aclocal.m4 revision 31637056
131637056Smrg# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
257ee1794Smrg
357ee1794Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
4a253d6aeSmrg
5a253d6aeSmrg# This file is free software; the Free Software Foundation
6a253d6aeSmrg# gives unlimited permission to copy and/or distribute it,
7a253d6aeSmrg# with or without modifications, as long as this notice is preserved.
8a253d6aeSmrg
9a253d6aeSmrg# This program is distributed in the hope that it will be useful,
10a253d6aeSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11a253d6aeSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12a253d6aeSmrg# PARTICULAR PURPOSE.
13a253d6aeSmrg
1457ee1794Smrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15ea133fd7Smrgm4_ifndef([AC_AUTOCONF_VERSION],
16ea133fd7Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1731637056Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
1831637056Smrg[m4_warning([this file was generated for autoconf 2.69.
19ea133fd7SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
20ea133fd7SmrgIf you have problems, you may need to regenerate the build system entirely.
2157ee1794SmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22a253d6aeSmrg
2331637056Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
24a253d6aeSmrg#
2531637056Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
2631637056Smrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
2731637056Smrg#                 Foundation, Inc.
2831637056Smrg#   Written by Gordon Matzigkeit, 1996
29a253d6aeSmrg#
3031637056Smrg# This file is free software; the Free Software Foundation gives
3131637056Smrg# unlimited permission to copy and/or distribute it, with or without
3231637056Smrg# modifications, as long as this notice is preserved.
33ea133fd7Smrg
3431637056Smrgm4_define([_LT_COPYING], [dnl
3531637056Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
3631637056Smrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
3731637056Smrg#                 Foundation, Inc.
3831637056Smrg#   Written by Gordon Matzigkeit, 1996
39a253d6aeSmrg#
4031637056Smrg#   This file is part of GNU Libtool.
41a253d6aeSmrg#
4231637056Smrg# GNU Libtool is free software; you can redistribute it and/or
4331637056Smrg# modify it under the terms of the GNU General Public License as
4431637056Smrg# published by the Free Software Foundation; either version 2 of
4531637056Smrg# the License, or (at your option) any later version.
46a253d6aeSmrg#
4731637056Smrg# As a special exception to the GNU General Public License,
4831637056Smrg# if you distribute this file as part of a program or library that
4931637056Smrg# is built using GNU Libtool, you may include this file under the
5031637056Smrg# same distribution terms that you use for the rest of that program.
51a253d6aeSmrg#
5231637056Smrg# GNU Libtool is distributed in the hope that it will be useful,
5331637056Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
5431637056Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5531637056Smrg# GNU General Public License for more details.
56a253d6aeSmrg#
5731637056Smrg# You should have received a copy of the GNU General Public License
5831637056Smrg# along with GNU Libtool; see the file COPYING.  If not, a copy
5931637056Smrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
6031637056Smrg# obtained by writing to the Free Software Foundation, Inc.,
6131637056Smrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
62ea133fd7Smrg])
63a253d6aeSmrg
6431637056Smrg# serial 57 LT_INIT
65a253d6aeSmrg
66a253d6aeSmrg
6731637056Smrg# LT_PREREQ(VERSION)
6831637056Smrg# ------------------
6931637056Smrg# Complain and exit if this libtool version is less that VERSION.
7031637056Smrgm4_defun([LT_PREREQ],
7131637056Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
7231637056Smrg       [m4_default([$3],
7331637056Smrg		   [m4_fatal([Libtool version $1 or higher is required],
7431637056Smrg		             63)])],
7531637056Smrg       [$2])])
76a253d6aeSmrg
77a253d6aeSmrg
7831637056Smrg# _LT_CHECK_BUILDDIR
7931637056Smrg# ------------------
8031637056Smrg# Complain if the absolute build directory name contains unusual characters
8131637056Smrgm4_defun([_LT_CHECK_BUILDDIR],
8231637056Smrg[case `pwd` in
8331637056Smrg  *\ * | *\	*)
8431637056Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
8531637056Smrgesac
8631637056Smrg])
87a253d6aeSmrg
88ea133fd7Smrg
8931637056Smrg# LT_INIT([OPTIONS])
9031637056Smrg# ------------------
9131637056SmrgAC_DEFUN([LT_INIT],
9231637056Smrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
9331637056SmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
9431637056SmrgAC_BEFORE([$0], [LT_LANG])dnl
9531637056SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
9631637056SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
9731637056Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
98ea133fd7Smrg
9931637056Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
10031637056Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
10131637056Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
10231637056Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
10331637056Smrgdnl unless we require an AC_DEFUNed macro:
10431637056SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
10531637056SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
10631637056SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
10731637056SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
10831637056Smrgm4_require([_LT_PROG_LTMAIN])dnl
109ea133fd7Smrg
11031637056Smrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
111ea133fd7Smrg
11231637056Smrgdnl Parse OPTIONS
11331637056Smrg_LT_SET_OPTIONS([$0], [$1])
114a253d6aeSmrg
11531637056Smrg# This can be used to rebuild libtool when needed
11631637056SmrgLIBTOOL_DEPS="$ltmain"
117a253d6aeSmrg
11831637056Smrg# Always use our own libtool.
11931637056SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
12031637056SmrgAC_SUBST(LIBTOOL)dnl
121a253d6aeSmrg
12231637056Smrg_LT_SETUP
123a253d6aeSmrg
12431637056Smrg# Only expand once:
12531637056Smrgm4_define([LT_INIT])
12631637056Smrg])# LT_INIT
127a253d6aeSmrg
12831637056Smrg# Old names:
12931637056SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
13031637056SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
13131637056Smrgdnl aclocal-1.4 backwards compatibility:
13231637056Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
13331637056Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
134a253d6aeSmrg
135a253d6aeSmrg
13631637056Smrg# _LT_CC_BASENAME(CC)
13731637056Smrg# -------------------
13831637056Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
13931637056Smrgm4_defun([_LT_CC_BASENAME],
14031637056Smrg[for cc_temp in $1""; do
14131637056Smrg  case $cc_temp in
14231637056Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
14331637056Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
14431637056Smrg    \-*) ;;
14531637056Smrg    *) break;;
14631637056Smrg  esac
14731637056Smrgdone
14831637056Smrgcc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
14925b89263Smrg])
150a253d6aeSmrg
151a253d6aeSmrg
15231637056Smrg# _LT_FILEUTILS_DEFAULTS
15331637056Smrg# ----------------------
15431637056Smrg# It is okay to use these file commands and assume they have been set
15531637056Smrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
15631637056Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
15731637056Smrg[: ${CP="cp -f"}
15831637056Smrg: ${MV="mv -f"}
15931637056Smrg: ${RM="rm -f"}
16031637056Smrg])# _LT_FILEUTILS_DEFAULTS
161a253d6aeSmrg
162ea133fd7Smrg
16331637056Smrg# _LT_SETUP
16431637056Smrg# ---------
16531637056Smrgm4_defun([_LT_SETUP],
16631637056Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
16731637056SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
16831637056SmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
16931637056SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
170ea133fd7Smrg
17131637056Smrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
17231637056Smrgdnl
17331637056Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
17431637056Smrg_LT_DECL([], [host], [0])dnl
17531637056Smrg_LT_DECL([], [host_os], [0])dnl
17631637056Smrgdnl
17731637056Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
17831637056Smrg_LT_DECL([], [build], [0])dnl
17931637056Smrg_LT_DECL([], [build_os], [0])dnl
18031637056Smrgdnl
18131637056SmrgAC_REQUIRE([AC_PROG_CC])dnl
18231637056SmrgAC_REQUIRE([LT_PATH_LD])dnl
18331637056SmrgAC_REQUIRE([LT_PATH_NM])dnl
18431637056Smrgdnl
18531637056SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
18631637056Smrgtest -z "$LN_S" && LN_S="ln -s"
18731637056Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
18831637056Smrgdnl
18931637056SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
19031637056Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
19131637056Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
19231637056Smrgdnl
19331637056Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
19431637056Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
19531637056Smrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
19631637056Smrgm4_require([_LT_CMD_RELOAD])dnl
19731637056Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
19831637056Smrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
19931637056Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
20031637056Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
20131637056Smrgm4_require([_LT_WITH_SYSROOT])dnl
202ea133fd7Smrg
20331637056Smrg_LT_CONFIG_LIBTOOL_INIT([
20431637056Smrg# See if we are running on zsh, and set the options which allow our
20531637056Smrg# commands through without removal of \ escapes INIT.
20631637056Smrgif test -n "\${ZSH_VERSION+set}" ; then
20731637056Smrg   setopt NO_GLOB_SUBST
20831637056Smrgfi
209a253d6aeSmrg])
21031637056Smrgif test -n "${ZSH_VERSION+set}" ; then
21131637056Smrg   setopt NO_GLOB_SUBST
21231637056Smrgfi
213ea133fd7Smrg
21431637056Smrg_LT_CHECK_OBJDIR
215ea133fd7Smrg
21631637056Smrgm4_require([_LT_TAG_COMPILER])dnl
217a253d6aeSmrg
21831637056Smrgcase $host_os in
21931637056Smrgaix3*)
22031637056Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
22131637056Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
22231637056Smrg  # vanish in a puff of smoke.
22331637056Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
22431637056Smrg    COLLECT_NAMES=
22531637056Smrg    export COLLECT_NAMES
22625b89263Smrg  fi
22731637056Smrg  ;;
22831637056Smrgesac
229a253d6aeSmrg
23031637056Smrg# Global variables:
23131637056Smrgofile=libtool
23231637056Smrgcan_build_shared=yes
233a253d6aeSmrg
23431637056Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
23531637056Smrg# which needs '.lib').
23631637056Smrglibext=a
237a253d6aeSmrg
23831637056Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
239a253d6aeSmrg
24031637056Smrgold_CC="$CC"
24131637056Smrgold_CFLAGS="$CFLAGS"
242a253d6aeSmrg
24331637056Smrg# Set sane defaults for various variables
24431637056Smrgtest -z "$CC" && CC=cc
24531637056Smrgtest -z "$LTCC" && LTCC=$CC
24631637056Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
24731637056Smrgtest -z "$LD" && LD=ld
24831637056Smrgtest -z "$ac_objext" && ac_objext=o
249a253d6aeSmrg
25031637056Smrg_LT_CC_BASENAME([$compiler])
251a253d6aeSmrg
25231637056Smrg# Only perform the check for file, if the check method requires it
25331637056Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
25431637056Smrgcase $deplibs_check_method in
25531637056Smrgfile_magic*)
25631637056Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
25731637056Smrg    _LT_PATH_MAGIC
25831637056Smrg  fi
25931637056Smrg  ;;
26031637056Smrgesac
261a253d6aeSmrg
26231637056Smrg# Use C for the default configuration in the libtool script
26331637056SmrgLT_SUPPORTED_TAG([CC])
26431637056Smrg_LT_LANG_C_CONFIG
26531637056Smrg_LT_LANG_DEFAULT_CONFIG
26631637056Smrg_LT_CONFIG_COMMANDS
26731637056Smrg])# _LT_SETUP
268a253d6aeSmrg
269a253d6aeSmrg
27031637056Smrg# _LT_PREPARE_SED_QUOTE_VARS
27131637056Smrg# --------------------------
27231637056Smrg# Define a few sed substitution that help us do robust quoting.
27331637056Smrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
27431637056Smrg[# Backslashify metacharacters that are still active within
27531637056Smrg# double-quoted strings.
27631637056Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
277a253d6aeSmrg
27831637056Smrg# Same as above, but do not quote variable references.
27931637056Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
280a253d6aeSmrg
28131637056Smrg# Sed substitution to delay expansion of an escaped shell variable in a
28231637056Smrg# double_quote_subst'ed string.
28331637056Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
284a253d6aeSmrg
28531637056Smrg# Sed substitution to delay expansion of an escaped single quote.
28631637056Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
28725b89263Smrg
28831637056Smrg# Sed substitution to avoid accidental globbing in evaled expressions
28931637056Smrgno_glob_subst='s/\*/\\\*/g'
29031637056Smrg])
291a253d6aeSmrg
29231637056Smrg# _LT_PROG_LTMAIN
29331637056Smrg# ---------------
29431637056Smrg# Note that this code is called both from `configure', and `config.status'
29531637056Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
29631637056Smrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
29731637056Smrg# so we pass a copy along to make sure it has a sensible value anyway.
29831637056Smrgm4_defun([_LT_PROG_LTMAIN],
29931637056Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
30031637056Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
30131637056Smrgltmain="$ac_aux_dir/ltmain.sh"
30231637056Smrg])# _LT_PROG_LTMAIN
303ea133fd7Smrg
304ea133fd7Smrg
305ea133fd7Smrg
30631637056Smrg# So that we can recreate a full libtool script including additional
30731637056Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
30831637056Smrg# in macros and then make a single call at the end using the `libtool'
30931637056Smrg# label.
31031637056Smrg
31131637056Smrg
31231637056Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
31331637056Smrg# ----------------------------------------
31431637056Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
31531637056Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
31631637056Smrg[m4_ifval([$1],
31731637056Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
31831637056Smrg                     [$1
31931637056Smrg])])])
32031637056Smrg
32131637056Smrg# Initialize.
32231637056Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
32331637056Smrg
32431637056Smrg
32531637056Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
326a253d6aeSmrg# ------------------------------
32731637056Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
32831637056Smrgm4_define([_LT_CONFIG_LIBTOOL],
32931637056Smrg[m4_ifval([$1],
33031637056Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
33131637056Smrg                     [$1
33231637056Smrg])])])
333ea133fd7Smrg
33431637056Smrg# Initialize.
33531637056Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
33631637056Smrg
33731637056Smrg
33831637056Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
33931637056Smrg# -----------------------------------------------------
34031637056Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
34131637056Smrg[_LT_CONFIG_LIBTOOL([$1])
34231637056Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
34325b89263Smrg])
344ea133fd7Smrg
345a253d6aeSmrg
34631637056Smrg# _LT_FORMAT_COMMENT([COMMENT])
34731637056Smrg# -----------------------------
34831637056Smrg# Add leading comment marks to the start of each line, and a trailing
34931637056Smrg# full-stop to the whole comment if one is not present already.
35031637056Smrgm4_define([_LT_FORMAT_COMMENT],
35131637056Smrg[m4_ifval([$1], [
35231637056Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
35331637056Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
35431637056Smrg)])
355ea133fd7Smrg
356a253d6aeSmrg
357a253d6aeSmrg
358a253d6aeSmrg
359a253d6aeSmrg
36031637056Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
36131637056Smrg# -------------------------------------------------------------------
36231637056Smrg# CONFIGNAME is the name given to the value in the libtool script.
36331637056Smrg# VARNAME is the (base) name used in the configure script.
36431637056Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
36531637056Smrg# VARNAME.  Any other value will be used directly.
36631637056Smrgm4_define([_LT_DECL],
36731637056Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
36831637056Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
36931637056Smrg	[m4_ifval([$1], [$1], [$2])])
37031637056Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
37131637056Smrg    m4_ifval([$4],
37231637056Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
37331637056Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
37431637056Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
37531637056Smrg])
376a253d6aeSmrg
377a253d6aeSmrg
37831637056Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
37931637056Smrg# --------------------------------------------------------
38031637056Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
381ea133fd7Smrg
38257ee1794Smrg
38331637056Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
38431637056Smrg# ------------------------------------------------
38531637056Smrgm4_define([lt_decl_tag_varnames],
38631637056Smrg[_lt_decl_filter([tagged?], [yes], $@)])
38731637056Smrg
38831637056Smrg
38931637056Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
39031637056Smrg# ---------------------------------------------------------
39131637056Smrgm4_define([_lt_decl_filter],
39231637056Smrg[m4_case([$#],
39331637056Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
39431637056Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
39531637056Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
39631637056Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
39731637056Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
39857ee1794Smrg])
399ea133fd7Smrg
400a253d6aeSmrg
40131637056Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
40231637056Smrg# --------------------------------------------------
40331637056Smrgm4_define([lt_decl_quote_varnames],
40431637056Smrg[_lt_decl_filter([value], [1], $@)])
40531637056Smrg
40631637056Smrg
40731637056Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
40831637056Smrg# ---------------------------------------------------
40931637056Smrgm4_define([lt_decl_dquote_varnames],
41031637056Smrg[_lt_decl_filter([value], [2], $@)])
41131637056Smrg
41231637056Smrg
41331637056Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
41431637056Smrg# ---------------------------------------------------
41531637056Smrgm4_define([lt_decl_varnames_tagged],
41631637056Smrg[m4_assert([$# <= 2])dnl
41731637056Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
41831637056Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
41931637056Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
42031637056Smrgm4_define([_lt_decl_varnames_tagged],
42131637056Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
42231637056Smrg
42331637056Smrg
42431637056Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
42531637056Smrg# ------------------------------------------------
42631637056Smrgm4_define([lt_decl_all_varnames],
42731637056Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
42831637056Smrg     m4_if([$2], [],
42931637056Smrg	   m4_quote(lt_decl_varnames),
43031637056Smrg	m4_quote(m4_shift($@))))[]dnl
43157ee1794Smrg])
43231637056Smrgm4_define([_lt_decl_all_varnames],
43331637056Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
43431637056Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
43525b89263Smrg])
436a253d6aeSmrg
437ea133fd7Smrg
43831637056Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
43931637056Smrg# ------------------------------------
44031637056Smrg# Quote a variable value, and forward it to `config.status' so that its
44131637056Smrg# declaration there will have the same value as in `configure'.  VARNAME
44231637056Smrg# must have a single quote delimited value for this to work.
44331637056Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
44431637056Smrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
445a253d6aeSmrg
446a253d6aeSmrg
44731637056Smrg# _LT_CONFIG_STATUS_DECLARATIONS
44831637056Smrg# ------------------------------
44931637056Smrg# We delimit libtool config variables with single quotes, so when
45031637056Smrg# we write them to config.status, we have to be sure to quote all
45131637056Smrg# embedded single quotes properly.  In configure, this macro expands
45231637056Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
45331637056Smrg#
45431637056Smrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
45531637056Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
45631637056Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
45731637056Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
458a253d6aeSmrg
459a253d6aeSmrg
46031637056Smrg# _LT_LIBTOOL_TAGS
46131637056Smrg# ----------------
46231637056Smrg# Output comment and list of tags supported by the script
46331637056Smrgm4_defun([_LT_LIBTOOL_TAGS],
46431637056Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
46531637056Smrgavailable_tags="_LT_TAGS"dnl
46631637056Smrg])
467a253d6aeSmrg
468a253d6aeSmrg
46931637056Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
47031637056Smrg# -----------------------------------
47131637056Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
47231637056Smrg# expand to a commented shell variable setting:
47306f32fbeSmrg#
47431637056Smrg#    # Some comment about what VAR is for.
47531637056Smrg#    visible_name=$lt_internal_name
47631637056Smrgm4_define([_LT_LIBTOOL_DECLARE],
47731637056Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
47831637056Smrg					   [description])))[]dnl
47931637056Smrgm4_pushdef([_libtool_name],
48031637056Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
48131637056Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
48231637056Smrg    [0], [_libtool_name=[$]$1],
48331637056Smrg    [1], [_libtool_name=$lt_[]$1],
48431637056Smrg    [2], [_libtool_name=$lt_[]$1],
48531637056Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
48631637056Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
48731637056Smrg])
488a253d6aeSmrg
489a253d6aeSmrg
49031637056Smrg# _LT_LIBTOOL_CONFIG_VARS
49131637056Smrg# -----------------------
49231637056Smrg# Produce commented declarations of non-tagged libtool config variables
49331637056Smrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
49431637056Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
49531637056Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
49631637056Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
49731637056Smrg[m4_foreach([_lt_var],
49831637056Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
49931637056Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
50057ee1794Smrg
501a253d6aeSmrg
50231637056Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
50331637056Smrg# -------------------------
50431637056Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
50531637056Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
50631637056Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
507a253d6aeSmrg
508a253d6aeSmrg
50931637056Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
51031637056Smrg# ------------------------------
51131637056Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
512a253d6aeSmrg
51325b89263Smrg
51431637056Smrg# _LT_CONFIG_COMMANDS
51531637056Smrg# -------------------
51631637056Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
51731637056Smrg# variables for single and double quote escaping we saved from calls
51831637056Smrg# to _LT_DECL, we can put quote escaped variables declarations
51931637056Smrg# into `config.status', and then the shell code to quote escape them in
52031637056Smrg# for loops in `config.status'.  Finally, any additional code accumulated
52131637056Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
52231637056Smrgm4_defun([_LT_CONFIG_COMMANDS],
52331637056Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
52431637056Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
52531637056Smrg	dnl instead of duplicating it all over again into config.status,
52631637056Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
52731637056Smrg	dnl needs to know what name is stored there:
52831637056Smrg        [AC_CONFIG_COMMANDS([libtool],
52931637056Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
53031637056Smrg    dnl If the libtool generation code is destined for config.status,
53131637056Smrg    dnl expand the accumulated commands and init code now:
53231637056Smrg    [AC_CONFIG_COMMANDS([libtool],
53331637056Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
53431637056Smrg])#_LT_CONFIG_COMMANDS
53506f32fbeSmrg
536ea133fd7Smrg
53731637056Smrg# Initialize.
53831637056Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
53931637056Smrg[
540ea133fd7Smrg
54131637056Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
54231637056Smrg# if CDPATH is set.
54331637056Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
544ea133fd7Smrg
54531637056Smrgsed_quote_subst='$sed_quote_subst'
54631637056Smrgdouble_quote_subst='$double_quote_subst'
54731637056Smrgdelay_variable_subst='$delay_variable_subst'
54831637056Smrg_LT_CONFIG_STATUS_DECLARATIONS
54931637056SmrgLTCC='$LTCC'
55031637056SmrgLTCFLAGS='$LTCFLAGS'
55131637056Smrgcompiler='$compiler_DEFAULT'
552a253d6aeSmrg
55331637056Smrg# A function that is used when there is no print builtin or printf.
55431637056Smrgfunc_fallback_echo ()
55531637056Smrg{
55631637056Smrg  eval 'cat <<_LTECHO_EOF
55731637056Smrg\$[]1
55831637056Smrg_LTECHO_EOF'
55931637056Smrg}
560a253d6aeSmrg
56131637056Smrg# Quote evaled strings.
56231637056Smrgfor var in lt_decl_all_varnames([[ \
56331637056Smrg]], lt_decl_quote_varnames); do
56431637056Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
56531637056Smrg    *[[\\\\\\\`\\"\\\$]]*)
56631637056Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
56731637056Smrg      ;;
56831637056Smrg    *)
56931637056Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
57031637056Smrg      ;;
57131637056Smrg    esac
57231637056Smrgdone
573a253d6aeSmrg
57431637056Smrg# Double-quote double-evaled strings.
57531637056Smrgfor var in lt_decl_all_varnames([[ \
57631637056Smrg]], lt_decl_dquote_varnames); do
57731637056Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
57831637056Smrg    *[[\\\\\\\`\\"\\\$]]*)
57931637056Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
58031637056Smrg      ;;
58131637056Smrg    *)
58231637056Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
58331637056Smrg      ;;
58431637056Smrg    esac
58531637056Smrgdone
586a253d6aeSmrg
58731637056Smrg_LT_OUTPUT_LIBTOOL_INIT
58806f32fbeSmrg])
589a253d6aeSmrg
59031637056Smrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
59131637056Smrg# ------------------------------------
59231637056Smrg# Generate a child script FILE with all initialization necessary to
59331637056Smrg# reuse the environment learned by the parent script, and make the
59431637056Smrg# file executable.  If COMMENT is supplied, it is inserted after the
59531637056Smrg# `#!' sequence but before initialization text begins.  After this
59631637056Smrg# macro, additional text can be appended to FILE to form the body of
59731637056Smrg# the child script.  The macro ends with non-zero status if the
59831637056Smrg# file could not be fully written (such as if the disk is full).
59931637056Smrgm4_ifdef([AS_INIT_GENERATED],
60031637056Smrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
60131637056Smrg[m4_defun([_LT_GENERATED_FILE_INIT],
60231637056Smrg[m4_require([AS_PREPARE])]dnl
60331637056Smrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
60431637056Smrg[lt_write_fail=0
60531637056Smrgcat >$1 <<_ASEOF || lt_write_fail=1
60631637056Smrg#! $SHELL
60731637056Smrg# Generated by $as_me.
60831637056Smrg$2
60931637056SmrgSHELL=\${CONFIG_SHELL-$SHELL}
61031637056Smrgexport SHELL
61131637056Smrg_ASEOF
61231637056Smrgcat >>$1 <<\_ASEOF || lt_write_fail=1
61331637056SmrgAS_SHELL_SANITIZE
61431637056Smrg_AS_PREPARE
61531637056Smrgexec AS_MESSAGE_FD>&1
61631637056Smrg_ASEOF
61731637056Smrgtest $lt_write_fail = 0 && chmod +x $1[]dnl
61831637056Smrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
619a253d6aeSmrg
62031637056Smrg# LT_OUTPUT
62131637056Smrg# ---------
62231637056Smrg# This macro allows early generation of the libtool script (before
62331637056Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
62431637056Smrg# tests.
62531637056SmrgAC_DEFUN([LT_OUTPUT],
62631637056Smrg[: ${CONFIG_LT=./config.lt}
62731637056SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
62831637056Smrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
62931637056Smrg[# Run this file to recreate a libtool stub with the current configuration.])
630a253d6aeSmrg
63131637056Smrgcat >>"$CONFIG_LT" <<\_LTEOF
63231637056Smrglt_cl_silent=false
63331637056Smrgexec AS_MESSAGE_LOG_FD>>config.log
63431637056Smrg{
63531637056Smrg  echo
63631637056Smrg  AS_BOX([Running $as_me.])
63731637056Smrg} >&AS_MESSAGE_LOG_FD
638a253d6aeSmrg
63931637056Smrglt_cl_help="\
64031637056Smrg\`$as_me' creates a local libtool stub from the current configuration,
64131637056Smrgfor use in further configure time tests before the real libtool is
64231637056Smrggenerated.
643a253d6aeSmrg
64431637056SmrgUsage: $[0] [[OPTIONS]]
645a253d6aeSmrg
64631637056Smrg  -h, --help      print this help, then exit
64731637056Smrg  -V, --version   print version number, then exit
64831637056Smrg  -q, --quiet     do not print progress messages
64931637056Smrg  -d, --debug     don't remove temporary files
650a253d6aeSmrg
65131637056SmrgReport bugs to <bug-libtool@gnu.org>."
652a253d6aeSmrg
65331637056Smrglt_cl_version="\
65431637056Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
65531637056Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
65631637056Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
657a253d6aeSmrg
65831637056SmrgCopyright (C) 2011 Free Software Foundation, Inc.
65931637056SmrgThis config.lt script is free software; the Free Software Foundation
66031637056Smrggives unlimited permision to copy, distribute and modify it."
661a253d6aeSmrg
66231637056Smrgwhile test $[#] != 0
66331637056Smrgdo
66431637056Smrg  case $[1] in
66531637056Smrg    --version | --v* | -V )
66631637056Smrg      echo "$lt_cl_version"; exit 0 ;;
66731637056Smrg    --help | --h* | -h )
66831637056Smrg      echo "$lt_cl_help"; exit 0 ;;
66931637056Smrg    --debug | --d* | -d )
67031637056Smrg      debug=: ;;
67131637056Smrg    --quiet | --q* | --silent | --s* | -q )
67231637056Smrg      lt_cl_silent=: ;;
673a253d6aeSmrg
67431637056Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
67531637056SmrgTry \`$[0] --help' for more information.]) ;;
676a253d6aeSmrg
67731637056Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
67831637056SmrgTry \`$[0] --help' for more information.]) ;;
67906f32fbeSmrg  esac
68031637056Smrg  shift
68106f32fbeSmrgdone
682a253d6aeSmrg
68331637056Smrgif $lt_cl_silent; then
68431637056Smrg  exec AS_MESSAGE_FD>/dev/null
68531637056Smrgfi
68631637056Smrg_LTEOF
687a253d6aeSmrg
68831637056Smrgcat >>"$CONFIG_LT" <<_LTEOF
68931637056Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
69031637056Smrg_LTEOF
691a253d6aeSmrg
69231637056Smrgcat >>"$CONFIG_LT" <<\_LTEOF
69331637056SmrgAC_MSG_NOTICE([creating $ofile])
69431637056Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
69531637056SmrgAS_EXIT(0)
69631637056Smrg_LTEOF
69731637056Smrgchmod +x "$CONFIG_LT"
698a253d6aeSmrg
69931637056Smrg# configure is writing to config.log, but config.lt does its own redirection,
70031637056Smrg# appending to config.log, which fails on DOS, as config.log is still kept
70131637056Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
70231637056Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
70331637056Smrglt_cl_success=:
70431637056Smrgtest "$silent" = yes &&
70531637056Smrg  lt_config_lt_args="$lt_config_lt_args --quiet"
70631637056Smrgexec AS_MESSAGE_LOG_FD>/dev/null
70731637056Smrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
70831637056Smrgexec AS_MESSAGE_LOG_FD>>config.log
70931637056Smrg$lt_cl_success || AS_EXIT(1)
71031637056Smrg])# LT_OUTPUT
71125b89263Smrg
71206f32fbeSmrg
71331637056Smrg# _LT_CONFIG(TAG)
71431637056Smrg# ---------------
71531637056Smrg# If TAG is the built-in tag, create an initial libtool script with a
71631637056Smrg# default configuration from the untagged config vars.  Otherwise add code
71731637056Smrg# to config.status for appending the configuration named by TAG from the
71831637056Smrg# matching tagged config vars.
71931637056Smrgm4_defun([_LT_CONFIG],
72031637056Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
72131637056Smrg_LT_CONFIG_SAVE_COMMANDS([
72231637056Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
72331637056Smrg  m4_if(_LT_TAG, [C], [
72431637056Smrg    # See if we are running on zsh, and set the options which allow our
72531637056Smrg    # commands through without removal of \ escapes.
72631637056Smrg    if test -n "${ZSH_VERSION+set}" ; then
72731637056Smrg      setopt NO_GLOB_SUBST
72831637056Smrg    fi
729a253d6aeSmrg
73031637056Smrg    cfgfile="${ofile}T"
73131637056Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
73231637056Smrg    $RM "$cfgfile"
733a253d6aeSmrg
73431637056Smrg    cat <<_LT_EOF >> "$cfgfile"
73531637056Smrg#! $SHELL
73625b89263Smrg
73731637056Smrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
73831637056Smrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
73931637056Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
74031637056Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
74131637056Smrg#
74231637056Smrg_LT_COPYING
74331637056Smrg_LT_LIBTOOL_TAGS
74425b89263Smrg
74531637056Smrg# ### BEGIN LIBTOOL CONFIG
74631637056Smrg_LT_LIBTOOL_CONFIG_VARS
74731637056Smrg_LT_LIBTOOL_TAG_VARS
74831637056Smrg# ### END LIBTOOL CONFIG
749a253d6aeSmrg
75031637056Smrg_LT_EOF
75125b89263Smrg
75231637056Smrg  case $host_os in
75331637056Smrg  aix3*)
75431637056Smrg    cat <<\_LT_EOF >> "$cfgfile"
75531637056Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
75631637056Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
75731637056Smrg# vanish in a puff of smoke.
75831637056Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
75931637056Smrg  COLLECT_NAMES=
76031637056Smrg  export COLLECT_NAMES
76131637056Smrgfi
76231637056Smrg_LT_EOF
76331637056Smrg    ;;
76431637056Smrg  esac
765a253d6aeSmrg
76631637056Smrg  _LT_PROG_LTMAIN
76725b89263Smrg
76831637056Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
76931637056Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
77031637056Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
77131637056Smrg  # is reportedly fixed, but why not run on old versions too?
77231637056Smrg  sed '$q' "$ltmain" >> "$cfgfile" \
77331637056Smrg     || (rm -f "$cfgfile"; exit 1)
774a253d6aeSmrg
77531637056Smrg  _LT_PROG_REPLACE_SHELLFNS
776a253d6aeSmrg
77731637056Smrg   mv -f "$cfgfile" "$ofile" ||
77831637056Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
77931637056Smrg  chmod +x "$ofile"
78031637056Smrg],
78131637056Smrg[cat <<_LT_EOF >> "$ofile"
782a253d6aeSmrg
78331637056Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
78431637056Smrgdnl in a comment (ie after a #).
78531637056Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
78631637056Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
78731637056Smrg# ### END LIBTOOL TAG CONFIG: $1
78831637056Smrg_LT_EOF
78931637056Smrg])dnl /m4_if
79031637056Smrg],
79131637056Smrg[m4_if([$1], [], [
79231637056Smrg    PACKAGE='$PACKAGE'
79331637056Smrg    VERSION='$VERSION'
79431637056Smrg    TIMESTAMP='$TIMESTAMP'
79531637056Smrg    RM='$RM'
79631637056Smrg    ofile='$ofile'], [])
79731637056Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
79831637056Smrg])# _LT_CONFIG
799a253d6aeSmrg
80025b89263Smrg
80131637056Smrg# LT_SUPPORTED_TAG(TAG)
80231637056Smrg# ---------------------
80331637056Smrg# Trace this macro to discover what tags are supported by the libtool
80431637056Smrg# --tag option, using:
80531637056Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
80631637056SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
807a253d6aeSmrg
80825b89263Smrg
80931637056Smrg# C support is built-in for now
81031637056Smrgm4_define([_LT_LANG_C_enabled], [])
81131637056Smrgm4_define([_LT_TAGS], [])
812a253d6aeSmrg
813a253d6aeSmrg
81431637056Smrg# LT_LANG(LANG)
81531637056Smrg# -------------
81631637056Smrg# Enable libtool support for the given language if not already enabled.
81731637056SmrgAC_DEFUN([LT_LANG],
81831637056Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
81931637056Smrgm4_case([$1],
82031637056Smrg  [C],			[_LT_LANG(C)],
82131637056Smrg  [C++],		[_LT_LANG(CXX)],
82231637056Smrg  [Go],			[_LT_LANG(GO)],
82331637056Smrg  [Java],		[_LT_LANG(GCJ)],
82431637056Smrg  [Fortran 77],		[_LT_LANG(F77)],
82531637056Smrg  [Fortran],		[_LT_LANG(FC)],
82631637056Smrg  [Windows Resource],	[_LT_LANG(RC)],
82731637056Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
82831637056Smrg    [_LT_LANG($1)],
82931637056Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
83031637056Smrg])# LT_LANG
831a253d6aeSmrg
832a253d6aeSmrg
83331637056Smrg# _LT_LANG(LANGNAME)
83431637056Smrg# ------------------
83531637056Smrgm4_defun([_LT_LANG],
83631637056Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
83731637056Smrg  [LT_SUPPORTED_TAG([$1])dnl
83831637056Smrg  m4_append([_LT_TAGS], [$1 ])dnl
83931637056Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
84031637056Smrg  _LT_LANG_$1_CONFIG($1)])dnl
84131637056Smrg])# _LT_LANG
842a253d6aeSmrg
843a253d6aeSmrg
84431637056Smrgm4_ifndef([AC_PROG_GO], [
84531637056Smrg# NOTE: This macro has been submitted for inclusion into   #
84631637056Smrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
84731637056Smrg#  a released version of Autoconf we should remove this    #
84831637056Smrg#  macro and use it instead.                               #
84931637056Smrgm4_defun([AC_PROG_GO],
85031637056Smrg[AC_LANG_PUSH(Go)dnl
85131637056SmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
85231637056SmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
85331637056Smrg_AC_ARG_VAR_LDFLAGS()dnl
85431637056SmrgAC_CHECK_TOOL(GOC, gccgo)
85531637056Smrgif test -z "$GOC"; then
85631637056Smrg  if test -n "$ac_tool_prefix"; then
85731637056Smrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
85831637056Smrg  fi
85931637056Smrgfi
86031637056Smrgif test -z "$GOC"; then
86131637056Smrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
86231637056Smrgfi
86331637056Smrg])#m4_defun
86431637056Smrg])#m4_ifndef
865a253d6aeSmrg
866a253d6aeSmrg
86731637056Smrg# _LT_LANG_DEFAULT_CONFIG
86831637056Smrg# -----------------------
86931637056Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
87031637056Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
87131637056Smrg  [LT_LANG(CXX)],
87231637056Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
873a253d6aeSmrg
87431637056SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
87531637056Smrg  [LT_LANG(F77)],
87631637056Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
877a253d6aeSmrg
87831637056SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
87931637056Smrg  [LT_LANG(FC)],
88031637056Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
881a253d6aeSmrg
88231637056Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
88331637056Smrgdnl pulling things in needlessly.
88431637056SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
88531637056Smrg  [LT_LANG(GCJ)],
88631637056Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
88731637056Smrg    [LT_LANG(GCJ)],
88831637056Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
88931637056Smrg      [LT_LANG(GCJ)],
89031637056Smrg      [m4_ifdef([AC_PROG_GCJ],
89131637056Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
89231637056Smrg       m4_ifdef([A][M_PROG_GCJ],
89331637056Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
89431637056Smrg       m4_ifdef([LT_PROG_GCJ],
89531637056Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
896a253d6aeSmrg
89731637056SmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
89831637056Smrg  [LT_LANG(GO)],
89931637056Smrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
900a253d6aeSmrg
90131637056SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
90231637056Smrg  [LT_LANG(RC)],
90331637056Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
90431637056Smrg])# _LT_LANG_DEFAULT_CONFIG
905a253d6aeSmrg
90631637056Smrg# Obsolete macros:
90731637056SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
90831637056SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
90931637056SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
91031637056SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
91131637056SmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
91231637056Smrgdnl aclocal-1.4 backwards compatibility:
91331637056Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
91431637056Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
91531637056Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
91631637056Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
91731637056Smrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
918a253d6aeSmrg
919a253d6aeSmrg
92031637056Smrg# _LT_TAG_COMPILER
92131637056Smrg# ----------------
92231637056Smrgm4_defun([_LT_TAG_COMPILER],
92331637056Smrg[AC_REQUIRE([AC_PROG_CC])dnl
924a253d6aeSmrg
92531637056Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
92631637056Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
92731637056Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
92831637056Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
929a253d6aeSmrg
93031637056Smrg# If no C compiler was specified, use CC.
93131637056SmrgLTCC=${LTCC-"$CC"}
93206f32fbeSmrg
93331637056Smrg# If no C compiler flags were specified, use CFLAGS.
93431637056SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
93506f32fbeSmrg
93631637056Smrg# Allow CC to be a program name with arguments.
93731637056Smrgcompiler=$CC
93831637056Smrg])# _LT_TAG_COMPILER
939a253d6aeSmrg
940a253d6aeSmrg
94131637056Smrg# _LT_COMPILER_BOILERPLATE
94231637056Smrg# ------------------------
94331637056Smrg# Check for compiler boilerplate output or warnings with
94431637056Smrg# the simple compiler test code.
94531637056Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
94631637056Smrg[m4_require([_LT_DECL_SED])dnl
94731637056Smrgac_outfile=conftest.$ac_objext
94831637056Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
94931637056Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
95031637056Smrg_lt_compiler_boilerplate=`cat conftest.err`
95131637056Smrg$RM conftest*
95231637056Smrg])# _LT_COMPILER_BOILERPLATE
953a253d6aeSmrg
954a253d6aeSmrg
95531637056Smrg# _LT_LINKER_BOILERPLATE
95631637056Smrg# ----------------------
95731637056Smrg# Check for linker boilerplate output or warnings with
95831637056Smrg# the simple link test code.
95931637056Smrgm4_defun([_LT_LINKER_BOILERPLATE],
96031637056Smrg[m4_require([_LT_DECL_SED])dnl
96131637056Smrgac_outfile=conftest.$ac_objext
96231637056Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
96331637056Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
96431637056Smrg_lt_linker_boilerplate=`cat conftest.err`
96531637056Smrg$RM -r conftest*
96631637056Smrg])# _LT_LINKER_BOILERPLATE
967a253d6aeSmrg
96831637056Smrg# _LT_REQUIRED_DARWIN_CHECKS
96931637056Smrg# -------------------------
97031637056Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
97131637056Smrg  case $host_os in
97231637056Smrg    rhapsody* | darwin*)
97331637056Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
97431637056Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
97531637056Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
97631637056Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
97731637056Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
97831637056Smrg    _LT_DECL([], [DSYMUTIL], [1],
97931637056Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
98031637056Smrg    _LT_DECL([], [NMEDIT], [1],
98131637056Smrg      [Tool to change global to local symbols on Mac OS X])
98231637056Smrg    _LT_DECL([], [LIPO], [1],
98331637056Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
98431637056Smrg    _LT_DECL([], [OTOOL], [1],
98531637056Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
98631637056Smrg    _LT_DECL([], [OTOOL64], [1],
98731637056Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
988a253d6aeSmrg
98931637056Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
99031637056Smrg      [lt_cv_apple_cc_single_mod=no
99131637056Smrg      if test -z "${LT_MULTI_MODULE}"; then
99231637056Smrg	# By default we will add the -single_module flag. You can override
99331637056Smrg	# by either setting the environment variable LT_MULTI_MODULE
99431637056Smrg	# non-empty at configure time, or by adding -multi_module to the
99531637056Smrg	# link flags.
99631637056Smrg	rm -rf libconftest.dylib*
99731637056Smrg	echo "int foo(void){return 1;}" > conftest.c
99831637056Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
99931637056Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
100031637056Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
100131637056Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
100231637056Smrg        _lt_result=$?
100331637056Smrg	# If there is a non-empty error log, and "single_module"
100431637056Smrg	# appears in it, assume the flag caused a linker warning
100531637056Smrg        if test -s conftest.err && $GREP single_module conftest.err; then
100631637056Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
100731637056Smrg	# Otherwise, if the output was created with a 0 exit code from
100831637056Smrg	# the compiler, it worked.
100931637056Smrg	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
101031637056Smrg	  lt_cv_apple_cc_single_mod=yes
101131637056Smrg	else
101231637056Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
101331637056Smrg	fi
101431637056Smrg	rm -rf libconftest.dylib*
101531637056Smrg	rm -f conftest.*
101631637056Smrg      fi])
1017a253d6aeSmrg
101831637056Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
101931637056Smrg      [lt_cv_ld_exported_symbols_list],
102031637056Smrg      [lt_cv_ld_exported_symbols_list=no
102131637056Smrg      save_LDFLAGS=$LDFLAGS
102231637056Smrg      echo "_main" > conftest.sym
102331637056Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
102431637056Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
102531637056Smrg	[lt_cv_ld_exported_symbols_list=yes],
102631637056Smrg	[lt_cv_ld_exported_symbols_list=no])
102731637056Smrg	LDFLAGS="$save_LDFLAGS"
102831637056Smrg    ])
1029a253d6aeSmrg
103031637056Smrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
103131637056Smrg      [lt_cv_ld_force_load=no
103231637056Smrg      cat > conftest.c << _LT_EOF
103331637056Smrgint forced_loaded() { return 2;}
103431637056Smrg_LT_EOF
103531637056Smrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
103631637056Smrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
103731637056Smrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
103831637056Smrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
103931637056Smrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
104031637056Smrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
104131637056Smrg      cat > conftest.c << _LT_EOF
104231637056Smrgint main() { return 0;}
104331637056Smrg_LT_EOF
104431637056Smrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
104531637056Smrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
104631637056Smrg      _lt_result=$?
104731637056Smrg      if test -s conftest.err && $GREP force_load conftest.err; then
104831637056Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
104931637056Smrg      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
105031637056Smrg	lt_cv_ld_force_load=yes
105131637056Smrg      else
105231637056Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
105331637056Smrg      fi
105431637056Smrg        rm -f conftest.err libconftest.a conftest conftest.c
105531637056Smrg        rm -rf conftest.dSYM
105631637056Smrg    ])
105731637056Smrg    case $host_os in
105831637056Smrg    rhapsody* | darwin1.[[012]])
105931637056Smrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
106031637056Smrg    darwin1.*)
106131637056Smrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
106231637056Smrg    darwin*) # darwin 5.x on
106331637056Smrg      # if running on 10.5 or later, the deployment target defaults
106431637056Smrg      # to the OS version, if on x86, and 10.4, the deployment
106531637056Smrg      # target defaults to 10.4. Don't you love it?
106631637056Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
106731637056Smrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
106831637056Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
106931637056Smrg	10.[[012]]*)
107031637056Smrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
107131637056Smrg	10.*)
107231637056Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
107331637056Smrg      esac
107431637056Smrg    ;;
107531637056Smrg  esac
107631637056Smrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
107731637056Smrg      _lt_dar_single_mod='$single_module'
107831637056Smrg    fi
107931637056Smrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
108031637056Smrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
108131637056Smrg    else
108231637056Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
108331637056Smrg    fi
108431637056Smrg    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
108531637056Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
108631637056Smrg    else
108731637056Smrg      _lt_dsymutil=
108831637056Smrg    fi
108931637056Smrg    ;;
109031637056Smrg  esac
109106f32fbeSmrg])
1092a253d6aeSmrg
1093a253d6aeSmrg
109431637056Smrg# _LT_DARWIN_LINKER_FEATURES([TAG])
109531637056Smrg# ---------------------------------
109631637056Smrg# Checks for linker and compiler features on darwin
109731637056Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
109831637056Smrg[
109931637056Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
110031637056Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
110131637056Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
110231637056Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
110331637056Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
110431637056Smrg  if test "$lt_cv_ld_force_load" = "yes"; then
110531637056Smrg    _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\"`'
110631637056Smrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
110731637056Smrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
110831637056Smrg  else
110931637056Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
111031637056Smrg  fi
111131637056Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
111231637056Smrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
111331637056Smrg  case $cc_basename in
111431637056Smrg     ifort*) _lt_dar_can_shared=yes ;;
111531637056Smrg     *) _lt_dar_can_shared=$GCC ;;
111631637056Smrg  esac
111731637056Smrg  if test "$_lt_dar_can_shared" = "yes"; then
111831637056Smrg    output_verbose_link_cmd=func_echo_all
111931637056Smrg    _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}"
112031637056Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
112131637056Smrg    _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}"
112231637056Smrg    _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}"
112331637056Smrg    m4_if([$1], [CXX],
112431637056Smrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
112531637056Smrg      _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}"
112631637056Smrg      _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}"
112731637056Smrg    fi
112831637056Smrg],[])
112931637056Smrg  else
113031637056Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
113131637056Smrg  fi
113206f32fbeSmrg])
1133a253d6aeSmrg
113431637056Smrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
113531637056Smrg# ----------------------------------
113631637056Smrg# Links a minimal program and checks the executable
113731637056Smrg# for the system default hardcoded library path. In most cases,
113831637056Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
113931637056Smrg# the location of the communication and MPI libs are included too.
114031637056Smrg# If we don't find anything, use the default library path according
114131637056Smrg# to the aix ld manual.
114231637056Smrg# Store the results from the different compilers for each TAGNAME.
114331637056Smrg# Allow to override them for all tags through lt_cv_aix_libpath.
114431637056Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
114531637056Smrg[m4_require([_LT_DECL_SED])dnl
114631637056Smrgif test "${lt_cv_aix_libpath+set}" = set; then
114731637056Smrg  aix_libpath=$lt_cv_aix_libpath
114831637056Smrgelse
114931637056Smrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
115031637056Smrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
115131637056Smrg  lt_aix_libpath_sed='[
115231637056Smrg      /Import File Strings/,/^$/ {
115331637056Smrg	  /^0/ {
115431637056Smrg	      s/^0  *\([^ ]*\) *$/\1/
115531637056Smrg	      p
115631637056Smrg	  }
115731637056Smrg      }]'
115831637056Smrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
115931637056Smrg  # Check for a 64-bit object if we didn't find anything.
116031637056Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
116131637056Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
116231637056Smrg  fi],[])
116331637056Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
116431637056Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
116531637056Smrg  fi
116631637056Smrg  ])
116731637056Smrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
116831637056Smrgfi
116931637056Smrg])# _LT_SYS_MODULE_PATH_AIX
1170ea133fd7Smrg
1171a253d6aeSmrg
117231637056Smrg# _LT_SHELL_INIT(ARG)
117331637056Smrg# -------------------
117431637056Smrgm4_define([_LT_SHELL_INIT],
117531637056Smrg[m4_divert_text([M4SH-INIT], [$1
117631637056Smrg])])# _LT_SHELL_INIT
1177a253d6aeSmrg
1178a253d6aeSmrg
1179a253d6aeSmrg
118031637056Smrg# _LT_PROG_ECHO_BACKSLASH
118131637056Smrg# -----------------------
118231637056Smrg# Find how we can fake an echo command that does not interpret backslash.
118331637056Smrg# In particular, with Autoconf 2.60 or later we add some code to the start
118431637056Smrg# of the generated configure script which will find a shell with a builtin
118531637056Smrg# printf (which we can use as an echo command).
118631637056Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
118731637056Smrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
118831637056SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
118931637056SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1190ea133fd7Smrg
119131637056SmrgAC_MSG_CHECKING([how to print strings])
119231637056Smrg# Test print first, because it will be a builtin if present.
119331637056Smrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
119431637056Smrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
119531637056Smrg  ECHO='print -r --'
119631637056Smrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
119731637056Smrg  ECHO='printf %s\n'
119831637056Smrgelse
119931637056Smrg  # Use this function as a fallback that always works.
120031637056Smrg  func_fallback_echo ()
120131637056Smrg  {
120231637056Smrg    eval 'cat <<_LTECHO_EOF
120331637056Smrg$[]1
120431637056Smrg_LTECHO_EOF'
120531637056Smrg  }
120631637056Smrg  ECHO='func_fallback_echo'
120731637056Smrgfi
1208ea133fd7Smrg
120931637056Smrg# func_echo_all arg...
121031637056Smrg# Invoke $ECHO with all args, space-separated.
121131637056Smrgfunc_echo_all ()
121231637056Smrg{
121331637056Smrg    $ECHO "$*" 
121431637056Smrg}
1215ea133fd7Smrg
121631637056Smrgcase "$ECHO" in
121731637056Smrg  printf*) AC_MSG_RESULT([printf]) ;;
121831637056Smrg  print*) AC_MSG_RESULT([print -r]) ;;
121931637056Smrg  *) AC_MSG_RESULT([cat]) ;;
122031637056Smrgesac
1221ea133fd7Smrg
122231637056Smrgm4_ifdef([_AS_DETECT_SUGGESTED],
122331637056Smrg[_AS_DETECT_SUGGESTED([
122431637056Smrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
122531637056Smrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
122631637056Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
122731637056Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
122831637056Smrg    PATH=/empty FPATH=/empty; export PATH FPATH
122931637056Smrg    test "X`printf %s $ECHO`" = "X$ECHO" \
123031637056Smrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
1231a253d6aeSmrg
123231637056Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
123331637056Smrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
123431637056Smrg])# _LT_PROG_ECHO_BACKSLASH
1235a253d6aeSmrg
123625b89263Smrg
123731637056Smrg# _LT_WITH_SYSROOT
123831637056Smrg# ----------------
123931637056SmrgAC_DEFUN([_LT_WITH_SYSROOT],
124031637056Smrg[AC_MSG_CHECKING([for sysroot])
124131637056SmrgAC_ARG_WITH([sysroot],
124231637056Smrg[  --with-sysroot[=DIR] Search for dependent libraries within DIR
124331637056Smrg                        (or the compiler's sysroot if not specified).],
124431637056Smrg[], [with_sysroot=no])
124525b89263Smrg
124631637056Smrgdnl lt_sysroot will always be passed unquoted.  We quote it here
124731637056Smrgdnl in case the user passed a directory name.
124831637056Smrglt_sysroot=
124931637056Smrgcase ${with_sysroot} in #(
125031637056Smrg yes)
125131637056Smrg   if test "$GCC" = yes; then
125231637056Smrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
125331637056Smrg   fi
125431637056Smrg   ;; #(
125531637056Smrg /*)
125631637056Smrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
125731637056Smrg   ;; #(
125831637056Smrg no|'')
125931637056Smrg   ;; #(
126031637056Smrg *)
126131637056Smrg   AC_MSG_RESULT([${with_sysroot}])
126231637056Smrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
126331637056Smrg   ;;
126431637056Smrgesac
126525b89263Smrg
126631637056Smrg AC_MSG_RESULT([${lt_sysroot:-no}])
126731637056Smrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
126831637056Smrg[dependent libraries, and in which our libraries should be installed.])])
126925b89263Smrg
127031637056Smrg# _LT_ENABLE_LOCK
127131637056Smrg# ---------------
127231637056Smrgm4_defun([_LT_ENABLE_LOCK],
127331637056Smrg[AC_ARG_ENABLE([libtool-lock],
127431637056Smrg  [AS_HELP_STRING([--disable-libtool-lock],
127531637056Smrg    [avoid locking (might break parallel builds)])])
127631637056Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
127731637056Smrg
127831637056Smrg# Some flags need to be propagated to the compiler or linker for good
127931637056Smrg# libtool support.
128031637056Smrgcase $host in
128131637056Smrgia64-*-hpux*)
128231637056Smrg  # Find out which ABI we are using.
128331637056Smrg  echo 'int i;' > conftest.$ac_ext
128431637056Smrg  if AC_TRY_EVAL(ac_compile); then
128531637056Smrg    case `/usr/bin/file conftest.$ac_objext` in
128631637056Smrg      *ELF-32*)
128731637056Smrg	HPUX_IA64_MODE="32"
128831637056Smrg	;;
128931637056Smrg      *ELF-64*)
129031637056Smrg	HPUX_IA64_MODE="64"
129131637056Smrg	;;
129206f32fbeSmrg    esac
129331637056Smrg  fi
129431637056Smrg  rm -rf conftest*
129531637056Smrg  ;;
129631637056Smrg*-*-irix6*)
129731637056Smrg  # Find out which ABI we are using.
129831637056Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
129931637056Smrg  if AC_TRY_EVAL(ac_compile); then
130031637056Smrg    if test "$lt_cv_prog_gnu_ld" = yes; then
130131637056Smrg      case `/usr/bin/file conftest.$ac_objext` in
130231637056Smrg	*32-bit*)
130331637056Smrg	  LD="${LD-ld} -melf32bsmip"
130431637056Smrg	  ;;
130531637056Smrg	*N32*)
130631637056Smrg	  LD="${LD-ld} -melf32bmipn32"
130731637056Smrg	  ;;
130831637056Smrg	*64-bit*)
130931637056Smrg	  LD="${LD-ld} -melf64bmip"
131031637056Smrg	;;
131131637056Smrg      esac
131231637056Smrg    else
131331637056Smrg      case `/usr/bin/file conftest.$ac_objext` in
131431637056Smrg	*32-bit*)
131531637056Smrg	  LD="${LD-ld} -32"
131631637056Smrg	  ;;
131731637056Smrg	*N32*)
131831637056Smrg	  LD="${LD-ld} -n32"
131931637056Smrg	  ;;
132031637056Smrg	*64-bit*)
132131637056Smrg	  LD="${LD-ld} -64"
132231637056Smrg	  ;;
132331637056Smrg      esac
132431637056Smrg    fi
132531637056Smrg  fi
132631637056Smrg  rm -rf conftest*
132731637056Smrg  ;;
1328ea133fd7Smrg
132931637056Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
133031637056Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
133131637056Smrg  # Find out which ABI we are using.
133231637056Smrg  echo 'int i;' > conftest.$ac_ext
133331637056Smrg  if AC_TRY_EVAL(ac_compile); then
133431637056Smrg    case `/usr/bin/file conftest.o` in
133531637056Smrg      *32-bit*)
133631637056Smrg	case $host in
133731637056Smrg	  x86_64-*kfreebsd*-gnu)
133831637056Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
133931637056Smrg	    ;;
134031637056Smrg	  x86_64-*linux*)
134131637056Smrg	    case `/usr/bin/file conftest.o` in
134231637056Smrg	      *x86-64*)
134331637056Smrg		LD="${LD-ld} -m elf32_x86_64"
134431637056Smrg		;;
134531637056Smrg	      *)
134631637056Smrg		LD="${LD-ld} -m elf_i386"
134731637056Smrg		;;
134831637056Smrg	    esac
134931637056Smrg	    ;;
135031637056Smrg	  powerpc64le-*)
135131637056Smrg	    LD="${LD-ld} -m elf32lppclinux"
135231637056Smrg	    ;;
135331637056Smrg	  powerpc64-*)
135431637056Smrg	    LD="${LD-ld} -m elf32ppclinux"
135531637056Smrg	    ;;
135631637056Smrg	  s390x-*linux*)
135731637056Smrg	    LD="${LD-ld} -m elf_s390"
135831637056Smrg	    ;;
135931637056Smrg	  sparc64-*linux*)
136031637056Smrg	    LD="${LD-ld} -m elf32_sparc"
136131637056Smrg	    ;;
136231637056Smrg	esac
136331637056Smrg	;;
136431637056Smrg      *64-bit*)
136531637056Smrg	case $host in
136631637056Smrg	  x86_64-*kfreebsd*-gnu)
136731637056Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
136831637056Smrg	    ;;
136931637056Smrg	  x86_64-*linux*)
137031637056Smrg	    LD="${LD-ld} -m elf_x86_64"
137131637056Smrg	    ;;
137231637056Smrg	  powerpcle-*)
137331637056Smrg	    LD="${LD-ld} -m elf64lppc"
137431637056Smrg	    ;;
137531637056Smrg	  powerpc-*)
137631637056Smrg	    LD="${LD-ld} -m elf64ppc"
137731637056Smrg	    ;;
137831637056Smrg	  s390*-*linux*|s390*-*tpf*)
137931637056Smrg	    LD="${LD-ld} -m elf64_s390"
138031637056Smrg	    ;;
138131637056Smrg	  sparc*-*linux*)
138231637056Smrg	    LD="${LD-ld} -m elf64_sparc"
138331637056Smrg	    ;;
138431637056Smrg	esac
138531637056Smrg	;;
138606f32fbeSmrg    esac
138731637056Smrg  fi
138831637056Smrg  rm -rf conftest*
138931637056Smrg  ;;
1390a253d6aeSmrg
139131637056Smrg*-*-sco3.2v5*)
139231637056Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
139331637056Smrg  SAVE_CFLAGS="$CFLAGS"
139431637056Smrg  CFLAGS="$CFLAGS -belf"
139531637056Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
139631637056Smrg    [AC_LANG_PUSH(C)
139731637056Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
139831637056Smrg     AC_LANG_POP])
139931637056Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
140031637056Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
140131637056Smrg    CFLAGS="$SAVE_CFLAGS"
140231637056Smrg  fi
140331637056Smrg  ;;
140431637056Smrg*-*solaris*)
140531637056Smrg  # Find out which ABI we are using.
140631637056Smrg  echo 'int i;' > conftest.$ac_ext
140731637056Smrg  if AC_TRY_EVAL(ac_compile); then
140831637056Smrg    case `/usr/bin/file conftest.o` in
140931637056Smrg    *64-bit*)
141031637056Smrg      case $lt_cv_prog_gnu_ld in
141131637056Smrg      yes*)
141231637056Smrg        case $host in
141331637056Smrg        i?86-*-solaris*)
141431637056Smrg          LD="${LD-ld} -m elf_x86_64"
141531637056Smrg          ;;
141631637056Smrg        sparc*-*-solaris*)
141731637056Smrg          LD="${LD-ld} -m elf64_sparc"
141831637056Smrg          ;;
141931637056Smrg        esac
142031637056Smrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
142131637056Smrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
142231637056Smrg          LD="${LD-ld}_sol2"
142331637056Smrg        fi
142431637056Smrg        ;;
142531637056Smrg      *)
142631637056Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
142731637056Smrg	  LD="${LD-ld} -64"
142831637056Smrg	fi
142931637056Smrg	;;
143031637056Smrg      esac
143131637056Smrg      ;;
143231637056Smrg    esac
143331637056Smrg  fi
143431637056Smrg  rm -rf conftest*
143531637056Smrg  ;;
143631637056Smrgesac
1437a253d6aeSmrg
143831637056Smrgneed_locks="$enable_libtool_lock"
143931637056Smrg])# _LT_ENABLE_LOCK
1440a253d6aeSmrg
1441a253d6aeSmrg
144231637056Smrg# _LT_PROG_AR
144331637056Smrg# -----------
144431637056Smrgm4_defun([_LT_PROG_AR],
144531637056Smrg[AC_CHECK_TOOLS(AR, [ar], false)
144631637056Smrg: ${AR=ar}
144731637056Smrg: ${AR_FLAGS=cru}
144831637056Smrg_LT_DECL([], [AR], [1], [The archiver])
144931637056Smrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
1450a253d6aeSmrg
145131637056SmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
145231637056Smrg  [lt_cv_ar_at_file=no
145331637056Smrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
145431637056Smrg     [echo conftest.$ac_objext > conftest.lst
145531637056Smrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
145631637056Smrg      AC_TRY_EVAL([lt_ar_try])
145731637056Smrg      if test "$ac_status" -eq 0; then
145831637056Smrg	# Ensure the archiver fails upon bogus file names.
145931637056Smrg	rm -f conftest.$ac_objext libconftest.a
146031637056Smrg	AC_TRY_EVAL([lt_ar_try])
146131637056Smrg	if test "$ac_status" -ne 0; then
146231637056Smrg          lt_cv_ar_at_file=@
146331637056Smrg        fi
146431637056Smrg      fi
146531637056Smrg      rm -f conftest.* libconftest.a
146631637056Smrg     ])
146731637056Smrg  ])
1468a253d6aeSmrg
146931637056Smrgif test "x$lt_cv_ar_at_file" = xno; then
147031637056Smrg  archiver_list_spec=
147131637056Smrgelse
147231637056Smrg  archiver_list_spec=$lt_cv_ar_at_file
147331637056Smrgfi
147431637056Smrg_LT_DECL([], [archiver_list_spec], [1],
147531637056Smrg  [How to feed a file listing to the archiver])
147631637056Smrg])# _LT_PROG_AR
1477a253d6aeSmrg
1478a253d6aeSmrg
147931637056Smrg# _LT_CMD_OLD_ARCHIVE
148031637056Smrg# -------------------
148131637056Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
148231637056Smrg[_LT_PROG_AR
1483a253d6aeSmrg
148431637056SmrgAC_CHECK_TOOL(STRIP, strip, :)
148531637056Smrgtest -z "$STRIP" && STRIP=:
148631637056Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1487a253d6aeSmrg
148831637056SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
148931637056Smrgtest -z "$RANLIB" && RANLIB=:
149031637056Smrg_LT_DECL([], [RANLIB], [1],
149131637056Smrg    [Commands used to install an old-style archive])
1492a253d6aeSmrg
149331637056Smrg# Determine commands to create old-style static archives.
149431637056Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
149531637056Smrgold_postinstall_cmds='chmod 644 $oldlib'
149631637056Smrgold_postuninstall_cmds=
1497a253d6aeSmrg
149831637056Smrgif test -n "$RANLIB"; then
149931637056Smrg  case $host_os in
150031637056Smrg  openbsd*)
150131637056Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
150231637056Smrg    ;;
150331637056Smrg  *)
150431637056Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
150531637056Smrg    ;;
150606f32fbeSmrg  esac
150731637056Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
150806f32fbeSmrgfi
1509a253d6aeSmrg
151031637056Smrgcase $host_os in
151131637056Smrg  darwin*)
151231637056Smrg    lock_old_archive_extraction=yes ;;
151331637056Smrg  *)
151431637056Smrg    lock_old_archive_extraction=no ;;
151531637056Smrgesac
151631637056Smrg_LT_DECL([], [old_postinstall_cmds], [2])
151731637056Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
151831637056Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
151931637056Smrg    [Commands used to build an old-style archive])
152031637056Smrg_LT_DECL([], [lock_old_archive_extraction], [0],
152131637056Smrg    [Whether to use a lock for old archive extraction])
152231637056Smrg])# _LT_CMD_OLD_ARCHIVE
1523a253d6aeSmrg
1524a253d6aeSmrg
152531637056Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
152631637056Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
152731637056Smrg# ----------------------------------------------------------------
152831637056Smrg# Check whether the given compiler option works
152931637056SmrgAC_DEFUN([_LT_COMPILER_OPTION],
153006f32fbeSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
153131637056Smrgm4_require([_LT_DECL_SED])dnl
153231637056SmrgAC_CACHE_CHECK([$1], [$2],
153331637056Smrg  [$2=no
153431637056Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
153531637056Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
153631637056Smrg   lt_compiler_flag="$3"
153731637056Smrg   # Insert the option either (1) after the last *FLAGS variable, or
153831637056Smrg   # (2) before a word containing "conftest.", or (3) at the end.
153931637056Smrg   # Note that $ac_compile itself does not contain backslashes and begins
154031637056Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
154131637056Smrg   # The option is referenced via a variable to avoid confusing sed.
154231637056Smrg   lt_compile=`echo "$ac_compile" | $SED \
154331637056Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
154431637056Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
154531637056Smrg   -e 's:$: $lt_compiler_flag:'`
154631637056Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
154731637056Smrg   (eval "$lt_compile" 2>conftest.err)
154831637056Smrg   ac_status=$?
154931637056Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
155031637056Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
155131637056Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
155231637056Smrg     # The compiler can only warn and ignore the option if not recognized
155331637056Smrg     # So say no if there are warnings other than the usual output.
155431637056Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
155531637056Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
155631637056Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
155731637056Smrg       $2=yes
155831637056Smrg     fi
155931637056Smrg   fi
156031637056Smrg   $RM conftest*
156131637056Smrg])
1562a253d6aeSmrg
156331637056Smrgif test x"[$]$2" = xyes; then
156431637056Smrg    m4_if([$5], , :, [$5])
156531637056Smrgelse
156631637056Smrg    m4_if([$6], , :, [$6])
156706f32fbeSmrgfi
156831637056Smrg])# _LT_COMPILER_OPTION
1569a253d6aeSmrg
157031637056Smrg# Old name:
157131637056SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
157231637056Smrgdnl aclocal-1.4 backwards compatibility:
157331637056Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1574a253d6aeSmrg
1575a253d6aeSmrg
157631637056Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
157731637056Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
157831637056Smrg# ----------------------------------------------------
157931637056Smrg# Check whether the given linker option works
158031637056SmrgAC_DEFUN([_LT_LINKER_OPTION],
158131637056Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
158231637056Smrgm4_require([_LT_DECL_SED])dnl
158331637056SmrgAC_CACHE_CHECK([$1], [$2],
158431637056Smrg  [$2=no
158531637056Smrg   save_LDFLAGS="$LDFLAGS"
158631637056Smrg   LDFLAGS="$LDFLAGS $3"
158731637056Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
158831637056Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
158931637056Smrg     # The linker can only warn and ignore the option if not recognized
159031637056Smrg     # So say no if there are warnings
159131637056Smrg     if test -s conftest.err; then
159231637056Smrg       # Append any errors to the config.log.
159331637056Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
159431637056Smrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
159531637056Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
159631637056Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
159731637056Smrg         $2=yes
159831637056Smrg       fi
159931637056Smrg     else
160031637056Smrg       $2=yes
160131637056Smrg     fi
160231637056Smrg   fi
160331637056Smrg   $RM -r conftest*
160431637056Smrg   LDFLAGS="$save_LDFLAGS"
160531637056Smrg])
1606a253d6aeSmrg
160731637056Smrgif test x"[$]$2" = xyes; then
160831637056Smrg    m4_if([$4], , :, [$4])
160931637056Smrgelse
161031637056Smrg    m4_if([$5], , :, [$5])
161131637056Smrgfi
161231637056Smrg])# _LT_LINKER_OPTION
1613a253d6aeSmrg
161431637056Smrg# Old name:
161531637056SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
161631637056Smrgdnl aclocal-1.4 backwards compatibility:
161731637056Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1618a253d6aeSmrg
1619ea133fd7Smrg
162031637056Smrg# LT_CMD_MAX_LEN
162131637056Smrg#---------------
162231637056SmrgAC_DEFUN([LT_CMD_MAX_LEN],
162331637056Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
162431637056Smrg# find the maximum length of command line arguments
162531637056SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
162631637056SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
162731637056Smrg  i=0
162831637056Smrg  teststring="ABCD"
1629ea133fd7Smrg
163031637056Smrg  case $build_os in
163131637056Smrg  msdosdjgpp*)
163231637056Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
163331637056Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
163431637056Smrg    # during glob expansion).  Even if it were fixed, the result of this
163531637056Smrg    # check would be larger than it should be.
163631637056Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
163731637056Smrg    ;;
1638ea133fd7Smrg
163931637056Smrg  gnu*)
164031637056Smrg    # Under GNU Hurd, this test is not required because there is
164131637056Smrg    # no limit to the length of command line arguments.
164231637056Smrg    # Libtool will interpret -1 as no limit whatsoever
164331637056Smrg    lt_cv_sys_max_cmd_len=-1;
164431637056Smrg    ;;
1645a253d6aeSmrg
164631637056Smrg  cygwin* | mingw* | cegcc*)
164731637056Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
164831637056Smrg    # about 5 minutes as the teststring grows exponentially.
164931637056Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
165031637056Smrg    # you end up with a "frozen" computer, even though with patience
165131637056Smrg    # the test eventually succeeds (with a max line length of 256k).
165231637056Smrg    # Instead, let's just punt: use the minimum linelength reported by
165331637056Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
165431637056Smrg    lt_cv_sys_max_cmd_len=8192;
165531637056Smrg    ;;
1656a253d6aeSmrg
165731637056Smrg  mint*)
165831637056Smrg    # On MiNT this can take a long time and run out of memory.
165931637056Smrg    lt_cv_sys_max_cmd_len=8192;
166031637056Smrg    ;;
1661a253d6aeSmrg
166231637056Smrg  amigaos*)
166331637056Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
166431637056Smrg    # So we just punt and use a minimum line length of 8192.
166531637056Smrg    lt_cv_sys_max_cmd_len=8192;
166631637056Smrg    ;;
1667a253d6aeSmrg
166831637056Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
166931637056Smrg    # This has been around since 386BSD, at least.  Likely further.
167031637056Smrg    if test -x /sbin/sysctl; then
167131637056Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
167231637056Smrg    elif test -x /usr/sbin/sysctl; then
167331637056Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
167431637056Smrg    else
167531637056Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
167631637056Smrg    fi
167731637056Smrg    # And add a safety zone
167831637056Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
167931637056Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
168031637056Smrg    ;;
1681a253d6aeSmrg
168231637056Smrg  interix*)
168331637056Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
168431637056Smrg    lt_cv_sys_max_cmd_len=196608
168531637056Smrg    ;;
168657ee1794Smrg
168731637056Smrg  os2*)
168831637056Smrg    # The test takes a long time on OS/2.
168931637056Smrg    lt_cv_sys_max_cmd_len=8192
169031637056Smrg    ;;
169157ee1794Smrg
169231637056Smrg  osf*)
169331637056Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
169431637056Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
169531637056Smrg    # nice to cause kernel panics so lets avoid the loop below.
169631637056Smrg    # First set a reasonable default.
169731637056Smrg    lt_cv_sys_max_cmd_len=16384
169831637056Smrg    #
169931637056Smrg    if test -x /sbin/sysconfig; then
170031637056Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
170131637056Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
170231637056Smrg      esac
170331637056Smrg    fi
170431637056Smrg    ;;
170531637056Smrg  sco3.2v5*)
170631637056Smrg    lt_cv_sys_max_cmd_len=102400
170731637056Smrg    ;;
170831637056Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
170931637056Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
171031637056Smrg    if test -n "$kargmax"; then
171131637056Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
171231637056Smrg    else
171331637056Smrg      lt_cv_sys_max_cmd_len=32768
171431637056Smrg    fi
171531637056Smrg    ;;
171631637056Smrg  *)
171731637056Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
171831637056Smrg    if test -n "$lt_cv_sys_max_cmd_len" && \
171931637056Smrg	test undefined != "$lt_cv_sys_max_cmd_len"; then
172031637056Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
172131637056Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
172231637056Smrg    else
172331637056Smrg      # Make teststring a little bigger before we do anything with it.
172431637056Smrg      # a 1K string should be a reasonable start.
172531637056Smrg      for i in 1 2 3 4 5 6 7 8 ; do
172631637056Smrg        teststring=$teststring$teststring
172731637056Smrg      done
172831637056Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
172931637056Smrg      # If test is not a shell built-in, we'll probably end up computing a
173031637056Smrg      # maximum length that is only half of the actual maximum length, but
173131637056Smrg      # we can't tell.
173231637056Smrg      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
173331637056Smrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
173431637056Smrg	      test $i != 17 # 1/2 MB should be enough
173531637056Smrg      do
173631637056Smrg        i=`expr $i + 1`
173731637056Smrg        teststring=$teststring$teststring
173831637056Smrg      done
173931637056Smrg      # Only check the string length outside the loop.
174031637056Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
174131637056Smrg      teststring=
174231637056Smrg      # Add a significant safety factor because C++ compilers can tack on
174331637056Smrg      # massive amounts of additional arguments before passing them to the
174431637056Smrg      # linker.  It appears as though 1/2 is a usable value.
174531637056Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
174631637056Smrg    fi
174731637056Smrg    ;;
174831637056Smrg  esac
174931637056Smrg])
175031637056Smrgif test -n $lt_cv_sys_max_cmd_len ; then
175131637056Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
175231637056Smrgelse
175331637056Smrg  AC_MSG_RESULT(none)
175431637056Smrgfi
175531637056Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
175631637056Smrg_LT_DECL([], [max_cmd_len], [0],
175731637056Smrg    [What is the maximum length of a command?])
175831637056Smrg])# LT_CMD_MAX_LEN
1759ea133fd7Smrg
176031637056Smrg# Old name:
176131637056SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
176231637056Smrgdnl aclocal-1.4 backwards compatibility:
176331637056Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1764ea133fd7Smrg
1765a253d6aeSmrg
176631637056Smrg# _LT_HEADER_DLFCN
176731637056Smrg# ----------------
176831637056Smrgm4_defun([_LT_HEADER_DLFCN],
176931637056Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
177031637056Smrg])# _LT_HEADER_DLFCN
177157ee1794Smrg
1772a253d6aeSmrg
177331637056Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
177431637056Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
177531637056Smrg# ----------------------------------------------------------------
177631637056Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
177731637056Smrg[m4_require([_LT_HEADER_DLFCN])dnl
177831637056Smrgif test "$cross_compiling" = yes; then :
177931637056Smrg  [$4]
178031637056Smrgelse
178131637056Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
178231637056Smrg  lt_status=$lt_dlunknown
178331637056Smrg  cat > conftest.$ac_ext <<_LT_EOF
178431637056Smrg[#line $LINENO "configure"
178531637056Smrg#include "confdefs.h"
1786a253d6aeSmrg
178731637056Smrg#if HAVE_DLFCN_H
178831637056Smrg#include <dlfcn.h>
178931637056Smrg#endif
1790a253d6aeSmrg
179131637056Smrg#include <stdio.h>
1792a253d6aeSmrg
179331637056Smrg#ifdef RTLD_GLOBAL
179431637056Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
179531637056Smrg#else
179631637056Smrg#  ifdef DL_GLOBAL
179731637056Smrg#    define LT_DLGLOBAL		DL_GLOBAL
179831637056Smrg#  else
179931637056Smrg#    define LT_DLGLOBAL		0
180031637056Smrg#  endif
180131637056Smrg#endif
1802a253d6aeSmrg
180331637056Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
180431637056Smrg   find out it does not work in some platform. */
180531637056Smrg#ifndef LT_DLLAZY_OR_NOW
180631637056Smrg#  ifdef RTLD_LAZY
180731637056Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
180831637056Smrg#  else
180931637056Smrg#    ifdef DL_LAZY
181031637056Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
181131637056Smrg#    else
181231637056Smrg#      ifdef RTLD_NOW
181331637056Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
181431637056Smrg#      else
181531637056Smrg#        ifdef DL_NOW
181631637056Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
181731637056Smrg#        else
181831637056Smrg#          define LT_DLLAZY_OR_NOW	0
181931637056Smrg#        endif
182031637056Smrg#      endif
182131637056Smrg#    endif
182231637056Smrg#  endif
182331637056Smrg#endif
1824a253d6aeSmrg
182531637056Smrg/* When -fvisbility=hidden is used, assume the code has been annotated
182631637056Smrg   correspondingly for the symbols needed.  */
182731637056Smrg#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
182831637056Smrgint fnord () __attribute__((visibility("default")));
182931637056Smrg#endif
1830a253d6aeSmrg
183131637056Smrgint fnord () { return 42; }
183231637056Smrgint main ()
183331637056Smrg{
183431637056Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
183531637056Smrg  int status = $lt_dlunknown;
1836a253d6aeSmrg
183731637056Smrg  if (self)
183831637056Smrg    {
183931637056Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
184031637056Smrg      else
184131637056Smrg        {
184231637056Smrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
184331637056Smrg          else puts (dlerror ());
184431637056Smrg	}
184531637056Smrg      /* dlclose (self); */
184631637056Smrg    }
184731637056Smrg  else
184831637056Smrg    puts (dlerror ());
1849a253d6aeSmrg
185031637056Smrg  return status;
185131637056Smrg}]
185231637056Smrg_LT_EOF
185331637056Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
185431637056Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
185531637056Smrg    lt_status=$?
185631637056Smrg    case x$lt_status in
185731637056Smrg      x$lt_dlno_uscore) $1 ;;
185831637056Smrg      x$lt_dlneed_uscore) $2 ;;
185931637056Smrg      x$lt_dlunknown|x*) $3 ;;
186031637056Smrg    esac
186131637056Smrg  else :
186231637056Smrg    # compilation failed
186331637056Smrg    $3
186431637056Smrg  fi
186531637056Smrgfi
186631637056Smrgrm -fr conftest*
186731637056Smrg])# _LT_TRY_DLOPEN_SELF
1868a253d6aeSmrg
1869a253d6aeSmrg
187031637056Smrg# LT_SYS_DLOPEN_SELF
187131637056Smrg# ------------------
187231637056SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
187331637056Smrg[m4_require([_LT_HEADER_DLFCN])dnl
187431637056Smrgif test "x$enable_dlopen" != xyes; then
187531637056Smrg  enable_dlopen=unknown
187631637056Smrg  enable_dlopen_self=unknown
187731637056Smrg  enable_dlopen_self_static=unknown
187831637056Smrgelse
187931637056Smrg  lt_cv_dlopen=no
188031637056Smrg  lt_cv_dlopen_libs=
1881a253d6aeSmrg
188206f32fbeSmrg  case $host_os in
188331637056Smrg  beos*)
188431637056Smrg    lt_cv_dlopen="load_add_on"
188531637056Smrg    lt_cv_dlopen_libs=
188631637056Smrg    lt_cv_dlopen_self=yes
188731637056Smrg    ;;
1888a253d6aeSmrg
188931637056Smrg  mingw* | pw32* | cegcc*)
189031637056Smrg    lt_cv_dlopen="LoadLibrary"
189131637056Smrg    lt_cv_dlopen_libs=
189231637056Smrg    ;;
189357ee1794Smrg
189431637056Smrg  cygwin*)
189531637056Smrg    lt_cv_dlopen="dlopen"
189631637056Smrg    lt_cv_dlopen_libs=
189731637056Smrg    ;;
189857ee1794Smrg
189931637056Smrg  darwin*)
190031637056Smrg  # if libdl is installed we need to link against it
190131637056Smrg    AC_CHECK_LIB([dl], [dlopen],
190231637056Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
190331637056Smrg    lt_cv_dlopen="dyld"
190431637056Smrg    lt_cv_dlopen_libs=
190531637056Smrg    lt_cv_dlopen_self=yes
190606f32fbeSmrg    ])
190706f32fbeSmrg    ;;
190831637056Smrg
190931637056Smrg  *)
191031637056Smrg    AC_CHECK_FUNC([shl_load],
191131637056Smrg	  [lt_cv_dlopen="shl_load"],
191231637056Smrg      [AC_CHECK_LIB([dld], [shl_load],
191331637056Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
191431637056Smrg	[AC_CHECK_FUNC([dlopen],
191531637056Smrg	      [lt_cv_dlopen="dlopen"],
191631637056Smrg	  [AC_CHECK_LIB([dl], [dlopen],
191731637056Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
191831637056Smrg	    [AC_CHECK_LIB([svld], [dlopen],
191931637056Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
192031637056Smrg	      [AC_CHECK_LIB([dld], [dld_link],
192131637056Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
192231637056Smrg	      ])
192331637056Smrg	    ])
192431637056Smrg	  ])
192531637056Smrg	])
192631637056Smrg      ])
192706f32fbeSmrg    ;;
192806f32fbeSmrg  esac
1929a253d6aeSmrg
193031637056Smrg  if test "x$lt_cv_dlopen" != xno; then
193131637056Smrg    enable_dlopen=yes
193206f32fbeSmrg  else
193331637056Smrg    enable_dlopen=no
193406f32fbeSmrg  fi
1935ea133fd7Smrg
193631637056Smrg  case $lt_cv_dlopen in
193731637056Smrg  dlopen)
193831637056Smrg    save_CPPFLAGS="$CPPFLAGS"
193931637056Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1940ea133fd7Smrg
194131637056Smrg    save_LDFLAGS="$LDFLAGS"
194231637056Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1943ea133fd7Smrg
194431637056Smrg    save_LIBS="$LIBS"
194531637056Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
1946ea133fd7Smrg
194731637056Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
194831637056Smrg	  lt_cv_dlopen_self, [dnl
194931637056Smrg	  _LT_TRY_DLOPEN_SELF(
195031637056Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
195131637056Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
195231637056Smrg    ])
1953a253d6aeSmrg
195431637056Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
195531637056Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
195631637056Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
195731637056Smrg	  lt_cv_dlopen_self_static, [dnl
195831637056Smrg	  _LT_TRY_DLOPEN_SELF(
195931637056Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
196031637056Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
196131637056Smrg      ])
196231637056Smrg    fi
1963a253d6aeSmrg
196431637056Smrg    CPPFLAGS="$save_CPPFLAGS"
196531637056Smrg    LDFLAGS="$save_LDFLAGS"
196631637056Smrg    LIBS="$save_LIBS"
196731637056Smrg    ;;
196831637056Smrg  esac
1969a253d6aeSmrg
197031637056Smrg  case $lt_cv_dlopen_self in
197131637056Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
197231637056Smrg  *) enable_dlopen_self=unknown ;;
197331637056Smrg  esac
1974a253d6aeSmrg
197531637056Smrg  case $lt_cv_dlopen_self_static in
197631637056Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
197731637056Smrg  *) enable_dlopen_self_static=unknown ;;
197831637056Smrg  esac
197931637056Smrgfi
198031637056Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
198131637056Smrg	 [Whether dlopen is supported])
198231637056Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
198331637056Smrg	 [Whether dlopen of programs is supported])
198431637056Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
198531637056Smrg	 [Whether dlopen of statically linked programs is supported])
198631637056Smrg])# LT_SYS_DLOPEN_SELF
1987a253d6aeSmrg
198831637056Smrg# Old name:
198931637056SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
199031637056Smrgdnl aclocal-1.4 backwards compatibility:
199131637056Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1992a253d6aeSmrg
1993a253d6aeSmrg
199431637056Smrg# _LT_COMPILER_C_O([TAGNAME])
199531637056Smrg# ---------------------------
199631637056Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
199731637056Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
199831637056Smrgm4_defun([_LT_COMPILER_C_O],
199931637056Smrg[m4_require([_LT_DECL_SED])dnl
200031637056Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
200131637056Smrgm4_require([_LT_TAG_COMPILER])dnl
200231637056SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
200331637056Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
200431637056Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
200531637056Smrg   $RM -r conftest 2>/dev/null
200631637056Smrg   mkdir conftest
200731637056Smrg   cd conftest
200831637056Smrg   mkdir out
200931637056Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
201006f32fbeSmrg
201131637056Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
201231637056Smrg   # Insert the option either (1) after the last *FLAGS variable, or
201331637056Smrg   # (2) before a word containing "conftest.", or (3) at the end.
201431637056Smrg   # Note that $ac_compile itself does not contain backslashes and begins
201531637056Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
201631637056Smrg   lt_compile=`echo "$ac_compile" | $SED \
201731637056Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
201831637056Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
201931637056Smrg   -e 's:$: $lt_compiler_flag:'`
202031637056Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
202131637056Smrg   (eval "$lt_compile" 2>out/conftest.err)
202231637056Smrg   ac_status=$?
202331637056Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
202431637056Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
202531637056Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
202631637056Smrg   then
202731637056Smrg     # The compiler can only warn and ignore the option if not recognized
202831637056Smrg     # So say no if there are warnings
202931637056Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
203031637056Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
203131637056Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
203231637056Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
203331637056Smrg     fi
203406f32fbeSmrg   fi
203531637056Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
203631637056Smrg   $RM conftest*
203731637056Smrg   # SGI C++ compiler will create directory out/ii_files/ for
203831637056Smrg   # template instantiation
203931637056Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
204031637056Smrg   $RM out/* && rmdir out
204131637056Smrg   cd ..
204231637056Smrg   $RM -r conftest
204331637056Smrg   $RM conftest*
204431637056Smrg])
204531637056Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
204631637056Smrg	[Does compiler simultaneously support -c and -o options?])
204731637056Smrg])# _LT_COMPILER_C_O
2048a253d6aeSmrg
2049a253d6aeSmrg
205031637056Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
205131637056Smrg# ----------------------------------
205231637056Smrg# Check to see if we can do hard links to lock some files if needed
205331637056Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
205431637056Smrg[m4_require([_LT_ENABLE_LOCK])dnl
205531637056Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
205631637056Smrg_LT_COMPILER_C_O([$1])
2057a253d6aeSmrg
205831637056Smrghard_links="nottested"
205931637056Smrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
206031637056Smrg  # do not overwrite the value of need_locks provided by the user
206131637056Smrg  AC_MSG_CHECKING([if we can lock with hard links])
206231637056Smrg  hard_links=yes
206331637056Smrg  $RM conftest*
206431637056Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
206531637056Smrg  touch conftest.a
206631637056Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
206731637056Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
206831637056Smrg  AC_MSG_RESULT([$hard_links])
206931637056Smrg  if test "$hard_links" = no; then
207031637056Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
207131637056Smrg    need_locks=warn
207206f32fbeSmrg  fi
207331637056Smrgelse
207431637056Smrg  need_locks=no
207531637056Smrgfi
207631637056Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
207731637056Smrg])# _LT_COMPILER_FILE_LOCKS
2078a253d6aeSmrg
2079a253d6aeSmrg
208031637056Smrg# _LT_CHECK_OBJDIR
208131637056Smrg# ----------------
208231637056Smrgm4_defun([_LT_CHECK_OBJDIR],
208331637056Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
208431637056Smrg[rm -f .libs 2>/dev/null
208531637056Smrgmkdir .libs 2>/dev/null
208631637056Smrgif test -d .libs; then
208731637056Smrg  lt_cv_objdir=.libs
208806f32fbeSmrgelse
208931637056Smrg  # MS-DOS does not allow filenames that begin with a dot.
209031637056Smrg  lt_cv_objdir=_libs
209106f32fbeSmrgfi
209231637056Smrgrmdir .libs 2>/dev/null])
209331637056Smrgobjdir=$lt_cv_objdir
209431637056Smrg_LT_DECL([], [objdir], [0],
209531637056Smrg         [The name of the directory that contains temporary libtool files])dnl
209631637056Smrgm4_pattern_allow([LT_OBJDIR])dnl
209731637056SmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
209831637056Smrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
209931637056Smrg])# _LT_CHECK_OBJDIR
2100a253d6aeSmrg
2101a253d6aeSmrg
210231637056Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
210331637056Smrg# --------------------------------------
210431637056Smrg# Check hardcoding attributes.
210531637056Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
210631637056Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
210731637056Smrg_LT_TAGVAR(hardcode_action, $1)=
210831637056Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
210931637056Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
211031637056Smrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
2111a253d6aeSmrg
211231637056Smrg  # We can hardcode non-existent directories.
211331637056Smrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
211431637056Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
211531637056Smrg     # have to relink, otherwise we might link with an installed library
211631637056Smrg     # when we should be linking with a yet-to-be-installed one
211731637056Smrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
211831637056Smrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
211931637056Smrg    # Linking always hardcodes the temporary library directory.
212031637056Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
212131637056Smrg  else
212231637056Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
212331637056Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
212431637056Smrg  fi
212531637056Smrgelse
212631637056Smrg  # We cannot hardcode anything, or else we can only hardcode existing
212731637056Smrg  # directories.
212831637056Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
212931637056Smrgfi
213031637056SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2131a253d6aeSmrg
213231637056Smrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
213331637056Smrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
213431637056Smrg  # Fast installation is not supported
213531637056Smrg  enable_fast_install=no
213631637056Smrgelif test "$shlibpath_overrides_runpath" = yes ||
213731637056Smrg     test "$enable_shared" = no; then
213831637056Smrg  # Fast installation is not necessary
213931637056Smrg  enable_fast_install=needless
214031637056Smrgfi
214131637056Smrg_LT_TAGDECL([], [hardcode_action], [0],
214231637056Smrg    [How to hardcode a shared library path into an executable])
214331637056Smrg])# _LT_LINKER_HARDCODE_LIBPATH
2144a253d6aeSmrg
2145a253d6aeSmrg
214631637056Smrg# _LT_CMD_STRIPLIB
214731637056Smrg# ----------------
214831637056Smrgm4_defun([_LT_CMD_STRIPLIB],
214931637056Smrg[m4_require([_LT_DECL_EGREP])
215031637056Smrgstriplib=
215131637056Smrgold_striplib=
215231637056SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
215331637056Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
215431637056Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
215531637056Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
215631637056Smrg  AC_MSG_RESULT([yes])
215731637056Smrgelse
215831637056Smrg# FIXME - insert some real tests, host_os isn't really good enough
215906f32fbeSmrg  case $host_os in
216031637056Smrg  darwin*)
216131637056Smrg    if test -n "$STRIP" ; then
216231637056Smrg      striplib="$STRIP -x"
216331637056Smrg      old_striplib="$STRIP -S"
216431637056Smrg      AC_MSG_RESULT([yes])
216531637056Smrg    else
216631637056Smrg      AC_MSG_RESULT([no])
216731637056Smrg    fi
216806f32fbeSmrg    ;;
216906f32fbeSmrg  *)
217031637056Smrg    AC_MSG_RESULT([no])
217106f32fbeSmrg    ;;
217206f32fbeSmrg  esac
217306f32fbeSmrgfi
217431637056Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
217531637056Smrg_LT_DECL([], [striplib], [1])
217631637056Smrg])# _LT_CMD_STRIPLIB
2177a253d6aeSmrg
2178a253d6aeSmrg
217931637056Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
218031637056Smrg# -----------------------------
218131637056Smrg# PORTME Fill in your ld.so characteristics
218231637056Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
218331637056Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
218431637056Smrgm4_require([_LT_DECL_EGREP])dnl
218531637056Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
218631637056Smrgm4_require([_LT_DECL_OBJDUMP])dnl
218706f32fbeSmrgm4_require([_LT_DECL_SED])dnl
218831637056Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
218931637056SmrgAC_MSG_CHECKING([dynamic linker characteristics])
219031637056Smrgm4_if([$1],
219131637056Smrg	[], [
219231637056Smrgif test "$GCC" = yes; then
219331637056Smrg  case $host_os in
219431637056Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
219531637056Smrg    *) lt_awk_arg="/^libraries:/" ;;
219631637056Smrg  esac
219731637056Smrg  case $host_os in
219831637056Smrg    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
219931637056Smrg    *) lt_sed_strip_eq="s,=/,/,g" ;;
220031637056Smrg  esac
220131637056Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
220231637056Smrg  case $lt_search_path_spec in
220331637056Smrg  *\;*)
220431637056Smrg    # if the path contains ";" then we assume it to be the separator
220531637056Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
220631637056Smrg    # assumed that no part of a normal pathname contains ";" but that should
220731637056Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
220831637056Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
220931637056Smrg    ;;
221031637056Smrg  *)
221131637056Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
221231637056Smrg    ;;
221331637056Smrg  esac
221431637056Smrg  # Ok, now we have the path, separated by spaces, we can step through it
221531637056Smrg  # and add multilib dir if necessary.
221631637056Smrg  lt_tmp_lt_search_path_spec=
221731637056Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
221831637056Smrg  for lt_sys_path in $lt_search_path_spec; do
221931637056Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
222031637056Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
222131637056Smrg    else
222231637056Smrg      test -d "$lt_sys_path" && \
222331637056Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
222431637056Smrg    fi
222531637056Smrg  done
222631637056Smrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
222731637056SmrgBEGIN {RS=" "; FS="/|\n";} {
222831637056Smrg  lt_foo="";
222931637056Smrg  lt_count=0;
223031637056Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
223131637056Smrg    if ($lt_i != "" && $lt_i != ".") {
223231637056Smrg      if ($lt_i == "..") {
223331637056Smrg        lt_count++;
223431637056Smrg      } else {
223531637056Smrg        if (lt_count == 0) {
223631637056Smrg          lt_foo="/" $lt_i lt_foo;
223731637056Smrg        } else {
223831637056Smrg          lt_count--;
223931637056Smrg        }
224031637056Smrg      }
224131637056Smrg    }
224231637056Smrg  }
224331637056Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
224431637056Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
224531637056Smrg}'`
224631637056Smrg  # AWK program above erroneously prepends '/' to C:/dos/paths
224731637056Smrg  # for these hosts.
224831637056Smrg  case $host_os in
224931637056Smrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
225031637056Smrg      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
225131637056Smrg  esac
225231637056Smrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
225306f32fbeSmrgelse
225431637056Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
225531637056Smrgfi])
225631637056Smrglibrary_names_spec=
225731637056Smrglibname_spec='lib$name'
225831637056Smrgsoname_spec=
225931637056Smrgshrext_cmds=".so"
226031637056Smrgpostinstall_cmds=
226131637056Smrgpostuninstall_cmds=
226231637056Smrgfinish_cmds=
226331637056Smrgfinish_eval=
226431637056Smrgshlibpath_var=
226531637056Smrgshlibpath_overrides_runpath=unknown
226631637056Smrgversion_type=none
226731637056Smrgdynamic_linker="$host_os ld.so"
226831637056Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
226931637056Smrgneed_lib_prefix=unknown
227031637056Smrghardcode_into_libs=no
2271a253d6aeSmrg
227231637056Smrg# when you set need_version to no, make sure it does not cause -set_version
227331637056Smrg# flags to be left without arguments
227431637056Smrgneed_version=unknown
2275a253d6aeSmrg
227631637056Smrgcase $host_os in
227731637056Smrgaix3*)
227831637056Smrg  version_type=linux # correct to gnu/linux during the next big refactor
227931637056Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
228031637056Smrg  shlibpath_var=LIBPATH
2281a253d6aeSmrg
228231637056Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
228331637056Smrg  soname_spec='${libname}${release}${shared_ext}$major'
228431637056Smrg  ;;
2285a253d6aeSmrg
228631637056Smrgaix[[4-9]]*)
228731637056Smrg  version_type=linux # correct to gnu/linux during the next big refactor
228831637056Smrg  need_lib_prefix=no
228931637056Smrg  need_version=no
229031637056Smrg  hardcode_into_libs=yes
229131637056Smrg  if test "$host_cpu" = ia64; then
229231637056Smrg    # AIX 5 supports IA64
229331637056Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
229431637056Smrg    shlibpath_var=LD_LIBRARY_PATH
229531637056Smrg  else
229631637056Smrg    # With GCC up to 2.95.x, collect2 would create an import file
229731637056Smrg    # for dependence libraries.  The import file would start with
229831637056Smrg    # the line `#! .'.  This would cause the generated library to
229931637056Smrg    # depend on `.', always an invalid library.  This was fixed in
230031637056Smrg    # development snapshots of GCC prior to 3.0.
230131637056Smrg    case $host_os in
230231637056Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
230331637056Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
230431637056Smrg	   echo ' yes '
230531637056Smrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
230631637056Smrg	:
230731637056Smrg      else
230831637056Smrg	can_build_shared=no
230931637056Smrg      fi
231031637056Smrg      ;;
231131637056Smrg    esac
231231637056Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
231331637056Smrg    # soname into executable. Probably we can add versioning support to
231431637056Smrg    # collect2, so additional links can be useful in future.
231531637056Smrg    if test "$aix_use_runtimelinking" = yes; then
231631637056Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
231731637056Smrg      # instead of lib<name>.a to let people know that these are not
231831637056Smrg      # typical AIX shared libraries.
231931637056Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
232031637056Smrg    else
232131637056Smrg      # We preserve .a as extension for shared libraries through AIX4.2
232231637056Smrg      # and later when we are not doing run time linking.
232331637056Smrg      library_names_spec='${libname}${release}.a $libname.a'
232431637056Smrg      soname_spec='${libname}${release}${shared_ext}$major'
232531637056Smrg    fi
232631637056Smrg    shlibpath_var=LIBPATH
232731637056Smrg  fi
232831637056Smrg  ;;
2329a253d6aeSmrg
233031637056Smrgamigaos*)
233131637056Smrg  case $host_cpu in
233231637056Smrg  powerpc)
233331637056Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
233431637056Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
233531637056Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
233606f32fbeSmrg    ;;
233731637056Smrg  m68k)
233831637056Smrg    library_names_spec='$libname.ixlibrary $libname.a'
233931637056Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
234031637056Smrg    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'
234106f32fbeSmrg    ;;
234231637056Smrg  esac
234331637056Smrg  ;;
234425b89263Smrg
234531637056Smrgbeos*)
234631637056Smrg  library_names_spec='${libname}${shared_ext}'
234731637056Smrg  dynamic_linker="$host_os ld.so"
234831637056Smrg  shlibpath_var=LIBRARY_PATH
234931637056Smrg  ;;
235025b89263Smrg
235131637056Smrgbsdi[[45]]*)
235231637056Smrg  version_type=linux # correct to gnu/linux during the next big refactor
235331637056Smrg  need_version=no
235431637056Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
235531637056Smrg  soname_spec='${libname}${release}${shared_ext}$major'
235631637056Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
235731637056Smrg  shlibpath_var=LD_LIBRARY_PATH
235831637056Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
235931637056Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
236031637056Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
236131637056Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
236231637056Smrg  # libtool to hard-code these into programs
236331637056Smrg  ;;
236425b89263Smrg
236531637056Smrgcygwin* | mingw* | pw32* | cegcc*)
236631637056Smrg  version_type=windows
236731637056Smrg  shrext_cmds=".dll"
236831637056Smrg  need_version=no
236931637056Smrg  need_lib_prefix=no
237025b89263Smrg
237131637056Smrg  case $GCC,$cc_basename in
237231637056Smrg  yes,*)
237331637056Smrg    # gcc
237431637056Smrg    library_names_spec='$libname.dll.a'
237531637056Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
237631637056Smrg    postinstall_cmds='base_file=`basename \${file}`~
237731637056Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
237831637056Smrg      dldir=$destdir/`dirname \$dlpath`~
237931637056Smrg      test -d \$dldir || mkdir -p \$dldir~
238031637056Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
238131637056Smrg      chmod a+x \$dldir/$dlname~
238231637056Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
238331637056Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
238431637056Smrg      fi'
238531637056Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
238631637056Smrg      dlpath=$dir/\$dldll~
238731637056Smrg       $RM \$dlpath'
238831637056Smrg    shlibpath_overrides_runpath=yes
238925b89263Smrg
239031637056Smrg    case $host_os in
239131637056Smrg    cygwin*)
239231637056Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
239331637056Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
239431637056Smrgm4_if([$1], [],[
239531637056Smrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
239631637056Smrg      ;;
239731637056Smrg    mingw* | cegcc*)
239831637056Smrg      # MinGW DLLs use traditional 'lib' prefix
239931637056Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
240031637056Smrg      ;;
240131637056Smrg    pw32*)
240231637056Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
240331637056Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
240431637056Smrg      ;;
240531637056Smrg    esac
240631637056Smrg    dynamic_linker='Win32 ld.exe'
240757ee1794Smrg    ;;
240857ee1794Smrg
240931637056Smrg  *,cl*)
241031637056Smrg    # Native MSVC
241131637056Smrg    libname_spec='$name'
241231637056Smrg    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
241331637056Smrg    library_names_spec='${libname}.dll.lib'
241431637056Smrg
241531637056Smrg    case $build_os in
241631637056Smrg    mingw*)
241731637056Smrg      sys_lib_search_path_spec=
241831637056Smrg      lt_save_ifs=$IFS
241931637056Smrg      IFS=';'
242031637056Smrg      for lt_path in $LIB
242106f32fbeSmrg      do
242231637056Smrg        IFS=$lt_save_ifs
242331637056Smrg        # Let DOS variable expansion print the short 8.3 style file name.
242431637056Smrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
242531637056Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
242606f32fbeSmrg      done
242731637056Smrg      IFS=$lt_save_ifs
242831637056Smrg      # Convert to MSYS style.
242931637056Smrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
243031637056Smrg      ;;
243131637056Smrg    cygwin*)
243231637056Smrg      # Convert to unix form, then to dos form, then back to unix form
243331637056Smrg      # but this time dos style (no spaces!) so that the unix form looks
243431637056Smrg      # like /cygdrive/c/PROGRA~1:/cygdr...
243531637056Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
243631637056Smrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
243731637056Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
243831637056Smrg      ;;
243931637056Smrg    *)
244031637056Smrg      sys_lib_search_path_spec="$LIB"
244131637056Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
244231637056Smrg        # It is most probably a Windows format PATH.
244331637056Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
244431637056Smrg      else
244531637056Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
244631637056Smrg      fi
244731637056Smrg      # FIXME: find the short name or the path components, as spaces are
244831637056Smrg      # common. (e.g. "Program Files" -> "PROGRA~1")
244931637056Smrg      ;;
245031637056Smrg    esac
245125b89263Smrg
245231637056Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
245331637056Smrg    postinstall_cmds='base_file=`basename \${file}`~
245431637056Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
245531637056Smrg      dldir=$destdir/`dirname \$dlpath`~
245631637056Smrg      test -d \$dldir || mkdir -p \$dldir~
245731637056Smrg      $install_prog $dir/$dlname \$dldir/$dlname'
245831637056Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
245931637056Smrg      dlpath=$dir/\$dldll~
246031637056Smrg       $RM \$dlpath'
246131637056Smrg    shlibpath_overrides_runpath=yes
246231637056Smrg    dynamic_linker='Win32 link.exe'
246331637056Smrg    ;;
246425b89263Smrg
246531637056Smrg  *)
246631637056Smrg    # Assume MSVC wrapper
246731637056Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
246831637056Smrg    dynamic_linker='Win32 ld.exe'
246931637056Smrg    ;;
247031637056Smrg  esac
247131637056Smrg  # FIXME: first we should search . and the directory the executable is in
247231637056Smrg  shlibpath_var=PATH
247331637056Smrg  ;;
247425b89263Smrg
247531637056Smrgdarwin* | rhapsody*)
247631637056Smrg  dynamic_linker="$host_os dyld"
247731637056Smrg  version_type=darwin
247831637056Smrg  need_lib_prefix=no
247931637056Smrg  need_version=no
248031637056Smrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
248131637056Smrg  soname_spec='${libname}${release}${major}$shared_ext'
248231637056Smrg  shlibpath_overrides_runpath=yes
248331637056Smrg  shlibpath_var=DYLD_LIBRARY_PATH
248431637056Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
248531637056Smrgm4_if([$1], [],[
248631637056Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
248731637056Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
248831637056Smrg  ;;
248925b89263Smrg
249031637056Smrgdgux*)
249131637056Smrg  version_type=linux # correct to gnu/linux during the next big refactor
249231637056Smrg  need_lib_prefix=no
249331637056Smrg  need_version=no
249431637056Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
249531637056Smrg  soname_spec='${libname}${release}${shared_ext}$major'
249631637056Smrg  shlibpath_var=LD_LIBRARY_PATH
249731637056Smrg  ;;
249825b89263Smrg
249931637056Smrgfreebsd* | dragonfly*)
250031637056Smrg  # DragonFly does not have aout.  When/if they implement a new
250131637056Smrg  # versioning mechanism, adjust this.
250231637056Smrg  if test -x /usr/bin/objformat; then
250331637056Smrg    objformat=`/usr/bin/objformat`
250406f32fbeSmrg  else
250531637056Smrg    case $host_os in
250631637056Smrg    freebsd[[23]].*) objformat=aout ;;
250731637056Smrg    *) objformat=elf ;;
250806f32fbeSmrg    esac
250906f32fbeSmrg  fi
251031637056Smrg  version_type=freebsd-$objformat
251131637056Smrg  case $version_type in
251231637056Smrg    freebsd-elf*)
251331637056Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
251431637056Smrg      need_version=no
251531637056Smrg      need_lib_prefix=no
251631637056Smrg      ;;
251731637056Smrg    freebsd-*)
251831637056Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
251931637056Smrg      need_version=yes
252031637056Smrg      ;;
252131637056Smrg  esac
252231637056Smrg  shlibpath_var=LD_LIBRARY_PATH
252306f32fbeSmrg  case $host_os in
252431637056Smrg  freebsd2.*)
252531637056Smrg    shlibpath_overrides_runpath=yes
252606f32fbeSmrg    ;;
252731637056Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
252831637056Smrg    shlibpath_overrides_runpath=yes
252931637056Smrg    hardcode_into_libs=yes
253006f32fbeSmrg    ;;
253131637056Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
253231637056Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
253331637056Smrg    shlibpath_overrides_runpath=no
253431637056Smrg    hardcode_into_libs=yes
253506f32fbeSmrg    ;;
253631637056Smrg  *) # from 4.6 on, and DragonFly
253731637056Smrg    shlibpath_overrides_runpath=yes
253831637056Smrg    hardcode_into_libs=yes
253906f32fbeSmrg    ;;
254006f32fbeSmrg  esac
254131637056Smrg  ;;
254225b89263Smrg
254331637056Smrghaiku*)
254431637056Smrg  version_type=linux # correct to gnu/linux during the next big refactor
254531637056Smrg  need_lib_prefix=no
254631637056Smrg  need_version=no
254731637056Smrg  dynamic_linker="$host_os runtime_loader"
254831637056Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
254931637056Smrg  soname_spec='${libname}${release}${shared_ext}$major'
255031637056Smrg  shlibpath_var=LIBRARY_PATH
255131637056Smrg  shlibpath_overrides_runpath=yes
255231637056Smrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
255331637056Smrg  hardcode_into_libs=yes
255431637056Smrg  ;;
255525b89263Smrg
255631637056Smrghpux9* | hpux10* | hpux11*)
255731637056Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
255831637056Smrg  # link against other versions.
255931637056Smrg  version_type=sunos
256031637056Smrg  need_lib_prefix=no
256131637056Smrg  need_version=no
256231637056Smrg  case $host_cpu in
256331637056Smrg  ia64*)
256431637056Smrg    shrext_cmds='.so'
256531637056Smrg    hardcode_into_libs=yes
256631637056Smrg    dynamic_linker="$host_os dld.so"
256731637056Smrg    shlibpath_var=LD_LIBRARY_PATH
256831637056Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
256931637056Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
257031637056Smrg    soname_spec='${libname}${release}${shared_ext}$major'
257131637056Smrg    if test "X$HPUX_IA64_MODE" = X32; then
257231637056Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
257331637056Smrg    else
257431637056Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
257506f32fbeSmrg    fi
257631637056Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
257731637056Smrg    ;;
257831637056Smrg  hppa*64*)
257931637056Smrg    shrext_cmds='.sl'
258031637056Smrg    hardcode_into_libs=yes
258131637056Smrg    dynamic_linker="$host_os dld.sl"
258231637056Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
258331637056Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
258431637056Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
258531637056Smrg    soname_spec='${libname}${release}${shared_ext}$major'
258631637056Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
258731637056Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
258831637056Smrg    ;;
258931637056Smrg  *)
259031637056Smrg    shrext_cmds='.sl'
259131637056Smrg    dynamic_linker="$host_os dld.sl"
259231637056Smrg    shlibpath_var=SHLIB_PATH
259331637056Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
259431637056Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
259531637056Smrg    soname_spec='${libname}${release}${shared_ext}$major'
259625b89263Smrg    ;;
259725b89263Smrg  esac
259831637056Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
259931637056Smrg  postinstall_cmds='chmod 555 $lib'
260031637056Smrg  # or fails outright, so override atomically:
260131637056Smrg  install_override_mode=555
260231637056Smrg  ;;
260306f32fbeSmrg
260431637056Smrginterix[[3-9]]*)
260531637056Smrg  version_type=linux # correct to gnu/linux during the next big refactor
260631637056Smrg  need_lib_prefix=no
260731637056Smrg  need_version=no
260831637056Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
260931637056Smrg  soname_spec='${libname}${release}${shared_ext}$major'
261031637056Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
261131637056Smrg  shlibpath_var=LD_LIBRARY_PATH
261231637056Smrg  shlibpath_overrides_runpath=no
261331637056Smrg  hardcode_into_libs=yes
261431637056Smrg  ;;
261506f32fbeSmrg
261631637056Smrgirix5* | irix6* | nonstopux*)
261731637056Smrg  case $host_os in
261831637056Smrg    nonstopux*) version_type=nonstopux ;;
261931637056Smrg    *)
262031637056Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
262131637056Smrg		version_type=linux # correct to gnu/linux during the next big refactor
262231637056Smrg	else
262331637056Smrg		version_type=irix
262431637056Smrg	fi ;;
262506f32fbeSmrg  esac
262631637056Smrg  need_lib_prefix=no
262731637056Smrg  need_version=no
262831637056Smrg  soname_spec='${libname}${release}${shared_ext}$major'
262931637056Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
263031637056Smrg  case $host_os in
263131637056Smrg  irix5* | nonstopux*)
263231637056Smrg    libsuff= shlibsuff=
263331637056Smrg    ;;
263431637056Smrg  *)
263531637056Smrg    case $LD in # libtool.m4 will add one of these switches to LD
263631637056Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
263731637056Smrg      libsuff= shlibsuff= libmagic=32-bit;;
263831637056Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
263931637056Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
264031637056Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
264131637056Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
264231637056Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
264331637056Smrg    esac
264431637056Smrg    ;;
264531637056Smrg  esac
264631637056Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
264731637056Smrg  shlibpath_overrides_runpath=no
264831637056Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
264931637056Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
265031637056Smrg  hardcode_into_libs=yes
265131637056Smrg  ;;
265225b89263Smrg
265331637056Smrg# No shared lib support for Linux oldld, aout, or coff.
265431637056Smrglinux*oldld* | linux*aout* | linux*coff*)
265531637056Smrg  dynamic_linker=no
265631637056Smrg  ;;
265706f32fbeSmrg
265831637056Smrg# This must be glibc/ELF.
265931637056Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
266031637056Smrg  version_type=linux # correct to gnu/linux during the next big refactor
266131637056Smrg  need_lib_prefix=no
266231637056Smrg  need_version=no
266331637056Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
266431637056Smrg  soname_spec='${libname}${release}${shared_ext}$major'
266531637056Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
266631637056Smrg  shlibpath_var=LD_LIBRARY_PATH
266731637056Smrg  shlibpath_overrides_runpath=no
266825b89263Smrg
266931637056Smrg  # Some binutils ld are patched to set DT_RUNPATH
267031637056Smrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
267131637056Smrg    [lt_cv_shlibpath_overrides_runpath=no
267231637056Smrg    save_LDFLAGS=$LDFLAGS
267331637056Smrg    save_libdir=$libdir
267431637056Smrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
267531637056Smrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
267631637056Smrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
267731637056Smrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
267831637056Smrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
267931637056Smrg    LDFLAGS=$save_LDFLAGS
268031637056Smrg    libdir=$save_libdir
268131637056Smrg    ])
268231637056Smrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
268325b89263Smrg
268431637056Smrg  # This implies no fast_install, which is unacceptable.
268531637056Smrg  # Some rework will be needed to allow for fast_install
268631637056Smrg  # before this can be enabled.
268731637056Smrg  hardcode_into_libs=yes
268825b89263Smrg
268931637056Smrg  # Append ld.so.conf contents to the search path
269031637056Smrg  if test -f /etc/ld.so.conf; then
269131637056Smrg    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' ' '`
269231637056Smrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
269306f32fbeSmrg  fi
269425b89263Smrg
269531637056Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
269631637056Smrg  # powerpc, because MkLinux only supported shared libraries with the
269731637056Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
269831637056Smrg  # most powerpc-linux boxes support dynamic linking these days and
269931637056Smrg  # people can always --disable-shared, the test was removed, and we
270031637056Smrg  # assume the GNU/Linux dynamic linker is in use.
270131637056Smrg  dynamic_linker='GNU/Linux ld.so'
270231637056Smrg  ;;
270325b89263Smrg
270431637056Smrgnetbsdelf*-gnu)
270531637056Smrg  version_type=linux
270631637056Smrg  need_lib_prefix=no
270731637056Smrg  need_version=no
270831637056Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
270931637056Smrg  soname_spec='${libname}${release}${shared_ext}$major'
271031637056Smrg  shlibpath_var=LD_LIBRARY_PATH
271131637056Smrg  shlibpath_overrides_runpath=no
271231637056Smrg  hardcode_into_libs=yes
271331637056Smrg  dynamic_linker='NetBSD ld.elf_so'
271431637056Smrg  ;;
271525b89263Smrg
271631637056Smrgnetbsd*)
271731637056Smrg  version_type=sunos
271831637056Smrg  need_lib_prefix=no
271931637056Smrg  need_version=no
272031637056Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
272131637056Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
272231637056Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
272331637056Smrg    dynamic_linker='NetBSD (a.out) ld.so'
272406f32fbeSmrg  else
272531637056Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
272631637056Smrg    soname_spec='${libname}${release}${shared_ext}$major'
272731637056Smrg    dynamic_linker='NetBSD ld.elf_so'
272806f32fbeSmrg  fi
272931637056Smrg  shlibpath_var=LD_LIBRARY_PATH
273031637056Smrg  shlibpath_overrides_runpath=yes
273131637056Smrg  hardcode_into_libs=yes
273231637056Smrg  ;;
273325b89263Smrg
273431637056Smrgnewsos6)
273531637056Smrg  version_type=linux # correct to gnu/linux during the next big refactor
273631637056Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
273731637056Smrg  shlibpath_var=LD_LIBRARY_PATH
273831637056Smrg  shlibpath_overrides_runpath=yes
273931637056Smrg  ;;
274025b89263Smrg
274131637056Smrg*nto* | *qnx*)
274231637056Smrg  version_type=qnx
274331637056Smrg  need_lib_prefix=no
274431637056Smrg  need_version=no
274531637056Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
274631637056Smrg  soname_spec='${libname}${release}${shared_ext}$major'
274731637056Smrg  shlibpath_var=LD_LIBRARY_PATH
274831637056Smrg  shlibpath_overrides_runpath=no
274931637056Smrg  hardcode_into_libs=yes
275031637056Smrg  dynamic_linker='ldqnx.so'
275131637056Smrg  ;;
275206f32fbeSmrg
275331637056Smrgopenbsd*)
275431637056Smrg  version_type=sunos
275531637056Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
275631637056Smrg  need_lib_prefix=no
275731637056Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
275806f32fbeSmrg  case $host_os in
275931637056Smrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
276031637056Smrg    *)				need_version=no  ;;
276125b89263Smrg  esac
276231637056Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
276331637056Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
276431637056Smrg  shlibpath_var=LD_LIBRARY_PATH
276531637056Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
276631637056Smrg    case $host_os in
276731637056Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
276831637056Smrg	shlibpath_overrides_runpath=no
276931637056Smrg	;;
277031637056Smrg      *)
277131637056Smrg	shlibpath_overrides_runpath=yes
277231637056Smrg	;;
277331637056Smrg      esac
277431637056Smrg  else
277531637056Smrg    shlibpath_overrides_runpath=yes
277631637056Smrg  fi
277731637056Smrg  ;;
277825b89263Smrg
277931637056Smrgos2*)
278031637056Smrg  libname_spec='$name'
278131637056Smrg  shrext_cmds=".dll"
278231637056Smrg  need_lib_prefix=no
278331637056Smrg  library_names_spec='$libname${shared_ext} $libname.a'
278431637056Smrg  dynamic_linker='OS/2 ld.exe'
278506f32fbeSmrg  shlibpath_var=LIBPATH
278631637056Smrg  ;;
278725b89263Smrg
278831637056Smrgosf3* | osf4* | osf5*)
278931637056Smrg  version_type=osf
279031637056Smrg  need_lib_prefix=no
279131637056Smrg  need_version=no
279206f32fbeSmrg  soname_spec='${libname}${release}${shared_ext}$major'
279331637056Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
279431637056Smrg  shlibpath_var=LD_LIBRARY_PATH
279531637056Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
279631637056Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
279706f32fbeSmrg  ;;
279825b89263Smrg
279931637056Smrgrdos*)
280031637056Smrg  dynamic_linker=no
280131637056Smrg  ;;
280231637056Smrg
280331637056Smrgsolaris*)
280457ee1794Smrg  version_type=linux # correct to gnu/linux during the next big refactor
280506f32fbeSmrg  need_lib_prefix=no
280606f32fbeSmrg  need_version=no
280731637056Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
280831637056Smrg  soname_spec='${libname}${release}${shared_ext}$major'
280931637056Smrg  shlibpath_var=LD_LIBRARY_PATH
281031637056Smrg  shlibpath_overrides_runpath=yes
281106f32fbeSmrg  hardcode_into_libs=yes
281231637056Smrg  # ldd complains unless libraries are executable
281331637056Smrg  postinstall_cmds='chmod +x $lib'
281406f32fbeSmrg  ;;
281525b89263Smrg
281631637056Smrgsunos4*)
281731637056Smrg  version_type=sunos
281831637056Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
281931637056Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
282031637056Smrg  shlibpath_var=LD_LIBRARY_PATH
282131637056Smrg  shlibpath_overrides_runpath=yes
282231637056Smrg  if test "$with_gnu_ld" = yes; then
282331637056Smrg    need_lib_prefix=no
282431637056Smrg  fi
282531637056Smrg  need_version=yes
282606f32fbeSmrg  ;;
282725b89263Smrg
282831637056Smrgsysv4 | sysv4.3*)
282957ee1794Smrg  version_type=linux # correct to gnu/linux during the next big refactor
283006f32fbeSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
283106f32fbeSmrg  soname_spec='${libname}${release}${shared_ext}$major'
283206f32fbeSmrg  shlibpath_var=LD_LIBRARY_PATH
283331637056Smrg  case $host_vendor in
283431637056Smrg    sni)
283531637056Smrg      shlibpath_overrides_runpath=no
283631637056Smrg      need_lib_prefix=no
283731637056Smrg      runpath_var=LD_RUN_PATH
283806f32fbeSmrg      ;;
283931637056Smrg    siemens)
284031637056Smrg      need_lib_prefix=no
284106f32fbeSmrg      ;;
284231637056Smrg    motorola)
284331637056Smrg      need_lib_prefix=no
284431637056Smrg      need_version=no
284531637056Smrg      shlibpath_overrides_runpath=no
284631637056Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
284706f32fbeSmrg      ;;
284806f32fbeSmrg  esac
284906f32fbeSmrg  ;;
2850a253d6aeSmrg
285131637056Smrgsysv4*MP*)
285231637056Smrg  if test -d /usr/nec ;then
285331637056Smrg    version_type=linux # correct to gnu/linux during the next big refactor
285431637056Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
285531637056Smrg    soname_spec='$libname${shared_ext}.$major'
285631637056Smrg    shlibpath_var=LD_LIBRARY_PATH
285731637056Smrg  fi
285806f32fbeSmrg  ;;
2859a253d6aeSmrg
286031637056Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
286131637056Smrg  version_type=freebsd-elf
286206f32fbeSmrg  need_lib_prefix=no
286306f32fbeSmrg  need_version=no
286431637056Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
286557ee1794Smrg  soname_spec='${libname}${release}${shared_ext}$major'
286657ee1794Smrg  shlibpath_var=LD_LIBRARY_PATH
286731637056Smrg  shlibpath_overrides_runpath=yes
286831637056Smrg  hardcode_into_libs=yes
286931637056Smrg  if test "$with_gnu_ld" = yes; then
287031637056Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
287125b89263Smrg  else
287231637056Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
287306f32fbeSmrg    case $host_os in
287431637056Smrg      sco3.2v5*)
287531637056Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
287631637056Smrg	;;
287706f32fbeSmrg    esac
287825b89263Smrg  fi
287931637056Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
288006f32fbeSmrg  ;;
2881a253d6aeSmrg
288231637056Smrgtpf*)
288331637056Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
288457ee1794Smrg  version_type=linux # correct to gnu/linux during the next big refactor
288506f32fbeSmrg  need_lib_prefix=no
288606f32fbeSmrg  need_version=no
288731637056Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
288806f32fbeSmrg  shlibpath_var=LD_LIBRARY_PATH
288957ee1794Smrg  shlibpath_overrides_runpath=no
289006f32fbeSmrg  hardcode_into_libs=yes
289106f32fbeSmrg  ;;
2892a253d6aeSmrg
289331637056Smrguts4*)
289457ee1794Smrg  version_type=linux # correct to gnu/linux during the next big refactor
289531637056Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
289606f32fbeSmrg  soname_spec='${libname}${release}${shared_ext}$major'
289731637056Smrg  shlibpath_var=LD_LIBRARY_PATH
289806f32fbeSmrg  ;;
2899a253d6aeSmrg
290031637056Smrg*)
290106f32fbeSmrg  dynamic_linker=no
290206f32fbeSmrg  ;;
290331637056Smrgesac
290431637056SmrgAC_MSG_RESULT([$dynamic_linker])
290531637056Smrgtest "$dynamic_linker" = no && can_build_shared=no
2906a253d6aeSmrg
290731637056Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
290831637056Smrgif test "$GCC" = yes; then
290931637056Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
291031637056Smrgfi
2911a253d6aeSmrg
291231637056Smrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
291331637056Smrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
291431637056Smrgfi
291531637056Smrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
291631637056Smrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
291731637056Smrgfi
2918a253d6aeSmrg
291931637056Smrg_LT_DECL([], [variables_saved_for_relink], [1],
292031637056Smrg    [Variables whose values should be saved in libtool wrapper scripts and
292131637056Smrg    restored at link time])
292231637056Smrg_LT_DECL([], [need_lib_prefix], [0],
292331637056Smrg    [Do we need the "lib" prefix for modules?])
292431637056Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
292531637056Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
292631637056Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
292731637056Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
292831637056Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
292931637056Smrg    [Is shlibpath searched before the hard-coded library search path?])
293031637056Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
293131637056Smrg_LT_DECL([], [library_names_spec], [1],
293231637056Smrg    [[List of archive names.  First name is the real one, the rest are links.
293331637056Smrg    The last name is the one that the linker finds with -lNAME]])
293431637056Smrg_LT_DECL([], [soname_spec], [1],
293531637056Smrg    [[The coded name of the library, if different from the real name]])
293631637056Smrg_LT_DECL([], [install_override_mode], [1],
293731637056Smrg    [Permission mode override for installation of shared libraries])
293831637056Smrg_LT_DECL([], [postinstall_cmds], [2],
293931637056Smrg    [Command to use after installation of a shared archive])
294031637056Smrg_LT_DECL([], [postuninstall_cmds], [2],
294131637056Smrg    [Command to use after uninstallation of a shared archive])
294231637056Smrg_LT_DECL([], [finish_cmds], [2],
294331637056Smrg    [Commands used to finish a libtool library installation in a directory])
294431637056Smrg_LT_DECL([], [finish_eval], [1],
294531637056Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
294631637056Smrg    not shown]])
294731637056Smrg_LT_DECL([], [hardcode_into_libs], [0],
294831637056Smrg    [Whether we should hardcode library paths into libraries])
294931637056Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
295031637056Smrg    [Compile-time system search path for libraries])
295131637056Smrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
295231637056Smrg    [Run-time system search path for libraries])
295331637056Smrg])# _LT_SYS_DYNAMIC_LINKER
2954a253d6aeSmrg
2955a253d6aeSmrg
295631637056Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
295731637056Smrg# --------------------------
295831637056Smrg# find a file program which can recognize shared library
295931637056SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
296031637056Smrg[m4_require([_LT_DECL_EGREP])dnl
296131637056SmrgAC_MSG_CHECKING([for $1])
296231637056SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
296331637056Smrg[case $MAGIC_CMD in
296431637056Smrg[[\\/*] |  ?:[\\/]*])
296531637056Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
296606f32fbeSmrg  ;;
296731637056Smrg*)
296831637056Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
296931637056Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
297031637056Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
297131637056Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
297231637056Smrgdnl not every word.  This closes a longstanding sh security hole.
297331637056Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
297431637056Smrg  for ac_dir in $ac_dummy; do
297531637056Smrg    IFS="$lt_save_ifs"
297631637056Smrg    test -z "$ac_dir" && ac_dir=.
297731637056Smrg    if test -f $ac_dir/$1; then
297831637056Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
297931637056Smrg      if test -n "$file_magic_test_file"; then
298031637056Smrg	case $deplibs_check_method in
298131637056Smrg	"file_magic "*)
298231637056Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
298331637056Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
298431637056Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
298531637056Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
298631637056Smrg	    :
298731637056Smrg	  else
298831637056Smrg	    cat <<_LT_EOF 1>&2
2989a253d6aeSmrg
299031637056Smrg*** Warning: the command libtool uses to detect shared libraries,
299131637056Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
299231637056Smrg*** The result is that libtool may fail to recognize shared libraries
299331637056Smrg*** as such.  This will affect the creation of libtool libraries that
299431637056Smrg*** depend on shared libraries, but programs linked with such libtool
299531637056Smrg*** libraries will work regardless of this problem.  Nevertheless, you
299631637056Smrg*** may want to report the problem to your system manager and/or to
299731637056Smrg*** bug-libtool@gnu.org
2998a253d6aeSmrg
299931637056Smrg_LT_EOF
300031637056Smrg	  fi ;;
300131637056Smrg	esac
300231637056Smrg      fi
300331637056Smrg      break
300431637056Smrg    fi
300531637056Smrg  done
300631637056Smrg  IFS="$lt_save_ifs"
300731637056Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
300806f32fbeSmrg  ;;
300931637056Smrgesac])
301031637056SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
301131637056Smrgif test -n "$MAGIC_CMD"; then
301231637056Smrg  AC_MSG_RESULT($MAGIC_CMD)
301331637056Smrgelse
301431637056Smrg  AC_MSG_RESULT(no)
301531637056Smrgfi
301631637056Smrg_LT_DECL([], [MAGIC_CMD], [0],
301731637056Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
301831637056Smrg])# _LT_PATH_TOOL_PREFIX
3019a253d6aeSmrg
302031637056Smrg# Old name:
302131637056SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
302231637056Smrgdnl aclocal-1.4 backwards compatibility:
302331637056Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3024a253d6aeSmrg
302531637056Smrg
302631637056Smrg# _LT_PATH_MAGIC
302731637056Smrg# --------------
302831637056Smrg# find a file program which can recognize a shared library
302931637056Smrgm4_defun([_LT_PATH_MAGIC],
303031637056Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
303131637056Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
303231637056Smrg  if test -n "$ac_tool_prefix"; then
303331637056Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
303431637056Smrg  else
303531637056Smrg    MAGIC_CMD=:
303631637056Smrg  fi
303731637056Smrgfi
303831637056Smrg])# _LT_PATH_MAGIC
303931637056Smrg
304031637056Smrg
304131637056Smrg# LT_PATH_LD
304231637056Smrg# ----------
304331637056Smrg# find the pathname to the GNU or non-GNU linker
304431637056SmrgAC_DEFUN([LT_PATH_LD],
304531637056Smrg[AC_REQUIRE([AC_PROG_CC])dnl
304631637056SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
304731637056SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
304831637056Smrgm4_require([_LT_DECL_SED])dnl
304931637056Smrgm4_require([_LT_DECL_EGREP])dnl
305031637056Smrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
305131637056Smrg
305231637056SmrgAC_ARG_WITH([gnu-ld],
305331637056Smrg    [AS_HELP_STRING([--with-gnu-ld],
305431637056Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
305531637056Smrg    [test "$withval" = no || with_gnu_ld=yes],
305631637056Smrg    [with_gnu_ld=no])dnl
305731637056Smrg
305831637056Smrgac_prog=ld
305931637056Smrgif test "$GCC" = yes; then
306031637056Smrg  # Check if gcc -print-prog-name=ld gives a path.
306131637056Smrg  AC_MSG_CHECKING([for ld used by $CC])
306231637056Smrg  case $host in
306331637056Smrg  *-*-mingw*)
306431637056Smrg    # gcc leaves a trailing carriage return which upsets mingw
306531637056Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
306631637056Smrg  *)
306731637056Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3068ea133fd7Smrg  esac
306931637056Smrg  case $ac_prog in
307031637056Smrg    # Accept absolute paths.
307131637056Smrg    [[\\/]]* | ?:[[\\/]]*)
307231637056Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
307331637056Smrg      # Canonicalize the pathname of ld
307431637056Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
307531637056Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
307631637056Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
307731637056Smrg      done
307831637056Smrg      test -z "$LD" && LD="$ac_prog"
307931637056Smrg      ;;
308031637056Smrg  "")
308131637056Smrg    # If it fails, then pretend we aren't using GCC.
308231637056Smrg    ac_prog=ld
308331637056Smrg    ;;
308431637056Smrg  *)
308531637056Smrg    # If it is relative, then search for the first ld in PATH.
308631637056Smrg    with_gnu_ld=unknown
308731637056Smrg    ;;
308831637056Smrg  esac
308931637056Smrgelif test "$with_gnu_ld" = yes; then
309031637056Smrg  AC_MSG_CHECKING([for GNU ld])
309131637056Smrgelse
309231637056Smrg  AC_MSG_CHECKING([for non-GNU ld])
309331637056Smrgfi
309431637056SmrgAC_CACHE_VAL(lt_cv_path_LD,
309531637056Smrg[if test -z "$LD"; then
309631637056Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
309731637056Smrg  for ac_dir in $PATH; do
309831637056Smrg    IFS="$lt_save_ifs"
309931637056Smrg    test -z "$ac_dir" && ac_dir=.
310031637056Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
310131637056Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
310231637056Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
310331637056Smrg      # but apparently some variants of GNU ld only accept -v.
310431637056Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
310531637056Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
310631637056Smrg      *GNU* | *'with BFD'*)
310731637056Smrg	test "$with_gnu_ld" != no && break
310806f32fbeSmrg	;;
310906f32fbeSmrg      *)
311031637056Smrg	test "$with_gnu_ld" != yes && break
311106f32fbeSmrg	;;
311206f32fbeSmrg      esac
311331637056Smrg    fi
311431637056Smrg  done
311531637056Smrg  IFS="$lt_save_ifs"
311631637056Smrgelse
311731637056Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
311831637056Smrgfi])
311931637056SmrgLD="$lt_cv_path_LD"
312031637056Smrgif test -n "$LD"; then
312131637056Smrg  AC_MSG_RESULT($LD)
312231637056Smrgelse
312331637056Smrg  AC_MSG_RESULT(no)
312431637056Smrgfi
312531637056Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
312631637056Smrg_LT_PATH_LD_GNU
312731637056SmrgAC_SUBST([LD])
3128a253d6aeSmrg
312931637056Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
313031637056Smrg])# LT_PATH_LD
313131637056Smrg
313231637056Smrg# Old names:
313331637056SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
313431637056SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
313531637056Smrgdnl aclocal-1.4 backwards compatibility:
313631637056Smrgdnl AC_DEFUN([AM_PROG_LD], [])
313731637056Smrgdnl AC_DEFUN([AC_PROG_LD], [])
313831637056Smrg
313931637056Smrg
314031637056Smrg# _LT_PATH_LD_GNU
314131637056Smrg#- --------------
314231637056Smrgm4_defun([_LT_PATH_LD_GNU],
314331637056Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
314431637056Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
314531637056Smrgcase `$LD -v 2>&1 </dev/null` in
314631637056Smrg*GNU* | *'with BFD'*)
314731637056Smrg  lt_cv_prog_gnu_ld=yes
314831637056Smrg  ;;
314931637056Smrg*)
315031637056Smrg  lt_cv_prog_gnu_ld=no
315106f32fbeSmrg  ;;
315231637056Smrgesac])
315331637056Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
315431637056Smrg])# _LT_PATH_LD_GNU
3155a253d6aeSmrg
315631637056Smrg
315731637056Smrg# _LT_CMD_RELOAD
315831637056Smrg# --------------
315931637056Smrg# find reload flag for linker
316031637056Smrg#   -- PORTME Some linkers may need a different reload flag.
316131637056Smrgm4_defun([_LT_CMD_RELOAD],
316231637056Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
316331637056Smrg  lt_cv_ld_reload_flag,
316431637056Smrg  [lt_cv_ld_reload_flag='-r'])
316531637056Smrgreload_flag=$lt_cv_ld_reload_flag
316631637056Smrgcase $reload_flag in
316731637056Smrg"" | " "*) ;;
316831637056Smrg*) reload_flag=" $reload_flag" ;;
316931637056Smrgesac
317031637056Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
317131637056Smrgcase $host_os in
317231637056Smrg  cygwin* | mingw* | pw32* | cegcc*)
317331637056Smrg    if test "$GCC" != yes; then
317431637056Smrg      reload_cmds=false
317531637056Smrg    fi
317631637056Smrg    ;;
317731637056Smrg  darwin*)
317831637056Smrg    if test "$GCC" = yes; then
317931637056Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
318031637056Smrg    else
318131637056Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
318231637056Smrg    fi
318331637056Smrg    ;;
318431637056Smrgesac
318531637056Smrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
318631637056Smrg_LT_TAGDECL([], [reload_cmds], [2])dnl
318731637056Smrg])# _LT_CMD_RELOAD
318831637056Smrg
318931637056Smrg
319031637056Smrg# _LT_CHECK_MAGIC_METHOD
319131637056Smrg# ----------------------
319231637056Smrg# how to check for library dependencies
319331637056Smrg#  -- PORTME fill in with the dynamic library characteristics
319431637056Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
319531637056Smrg[m4_require([_LT_DECL_EGREP])
319631637056Smrgm4_require([_LT_DECL_OBJDUMP])
319731637056SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
319831637056Smrglt_cv_deplibs_check_method,
319931637056Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
320031637056Smrglt_cv_file_magic_test_file=
320131637056Smrglt_cv_deplibs_check_method='unknown'
320231637056Smrg# Need to set the preceding variable on all platforms that support
320331637056Smrg# interlibrary dependencies.
320431637056Smrg# 'none' -- dependencies not supported.
320531637056Smrg# `unknown' -- same as none, but documents that we really don't know.
320631637056Smrg# 'pass_all' -- all dependencies passed with no checks.
320731637056Smrg# 'test_compile' -- check by making test program.
320831637056Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
320931637056Smrg# which responds to the $file_magic_cmd with a given extended regex.
321031637056Smrg# If you have `file' or equivalent on your system and you're not sure
321131637056Smrg# whether `pass_all' will *always* work, you probably want this one.
321231637056Smrg
321331637056Smrgcase $host_os in
321431637056Smrgaix[[4-9]]*)
321531637056Smrg  lt_cv_deplibs_check_method=pass_all
321606f32fbeSmrg  ;;
321706f32fbeSmrg
321831637056Smrgbeos*)
321931637056Smrg  lt_cv_deplibs_check_method=pass_all
322006f32fbeSmrg  ;;
322106f32fbeSmrg
322231637056Smrgbsdi[[45]]*)
322331637056Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
322431637056Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
322531637056Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
322606f32fbeSmrg  ;;
322706f32fbeSmrg
322831637056Smrgcygwin*)
322931637056Smrg  # func_win32_libid is a shell function defined in ltmain.sh
323031637056Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
323131637056Smrg  lt_cv_file_magic_cmd='func_win32_libid'
323231637056Smrg  ;;
323331637056Smrg
323431637056Smrgmingw* | pw32*)
323531637056Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
323631637056Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
323731637056Smrg  # unless we find 'file', for example because we are cross-compiling.
323831637056Smrg  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
323931637056Smrg  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
324031637056Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
324131637056Smrg    lt_cv_file_magic_cmd='func_win32_libid'
324231637056Smrg  else
324331637056Smrg    # Keep this pattern in sync with the one in func_win32_libid.
324431637056Smrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
324531637056Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
324606f32fbeSmrg  fi
324706f32fbeSmrg  ;;
324806f32fbeSmrg
324931637056Smrgcegcc*)
325031637056Smrg  # use the weaker test based on 'objdump'. See mingw*.
325131637056Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
325231637056Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
325306f32fbeSmrg  ;;
325425b89263Smrg
325531637056Smrgdarwin* | rhapsody*)
325631637056Smrg  lt_cv_deplibs_check_method=pass_all
325725b89263Smrg  ;;
325825b89263Smrg
325931637056Smrgfreebsd* | dragonfly*)
326031637056Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
326131637056Smrg    case $host_cpu in
326231637056Smrg    i*86 )
326331637056Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
326431637056Smrg      # Let's accept both of them until this is cleared up.
326531637056Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
326631637056Smrg      lt_cv_file_magic_cmd=/usr/bin/file
326731637056Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
326831637056Smrg      ;;
326925b89263Smrg    esac
327031637056Smrg  else
327131637056Smrg    lt_cv_deplibs_check_method=pass_all
327225b89263Smrg  fi
327325b89263Smrg  ;;
3274a253d6aeSmrg
327531637056Smrghaiku*)
327631637056Smrg  lt_cv_deplibs_check_method=pass_all
327725b89263Smrg  ;;
3278ea133fd7Smrg
327931637056Smrghpux10.20* | hpux11*)
328031637056Smrg  lt_cv_file_magic_cmd=/usr/bin/file
328131637056Smrg  case $host_cpu in
328231637056Smrg  ia64*)
328331637056Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
328431637056Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
328531637056Smrg    ;;
328631637056Smrg  hppa*64*)
328731637056Smrg    [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]']
328831637056Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
328931637056Smrg    ;;
329031637056Smrg  *)
329131637056Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
329231637056Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
329331637056Smrg    ;;
329431637056Smrg  esac
329525b89263Smrg  ;;
329625b89263Smrg
329731637056Smrginterix[[3-9]]*)
329831637056Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
329931637056Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
330025b89263Smrg  ;;
330125b89263Smrg
330231637056Smrgirix5* | irix6* | nonstopux*)
330331637056Smrg  case $LD in
330431637056Smrg  *-32|*"-32 ") libmagic=32-bit;;
330531637056Smrg  *-n32|*"-n32 ") libmagic=N32;;
330631637056Smrg  *-64|*"-64 ") libmagic=64-bit;;
330731637056Smrg  *) libmagic=never-match;;
330831637056Smrg  esac
330931637056Smrg  lt_cv_deplibs_check_method=pass_all
331031637056Smrg  ;;
331125b89263Smrg
331231637056Smrg# This must be glibc/ELF.
331331637056Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
331431637056Smrg  lt_cv_deplibs_check_method=pass_all
331531637056Smrg  ;;
3316ea133fd7Smrg
331731637056Smrgnetbsd* | netbsdelf*-gnu)
331831637056Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
331931637056Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
332031637056Smrg  else
332131637056Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
332231637056Smrg  fi
332331637056Smrg  ;;
332425b89263Smrg
332531637056Smrgnewos6*)
332631637056Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
332731637056Smrg  lt_cv_file_magic_cmd=/usr/bin/file
332831637056Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
332931637056Smrg  ;;
333025b89263Smrg
333131637056Smrg*nto* | *qnx*)
333231637056Smrg  lt_cv_deplibs_check_method=pass_all
333325b89263Smrg  ;;
3334ea133fd7Smrg
333531637056Smrgopenbsd*)
333631637056Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
333731637056Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
333831637056Smrg  else
333931637056Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
334031637056Smrg  fi
334131637056Smrg  ;;
3342a253d6aeSmrg
334331637056Smrgosf3* | osf4* | osf5*)
334431637056Smrg  lt_cv_deplibs_check_method=pass_all
334525b89263Smrg  ;;
3346a253d6aeSmrg
334731637056Smrgrdos*)
334831637056Smrg  lt_cv_deplibs_check_method=pass_all
334931637056Smrg  ;;
3350a253d6aeSmrg
335131637056Smrgsolaris*)
335231637056Smrg  lt_cv_deplibs_check_method=pass_all
335331637056Smrg  ;;
335425b89263Smrg
335531637056Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
335631637056Smrg  lt_cv_deplibs_check_method=pass_all
335731637056Smrg  ;;
335806f32fbeSmrg
335931637056Smrgsysv4 | sysv4.3*)
336031637056Smrg  case $host_vendor in
336131637056Smrg  motorola)
336231637056Smrg    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]]'
336331637056Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
336406f32fbeSmrg    ;;
336531637056Smrg  ncr)
336631637056Smrg    lt_cv_deplibs_check_method=pass_all
336731637056Smrg    ;;
336831637056Smrg  sequent)
336931637056Smrg    lt_cv_file_magic_cmd='/bin/file'
337031637056Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
337131637056Smrg    ;;
337231637056Smrg  sni)
337331637056Smrg    lt_cv_file_magic_cmd='/bin/file'
337431637056Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
337531637056Smrg    lt_cv_file_magic_test_file=/lib/libc.so
337631637056Smrg    ;;
337731637056Smrg  siemens)
337831637056Smrg    lt_cv_deplibs_check_method=pass_all
337931637056Smrg    ;;
338031637056Smrg  pc)
338131637056Smrg    lt_cv_deplibs_check_method=pass_all
338206f32fbeSmrg    ;;
338306f32fbeSmrg  esac
338425b89263Smrg  ;;
338506f32fbeSmrg
338631637056Smrgtpf*)
338731637056Smrg  lt_cv_deplibs_check_method=pass_all
338831637056Smrg  ;;
338906f32fbeSmrgesac
339031637056Smrg])
339131637056Smrg
339231637056Smrgfile_magic_glob=
339331637056Smrgwant_nocaseglob=no
339431637056Smrgif test "$build" = "$host"; then
339531637056Smrg  case $host_os in
339631637056Smrg  mingw* | pw32*)
339731637056Smrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
339831637056Smrg      want_nocaseglob=yes
339906f32fbeSmrg    else
340031637056Smrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
340106f32fbeSmrg    fi
340206f32fbeSmrg    ;;
340331637056Smrg  esac
340431637056Smrgfi
340506f32fbeSmrg
340631637056Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
340731637056Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
340831637056Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
340906f32fbeSmrg
341031637056Smrg_LT_DECL([], [deplibs_check_method], [1],
341131637056Smrg    [Method to check whether dependent libraries are shared objects])
341231637056Smrg_LT_DECL([], [file_magic_cmd], [1],
341331637056Smrg    [Command to use when deplibs_check_method = "file_magic"])
341431637056Smrg_LT_DECL([], [file_magic_glob], [1],
341531637056Smrg    [How to find potential files when deplibs_check_method = "file_magic"])
341631637056Smrg_LT_DECL([], [want_nocaseglob], [1],
341731637056Smrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
341831637056Smrg])# _LT_CHECK_MAGIC_METHOD
3419a253d6aeSmrg
3420a253d6aeSmrg
342125b89263Smrg# LT_PATH_NM
342225b89263Smrg# ----------
342325b89263Smrg# find the pathname to a BSD- or MS-compatible name lister
342425b89263SmrgAC_DEFUN([LT_PATH_NM],
342525b89263Smrg[AC_REQUIRE([AC_PROG_CC])dnl
342625b89263SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
342725b89263Smrg[if test -n "$NM"; then
342825b89263Smrg  # Let the user override the test.
342925b89263Smrg  lt_cv_path_NM="$NM"
3430ea133fd7Smrgelse
343125b89263Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
343225b89263Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
343325b89263Smrg    lt_nm_to_check="$lt_nm_to_check nm"
343425b89263Smrg  fi
343525b89263Smrg  for lt_tmp_nm in $lt_nm_to_check; do
343625b89263Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
343725b89263Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
343825b89263Smrg      IFS="$lt_save_ifs"
343925b89263Smrg      test -z "$ac_dir" && ac_dir=.
344025b89263Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
344125b89263Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
344225b89263Smrg	# Check to see if the nm accepts a BSD-compat flag.
344325b89263Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
344425b89263Smrg	#   nm: unknown option "B" ignored
344525b89263Smrg	# Tru64's nm complains that /dev/null is an invalid object file
344625b89263Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
344725b89263Smrg	*/dev/null* | *'Invalid file or object type'*)
344825b89263Smrg	  lt_cv_path_NM="$tmp_nm -B"
344925b89263Smrg	  break
345025b89263Smrg	  ;;
345125b89263Smrg	*)
345225b89263Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
345325b89263Smrg	  */dev/null*)
345425b89263Smrg	    lt_cv_path_NM="$tmp_nm -p"
345525b89263Smrg	    break
345625b89263Smrg	    ;;
345725b89263Smrg	  *)
345825b89263Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
345925b89263Smrg	    continue # so that we can try to find one that supports BSD flags
346025b89263Smrg	    ;;
346125b89263Smrg	  esac
346225b89263Smrg	  ;;
346325b89263Smrg	esac
346425b89263Smrg      fi
346525b89263Smrg    done
346625b89263Smrg    IFS="$lt_save_ifs"
346725b89263Smrg  done
346825b89263Smrg  : ${lt_cv_path_NM=no}
346925b89263Smrgfi])
347025b89263Smrgif test "$lt_cv_path_NM" != "no"; then
347125b89263Smrg  NM="$lt_cv_path_NM"
347225b89263Smrgelse
347325b89263Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
347425b89263Smrg  if test -n "$DUMPBIN"; then :
347525b89263Smrg    # Let the user override the test.
347625b89263Smrg  else
347725b89263Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
347825b89263Smrg    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
347925b89263Smrg    *COFF*)
348025b89263Smrg      DUMPBIN="$DUMPBIN -symbols"
348125b89263Smrg      ;;
348225b89263Smrg    *)
348325b89263Smrg      DUMPBIN=:
348425b89263Smrg      ;;
348525b89263Smrg    esac
348625b89263Smrg  fi
348725b89263Smrg  AC_SUBST([DUMPBIN])
348825b89263Smrg  if test "$DUMPBIN" != ":"; then
348925b89263Smrg    NM="$DUMPBIN"
349025b89263Smrg  fi
3491ea133fd7Smrgfi
349225b89263Smrgtest -z "$NM" && NM=nm
349325b89263SmrgAC_SUBST([NM])
349425b89263Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
349525b89263Smrg
349625b89263SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
349725b89263Smrg  [lt_cv_nm_interface="BSD nm"
349825b89263Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
349925b89263Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
350025b89263Smrg  (eval "$ac_compile" 2>conftest.err)
350125b89263Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
350225b89263Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
350325b89263Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
350425b89263Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
350525b89263Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
350625b89263Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
350725b89263Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
350825b89263Smrg    lt_cv_nm_interface="MS dumpbin"
350925b89263Smrg  fi
351025b89263Smrg  rm -f conftest*])
351125b89263Smrg])# LT_PATH_NM
3512a253d6aeSmrg
351325b89263Smrg# Old names:
351425b89263SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
351525b89263SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3516ea133fd7Smrgdnl aclocal-1.4 backwards compatibility:
351725b89263Smrgdnl AC_DEFUN([AM_PROG_NM], [])
351825b89263Smrgdnl AC_DEFUN([AC_PROG_NM], [])
3519a253d6aeSmrg
352006f32fbeSmrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
352106f32fbeSmrg# --------------------------------
352206f32fbeSmrg# how to determine the name of the shared library
352306f32fbeSmrg# associated with a specific link library.
352406f32fbeSmrg#  -- PORTME fill in with the dynamic library characteristics
352506f32fbeSmrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
352606f32fbeSmrg[m4_require([_LT_DECL_EGREP])
352706f32fbeSmrgm4_require([_LT_DECL_OBJDUMP])
352806f32fbeSmrgm4_require([_LT_DECL_DLLTOOL])
352906f32fbeSmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
353006f32fbeSmrglt_cv_sharedlib_from_linklib_cmd,
353106f32fbeSmrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
353206f32fbeSmrg
353306f32fbeSmrgcase $host_os in
353406f32fbeSmrgcygwin* | mingw* | pw32* | cegcc*)
353506f32fbeSmrg  # two different shell functions defined in ltmain.sh
353606f32fbeSmrg  # decide which to use based on capabilities of $DLLTOOL
353706f32fbeSmrg  case `$DLLTOOL --help 2>&1` in
353806f32fbeSmrg  *--identify-strict*)
353906f32fbeSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
354006f32fbeSmrg    ;;
354106f32fbeSmrg  *)
354206f32fbeSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
354306f32fbeSmrg    ;;
354406f32fbeSmrg  esac
354506f32fbeSmrg  ;;
354606f32fbeSmrg*)
354706f32fbeSmrg  # fallback: assume linklib IS sharedlib
354806f32fbeSmrg  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
354906f32fbeSmrg  ;;
355006f32fbeSmrgesac
355106f32fbeSmrg])
355206f32fbeSmrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
355306f32fbeSmrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
355406f32fbeSmrg
355506f32fbeSmrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
355606f32fbeSmrg    [Command to associate shared and link libraries])
355706f32fbeSmrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
355806f32fbeSmrg
355906f32fbeSmrg
356006f32fbeSmrg# _LT_PATH_MANIFEST_TOOL
356106f32fbeSmrg# ----------------------
356206f32fbeSmrg# locate the manifest tool
356306f32fbeSmrgm4_defun([_LT_PATH_MANIFEST_TOOL],
356406f32fbeSmrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
356506f32fbeSmrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
356606f32fbeSmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
356706f32fbeSmrg  [lt_cv_path_mainfest_tool=no
356806f32fbeSmrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
356906f32fbeSmrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
357006f32fbeSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
357106f32fbeSmrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
357206f32fbeSmrg    lt_cv_path_mainfest_tool=yes
357306f32fbeSmrg  fi
357406f32fbeSmrg  rm -f conftest*])
357506f32fbeSmrgif test "x$lt_cv_path_mainfest_tool" != xyes; then
357606f32fbeSmrg  MANIFEST_TOOL=:
357706f32fbeSmrgfi
357806f32fbeSmrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
357906f32fbeSmrg])# _LT_PATH_MANIFEST_TOOL
358006f32fbeSmrg
3581a253d6aeSmrg
358225b89263Smrg# LT_LIB_M
358325b89263Smrg# --------
358425b89263Smrg# check for math library
358525b89263SmrgAC_DEFUN([LT_LIB_M],
358625b89263Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
358725b89263SmrgLIBM=
358825b89263Smrgcase $host in
358925b89263Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
359025b89263Smrg  # These system don't have libm, or don't need it
359125b89263Smrg  ;;
359225b89263Smrg*-ncr-sysv4.3*)
359325b89263Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
359425b89263Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
359525b89263Smrg  ;;
359625b89263Smrg*)
359725b89263Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
359825b89263Smrg  ;;
359925b89263Smrgesac
360025b89263SmrgAC_SUBST([LIBM])
360125b89263Smrg])# LT_LIB_M
360225b89263Smrg
360325b89263Smrg# Old name:
360425b89263SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
360525b89263Smrgdnl aclocal-1.4 backwards compatibility:
360625b89263Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3607ea133fd7Smrg
3608a253d6aeSmrg
360925b89263Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
361025b89263Smrg# -------------------------------
361125b89263Smrgm4_defun([_LT_COMPILER_NO_RTTI],
361225b89263Smrg[m4_require([_LT_TAG_COMPILER])dnl
3613a253d6aeSmrg
361425b89263Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3615ea133fd7Smrg
361625b89263Smrgif test "$GCC" = yes; then
361725b89263Smrg  case $cc_basename in
361825b89263Smrg  nvcc*)
361925b89263Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
362025b89263Smrg  *)
362125b89263Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
362225b89263Smrg  esac
3623ea133fd7Smrg
362425b89263Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
362525b89263Smrg    lt_cv_prog_compiler_rtti_exceptions,
362625b89263Smrg    [-fno-rtti -fno-exceptions], [],
362725b89263Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
362825b89263Smrgfi
362925b89263Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
363025b89263Smrg	[Compiler flag to turn off builtin functions])
363125b89263Smrg])# _LT_COMPILER_NO_RTTI
3632ea133fd7Smrg
3633ea133fd7Smrg
363425b89263Smrg# _LT_CMD_GLOBAL_SYMBOLS
363525b89263Smrg# ----------------------
363625b89263Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
363725b89263Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
363825b89263SmrgAC_REQUIRE([AC_PROG_CC])dnl
363925b89263SmrgAC_REQUIRE([AC_PROG_AWK])dnl
364025b89263SmrgAC_REQUIRE([LT_PATH_NM])dnl
364125b89263SmrgAC_REQUIRE([LT_PATH_LD])dnl
364225b89263Smrgm4_require([_LT_DECL_SED])dnl
364325b89263Smrgm4_require([_LT_DECL_EGREP])dnl
364425b89263Smrgm4_require([_LT_TAG_COMPILER])dnl
3645ea133fd7Smrg
364625b89263Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
364725b89263SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
364825b89263SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
364925b89263Smrg[
365025b89263Smrg# These are sane defaults that work on at least a few old systems.
365125b89263Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3652a253d6aeSmrg
365325b89263Smrg# Character class describing NM global symbol codes.
365425b89263Smrgsymcode='[[BCDEGRST]]'
3655a253d6aeSmrg
365625b89263Smrg# Regexp to match symbols that can be accessed directly from C.
365725b89263Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3658a253d6aeSmrg
365925b89263Smrg# Define system-specific variables.
366025b89263Smrgcase $host_os in
366125b89263Smrgaix*)
366225b89263Smrg  symcode='[[BCDT]]'
366325b89263Smrg  ;;
366425b89263Smrgcygwin* | mingw* | pw32* | cegcc*)
366525b89263Smrg  symcode='[[ABCDGISTW]]'
366625b89263Smrg  ;;
366725b89263Smrghpux*)
366825b89263Smrg  if test "$host_cpu" = ia64; then
366925b89263Smrg    symcode='[[ABCDEGRST]]'
367025b89263Smrg  fi
367125b89263Smrg  ;;
367225b89263Smrgirix* | nonstopux*)
367325b89263Smrg  symcode='[[BCDEGRST]]'
367425b89263Smrg  ;;
367525b89263Smrgosf*)
367625b89263Smrg  symcode='[[BCDEGQRST]]'
367725b89263Smrg  ;;
367825b89263Smrgsolaris*)
367925b89263Smrg  symcode='[[BDRT]]'
368025b89263Smrg  ;;
368125b89263Smrgsco3.2v5*)
368225b89263Smrg  symcode='[[DT]]'
368325b89263Smrg  ;;
368425b89263Smrgsysv4.2uw2*)
368525b89263Smrg  symcode='[[DT]]'
368625b89263Smrg  ;;
368725b89263Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
368825b89263Smrg  symcode='[[ABDT]]'
368925b89263Smrg  ;;
369025b89263Smrgsysv4)
369125b89263Smrg  symcode='[[DFNSTU]]'
369225b89263Smrg  ;;
369325b89263Smrgesac
3694a253d6aeSmrg
369525b89263Smrg# If we're using GNU nm, then use its standard symbol codes.
369625b89263Smrgcase `$NM -V 2>&1` in
369725b89263Smrg*GNU* | *'with BFD'*)
369825b89263Smrg  symcode='[[ABCDGIRSTW]]' ;;
369925b89263Smrgesac
3700a253d6aeSmrg
370125b89263Smrg# Transform an extracted symbol line into a proper C declaration.
370225b89263Smrg# Some systems (esp. on ia64) link data and code symbols differently,
370325b89263Smrg# so use this general approach.
370425b89263Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3705a253d6aeSmrg
370625b89263Smrg# Transform an extracted symbol line into symbol name and symbol address
370706f32fbeSmrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
370806f32fbeSmrglt_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'"
3709a253d6aeSmrg
371025b89263Smrg# Handle CRLF in mingw tool chain
371125b89263Smrgopt_cr=
371225b89263Smrgcase $build_os in
371325b89263Smrgmingw*)
371425b89263Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
371525b89263Smrg  ;;
371625b89263Smrgesac
3717ea133fd7Smrg
371825b89263Smrg# Try without a prefix underscore, then with it.
371925b89263Smrgfor ac_symprfx in "" "_"; do
3720a253d6aeSmrg
372125b89263Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
372225b89263Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
3723a253d6aeSmrg
372425b89263Smrg  # Write the raw and C identifiers.
372525b89263Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
372625b89263Smrg    # Fake it for dumpbin and say T for any non-static function
372725b89263Smrg    # and D for any global variable.
372825b89263Smrg    # Also find C++ and __fastcall symbols from MSVC++,
372925b89263Smrg    # which start with @ or ?.
373025b89263Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
373125b89263Smrg"     {last_section=section; section=\$ 3};"\
373257ee1794Smrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
373325b89263Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
373425b89263Smrg"     \$ 0!~/External *\|/{next};"\
373525b89263Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
373625b89263Smrg"     {if(hide[section]) next};"\
373725b89263Smrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
373825b89263Smrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
373925b89263Smrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
374025b89263Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
374125b89263Smrg"     ' prfx=^$ac_symprfx]"
374225b89263Smrg  else
374325b89263Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
374425b89263Smrg  fi
374506f32fbeSmrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
3746a253d6aeSmrg
374725b89263Smrg  # Check to see that the pipe works correctly.
374825b89263Smrg  pipe_works=no
3749ea133fd7Smrg
375025b89263Smrg  rm -f conftest*
375125b89263Smrg  cat > conftest.$ac_ext <<_LT_EOF
375225b89263Smrg#ifdef __cplusplus
375325b89263Smrgextern "C" {
375425b89263Smrg#endif
375525b89263Smrgchar nm_test_var;
375625b89263Smrgvoid nm_test_func(void);
375725b89263Smrgvoid nm_test_func(void){}
375825b89263Smrg#ifdef __cplusplus
375925b89263Smrg}
376025b89263Smrg#endif
376125b89263Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
376225b89263Smrg_LT_EOF
3763a253d6aeSmrg
376425b89263Smrg  if AC_TRY_EVAL(ac_compile); then
376525b89263Smrg    # Now try to grab the symbols.
376625b89263Smrg    nlist=conftest.nm
376725b89263Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
376825b89263Smrg      # Try sorting and uniquifying the output.
376925b89263Smrg      if sort "$nlist" | uniq > "$nlist"T; then
377025b89263Smrg	mv -f "$nlist"T "$nlist"
377125b89263Smrg      else
377225b89263Smrg	rm -f "$nlist"T
377325b89263Smrg      fi
3774a253d6aeSmrg
377525b89263Smrg      # Make sure that we snagged all the symbols we need.
377625b89263Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
377725b89263Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
377825b89263Smrg	  cat <<_LT_EOF > conftest.$ac_ext
377906f32fbeSmrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
378006f32fbeSmrg#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
378106f32fbeSmrg/* DATA imports from DLLs on WIN32 con't be const, because runtime
378206f32fbeSmrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
378306f32fbeSmrg# define LT@&t@_DLSYM_CONST
378406f32fbeSmrg#elif defined(__osf__)
378506f32fbeSmrg/* This system does not cope well with relocations in const data.  */
378606f32fbeSmrg# define LT@&t@_DLSYM_CONST
378706f32fbeSmrg#else
378806f32fbeSmrg# define LT@&t@_DLSYM_CONST const
378906f32fbeSmrg#endif
379006f32fbeSmrg
379125b89263Smrg#ifdef __cplusplus
379225b89263Smrgextern "C" {
379325b89263Smrg#endif
3794ea133fd7Smrg
379525b89263Smrg_LT_EOF
379625b89263Smrg	  # Now generate the symbol file.
379725b89263Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
3798ea133fd7Smrg
379925b89263Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
3800a253d6aeSmrg
380125b89263Smrg/* The mapping between symbol names and symbols.  */
380206f32fbeSmrgLT@&t@_DLSYM_CONST struct {
380325b89263Smrg  const char *name;
380425b89263Smrg  void       *address;
380525b89263Smrg}
380625b89263Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
380725b89263Smrg{
380825b89263Smrg  { "@PROGRAM@", (void *) 0 },
380925b89263Smrg_LT_EOF
381025b89263Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
381125b89263Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
381225b89263Smrg  {0, (void *) 0}
381325b89263Smrg};
3814ea133fd7Smrg
381525b89263Smrg/* This works around a problem in FreeBSD linker */
381625b89263Smrg#ifdef FREEBSD_WORKAROUND
381725b89263Smrgstatic const void *lt_preloaded_setup() {
381825b89263Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
381925b89263Smrg}
382025b89263Smrg#endif
3821a253d6aeSmrg
382225b89263Smrg#ifdef __cplusplus
382325b89263Smrg}
382425b89263Smrg#endif
382525b89263Smrg_LT_EOF
382625b89263Smrg	  # Now try linking the two files.
382725b89263Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
382806f32fbeSmrg	  lt_globsym_save_LIBS=$LIBS
382906f32fbeSmrg	  lt_globsym_save_CFLAGS=$CFLAGS
383025b89263Smrg	  LIBS="conftstm.$ac_objext"
383125b89263Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
383225b89263Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
383325b89263Smrg	    pipe_works=yes
383425b89263Smrg	  fi
383506f32fbeSmrg	  LIBS=$lt_globsym_save_LIBS
383606f32fbeSmrg	  CFLAGS=$lt_globsym_save_CFLAGS
3837ea133fd7Smrg	else
383825b89263Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
3839ea133fd7Smrg	fi
384025b89263Smrg      else
384125b89263Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
384225b89263Smrg      fi
384325b89263Smrg    else
384425b89263Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
384525b89263Smrg    fi
384625b89263Smrg  else
384725b89263Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
384825b89263Smrg    cat conftest.$ac_ext >&5
384925b89263Smrg  fi
385025b89263Smrg  rm -rf conftest* conftst*
3851a253d6aeSmrg
385225b89263Smrg  # Do not use the global_symbol_pipe unless it works.
385325b89263Smrg  if test "$pipe_works" = yes; then
385425b89263Smrg    break
385525b89263Smrg  else
385625b89263Smrg    lt_cv_sys_global_symbol_pipe=
385725b89263Smrg  fi
385825b89263Smrgdone
385925b89263Smrg])
386025b89263Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
386125b89263Smrg  lt_cv_sys_global_symbol_to_cdecl=
386225b89263Smrgfi
386325b89263Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
386425b89263Smrg  AC_MSG_RESULT(failed)
386525b89263Smrgelse
386625b89263Smrg  AC_MSG_RESULT(ok)
386725b89263Smrgfi
3868a253d6aeSmrg
386906f32fbeSmrg# Response file support.
387006f32fbeSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
387106f32fbeSmrg  nm_file_list_spec='@'
387206f32fbeSmrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
387306f32fbeSmrg  nm_file_list_spec='@'
387406f32fbeSmrgfi
387506f32fbeSmrg
387625b89263Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
387725b89263Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
387825b89263Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
387925b89263Smrg    [Transform the output of nm in a proper C declaration])
388025b89263Smrg_LT_DECL([global_symbol_to_c_name_address],
388125b89263Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
388225b89263Smrg    [Transform the output of nm in a C name address pair])
388325b89263Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
388425b89263Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
388525b89263Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
388606f32fbeSmrg_LT_DECL([], [nm_file_list_spec], [1],
388706f32fbeSmrg    [Specify filename containing input files for $NM])
388825b89263Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
3889a253d6aeSmrg
3890a253d6aeSmrg
389125b89263Smrg# _LT_COMPILER_PIC([TAGNAME])
389225b89263Smrg# ---------------------------
389325b89263Smrgm4_defun([_LT_COMPILER_PIC],
389425b89263Smrg[m4_require([_LT_TAG_COMPILER])dnl
389525b89263Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
389625b89263Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
389725b89263Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
3898a253d6aeSmrg
389925b89263Smrgm4_if([$1], [CXX], [
390025b89263Smrg  # C++ specific cases for pic, static, wl, etc.
390125b89263Smrg  if test "$GXX" = yes; then
390225b89263Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
390325b89263Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3904a253d6aeSmrg
390525b89263Smrg    case $host_os in
390625b89263Smrg    aix*)
390725b89263Smrg      # All AIX code is PIC.
390825b89263Smrg      if test "$host_cpu" = ia64; then
390925b89263Smrg	# AIX 5 now supports IA64 processor
391025b89263Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
391125b89263Smrg      fi
391225b89263Smrg      ;;
3913ea133fd7Smrg
391425b89263Smrg    amigaos*)
391525b89263Smrg      case $host_cpu in
391625b89263Smrg      powerpc)
391725b89263Smrg            # see comment about AmigaOS4 .so support
391825b89263Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3919ea133fd7Smrg        ;;
392025b89263Smrg      m68k)
392125b89263Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
392225b89263Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
392325b89263Smrg            # like `-m68040'.
392425b89263Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3925ea133fd7Smrg        ;;
392625b89263Smrg      esac
392725b89263Smrg      ;;
3928a253d6aeSmrg
392925b89263Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
393025b89263Smrg      # PIC is the default for these OSes.
393125b89263Smrg      ;;
393225b89263Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
393325b89263Smrg      # This hack is so that the source file can tell whether it is being
393425b89263Smrg      # built for inclusion in a dll (and should export symbols for example).
393525b89263Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
393625b89263Smrg      # (--disable-auto-import) libraries
393725b89263Smrg      m4_if([$1], [GCJ], [],
393825b89263Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
393925b89263Smrg      ;;
394025b89263Smrg    darwin* | rhapsody*)
394125b89263Smrg      # PIC is the default on this platform
394225b89263Smrg      # Common symbols not allowed in MH_DYLIB files
394325b89263Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
394425b89263Smrg      ;;
394525b89263Smrg    *djgpp*)
394625b89263Smrg      # DJGPP does not support shared libraries at all
394725b89263Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
394825b89263Smrg      ;;
394925b89263Smrg    haiku*)
395025b89263Smrg      # PIC is the default for Haiku.
395125b89263Smrg      # The "-static" flag exists, but is broken.
395225b89263Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
395325b89263Smrg      ;;
395425b89263Smrg    interix[[3-9]]*)
395525b89263Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
395625b89263Smrg      # Instead, we relocate shared libraries at runtime.
395725b89263Smrg      ;;
395825b89263Smrg    sysv4*MP*)
395925b89263Smrg      if test -d /usr/nec; then
396025b89263Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
396125b89263Smrg      fi
396225b89263Smrg      ;;
396325b89263Smrg    hpux*)
396425b89263Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
396525b89263Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
396625b89263Smrg      # sets the default TLS model and affects inlining.
396725b89263Smrg      case $host_cpu in
396825b89263Smrg      hppa*64*)
3969ea133fd7Smrg	;;
397025b89263Smrg      *)
397125b89263Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
397225b89263Smrg	;;
397325b89263Smrg      esac
397425b89263Smrg      ;;
397525b89263Smrg    *qnx* | *nto*)
397625b89263Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
397725b89263Smrg      # it will coredump.
397825b89263Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
397925b89263Smrg      ;;
398025b89263Smrg    *)
398125b89263Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
398225b89263Smrg      ;;
398325b89263Smrg    esac
398425b89263Smrg  else
398525b89263Smrg    case $host_os in
398625b89263Smrg      aix[[4-9]]*)
398725b89263Smrg	# All AIX code is PIC.
398825b89263Smrg	if test "$host_cpu" = ia64; then
398925b89263Smrg	  # AIX 5 now supports IA64 processor
399025b89263Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
399125b89263Smrg	else
399225b89263Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
399325b89263Smrg	fi
399425b89263Smrg	;;
399525b89263Smrg      chorus*)
399625b89263Smrg	case $cc_basename in
399725b89263Smrg	cxch68*)
399825b89263Smrg	  # Green Hills C++ Compiler
399925b89263Smrg	  # _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"
400025b89263Smrg	  ;;
400125b89263Smrg	esac
400225b89263Smrg	;;
400306f32fbeSmrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
400406f32fbeSmrg	# This hack is so that the source file can tell whether it is being
400506f32fbeSmrg	# built for inclusion in a dll (and should export symbols for example).
400606f32fbeSmrg	m4_if([$1], [GCJ], [],
400706f32fbeSmrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
400806f32fbeSmrg	;;
400925b89263Smrg      dgux*)
401025b89263Smrg	case $cc_basename in
401125b89263Smrg	  ec++*)
401225b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4013ea133fd7Smrg	    ;;
401425b89263Smrg	  ghcx*)
401525b89263Smrg	    # Green Hills C++ Compiler
401625b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4017ea133fd7Smrg	    ;;
401825b89263Smrg	  *)
4019ea133fd7Smrg	    ;;
402025b89263Smrg	esac
402125b89263Smrg	;;
402225b89263Smrg      freebsd* | dragonfly*)
402325b89263Smrg	# FreeBSD uses GNU C++
402425b89263Smrg	;;
402525b89263Smrg      hpux9* | hpux10* | hpux11*)
402625b89263Smrg	case $cc_basename in
402725b89263Smrg	  CC*)
402825b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
402925b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
403025b89263Smrg	    if test "$host_cpu" != ia64; then
403125b89263Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
403225b89263Smrg	    fi
4033ea133fd7Smrg	    ;;
403425b89263Smrg	  aCC*)
403525b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
403625b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
403725b89263Smrg	    case $host_cpu in
403825b89263Smrg	    hppa*64*|ia64*)
403925b89263Smrg	      # +Z the default
4040ea133fd7Smrg	      ;;
404125b89263Smrg	    *)
404225b89263Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4043ea133fd7Smrg	      ;;
4044ea133fd7Smrg	    esac
404525b89263Smrg	    ;;
404625b89263Smrg	  *)
404725b89263Smrg	    ;;
404825b89263Smrg	esac
404925b89263Smrg	;;
405025b89263Smrg      interix*)
405125b89263Smrg	# This is c89, which is MS Visual C++ (no shared libs)
405225b89263Smrg	# Anyone wants to do a port?
405325b89263Smrg	;;
405425b89263Smrg      irix5* | irix6* | nonstopux*)
405525b89263Smrg	case $cc_basename in
405625b89263Smrg	  CC*)
405725b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
405825b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
405925b89263Smrg	    # CC pic flag -KPIC is the default.
406025b89263Smrg	    ;;
406125b89263Smrg	  *)
406225b89263Smrg	    ;;
406325b89263Smrg	esac
406425b89263Smrg	;;
406531637056Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
406625b89263Smrg	case $cc_basename in
406725b89263Smrg	  KCC*)
406825b89263Smrg	    # KAI C++ Compiler
406925b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
407025b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
407125b89263Smrg	    ;;
407225b89263Smrg	  ecpc* )
407325b89263Smrg	    # old Intel C++ for x86_64 which still supported -KPIC.
407425b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
407525b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
407625b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
407725b89263Smrg	    ;;
407825b89263Smrg	  icpc* )
407925b89263Smrg	    # Intel C++, used to be incompatible with GCC.
408025b89263Smrg	    # ICC 10 doesn't accept -KPIC any more.
408125b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
408225b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
408325b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
408425b89263Smrg	    ;;
408525b89263Smrg	  pgCC* | pgcpp*)
408625b89263Smrg	    # Portland Group C++ compiler
408725b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
408825b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
408925b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
409025b89263Smrg	    ;;
4091ea133fd7Smrg	  cxx*)
4092ea133fd7Smrg	    # Compaq C++
409325b89263Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
409425b89263Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
409525b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
409625b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4097ea133fd7Smrg	    ;;
409825b89263Smrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
409925b89263Smrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
410025b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
410125b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
410225b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4103ea133fd7Smrg	    ;;
4104ea133fd7Smrg	  *)
4105ea133fd7Smrg	    case `$CC -V 2>&1 | sed 5q` in
4106ea133fd7Smrg	    *Sun\ C*)
4107ea133fd7Smrg	      # Sun C++ 5.9
410825b89263Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
410925b89263Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
411025b89263Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4111ea133fd7Smrg	      ;;
4112ea133fd7Smrg	    esac
4113ea133fd7Smrg	    ;;
4114ea133fd7Smrg	esac
4115ea133fd7Smrg	;;
411625b89263Smrg      lynxos*)
411725b89263Smrg	;;
411825b89263Smrg      m88k*)
411925b89263Smrg	;;
412025b89263Smrg      mvs*)
412125b89263Smrg	case $cc_basename in
412225b89263Smrg	  cxx*)
412325b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
412425b89263Smrg	    ;;
412525b89263Smrg	  *)
412625b89263Smrg	    ;;
412725b89263Smrg	esac
412825b89263Smrg	;;
412931637056Smrg      netbsd* | netbsdelf*-gnu)
413025b89263Smrg	;;
413125b89263Smrg      *qnx* | *nto*)
413225b89263Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
413325b89263Smrg        # it will coredump.
413425b89263Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
413525b89263Smrg        ;;
413625b89263Smrg      osf3* | osf4* | osf5*)
413725b89263Smrg	case $cc_basename in
413825b89263Smrg	  KCC*)
413925b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
414025b89263Smrg	    ;;
414125b89263Smrg	  RCC*)
414225b89263Smrg	    # Rational C++ 2.4.1
414325b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
414425b89263Smrg	    ;;
414525b89263Smrg	  cxx*)
414625b89263Smrg	    # Digital/Compaq C++
414725b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
414825b89263Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
414925b89263Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
415025b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
415125b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
415225b89263Smrg	    ;;
415325b89263Smrg	  *)
415425b89263Smrg	    ;;
415525b89263Smrg	esac
415625b89263Smrg	;;
415725b89263Smrg      psos*)
4158ea133fd7Smrg	;;
415925b89263Smrg      solaris*)
416025b89263Smrg	case $cc_basename in
416125b89263Smrg	  CC* | sunCC*)
416225b89263Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
416325b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
416425b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
416525b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
416625b89263Smrg	    ;;
416725b89263Smrg	  gcx*)
416825b89263Smrg	    # Green Hills C++ Compiler
416925b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
417025b89263Smrg	    ;;
417125b89263Smrg	  *)
417225b89263Smrg	    ;;
417325b89263Smrg	esac
4174ea133fd7Smrg	;;
417525b89263Smrg      sunos4*)
417625b89263Smrg	case $cc_basename in
417725b89263Smrg	  CC*)
417825b89263Smrg	    # Sun C++ 4.x
417925b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
418025b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
418125b89263Smrg	    ;;
418225b89263Smrg	  lcc*)
418325b89263Smrg	    # Lucid
418425b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4185ea133fd7Smrg	    ;;
4186ea133fd7Smrg	  *)
4187ea133fd7Smrg	    ;;
4188ea133fd7Smrg	esac
4189ea133fd7Smrg	;;
419025b89263Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
419125b89263Smrg	case $cc_basename in
419225b89263Smrg	  CC*)
419325b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
419425b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
419525b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
419625b89263Smrg	    ;;
419725b89263Smrg	esac
4198ea133fd7Smrg	;;
419925b89263Smrg      tandem*)
420025b89263Smrg	case $cc_basename in
420125b89263Smrg	  NCC*)
420225b89263Smrg	    # NonStop-UX NCC 3.20
420325b89263Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
420425b89263Smrg	    ;;
420525b89263Smrg	  *)
420625b89263Smrg	    ;;
420725b89263Smrg	esac
4208ea133fd7Smrg	;;
420925b89263Smrg      vxworks*)
4210ea133fd7Smrg	;;
421125b89263Smrg      *)
421225b89263Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4213ea133fd7Smrg	;;
421425b89263Smrg    esac
421525b89263Smrg  fi
421625b89263Smrg],
421725b89263Smrg[
421825b89263Smrg  if test "$GCC" = yes; then
421925b89263Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
422025b89263Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4221a253d6aeSmrg
422225b89263Smrg    case $host_os in
422325b89263Smrg      aix*)
422425b89263Smrg      # All AIX code is PIC.
422525b89263Smrg      if test "$host_cpu" = ia64; then
422625b89263Smrg	# AIX 5 now supports IA64 processor
422725b89263Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
422825b89263Smrg      fi
422925b89263Smrg      ;;
4230a253d6aeSmrg
423125b89263Smrg    amigaos*)
423225b89263Smrg      case $host_cpu in
423325b89263Smrg      powerpc)
423425b89263Smrg            # see comment about AmigaOS4 .so support
423525b89263Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
423625b89263Smrg        ;;
423725b89263Smrg      m68k)
423825b89263Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
423925b89263Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
424025b89263Smrg            # like `-m68040'.
424125b89263Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
424225b89263Smrg        ;;
424325b89263Smrg      esac
424425b89263Smrg      ;;
4245ea133fd7Smrg
424625b89263Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
424725b89263Smrg      # PIC is the default for these OSes.
424825b89263Smrg      ;;
4249ea133fd7Smrg
425025b89263Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
425125b89263Smrg      # This hack is so that the source file can tell whether it is being
425225b89263Smrg      # built for inclusion in a dll (and should export symbols for example).
425325b89263Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
425425b89263Smrg      # (--disable-auto-import) libraries
425525b89263Smrg      m4_if([$1], [GCJ], [],
425625b89263Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
425725b89263Smrg      ;;
4258ea133fd7Smrg
425925b89263Smrg    darwin* | rhapsody*)
426025b89263Smrg      # PIC is the default on this platform
426125b89263Smrg      # Common symbols not allowed in MH_DYLIB files
426225b89263Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
426325b89263Smrg      ;;
4264a253d6aeSmrg
426525b89263Smrg    haiku*)
426625b89263Smrg      # PIC is the default for Haiku.
426725b89263Smrg      # The "-static" flag exists, but is broken.
426825b89263Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
426925b89263Smrg      ;;
4270a253d6aeSmrg
427125b89263Smrg    hpux*)
427225b89263Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
427325b89263Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
427425b89263Smrg      # sets the default TLS model and affects inlining.
427525b89263Smrg      case $host_cpu in
427625b89263Smrg      hppa*64*)
427725b89263Smrg	# +Z the default
427825b89263Smrg	;;
427925b89263Smrg      *)
428025b89263Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
428125b89263Smrg	;;
428225b89263Smrg      esac
428325b89263Smrg      ;;
4284a253d6aeSmrg
428525b89263Smrg    interix[[3-9]]*)
428625b89263Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
428725b89263Smrg      # Instead, we relocate shared libraries at runtime.
428825b89263Smrg      ;;
4289ea133fd7Smrg
429025b89263Smrg    msdosdjgpp*)
429125b89263Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
429225b89263Smrg      # on systems that don't support them.
429325b89263Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
429425b89263Smrg      enable_shared=no
429525b89263Smrg      ;;
4296a253d6aeSmrg
429725b89263Smrg    *nto* | *qnx*)
429825b89263Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
429925b89263Smrg      # it will coredump.
430025b89263Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
430125b89263Smrg      ;;
4302a253d6aeSmrg
430325b89263Smrg    sysv4*MP*)
430425b89263Smrg      if test -d /usr/nec; then
430525b89263Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
430625b89263Smrg      fi
430725b89263Smrg      ;;
4308a253d6aeSmrg
430925b89263Smrg    *)
431025b89263Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
431125b89263Smrg      ;;
431225b89263Smrg    esac
4313ea133fd7Smrg
431425b89263Smrg    case $cc_basename in
431525b89263Smrg    nvcc*) # Cuda Compiler Driver 2.2
431625b89263Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
431757ee1794Smrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
431857ee1794Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
431957ee1794Smrg      fi
432025b89263Smrg      ;;
432125b89263Smrg    esac
432225b89263Smrg  else
432325b89263Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
432425b89263Smrg    case $host_os in
432525b89263Smrg    aix*)
432625b89263Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
432725b89263Smrg      if test "$host_cpu" = ia64; then
432825b89263Smrg	# AIX 5 now supports IA64 processor
432925b89263Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
433025b89263Smrg      else
433125b89263Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
433225b89263Smrg      fi
433325b89263Smrg      ;;
4334ea133fd7Smrg
433525b89263Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
433625b89263Smrg      # This hack is so that the source file can tell whether it is being
433725b89263Smrg      # built for inclusion in a dll (and should export symbols for example).
433825b89263Smrg      m4_if([$1], [GCJ], [],
433925b89263Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
434025b89263Smrg      ;;
4341ea133fd7Smrg
434225b89263Smrg    hpux9* | hpux10* | hpux11*)
434325b89263Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
434425b89263Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
434525b89263Smrg      # not for PA HP-UX.
434625b89263Smrg      case $host_cpu in
434725b89263Smrg      hppa*64*|ia64*)
434825b89263Smrg	# +Z the default
434925b89263Smrg	;;
435025b89263Smrg      *)
435125b89263Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
435225b89263Smrg	;;
435325b89263Smrg      esac
435425b89263Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
435525b89263Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
435625b89263Smrg      ;;
4357a253d6aeSmrg
435825b89263Smrg    irix5* | irix6* | nonstopux*)
435925b89263Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
436025b89263Smrg      # PIC (with -KPIC) is the default.
436125b89263Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
436225b89263Smrg      ;;
4363a253d6aeSmrg
436431637056Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
4365ea133fd7Smrg      case $cc_basename in
436625b89263Smrg      # old Intel for x86_64 which still supported -KPIC.
436725b89263Smrg      ecc*)
436825b89263Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
436925b89263Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
437025b89263Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
437125b89263Smrg        ;;
437225b89263Smrg      # icc used to be incompatible with GCC.
437325b89263Smrg      # ICC 10 doesn't accept -KPIC any more.
437425b89263Smrg      icc* | ifort*)
437525b89263Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
437625b89263Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
437725b89263Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
437825b89263Smrg        ;;
437925b89263Smrg      # Lahey Fortran 8.1.
438025b89263Smrg      lf95*)
438125b89263Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
438225b89263Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
438325b89263Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
438425b89263Smrg	;;
438506f32fbeSmrg      nagfor*)
438606f32fbeSmrg	# NAG Fortran compiler
438706f32fbeSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
438806f32fbeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
438906f32fbeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
439006f32fbeSmrg	;;
439125b89263Smrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
439225b89263Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
439325b89263Smrg	# which looks to be a dead project)
439425b89263Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
439525b89263Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
439625b89263Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
439725b89263Smrg        ;;
439825b89263Smrg      ccc*)
439925b89263Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
440025b89263Smrg        # All Alpha code is PIC.
440125b89263Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
440225b89263Smrg        ;;
440325b89263Smrg      xl* | bgxl* | bgf* | mpixl*)
440425b89263Smrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
440525b89263Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
440625b89263Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
440725b89263Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
440825b89263Smrg	;;
440925b89263Smrg      *)
441025b89263Smrg	case `$CC -V 2>&1 | sed 5q` in
441157ee1794Smrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
441225b89263Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
441325b89263Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
441425b89263Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
441525b89263Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4416ea133fd7Smrg	  ;;
441757ee1794Smrg	*Sun\ F* | *Sun*Fortran*)
441857ee1794Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
441957ee1794Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
442057ee1794Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
442157ee1794Smrg	  ;;
442225b89263Smrg	*Sun\ C*)
442325b89263Smrg	  # Sun C 5.9
442425b89263Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
442525b89263Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
442625b89263Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4427ea133fd7Smrg	  ;;
442857ee1794Smrg        *Intel*\ [[CF]]*Compiler*)
442957ee1794Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
443057ee1794Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
443157ee1794Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
443257ee1794Smrg	  ;;
443357ee1794Smrg	*Portland\ Group*)
443457ee1794Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
443557ee1794Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
443657ee1794Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
443757ee1794Smrg	  ;;
443825b89263Smrg	esac
443925b89263Smrg	;;
4440ea133fd7Smrg      esac
4441ea133fd7Smrg      ;;
4442a253d6aeSmrg
444325b89263Smrg    newsos6)
444425b89263Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
444525b89263Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
444625b89263Smrg      ;;
4447a253d6aeSmrg
444825b89263Smrg    *nto* | *qnx*)
444925b89263Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
445025b89263Smrg      # it will coredump.
445125b89263Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4452ea133fd7Smrg      ;;
4453a253d6aeSmrg
445425b89263Smrg    osf3* | osf4* | osf5*)
445525b89263Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
445625b89263Smrg      # All OSF/1 code is PIC.
445725b89263Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
445825b89263Smrg      ;;
4459a253d6aeSmrg
446025b89263Smrg    rdos*)
446125b89263Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
446225b89263Smrg      ;;
4463a253d6aeSmrg
446425b89263Smrg    solaris*)
446525b89263Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
446625b89263Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
446725b89263Smrg      case $cc_basename in
446825b89263Smrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
446925b89263Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4470ea133fd7Smrg      *)
447125b89263Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
447225b89263Smrg      esac
447325b89263Smrg      ;;
4474a253d6aeSmrg
447525b89263Smrg    sunos4*)
447625b89263Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
447725b89263Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
447825b89263Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
447925b89263Smrg      ;;
4480ea133fd7Smrg
448125b89263Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
448225b89263Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
448325b89263Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
448425b89263Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
448525b89263Smrg      ;;
4486ea133fd7Smrg
448725b89263Smrg    sysv4*MP*)
448825b89263Smrg      if test -d /usr/nec ;then
448925b89263Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
449025b89263Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
449125b89263Smrg      fi
449225b89263Smrg      ;;
4493ea133fd7Smrg
449425b89263Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
449525b89263Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
449625b89263Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
449725b89263Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
449825b89263Smrg      ;;
4499ea133fd7Smrg
450025b89263Smrg    unicos*)
450125b89263Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
450225b89263Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
450325b89263Smrg      ;;
4504a253d6aeSmrg
450525b89263Smrg    uts4*)
450625b89263Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
450725b89263Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
450825b89263Smrg      ;;
4509a253d6aeSmrg
451025b89263Smrg    *)
451125b89263Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
451225b89263Smrg      ;;
451325b89263Smrg    esac
451425b89263Smrg  fi
451525b89263Smrg])
451625b89263Smrgcase $host_os in
451725b89263Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
451825b89263Smrg  *djgpp*)
451925b89263Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
452025b89263Smrg    ;;
452125b89263Smrg  *)
452225b89263Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
452325b89263Smrg    ;;
452425b89263Smrgesac
452506f32fbeSmrg
452606f32fbeSmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
452706f32fbeSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
452806f32fbeSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
452906f32fbeSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
4530a253d6aeSmrg
453125b89263Smrg#
453225b89263Smrg# Check to make sure the PIC flag actually works.
453325b89263Smrg#
453425b89263Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
453525b89263Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
453625b89263Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
453725b89263Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
453825b89263Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
453925b89263Smrg     "" | " "*) ;;
454025b89263Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
454125b89263Smrg     esac],
454225b89263Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
454325b89263Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
454425b89263Smrgfi
454525b89263Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
454625b89263Smrg	[Additional compiler flags for building library objects])
4547a253d6aeSmrg
454806f32fbeSmrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
454906f32fbeSmrg	[How to pass a linker flag through the compiler])
455025b89263Smrg#
455125b89263Smrg# Check to make sure the static flag actually works.
455225b89263Smrg#
455325b89263Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
455425b89263Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
455525b89263Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
455625b89263Smrg  $lt_tmp_static_flag,
455725b89263Smrg  [],
455825b89263Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
455925b89263Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
456025b89263Smrg	[Compiler flag to prevent dynamic linking])
456125b89263Smrg])# _LT_COMPILER_PIC
4562a253d6aeSmrg
4563a253d6aeSmrg
456425b89263Smrg# _LT_LINKER_SHLIBS([TAGNAME])
456525b89263Smrg# ----------------------------
456625b89263Smrg# See if the linker supports building shared libraries.
456725b89263Smrgm4_defun([_LT_LINKER_SHLIBS],
456825b89263Smrg[AC_REQUIRE([LT_PATH_LD])dnl
456925b89263SmrgAC_REQUIRE([LT_PATH_NM])dnl
457006f32fbeSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
457125b89263Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
457225b89263Smrgm4_require([_LT_DECL_EGREP])dnl
457325b89263Smrgm4_require([_LT_DECL_SED])dnl
457425b89263Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
457525b89263Smrgm4_require([_LT_TAG_COMPILER])dnl
457625b89263SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
457725b89263Smrgm4_if([$1], [CXX], [
457825b89263Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
457906f32fbeSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
458025b89263Smrg  case $host_os in
458125b89263Smrg  aix[[4-9]]*)
458225b89263Smrg    # If we're using GNU nm, then we don't want the "-C" option.
458325b89263Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
458425b89263Smrg    # Also, AIX nm treats weak defined symbols like other global defined
458525b89263Smrg    # symbols, whereas GNU nm marks them as "W".
458625b89263Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
458725b89263Smrg      _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'
458825b89263Smrg    else
458925b89263Smrg      _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'
459025b89263Smrg    fi
459125b89263Smrg    ;;
459225b89263Smrg  pw32*)
459325b89263Smrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
459406f32fbeSmrg    ;;
459525b89263Smrg  cygwin* | mingw* | cegcc*)
459606f32fbeSmrg    case $cc_basename in
459757ee1794Smrg    cl*)
459857ee1794Smrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
459957ee1794Smrg      ;;
460006f32fbeSmrg    *)
460106f32fbeSmrg      _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'
460206f32fbeSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
460306f32fbeSmrg      ;;
460406f32fbeSmrg    esac
460506f32fbeSmrg    ;;
460631637056Smrg  linux* | k*bsd*-gnu | gnu*)
460731637056Smrg    _LT_TAGVAR(link_all_deplibs, $1)=no
460831637056Smrg    ;;
460925b89263Smrg  *)
461025b89263Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
461106f32fbeSmrg    ;;
461225b89263Smrg  esac
461325b89263Smrg], [
461425b89263Smrg  runpath_var=
461525b89263Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
461625b89263Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
461725b89263Smrg  _LT_TAGVAR(archive_cmds, $1)=
461825b89263Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
461925b89263Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
462025b89263Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
462125b89263Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
462225b89263Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
462325b89263Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
462425b89263Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
462525b89263Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
462625b89263Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
462725b89263Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
462825b89263Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
462925b89263Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
463025b89263Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
463125b89263Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
463225b89263Smrg  _LT_TAGVAR(module_cmds, $1)=
463325b89263Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
463425b89263Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
463525b89263Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
463625b89263Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
463725b89263Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
463825b89263Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
463925b89263Smrg  # included in the symbol list
464025b89263Smrg  _LT_TAGVAR(include_expsyms, $1)=
464125b89263Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
464225b89263Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
464325b89263Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
464425b89263Smrg  # as well as any symbol that contains `d'.
464525b89263Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
464625b89263Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
464725b89263Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
464825b89263Smrg  # the symbol is explicitly referenced.  Since portable code cannot
464925b89263Smrg  # rely on this symbol name, it's probably fine to never include it in
465025b89263Smrg  # preloaded symbol tables.
465125b89263Smrg  # Exclude shared library initialization/finalization symbols.
465225b89263Smrgdnl Note also adjust exclude_expsyms for C++ above.
465325b89263Smrg  extract_expsyms_cmds=
465425b89263Smrg
465525b89263Smrg  case $host_os in
465625b89263Smrg  cygwin* | mingw* | pw32* | cegcc*)
465725b89263Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
465825b89263Smrg    # When not using gcc, we currently assume that we are using
465925b89263Smrg    # Microsoft Visual C++.
466025b89263Smrg    if test "$GCC" != yes; then
466125b89263Smrg      with_gnu_ld=no
466225b89263Smrg    fi
466325b89263Smrg    ;;
466425b89263Smrg  interix*)
466525b89263Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
466625b89263Smrg    with_gnu_ld=yes
466725b89263Smrg    ;;
466825b89263Smrg  openbsd*)
466925b89263Smrg    with_gnu_ld=no
467025b89263Smrg    ;;
467131637056Smrg  linux* | k*bsd*-gnu | gnu*)
467231637056Smrg    _LT_TAGVAR(link_all_deplibs, $1)=no
467331637056Smrg    ;;
467425b89263Smrg  esac
4675a253d6aeSmrg
467625b89263Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
4677a253d6aeSmrg
467825b89263Smrg  # On some targets, GNU ld is compatible enough with the native linker
467925b89263Smrg  # that we're better off using the native interface for both.
468025b89263Smrg  lt_use_gnu_ld_interface=no
468125b89263Smrg  if test "$with_gnu_ld" = yes; then
468225b89263Smrg    case $host_os in
468325b89263Smrg      aix*)
468425b89263Smrg	# The AIX port of GNU ld has always aspired to compatibility
468525b89263Smrg	# with the native linker.  However, as the warning in the GNU ld
468625b89263Smrg	# block says, versions before 2.19.5* couldn't really create working
468725b89263Smrg	# shared libraries, regardless of the interface used.
468825b89263Smrg	case `$LD -v 2>&1` in
468925b89263Smrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
469025b89263Smrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
469125b89263Smrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
469225b89263Smrg	  *)
469325b89263Smrg	    lt_use_gnu_ld_interface=yes
469425b89263Smrg	    ;;
469525b89263Smrg	esac
469625b89263Smrg	;;
469725b89263Smrg      *)
469825b89263Smrg	lt_use_gnu_ld_interface=yes
469925b89263Smrg	;;
470025b89263Smrg    esac
470125b89263Smrg  fi
4702a253d6aeSmrg
470325b89263Smrg  if test "$lt_use_gnu_ld_interface" = yes; then
470425b89263Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
470525b89263Smrg    wlarc='${wl}'
4706a253d6aeSmrg
470725b89263Smrg    # Set some defaults for GNU ld with shared library support. These
470825b89263Smrg    # are reset later if shared libraries are not supported. Putting them
470925b89263Smrg    # here allows them to be overridden if necessary.
471025b89263Smrg    runpath_var=LD_RUN_PATH
471125b89263Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
471225b89263Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
471325b89263Smrg    # ancient GNU ld didn't support --whole-archive et. al.
471425b89263Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
471525b89263Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
471625b89263Smrg    else
471725b89263Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
471825b89263Smrg    fi
471925b89263Smrg    supports_anon_versioning=no
472025b89263Smrg    case `$LD -v 2>&1` in
472125b89263Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
472225b89263Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
472325b89263Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
472425b89263Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
472525b89263Smrg      *\ 2.11.*) ;; # other 2.11 versions
472625b89263Smrg      *) supports_anon_versioning=yes ;;
472725b89263Smrg    esac
4728a253d6aeSmrg
472925b89263Smrg    # See if GNU ld supports shared libraries.
473025b89263Smrg    case $host_os in
473125b89263Smrg    aix[[3-9]]*)
473225b89263Smrg      # On AIX/PPC, the GNU linker is very broken
473325b89263Smrg      if test "$host_cpu" != ia64; then
473425b89263Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
473525b89263Smrg	cat <<_LT_EOF 1>&2
4736a253d6aeSmrg
473725b89263Smrg*** Warning: the GNU linker, at least up to release 2.19, is reported
473825b89263Smrg*** to be unable to reliably create shared libraries on AIX.
473925b89263Smrg*** Therefore, libtool is disabling shared libraries support.  If you
474025b89263Smrg*** really care for shared libraries, you may want to install binutils
474125b89263Smrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
474225b89263Smrg*** You will then need to restart the configuration process.
4743a253d6aeSmrg
474425b89263Smrg_LT_EOF
474525b89263Smrg      fi
474625b89263Smrg      ;;
4747a253d6aeSmrg
474825b89263Smrg    amigaos*)
474925b89263Smrg      case $host_cpu in
475025b89263Smrg      powerpc)
475125b89263Smrg            # see comment about AmigaOS4 .so support
475225b89263Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
475325b89263Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
475425b89263Smrg        ;;
475525b89263Smrg      m68k)
475625b89263Smrg            _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)'
475725b89263Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
475825b89263Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
475925b89263Smrg        ;;
476025b89263Smrg      esac
476125b89263Smrg      ;;
4762a253d6aeSmrg
476325b89263Smrg    beos*)
476425b89263Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
476525b89263Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
476625b89263Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
476725b89263Smrg	# support --undefined.  This deserves some investigation.  FIXME
476825b89263Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
476925b89263Smrg      else
477025b89263Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
477125b89263Smrg      fi
477225b89263Smrg      ;;
4773a253d6aeSmrg
477425b89263Smrg    cygwin* | mingw* | pw32* | cegcc*)
477525b89263Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
477625b89263Smrg      # as there is no search path for DLLs.
477725b89263Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
477825b89263Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
477925b89263Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
478025b89263Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
478125b89263Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
478206f32fbeSmrg      _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'
478306f32fbeSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4784ea133fd7Smrg
478525b89263Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
478625b89263Smrg        _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'
478725b89263Smrg	# If the export-symbols file already is a .def file (1st line
478825b89263Smrg	# is EXPORTS), use it as is; otherwise, prepend...
478925b89263Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
479025b89263Smrg	  cp $export_symbols $output_objdir/$soname.def;
479125b89263Smrg	else
479225b89263Smrg	  echo EXPORTS > $output_objdir/$soname.def;
479325b89263Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
479425b89263Smrg	fi~
479525b89263Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
479625b89263Smrg      else
479725b89263Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
479825b89263Smrg      fi
4799ea133fd7Smrg      ;;
4800a253d6aeSmrg
480125b89263Smrg    haiku*)
480225b89263Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
480325b89263Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
480425b89263Smrg      ;;
4805a253d6aeSmrg
480625b89263Smrg    interix[[3-9]]*)
480725b89263Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
480825b89263Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
480925b89263Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
481025b89263Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
481125b89263Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
481225b89263Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
481325b89263Smrg      # default) and relocated if they conflict, which is a slow very memory
481425b89263Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
481525b89263Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
481625b89263Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
481725b89263Smrg      _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'
481825b89263Smrg      _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'
4819ea133fd7Smrg      ;;
4820a253d6aeSmrg
482125b89263Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
482225b89263Smrg      tmp_diet=no
482325b89263Smrg      if test "$host_os" = linux-dietlibc; then
482425b89263Smrg	case $cc_basename in
482525b89263Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
482625b89263Smrg	esac
482725b89263Smrg      fi
482825b89263Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
482925b89263Smrg	 && test "$tmp_diet" = no
483025b89263Smrg      then
483106f32fbeSmrg	tmp_addflag=' $pic_flag'
483225b89263Smrg	tmp_sharedflag='-shared'
483325b89263Smrg	case $cc_basename,$host_cpu in
483425b89263Smrg        pgcc*)				# Portland Group C compiler
483525b89263Smrg	  _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'
483625b89263Smrg	  tmp_addflag=' $pic_flag'
483725b89263Smrg	  ;;
483825b89263Smrg	pgf77* | pgf90* | pgf95* | pgfortran*)
483925b89263Smrg					# Portland Group f77 and f90 compilers
484025b89263Smrg	  _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'
484125b89263Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
484225b89263Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
484325b89263Smrg	  tmp_addflag=' -i_dynamic' ;;
484425b89263Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
484525b89263Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
484625b89263Smrg	ifc* | ifort*)			# Intel Fortran compiler
484725b89263Smrg	  tmp_addflag=' -nofor_main' ;;
484825b89263Smrg	lf95*)				# Lahey Fortran 8.1
484925b89263Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
485025b89263Smrg	  tmp_sharedflag='--shared' ;;
485125b89263Smrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
485225b89263Smrg	  tmp_sharedflag='-qmkshrobj'
485325b89263Smrg	  tmp_addflag= ;;
485425b89263Smrg	nvcc*)	# Cuda Compiler Driver 2.2
485525b89263Smrg	  _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'
485625b89263Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
485725b89263Smrg	  ;;
485825b89263Smrg	esac
485925b89263Smrg	case `$CC -V 2>&1 | sed 5q` in
486025b89263Smrg	*Sun\ C*)			# Sun C 5.9
486125b89263Smrg	  _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'
486225b89263Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
486325b89263Smrg	  tmp_sharedflag='-G' ;;
486425b89263Smrg	*Sun\ F*)			# Sun Fortran 8.3
486525b89263Smrg	  tmp_sharedflag='-G' ;;
486625b89263Smrg	esac
486725b89263Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4868a253d6aeSmrg
486925b89263Smrg        if test "x$supports_anon_versioning" = xyes; then
487025b89263Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
487125b89263Smrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
487225b89263Smrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
487325b89263Smrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
487425b89263Smrg        fi
4875ea133fd7Smrg
487625b89263Smrg	case $cc_basename in
487725b89263Smrg	xlf* | bgf* | bgxlf* | mpixlf*)
487825b89263Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
487925b89263Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
488057ee1794Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
488125b89263Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
488225b89263Smrg	  if test "x$supports_anon_versioning" = xyes; then
488325b89263Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
488425b89263Smrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
488525b89263Smrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
488625b89263Smrg	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
488725b89263Smrg	  fi
488825b89263Smrg	  ;;
488925b89263Smrg	esac
489025b89263Smrg      else
489125b89263Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
489225b89263Smrg      fi
489325b89263Smrg      ;;
4894ea133fd7Smrg
489531637056Smrg    netbsd* | netbsdelf*-gnu)
489625b89263Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
489725b89263Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
489825b89263Smrg	wlarc=
489925b89263Smrg      else
490006f32fbeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
490106f32fbeSmrg	_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'
490225b89263Smrg      fi
490325b89263Smrg      ;;
4904a253d6aeSmrg
490525b89263Smrg    solaris*)
490625b89263Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
490725b89263Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
490825b89263Smrg	cat <<_LT_EOF 1>&2
4909a253d6aeSmrg
491025b89263Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
491125b89263Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
491225b89263Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
491325b89263Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
491425b89263Smrg*** your PATH or compiler configuration so that the native linker is
491525b89263Smrg*** used, and then restart.
4916a253d6aeSmrg
491725b89263Smrg_LT_EOF
491825b89263Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
491906f32fbeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
492006f32fbeSmrg	_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'
492125b89263Smrg      else
492225b89263Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
492325b89263Smrg      fi
492425b89263Smrg      ;;
4925a253d6aeSmrg
492625b89263Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
492725b89263Smrg      case `$LD -v 2>&1` in
492825b89263Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
492925b89263Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
493025b89263Smrg	cat <<_LT_EOF 1>&2
4931a253d6aeSmrg
493225b89263Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
493325b89263Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
493425b89263Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
493525b89263Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
493625b89263Smrg*** your PATH or compiler configuration so that the native linker is
493725b89263Smrg*** used, and then restart.
4938a253d6aeSmrg
493925b89263Smrg_LT_EOF
494025b89263Smrg	;;
494125b89263Smrg	*)
494225b89263Smrg	  # For security reasons, it is highly recommended that you always
494325b89263Smrg	  # use absolute paths for naming shared libraries, and exclude the
494425b89263Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
494525b89263Smrg	  # requires that you compile everything twice, which is a pain.
494625b89263Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
494725b89263Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
494825b89263Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
494925b89263Smrg	    _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'
495025b89263Smrg	  else
495125b89263Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
495225b89263Smrg	  fi
495325b89263Smrg	;;
495425b89263Smrg      esac
495525b89263Smrg      ;;
4956ea133fd7Smrg
495725b89263Smrg    sunos4*)
495825b89263Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
495925b89263Smrg      wlarc=
496025b89263Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
496125b89263Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
496225b89263Smrg      ;;
4963a253d6aeSmrg
496425b89263Smrg    *)
496525b89263Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
496606f32fbeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
496706f32fbeSmrg	_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'
496825b89263Smrg      else
496925b89263Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
497025b89263Smrg      fi
497125b89263Smrg      ;;
497225b89263Smrg    esac
4973a253d6aeSmrg
497425b89263Smrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
497525b89263Smrg      runpath_var=
497625b89263Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
497725b89263Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
497825b89263Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
497925b89263Smrg    fi
498025b89263Smrg  else
498125b89263Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
498225b89263Smrg    case $host_os in
498325b89263Smrg    aix3*)
498425b89263Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
498525b89263Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
498625b89263Smrg      _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'
498725b89263Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
498825b89263Smrg      # are no directories specified by -L.
498925b89263Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
499025b89263Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
499125b89263Smrg	# Neither direct hardcoding nor static linking is supported with a
499225b89263Smrg	# broken collect2.
499325b89263Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
499425b89263Smrg      fi
499525b89263Smrg      ;;
4996a253d6aeSmrg
499725b89263Smrg    aix[[4-9]]*)
499825b89263Smrg      if test "$host_cpu" = ia64; then
499925b89263Smrg	# On IA64, the linker does run time linking by default, so we don't
500025b89263Smrg	# have to do anything special.
500125b89263Smrg	aix_use_runtimelinking=no
500225b89263Smrg	exp_sym_flag='-Bexport'
500325b89263Smrg	no_entry_flag=""
500425b89263Smrg      else
500525b89263Smrg	# If we're using GNU nm, then we don't want the "-C" option.
500625b89263Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
500725b89263Smrg	# Also, AIX nm treats weak defined symbols like other global
500825b89263Smrg	# defined symbols, whereas GNU nm marks them as "W".
500925b89263Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
501025b89263Smrg	  _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'
501125b89263Smrg	else
501225b89263Smrg	  _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'
501325b89263Smrg	fi
501425b89263Smrg	aix_use_runtimelinking=no
5015a253d6aeSmrg
501625b89263Smrg	# Test if we are trying to use run time linking or normal
501725b89263Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
501825b89263Smrg	# need to do runtime linking.
501925b89263Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
502025b89263Smrg	  for ld_flag in $LDFLAGS; do
502125b89263Smrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
502225b89263Smrg	    aix_use_runtimelinking=yes
502325b89263Smrg	    break
502425b89263Smrg	  fi
502525b89263Smrg	  done
502625b89263Smrg	  ;;
502725b89263Smrg	esac
5028a253d6aeSmrg
502925b89263Smrg	exp_sym_flag='-bexport'
503025b89263Smrg	no_entry_flag='-bnoentry'
503125b89263Smrg      fi
5032a253d6aeSmrg
503325b89263Smrg      # When large executables or shared objects are built, AIX ld can
503425b89263Smrg      # have problems creating the table of contents.  If linking a library
503525b89263Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
503625b89263Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
503725b89263Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5038ea133fd7Smrg
503925b89263Smrg      _LT_TAGVAR(archive_cmds, $1)=''
504025b89263Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
504125b89263Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
504225b89263Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
504325b89263Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
504425b89263Smrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
5045ea133fd7Smrg
504625b89263Smrg      if test "$GCC" = yes; then
504725b89263Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
504825b89263Smrg	# We only want to do this on AIX 4.2 and lower, the check
504925b89263Smrg	# below for broken collect2 doesn't work under 4.3+
505025b89263Smrg	  collect2name=`${CC} -print-prog-name=collect2`
505125b89263Smrg	  if test -f "$collect2name" &&
505225b89263Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
505325b89263Smrg	  then
505425b89263Smrg	  # We have reworked collect2
505525b89263Smrg	  :
505625b89263Smrg	  else
505725b89263Smrg	  # We have old collect2
505825b89263Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
505925b89263Smrg	  # It fails to find uninstalled libraries when the uninstalled
506025b89263Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
506125b89263Smrg	  # to unsupported forces relinking
506225b89263Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
506325b89263Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
506425b89263Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
506525b89263Smrg	  fi
506625b89263Smrg	  ;;
506725b89263Smrg	esac
506825b89263Smrg	shared_flag='-shared'
506925b89263Smrg	if test "$aix_use_runtimelinking" = yes; then
507025b89263Smrg	  shared_flag="$shared_flag "'${wl}-G'
507125b89263Smrg	fi
507231637056Smrg	_LT_TAGVAR(link_all_deplibs, $1)=no
507325b89263Smrg      else
507425b89263Smrg	# not using gcc
507525b89263Smrg	if test "$host_cpu" = ia64; then
507625b89263Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
507725b89263Smrg	# chokes on -Wl,-G. The following line is correct:
507825b89263Smrg	  shared_flag='-G'
507925b89263Smrg	else
508025b89263Smrg	  if test "$aix_use_runtimelinking" = yes; then
508125b89263Smrg	    shared_flag='${wl}-G'
508225b89263Smrg	  else
508325b89263Smrg	    shared_flag='${wl}-bM:SRE'
508425b89263Smrg	  fi
508525b89263Smrg	fi
508625b89263Smrg      fi
5087ea133fd7Smrg
508825b89263Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
508925b89263Smrg      # It seems that -bexpall does not export symbols beginning with
509025b89263Smrg      # underscore (_), so it is better to generate a list of symbols to export.
509125b89263Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
509225b89263Smrg      if test "$aix_use_runtimelinking" = yes; then
509325b89263Smrg	# Warning - without using the other runtime loading flags (-brtl),
509425b89263Smrg	# -berok will link without error, but may produce a broken library.
509525b89263Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
509625b89263Smrg        # Determine the default libpath from the value encoded in an
509725b89263Smrg        # empty executable.
509806f32fbeSmrg        _LT_SYS_MODULE_PATH_AIX([$1])
509925b89263Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
510025b89263Smrg        _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"
510125b89263Smrg      else
510225b89263Smrg	if test "$host_cpu" = ia64; then
510325b89263Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
510425b89263Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
510525b89263Smrg	  _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"
510625b89263Smrg	else
510725b89263Smrg	 # Determine the default libpath from the value encoded in an
510825b89263Smrg	 # empty executable.
510906f32fbeSmrg	 _LT_SYS_MODULE_PATH_AIX([$1])
511025b89263Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
511125b89263Smrg	  # Warning - without using the other run time loading flags,
511225b89263Smrg	  # -berok will link without error, but may produce a broken library.
511325b89263Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
511425b89263Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
511525b89263Smrg	  if test "$with_gnu_ld" = yes; then
511625b89263Smrg	    # We only use this code for GNU lds that support --whole-archive.
511725b89263Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
511825b89263Smrg	  else
511925b89263Smrg	    # Exported symbols can be pulled into shared objects from archives
512025b89263Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
512125b89263Smrg	  fi
512225b89263Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
512325b89263Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
512425b89263Smrg	  _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'
512525b89263Smrg	fi
512625b89263Smrg      fi
512725b89263Smrg      ;;
5128ea133fd7Smrg
512925b89263Smrg    amigaos*)
513025b89263Smrg      case $host_cpu in
513125b89263Smrg      powerpc)
513225b89263Smrg            # see comment about AmigaOS4 .so support
513325b89263Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
513425b89263Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
513525b89263Smrg        ;;
513625b89263Smrg      m68k)
513725b89263Smrg            _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)'
513825b89263Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
513925b89263Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
514025b89263Smrg        ;;
514125b89263Smrg      esac
514225b89263Smrg      ;;
5143ea133fd7Smrg
514425b89263Smrg    bsdi[[45]]*)
514525b89263Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
514625b89263Smrg      ;;
5147a253d6aeSmrg
514825b89263Smrg    cygwin* | mingw* | pw32* | cegcc*)
514925b89263Smrg      # When not using gcc, we currently assume that we are using
515025b89263Smrg      # Microsoft Visual C++.
515125b89263Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
515225b89263Smrg      # no search path for DLLs.
515306f32fbeSmrg      case $cc_basename in
515406f32fbeSmrg      cl*)
515506f32fbeSmrg	# Native MSVC
515606f32fbeSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
515706f32fbeSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
515806f32fbeSmrg	_LT_TAGVAR(always_export_symbols, $1)=yes
515906f32fbeSmrg	_LT_TAGVAR(file_list_spec, $1)='@'
516006f32fbeSmrg	# Tell ltmain to make .lib files, not .a files.
516106f32fbeSmrg	libext=lib
516206f32fbeSmrg	# Tell ltmain to make .dll files, not .so files.
516306f32fbeSmrg	shrext_cmds=".dll"
516406f32fbeSmrg	# FIXME: Setting linknames here is a bad hack.
516506f32fbeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
516606f32fbeSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
516706f32fbeSmrg	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
516806f32fbeSmrg	  else
516906f32fbeSmrg	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
517006f32fbeSmrg	  fi~
517106f32fbeSmrg	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
517206f32fbeSmrg	  linknames='
517306f32fbeSmrg	# The linker will not automatically build a static lib if we build a DLL.
517406f32fbeSmrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
517506f32fbeSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
517657ee1794Smrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
517706f32fbeSmrg	_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'
517806f32fbeSmrg	# Don't use ranlib
517906f32fbeSmrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
518006f32fbeSmrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
518106f32fbeSmrg	  lt_tool_outputfile="@TOOL_OUTPUT@"~
518206f32fbeSmrg	  case $lt_outputfile in
518306f32fbeSmrg	    *.exe|*.EXE) ;;
518406f32fbeSmrg	    *)
518506f32fbeSmrg	      lt_outputfile="$lt_outputfile.exe"
518606f32fbeSmrg	      lt_tool_outputfile="$lt_tool_outputfile.exe"
518706f32fbeSmrg	      ;;
518806f32fbeSmrg	  esac~
518906f32fbeSmrg	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
519006f32fbeSmrg	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
519106f32fbeSmrg	    $RM "$lt_outputfile.manifest";
519206f32fbeSmrg	  fi'
519306f32fbeSmrg	;;
519406f32fbeSmrg      *)
519506f32fbeSmrg	# Assume MSVC wrapper
519606f32fbeSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
519706f32fbeSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
519806f32fbeSmrg	# Tell ltmain to make .lib files, not .a files.
519906f32fbeSmrg	libext=lib
520006f32fbeSmrg	# Tell ltmain to make .dll files, not .so files.
520106f32fbeSmrg	shrext_cmds=".dll"
520206f32fbeSmrg	# FIXME: Setting linknames here is a bad hack.
520306f32fbeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
520406f32fbeSmrg	# The linker will automatically build a .lib file if we build a DLL.
520506f32fbeSmrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
520606f32fbeSmrg	# FIXME: Should let the user specify the lib program.
520706f32fbeSmrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
520806f32fbeSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
520906f32fbeSmrg	;;
521006f32fbeSmrg      esac
521125b89263Smrg      ;;
5212a253d6aeSmrg
521325b89263Smrg    darwin* | rhapsody*)
521425b89263Smrg      _LT_DARWIN_LINKER_FEATURES($1)
521525b89263Smrg      ;;
5216a253d6aeSmrg
521725b89263Smrg    dgux*)
521825b89263Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
521925b89263Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
522025b89263Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
522125b89263Smrg      ;;
5222a253d6aeSmrg
522325b89263Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
522425b89263Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
522525b89263Smrg    # does not break anything, and helps significantly (at the cost of a little
522625b89263Smrg    # extra space).
522725b89263Smrg    freebsd2.2*)
522825b89263Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
522925b89263Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
523025b89263Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
523125b89263Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
523225b89263Smrg      ;;
5233a253d6aeSmrg
523425b89263Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
523557ee1794Smrg    freebsd2.*)
523625b89263Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
523725b89263Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
523825b89263Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
523925b89263Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
524025b89263Smrg      ;;
5241ea133fd7Smrg
524225b89263Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
524325b89263Smrg    freebsd* | dragonfly*)
524406f32fbeSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
524525b89263Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
524625b89263Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
524725b89263Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
524825b89263Smrg      ;;
5249ea133fd7Smrg
525025b89263Smrg    hpux9*)
525125b89263Smrg      if test "$GCC" = yes; then
525206f32fbeSmrg	_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'
525325b89263Smrg      else
525425b89263Smrg	_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'
525525b89263Smrg      fi
525625b89263Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
525725b89263Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
525825b89263Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5259ea133fd7Smrg
526025b89263Smrg      # hardcode_minus_L: Not really in the search PATH,
526125b89263Smrg      # but as the default location of the library.
526225b89263Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
526325b89263Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
526425b89263Smrg      ;;
5265ea133fd7Smrg
526625b89263Smrg    hpux10*)
526725b89263Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
526806f32fbeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
526925b89263Smrg      else
527025b89263Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
527125b89263Smrg      fi
527225b89263Smrg      if test "$with_gnu_ld" = no; then
527325b89263Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
527425b89263Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
527525b89263Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
527625b89263Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
527725b89263Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
527825b89263Smrg	# hardcode_minus_L: Not really in the search PATH,
527925b89263Smrg	# but as the default location of the library.
528025b89263Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
528125b89263Smrg      fi
528225b89263Smrg      ;;
5283a253d6aeSmrg
528425b89263Smrg    hpux11*)
528525b89263Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
528625b89263Smrg	case $host_cpu in
528725b89263Smrg	hppa*64*)
528825b89263Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
528925b89263Smrg	  ;;
529025b89263Smrg	ia64*)
529106f32fbeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
529225b89263Smrg	  ;;
529325b89263Smrg	*)
529406f32fbeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
529525b89263Smrg	  ;;
529625b89263Smrg	esac
529725b89263Smrg      else
529825b89263Smrg	case $host_cpu in
529925b89263Smrg	hppa*64*)
530025b89263Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
530125b89263Smrg	  ;;
530225b89263Smrg	ia64*)
530325b89263Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
530425b89263Smrg	  ;;
530525b89263Smrg	*)
530625b89263Smrg	m4_if($1, [], [
530725b89263Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
530825b89263Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
530925b89263Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
531025b89263Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
531125b89263Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
531225b89263Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
531325b89263Smrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
531425b89263Smrg	  ;;
531525b89263Smrg	esac
531625b89263Smrg      fi
531725b89263Smrg      if test "$with_gnu_ld" = no; then
531825b89263Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
531925b89263Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5320a253d6aeSmrg
532125b89263Smrg	case $host_cpu in
532225b89263Smrg	hppa*64*|ia64*)
532325b89263Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
532425b89263Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
532525b89263Smrg	  ;;
532625b89263Smrg	*)
532725b89263Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
532825b89263Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
532925b89263Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5330a253d6aeSmrg
533125b89263Smrg	  # hardcode_minus_L: Not really in the search PATH,
533225b89263Smrg	  # but as the default location of the library.
533325b89263Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
533425b89263Smrg	  ;;
533525b89263Smrg	esac
533625b89263Smrg      fi
533725b89263Smrg      ;;
5338a253d6aeSmrg
533925b89263Smrg    irix5* | irix6* | nonstopux*)
534025b89263Smrg      if test "$GCC" = yes; then
534106f32fbeSmrg	_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'
534225b89263Smrg	# Try to use the -exported_symbol ld option, if it does not
534325b89263Smrg	# work, assume that -exports_file does not work either and
534425b89263Smrg	# implicitly export all symbols.
534506f32fbeSmrg	# This should be the same for all languages, so no per-tag cache variable.
534606f32fbeSmrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
534706f32fbeSmrg	  [lt_cv_irix_exported_symbol],
534806f32fbeSmrg	  [save_LDFLAGS="$LDFLAGS"
534906f32fbeSmrg	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
535006f32fbeSmrg	   AC_LINK_IFELSE(
535106f32fbeSmrg	     [AC_LANG_SOURCE(
535206f32fbeSmrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
535306f32fbeSmrg			      [C++], [[int foo (void) { return 0; }]],
535406f32fbeSmrg			      [Fortran 77], [[
535506f32fbeSmrg      subroutine foo
535606f32fbeSmrg      end]],
535706f32fbeSmrg			      [Fortran], [[
535806f32fbeSmrg      subroutine foo
535906f32fbeSmrg      end]])])],
536006f32fbeSmrg	      [lt_cv_irix_exported_symbol=yes],
536106f32fbeSmrg	      [lt_cv_irix_exported_symbol=no])
536206f32fbeSmrg           LDFLAGS="$save_LDFLAGS"])
536306f32fbeSmrg	if test "$lt_cv_irix_exported_symbol" = yes; then
536406f32fbeSmrg          _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'
536506f32fbeSmrg	fi
536625b89263Smrg      else
536725b89263Smrg	_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'
536825b89263Smrg	_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'
536925b89263Smrg      fi
537025b89263Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
537125b89263Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
537225b89263Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
537325b89263Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
537425b89263Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
537525b89263Smrg      ;;
5376a253d6aeSmrg
537731637056Smrg    netbsd* | netbsdelf*-gnu)
537825b89263Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
537925b89263Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
538025b89263Smrg      else
538125b89263Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
538225b89263Smrg      fi
538325b89263Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
538425b89263Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
538525b89263Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
538625b89263Smrg      ;;
5387a253d6aeSmrg
538825b89263Smrg    newsos6)
538925b89263Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
539025b89263Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
539125b89263Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
539225b89263Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
539325b89263Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
539425b89263Smrg      ;;
5395a253d6aeSmrg
539625b89263Smrg    *nto* | *qnx*)
539725b89263Smrg      ;;
5398a253d6aeSmrg
539925b89263Smrg    openbsd*)
540025b89263Smrg      if test -f /usr/libexec/ld.so; then
540125b89263Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
540225b89263Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
540325b89263Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
540425b89263Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
540525b89263Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
540625b89263Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
540725b89263Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
540825b89263Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
540925b89263Smrg	else
541025b89263Smrg	  case $host_os in
541125b89263Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
541225b89263Smrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
541325b89263Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
541425b89263Smrg	     ;;
541525b89263Smrg	   *)
541625b89263Smrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
541725b89263Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
541825b89263Smrg	     ;;
541925b89263Smrg	  esac
5420ea133fd7Smrg	fi
542125b89263Smrg      else
542225b89263Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
542325b89263Smrg      fi
542425b89263Smrg      ;;
5425ea133fd7Smrg
542625b89263Smrg    os2*)
542725b89263Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
542825b89263Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
542925b89263Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
543025b89263Smrg      _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'
543125b89263Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
543225b89263Smrg      ;;
5433ea133fd7Smrg
543425b89263Smrg    osf3*)
543525b89263Smrg      if test "$GCC" = yes; then
543625b89263Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
543725b89263Smrg	_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'
543825b89263Smrg      else
543925b89263Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
544025b89263Smrg	_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'
544125b89263Smrg      fi
544225b89263Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
544325b89263Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
544425b89263Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
544525b89263Smrg      ;;
5446ea133fd7Smrg
544725b89263Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
544825b89263Smrg      if test "$GCC" = yes; then
544925b89263Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
545006f32fbeSmrg	_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'
545125b89263Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
545225b89263Smrg      else
545325b89263Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
545425b89263Smrg	_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'
545525b89263Smrg	_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~
545625b89263Smrg	$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'
5457ea133fd7Smrg
545825b89263Smrg	# Both c and cxx compiler support -rpath directly
545925b89263Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
546025b89263Smrg      fi
546125b89263Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
546225b89263Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
546325b89263Smrg      ;;
5464ea133fd7Smrg
546525b89263Smrg    solaris*)
546625b89263Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
546725b89263Smrg      if test "$GCC" = yes; then
546825b89263Smrg	wlarc='${wl}'
546906f32fbeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
547025b89263Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
547106f32fbeSmrg	  $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'
547225b89263Smrg      else
547325b89263Smrg	case `$CC -V 2>&1` in
547425b89263Smrg	*"Compilers 5.0"*)
547525b89263Smrg	  wlarc=''
547625b89263Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
547725b89263Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
547825b89263Smrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
547925b89263Smrg	  ;;
548025b89263Smrg	*)
548125b89263Smrg	  wlarc='${wl}'
548225b89263Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
548325b89263Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
548425b89263Smrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
548525b89263Smrg	  ;;
548625b89263Smrg	esac
548725b89263Smrg      fi
548825b89263Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
548925b89263Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
549025b89263Smrg      case $host_os in
549125b89263Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
549225b89263Smrg      *)
549325b89263Smrg	# The compiler driver will combine and reorder linker options,
549425b89263Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
549525b89263Smrg	# but is careful enough not to reorder.
549625b89263Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
549725b89263Smrg	if test "$GCC" = yes; then
549825b89263Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
549925b89263Smrg	else
550025b89263Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
550125b89263Smrg	fi
550225b89263Smrg	;;
550325b89263Smrg      esac
550425b89263Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
550525b89263Smrg      ;;
5506a253d6aeSmrg
550725b89263Smrg    sunos4*)
550825b89263Smrg      if test "x$host_vendor" = xsequent; then
550925b89263Smrg	# Use $CC to link under sequent, because it throws in some extra .o
551025b89263Smrg	# files that make .init and .fini sections work.
551125b89263Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
551225b89263Smrg      else
551325b89263Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
551425b89263Smrg      fi
551525b89263Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
551625b89263Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
551725b89263Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
551825b89263Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
551925b89263Smrg      ;;
5520a253d6aeSmrg
552125b89263Smrg    sysv4)
552225b89263Smrg      case $host_vendor in
552325b89263Smrg	sni)
552425b89263Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
552525b89263Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
552625b89263Smrg	;;
552725b89263Smrg	siemens)
552825b89263Smrg	  ## LD is ld it makes a PLAMLIB
552925b89263Smrg	  ## CC just makes a GrossModule.
553025b89263Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
553125b89263Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
553225b89263Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
553325b89263Smrg        ;;
553425b89263Smrg	motorola)
553525b89263Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
553625b89263Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
553725b89263Smrg	;;
553825b89263Smrg      esac
553925b89263Smrg      runpath_var='LD_RUN_PATH'
554025b89263Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
554125b89263Smrg      ;;
5542a253d6aeSmrg
554325b89263Smrg    sysv4.3*)
554425b89263Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
554525b89263Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
554625b89263Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
554725b89263Smrg      ;;
5548a253d6aeSmrg
554925b89263Smrg    sysv4*MP*)
555025b89263Smrg      if test -d /usr/nec; then
555125b89263Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
555225b89263Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
555325b89263Smrg	runpath_var=LD_RUN_PATH
555425b89263Smrg	hardcode_runpath_var=yes
555525b89263Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
555625b89263Smrg      fi
555725b89263Smrg      ;;
5558ea133fd7Smrg
555925b89263Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
556025b89263Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
556125b89263Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
556225b89263Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
556325b89263Smrg      runpath_var='LD_RUN_PATH'
5564a253d6aeSmrg
556525b89263Smrg      if test "$GCC" = yes; then
556625b89263Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
556725b89263Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
556825b89263Smrg      else
556925b89263Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
557025b89263Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
557125b89263Smrg      fi
557225b89263Smrg      ;;
5573a253d6aeSmrg
557425b89263Smrg    sysv5* | sco3.2v5* | sco5v6*)
557525b89263Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
557625b89263Smrg      # link with -lc, and that would cause any symbols used from libc to
557725b89263Smrg      # always be unresolved, which means just about no library would
557825b89263Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
557925b89263Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
558025b89263Smrg      # as -z defs.
558125b89263Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
558225b89263Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
558325b89263Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
558425b89263Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
558525b89263Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
558625b89263Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
558725b89263Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
558825b89263Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
558925b89263Smrg      runpath_var='LD_RUN_PATH'
5590a253d6aeSmrg
559125b89263Smrg      if test "$GCC" = yes; then
559225b89263Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
559325b89263Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
559425b89263Smrg      else
559525b89263Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
559625b89263Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
559725b89263Smrg      fi
559825b89263Smrg      ;;
5599a253d6aeSmrg
560025b89263Smrg    uts4*)
560125b89263Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
560225b89263Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
560325b89263Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
560425b89263Smrg      ;;
5605a253d6aeSmrg
560625b89263Smrg    *)
560725b89263Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
560825b89263Smrg      ;;
560925b89263Smrg    esac
5610ea133fd7Smrg
561125b89263Smrg    if test x$host_vendor = xsni; then
561225b89263Smrg      case $host in
561325b89263Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
561425b89263Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
561525b89263Smrg	;;
561625b89263Smrg      esac
561725b89263Smrg    fi
561825b89263Smrg  fi
561925b89263Smrg])
562025b89263SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
562125b89263Smrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
5622ea133fd7Smrg
562325b89263Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
5624ea133fd7Smrg
562525b89263Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
562625b89263Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
562725b89263Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
562825b89263Smrg    [The commands to extract the exported symbol list from a shared archive])
5629ea133fd7Smrg
563025b89263Smrg#
563125b89263Smrg# Do we need to explicitly link libc?
563225b89263Smrg#
563325b89263Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
563425b89263Smrgx|xyes)
563525b89263Smrg  # Assume -lc should be added
563625b89263Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5637a253d6aeSmrg
563825b89263Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
563925b89263Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
564025b89263Smrg    *'~'*)
564125b89263Smrg      # FIXME: we may have to deal with multi-command sequences.
564225b89263Smrg      ;;
564325b89263Smrg    '$CC '*)
564425b89263Smrg      # Test whether the compiler implicitly links with -lc since on some
564525b89263Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
564625b89263Smrg      # to ld, don't add -lc before -lgcc.
564725b89263Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
564825b89263Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
564925b89263Smrg	[$RM conftest*
565025b89263Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
565125b89263Smrg
565225b89263Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
565325b89263Smrg	  soname=conftest
565425b89263Smrg	  lib=conftest
565525b89263Smrg	  libobjs=conftest.$ac_objext
565625b89263Smrg	  deplibs=
565725b89263Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
565825b89263Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
565925b89263Smrg	  compiler_flags=-v
566025b89263Smrg	  linker_flags=-v
566125b89263Smrg	  verstring=
566225b89263Smrg	  output_objdir=.
566325b89263Smrg	  libname=conftest
566425b89263Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
566525b89263Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
566625b89263Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
566725b89263Smrg	  then
566825b89263Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
566925b89263Smrg	  else
567025b89263Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
567125b89263Smrg	  fi
567225b89263Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
567325b89263Smrg	else
567425b89263Smrg	  cat conftest.err 1>&5
567525b89263Smrg	fi
567625b89263Smrg	$RM conftest*
567725b89263Smrg	])
567825b89263Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
567925b89263Smrg      ;;
568025b89263Smrg    esac
568125b89263Smrg  fi
568225b89263Smrg  ;;
568325b89263Smrgesac
5684a253d6aeSmrg
568525b89263Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
568625b89263Smrg    [Whether or not to add -lc for building shared libraries])
568725b89263Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
568825b89263Smrg    [enable_shared_with_static_runtimes], [0],
568925b89263Smrg    [Whether or not to disallow shared libs when runtime libs are static])
569025b89263Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
569125b89263Smrg    [Compiler flag to allow reflexive dlopens])
569225b89263Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
569325b89263Smrg    [Compiler flag to generate shared objects directly from archives])
569425b89263Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
569525b89263Smrg    [Whether the compiler copes with passing no objects directly])
569625b89263Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
569725b89263Smrg    [Create an old-style archive from a shared archive])
569825b89263Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
569925b89263Smrg    [Create a temporary old-style archive to link instead of a shared archive])
570025b89263Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
570125b89263Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
570225b89263Smrg_LT_TAGDECL([], [module_cmds], [2],
570325b89263Smrg    [Commands used to build a loadable module if different from building
570425b89263Smrg    a shared archive.])
570525b89263Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
570625b89263Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
570725b89263Smrg    [Whether we are building with GNU ld or not])
570825b89263Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
570925b89263Smrg    [Flag that allows shared libraries with undefined symbols to be built])
571025b89263Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
571125b89263Smrg    [Flag that enforces no undefined symbols])
571225b89263Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
571325b89263Smrg    [Flag to hardcode $libdir into a binary during linking.
571425b89263Smrg    This must work even if $libdir does not exist])
571525b89263Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
571625b89263Smrg    [Whether we need a single "-rpath" flag with a separated argument])
571725b89263Smrg_LT_TAGDECL([], [hardcode_direct], [0],
571825b89263Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
571925b89263Smrg    DIR into the resulting binary])
572025b89263Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
572125b89263Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
572225b89263Smrg    DIR into the resulting binary and the resulting library dependency is
572325b89263Smrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
572425b89263Smrg    library is relocated])
572525b89263Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
572625b89263Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
572725b89263Smrg    into the resulting binary])
572825b89263Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
572925b89263Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
573025b89263Smrg    into the resulting binary])
573125b89263Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
573225b89263Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
573325b89263Smrg    into the library and all subsequent libraries and executables linked
573425b89263Smrg    against it])
573525b89263Smrg_LT_TAGDECL([], [inherit_rpath], [0],
573625b89263Smrg    [Set to yes if linker adds runtime paths of dependent libraries
573725b89263Smrg    to runtime path list])
573825b89263Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
573925b89263Smrg    [Whether libtool must link a program against all its dependency libraries])
574025b89263Smrg_LT_TAGDECL([], [always_export_symbols], [0],
574125b89263Smrg    [Set to "yes" if exported symbols are required])
574225b89263Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
574325b89263Smrg    [The commands to list exported symbols])
574425b89263Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
574525b89263Smrg    [Symbols that should not be listed in the preloaded symbols])
574625b89263Smrg_LT_TAGDECL([], [include_expsyms], [1],
574725b89263Smrg    [Symbols that must always be exported])
574825b89263Smrg_LT_TAGDECL([], [prelink_cmds], [2],
574925b89263Smrg    [Commands necessary for linking programs (against libraries) with templates])
575006f32fbeSmrg_LT_TAGDECL([], [postlink_cmds], [2],
575106f32fbeSmrg    [Commands necessary for finishing linking programs])
575225b89263Smrg_LT_TAGDECL([], [file_list_spec], [1],
575325b89263Smrg    [Specify filename containing input files])
575425b89263Smrgdnl FIXME: Not yet implemented
575525b89263Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
575625b89263Smrgdnl    [Compiler flag to generate thread safe objects])
575725b89263Smrg])# _LT_LINKER_SHLIBS
5758a253d6aeSmrg
5759a253d6aeSmrg
576025b89263Smrg# _LT_LANG_C_CONFIG([TAG])
576125b89263Smrg# ------------------------
576225b89263Smrg# Ensure that the configuration variables for a C compiler are suitably
576325b89263Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
576425b89263Smrg# the compiler configuration to `libtool'.
576525b89263Smrgm4_defun([_LT_LANG_C_CONFIG],
576625b89263Smrg[m4_require([_LT_DECL_EGREP])dnl
576725b89263Smrglt_save_CC="$CC"
576825b89263SmrgAC_LANG_PUSH(C)
5769a253d6aeSmrg
577025b89263Smrg# Source file extension for C test sources.
577125b89263Smrgac_ext=c
5772a253d6aeSmrg
577325b89263Smrg# Object file extension for compiled C test sources.
5774ea133fd7Smrgobjext=o
5775ea133fd7Smrg_LT_TAGVAR(objext, $1)=$objext
5776a253d6aeSmrg
5777ea133fd7Smrg# Code to be used in simple compile tests
577825b89263Smrglt_simple_compile_test_code="int some_variable = 0;"
5779a253d6aeSmrg
5780ea133fd7Smrg# Code to be used in simple link tests
578125b89263Smrglt_simple_link_test_code='int main(){return(0);}'
5782a253d6aeSmrg
5783ea133fd7Smrg_LT_TAG_COMPILER
578425b89263Smrg# Save the default compiler, since it gets overwritten when the other
578525b89263Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
578625b89263Smrgcompiler_DEFAULT=$CC
5787a253d6aeSmrg
5788ea133fd7Smrg# save warnings/boilerplate of simple test code
5789ea133fd7Smrg_LT_COMPILER_BOILERPLATE
5790ea133fd7Smrg_LT_LINKER_BOILERPLATE
5791a253d6aeSmrg
5792ea133fd7Smrgif test -n "$compiler"; then
579325b89263Smrg  _LT_COMPILER_NO_RTTI($1)
579425b89263Smrg  _LT_COMPILER_PIC($1)
579525b89263Smrg  _LT_COMPILER_C_O($1)
579625b89263Smrg  _LT_COMPILER_FILE_LOCKS($1)
579725b89263Smrg  _LT_LINKER_SHLIBS($1)
579825b89263Smrg  _LT_SYS_DYNAMIC_LINKER($1)
579925b89263Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
580025b89263Smrg  LT_SYS_DLOPEN_SELF
580125b89263Smrg  _LT_CMD_STRIPLIB
5802ea133fd7Smrg
580325b89263Smrg  # Report which library types will actually be built
580425b89263Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
580525b89263Smrg  AC_MSG_RESULT([$can_build_shared])
5806ea133fd7Smrg
580725b89263Smrg  AC_MSG_CHECKING([whether to build shared libraries])
580825b89263Smrg  test "$can_build_shared" = "no" && enable_shared=no
5809ea133fd7Smrg
581025b89263Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
581125b89263Smrg  # are all built from PIC.
581225b89263Smrg  case $host_os in
581325b89263Smrg  aix3*)
581425b89263Smrg    test "$enable_shared" = yes && enable_static=no
581525b89263Smrg    if test -n "$RANLIB"; then
581625b89263Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
581725b89263Smrg      postinstall_cmds='$RANLIB $lib'
581825b89263Smrg    fi
581925b89263Smrg    ;;
5820ea133fd7Smrg
582125b89263Smrg  aix[[4-9]]*)
582225b89263Smrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
582325b89263Smrg      test "$enable_shared" = yes && enable_static=no
582425b89263Smrg    fi
582525b89263Smrg    ;;
5826ea133fd7Smrg  esac
582725b89263Smrg  AC_MSG_RESULT([$enable_shared])
5828ea133fd7Smrg
582925b89263Smrg  AC_MSG_CHECKING([whether to build static libraries])
583025b89263Smrg  # Make sure either enable_shared or enable_static is yes.
583125b89263Smrg  test "$enable_shared" = yes || enable_static=yes
583225b89263Smrg  AC_MSG_RESULT([$enable_static])
5833ea133fd7Smrg
583425b89263Smrg  _LT_CONFIG($1)
583525b89263Smrgfi
583625b89263SmrgAC_LANG_POP
583725b89263SmrgCC="$lt_save_CC"
583825b89263Smrg])# _LT_LANG_C_CONFIG
5839ea133fd7Smrg
5840ea133fd7Smrg
584125b89263Smrg# _LT_LANG_CXX_CONFIG([TAG])
584225b89263Smrg# --------------------------
584325b89263Smrg# Ensure that the configuration variables for a C++ compiler are suitably
584425b89263Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
584525b89263Smrg# the compiler configuration to `libtool'.
584625b89263Smrgm4_defun([_LT_LANG_CXX_CONFIG],
584725b89263Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
584825b89263Smrgm4_require([_LT_DECL_EGREP])dnl
584906f32fbeSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
585025b89263Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
585125b89263Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
585225b89263Smrg    (test "X$CXX" != "Xg++"))) ; then
585325b89263Smrg  AC_PROG_CXXCPP
585425b89263Smrgelse
585525b89263Smrg  _lt_caught_CXX_error=yes
585625b89263Smrgfi
5857ea133fd7Smrg
585825b89263SmrgAC_LANG_PUSH(C++)
585925b89263Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
586025b89263Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
586125b89263Smrg_LT_TAGVAR(always_export_symbols, $1)=no
586225b89263Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
586325b89263Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
586425b89263Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
586525b89263Smrg_LT_TAGVAR(hardcode_direct, $1)=no
586625b89263Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
586725b89263Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
586825b89263Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
586925b89263Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
587025b89263Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
587125b89263Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
587225b89263Smrg_LT_TAGVAR(inherit_rpath, $1)=no
587325b89263Smrg_LT_TAGVAR(module_cmds, $1)=
587425b89263Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
587525b89263Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
587625b89263Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
587725b89263Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
587825b89263Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
587925b89263Smrg_LT_TAGVAR(no_undefined_flag, $1)=
588025b89263Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
588125b89263Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5882ea133fd7Smrg
588325b89263Smrg# Source file extension for C++ test sources.
588425b89263Smrgac_ext=cpp
5885ea133fd7Smrg
588625b89263Smrg# Object file extension for compiled C++ test sources.
588725b89263Smrgobjext=o
588825b89263Smrg_LT_TAGVAR(objext, $1)=$objext
5889ea133fd7Smrg
589025b89263Smrg# No sense in running all these tests if we already determined that
589125b89263Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
589225b89263Smrg# are currently assumed to apply to all compilers on this platform,
589325b89263Smrg# and will be corrupted by setting them based on a non-working compiler.
589425b89263Smrgif test "$_lt_caught_CXX_error" != yes; then
589525b89263Smrg  # Code to be used in simple compile tests
589625b89263Smrg  lt_simple_compile_test_code="int some_variable = 0;"
5897ea133fd7Smrg
589825b89263Smrg  # Code to be used in simple link tests
589925b89263Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
5900ea133fd7Smrg
590125b89263Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
590225b89263Smrg  _LT_TAG_COMPILER
5903ea133fd7Smrg
590425b89263Smrg  # save warnings/boilerplate of simple test code
590525b89263Smrg  _LT_COMPILER_BOILERPLATE
590625b89263Smrg  _LT_LINKER_BOILERPLATE
5907ea133fd7Smrg
590825b89263Smrg  # Allow CC to be a program name with arguments.
590925b89263Smrg  lt_save_CC=$CC
591006f32fbeSmrg  lt_save_CFLAGS=$CFLAGS
591125b89263Smrg  lt_save_LD=$LD
591225b89263Smrg  lt_save_GCC=$GCC
591325b89263Smrg  GCC=$GXX
591425b89263Smrg  lt_save_with_gnu_ld=$with_gnu_ld
591525b89263Smrg  lt_save_path_LD=$lt_cv_path_LD
591625b89263Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
591725b89263Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
591825b89263Smrg  else
591925b89263Smrg    $as_unset lt_cv_prog_gnu_ld
592025b89263Smrg  fi
592125b89263Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
592225b89263Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
592325b89263Smrg  else
592425b89263Smrg    $as_unset lt_cv_path_LD
592525b89263Smrg  fi
592625b89263Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
592725b89263Smrg  CC=${CXX-"c++"}
592806f32fbeSmrg  CFLAGS=$CXXFLAGS
592925b89263Smrg  compiler=$CC
593025b89263Smrg  _LT_TAGVAR(compiler, $1)=$CC
593125b89263Smrg  _LT_CC_BASENAME([$compiler])
5932ea133fd7Smrg
593325b89263Smrg  if test -n "$compiler"; then
593425b89263Smrg    # We don't want -fno-exception when compiling C++ code, so set the
593525b89263Smrg    # no_builtin_flag separately
593625b89263Smrg    if test "$GXX" = yes; then
593725b89263Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
593825b89263Smrg    else
593925b89263Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
594025b89263Smrg    fi
5941ea133fd7Smrg
594225b89263Smrg    if test "$GXX" = yes; then
594325b89263Smrg      # Set up default GNU C++ configuration
5944ea133fd7Smrg
594525b89263Smrg      LT_PATH_LD
5946ea133fd7Smrg
594725b89263Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
594825b89263Smrg      # archiving commands below assume that GNU ld is being used.
594925b89263Smrg      if test "$with_gnu_ld" = yes; then
595006f32fbeSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
595106f32fbeSmrg        _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'
5952ea133fd7Smrg
595325b89263Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
595425b89263Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5955ea133fd7Smrg
595625b89263Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
595725b89263Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
595825b89263Smrg        #     investigate it a little bit more. (MM)
595925b89263Smrg        wlarc='${wl}'
5960ea133fd7Smrg
596125b89263Smrg        # ancient GNU ld didn't support --whole-archive et. al.
596225b89263Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
596325b89263Smrg	  $GREP 'no-whole-archive' > /dev/null; then
596425b89263Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
596525b89263Smrg        else
596625b89263Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
596725b89263Smrg        fi
596825b89263Smrg      else
596925b89263Smrg        with_gnu_ld=no
597025b89263Smrg        wlarc=
5971ea133fd7Smrg
597225b89263Smrg        # A generic and very simple default shared library creation
597325b89263Smrg        # command for GNU C++ for the case where it uses the native
597425b89263Smrg        # linker, instead of GNU ld.  If possible, this setting should
597525b89263Smrg        # overridden to take advantage of the native linker features on
597625b89263Smrg        # the platform it is being used on.
597725b89263Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
597825b89263Smrg      fi
5979ea133fd7Smrg
598025b89263Smrg      # Commands to make compiler produce verbose output that lists
598125b89263Smrg      # what "hidden" libraries, object files and flags are used when
598225b89263Smrg      # linking a shared library.
598325b89263Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
5984ea133fd7Smrg
598525b89263Smrg    else
598625b89263Smrg      GXX=no
598725b89263Smrg      with_gnu_ld=no
598825b89263Smrg      wlarc=
598925b89263Smrg    fi
5990ea133fd7Smrg
599125b89263Smrg    # PORTME: fill in a description of your system's C++ link characteristics
599225b89263Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
599325b89263Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
599425b89263Smrg    case $host_os in
599525b89263Smrg      aix3*)
599625b89263Smrg        # FIXME: insert proper C++ library support
599725b89263Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
599825b89263Smrg        ;;
599925b89263Smrg      aix[[4-9]]*)
600025b89263Smrg        if test "$host_cpu" = ia64; then
600125b89263Smrg          # On IA64, the linker does run time linking by default, so we don't
600225b89263Smrg          # have to do anything special.
600325b89263Smrg          aix_use_runtimelinking=no
600425b89263Smrg          exp_sym_flag='-Bexport'
600525b89263Smrg          no_entry_flag=""
600625b89263Smrg        else
600725b89263Smrg          aix_use_runtimelinking=no
6008ea133fd7Smrg
600925b89263Smrg          # Test if we are trying to use run time linking or normal
601025b89263Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
601125b89263Smrg          # need to do runtime linking.
601225b89263Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
601325b89263Smrg	    for ld_flag in $LDFLAGS; do
601425b89263Smrg	      case $ld_flag in
601525b89263Smrg	      *-brtl*)
601625b89263Smrg	        aix_use_runtimelinking=yes
601725b89263Smrg	        break
601825b89263Smrg	        ;;
601925b89263Smrg	      esac
602025b89263Smrg	    done
602125b89263Smrg	    ;;
602225b89263Smrg          esac
6023ea133fd7Smrg
602425b89263Smrg          exp_sym_flag='-bexport'
602525b89263Smrg          no_entry_flag='-bnoentry'
602625b89263Smrg        fi
6027ea133fd7Smrg
602825b89263Smrg        # When large executables or shared objects are built, AIX ld can
602925b89263Smrg        # have problems creating the table of contents.  If linking a library
603025b89263Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
603125b89263Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
603225b89263Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6033ea133fd7Smrg
603425b89263Smrg        _LT_TAGVAR(archive_cmds, $1)=''
603525b89263Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
603625b89263Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
603725b89263Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
603825b89263Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
603925b89263Smrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6040ea133fd7Smrg
604125b89263Smrg        if test "$GXX" = yes; then
604225b89263Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
604325b89263Smrg          # We only want to do this on AIX 4.2 and lower, the check
604425b89263Smrg          # below for broken collect2 doesn't work under 4.3+
604525b89263Smrg	  collect2name=`${CC} -print-prog-name=collect2`
604625b89263Smrg	  if test -f "$collect2name" &&
604725b89263Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
604825b89263Smrg	  then
604925b89263Smrg	    # We have reworked collect2
605025b89263Smrg	    :
605125b89263Smrg	  else
605225b89263Smrg	    # We have old collect2
605325b89263Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
605425b89263Smrg	    # It fails to find uninstalled libraries when the uninstalled
605525b89263Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
605625b89263Smrg	    # to unsupported forces relinking
605725b89263Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
605825b89263Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
605925b89263Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
606025b89263Smrg	  fi
606125b89263Smrg          esac
606225b89263Smrg          shared_flag='-shared'
606325b89263Smrg	  if test "$aix_use_runtimelinking" = yes; then
606425b89263Smrg	    shared_flag="$shared_flag "'${wl}-G'
606525b89263Smrg	  fi
606625b89263Smrg        else
606725b89263Smrg          # not using gcc
606825b89263Smrg          if test "$host_cpu" = ia64; then
606925b89263Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
607025b89263Smrg	  # chokes on -Wl,-G. The following line is correct:
607125b89263Smrg	  shared_flag='-G'
607225b89263Smrg          else
607325b89263Smrg	    if test "$aix_use_runtimelinking" = yes; then
607425b89263Smrg	      shared_flag='${wl}-G'
607525b89263Smrg	    else
607625b89263Smrg	      shared_flag='${wl}-bM:SRE'
607725b89263Smrg	    fi
607825b89263Smrg          fi
607925b89263Smrg        fi
6080ea133fd7Smrg
608125b89263Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
608225b89263Smrg        # It seems that -bexpall does not export symbols beginning with
608325b89263Smrg        # underscore (_), so it is better to generate a list of symbols to
608425b89263Smrg	# export.
608525b89263Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
608625b89263Smrg        if test "$aix_use_runtimelinking" = yes; then
608725b89263Smrg          # Warning - without using the other runtime loading flags (-brtl),
608825b89263Smrg          # -berok will link without error, but may produce a broken library.
608925b89263Smrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
609025b89263Smrg          # Determine the default libpath from the value encoded in an empty
609125b89263Smrg          # executable.
609206f32fbeSmrg          _LT_SYS_MODULE_PATH_AIX([$1])
609325b89263Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6094ea133fd7Smrg
609525b89263Smrg          _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"
609625b89263Smrg        else
609725b89263Smrg          if test "$host_cpu" = ia64; then
609825b89263Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
609925b89263Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
610025b89263Smrg	    _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"
610125b89263Smrg          else
610225b89263Smrg	    # Determine the default libpath from the value encoded in an
610325b89263Smrg	    # empty executable.
610406f32fbeSmrg	    _LT_SYS_MODULE_PATH_AIX([$1])
610525b89263Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
610625b89263Smrg	    # Warning - without using the other run time loading flags,
610725b89263Smrg	    # -berok will link without error, but may produce a broken library.
610825b89263Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
610925b89263Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
611025b89263Smrg	    if test "$with_gnu_ld" = yes; then
611125b89263Smrg	      # We only use this code for GNU lds that support --whole-archive.
611225b89263Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
611325b89263Smrg	    else
611425b89263Smrg	      # Exported symbols can be pulled into shared objects from archives
611525b89263Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
611625b89263Smrg	    fi
611725b89263Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
611825b89263Smrg	    # This is similar to how AIX traditionally builds its shared
611925b89263Smrg	    # libraries.
612025b89263Smrg	    _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'
612125b89263Smrg          fi
612225b89263Smrg        fi
612325b89263Smrg        ;;
6124ea133fd7Smrg
612525b89263Smrg      beos*)
612625b89263Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
612725b89263Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
612825b89263Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
612925b89263Smrg	  # support --undefined.  This deserves some investigation.  FIXME
613025b89263Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
613125b89263Smrg	else
613225b89263Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
613325b89263Smrg	fi
613425b89263Smrg	;;
6135ea133fd7Smrg
613625b89263Smrg      chorus*)
613725b89263Smrg        case $cc_basename in
613825b89263Smrg          *)
613925b89263Smrg	  # FIXME: insert proper C++ library support
614025b89263Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
614125b89263Smrg	  ;;
614225b89263Smrg        esac
614325b89263Smrg        ;;
6144ea133fd7Smrg
614525b89263Smrg      cygwin* | mingw* | pw32* | cegcc*)
614606f32fbeSmrg	case $GXX,$cc_basename in
614706f32fbeSmrg	,cl* | no,cl*)
614806f32fbeSmrg	  # Native MSVC
614906f32fbeSmrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
615006f32fbeSmrg	  # no search path for DLLs.
615106f32fbeSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
615206f32fbeSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
615306f32fbeSmrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
615406f32fbeSmrg	  _LT_TAGVAR(file_list_spec, $1)='@'
615506f32fbeSmrg	  # Tell ltmain to make .lib files, not .a files.
615606f32fbeSmrg	  libext=lib
615706f32fbeSmrg	  # Tell ltmain to make .dll files, not .so files.
615806f32fbeSmrg	  shrext_cmds=".dll"
615906f32fbeSmrg	  # FIXME: Setting linknames here is a bad hack.
616006f32fbeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
616106f32fbeSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
616206f32fbeSmrg	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
616306f32fbeSmrg	    else
616406f32fbeSmrg	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
616506f32fbeSmrg	    fi~
616606f32fbeSmrg	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
616706f32fbeSmrg	    linknames='
616806f32fbeSmrg	  # The linker will not automatically build a static lib if we build a DLL.
616906f32fbeSmrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
617006f32fbeSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
617106f32fbeSmrg	  # Don't use ranlib
617206f32fbeSmrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
617306f32fbeSmrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
617406f32fbeSmrg	    lt_tool_outputfile="@TOOL_OUTPUT@"~
617506f32fbeSmrg	    case $lt_outputfile in
617606f32fbeSmrg	      *.exe|*.EXE) ;;
617706f32fbeSmrg	      *)
617806f32fbeSmrg		lt_outputfile="$lt_outputfile.exe"
617906f32fbeSmrg		lt_tool_outputfile="$lt_tool_outputfile.exe"
618006f32fbeSmrg		;;
618106f32fbeSmrg	    esac~
618206f32fbeSmrg	    func_to_tool_file "$lt_outputfile"~
618306f32fbeSmrg	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
618406f32fbeSmrg	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
618506f32fbeSmrg	      $RM "$lt_outputfile.manifest";
618606f32fbeSmrg	    fi'
618706f32fbeSmrg	  ;;
618806f32fbeSmrg	*)
618906f32fbeSmrg	  # g++
619006f32fbeSmrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
619106f32fbeSmrg	  # as there is no search path for DLLs.
619206f32fbeSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
619306f32fbeSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
619406f32fbeSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
619506f32fbeSmrg	  _LT_TAGVAR(always_export_symbols, $1)=no
619606f32fbeSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
619706f32fbeSmrg
619806f32fbeSmrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
619906f32fbeSmrg	    _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'
620006f32fbeSmrg	    # If the export-symbols file already is a .def file (1st line
620106f32fbeSmrg	    # is EXPORTS), use it as is; otherwise, prepend...
620206f32fbeSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
620306f32fbeSmrg	      cp $export_symbols $output_objdir/$soname.def;
620406f32fbeSmrg	    else
620506f32fbeSmrg	      echo EXPORTS > $output_objdir/$soname.def;
620606f32fbeSmrg	      cat $export_symbols >> $output_objdir/$soname.def;
620706f32fbeSmrg	    fi~
620806f32fbeSmrg	    $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'
620906f32fbeSmrg	  else
621006f32fbeSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
621106f32fbeSmrg	  fi
621206f32fbeSmrg	  ;;
621306f32fbeSmrg	esac
621406f32fbeSmrg	;;
621525b89263Smrg      darwin* | rhapsody*)
621625b89263Smrg        _LT_DARWIN_LINKER_FEATURES($1)
621725b89263Smrg	;;
6218ea133fd7Smrg
621925b89263Smrg      dgux*)
622025b89263Smrg        case $cc_basename in
622125b89263Smrg          ec++*)
622225b89263Smrg	    # FIXME: insert proper C++ library support
622325b89263Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
622425b89263Smrg	    ;;
622525b89263Smrg          ghcx*)
622625b89263Smrg	    # Green Hills C++ Compiler
622725b89263Smrg	    # FIXME: insert proper C++ library support
622825b89263Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
622925b89263Smrg	    ;;
623025b89263Smrg          *)
623125b89263Smrg	    # FIXME: insert proper C++ library support
623225b89263Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
623325b89263Smrg	    ;;
623425b89263Smrg        esac
623525b89263Smrg        ;;
6236ea133fd7Smrg
623757ee1794Smrg      freebsd2.*)
623825b89263Smrg        # C++ shared libraries reported to be fairly broken before
623925b89263Smrg	# switch to ELF
624025b89263Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
624125b89263Smrg        ;;
6242ea133fd7Smrg
624325b89263Smrg      freebsd-elf*)
624425b89263Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
624525b89263Smrg        ;;
6246ea133fd7Smrg
624725b89263Smrg      freebsd* | dragonfly*)
624825b89263Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
624925b89263Smrg        # conventions
625025b89263Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
625125b89263Smrg        ;;
6252ea133fd7Smrg
625325b89263Smrg      haiku*)
625425b89263Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
625525b89263Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
625625b89263Smrg        ;;
6257ea133fd7Smrg
625825b89263Smrg      hpux9*)
625925b89263Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
626025b89263Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
626125b89263Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
626225b89263Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
626325b89263Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
626425b89263Smrg				             # but as the default
626525b89263Smrg				             # location of the library.
6266ea133fd7Smrg
626725b89263Smrg        case $cc_basename in
626825b89263Smrg          CC*)
626925b89263Smrg            # FIXME: insert proper C++ library support
627025b89263Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
627125b89263Smrg            ;;
627225b89263Smrg          aCC*)
627325b89263Smrg            _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'
627425b89263Smrg            # Commands to make compiler produce verbose output that lists
627525b89263Smrg            # what "hidden" libraries, object files and flags are used when
627625b89263Smrg            # linking a shared library.
627725b89263Smrg            #
627825b89263Smrg            # There doesn't appear to be a way to prevent this compiler from
627925b89263Smrg            # explicitly linking system object files so we need to strip them
628025b89263Smrg            # from the output so that they don't get included in the library
628125b89263Smrg            # dependencies.
628225b89263Smrg            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"'
628325b89263Smrg            ;;
628425b89263Smrg          *)
628525b89263Smrg            if test "$GXX" = yes; then
628606f32fbeSmrg              _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'
628725b89263Smrg            else
628825b89263Smrg              # FIXME: insert proper C++ library support
628925b89263Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
629025b89263Smrg            fi
629125b89263Smrg            ;;
629225b89263Smrg        esac
629325b89263Smrg        ;;
6294ea133fd7Smrg
629525b89263Smrg      hpux10*|hpux11*)
629625b89263Smrg        if test $with_gnu_ld = no; then
629725b89263Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
629825b89263Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6299ea133fd7Smrg
630025b89263Smrg          case $host_cpu in
630125b89263Smrg            hppa*64*|ia64*)
630225b89263Smrg              ;;
630325b89263Smrg            *)
630425b89263Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
630525b89263Smrg              ;;
630625b89263Smrg          esac
630725b89263Smrg        fi
630825b89263Smrg        case $host_cpu in
630925b89263Smrg          hppa*64*|ia64*)
631025b89263Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
631125b89263Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
631225b89263Smrg            ;;
631325b89263Smrg          *)
631425b89263Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
631525b89263Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
631625b89263Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
631725b89263Smrg					         # but as the default
631825b89263Smrg					         # location of the library.
631925b89263Smrg            ;;
632025b89263Smrg        esac
6321ea133fd7Smrg
632225b89263Smrg        case $cc_basename in
632325b89263Smrg          CC*)
632425b89263Smrg	    # FIXME: insert proper C++ library support
632525b89263Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
632625b89263Smrg	    ;;
632725b89263Smrg          aCC*)
632825b89263Smrg	    case $host_cpu in
632925b89263Smrg	      hppa*64*)
633025b89263Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
633125b89263Smrg	        ;;
633225b89263Smrg	      ia64*)
633325b89263Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
633425b89263Smrg	        ;;
633525b89263Smrg	      *)
633625b89263Smrg	        _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'
633725b89263Smrg	        ;;
633825b89263Smrg	    esac
633925b89263Smrg	    # Commands to make compiler produce verbose output that lists
634025b89263Smrg	    # what "hidden" libraries, object files and flags are used when
634125b89263Smrg	    # linking a shared library.
634225b89263Smrg	    #
634325b89263Smrg	    # There doesn't appear to be a way to prevent this compiler from
634425b89263Smrg	    # explicitly linking system object files so we need to strip them
634525b89263Smrg	    # from the output so that they don't get included in the library
634625b89263Smrg	    # dependencies.
634725b89263Smrg	    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"'
634825b89263Smrg	    ;;
634925b89263Smrg          *)
635025b89263Smrg	    if test "$GXX" = yes; then
635125b89263Smrg	      if test $with_gnu_ld = no; then
635225b89263Smrg	        case $host_cpu in
635325b89263Smrg	          hppa*64*)
635425b89263Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
635525b89263Smrg	            ;;
635625b89263Smrg	          ia64*)
635706f32fbeSmrg	            _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'
635825b89263Smrg	            ;;
635925b89263Smrg	          *)
636006f32fbeSmrg	            _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'
636125b89263Smrg	            ;;
636225b89263Smrg	        esac
636325b89263Smrg	      fi
636425b89263Smrg	    else
636525b89263Smrg	      # FIXME: insert proper C++ library support
636625b89263Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
636725b89263Smrg	    fi
636825b89263Smrg	    ;;
636925b89263Smrg        esac
637025b89263Smrg        ;;
6371ea133fd7Smrg
637225b89263Smrg      interix[[3-9]]*)
637325b89263Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
637425b89263Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
637525b89263Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
637625b89263Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
637725b89263Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
637825b89263Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
637925b89263Smrg	# default) and relocated if they conflict, which is a slow very memory
638025b89263Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
638125b89263Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
638225b89263Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
638325b89263Smrg	_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'
638425b89263Smrg	_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'
638525b89263Smrg	;;
638625b89263Smrg      irix5* | irix6*)
638725b89263Smrg        case $cc_basename in
638825b89263Smrg          CC*)
638925b89263Smrg	    # SGI C++
639025b89263Smrg	    _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'
6391ea133fd7Smrg
639225b89263Smrg	    # Archives containing C++ object files must be created using
639325b89263Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
639425b89263Smrg	    # necessary to make sure instantiated templates are included
639525b89263Smrg	    # in the archive.
639625b89263Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
639725b89263Smrg	    ;;
639825b89263Smrg          *)
639925b89263Smrg	    if test "$GXX" = yes; then
640025b89263Smrg	      if test "$with_gnu_ld" = no; then
640106f32fbeSmrg	        _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'
640225b89263Smrg	      else
640306f32fbeSmrg	        _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'
640425b89263Smrg	      fi
640525b89263Smrg	    fi
640625b89263Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
640725b89263Smrg	    ;;
640825b89263Smrg        esac
640925b89263Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
641025b89263Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
641125b89263Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
641225b89263Smrg        ;;
6413ea133fd7Smrg
641431637056Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
641525b89263Smrg        case $cc_basename in
641625b89263Smrg          KCC*)
641725b89263Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6418ea133fd7Smrg
641925b89263Smrg	    # KCC will only create a shared library if the output file
642025b89263Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
642125b89263Smrg	    # to its proper name (with version) after linking.
642225b89263Smrg	    _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'
642325b89263Smrg	    _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'
642425b89263Smrg	    # Commands to make compiler produce verbose output that lists
642525b89263Smrg	    # what "hidden" libraries, object files and flags are used when
642625b89263Smrg	    # linking a shared library.
642725b89263Smrg	    #
642825b89263Smrg	    # There doesn't appear to be a way to prevent this compiler from
642925b89263Smrg	    # explicitly linking system object files so we need to strip them
643025b89263Smrg	    # from the output so that they don't get included in the library
643125b89263Smrg	    # dependencies.
643225b89263Smrg	    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"'
6433ea133fd7Smrg
643425b89263Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
643525b89263Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6436ea133fd7Smrg
643725b89263Smrg	    # Archives containing C++ object files must be created using
643825b89263Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
643925b89263Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
644025b89263Smrg	    ;;
644125b89263Smrg	  icpc* | ecpc* )
644225b89263Smrg	    # Intel C++
644325b89263Smrg	    with_gnu_ld=yes
644425b89263Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
644525b89263Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
644625b89263Smrg	    # earlier do not add the objects themselves.
644725b89263Smrg	    case `$CC -V 2>&1` in
644825b89263Smrg	      *"Version 7."*)
644925b89263Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
645025b89263Smrg		_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'
645125b89263Smrg		;;
645225b89263Smrg	      *)  # Version 8.0 or newer
645325b89263Smrg	        tmp_idyn=
645425b89263Smrg	        case $host_cpu in
645525b89263Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
645625b89263Smrg		esac
645725b89263Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
645825b89263Smrg		_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'
645925b89263Smrg		;;
646025b89263Smrg	    esac
646125b89263Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
646225b89263Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
646325b89263Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
646425b89263Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
646525b89263Smrg	    ;;
646625b89263Smrg          pgCC* | pgcpp*)
646725b89263Smrg            # Portland Group C++ compiler
646825b89263Smrg	    case `$CC -V` in
646925b89263Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
647025b89263Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
647125b89263Smrg		rm -rf $tpldir~
647225b89263Smrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
647325b89263Smrg		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
647425b89263Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
647525b89263Smrg		rm -rf $tpldir~
647625b89263Smrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
647725b89263Smrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
647825b89263Smrg		$RANLIB $oldlib'
647925b89263Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
648025b89263Smrg		rm -rf $tpldir~
648125b89263Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
648225b89263Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
648325b89263Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
648425b89263Smrg		rm -rf $tpldir~
648525b89263Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
648625b89263Smrg		$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'
648725b89263Smrg	      ;;
648825b89263Smrg	    *) # Version 6 and above use weak symbols
648925b89263Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
649025b89263Smrg	      _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'
649125b89263Smrg	      ;;
649225b89263Smrg	    esac
6493ea133fd7Smrg
649431637056Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
649531637056Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
649631637056Smrg	    _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'
649731637056Smrg            ;;
649831637056Smrg	  cxx*)
649931637056Smrg	    # Compaq C++
650031637056Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
650131637056Smrg	    _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'
650231637056Smrg
650331637056Smrg	    runpath_var=LD_RUN_PATH
650431637056Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
650531637056Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
650631637056Smrg
650731637056Smrg	    # Commands to make compiler produce verbose output that lists
650831637056Smrg	    # what "hidden" libraries, object files and flags are used when
650931637056Smrg	    # linking a shared library.
651031637056Smrg	    #
651131637056Smrg	    # There doesn't appear to be a way to prevent this compiler from
651231637056Smrg	    # explicitly linking system object files so we need to strip them
651331637056Smrg	    # from the output so that they don't get included in the library
651431637056Smrg	    # dependencies.
651531637056Smrg	    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'
651631637056Smrg	    ;;
651731637056Smrg	  xl* | mpixl* | bgxl*)
651831637056Smrg	    # IBM XL 8.0 on PPC, with GNU ld
651931637056Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
652031637056Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
652131637056Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
652231637056Smrg	    if test "x$supports_anon_versioning" = xyes; then
652331637056Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
652431637056Smrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
652531637056Smrg		echo "local: *; };" >> $output_objdir/$libname.ver~
652631637056Smrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
652731637056Smrg	    fi
652831637056Smrg	    ;;
652931637056Smrg	  *)
653031637056Smrg	    case `$CC -V 2>&1 | sed 5q` in
653131637056Smrg	    *Sun\ C*)
653231637056Smrg	      # Sun C++ 5.9
653331637056Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
653431637056Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
653531637056Smrg	      _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'
653631637056Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
653731637056Smrg	      _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'
653831637056Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
653931637056Smrg
654031637056Smrg	      # Not sure whether something based on
654131637056Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
654231637056Smrg	      # would be better.
654331637056Smrg	      output_verbose_link_cmd='func_echo_all'
654431637056Smrg
654531637056Smrg	      # Archives containing C++ object files must be created using
654631637056Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
654731637056Smrg	      # necessary to make sure instantiated templates are included
654831637056Smrg	      # in the archive.
654931637056Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
655031637056Smrg	      ;;
655131637056Smrg	    esac
655231637056Smrg	    ;;
655331637056Smrg	esac
655431637056Smrg	;;
655531637056Smrg
655631637056Smrg      lynxos*)
655731637056Smrg        # FIXME: insert proper C++ library support
655831637056Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
655931637056Smrg	;;
656031637056Smrg
656131637056Smrg      m88k*)
656231637056Smrg        # FIXME: insert proper C++ library support
656331637056Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
656431637056Smrg	;;
656531637056Smrg
656631637056Smrg      mvs*)
656731637056Smrg        case $cc_basename in
656831637056Smrg          cxx*)
656931637056Smrg	    # FIXME: insert proper C++ library support
657031637056Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
657131637056Smrg	    ;;
657231637056Smrg	  *)
657331637056Smrg	    # FIXME: insert proper C++ library support
657431637056Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
657531637056Smrg	    ;;
657631637056Smrg	esac
657731637056Smrg	;;
657831637056Smrg
657931637056Smrg      netbsd*)
658031637056Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
658131637056Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
658231637056Smrg	  wlarc=
658331637056Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
658431637056Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
658531637056Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
658631637056Smrg	fi
658731637056Smrg	# Workaround some broken pre-1.5 toolchains
658831637056Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
658931637056Smrg	;;
659031637056Smrg
659131637056Smrg      *nto* | *qnx*)
659231637056Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
659331637056Smrg	;;
659431637056Smrg
659531637056Smrg      openbsd2*)
659631637056Smrg        # C++ shared libraries are fairly broken
659731637056Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
659831637056Smrg	;;
659931637056Smrg
660031637056Smrg      openbsd*)
660131637056Smrg	if test -f /usr/libexec/ld.so; then
660231637056Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
660331637056Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
660431637056Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
660531637056Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
660631637056Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
660731637056Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
660831637056Smrg	    _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'
660931637056Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
661031637056Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
661131637056Smrg	  fi
661231637056Smrg	  output_verbose_link_cmd=func_echo_all
661331637056Smrg	else
661431637056Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
661531637056Smrg	fi
661631637056Smrg	;;
661731637056Smrg
661831637056Smrg      osf3* | osf4* | osf5*)
661931637056Smrg        case $cc_basename in
662031637056Smrg          KCC*)
662131637056Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
662231637056Smrg
662331637056Smrg	    # KCC will only create a shared library if the output file
662431637056Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
662531637056Smrg	    # to its proper name (with version) after linking.
662631637056Smrg	    _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'
662731637056Smrg
662831637056Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
662931637056Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
663031637056Smrg
663131637056Smrg	    # Archives containing C++ object files must be created using
663231637056Smrg	    # the KAI C++ compiler.
663331637056Smrg	    case $host in
663431637056Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
663531637056Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
663631637056Smrg	    esac
663731637056Smrg	    ;;
663831637056Smrg          RCC*)
663931637056Smrg	    # Rational C++ 2.4.1
664031637056Smrg	    # FIXME: insert proper C++ library support
664131637056Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
664231637056Smrg	    ;;
664331637056Smrg          cxx*)
664431637056Smrg	    case $host in
664531637056Smrg	      osf3*)
664631637056Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
664731637056Smrg	        _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'
664831637056Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
664931637056Smrg		;;
665031637056Smrg	      *)
665131637056Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
665231637056Smrg	        _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'
665331637056Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
665431637056Smrg	          echo "-hidden">> $lib.exp~
665531637056Smrg	          $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~
665631637056Smrg	          $RM $lib.exp'
665731637056Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
665831637056Smrg		;;
665931637056Smrg	    esac
666031637056Smrg
666131637056Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
666231637056Smrg
666331637056Smrg	    # Commands to make compiler produce verbose output that lists
666431637056Smrg	    # what "hidden" libraries, object files and flags are used when
666531637056Smrg	    # linking a shared library.
666631637056Smrg	    #
666731637056Smrg	    # There doesn't appear to be a way to prevent this compiler from
666831637056Smrg	    # explicitly linking system object files so we need to strip them
666931637056Smrg	    # from the output so that they don't get included in the library
667031637056Smrg	    # dependencies.
667131637056Smrg	    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"'
667231637056Smrg	    ;;
667331637056Smrg	  *)
667431637056Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
667531637056Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
667631637056Smrg	      case $host in
667731637056Smrg	        osf3*)
667831637056Smrg	          _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'
667931637056Smrg		  ;;
668031637056Smrg	        *)
668131637056Smrg	          _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'
668231637056Smrg		  ;;
668331637056Smrg	      esac
668431637056Smrg
668531637056Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
668631637056Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
668731637056Smrg
668831637056Smrg	      # Commands to make compiler produce verbose output that lists
668931637056Smrg	      # what "hidden" libraries, object files and flags are used when
669031637056Smrg	      # linking a shared library.
669131637056Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
669231637056Smrg
669331637056Smrg	    else
669431637056Smrg	      # FIXME: insert proper C++ library support
669531637056Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
669631637056Smrg	    fi
669731637056Smrg	    ;;
669831637056Smrg        esac
669931637056Smrg        ;;
670031637056Smrg
670131637056Smrg      psos*)
670231637056Smrg        # FIXME: insert proper C++ library support
670331637056Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
670431637056Smrg        ;;
670531637056Smrg
670631637056Smrg      sunos4*)
670731637056Smrg        case $cc_basename in
670831637056Smrg          CC*)
670931637056Smrg	    # Sun C++ 4.x
671031637056Smrg	    # FIXME: insert proper C++ library support
671131637056Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
671231637056Smrg	    ;;
671331637056Smrg          lcc*)
671431637056Smrg	    # Lucid
671531637056Smrg	    # FIXME: insert proper C++ library support
671631637056Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
671731637056Smrg	    ;;
671831637056Smrg          *)
671931637056Smrg	    # FIXME: insert proper C++ library support
672031637056Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
672131637056Smrg	    ;;
672231637056Smrg        esac
672331637056Smrg        ;;
672431637056Smrg
672531637056Smrg      solaris*)
672631637056Smrg        case $cc_basename in
672731637056Smrg          CC* | sunCC*)
672831637056Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
672931637056Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
673031637056Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
673131637056Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
673231637056Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
673331637056Smrg	      $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'
673431637056Smrg
673531637056Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
673631637056Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
673731637056Smrg	    case $host_os in
673831637056Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
673931637056Smrg	      *)
674031637056Smrg		# The compiler driver will combine and reorder linker options,
674131637056Smrg		# but understands `-z linker_flag'.
674231637056Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
674331637056Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
674431637056Smrg	        ;;
674531637056Smrg	    esac
674631637056Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
674731637056Smrg
674831637056Smrg	    output_verbose_link_cmd='func_echo_all'
674931637056Smrg
675031637056Smrg	    # Archives containing C++ object files must be created using
675131637056Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
675231637056Smrg	    # necessary to make sure instantiated templates are included
675331637056Smrg	    # in the archive.
675431637056Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
675531637056Smrg	    ;;
675631637056Smrg          gcx*)
675731637056Smrg	    # Green Hills C++ Compiler
675831637056Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
675931637056Smrg
676031637056Smrg	    # The C++ compiler must be used to create the archive.
676131637056Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
676231637056Smrg	    ;;
676331637056Smrg          *)
676431637056Smrg	    # GNU C++ compiler with Solaris linker
676531637056Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
676631637056Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
676731637056Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
676831637056Smrg	        _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'
676931637056Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
677031637056Smrg		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
677131637056Smrg
677231637056Smrg	        # Commands to make compiler produce verbose output that lists
677331637056Smrg	        # what "hidden" libraries, object files and flags are used when
677431637056Smrg	        # linking a shared library.
677531637056Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
677631637056Smrg	      else
677731637056Smrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
677831637056Smrg	        # platform.
677931637056Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
678031637056Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
678131637056Smrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
678231637056Smrg
678331637056Smrg	        # Commands to make compiler produce verbose output that lists
678431637056Smrg	        # what "hidden" libraries, object files and flags are used when
678531637056Smrg	        # linking a shared library.
678631637056Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
678731637056Smrg	      fi
678831637056Smrg
678931637056Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
679031637056Smrg	      case $host_os in
679131637056Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
679231637056Smrg		*)
679331637056Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
679431637056Smrg		  ;;
679531637056Smrg	      esac
679631637056Smrg	    fi
679731637056Smrg	    ;;
679831637056Smrg        esac
679931637056Smrg        ;;
680031637056Smrg
680131637056Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
680231637056Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
680331637056Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
680431637056Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
680531637056Smrg      runpath_var='LD_RUN_PATH'
680631637056Smrg
680731637056Smrg      case $cc_basename in
680831637056Smrg        CC*)
680931637056Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
681031637056Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
681131637056Smrg	  ;;
681231637056Smrg	*)
681331637056Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
681431637056Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
681531637056Smrg	  ;;
681631637056Smrg      esac
681731637056Smrg      ;;
681831637056Smrg
681931637056Smrg      sysv5* | sco3.2v5* | sco5v6*)
682031637056Smrg	# Note: We can NOT use -z defs as we might desire, because we do not
682131637056Smrg	# link with -lc, and that would cause any symbols used from libc to
682231637056Smrg	# always be unresolved, which means just about no library would
682331637056Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
682431637056Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
682531637056Smrg	# as -z defs.
682631637056Smrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
682731637056Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
682831637056Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
682931637056Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
683031637056Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
683131637056Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
683231637056Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
683331637056Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
683431637056Smrg	runpath_var='LD_RUN_PATH'
683531637056Smrg
683631637056Smrg	case $cc_basename in
683731637056Smrg          CC*)
683831637056Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
683931637056Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
684031637056Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
684131637056Smrg	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
684231637056Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
684331637056Smrg	      '"$_LT_TAGVAR(reload_cmds, $1)"
684431637056Smrg	    ;;
684531637056Smrg	  *)
684631637056Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
684731637056Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
684831637056Smrg	    ;;
684931637056Smrg	esac
685031637056Smrg      ;;
685131637056Smrg
685231637056Smrg      tandem*)
685331637056Smrg        case $cc_basename in
685431637056Smrg          NCC*)
685531637056Smrg	    # NonStop-UX NCC 3.20
685631637056Smrg	    # FIXME: insert proper C++ library support
685731637056Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
685831637056Smrg	    ;;
685931637056Smrg          *)
686031637056Smrg	    # FIXME: insert proper C++ library support
686131637056Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
686231637056Smrg	    ;;
686331637056Smrg        esac
686431637056Smrg        ;;
686531637056Smrg
686631637056Smrg      vxworks*)
686731637056Smrg        # FIXME: insert proper C++ library support
686831637056Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
686931637056Smrg        ;;
687031637056Smrg
687131637056Smrg      *)
687231637056Smrg        # FIXME: insert proper C++ library support
687331637056Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
687431637056Smrg        ;;
687531637056Smrg    esac
687631637056Smrg
687731637056Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
687831637056Smrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
687931637056Smrg
688031637056Smrg    _LT_TAGVAR(GCC, $1)="$GXX"
688131637056Smrg    _LT_TAGVAR(LD, $1)="$LD"
688231637056Smrg
688331637056Smrg    ## CAVEAT EMPTOR:
688431637056Smrg    ## There is no encapsulation within the following macros, do not change
688531637056Smrg    ## the running order or otherwise move them around unless you know exactly
688631637056Smrg    ## what you are doing...
688731637056Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
688831637056Smrg    _LT_COMPILER_PIC($1)
688931637056Smrg    _LT_COMPILER_C_O($1)
689031637056Smrg    _LT_COMPILER_FILE_LOCKS($1)
689131637056Smrg    _LT_LINKER_SHLIBS($1)
689231637056Smrg    _LT_SYS_DYNAMIC_LINKER($1)
689331637056Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
689431637056Smrg
689531637056Smrg    _LT_CONFIG($1)
689631637056Smrg  fi # test -n "$compiler"
689731637056Smrg
689831637056Smrg  CC=$lt_save_CC
689931637056Smrg  CFLAGS=$lt_save_CFLAGS
690031637056Smrg  LDCXX=$LD
690131637056Smrg  LD=$lt_save_LD
690231637056Smrg  GCC=$lt_save_GCC
690331637056Smrg  with_gnu_ld=$lt_save_with_gnu_ld
690431637056Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
690531637056Smrg  lt_cv_path_LD=$lt_save_path_LD
690631637056Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
690731637056Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
690831637056Smrgfi # test "$_lt_caught_CXX_error" != yes
690931637056Smrg
691031637056SmrgAC_LANG_POP
691131637056Smrg])# _LT_LANG_CXX_CONFIG
691231637056Smrg
691331637056Smrg
691431637056Smrg# _LT_FUNC_STRIPNAME_CNF
691531637056Smrg# ----------------------
691631637056Smrg# func_stripname_cnf prefix suffix name
691731637056Smrg# strip PREFIX and SUFFIX off of NAME.
691831637056Smrg# PREFIX and SUFFIX must not contain globbing or regex special
691931637056Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
692031637056Smrg# dot (in which case that matches only a dot).
692131637056Smrg#
692231637056Smrg# This function is identical to the (non-XSI) version of func_stripname,
692331637056Smrg# except this one can be used by m4 code that may be executed by configure,
692431637056Smrg# rather than the libtool script.
692531637056Smrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
692631637056SmrgAC_REQUIRE([_LT_DECL_SED])
692731637056SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
692831637056Smrgfunc_stripname_cnf ()
692931637056Smrg{
693031637056Smrg  case ${2} in
693131637056Smrg  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
693231637056Smrg  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
693331637056Smrg  esac
693431637056Smrg} # func_stripname_cnf
693531637056Smrg])# _LT_FUNC_STRIPNAME_CNF
693631637056Smrg
693731637056Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
693831637056Smrg# ---------------------------------
693931637056Smrg# Figure out "hidden" library dependencies from verbose
694031637056Smrg# compiler output when linking a shared library.
694131637056Smrg# Parse the compiler output and extract the necessary
694231637056Smrg# objects, libraries and library flags.
694331637056Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
694431637056Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
694531637056SmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
694631637056Smrg# Dependencies to place before and after the object being linked:
694731637056Smrg_LT_TAGVAR(predep_objects, $1)=
694831637056Smrg_LT_TAGVAR(postdep_objects, $1)=
694931637056Smrg_LT_TAGVAR(predeps, $1)=
695031637056Smrg_LT_TAGVAR(postdeps, $1)=
695131637056Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
695231637056Smrg
695331637056Smrgdnl we can't use the lt_simple_compile_test_code here,
695431637056Smrgdnl because it contains code intended for an executable,
695531637056Smrgdnl not a library.  It's possible we should let each
695631637056Smrgdnl tag define a new lt_????_link_test_code variable,
695731637056Smrgdnl but it's only used here...
695831637056Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
695931637056Smrgint a;
696031637056Smrgvoid foo (void) { a = 0; }
696131637056Smrg_LT_EOF
696231637056Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
696331637056Smrgclass Foo
696431637056Smrg{
696531637056Smrgpublic:
696631637056Smrg  Foo (void) { a = 0; }
696731637056Smrgprivate:
696831637056Smrg  int a;
696931637056Smrg};
697031637056Smrg_LT_EOF
697131637056Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
697231637056Smrg      subroutine foo
697331637056Smrg      implicit none
697431637056Smrg      integer*4 a
697531637056Smrg      a=0
697631637056Smrg      return
697731637056Smrg      end
697831637056Smrg_LT_EOF
697931637056Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
698031637056Smrg      subroutine foo
698131637056Smrg      implicit none
698231637056Smrg      integer a
698331637056Smrg      a=0
698431637056Smrg      return
698531637056Smrg      end
698631637056Smrg_LT_EOF
698731637056Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
698831637056Smrgpublic class foo {
698931637056Smrg  private int a;
699031637056Smrg  public void bar (void) {
699131637056Smrg    a = 0;
699231637056Smrg  }
699331637056Smrg};
699431637056Smrg_LT_EOF
699531637056Smrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
699631637056Smrgpackage foo
699731637056Smrgfunc foo() {
699831637056Smrg}
699931637056Smrg_LT_EOF
700031637056Smrg])
700131637056Smrg
700231637056Smrg_lt_libdeps_save_CFLAGS=$CFLAGS
700331637056Smrgcase "$CC $CFLAGS " in #(
700431637056Smrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
700531637056Smrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
700631637056Smrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
700731637056Smrgesac
700831637056Smrg
700931637056Smrgdnl Parse the compiler output and extract the necessary
701031637056Smrgdnl objects, libraries and library flags.
701131637056Smrgif AC_TRY_EVAL(ac_compile); then
701231637056Smrg  # Parse the compiler output and extract the necessary
701331637056Smrg  # objects, libraries and library flags.
701431637056Smrg
701531637056Smrg  # Sentinel used to keep track of whether or not we are before
701631637056Smrg  # the conftest object file.
701731637056Smrg  pre_test_object_deps_done=no
701831637056Smrg
701931637056Smrg  for p in `eval "$output_verbose_link_cmd"`; do
702031637056Smrg    case ${prev}${p} in
702131637056Smrg
702231637056Smrg    -L* | -R* | -l*)
702331637056Smrg       # Some compilers place space between "-{L,R}" and the path.
702431637056Smrg       # Remove the space.
702531637056Smrg       if test $p = "-L" ||
702631637056Smrg          test $p = "-R"; then
702731637056Smrg	 prev=$p
702831637056Smrg	 continue
702931637056Smrg       fi
703031637056Smrg
703131637056Smrg       # Expand the sysroot to ease extracting the directories later.
703231637056Smrg       if test -z "$prev"; then
703331637056Smrg         case $p in
703431637056Smrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
703531637056Smrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
703631637056Smrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
703731637056Smrg         esac
703831637056Smrg       fi
703931637056Smrg       case $p in
704031637056Smrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
704131637056Smrg       esac
704231637056Smrg       if test "$pre_test_object_deps_done" = no; then
704331637056Smrg	 case ${prev} in
704431637056Smrg	 -L | -R)
704531637056Smrg	   # Internal compiler library paths should come after those
704631637056Smrg	   # provided the user.  The postdeps already come after the
704731637056Smrg	   # user supplied libs so there is no need to process them.
704831637056Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
704931637056Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
705031637056Smrg	   else
705131637056Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
705231637056Smrg	   fi
705331637056Smrg	   ;;
705431637056Smrg	 # The "-l" case would never come before the object being
705531637056Smrg	 # linked, so don't bother handling this case.
705631637056Smrg	 esac
705731637056Smrg       else
705831637056Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
705931637056Smrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
706031637056Smrg	 else
706131637056Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
706231637056Smrg	 fi
706331637056Smrg       fi
706431637056Smrg       prev=
706531637056Smrg       ;;
706631637056Smrg
706731637056Smrg    *.lto.$objext) ;; # Ignore GCC LTO objects
706831637056Smrg    *.$objext)
706931637056Smrg       # This assumes that the test object file only shows up
707031637056Smrg       # once in the compiler output.
707131637056Smrg       if test "$p" = "conftest.$objext"; then
707231637056Smrg	 pre_test_object_deps_done=yes
707331637056Smrg	 continue
707431637056Smrg       fi
7075ea133fd7Smrg
707631637056Smrg       if test "$pre_test_object_deps_done" = no; then
707731637056Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
707831637056Smrg	   _LT_TAGVAR(predep_objects, $1)="$p"
707931637056Smrg	 else
708031637056Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
708131637056Smrg	 fi
708231637056Smrg       else
708331637056Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
708431637056Smrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
708531637056Smrg	 else
708631637056Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
708731637056Smrg	 fi
708831637056Smrg       fi
708931637056Smrg       ;;
7090ea133fd7Smrg
709131637056Smrg    *) ;; # Ignore the rest.
7092ea133fd7Smrg
709331637056Smrg    esac
709431637056Smrg  done
709506f32fbeSmrg
709631637056Smrg  # Clean up.
709731637056Smrg  rm -f a.out a.exe
709831637056Smrgelse
709931637056Smrg  echo "libtool.m4: error: problem compiling $1 test program"
710031637056Smrgfi
710106f32fbeSmrg
710231637056Smrg$RM -f confest.$objext
710331637056SmrgCFLAGS=$_lt_libdeps_save_CFLAGS
710406f32fbeSmrg
710531637056Smrg# PORTME: override above test on systems where it is broken
710631637056Smrgm4_if([$1], [CXX],
710731637056Smrg[case $host_os in
710831637056Smrginterix[[3-9]]*)
710931637056Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
711031637056Smrg  # hack all around it, let's just trust "g++" to DTRT.
711131637056Smrg  _LT_TAGVAR(predep_objects,$1)=
711231637056Smrg  _LT_TAGVAR(postdep_objects,$1)=
711331637056Smrg  _LT_TAGVAR(postdeps,$1)=
711431637056Smrg  ;;
711506f32fbeSmrg
711631637056Smrglinux*)
711731637056Smrg  case `$CC -V 2>&1 | sed 5q` in
711831637056Smrg  *Sun\ C*)
711931637056Smrg    # Sun C++ 5.9
712006f32fbeSmrg
712131637056Smrg    # The more standards-conforming stlport4 library is
712231637056Smrg    # incompatible with the Cstd library. Avoid specifying
712331637056Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
712431637056Smrg    # -library=stlport4 depends on it.
712531637056Smrg    case " $CXX $CXXFLAGS " in
712631637056Smrg    *" -library=stlport4 "*)
712731637056Smrg      solaris_use_stlport4=yes
712831637056Smrg      ;;
712931637056Smrg    esac
713006f32fbeSmrg
713131637056Smrg    if test "$solaris_use_stlport4" != yes; then
713231637056Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
713331637056Smrg    fi
713431637056Smrg    ;;
713531637056Smrg  esac
713631637056Smrg  ;;
713706f32fbeSmrg
713831637056Smrgsolaris*)
713931637056Smrg  case $cc_basename in
714031637056Smrg  CC* | sunCC*)
714131637056Smrg    # The more standards-conforming stlport4 library is
714231637056Smrg    # incompatible with the Cstd library. Avoid specifying
714331637056Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
714431637056Smrg    # -library=stlport4 depends on it.
714531637056Smrg    case " $CXX $CXXFLAGS " in
714631637056Smrg    *" -library=stlport4 "*)
714731637056Smrg      solaris_use_stlport4=yes
714831637056Smrg      ;;
714931637056Smrg    esac
715006f32fbeSmrg
715131637056Smrg    # Adding this requires a known-good setup of shared libraries for
715231637056Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
715331637056Smrg    # archive will be linked into the output, leading to subtle bugs.
715431637056Smrg    if test "$solaris_use_stlport4" != yes; then
715531637056Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
715631637056Smrg    fi
715731637056Smrg    ;;
715831637056Smrg  esac
715931637056Smrg  ;;
716031637056Smrgesac
716131637056Smrg])
716231637056Smrg
716331637056Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
716431637056Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
716531637056Smrgesac
716631637056Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
716731637056Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
716831637056Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
716931637056Smrgfi
717031637056Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
717131637056Smrg    [The directories searched by this compiler when creating a shared library])
717231637056Smrg_LT_TAGDECL([], [predep_objects], [1],
717331637056Smrg    [Dependencies to place before and after the objects being linked to
717431637056Smrg    create a shared library])
717531637056Smrg_LT_TAGDECL([], [postdep_objects], [1])
717631637056Smrg_LT_TAGDECL([], [predeps], [1])
717731637056Smrg_LT_TAGDECL([], [postdeps], [1])
717831637056Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
717931637056Smrg    [The library search path used internally by the compiler when linking
718031637056Smrg    a shared library])
718131637056Smrg])# _LT_SYS_HIDDEN_LIBDEPS
718231637056Smrg
718331637056Smrg
718431637056Smrg# _LT_LANG_F77_CONFIG([TAG])
718531637056Smrg# --------------------------
718631637056Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
718731637056Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
718831637056Smrg# to write the compiler configuration to `libtool'.
718931637056Smrgm4_defun([_LT_LANG_F77_CONFIG],
719031637056Smrg[AC_LANG_PUSH(Fortran 77)
719131637056Smrgif test -z "$F77" || test "X$F77" = "Xno"; then
719231637056Smrg  _lt_disable_F77=yes
719331637056Smrgfi
719431637056Smrg
719531637056Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
719631637056Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
719731637056Smrg_LT_TAGVAR(always_export_symbols, $1)=no
719831637056Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
719931637056Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
720031637056Smrg_LT_TAGVAR(hardcode_direct, $1)=no
720131637056Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
720231637056Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
720331637056Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
720431637056Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
720531637056Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
720631637056Smrg_LT_TAGVAR(inherit_rpath, $1)=no
720731637056Smrg_LT_TAGVAR(module_cmds, $1)=
720831637056Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
720931637056Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
721031637056Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
721131637056Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
721231637056Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
721331637056Smrg_LT_TAGVAR(no_undefined_flag, $1)=
721431637056Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
721531637056Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
721606f32fbeSmrg
721731637056Smrg# Source file extension for f77 test sources.
721831637056Smrgac_ext=f
721906f32fbeSmrg
722031637056Smrg# Object file extension for compiled f77 test sources.
722131637056Smrgobjext=o
722231637056Smrg_LT_TAGVAR(objext, $1)=$objext
722306f32fbeSmrg
722431637056Smrg# No sense in running all these tests if we already determined that
722531637056Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
722631637056Smrg# are currently assumed to apply to all compilers on this platform,
722731637056Smrg# and will be corrupted by setting them based on a non-working compiler.
722831637056Smrgif test "$_lt_disable_F77" != yes; then
722931637056Smrg  # Code to be used in simple compile tests
723031637056Smrg  lt_simple_compile_test_code="\
723131637056Smrg      subroutine t
723231637056Smrg      return
723331637056Smrg      end
723431637056Smrg"
723506f32fbeSmrg
723631637056Smrg  # Code to be used in simple link tests
723731637056Smrg  lt_simple_link_test_code="\
723831637056Smrg      program t
723931637056Smrg      end
724031637056Smrg"
724106f32fbeSmrg
724231637056Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
724331637056Smrg  _LT_TAG_COMPILER
724406f32fbeSmrg
724531637056Smrg  # save warnings/boilerplate of simple test code
724631637056Smrg  _LT_COMPILER_BOILERPLATE
724731637056Smrg  _LT_LINKER_BOILERPLATE
724806f32fbeSmrg
724931637056Smrg  # Allow CC to be a program name with arguments.
725031637056Smrg  lt_save_CC="$CC"
725131637056Smrg  lt_save_GCC=$GCC
725231637056Smrg  lt_save_CFLAGS=$CFLAGS
725331637056Smrg  CC=${F77-"f77"}
725431637056Smrg  CFLAGS=$FFLAGS
725531637056Smrg  compiler=$CC
725631637056Smrg  _LT_TAGVAR(compiler, $1)=$CC
725731637056Smrg  _LT_CC_BASENAME([$compiler])
725831637056Smrg  GCC=$G77
725931637056Smrg  if test -n "$compiler"; then
726031637056Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
726131637056Smrg    AC_MSG_RESULT([$can_build_shared])
726206f32fbeSmrg
726331637056Smrg    AC_MSG_CHECKING([whether to build shared libraries])
726431637056Smrg    test "$can_build_shared" = "no" && enable_shared=no
726506f32fbeSmrg
726631637056Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
726731637056Smrg    # are all built from PIC.
726831637056Smrg    case $host_os in
726931637056Smrg      aix3*)
727031637056Smrg        test "$enable_shared" = yes && enable_static=no
727131637056Smrg        if test -n "$RANLIB"; then
727231637056Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
727331637056Smrg          postinstall_cmds='$RANLIB $lib'
727431637056Smrg        fi
727506f32fbeSmrg        ;;
727631637056Smrg      aix[[4-9]]*)
727731637056Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
727831637056Smrg	  test "$enable_shared" = yes && enable_static=no
727931637056Smrg	fi
728006f32fbeSmrg        ;;
728131637056Smrg    esac
728231637056Smrg    AC_MSG_RESULT([$enable_shared])
728306f32fbeSmrg
728431637056Smrg    AC_MSG_CHECKING([whether to build static libraries])
728531637056Smrg    # Make sure either enable_shared or enable_static is yes.
728631637056Smrg    test "$enable_shared" = yes || enable_static=yes
728731637056Smrg    AC_MSG_RESULT([$enable_static])
728806f32fbeSmrg
728931637056Smrg    _LT_TAGVAR(GCC, $1)="$G77"
729031637056Smrg    _LT_TAGVAR(LD, $1)="$LD"
729106f32fbeSmrg
729231637056Smrg    ## CAVEAT EMPTOR:
729331637056Smrg    ## There is no encapsulation within the following macros, do not change
729431637056Smrg    ## the running order or otherwise move them around unless you know exactly
729531637056Smrg    ## what you are doing...
729631637056Smrg    _LT_COMPILER_PIC($1)
729731637056Smrg    _LT_COMPILER_C_O($1)
729831637056Smrg    _LT_COMPILER_FILE_LOCKS($1)
729931637056Smrg    _LT_LINKER_SHLIBS($1)
730031637056Smrg    _LT_SYS_DYNAMIC_LINKER($1)
730131637056Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
730206f32fbeSmrg
730331637056Smrg    _LT_CONFIG($1)
730431637056Smrg  fi # test -n "$compiler"
730506f32fbeSmrg
730631637056Smrg  GCC=$lt_save_GCC
730731637056Smrg  CC="$lt_save_CC"
730831637056Smrg  CFLAGS="$lt_save_CFLAGS"
730931637056Smrgfi # test "$_lt_disable_F77" != yes
731006f32fbeSmrg
731131637056SmrgAC_LANG_POP
731231637056Smrg])# _LT_LANG_F77_CONFIG
731331637056Smrg
731431637056Smrg
731531637056Smrg# _LT_LANG_FC_CONFIG([TAG])
731631637056Smrg# -------------------------
731731637056Smrg# Ensure that the configuration variables for a Fortran compiler are
731831637056Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
731931637056Smrg# to write the compiler configuration to `libtool'.
732031637056Smrgm4_defun([_LT_LANG_FC_CONFIG],
732131637056Smrg[AC_LANG_PUSH(Fortran)
732231637056Smrg
732331637056Smrgif test -z "$FC" || test "X$FC" = "Xno"; then
732431637056Smrg  _lt_disable_FC=yes
732531637056Smrgfi
732631637056Smrg
732731637056Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
732831637056Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
732931637056Smrg_LT_TAGVAR(always_export_symbols, $1)=no
733031637056Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
733131637056Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
733231637056Smrg_LT_TAGVAR(hardcode_direct, $1)=no
733331637056Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
733431637056Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
733531637056Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
733631637056Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
733731637056Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
733831637056Smrg_LT_TAGVAR(inherit_rpath, $1)=no
733931637056Smrg_LT_TAGVAR(module_cmds, $1)=
734031637056Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
734131637056Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
734231637056Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
734331637056Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
734431637056Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
734531637056Smrg_LT_TAGVAR(no_undefined_flag, $1)=
734631637056Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
734731637056Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
734831637056Smrg
734931637056Smrg# Source file extension for fc test sources.
735031637056Smrgac_ext=${ac_fc_srcext-f}
735106f32fbeSmrg
735231637056Smrg# Object file extension for compiled fc test sources.
735331637056Smrgobjext=o
735431637056Smrg_LT_TAGVAR(objext, $1)=$objext
735506f32fbeSmrg
735631637056Smrg# No sense in running all these tests if we already determined that
735731637056Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
735831637056Smrg# are currently assumed to apply to all compilers on this platform,
735931637056Smrg# and will be corrupted by setting them based on a non-working compiler.
736031637056Smrgif test "$_lt_disable_FC" != yes; then
736131637056Smrg  # Code to be used in simple compile tests
736231637056Smrg  lt_simple_compile_test_code="\
736331637056Smrg      subroutine t
736431637056Smrg      return
736531637056Smrg      end
736631637056Smrg"
736706f32fbeSmrg
736831637056Smrg  # Code to be used in simple link tests
736931637056Smrg  lt_simple_link_test_code="\
737031637056Smrg      program t
737131637056Smrg      end
737231637056Smrg"
737306f32fbeSmrg
737431637056Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
737531637056Smrg  _LT_TAG_COMPILER
737606f32fbeSmrg
737731637056Smrg  # save warnings/boilerplate of simple test code
737831637056Smrg  _LT_COMPILER_BOILERPLATE
737931637056Smrg  _LT_LINKER_BOILERPLATE
738006f32fbeSmrg
738131637056Smrg  # Allow CC to be a program name with arguments.
738231637056Smrg  lt_save_CC="$CC"
738331637056Smrg  lt_save_GCC=$GCC
738431637056Smrg  lt_save_CFLAGS=$CFLAGS
738531637056Smrg  CC=${FC-"f95"}
738631637056Smrg  CFLAGS=$FCFLAGS
738731637056Smrg  compiler=$CC
738831637056Smrg  GCC=$ac_cv_fc_compiler_gnu
738906f32fbeSmrg
739031637056Smrg  _LT_TAGVAR(compiler, $1)=$CC
739131637056Smrg  _LT_CC_BASENAME([$compiler])
739206f32fbeSmrg
739331637056Smrg  if test -n "$compiler"; then
739431637056Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
739531637056Smrg    AC_MSG_RESULT([$can_build_shared])
739606f32fbeSmrg
739731637056Smrg    AC_MSG_CHECKING([whether to build shared libraries])
739831637056Smrg    test "$can_build_shared" = "no" && enable_shared=no
739906f32fbeSmrg
740031637056Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
740131637056Smrg    # are all built from PIC.
740231637056Smrg    case $host_os in
740331637056Smrg      aix3*)
740431637056Smrg        test "$enable_shared" = yes && enable_static=no
740531637056Smrg        if test -n "$RANLIB"; then
740631637056Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
740731637056Smrg          postinstall_cmds='$RANLIB $lib'
740831637056Smrg        fi
740931637056Smrg        ;;
741031637056Smrg      aix[[4-9]]*)
741131637056Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
741231637056Smrg	  test "$enable_shared" = yes && enable_static=no
741331637056Smrg	fi
741406f32fbeSmrg        ;;
741506f32fbeSmrg    esac
741631637056Smrg    AC_MSG_RESULT([$enable_shared])
741706f32fbeSmrg
741831637056Smrg    AC_MSG_CHECKING([whether to build static libraries])
741931637056Smrg    # Make sure either enable_shared or enable_static is yes.
742031637056Smrg    test "$enable_shared" = yes || enable_static=yes
742131637056Smrg    AC_MSG_RESULT([$enable_static])
742206f32fbeSmrg
742331637056Smrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
742406f32fbeSmrg    _LT_TAGVAR(LD, $1)="$LD"
742506f32fbeSmrg
742606f32fbeSmrg    ## CAVEAT EMPTOR:
742706f32fbeSmrg    ## There is no encapsulation within the following macros, do not change
742806f32fbeSmrg    ## the running order or otherwise move them around unless you know exactly
742906f32fbeSmrg    ## what you are doing...
743006f32fbeSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
743106f32fbeSmrg    _LT_COMPILER_PIC($1)
743206f32fbeSmrg    _LT_COMPILER_C_O($1)
743306f32fbeSmrg    _LT_COMPILER_FILE_LOCKS($1)
743406f32fbeSmrg    _LT_LINKER_SHLIBS($1)
743506f32fbeSmrg    _LT_SYS_DYNAMIC_LINKER($1)
743606f32fbeSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
743706f32fbeSmrg
743806f32fbeSmrg    _LT_CONFIG($1)
743906f32fbeSmrg  fi # test -n "$compiler"
744006f32fbeSmrg
744131637056Smrg  GCC=$lt_save_GCC
744231637056Smrg  CC=$lt_save_CC
744331637056Smrg  CFLAGS=$lt_save_CFLAGS
744431637056Smrgfi # test "$_lt_disable_FC" != yes
744531637056Smrg
744631637056SmrgAC_LANG_POP
744731637056Smrg])# _LT_LANG_FC_CONFIG
744831637056Smrg
744931637056Smrg
745031637056Smrg# _LT_LANG_GCJ_CONFIG([TAG])
745131637056Smrg# --------------------------
745231637056Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
745331637056Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
745431637056Smrg# to write the compiler configuration to `libtool'.
745531637056Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
745631637056Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
745731637056SmrgAC_LANG_SAVE
745831637056Smrg
745931637056Smrg# Source file extension for Java test sources.
746031637056Smrgac_ext=java
746131637056Smrg
746231637056Smrg# Object file extension for compiled Java test sources.
746331637056Smrgobjext=o
746431637056Smrg_LT_TAGVAR(objext, $1)=$objext
746531637056Smrg
746631637056Smrg# Code to be used in simple compile tests
746731637056Smrglt_simple_compile_test_code="class foo {}"
746831637056Smrg
746931637056Smrg# Code to be used in simple link tests
747031637056Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
747131637056Smrg
747231637056Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
747331637056Smrg_LT_TAG_COMPILER
747431637056Smrg
747531637056Smrg# save warnings/boilerplate of simple test code
747631637056Smrg_LT_COMPILER_BOILERPLATE
747731637056Smrg_LT_LINKER_BOILERPLATE
747831637056Smrg
747931637056Smrg# Allow CC to be a program name with arguments.
748031637056Smrglt_save_CC=$CC
748131637056Smrglt_save_CFLAGS=$CFLAGS
748231637056Smrglt_save_GCC=$GCC
748331637056SmrgGCC=yes
748431637056SmrgCC=${GCJ-"gcj"}
748531637056SmrgCFLAGS=$GCJFLAGS
748631637056Smrgcompiler=$CC
748731637056Smrg_LT_TAGVAR(compiler, $1)=$CC
748831637056Smrg_LT_TAGVAR(LD, $1)="$LD"
748931637056Smrg_LT_CC_BASENAME([$compiler])
749031637056Smrg
749131637056Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
749231637056Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
749331637056Smrg
749431637056Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
749531637056Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
749631637056Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
749731637056Smrg
749831637056Smrgif test -n "$compiler"; then
749931637056Smrg  _LT_COMPILER_NO_RTTI($1)
750031637056Smrg  _LT_COMPILER_PIC($1)
750131637056Smrg  _LT_COMPILER_C_O($1)
750231637056Smrg  _LT_COMPILER_FILE_LOCKS($1)
750331637056Smrg  _LT_LINKER_SHLIBS($1)
750431637056Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
750531637056Smrg
750631637056Smrg  _LT_CONFIG($1)
750731637056Smrgfi
750831637056Smrg
750931637056SmrgAC_LANG_RESTORE
751031637056Smrg
751131637056SmrgGCC=$lt_save_GCC
751231637056SmrgCC=$lt_save_CC
751331637056SmrgCFLAGS=$lt_save_CFLAGS
751431637056Smrg])# _LT_LANG_GCJ_CONFIG
751531637056Smrg
751631637056Smrg
751731637056Smrg# _LT_LANG_GO_CONFIG([TAG])
751831637056Smrg# --------------------------
751931637056Smrg# Ensure that the configuration variables for the GNU Go compiler
752031637056Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
752131637056Smrg# to write the compiler configuration to `libtool'.
752231637056Smrgm4_defun([_LT_LANG_GO_CONFIG],
752331637056Smrg[AC_REQUIRE([LT_PROG_GO])dnl
752431637056SmrgAC_LANG_SAVE
752531637056Smrg
752631637056Smrg# Source file extension for Go test sources.
752731637056Smrgac_ext=go
752831637056Smrg
752931637056Smrg# Object file extension for compiled Go test sources.
753031637056Smrgobjext=o
753131637056Smrg_LT_TAGVAR(objext, $1)=$objext
753231637056Smrg
753331637056Smrg# Code to be used in simple compile tests
753431637056Smrglt_simple_compile_test_code="package main; func main() { }"
753531637056Smrg
753631637056Smrg# Code to be used in simple link tests
753731637056Smrglt_simple_link_test_code='package main; func main() { }'
753831637056Smrg
753931637056Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
754031637056Smrg_LT_TAG_COMPILER
754131637056Smrg
754231637056Smrg# save warnings/boilerplate of simple test code
754331637056Smrg_LT_COMPILER_BOILERPLATE
754431637056Smrg_LT_LINKER_BOILERPLATE
754506f32fbeSmrg
754631637056Smrg# Allow CC to be a program name with arguments.
754731637056Smrglt_save_CC=$CC
754831637056Smrglt_save_CFLAGS=$CFLAGS
754931637056Smrglt_save_GCC=$GCC
755031637056SmrgGCC=yes
755131637056SmrgCC=${GOC-"gccgo"}
755231637056SmrgCFLAGS=$GOFLAGS
755331637056Smrgcompiler=$CC
755431637056Smrg_LT_TAGVAR(compiler, $1)=$CC
755531637056Smrg_LT_TAGVAR(LD, $1)="$LD"
755631637056Smrg_LT_CC_BASENAME([$compiler])
755706f32fbeSmrg
755831637056Smrg# Go did not exist at the time GCC didn't implicitly link libc in.
755931637056Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
756006f32fbeSmrg
756131637056Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
756231637056Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
756331637056Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
756406f32fbeSmrg
756531637056Smrgif test -n "$compiler"; then
756631637056Smrg  _LT_COMPILER_NO_RTTI($1)
756731637056Smrg  _LT_COMPILER_PIC($1)
756831637056Smrg  _LT_COMPILER_C_O($1)
756931637056Smrg  _LT_COMPILER_FILE_LOCKS($1)
757031637056Smrg  _LT_LINKER_SHLIBS($1)
757131637056Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
757206f32fbeSmrg
757331637056Smrg  _LT_CONFIG($1)
757431637056Smrgfi
757506f32fbeSmrg
757631637056SmrgAC_LANG_RESTORE
757706f32fbeSmrg
757831637056SmrgGCC=$lt_save_GCC
757931637056SmrgCC=$lt_save_CC
758031637056SmrgCFLAGS=$lt_save_CFLAGS
758131637056Smrg])# _LT_LANG_GO_CONFIG
758206f32fbeSmrg
758306f32fbeSmrg
758431637056Smrg# _LT_LANG_RC_CONFIG([TAG])
758531637056Smrg# -------------------------
758631637056Smrg# Ensure that the configuration variables for the Windows resource compiler
758731637056Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
758831637056Smrg# to write the compiler configuration to `libtool'.
758931637056Smrgm4_defun([_LT_LANG_RC_CONFIG],
759031637056Smrg[AC_REQUIRE([LT_PROG_RC])dnl
759131637056SmrgAC_LANG_SAVE
759206f32fbeSmrg
759331637056Smrg# Source file extension for RC test sources.
759431637056Smrgac_ext=rc
759506f32fbeSmrg
759631637056Smrg# Object file extension for compiled RC test sources.
759731637056Smrgobjext=o
759831637056Smrg_LT_TAGVAR(objext, $1)=$objext
759906f32fbeSmrg
760031637056Smrg# Code to be used in simple compile tests
760131637056Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
760206f32fbeSmrg
760331637056Smrg# Code to be used in simple link tests
760431637056Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
7605ea133fd7Smrg
760631637056Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
760731637056Smrg_LT_TAG_COMPILER
7608ea133fd7Smrg
760931637056Smrg# save warnings/boilerplate of simple test code
761031637056Smrg_LT_COMPILER_BOILERPLATE
761131637056Smrg_LT_LINKER_BOILERPLATE
7612ea133fd7Smrg
761331637056Smrg# Allow CC to be a program name with arguments.
761431637056Smrglt_save_CC="$CC"
761531637056Smrglt_save_CFLAGS=$CFLAGS
761631637056Smrglt_save_GCC=$GCC
761731637056SmrgGCC=
761831637056SmrgCC=${RC-"windres"}
761931637056SmrgCFLAGS=
762031637056Smrgcompiler=$CC
762131637056Smrg_LT_TAGVAR(compiler, $1)=$CC
762231637056Smrg_LT_CC_BASENAME([$compiler])
762331637056Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
762431637056Smrg
762531637056Smrgif test -n "$compiler"; then
762631637056Smrg  :
762731637056Smrg  _LT_CONFIG($1)
762806f32fbeSmrgfi
7629ea133fd7Smrg
763031637056SmrgGCC=$lt_save_GCC
763131637056SmrgAC_LANG_RESTORE
763231637056SmrgCC=$lt_save_CC
763331637056SmrgCFLAGS=$lt_save_CFLAGS
763431637056Smrg])# _LT_LANG_RC_CONFIG
7635ea133fd7Smrg
7636ea133fd7Smrg
763731637056Smrg# LT_PROG_GCJ
763831637056Smrg# -----------
763931637056SmrgAC_DEFUN([LT_PROG_GCJ],
764031637056Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
764131637056Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
764231637056Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
764331637056Smrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
764431637056Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
764531637056Smrg])
7646ea133fd7Smrg
764731637056Smrg# Old name:
764831637056SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
764931637056Smrgdnl aclocal-1.4 backwards compatibility:
765031637056Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
7651ea133fd7Smrg
7652ea133fd7Smrg
765331637056Smrg# LT_PROG_GO
765431637056Smrg# ----------
765531637056SmrgAC_DEFUN([LT_PROG_GO],
765631637056Smrg[AC_CHECK_TOOL(GOC, gccgo,)
765706f32fbeSmrg])
7658ea133fd7Smrg
7659ea133fd7Smrg
766031637056Smrg# LT_PROG_RC
766131637056Smrg# ----------
766231637056SmrgAC_DEFUN([LT_PROG_RC],
766331637056Smrg[AC_CHECK_TOOL(RC, windres,)
766431637056Smrg])
7665ea133fd7Smrg
766631637056Smrg# Old name:
766731637056SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
766831637056Smrgdnl aclocal-1.4 backwards compatibility:
766931637056Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
767006f32fbeSmrg
767106f32fbeSmrg
767231637056Smrg# _LT_DECL_EGREP
767331637056Smrg# --------------
767431637056Smrg# If we don't have a new enough Autoconf to choose the best grep
767531637056Smrg# available, choose the one first in the user's PATH.
767631637056Smrgm4_defun([_LT_DECL_EGREP],
767731637056Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
767831637056SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
767931637056Smrgtest -z "$GREP" && GREP=grep
768031637056Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
768131637056Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
768231637056Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
768331637056Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
768431637056SmrgAC_SUBST([GREP])
768531637056Smrg])
768606f32fbeSmrg
768706f32fbeSmrg
768831637056Smrg# _LT_DECL_OBJDUMP
768931637056Smrg# --------------
769031637056Smrg# If we don't have a new enough Autoconf to choose the best objdump
769131637056Smrg# available, choose the one first in the user's PATH.
769231637056Smrgm4_defun([_LT_DECL_OBJDUMP],
769331637056Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
769431637056Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
769531637056Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
769631637056SmrgAC_SUBST([OBJDUMP])
769731637056Smrg])
769806f32fbeSmrg
769931637056Smrg# _LT_DECL_DLLTOOL
770031637056Smrg# ----------------
770131637056Smrg# Ensure DLLTOOL variable is set.
770231637056Smrgm4_defun([_LT_DECL_DLLTOOL],
770331637056Smrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
770431637056Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
770531637056Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
770631637056SmrgAC_SUBST([DLLTOOL])
770731637056Smrg])
7708ea133fd7Smrg
770931637056Smrg# _LT_DECL_SED
771031637056Smrg# ------------
771131637056Smrg# Check for a fully-functional sed program, that truncates
771231637056Smrg# as few characters as possible.  Prefer GNU sed if found.
771331637056Smrgm4_defun([_LT_DECL_SED],
771431637056Smrg[AC_PROG_SED
771531637056Smrgtest -z "$SED" && SED=sed
771631637056SmrgXsed="$SED -e 1s/^X//"
771731637056Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
771831637056Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
771931637056Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
772031637056Smrg])# _LT_DECL_SED
7721ea133fd7Smrg
772231637056Smrgm4_ifndef([AC_PROG_SED], [
772331637056Smrg# NOTE: This macro has been submitted for inclusion into   #
772431637056Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
772531637056Smrg#  a released version of Autoconf we should remove this    #
772631637056Smrg#  macro and use it instead.                               #
7727ea133fd7Smrg
772831637056Smrgm4_defun([AC_PROG_SED],
772931637056Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
773031637056SmrgAC_CACHE_VAL(lt_cv_path_SED,
773131637056Smrg[# Loop through the user's path and test for sed and gsed.
773231637056Smrg# Then use that list of sed's as ones to test for truncation.
773331637056Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
773431637056Smrgfor as_dir in $PATH
773531637056Smrgdo
773631637056Smrg  IFS=$as_save_IFS
773731637056Smrg  test -z "$as_dir" && as_dir=.
773831637056Smrg  for lt_ac_prog in sed gsed; do
773931637056Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
774031637056Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
774131637056Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
774231637056Smrg      fi
774331637056Smrg    done
774431637056Smrg  done
774531637056Smrgdone
774631637056SmrgIFS=$as_save_IFS
774731637056Smrglt_ac_max=0
774831637056Smrglt_ac_count=0
774931637056Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
775031637056Smrg# along with /bin/sed that truncates output.
775131637056Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
775231637056Smrg  test ! -f $lt_ac_sed && continue
775331637056Smrg  cat /dev/null > conftest.in
775431637056Smrg  lt_ac_count=0
775531637056Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
775631637056Smrg  # Check for GNU sed and select it if it is found.
775731637056Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
775831637056Smrg    lt_cv_path_SED=$lt_ac_sed
775931637056Smrg    break
776031637056Smrg  fi
776131637056Smrg  while true; do
776231637056Smrg    cat conftest.in conftest.in >conftest.tmp
776331637056Smrg    mv conftest.tmp conftest.in
776431637056Smrg    cp conftest.in conftest.nl
776531637056Smrg    echo >>conftest.nl
776631637056Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
776731637056Smrg    cmp -s conftest.out conftest.nl || break
776831637056Smrg    # 10000 chars as input seems more than enough
776931637056Smrg    test $lt_ac_count -gt 10 && break
777031637056Smrg    lt_ac_count=`expr $lt_ac_count + 1`
777131637056Smrg    if test $lt_ac_count -gt $lt_ac_max; then
777231637056Smrg      lt_ac_max=$lt_ac_count
777331637056Smrg      lt_cv_path_SED=$lt_ac_sed
777431637056Smrg    fi
777531637056Smrg  done
777631637056Smrgdone
777731637056Smrg])
777831637056SmrgSED=$lt_cv_path_SED
777931637056SmrgAC_SUBST([SED])
778031637056SmrgAC_MSG_RESULT([$SED])
778131637056Smrg])#AC_PROG_SED
778231637056Smrg])#m4_ifndef
7783ea133fd7Smrg
778431637056Smrg# Old name:
778531637056SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
778631637056Smrgdnl aclocal-1.4 backwards compatibility:
778731637056Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
7788ea133fd7Smrg
7789ea133fd7Smrg
779031637056Smrg# _LT_CHECK_SHELL_FEATURES
779131637056Smrg# ------------------------
779231637056Smrg# Find out whether the shell is Bourne or XSI compatible,
779331637056Smrg# or has some other useful features.
779431637056Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
779531637056Smrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
779631637056Smrg# Try some XSI features
779731637056Smrgxsi_shell=no
779831637056Smrg( _lt_dummy="a/b/c"
779931637056Smrg  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
780031637056Smrg      = c,a/b,b/c, \
780131637056Smrg    && eval 'test $(( 1 + 1 )) -eq 2 \
780231637056Smrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
780331637056Smrg  && xsi_shell=yes
780431637056SmrgAC_MSG_RESULT([$xsi_shell])
780531637056Smrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
7806ea133fd7Smrg
780731637056SmrgAC_MSG_CHECKING([whether the shell understands "+="])
780831637056Smrglt_shell_append=no
780931637056Smrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
781031637056Smrg    >/dev/null 2>&1 \
781131637056Smrg  && lt_shell_append=yes
781231637056SmrgAC_MSG_RESULT([$lt_shell_append])
781331637056Smrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
7814ea133fd7Smrg
781531637056Smrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
781631637056Smrg  lt_unset=unset
781731637056Smrgelse
781831637056Smrg  lt_unset=false
781931637056Smrgfi
782031637056Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
7821ea133fd7Smrg
782231637056Smrg# test EBCDIC or ASCII
782331637056Smrgcase `echo X|tr X '\101'` in
782431637056Smrg A) # ASCII based system
782531637056Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
782631637056Smrg  lt_SP2NL='tr \040 \012'
782731637056Smrg  lt_NL2SP='tr \015\012 \040\040'
782831637056Smrg  ;;
782931637056Smrg *) # EBCDIC based system
783031637056Smrg  lt_SP2NL='tr \100 \n'
783131637056Smrg  lt_NL2SP='tr \r\n \100\100'
783231637056Smrg  ;;
783331637056Smrgesac
783431637056Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
783531637056Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
783631637056Smrg])# _LT_CHECK_SHELL_FEATURES
7837ea133fd7Smrg
7838ea133fd7Smrg
783931637056Smrg# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
784031637056Smrg# ------------------------------------------------------
784131637056Smrg# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
784231637056Smrg# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
784331637056Smrgm4_defun([_LT_PROG_FUNCTION_REPLACE],
784431637056Smrg[dnl {
784531637056Smrgsed -e '/^$1 ()$/,/^} # $1 /c\
784631637056Smrg$1 ()\
784731637056Smrg{\
784831637056Smrgm4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
784931637056Smrg} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
785031637056Smrg  && mv -f "$cfgfile.tmp" "$cfgfile" \
785131637056Smrg    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
785231637056Smrgtest 0 -eq $? || _lt_function_replace_fail=:
785331637056Smrg])
7854ea133fd7Smrg
7855ea133fd7Smrg
785631637056Smrg# _LT_PROG_REPLACE_SHELLFNS
785706f32fbeSmrg# -------------------------
785831637056Smrg# Replace existing portable implementations of several shell functions with
785931637056Smrg# equivalent extended shell implementations where those features are available..
786031637056Smrgm4_defun([_LT_PROG_REPLACE_SHELLFNS],
786131637056Smrg[if test x"$xsi_shell" = xyes; then
786231637056Smrg  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
786331637056Smrg    case ${1} in
786431637056Smrg      */*) func_dirname_result="${1%/*}${2}" ;;
786531637056Smrg      *  ) func_dirname_result="${3}" ;;
786631637056Smrg    esac])
7867ea133fd7Smrg
786831637056Smrg  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
786931637056Smrg    func_basename_result="${1##*/}"])
7870ea133fd7Smrg
787131637056Smrg  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
787231637056Smrg    case ${1} in
787331637056Smrg      */*) func_dirname_result="${1%/*}${2}" ;;
787431637056Smrg      *  ) func_dirname_result="${3}" ;;
787531637056Smrg    esac
787631637056Smrg    func_basename_result="${1##*/}"])
787706f32fbeSmrg
787831637056Smrg  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
787931637056Smrg    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
788031637056Smrg    # positional parameters, so assign one to ordinary parameter first.
788131637056Smrg    func_stripname_result=${3}
788231637056Smrg    func_stripname_result=${func_stripname_result#"${1}"}
788331637056Smrg    func_stripname_result=${func_stripname_result%"${2}"}])
788406f32fbeSmrg
788531637056Smrg  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
788631637056Smrg    func_split_long_opt_name=${1%%=*}
788731637056Smrg    func_split_long_opt_arg=${1#*=}])
788806f32fbeSmrg
788931637056Smrg  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
789031637056Smrg    func_split_short_opt_arg=${1#??}
789131637056Smrg    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
789206f32fbeSmrg
789331637056Smrg  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
789431637056Smrg    case ${1} in
789531637056Smrg      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
789631637056Smrg      *)    func_lo2o_result=${1} ;;
789731637056Smrg    esac])
789806f32fbeSmrg
789931637056Smrg  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
7900ea133fd7Smrg
790131637056Smrg  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
7902ea133fd7Smrg
790331637056Smrg  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
790431637056Smrgfi
7905ea133fd7Smrg
790631637056Smrgif test x"$lt_shell_append" = xyes; then
790731637056Smrg  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
7908ea133fd7Smrg
790931637056Smrg  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
791031637056Smrg    func_quote_for_eval "${2}"
791131637056Smrgdnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
791231637056Smrg    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
791331637056Smrg
791431637056Smrg  # Save a `func_append' function call where possible by direct use of '+='
791531637056Smrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
791631637056Smrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
791731637056Smrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
791831637056Smrg  test 0 -eq $? || _lt_function_replace_fail=:
791931637056Smrgelse
792031637056Smrg  # Save a `func_append' function call even when '+=' is not available
792131637056Smrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
792231637056Smrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
792331637056Smrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
792431637056Smrg  test 0 -eq $? || _lt_function_replace_fail=:
792531637056Smrgfi
7926ea133fd7Smrg
792731637056Smrgif test x"$_lt_function_replace_fail" = x":"; then
792831637056Smrg  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
792931637056Smrgfi
793031637056Smrg])
793106f32fbeSmrg
793231637056Smrg# _LT_PATH_CONVERSION_FUNCTIONS
793331637056Smrg# -----------------------------
793431637056Smrg# Determine which file name conversion functions should be used by
793531637056Smrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
793631637056Smrg# for certain cross-compile configurations and native mingw.
793731637056Smrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
793831637056Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
793931637056SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
794031637056SmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
794131637056SmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
794231637056Smrg[case $host in
794331637056Smrg  *-*-mingw* )
794431637056Smrg    case $build in
794531637056Smrg      *-*-mingw* ) # actually msys
794631637056Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
794706f32fbeSmrg        ;;
794831637056Smrg      *-*-cygwin* )
794931637056Smrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
795031637056Smrg        ;;
795131637056Smrg      * ) # otherwise, assume *nix
795231637056Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
795325b89263Smrg        ;;
795425b89263Smrg    esac
795531637056Smrg    ;;
795631637056Smrg  *-*-cygwin* )
795731637056Smrg    case $build in
795831637056Smrg      *-*-mingw* ) # actually msys
795931637056Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
796031637056Smrg        ;;
796131637056Smrg      *-*-cygwin* )
796231637056Smrg        lt_cv_to_host_file_cmd=func_convert_file_noop
796331637056Smrg        ;;
796431637056Smrg      * ) # otherwise, assume *nix
796531637056Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
796631637056Smrg        ;;
796731637056Smrg    esac
796831637056Smrg    ;;
796931637056Smrg  * ) # unhandled hosts (and "normal" native builds)
797031637056Smrg    lt_cv_to_host_file_cmd=func_convert_file_noop
797131637056Smrg    ;;
797231637056Smrgesac
797331637056Smrg])
797431637056Smrgto_host_file_cmd=$lt_cv_to_host_file_cmd
797531637056SmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
797631637056Smrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
797731637056Smrg         [0], [convert $build file names to $host format])dnl
7978ea133fd7Smrg
797931637056SmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
798031637056SmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
798131637056Smrg[#assume ordinary cross tools, or native build.
798231637056Smrglt_cv_to_tool_file_cmd=func_convert_file_noop
798331637056Smrgcase $host in
798431637056Smrg  *-*-mingw* )
798531637056Smrg    case $build in
798631637056Smrg      *-*-mingw* ) # actually msys
798731637056Smrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
798831637056Smrg        ;;
798931637056Smrg    esac
799031637056Smrg    ;;
799131637056Smrgesac
799231637056Smrg])
799331637056Smrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
799431637056SmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
799531637056Smrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
799631637056Smrg         [0], [convert $build files to toolchain format])dnl
799731637056Smrg])# _LT_PATH_CONVERSION_FUNCTIONS
7998ea133fd7Smrg
799931637056Smrg# Helper functions for option handling.                    -*- Autoconf -*-
800031637056Smrg#
800131637056Smrg#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
800231637056Smrg#   Inc.
800331637056Smrg#   Written by Gary V. Vaughan, 2004
800431637056Smrg#
800531637056Smrg# This file is free software; the Free Software Foundation gives
800631637056Smrg# unlimited permission to copy and/or distribute it, with or without
800731637056Smrg# modifications, as long as this notice is preserved.
8008ea133fd7Smrg
800931637056Smrg# serial 7 ltoptions.m4
8010ea133fd7Smrg
801131637056Smrg# This is to help aclocal find these macros, as it can't see m4_define.
801231637056SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
801306f32fbeSmrg
801406f32fbeSmrg
801531637056Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
801631637056Smrg# ------------------------------------------
801731637056Smrgm4_define([_LT_MANGLE_OPTION],
801831637056Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
801906f32fbeSmrg
802006f32fbeSmrg
802131637056Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
802231637056Smrg# ---------------------------------------
802331637056Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
802431637056Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
802531637056Smrg# saved as a flag.
802631637056Smrgm4_define([_LT_SET_OPTION],
802731637056Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
802831637056Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
802931637056Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
803031637056Smrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
803131637056Smrg])
803206f32fbeSmrg
803306f32fbeSmrg
803431637056Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
803531637056Smrg# ------------------------------------------------------------
803631637056Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
803731637056Smrgm4_define([_LT_IF_OPTION],
803831637056Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
803906f32fbeSmrg
804006f32fbeSmrg
804131637056Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
804231637056Smrg# -------------------------------------------------------
804331637056Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
804431637056Smrg# are set.
804531637056Smrgm4_define([_LT_UNLESS_OPTIONS],
804631637056Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
804731637056Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
804831637056Smrg		      [m4_define([$0_found])])])[]dnl
804931637056Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
805031637056Smrg])[]dnl
805131637056Smrg])
805206f32fbeSmrg
805306f32fbeSmrg
805431637056Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
805531637056Smrg# ----------------------------------------
805631637056Smrg# OPTION-LIST is a space-separated list of Libtool options associated
805731637056Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
805831637056Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
805931637056Smrg# the unknown option and exit.
806031637056Smrgm4_defun([_LT_SET_OPTIONS],
806131637056Smrg[# Set options
806231637056Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
806331637056Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
806406f32fbeSmrg
806531637056Smrgm4_if([$1],[LT_INIT],[
806631637056Smrg  dnl
806731637056Smrg  dnl Simply set some default values (i.e off) if boolean options were not
806831637056Smrg  dnl specified:
806931637056Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
807031637056Smrg  ])
807131637056Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
807231637056Smrg  ])
807331637056Smrg  dnl
807431637056Smrg  dnl If no reference was made to various pairs of opposing options, then
807531637056Smrg  dnl we run the default mode handler for the pair.  For example, if neither
807631637056Smrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
807731637056Smrg  dnl archives by default:
807831637056Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
807931637056Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
808031637056Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
808131637056Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
808231637056Smrg  		   [_LT_ENABLE_FAST_INSTALL])
808331637056Smrg  ])
808431637056Smrg])# _LT_SET_OPTIONS
808506f32fbeSmrg
808606f32fbeSmrg
808706f32fbeSmrg
808831637056Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
808931637056Smrg# -----------------------------------------
809031637056Smrgm4_define([_LT_MANGLE_DEFUN],
809131637056Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
809206f32fbeSmrg
809306f32fbeSmrg
809431637056Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
809531637056Smrg# -----------------------------------------------
809631637056Smrgm4_define([LT_OPTION_DEFINE],
809731637056Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
809831637056Smrg])# LT_OPTION_DEFINE
809906f32fbeSmrg
810031637056Smrg
810131637056Smrg# dlopen
810231637056Smrg# ------
810331637056SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
810431637056Smrg])
810531637056Smrg
810631637056SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
810731637056Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
810831637056SmrgAC_DIAGNOSE([obsolete],
810931637056Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
811031637056Smrgput the `dlopen' option into LT_INIT's first parameter.])
811131637056Smrg])
811231637056Smrg
811331637056Smrgdnl aclocal-1.4 backwards compatibility:
811431637056Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
811506f32fbeSmrg
811606f32fbeSmrg
811731637056Smrg# win32-dll
811831637056Smrg# ---------
811931637056Smrg# Declare package support for building win32 dll's.
812031637056SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
812131637056Smrg[enable_win32_dll=yes
812257ee1794Smrg
812331637056Smrgcase $host in
812431637056Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
812531637056Smrg  AC_CHECK_TOOL(AS, as, false)
812631637056Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
812731637056Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
812831637056Smrg  ;;
812931637056Smrgesac
813057ee1794Smrg
813131637056Smrgtest -z "$AS" && AS=as
813231637056Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
813357ee1794Smrg
813431637056Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
813531637056Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
813657ee1794Smrg
813731637056Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
813831637056Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
813931637056Smrg])# win32-dll
814057ee1794Smrg
814131637056SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
814231637056Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
814331637056Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
814431637056SmrgAC_DIAGNOSE([obsolete],
814531637056Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
814631637056Smrgput the `win32-dll' option into LT_INIT's first parameter.])
814731637056Smrg])
814857ee1794Smrg
814931637056Smrgdnl aclocal-1.4 backwards compatibility:
815031637056Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
815157ee1794Smrg
815257ee1794Smrg
815331637056Smrg# _LT_ENABLE_SHARED([DEFAULT])
815431637056Smrg# ----------------------------
815531637056Smrg# implement the --enable-shared flag, and supports the `shared' and
815631637056Smrg# `disable-shared' LT_INIT options.
815731637056Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
815831637056Smrgm4_define([_LT_ENABLE_SHARED],
815931637056Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
816031637056SmrgAC_ARG_ENABLE([shared],
816131637056Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
816231637056Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
816331637056Smrg    [p=${PACKAGE-default}
816431637056Smrg    case $enableval in
816531637056Smrg    yes) enable_shared=yes ;;
816631637056Smrg    no) enable_shared=no ;;
816731637056Smrg    *)
816831637056Smrg      enable_shared=no
816931637056Smrg      # Look at the argument we got.  We use all the common list separators.
817031637056Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
817131637056Smrg      for pkg in $enableval; do
817231637056Smrg	IFS="$lt_save_ifs"
817331637056Smrg	if test "X$pkg" = "X$p"; then
817431637056Smrg	  enable_shared=yes
817531637056Smrg	fi
817631637056Smrg      done
817731637056Smrg      IFS="$lt_save_ifs"
817831637056Smrg      ;;
817931637056Smrg    esac],
818031637056Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
818157ee1794Smrg
818231637056Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
818331637056Smrg	[Whether or not to build shared libraries])
818431637056Smrg])# _LT_ENABLE_SHARED
818557ee1794Smrg
818631637056SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
818731637056SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
818857ee1794Smrg
818931637056Smrg# Old names:
819031637056SmrgAC_DEFUN([AC_ENABLE_SHARED],
819131637056Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
819231637056Smrg])
819357ee1794Smrg
819431637056SmrgAC_DEFUN([AC_DISABLE_SHARED],
819531637056Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
819631637056Smrg])
819757ee1794Smrg
819831637056SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
819931637056SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
820057ee1794Smrg
820131637056Smrgdnl aclocal-1.4 backwards compatibility:
820231637056Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
820331637056Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
820457ee1794Smrg
820506f32fbeSmrg
820606f32fbeSmrg
820731637056Smrg# _LT_ENABLE_STATIC([DEFAULT])
820831637056Smrg# ----------------------------
820931637056Smrg# implement the --enable-static flag, and support the `static' and
821031637056Smrg# `disable-static' LT_INIT options.
821131637056Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
821231637056Smrgm4_define([_LT_ENABLE_STATIC],
821331637056Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
821431637056SmrgAC_ARG_ENABLE([static],
821531637056Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
821631637056Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
821731637056Smrg    [p=${PACKAGE-default}
821831637056Smrg    case $enableval in
821931637056Smrg    yes) enable_static=yes ;;
822031637056Smrg    no) enable_static=no ;;
822131637056Smrg    *)
822231637056Smrg     enable_static=no
822331637056Smrg      # Look at the argument we got.  We use all the common list separators.
822431637056Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
822531637056Smrg      for pkg in $enableval; do
822631637056Smrg	IFS="$lt_save_ifs"
822731637056Smrg	if test "X$pkg" = "X$p"; then
822831637056Smrg	  enable_static=yes
822931637056Smrg	fi
823031637056Smrg      done
823131637056Smrg      IFS="$lt_save_ifs"
823231637056Smrg      ;;
823331637056Smrg    esac],
823431637056Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
823506f32fbeSmrg
823631637056Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
823731637056Smrg	[Whether or not to build static libraries])
823831637056Smrg])# _LT_ENABLE_STATIC
823906f32fbeSmrg
824031637056SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
824131637056SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
824206f32fbeSmrg
824331637056Smrg# Old names:
824431637056SmrgAC_DEFUN([AC_ENABLE_STATIC],
824531637056Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
824631637056Smrg])
824706f32fbeSmrg
824831637056SmrgAC_DEFUN([AC_DISABLE_STATIC],
824931637056Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
825031637056Smrg])
825106f32fbeSmrg
825231637056SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
825331637056SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
825406f32fbeSmrg
825531637056Smrgdnl aclocal-1.4 backwards compatibility:
825631637056Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
825731637056Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
825806f32fbeSmrg
825906f32fbeSmrg
826006f32fbeSmrg
826131637056Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
826231637056Smrg# ----------------------------------
826331637056Smrg# implement the --enable-fast-install flag, and support the `fast-install'
826431637056Smrg# and `disable-fast-install' LT_INIT options.
826531637056Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
826631637056Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
826731637056Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
826831637056SmrgAC_ARG_ENABLE([fast-install],
826931637056Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
827031637056Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
827131637056Smrg    [p=${PACKAGE-default}
827231637056Smrg    case $enableval in
827331637056Smrg    yes) enable_fast_install=yes ;;
827431637056Smrg    no) enable_fast_install=no ;;
827531637056Smrg    *)
827631637056Smrg      enable_fast_install=no
827731637056Smrg      # Look at the argument we got.  We use all the common list separators.
827831637056Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
827931637056Smrg      for pkg in $enableval; do
828031637056Smrg	IFS="$lt_save_ifs"
828131637056Smrg	if test "X$pkg" = "X$p"; then
828231637056Smrg	  enable_fast_install=yes
828331637056Smrg	fi
828431637056Smrg      done
828531637056Smrg      IFS="$lt_save_ifs"
828631637056Smrg      ;;
828731637056Smrg    esac],
828831637056Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
828906f32fbeSmrg
829031637056Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
829131637056Smrg	 [Whether or not to optimize for fast installation])dnl
829231637056Smrg])# _LT_ENABLE_FAST_INSTALL
829306f32fbeSmrg
829431637056SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
829531637056SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
829606f32fbeSmrg
829731637056Smrg# Old names:
829831637056SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
829931637056Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
830031637056SmrgAC_DIAGNOSE([obsolete],
830131637056Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
830231637056Smrgthe `fast-install' option into LT_INIT's first parameter.])
830357ee1794Smrg])
830457ee1794Smrg
830531637056SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
830631637056Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
830731637056SmrgAC_DIAGNOSE([obsolete],
830831637056Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
830931637056Smrgthe `disable-fast-install' option into LT_INIT's first parameter.])
831006f32fbeSmrg])
831106f32fbeSmrg
831206f32fbeSmrgdnl aclocal-1.4 backwards compatibility:
831331637056Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
831431637056Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
831506f32fbeSmrg
8316ea133fd7Smrg
831731637056Smrg# _LT_WITH_PIC([MODE])
831831637056Smrg# --------------------
831931637056Smrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
832031637056Smrg# LT_INIT options.
832131637056Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
832231637056Smrgm4_define([_LT_WITH_PIC],
832331637056Smrg[AC_ARG_WITH([pic],
832431637056Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
832531637056Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
832631637056Smrg    [lt_p=${PACKAGE-default}
832731637056Smrg    case $withval in
832831637056Smrg    yes|no) pic_mode=$withval ;;
832931637056Smrg    *)
833031637056Smrg      pic_mode=default
833131637056Smrg      # Look at the argument we got.  We use all the common list separators.
833231637056Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
833331637056Smrg      for lt_pkg in $withval; do
833431637056Smrg	IFS="$lt_save_ifs"
833531637056Smrg	if test "X$lt_pkg" = "X$lt_p"; then
833631637056Smrg	  pic_mode=yes
833731637056Smrg	fi
833831637056Smrg      done
833931637056Smrg      IFS="$lt_save_ifs"
834031637056Smrg      ;;
834131637056Smrg    esac],
834231637056Smrg    [pic_mode=default])
8343ea133fd7Smrg
834431637056Smrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
8345ea133fd7Smrg
834631637056Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
834731637056Smrg])# _LT_WITH_PIC
8348ea133fd7Smrg
834931637056SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
835031637056SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
8351ea133fd7Smrg
835231637056Smrg# Old name:
835331637056SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
835431637056Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
835531637056SmrgAC_DIAGNOSE([obsolete],
835631637056Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
835731637056Smrgput the `pic-only' option into LT_INIT's first parameter.])
835825b89263Smrg])
8359ea133fd7Smrg
836006f32fbeSmrgdnl aclocal-1.4 backwards compatibility:
836131637056Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
8362ea133fd7Smrg
836306f32fbeSmrg
836431637056Smrgm4_define([_LTDL_MODE], [])
836531637056SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
836631637056Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
836731637056SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
836831637056Smrg		 [m4_define([_LTDL_MODE], [recursive])])
836931637056SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
837031637056Smrg		 [m4_define([_LTDL_MODE], [subproject])])
837106f32fbeSmrg
837231637056Smrgm4_define([_LTDL_TYPE], [])
837331637056SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
837431637056Smrg		 [m4_define([_LTDL_TYPE], [installable])])
837531637056SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
837631637056Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
8377ea133fd7Smrg
837831637056Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
837931637056Smrg#
838031637056Smrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
838131637056Smrg# Written by Gary V. Vaughan, 2004
838231637056Smrg#
838331637056Smrg# This file is free software; the Free Software Foundation gives
838431637056Smrg# unlimited permission to copy and/or distribute it, with or without
838531637056Smrg# modifications, as long as this notice is preserved.
8386ea133fd7Smrg
838731637056Smrg# serial 6 ltsugar.m4
838806f32fbeSmrg
838931637056Smrg# This is to help aclocal find these macros, as it can't see m4_define.
839031637056SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
839106f32fbeSmrg
8392ea133fd7Smrg
839331637056Smrg# lt_join(SEP, ARG1, [ARG2...])
839431637056Smrg# -----------------------------
839531637056Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
839631637056Smrg# associated separator.
839731637056Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
839831637056Smrg# versions in m4sugar had bugs.
839931637056Smrgm4_define([lt_join],
840031637056Smrg[m4_if([$#], [1], [],
840131637056Smrg       [$#], [2], [[$2]],
840231637056Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
840331637056Smrgm4_define([_lt_join],
840431637056Smrg[m4_if([$#$2], [2], [],
840531637056Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
840606f32fbeSmrg
840706f32fbeSmrg
840831637056Smrg# lt_car(LIST)
840931637056Smrg# lt_cdr(LIST)
841031637056Smrg# ------------
841131637056Smrg# Manipulate m4 lists.
841231637056Smrg# These macros are necessary as long as will still need to support
841331637056Smrg# Autoconf-2.59 which quotes differently.
841431637056Smrgm4_define([lt_car], [[$1]])
841531637056Smrgm4_define([lt_cdr],
841631637056Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
841731637056Smrg       [$#], 1, [],
841831637056Smrg       [m4_dquote(m4_shift($@))])])
841931637056Smrgm4_define([lt_unquote], $1)
842006f32fbeSmrg
842106f32fbeSmrg
842231637056Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
842331637056Smrg# ------------------------------------------
842431637056Smrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
842531637056Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
842631637056Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
842731637056Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
842831637056Smrg# than defined and empty).
842931637056Smrg#
843031637056Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
843131637056Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
843231637056Smrgm4_define([lt_append],
843331637056Smrg[m4_define([$1],
843431637056Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
843506f32fbeSmrg
843606f32fbeSmrg
8437ea133fd7Smrg
843831637056Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
843931637056Smrg# ----------------------------------------------------------
844031637056Smrg# Produce a SEP delimited list of all paired combinations of elements of
844131637056Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
844231637056Smrg# has the form PREFIXmINFIXSUFFIXn.
844331637056Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
844431637056Smrgm4_define([lt_combine],
844531637056Smrg[m4_if(m4_eval([$# > 3]), [1],
844631637056Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
844731637056Smrg[[m4_foreach([_Lt_prefix], [$2],
844831637056Smrg	     [m4_foreach([_Lt_suffix],
844931637056Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
845031637056Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
8451ea133fd7Smrg
8452ea133fd7Smrg
845331637056Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
845431637056Smrg# -----------------------------------------------------------------------
845531637056Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
845631637056Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
845731637056Smrgm4_define([lt_if_append_uniq],
845831637056Smrg[m4_ifdef([$1],
845931637056Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
846031637056Smrg		 [lt_append([$1], [$2], [$3])$4],
846131637056Smrg		 [$5])],
846231637056Smrg	  [lt_append([$1], [$2], [$3])$4])])
8463ea133fd7Smrg
8464ea133fd7Smrg
846531637056Smrg# lt_dict_add(DICT, KEY, VALUE)
846606f32fbeSmrg# -----------------------------
846731637056Smrgm4_define([lt_dict_add],
846831637056Smrg[m4_define([$1($2)], [$3])])
846906f32fbeSmrg
8470ea133fd7Smrg
847131637056Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
847231637056Smrg# --------------------------------------------
847331637056Smrgm4_define([lt_dict_add_subkey],
847431637056Smrg[m4_define([$1($2:$3)], [$4])])
8475ea133fd7Smrg
8476ea133fd7Smrg
847731637056Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
847831637056Smrg# ----------------------------------
847931637056Smrgm4_define([lt_dict_fetch],
848031637056Smrg[m4_ifval([$3],
848131637056Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
848231637056Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
8483ea133fd7Smrg
8484ea133fd7Smrg
848531637056Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
848631637056Smrg# -----------------------------------------------------------------
848731637056Smrgm4_define([lt_if_dict_fetch],
848831637056Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
848931637056Smrg	[$5],
849031637056Smrg    [$6])])
8491ea133fd7Smrg
8492ea133fd7Smrg
849331637056Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
849431637056Smrg# --------------------------------------------------------------
849531637056Smrgm4_define([lt_dict_filter],
849631637056Smrg[m4_if([$5], [], [],
849731637056Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
849831637056Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
849931637056Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
850006f32fbeSmrg])
8501ea133fd7Smrg
850231637056Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
850331637056Smrg#
850431637056Smrg#   Copyright (C) 2004 Free Software Foundation, Inc.
850531637056Smrg#   Written by Scott James Remnant, 2004
850631637056Smrg#
850731637056Smrg# This file is free software; the Free Software Foundation gives
850831637056Smrg# unlimited permission to copy and/or distribute it, with or without
850931637056Smrg# modifications, as long as this notice is preserved.
851025b89263Smrg
851131637056Smrg# @configure_input@
851225b89263Smrg
851331637056Smrg# serial 3337 ltversion.m4
851431637056Smrg# This file is part of GNU Libtool
851525b89263Smrg
851631637056Smrgm4_define([LT_PACKAGE_VERSION], [2.4.2])
851731637056Smrgm4_define([LT_PACKAGE_REVISION], [1.3337])
851806f32fbeSmrg
851931637056SmrgAC_DEFUN([LTVERSION_VERSION],
852031637056Smrg[macro_version='2.4.2'
852131637056Smrgmacro_revision='1.3337'
852231637056Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
852331637056Smrg_LT_DECL(, macro_revision, 0)
852431637056Smrg])
852506f32fbeSmrg
852631637056Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
852731637056Smrg#
852831637056Smrg#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
852931637056Smrg#   Written by Scott James Remnant, 2004.
853031637056Smrg#
853131637056Smrg# This file is free software; the Free Software Foundation gives
853231637056Smrg# unlimited permission to copy and/or distribute it, with or without
853331637056Smrg# modifications, as long as this notice is preserved.
853406f32fbeSmrg
853531637056Smrg# serial 5 lt~obsolete.m4
853606f32fbeSmrg
853731637056Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
853831637056Smrg#
853931637056Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
854031637056Smrg# which have later been changed to m4_define as they aren't part of the
854131637056Smrg# exported API, or moved to Autoconf or Automake where they belong.
854231637056Smrg#
854331637056Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
854431637056Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
854531637056Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
854631637056Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
854731637056Smrg# and doesn't know about Autoconf macros at all.)
854831637056Smrg#
854931637056Smrg# So we provide this file, which has a silly filename so it's always
855031637056Smrg# included after everything else.  This provides aclocal with the
855131637056Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
855231637056Smrg# because those macros already exist, or will be overwritten later.
855331637056Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
855431637056Smrg#
855531637056Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
855631637056Smrg# Yes, that means every name once taken will need to remain here until
855731637056Smrg# we give up compatibility with versions before 1.7, at which point
855831637056Smrg# we need to keep only those names which we still refer to.
855925b89263Smrg
856031637056Smrg# This is to help aclocal find these macros, as it can't see m4_define.
856131637056SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
8562ea133fd7Smrg
856331637056Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
856431637056Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
856531637056Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
856631637056Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
856731637056Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
856831637056Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
856931637056Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
857031637056Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
857131637056Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
857231637056Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
857331637056Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
857431637056Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
857531637056Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
857631637056Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
857731637056Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
857831637056Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
857931637056Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
858031637056Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
858131637056Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
858231637056Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
858331637056Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
858431637056Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
858531637056Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
858631637056Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
858731637056Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
858831637056Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
858931637056Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
859031637056Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
859131637056Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
859231637056Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
859331637056Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
859431637056Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
859531637056Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
859631637056Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
859731637056Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
859831637056Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
859931637056Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
860031637056Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
860131637056Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
860231637056Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
860331637056Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
860431637056Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
860531637056Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
860631637056Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
860731637056Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
860831637056Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
860931637056Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
861031637056Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
861131637056Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
861231637056Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
861331637056Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
861431637056Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
861531637056Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
861631637056Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
861731637056Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
861831637056Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
861931637056Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
862031637056Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
862131637056Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
862231637056Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
862331637056Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
8624ea133fd7Smrg
862531637056Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
862631637056Smrg# serial 1 (pkg-config-0.24)
862731637056Smrg# 
862831637056Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
862931637056Smrg#
863031637056Smrg# This program is free software; you can redistribute it and/or modify
863131637056Smrg# it under the terms of the GNU General Public License as published by
863231637056Smrg# the Free Software Foundation; either version 2 of the License, or
863331637056Smrg# (at your option) any later version.
863431637056Smrg#
863531637056Smrg# This program is distributed in the hope that it will be useful, but
863631637056Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
863731637056Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
863831637056Smrg# General Public License for more details.
863931637056Smrg#
864031637056Smrg# You should have received a copy of the GNU General Public License
864131637056Smrg# along with this program; if not, write to the Free Software
864231637056Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
864331637056Smrg#
864431637056Smrg# As a special exception to the GNU General Public License, if you
864531637056Smrg# distribute this file as part of a program that contains a
864631637056Smrg# configuration script generated by Autoconf, you may include it under
864731637056Smrg# the same distribution terms that you use for the rest of that program.
8648ea133fd7Smrg
864931637056Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
865031637056Smrg# ----------------------------------
865131637056SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
865231637056Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
865331637056Smrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
865431637056Smrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
865531637056SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
865631637056SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
865731637056SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
8658ea133fd7Smrg
865931637056Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
866031637056Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
866131637056Smrgfi
866231637056Smrgif test -n "$PKG_CONFIG"; then
866331637056Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
866431637056Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
866531637056Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
866631637056Smrg		AC_MSG_RESULT([yes])
866731637056Smrg	else
866831637056Smrg		AC_MSG_RESULT([no])
866931637056Smrg		PKG_CONFIG=""
867031637056Smrg	fi
867131637056Smrgfi[]dnl
867231637056Smrg])# PKG_PROG_PKG_CONFIG
8673ea133fd7Smrg
867431637056Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
867531637056Smrg#
867631637056Smrg# Check to see whether a particular set of modules exists.  Similar
867731637056Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
867831637056Smrg#
867931637056Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
868031637056Smrg# only at the first occurence in configure.ac, so if the first place
868131637056Smrg# it's called might be skipped (such as if it is within an "if", you
868231637056Smrg# have to call PKG_CHECK_EXISTS manually
868331637056Smrg# --------------------------------------------------------------
868431637056SmrgAC_DEFUN([PKG_CHECK_EXISTS],
868531637056Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
868631637056Smrgif test -n "$PKG_CONFIG" && \
868731637056Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
868831637056Smrg  m4_default([$2], [:])
868931637056Smrgm4_ifvaln([$3], [else
869031637056Smrg  $3])dnl
869131637056Smrgfi])
8692ea133fd7Smrg
869331637056Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
869431637056Smrg# ---------------------------------------------
869531637056Smrgm4_define([_PKG_CONFIG],
869631637056Smrg[if test -n "$$1"; then
869731637056Smrg    pkg_cv_[]$1="$$1"
869831637056Smrg elif test -n "$PKG_CONFIG"; then
869931637056Smrg    PKG_CHECK_EXISTS([$3],
870031637056Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
870131637056Smrg		      test "x$?" != "x0" && pkg_failed=yes ],
870231637056Smrg		     [pkg_failed=yes])
870331637056Smrg else
870431637056Smrg    pkg_failed=untried
870531637056Smrgfi[]dnl
870631637056Smrg])# _PKG_CONFIG
8707ea133fd7Smrg
870831637056Smrg# _PKG_SHORT_ERRORS_SUPPORTED
870931637056Smrg# -----------------------------
871031637056SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
871131637056Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
871231637056Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
871331637056Smrg        _pkg_short_errors_supported=yes
871431637056Smrgelse
871531637056Smrg        _pkg_short_errors_supported=no
871631637056Smrgfi[]dnl
871731637056Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
8718ea133fd7Smrg
8719ea133fd7Smrg
872031637056Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
872131637056Smrg# [ACTION-IF-NOT-FOUND])
872231637056Smrg#
872331637056Smrg#
872431637056Smrg# Note that if there is a possibility the first call to
872531637056Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
872631637056Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
872731637056Smrg#
872831637056Smrg#
872931637056Smrg# --------------------------------------------------------------
873031637056SmrgAC_DEFUN([PKG_CHECK_MODULES],
873131637056Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
873231637056SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
873331637056SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
8734ea133fd7Smrg
873531637056Smrgpkg_failed=no
873631637056SmrgAC_MSG_CHECKING([for $1])
8737ea133fd7Smrg
873831637056Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
873931637056Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
8740ea133fd7Smrg
874131637056Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
874231637056Smrgand $1[]_LIBS to avoid the need to call pkg-config.
874331637056SmrgSee the pkg-config man page for more details.])
8744ea133fd7Smrg
874531637056Smrgif test $pkg_failed = yes; then
874631637056Smrg   	AC_MSG_RESULT([no])
874731637056Smrg        _PKG_SHORT_ERRORS_SUPPORTED
874831637056Smrg        if test $_pkg_short_errors_supported = yes; then
874931637056Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
875031637056Smrg        else 
875131637056Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
875231637056Smrg        fi
875331637056Smrg	# Put the nasty error message in config.log where it belongs
875431637056Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
8755ea133fd7Smrg
875631637056Smrg	m4_default([$4], [AC_MSG_ERROR(
875731637056Smrg[Package requirements ($2) were not met:
8758ea133fd7Smrg
875931637056Smrg$$1_PKG_ERRORS
876025b89263Smrg
876131637056SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
876231637056Smrginstalled software in a non-standard prefix.
8763ea133fd7Smrg
876431637056Smrg_PKG_TEXT])[]dnl
876531637056Smrg        ])
876631637056Smrgelif test $pkg_failed = untried; then
876731637056Smrg     	AC_MSG_RESULT([no])
876831637056Smrg	m4_default([$4], [AC_MSG_FAILURE(
876931637056Smrg[The pkg-config script could not be found or is too old.  Make sure it
877031637056Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
877131637056Smrgpath to pkg-config.
8772ea133fd7Smrg
877331637056Smrg_PKG_TEXT
8774ea133fd7Smrg
877531637056SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
877631637056Smrg        ])
877731637056Smrgelse
877831637056Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
877931637056Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
878031637056Smrg        AC_MSG_RESULT([yes])
878131637056Smrg	$3
878231637056Smrgfi[]dnl
878331637056Smrg])# PKG_CHECK_MODULES
8784ea133fd7Smrg
878531637056Smrg# Copyright (C) 2002-2013 Free Software Foundation, Inc.
878631637056Smrg#
878731637056Smrg# This file is free software; the Free Software Foundation
878831637056Smrg# gives unlimited permission to copy and/or distribute it,
878931637056Smrg# with or without modifications, as long as this notice is preserved.
8790ea133fd7Smrg
879131637056Smrg# AM_AUTOMAKE_VERSION(VERSION)
879231637056Smrg# ----------------------------
879331637056Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
879431637056Smrg# generated from the m4 files accompanying Automake X.Y.
879531637056Smrg# (This private macro should not be called outside this file.)
879631637056SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
879731637056Smrg[am__api_version='1.14'
879831637056Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
879931637056Smrgdnl require some minimum version.  Point them to the right macro.
880031637056Smrgm4_if([$1], [1.14.1], [],
880131637056Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
880206f32fbeSmrg])
8803ea133fd7Smrg
880431637056Smrg# _AM_AUTOCONF_VERSION(VERSION)
880531637056Smrg# -----------------------------
880631637056Smrg# aclocal traces this macro to find the Autoconf version.
880731637056Smrg# This is a private macro too.  Using m4_define simplifies
880831637056Smrg# the logic in aclocal, which can simply ignore this definition.
880931637056Smrgm4_define([_AM_AUTOCONF_VERSION], [])
8810ea133fd7Smrg
881131637056Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
881231637056Smrg# -------------------------------
881331637056Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
881431637056Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
881531637056SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
881631637056Smrg[AM_AUTOMAKE_VERSION([1.14.1])dnl
881731637056Smrgm4_ifndef([AC_AUTOCONF_VERSION],
881831637056Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
881931637056Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
8820ea133fd7Smrg
882131637056Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
882206f32fbeSmrg
882331637056Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
882431637056Smrg#
882531637056Smrg# This file is free software; the Free Software Foundation
882631637056Smrg# gives unlimited permission to copy and/or distribute it,
882731637056Smrg# with or without modifications, as long as this notice is preserved.
882806f32fbeSmrg
882931637056Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
883031637056Smrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
883131637056Smrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
883231637056Smrg#
883331637056Smrg# Of course, Automake must honor this variable whenever it calls a
883431637056Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
883531637056Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
883631637056Smrg# depending on how configure is run.  This is pretty annoying, since
883731637056Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
883831637056Smrg# source directory, any form will work fine, but in subdirectories a
883931637056Smrg# relative path needs to be adjusted first.
884031637056Smrg#
884131637056Smrg# $ac_aux_dir/missing
884231637056Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
884331637056Smrg# $top_srcdir/$ac_aux_dir/missing
884431637056Smrg#    fails if $ac_aux_dir is absolute,
884531637056Smrg#    fails when called from a subdirectory in a VPATH build with
884631637056Smrg#          a relative $ac_aux_dir
884731637056Smrg#
884831637056Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
884931637056Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
885031637056Smrg# harmless because $srcdir is '.', but things will broke when you
885131637056Smrg# start a VPATH build or use an absolute $srcdir.
885231637056Smrg#
885331637056Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
885431637056Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
885531637056Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
885631637056Smrg# and then we would define $MISSING as
885731637056Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
885831637056Smrg# This will work as long as MISSING is not called from configure, because
885931637056Smrg# unfortunately $(top_srcdir) has no meaning in configure.
886031637056Smrg# However there are other variables, like CC, which are often used in
886131637056Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
886231637056Smrg#
886331637056Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
886431637056Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
886531637056Smrg# configured tree to be moved without reconfiguration.
8866ea133fd7Smrg
886731637056SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
886831637056Smrg[dnl Rely on autoconf to set up CDPATH properly.
886931637056SmrgAC_PREREQ([2.50])dnl
887031637056Smrg# expand $ac_aux_dir to an absolute path
887131637056Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
887206f32fbeSmrg])
8873ea133fd7Smrg
887431637056Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
8875ea133fd7Smrg
887631637056Smrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
887731637056Smrg#
887831637056Smrg# This file is free software; the Free Software Foundation
887931637056Smrg# gives unlimited permission to copy and/or distribute it,
888031637056Smrg# with or without modifications, as long as this notice is preserved.
8881a253d6aeSmrg
888231637056Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
888331637056Smrg# -------------------------------------
888431637056Smrg# Define a conditional.
888531637056SmrgAC_DEFUN([AM_CONDITIONAL],
888631637056Smrg[AC_PREREQ([2.52])dnl
888731637056Smrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
888831637056Smrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
888931637056SmrgAC_SUBST([$1_TRUE])dnl
889031637056SmrgAC_SUBST([$1_FALSE])dnl
889131637056Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
889231637056Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
889331637056Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
889431637056Smrgif $2; then
889531637056Smrg  $1_TRUE=
889631637056Smrg  $1_FALSE='#'
889731637056Smrgelse
889831637056Smrg  $1_TRUE='#'
889931637056Smrg  $1_FALSE=
890031637056Smrgfi
890131637056SmrgAC_CONFIG_COMMANDS_PRE(
890231637056Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
890331637056Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
890431637056SmrgUsually this means the macro was only invoked conditionally.]])
890531637056Smrgfi])])
8906a253d6aeSmrg
890731637056Smrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
890831637056Smrg#
890931637056Smrg# This file is free software; the Free Software Foundation
891031637056Smrg# gives unlimited permission to copy and/or distribute it,
891131637056Smrg# with or without modifications, as long as this notice is preserved.
8912a253d6aeSmrg
8913a253d6aeSmrg
891431637056Smrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
891531637056Smrg# written in clear, in which case automake, when reading aclocal.m4,
891631637056Smrg# will think it sees a *use*, and therefore will trigger all it's
891731637056Smrg# C support machinery.  Also note that it means that autoscan, seeing
891831637056Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
8919a253d6aeSmrg
8920a253d6aeSmrg
892131637056Smrg# _AM_DEPENDENCIES(NAME)
892231637056Smrg# ----------------------
892331637056Smrg# See how the compiler implements dependency checking.
892431637056Smrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
892531637056Smrg# We try a few techniques and use that to set a single cache variable.
892631637056Smrg#
892731637056Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
892831637056Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
892931637056Smrg# dependency, and given that the user is not expected to run this macro,
893031637056Smrg# just rely on AC_PROG_CC.
893131637056SmrgAC_DEFUN([_AM_DEPENDENCIES],
893231637056Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
893331637056SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
893431637056SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
893531637056SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
8936a253d6aeSmrg
893731637056Smrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
893831637056Smrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
893931637056Smrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
894031637056Smrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
894131637056Smrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
894231637056Smrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
894331637056Smrg                    [depcc="$$1"   am_compiler_list=])
8944a253d6aeSmrg
894531637056SmrgAC_CACHE_CHECK([dependency style of $depcc],
894631637056Smrg               [am_cv_$1_dependencies_compiler_type],
894731637056Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
894831637056Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
894931637056Smrg  # making bogus files that we don't know about and never remove.  For
895031637056Smrg  # instance it was reported that on HP-UX the gcc test will end up
895131637056Smrg  # making a dummy file named 'D' -- because '-MD' means "put the output
895231637056Smrg  # in D".
895331637056Smrg  rm -rf conftest.dir
895431637056Smrg  mkdir conftest.dir
895531637056Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
895631637056Smrg  # using a relative directory.
895731637056Smrg  cp "$am_depcomp" conftest.dir
895831637056Smrg  cd conftest.dir
895931637056Smrg  # We will build objects and dependencies in a subdirectory because
896031637056Smrg  # it helps to detect inapplicable dependency modes.  For instance
896131637056Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
896231637056Smrg  # side effect of compilation, but ICC will put the dependencies in
896331637056Smrg  # the current directory while Tru64 will put them in the object
896431637056Smrg  # directory.
896531637056Smrg  mkdir sub
8966a253d6aeSmrg
896731637056Smrg  am_cv_$1_dependencies_compiler_type=none
896831637056Smrg  if test "$am_compiler_list" = ""; then
896931637056Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
897031637056Smrg  fi
897131637056Smrg  am__universal=false
897231637056Smrg  m4_case([$1], [CC],
897331637056Smrg    [case " $depcc " in #(
897431637056Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
897531637056Smrg     esac],
897631637056Smrg    [CXX],
897731637056Smrg    [case " $depcc " in #(
897831637056Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
897931637056Smrg     esac])
8980a253d6aeSmrg
898131637056Smrg  for depmode in $am_compiler_list; do
898231637056Smrg    # Setup a source with many dependencies, because some compilers
898331637056Smrg    # like to wrap large dependency lists on column 80 (with \), and
898431637056Smrg    # we should not choose a depcomp mode which is confused by this.
898531637056Smrg    #
898631637056Smrg    # We need to recreate these files for each test, as the compiler may
898731637056Smrg    # overwrite some of them when testing with obscure command lines.
898831637056Smrg    # This happens at least with the AIX C compiler.
898931637056Smrg    : > sub/conftest.c
899031637056Smrg    for i in 1 2 3 4 5 6; do
899131637056Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
899231637056Smrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
899331637056Smrg      # Solaris 10 /bin/sh.
899431637056Smrg      echo '/* dummy */' > sub/conftst$i.h
899531637056Smrg    done
899631637056Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
8997a253d6aeSmrg
899831637056Smrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
899931637056Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
900031637056Smrg    # handle '-M -o', and we need to detect this.  Also, some Intel
900131637056Smrg    # versions had trouble with output in subdirs.
900231637056Smrg    am__obj=sub/conftest.${OBJEXT-o}
900331637056Smrg    am__minus_obj="-o $am__obj"
900431637056Smrg    case $depmode in
900531637056Smrg    gcc)
900631637056Smrg      # This depmode causes a compiler race in universal mode.
900731637056Smrg      test "$am__universal" = false || continue
900857ee1794Smrg      ;;
900931637056Smrg    nosideeffect)
901031637056Smrg      # After this tag, mechanisms are not by side-effect, so they'll
901131637056Smrg      # only be used when explicitly requested.
901231637056Smrg      if test "x$enable_dependency_tracking" = xyes; then
901331637056Smrg	continue
901431637056Smrg      else
901531637056Smrg	break
901631637056Smrg      fi
901731637056Smrg      ;;
901831637056Smrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
901931637056Smrg      # This compiler won't grok '-c -o', but also, the minuso test has
902031637056Smrg      # not run yet.  These depmodes are late enough in the game, and
902131637056Smrg      # so weak that their functioning should not be impacted.
902231637056Smrg      am__obj=conftest.${OBJEXT-o}
902331637056Smrg      am__minus_obj=
902431637056Smrg      ;;
902531637056Smrg    none) break ;;
902631637056Smrg    esac
902731637056Smrg    if depmode=$depmode \
902831637056Smrg       source=sub/conftest.c object=$am__obj \
902931637056Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
903031637056Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
903131637056Smrg         >/dev/null 2>conftest.err &&
903231637056Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
903331637056Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
903431637056Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
903531637056Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
903631637056Smrg      # icc doesn't choke on unknown options, it will just issue warnings
903731637056Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
903831637056Smrg      # that says an option was ignored or not supported.
903931637056Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
904031637056Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
904131637056Smrg      # The diagnosis changed in icc 8.0:
904231637056Smrg      #   icc: Command line remark: option '-MP' not supported
904331637056Smrg      if (grep 'ignoring option' conftest.err ||
904431637056Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
904531637056Smrg        am_cv_$1_dependencies_compiler_type=$depmode
904631637056Smrg        break
904731637056Smrg      fi
904831637056Smrg    fi
904931637056Smrg  done
9050a253d6aeSmrg
905131637056Smrg  cd ..
905231637056Smrg  rm -rf conftest.dir
905331637056Smrgelse
905431637056Smrg  am_cv_$1_dependencies_compiler_type=none
905531637056Smrgfi
905631637056Smrg])
905731637056SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
905831637056SmrgAM_CONDITIONAL([am__fastdep$1], [
905931637056Smrg  test "x$enable_dependency_tracking" != xno \
906031637056Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
906131637056Smrg])
9062ea133fd7Smrg
9063ea133fd7Smrg
906431637056Smrg# AM_SET_DEPDIR
906531637056Smrg# -------------
906631637056Smrg# Choose a directory name for dependency files.
906731637056Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
906831637056SmrgAC_DEFUN([AM_SET_DEPDIR],
906931637056Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
907031637056SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
907106f32fbeSmrg])
9072ea133fd7Smrg
9073ea133fd7Smrg
907431637056Smrg# AM_DEP_TRACK
907531637056Smrg# ------------
907631637056SmrgAC_DEFUN([AM_DEP_TRACK],
907731637056Smrg[AC_ARG_ENABLE([dependency-tracking], [dnl
907831637056SmrgAS_HELP_STRING(
907931637056Smrg  [--enable-dependency-tracking],
908031637056Smrg  [do not reject slow dependency extractors])
908131637056SmrgAS_HELP_STRING(
908231637056Smrg  [--disable-dependency-tracking],
908331637056Smrg  [speeds up one-time build])])
908431637056Smrgif test "x$enable_dependency_tracking" != xno; then
908531637056Smrg  am_depcomp="$ac_aux_dir/depcomp"
908631637056Smrg  AMDEPBACKSLASH='\'
908731637056Smrg  am__nodep='_no'
908831637056Smrgfi
908931637056SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
909031637056SmrgAC_SUBST([AMDEPBACKSLASH])dnl
909131637056Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
909231637056SmrgAC_SUBST([am__nodep])dnl
909331637056Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl
909431637056Smrg])
9095ea133fd7Smrg
909631637056Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
9097ea133fd7Smrg
909831637056Smrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
909906f32fbeSmrg#
910031637056Smrg# This file is free software; the Free Software Foundation
910131637056Smrg# gives unlimited permission to copy and/or distribute it,
910231637056Smrg# with or without modifications, as long as this notice is preserved.
9103ea133fd7Smrg
910425b89263Smrg
910531637056Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
910631637056Smrg# ------------------------------
910731637056SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
910831637056Smrg[{
910931637056Smrg  # Older Autoconf quotes --file arguments for eval, but not when files
911031637056Smrg  # are listed without --file.  Let's play safe and only enable the eval
911131637056Smrg  # if we detect the quoting.
911231637056Smrg  case $CONFIG_FILES in
911331637056Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
911431637056Smrg  *)   set x $CONFIG_FILES ;;
911531637056Smrg  esac
911631637056Smrg  shift
911731637056Smrg  for mf
911831637056Smrg  do
911931637056Smrg    # Strip MF so we end up with the name of the file.
912031637056Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
912131637056Smrg    # Check whether this is an Automake generated Makefile or not.
912231637056Smrg    # We used to match only the files named 'Makefile.in', but
912331637056Smrg    # some people rename them; so instead we look at the file content.
912431637056Smrg    # Grep'ing the first line is not enough: some people post-process
912531637056Smrg    # each Makefile.in and add a new line on top of each file to say so.
912631637056Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
912731637056Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
912831637056Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
912931637056Smrg      dirpart=`AS_DIRNAME("$mf")`
913031637056Smrg    else
913131637056Smrg      continue
913231637056Smrg    fi
913331637056Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
913431637056Smrg    # from the Makefile without running 'make'.
913531637056Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
913631637056Smrg    test -z "$DEPDIR" && continue
913731637056Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
913831637056Smrg    test -z "$am__include" && continue
913931637056Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
914031637056Smrg    # Find all dependency output files, they are included files with
914131637056Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
914231637056Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
914331637056Smrg    # expansion.
914431637056Smrg    for file in `sed -n "
914531637056Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
914631637056Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
914731637056Smrg      # Make sure the directory exists.
914831637056Smrg      test -f "$dirpart/$file" && continue
914931637056Smrg      fdir=`AS_DIRNAME(["$file"])`
915031637056Smrg      AS_MKDIR_P([$dirpart/$fdir])
915131637056Smrg      # echo "creating $dirpart/$file"
915231637056Smrg      echo '# dummy' > "$dirpart/$file"
915331637056Smrg    done
915431637056Smrg  done
915531637056Smrg}
915631637056Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
915725b89263Smrg
915825b89263Smrg
915931637056Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
916006f32fbeSmrg# -----------------------------
916131637056Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
916231637056Smrg#
916331637056Smrg# This code is only required when automatic dependency tracking
916431637056Smrg# is enabled.  FIXME.  This creates each '.P' file that we will
916531637056Smrg# need in order to bootstrap the dependency handling code.
916631637056SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
916731637056Smrg[AC_CONFIG_COMMANDS([depfiles],
916831637056Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
916931637056Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
917031637056Smrg])
917125b89263Smrg
917231637056Smrg# Do all the work for Automake.                             -*- Autoconf -*-
917325b89263Smrg
917431637056Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
917531637056Smrg#
917631637056Smrg# This file is free software; the Free Software Foundation
917731637056Smrg# gives unlimited permission to copy and/or distribute it,
917831637056Smrg# with or without modifications, as long as this notice is preserved.
9179ea133fd7Smrg
918031637056Smrg# This macro actually does too much.  Some checks are only needed if
918131637056Smrg# your package does certain things.  But this isn't really a big deal.
9182ea133fd7Smrg
918331637056Smrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
918431637056Smrgm4_define([AC_PROG_CC],
918531637056Smrgm4_defn([AC_PROG_CC])
918631637056Smrg[_AM_PROG_CC_C_O
918731637056Smrg])
9188a253d6aeSmrg
918931637056Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
919031637056Smrg# AM_INIT_AUTOMAKE([OPTIONS])
919131637056Smrg# -----------------------------------------------
919231637056Smrg# The call with PACKAGE and VERSION arguments is the old style
919331637056Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
919431637056Smrg# and VERSION should now be passed to AC_INIT and removed from
919531637056Smrg# the call to AM_INIT_AUTOMAKE.
919631637056Smrg# We support both call styles for the transition.  After
919731637056Smrg# the next Automake release, Autoconf can make the AC_INIT
919831637056Smrg# arguments mandatory, and then we can depend on a new Autoconf
919931637056Smrg# release and drop the old call support.
920031637056SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
920131637056Smrg[AC_PREREQ([2.65])dnl
920231637056Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
920331637056Smrgdnl the ones we care about.
920431637056Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
920531637056SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
920631637056SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
920731637056Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
920831637056Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
920931637056Smrg  # is not polluted with repeated "-I."
921031637056Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
921131637056Smrg  # test to see if srcdir already configured
921231637056Smrg  if test -f $srcdir/config.status; then
921331637056Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
921431637056Smrg  fi
921531637056Smrgfi
9216a253d6aeSmrg
921731637056Smrg# test whether we have cygpath
921831637056Smrgif test -z "$CYGPATH_W"; then
921931637056Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
922031637056Smrg    CYGPATH_W='cygpath -w'
922131637056Smrg  else
922231637056Smrg    CYGPATH_W=echo
922331637056Smrg  fi
922431637056Smrgfi
922531637056SmrgAC_SUBST([CYGPATH_W])
9226a253d6aeSmrg
922731637056Smrg# Define the identity of the package.
922831637056Smrgdnl Distinguish between old-style and new-style calls.
922931637056Smrgm4_ifval([$2],
923031637056Smrg[AC_DIAGNOSE([obsolete],
923131637056Smrg             [$0: two- and three-arguments forms are deprecated.])
923231637056Smrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
923331637056Smrg AC_SUBST([PACKAGE], [$1])dnl
923431637056Smrg AC_SUBST([VERSION], [$2])],
923531637056Smrg[_AM_SET_OPTIONS([$1])dnl
923631637056Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
923731637056Smrgm4_if(
923831637056Smrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
923931637056Smrg  [ok:ok],,
924031637056Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
924131637056Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
924231637056Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
924331637056Smrg
924431637056Smrg_AM_IF_OPTION([no-define],,
924531637056Smrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
924631637056Smrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
924731637056Smrg
924831637056Smrg# Some tools Automake needs.
924931637056SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
925031637056SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
925131637056SmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
925231637056SmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
925331637056SmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
925431637056SmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
925531637056SmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
925631637056SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
925731637056SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
925831637056SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
925931637056Smrg# For better backward compatibility.  To be removed once Automake 1.9.x
926031637056Smrg# dies out for good.  For more background, see:
926131637056Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
926231637056Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
926331637056SmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
926431637056Smrg# We need awk for the "check" target.  The system "awk" is bad on
926531637056Smrg# some platforms.
926631637056SmrgAC_REQUIRE([AC_PROG_AWK])dnl
926731637056SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
926831637056SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
926931637056Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
927031637056Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
927131637056Smrg			     [_AM_PROG_TAR([v7])])])
927231637056Smrg_AM_IF_OPTION([no-dependencies],,
927331637056Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
927431637056Smrg		  [_AM_DEPENDENCIES([CC])],
927531637056Smrg		  [m4_define([AC_PROG_CC],
927631637056Smrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
927731637056SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
927831637056Smrg		  [_AM_DEPENDENCIES([CXX])],
927931637056Smrg		  [m4_define([AC_PROG_CXX],
928031637056Smrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
928131637056SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
928231637056Smrg		  [_AM_DEPENDENCIES([OBJC])],
928331637056Smrg		  [m4_define([AC_PROG_OBJC],
928431637056Smrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
928531637056SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
928631637056Smrg		  [_AM_DEPENDENCIES([OBJCXX])],
928731637056Smrg		  [m4_define([AC_PROG_OBJCXX],
928831637056Smrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
928931637056Smrg])
929031637056SmrgAC_REQUIRE([AM_SILENT_RULES])dnl
929131637056Smrgdnl The testsuite driver may need to know about EXEEXT, so add the
929231637056Smrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
929331637056Smrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
929431637056SmrgAC_CONFIG_COMMANDS_PRE(dnl
929531637056Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
929631637056Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
9297a253d6aeSmrg
929831637056Smrg# POSIX will say in a future version that running "rm -f" with no argument
929931637056Smrg# is OK; and we want to be able to make that assumption in our Makefile
930031637056Smrg# recipes.  So use an aggressive probe to check that the usage we want is
930131637056Smrg# actually supported "in the wild" to an acceptable degree.
930231637056Smrg# See automake bug#10828.
930331637056Smrg# To make any issue more visible, cause the running configure to be aborted
930431637056Smrg# by default if the 'rm' program in use doesn't match our expectations; the
930531637056Smrg# user can still override this though.
930631637056Smrgif rm -f && rm -fr && rm -rf; then : OK; else
930731637056Smrg  cat >&2 <<'END'
930831637056SmrgOops!
930931637056Smrg
931031637056SmrgYour 'rm' program seems unable to run without file operands specified
931131637056Smrgon the command line, even when the '-f' option is present.  This is contrary
931231637056Smrgto the behaviour of most rm programs out there, and not conforming with
931331637056Smrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
931431637056Smrg
931531637056SmrgPlease tell bug-automake@gnu.org about your system, including the value
931631637056Smrgof your $PATH and any error possibly output before this message.  This
931731637056Smrgcan help us improve future automake versions.
9318a253d6aeSmrg
931931637056SmrgEND
932031637056Smrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
932131637056Smrg    echo 'Configuration will proceed anyway, since you have set the' >&2
932231637056Smrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
932331637056Smrg    echo >&2
932431637056Smrg  else
932531637056Smrg    cat >&2 <<'END'
932631637056SmrgAborting the configuration process, to ensure you take notice of the issue.
9327a253d6aeSmrg
932831637056SmrgYou can download and install GNU coreutils to get an 'rm' implementation
932931637056Smrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
9330a253d6aeSmrg
933131637056SmrgIf you want to complete the configuration process using your problematic
933231637056Smrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
933331637056Smrgto "yes", and re-run configure.
9334a253d6aeSmrg
933531637056SmrgEND
933631637056Smrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
933731637056Smrg  fi
933831637056Smrgfi])
9339a253d6aeSmrg
934031637056Smrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
934131637056Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
934231637056Smrgdnl mangled by Autoconf and run in a shell conditional statement.
934331637056Smrgm4_define([_AC_COMPILER_EXEEXT],
934431637056Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
9345a253d6aeSmrg
934631637056Smrg# When config.status generates a header, we must update the stamp-h file.
934731637056Smrg# This file resides in the same directory as the config header
934831637056Smrg# that is generated.  The stamp files are numbered to have different names.
9349a253d6aeSmrg
935031637056Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
935131637056Smrg# loop where config.status creates the headers, so we can generate
935231637056Smrg# our stamp files there.
935331637056SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
935431637056Smrg[# Compute $1's index in $config_headers.
935531637056Smrg_am_arg=$1
935631637056Smrg_am_stamp_count=1
935731637056Smrgfor _am_header in $config_headers :; do
935831637056Smrg  case $_am_header in
935931637056Smrg    $_am_arg | $_am_arg:* )
936031637056Smrg      break ;;
936131637056Smrg    * )
936231637056Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
936331637056Smrg  esac
936431637056Smrgdone
936531637056Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
9366ea133fd7Smrg
936731637056Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
936831637056Smrg#
936931637056Smrg# This file is free software; the Free Software Foundation
937031637056Smrg# gives unlimited permission to copy and/or distribute it,
937131637056Smrg# with or without modifications, as long as this notice is preserved.
9372ea133fd7Smrg
937331637056Smrg# AM_PROG_INSTALL_SH
937431637056Smrg# ------------------
937531637056Smrg# Define $install_sh.
937631637056SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
937731637056Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
937831637056Smrgif test x"${install_sh}" != xset; then
937931637056Smrg  case $am_aux_dir in
938031637056Smrg  *\ * | *\	*)
938131637056Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
938231637056Smrg  *)
938331637056Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
938431637056Smrg  esac
938531637056Smrgfi
938631637056SmrgAC_SUBST([install_sh])])
9387ea133fd7Smrg
938831637056Smrg# Copyright (C) 2003-2013 Free Software Foundation, Inc.
938931637056Smrg#
939031637056Smrg# This file is free software; the Free Software Foundation
939131637056Smrg# gives unlimited permission to copy and/or distribute it,
939231637056Smrg# with or without modifications, as long as this notice is preserved.
9393ea133fd7Smrg
939431637056Smrg# Check whether the underlying file-system supports filenames
939531637056Smrg# with a leading dot.  For instance MS-DOS doesn't.
939631637056SmrgAC_DEFUN([AM_SET_LEADING_DOT],
939731637056Smrg[rm -rf .tst 2>/dev/null
939831637056Smrgmkdir .tst 2>/dev/null
939931637056Smrgif test -d .tst; then
940031637056Smrg  am__leading_dot=.
940131637056Smrgelse
940231637056Smrg  am__leading_dot=_
940331637056Smrgfi
940431637056Smrgrmdir .tst 2>/dev/null
940531637056SmrgAC_SUBST([am__leading_dot])])
9406a253d6aeSmrg
940731637056Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
940831637056Smrg
940931637056Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
941006f32fbeSmrg#
941131637056Smrg# This file is free software; the Free Software Foundation
941231637056Smrg# gives unlimited permission to copy and/or distribute it,
941331637056Smrg# with or without modifications, as long as this notice is preserved.
9414ea133fd7Smrg
941531637056Smrg# AM_MAKE_INCLUDE()
941631637056Smrg# -----------------
941731637056Smrg# Check to see how make treats includes.
941831637056SmrgAC_DEFUN([AM_MAKE_INCLUDE],
941931637056Smrg[am_make=${MAKE-make}
942031637056Smrgcat > confinc << 'END'
942131637056Smrgam__doit:
942231637056Smrg	@echo this is the am__doit target
942331637056Smrg.PHONY: am__doit
942431637056SmrgEND
942531637056Smrg# If we don't find an include directive, just comment out the code.
942631637056SmrgAC_MSG_CHECKING([for style of include used by $am_make])
942731637056Smrgam__include="#"
942831637056Smrgam__quote=
942931637056Smrg_am_result=none
943031637056Smrg# First try GNU make style include.
943131637056Smrgecho "include confinc" > confmf
943231637056Smrg# Ignore all kinds of additional output from 'make'.
943331637056Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
943431637056Smrg*the\ am__doit\ target*)
943531637056Smrg  am__include=include
943631637056Smrg  am__quote=
943731637056Smrg  _am_result=GNU
943831637056Smrg  ;;
943931637056Smrgesac
944031637056Smrg# Now try BSD make style include.
944131637056Smrgif test "$am__include" = "#"; then
944231637056Smrg   echo '.include "confinc"' > confmf
944331637056Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
944431637056Smrg   *the\ am__doit\ target*)
944531637056Smrg     am__include=.include
944631637056Smrg     am__quote="\""
944731637056Smrg     _am_result=BSD
944831637056Smrg     ;;
944931637056Smrg   esac
945031637056Smrgfi
945131637056SmrgAC_SUBST([am__include])
945231637056SmrgAC_SUBST([am__quote])
945331637056SmrgAC_MSG_RESULT([$_am_result])
945431637056Smrgrm -f confinc confmf
945531637056Smrg])
9456ea133fd7Smrg
945731637056Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
9458ea133fd7Smrg
945931637056Smrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
946031637056Smrg#
946131637056Smrg# This file is free software; the Free Software Foundation
946231637056Smrg# gives unlimited permission to copy and/or distribute it,
946331637056Smrg# with or without modifications, as long as this notice is preserved.
9464a253d6aeSmrg
946531637056Smrg# AM_MISSING_PROG(NAME, PROGRAM)
946631637056Smrg# ------------------------------
946731637056SmrgAC_DEFUN([AM_MISSING_PROG],
946831637056Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
946931637056Smrg$1=${$1-"${am_missing_run}$2"}
947031637056SmrgAC_SUBST($1)])
947131637056Smrg
947231637056Smrg# AM_MISSING_HAS_RUN
947331637056Smrg# ------------------
947431637056Smrg# Define MISSING if not defined so far and test if it is modern enough.
947531637056Smrg# If it is, set am_missing_run to use it, otherwise, to nothing.
947631637056SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
947731637056Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
947831637056SmrgAC_REQUIRE_AUX_FILE([missing])dnl
947931637056Smrgif test x"${MISSING+set}" != xset; then
948031637056Smrg  case $am_aux_dir in
948131637056Smrg  *\ * | *\	*)
948231637056Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
948331637056Smrg  *)
948431637056Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
948531637056Smrg  esac
948631637056Smrgfi
948731637056Smrg# Use eval to expand $SHELL
948831637056Smrgif eval "$MISSING --is-lightweight"; then
948931637056Smrg  am_missing_run="$MISSING "
949031637056Smrgelse
949131637056Smrg  am_missing_run=
949231637056Smrg  AC_MSG_WARN(['missing' script is too old or missing])
949331637056Smrgfi
949406f32fbeSmrg])
9495a253d6aeSmrg
949631637056Smrg# Helper functions for option handling.                     -*- Autoconf -*-
949731637056Smrg
949831637056Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
949906f32fbeSmrg#
950031637056Smrg# This file is free software; the Free Software Foundation
950131637056Smrg# gives unlimited permission to copy and/or distribute it,
950231637056Smrg# with or without modifications, as long as this notice is preserved.
9503a253d6aeSmrg
950431637056Smrg# _AM_MANGLE_OPTION(NAME)
950531637056Smrg# -----------------------
950631637056SmrgAC_DEFUN([_AM_MANGLE_OPTION],
950731637056Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
9508ea133fd7Smrg
950931637056Smrg# _AM_SET_OPTION(NAME)
951031637056Smrg# --------------------
951131637056Smrg# Set option NAME.  Presently that only means defining a flag for this option.
951231637056SmrgAC_DEFUN([_AM_SET_OPTION],
951331637056Smrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
951431637056Smrg
951531637056Smrg# _AM_SET_OPTIONS(OPTIONS)
951631637056Smrg# ------------------------
951731637056Smrg# OPTIONS is a space-separated list of Automake options.
951831637056SmrgAC_DEFUN([_AM_SET_OPTIONS],
951931637056Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
952031637056Smrg
952131637056Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
952231637056Smrg# -------------------------------------------
952331637056Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
952431637056SmrgAC_DEFUN([_AM_IF_OPTION],
952531637056Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
952631637056Smrg
952731637056Smrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
952806f32fbeSmrg#
952931637056Smrg# This file is free software; the Free Software Foundation
953031637056Smrg# gives unlimited permission to copy and/or distribute it,
953131637056Smrg# with or without modifications, as long as this notice is preserved.
9532ea133fd7Smrg
953331637056Smrg# _AM_PROG_CC_C_O
953431637056Smrg# ---------------
953531637056Smrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
953631637056Smrg# to automatically call this.
953731637056SmrgAC_DEFUN([_AM_PROG_CC_C_O],
953831637056Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
953931637056SmrgAC_REQUIRE_AUX_FILE([compile])dnl
954031637056SmrgAC_LANG_PUSH([C])dnl
954131637056SmrgAC_CACHE_CHECK(
954231637056Smrg  [whether $CC understands -c and -o together],
954331637056Smrg  [am_cv_prog_cc_c_o],
954431637056Smrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
954531637056Smrg  # Make sure it works both with $CC and with simple cc.
954631637056Smrg  # Following AC_PROG_CC_C_O, we do the test twice because some
954731637056Smrg  # compilers refuse to overwrite an existing .o file with -o,
954831637056Smrg  # though they will create one.
954931637056Smrg  am_cv_prog_cc_c_o=yes
955031637056Smrg  for am_i in 1 2; do
955131637056Smrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
955231637056Smrg         && test -f conftest2.$ac_objext; then
955331637056Smrg      : OK
955431637056Smrg    else
955531637056Smrg      am_cv_prog_cc_c_o=no
955631637056Smrg      break
955731637056Smrg    fi
955831637056Smrg  done
955931637056Smrg  rm -f core conftest*
956031637056Smrg  unset am_i])
956131637056Smrgif test "$am_cv_prog_cc_c_o" != yes; then
956231637056Smrg   # Losing compiler, so override with the script.
956331637056Smrg   # FIXME: It is wrong to rewrite CC.
956431637056Smrg   # But if we don't then we get into trouble of one sort or another.
956531637056Smrg   # A longer-term fix would be to have automake use am__CC in this case,
956631637056Smrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
956731637056Smrg   CC="$am_aux_dir/compile $CC"
956831637056Smrgfi
956931637056SmrgAC_LANG_POP([C])])
9570a253d6aeSmrg
957131637056Smrg# For backward compatibility.
957231637056SmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
9573a253d6aeSmrg
957431637056Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
957557ee1794Smrg#
957631637056Smrg# This file is free software; the Free Software Foundation
957731637056Smrg# gives unlimited permission to copy and/or distribute it,
957831637056Smrg# with or without modifications, as long as this notice is preserved.
957931637056Smrg
958031637056Smrg# AM_RUN_LOG(COMMAND)
958131637056Smrg# -------------------
958231637056Smrg# Run COMMAND, save the exit status in ac_status, and log it.
958331637056Smrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
958431637056SmrgAC_DEFUN([AM_RUN_LOG],
958531637056Smrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
958631637056Smrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
958731637056Smrg   ac_status=$?
958831637056Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
958931637056Smrg   (exit $ac_status); }])
959031637056Smrg
959131637056Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
959231637056Smrg
959331637056Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
959457ee1794Smrg#
959531637056Smrg# This file is free software; the Free Software Foundation
959631637056Smrg# gives unlimited permission to copy and/or distribute it,
959731637056Smrg# with or without modifications, as long as this notice is preserved.
959831637056Smrg
959931637056Smrg# AM_SANITY_CHECK
960031637056Smrg# ---------------
960131637056SmrgAC_DEFUN([AM_SANITY_CHECK],
960231637056Smrg[AC_MSG_CHECKING([whether build environment is sane])
960331637056Smrg# Reject unsafe characters in $srcdir or the absolute working directory
960431637056Smrg# name.  Accept space and tab only in the latter.
960531637056Smrgam_lf='
960631637056Smrg'
960731637056Smrgcase `pwd` in
960831637056Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
960931637056Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
961031637056Smrgesac
961131637056Smrgcase $srcdir in
961231637056Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
961331637056Smrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
961431637056Smrgesac
961531637056Smrg
961631637056Smrg# Do 'set' in a subshell so we don't clobber the current shell's
961731637056Smrg# arguments.  Must try -L first in case configure is actually a
961831637056Smrg# symlink; some systems play weird games with the mod time of symlinks
961931637056Smrg# (eg FreeBSD returns the mod time of the symlink's containing
962031637056Smrg# directory).
962131637056Smrgif (
962231637056Smrg   am_has_slept=no
962331637056Smrg   for am_try in 1 2; do
962431637056Smrg     echo "timestamp, slept: $am_has_slept" > conftest.file
962531637056Smrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
962631637056Smrg     if test "$[*]" = "X"; then
962731637056Smrg	# -L didn't work.
962831637056Smrg	set X `ls -t "$srcdir/configure" conftest.file`
962931637056Smrg     fi
963031637056Smrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
963131637056Smrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
963231637056Smrg
963331637056Smrg	# If neither matched, then we have a broken ls.  This can happen
963431637056Smrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
963531637056Smrg	# broken ls alias from the environment.  This has actually
963631637056Smrg	# happened.  Such a system could not be considered "sane".
963731637056Smrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
963831637056Smrg  alias in your environment])
963931637056Smrg     fi
964031637056Smrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
964131637056Smrg       break
964231637056Smrg     fi
964331637056Smrg     # Just in case.
964431637056Smrg     sleep 1
964531637056Smrg     am_has_slept=yes
964631637056Smrg   done
964731637056Smrg   test "$[2]" = conftest.file
964831637056Smrg   )
964931637056Smrgthen
965031637056Smrg   # Ok.
965131637056Smrg   :
965231637056Smrgelse
965331637056Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
965431637056SmrgCheck your system clock])
965531637056Smrgfi
965631637056SmrgAC_MSG_RESULT([yes])
965731637056Smrg# If we didn't sleep, we still need to ensure time stamps of config.status and
965831637056Smrg# generated files are strictly newer.
965931637056Smrgam_sleep_pid=
966031637056Smrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
966131637056Smrg  ( sleep 1 ) &
966231637056Smrg  am_sleep_pid=$!
966331637056Smrgfi
966431637056SmrgAC_CONFIG_COMMANDS_PRE(
966531637056Smrg  [AC_MSG_CHECKING([that generated files are newer than configure])
966631637056Smrg   if test -n "$am_sleep_pid"; then
966731637056Smrg     # Hide warnings about reused PIDs.
966831637056Smrg     wait $am_sleep_pid 2>/dev/null
966931637056Smrg   fi
967031637056Smrg   AC_MSG_RESULT([done])])
967131637056Smrgrm -f conftest.file
967231637056Smrg])
967331637056Smrg
967431637056Smrg# Copyright (C) 2009-2013 Free Software Foundation, Inc.
967557ee1794Smrg#
967631637056Smrg# This file is free software; the Free Software Foundation
967731637056Smrg# gives unlimited permission to copy and/or distribute it,
967831637056Smrg# with or without modifications, as long as this notice is preserved.
967957ee1794Smrg
968031637056Smrg# AM_SILENT_RULES([DEFAULT])
968131637056Smrg# --------------------------
968231637056Smrg# Enable less verbose build rules; with the default set to DEFAULT
968331637056Smrg# ("yes" being less verbose, "no" or empty being verbose).
968431637056SmrgAC_DEFUN([AM_SILENT_RULES],
968531637056Smrg[AC_ARG_ENABLE([silent-rules], [dnl
968631637056SmrgAS_HELP_STRING(
968731637056Smrg  [--enable-silent-rules],
968831637056Smrg  [less verbose build output (undo: "make V=1")])
968931637056SmrgAS_HELP_STRING(
969031637056Smrg  [--disable-silent-rules],
969131637056Smrg  [verbose build output (undo: "make V=0")])dnl
969231637056Smrg])
969331637056Smrgcase $enable_silent_rules in @%:@ (((
969431637056Smrg  yes) AM_DEFAULT_VERBOSITY=0;;
969531637056Smrg   no) AM_DEFAULT_VERBOSITY=1;;
969631637056Smrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
969731637056Smrgesac
969831637056Smrgdnl
969931637056Smrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
970031637056Smrgdnl do not support nested variable expansions.
970131637056Smrgdnl See automake bug#9928 and bug#10237.
970231637056Smrgam_make=${MAKE-make}
970331637056SmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
970431637056Smrg   [am_cv_make_support_nested_variables],
970531637056Smrg   [if AS_ECHO([['TRUE=$(BAR$(V))
970631637056SmrgBAR0=false
970731637056SmrgBAR1=true
970831637056SmrgV=1
970931637056Smrgam__doit:
971031637056Smrg	@$(TRUE)
971131637056Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
971231637056Smrg  am_cv_make_support_nested_variables=yes
971331637056Smrgelse
971431637056Smrg  am_cv_make_support_nested_variables=no
971531637056Smrgfi])
971631637056Smrgif test $am_cv_make_support_nested_variables = yes; then
971731637056Smrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
971831637056Smrg  AM_V='$(V)'
971931637056Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
972031637056Smrgelse
972131637056Smrg  AM_V=$AM_DEFAULT_VERBOSITY
972231637056Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
972357ee1794Smrgfi
972431637056SmrgAC_SUBST([AM_V])dnl
972531637056SmrgAM_SUBST_NOTMAKE([AM_V])dnl
972631637056SmrgAC_SUBST([AM_DEFAULT_V])dnl
972731637056SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
972831637056SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
972931637056SmrgAM_BACKSLASH='\'
973031637056SmrgAC_SUBST([AM_BACKSLASH])dnl
973131637056Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
973231637056Smrg])
973357ee1794Smrg
973431637056Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
973557ee1794Smrg#
973631637056Smrg# This file is free software; the Free Software Foundation
973731637056Smrg# gives unlimited permission to copy and/or distribute it,
973831637056Smrg# with or without modifications, as long as this notice is preserved.
973957ee1794Smrg
974031637056Smrg# AM_PROG_INSTALL_STRIP
974131637056Smrg# ---------------------
974231637056Smrg# One issue with vendor 'install' (even GNU) is that you can't
974331637056Smrg# specify the program used to strip binaries.  This is especially
974431637056Smrg# annoying in cross-compiling environments, where the build's strip
974531637056Smrg# is unlikely to handle the host's binaries.
974631637056Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
974731637056Smrg# always use install-sh in "make install-strip", and initialize
974831637056Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
974931637056SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
975031637056Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
975131637056Smrg# Installed binaries are usually stripped using 'strip' when the user
975231637056Smrg# run "make install-strip".  However 'strip' might not be the right
975331637056Smrg# tool to use in cross-compilation environments, therefore Automake
975431637056Smrg# will honor the 'STRIP' environment variable to overrule this program.
975531637056Smrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
975631637056Smrgif test "$cross_compiling" != no; then
975731637056Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
975831637056Smrgfi
975931637056SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
976031637056SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
976157ee1794Smrg
976231637056Smrg# Copyright (C) 2006-2013 Free Software Foundation, Inc.
976331637056Smrg#
976431637056Smrg# This file is free software; the Free Software Foundation
976531637056Smrg# gives unlimited permission to copy and/or distribute it,
976631637056Smrg# with or without modifications, as long as this notice is preserved.
976757ee1794Smrg
976831637056Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
976931637056Smrg# ---------------------------
977031637056Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
977131637056Smrg# This macro is traced by Automake.
977231637056SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
977357ee1794Smrg
977431637056Smrg# AM_SUBST_NOTMAKE(VARIABLE)
977531637056Smrg# --------------------------
977631637056Smrg# Public sister of _AM_SUBST_NOTMAKE.
977731637056SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
977857ee1794Smrg
977931637056Smrg# Check how to create a tarball.                            -*- Autoconf -*-
978031637056Smrg
978131637056Smrg# Copyright (C) 2004-2013 Free Software Foundation, Inc.
978257ee1794Smrg#
978331637056Smrg# This file is free software; the Free Software Foundation
978431637056Smrg# gives unlimited permission to copy and/or distribute it,
978531637056Smrg# with or without modifications, as long as this notice is preserved.
978631637056Smrg
978731637056Smrg# _AM_PROG_TAR(FORMAT)
978831637056Smrg# --------------------
978931637056Smrg# Check how to create a tarball in format FORMAT.
979031637056Smrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
979157ee1794Smrg#
979231637056Smrg# Substitute a variable $(am__tar) that is a command
979331637056Smrg# writing to stdout a FORMAT-tarball containing the directory
979431637056Smrg# $tardir.
979531637056Smrg#     tardir=directory && $(am__tar) > result.tar
979657ee1794Smrg#
979731637056Smrg# Substitute a variable $(am__untar) that extract such
979831637056Smrg# a tarball read from stdin.
979931637056Smrg#     $(am__untar) < result.tar
980057ee1794Smrg#
980131637056SmrgAC_DEFUN([_AM_PROG_TAR],
980231637056Smrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
980331637056Smrg# in the wild :-(  We should find a proper way to deprecate it ...
980431637056SmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
980557ee1794Smrg
980631637056Smrg# We'll loop over all known methods to create a tar archive until one works.
980731637056Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
980857ee1794Smrg
980931637056Smrgm4_if([$1], [v7],
981031637056Smrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
981157ee1794Smrg
981231637056Smrg  [m4_case([$1],
981331637056Smrg    [ustar],
981431637056Smrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
981531637056Smrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
981631637056Smrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
981731637056Smrg      # and bug#13588).
981831637056Smrg      am_max_uid=2097151 # 2^21 - 1
981931637056Smrg      am_max_gid=$am_max_uid
982031637056Smrg      # The $UID and $GID variables are not portable, so we need to resort
982131637056Smrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
982231637056Smrg      # below are definitely unexpected, so allow the users to see them
982331637056Smrg      # (that is, avoid stderr redirection).
982431637056Smrg      am_uid=`id -u || echo unknown`
982531637056Smrg      am_gid=`id -g || echo unknown`
982631637056Smrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
982731637056Smrg      if test $am_uid -le $am_max_uid; then
982831637056Smrg         AC_MSG_RESULT([yes])
982931637056Smrg      else
983031637056Smrg         AC_MSG_RESULT([no])
983131637056Smrg         _am_tools=none
983231637056Smrg      fi
983331637056Smrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
983431637056Smrg      if test $am_gid -le $am_max_gid; then
983531637056Smrg         AC_MSG_RESULT([yes])
983631637056Smrg      else
983731637056Smrg        AC_MSG_RESULT([no])
983831637056Smrg        _am_tools=none
983931637056Smrg      fi],
984057ee1794Smrg
984131637056Smrg  [pax],
984231637056Smrg    [],
984357ee1794Smrg
984431637056Smrg  [m4_fatal([Unknown tar format])])
984557ee1794Smrg
984631637056Smrg  AC_MSG_CHECKING([how to create a $1 tar archive])
984757ee1794Smrg
984831637056Smrg  # Go ahead even if we have the value already cached.  We do so because we
984931637056Smrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
985031637056Smrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
985157ee1794Smrg
985231637056Smrg  for _am_tool in $_am_tools; do
985331637056Smrg    case $_am_tool in
985431637056Smrg    gnutar)
985531637056Smrg      for _am_tar in tar gnutar gtar; do
985631637056Smrg        AM_RUN_LOG([$_am_tar --version]) && break
985731637056Smrg      done
985831637056Smrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
985931637056Smrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
986031637056Smrg      am__untar="$_am_tar -xf -"
986131637056Smrg      ;;
986231637056Smrg    plaintar)
986331637056Smrg      # Must skip GNU tar: if it does not support --format= it doesn't create
986431637056Smrg      # ustar tarball either.
986531637056Smrg      (tar --version) >/dev/null 2>&1 && continue
986631637056Smrg      am__tar='tar chf - "$$tardir"'
986731637056Smrg      am__tar_='tar chf - "$tardir"'
986831637056Smrg      am__untar='tar xf -'
986931637056Smrg      ;;
987031637056Smrg    pax)
987131637056Smrg      am__tar='pax -L -x $1 -w "$$tardir"'
987231637056Smrg      am__tar_='pax -L -x $1 -w "$tardir"'
987331637056Smrg      am__untar='pax -r'
987431637056Smrg      ;;
987531637056Smrg    cpio)
987631637056Smrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
987731637056Smrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
987831637056Smrg      am__untar='cpio -i -H $1 -d'
987931637056Smrg      ;;
988031637056Smrg    none)
988131637056Smrg      am__tar=false
988231637056Smrg      am__tar_=false
988331637056Smrg      am__untar=false
988431637056Smrg      ;;
988531637056Smrg    esac
988657ee1794Smrg
988731637056Smrg    # If the value was cached, stop now.  We just wanted to have am__tar
988831637056Smrg    # and am__untar set.
988931637056Smrg    test -n "${am_cv_prog_tar_$1}" && break
989057ee1794Smrg
989131637056Smrg    # tar/untar a dummy directory, and stop if the command works.
989231637056Smrg    rm -rf conftest.dir
989331637056Smrg    mkdir conftest.dir
989431637056Smrg    echo GrepMe > conftest.dir/file
989531637056Smrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
989631637056Smrg    rm -rf conftest.dir
989731637056Smrg    if test -s conftest.tar; then
989831637056Smrg      AM_RUN_LOG([$am__untar <conftest.tar])
989931637056Smrg      AM_RUN_LOG([cat conftest.dir/file])
990031637056Smrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
990131637056Smrg    fi
990231637056Smrg  done
990331637056Smrg  rm -rf conftest.dir
990431637056Smrg
990531637056Smrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
990631637056Smrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
990731637056Smrg
990831637056SmrgAC_SUBST([am__tar])
990931637056SmrgAC_SUBST([am__untar])
991031637056Smrg]) # _AM_PROG_TAR
991157ee1794Smrg
991206f32fbeSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
991306f32fbeSmrgdnl
991431637056Smrgdnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
991531637056Smrgdnl
991606f32fbeSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
991706f32fbeSmrgdnl copy of this software and associated documentation files (the "Software"),
991806f32fbeSmrgdnl to deal in the Software without restriction, including without limitation
991906f32fbeSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
992006f32fbeSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
992106f32fbeSmrgdnl Software is furnished to do so, subject to the following conditions:
992206f32fbeSmrgdnl
992306f32fbeSmrgdnl The above copyright notice and this permission notice (including the next
992406f32fbeSmrgdnl paragraph) shall be included in all copies or substantial portions of the
992506f32fbeSmrgdnl Software.
992606f32fbeSmrgdnl
992706f32fbeSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
992806f32fbeSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
992906f32fbeSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
993006f32fbeSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
993106f32fbeSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
993206f32fbeSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
993306f32fbeSmrgdnl DEALINGS IN THE SOFTWARE.
993425b89263Smrg
993506f32fbeSmrg# XORG_MACROS_VERSION(required-version)
993606f32fbeSmrg# -------------------------------------
993706f32fbeSmrg# Minimum version: 1.1.0
993806f32fbeSmrg#
993906f32fbeSmrg# If you're using a macro added in Version 1.1 or newer, include this in
994006f32fbeSmrg# your configure.ac with the minimum required version, such as:
994106f32fbeSmrg# XORG_MACROS_VERSION(1.1)
994206f32fbeSmrg#
994306f32fbeSmrg# To ensure that this macro is defined, also add:
994406f32fbeSmrg# m4_ifndef([XORG_MACROS_VERSION],
994506f32fbeSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
994606f32fbeSmrg#
994706f32fbeSmrg#
994831637056Smrg# See the "minimum version" comment for each macro you use to see what
994906f32fbeSmrg# version you require.
995006f32fbeSmrgm4_defun([XORG_MACROS_VERSION],[
995131637056Smrgm4_define([vers_have], [1.19.0])
995206f32fbeSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
995306f32fbeSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
995406f32fbeSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
995506f32fbeSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
995606f32fbeSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
995706f32fbeSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
995806f32fbeSmrgm4_undefine([vers_have])
995906f32fbeSmrgm4_undefine([maj_have])
996006f32fbeSmrgm4_undefine([maj_needed])
996106f32fbeSmrg]) # XORG_MACROS_VERSION
996225b89263Smrg
996306f32fbeSmrg# XORG_PROG_RAWCPP()
996406f32fbeSmrg# ------------------
996506f32fbeSmrg# Minimum version: 1.0.0
996606f32fbeSmrg#
996706f32fbeSmrg# Find cpp program and necessary flags for use in pre-processing text files
996806f32fbeSmrg# such as man pages and config files
996906f32fbeSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
997006f32fbeSmrgAC_REQUIRE([AC_PROG_CPP])
997131637056SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
997206f32fbeSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9973a253d6aeSmrg
997406f32fbeSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
997506f32fbeSmrg# which is not the best choice for supporting other OS'es, but covers most
997606f32fbeSmrg# of the ones we need for now.
997706f32fbeSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
997806f32fbeSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
997906f32fbeSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
998006f32fbeSmrg	AC_MSG_RESULT([no])
998106f32fbeSmrgelse
998206f32fbeSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
998306f32fbeSmrg		RAWCPPFLAGS=-undef
998406f32fbeSmrg		AC_MSG_RESULT([yes])
998506f32fbeSmrg	# under Cygwin unix is still defined even with -undef
998606f32fbeSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
998706f32fbeSmrg		RAWCPPFLAGS="-undef -ansi"
998806f32fbeSmrg		AC_MSG_RESULT([yes, with -ansi])
998906f32fbeSmrg	else
999006f32fbeSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
999106f32fbeSmrg	fi
999206f32fbeSmrgfi
999306f32fbeSmrgrm -f conftest.$ac_ext
9994a253d6aeSmrg
999506f32fbeSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
999606f32fbeSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
999706f32fbeSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
999806f32fbeSmrg	AC_MSG_RESULT([no])
999906f32fbeSmrgelse
1000006f32fbeSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1000131637056Smrg		TRADITIONALCPPFLAGS="-traditional"
1000206f32fbeSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1000306f32fbeSmrg		AC_MSG_RESULT([yes])
1000406f32fbeSmrg	else
1000506f32fbeSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1000606f32fbeSmrg	fi
1000706f32fbeSmrgfi
1000806f32fbeSmrgrm -f conftest.$ac_ext
1000906f32fbeSmrgAC_SUBST(RAWCPPFLAGS)
1001031637056SmrgAC_SUBST(TRADITIONALCPPFLAGS)
1001106f32fbeSmrg]) # XORG_PROG_RAWCPP
10012a253d6aeSmrg
1001306f32fbeSmrg# XORG_MANPAGE_SECTIONS()
1001406f32fbeSmrg# -----------------------
1001506f32fbeSmrg# Minimum version: 1.0.0
1001606f32fbeSmrg#
1001706f32fbeSmrg# Determine which sections man pages go in for the different man page types
1001806f32fbeSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1001906f32fbeSmrg# Not sure if there's any better way than just hardcoding by OS name.
1002006f32fbeSmrg# Override default settings by setting environment variables
1002106f32fbeSmrg# Added MAN_SUBSTS in version 1.8
1002206f32fbeSmrg# Added AC_PROG_SED in version 1.8
10023a253d6aeSmrg
1002406f32fbeSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1002506f32fbeSmrgAC_REQUIRE([AC_CANONICAL_HOST])
1002606f32fbeSmrgAC_REQUIRE([AC_PROG_SED])
10027a253d6aeSmrg
1002806f32fbeSmrgif test x$APP_MAN_SUFFIX = x    ; then
1002906f32fbeSmrg    APP_MAN_SUFFIX=1
1003006f32fbeSmrgfi
1003106f32fbeSmrgif test x$APP_MAN_DIR = x    ; then
1003206f32fbeSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1003306f32fbeSmrgfi
10034a253d6aeSmrg
1003506f32fbeSmrgif test x$LIB_MAN_SUFFIX = x    ; then
1003606f32fbeSmrg    LIB_MAN_SUFFIX=3
1003706f32fbeSmrgfi
1003806f32fbeSmrgif test x$LIB_MAN_DIR = x    ; then
1003906f32fbeSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1004006f32fbeSmrgfi
1004125b89263Smrg
1004206f32fbeSmrgif test x$FILE_MAN_SUFFIX = x    ; then
1004306f32fbeSmrg    case $host_os in
1004431637056Smrg	# Solaris 2.0 - 11 use SysV man page sections
1004531637056Smrg	solaris2.?|solaris2.1[[01]])	FILE_MAN_SUFFIX=4  ;;
1004631637056Smrg	*)				FILE_MAN_SUFFIX=5  ;;
1004706f32fbeSmrg    esac
1004806f32fbeSmrgfi
1004906f32fbeSmrgif test x$FILE_MAN_DIR = x    ; then
1005006f32fbeSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
1005106f32fbeSmrgfi
1005225b89263Smrg
1005306f32fbeSmrgif test x$MISC_MAN_SUFFIX = x    ; then
1005406f32fbeSmrg    case $host_os in
1005531637056Smrg	# Solaris 2.0 - 11 use SysV man page sections
1005631637056Smrg	solaris2.?|solaris2.1[[01]])	MISC_MAN_SUFFIX=5  ;;
1005731637056Smrg	*)				MISC_MAN_SUFFIX=7  ;;
1005806f32fbeSmrg    esac
1005906f32fbeSmrgfi
1006006f32fbeSmrgif test x$MISC_MAN_DIR = x    ; then
1006106f32fbeSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1006206f32fbeSmrgfi
1006325b89263Smrg
1006406f32fbeSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1006506f32fbeSmrg    case $host_os in
1006631637056Smrg	# Solaris 2.0 - 11 use SysV man page sections
1006731637056Smrg	solaris2.?|solaris2.1[[01]])	DRIVER_MAN_SUFFIX=7  ;;
1006831637056Smrg	*)				DRIVER_MAN_SUFFIX=4  ;;
1006906f32fbeSmrg    esac
1007006f32fbeSmrgfi
1007106f32fbeSmrgif test x$DRIVER_MAN_DIR = x    ; then
1007206f32fbeSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1007306f32fbeSmrgfi
1007425b89263Smrg
1007506f32fbeSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1007606f32fbeSmrg    case $host_os in
1007731637056Smrg	# Solaris 2.0 - 11 use SysV man page sections
1007831637056Smrg	solaris2.?|solaris2.1[[01]])	ADMIN_MAN_SUFFIX=1m ;;
1007931637056Smrg	*)				ADMIN_MAN_SUFFIX=8  ;;
1008006f32fbeSmrg    esac
1008106f32fbeSmrgfi
1008206f32fbeSmrgif test x$ADMIN_MAN_DIR = x    ; then
1008306f32fbeSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1008406f32fbeSmrgfi
1008525b89263Smrg
1008625b89263Smrg
1008706f32fbeSmrgAC_SUBST([APP_MAN_SUFFIX])
1008806f32fbeSmrgAC_SUBST([LIB_MAN_SUFFIX])
1008906f32fbeSmrgAC_SUBST([FILE_MAN_SUFFIX])
1009006f32fbeSmrgAC_SUBST([MISC_MAN_SUFFIX])
1009106f32fbeSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1009206f32fbeSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1009306f32fbeSmrgAC_SUBST([APP_MAN_DIR])
1009406f32fbeSmrgAC_SUBST([LIB_MAN_DIR])
1009506f32fbeSmrgAC_SUBST([FILE_MAN_DIR])
1009606f32fbeSmrgAC_SUBST([MISC_MAN_DIR])
1009706f32fbeSmrgAC_SUBST([DRIVER_MAN_DIR])
1009806f32fbeSmrgAC_SUBST([ADMIN_MAN_DIR])
1009925b89263Smrg
1010006f32fbeSmrgXORG_MAN_PAGE="X Version 11"
1010106f32fbeSmrgAC_SUBST([XORG_MAN_PAGE])
1010206f32fbeSmrgMAN_SUBSTS="\
1010306f32fbeSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1010406f32fbeSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1010506f32fbeSmrg	-e 's|__xservername__|Xorg|g' \
1010606f32fbeSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
1010706f32fbeSmrg	-e 's|__projectroot__|\$(prefix)|g' \
1010806f32fbeSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
1010906f32fbeSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
1011006f32fbeSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
1011106f32fbeSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
1011206f32fbeSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
1011306f32fbeSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
1011406f32fbeSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
1011506f32fbeSmrgAC_SUBST([MAN_SUBSTS])
1011625b89263Smrg
1011706f32fbeSmrg]) # XORG_MANPAGE_SECTIONS
10118a253d6aeSmrg
1011906f32fbeSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
1012006f32fbeSmrg# ------------------------
1012106f32fbeSmrg# Minimum version: 1.7.0
1012225b89263Smrg#
1012306f32fbeSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
1012406f32fbeSmrg# provided by xorg-sgml-doctools, if installed.
1012506f32fbeSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
1012606f32fbeSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
1012706f32fbeSmrgXORG_SGML_PATH=
1012806f32fbeSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
1012906f32fbeSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
1013006f32fbeSmrg    [m4_ifval([$1],[:],
1013106f32fbeSmrg        [if test x"$cross_compiling" != x"yes" ; then
1013206f32fbeSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
1013306f32fbeSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
1013406f32fbeSmrg         fi])
1013506f32fbeSmrg    ])
10136a253d6aeSmrg
1013706f32fbeSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
1013806f32fbeSmrg# the path and the name of the doc stylesheet
1013906f32fbeSmrgif test "x$XORG_SGML_PATH" != "x" ; then
1014006f32fbeSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
1014106f32fbeSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
1014206f32fbeSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
1014306f32fbeSmrgelse
1014406f32fbeSmrg   AC_MSG_RESULT([no])
1014506f32fbeSmrgfi
10146a253d6aeSmrg
1014706f32fbeSmrgAC_SUBST(XORG_SGML_PATH)
1014806f32fbeSmrgAC_SUBST(STYLESHEET_SRCDIR)
1014906f32fbeSmrgAC_SUBST(XSL_STYLESHEET)
1015006f32fbeSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
1015106f32fbeSmrg]) # XORG_CHECK_SGML_DOCTOOLS
10152a253d6aeSmrg
1015306f32fbeSmrg# XORG_CHECK_LINUXDOC
1015406f32fbeSmrg# -------------------
1015506f32fbeSmrg# Minimum version: 1.0.0
1015606f32fbeSmrg#
1015706f32fbeSmrg# Defines the variable MAKE_TEXT if the necessary tools and
1015806f32fbeSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1015906f32fbeSmrg# Whether or not the necessary tools and files are found can be checked
1016006f32fbeSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1016106f32fbeSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1016206f32fbeSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1016306f32fbeSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
10164a253d6aeSmrg
1016506f32fbeSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
10166a253d6aeSmrg
1016706f32fbeSmrgAC_MSG_CHECKING([whether to build documentation])
10168a253d6aeSmrg
1016906f32fbeSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
1017006f32fbeSmrg   BUILDDOC=yes
1017106f32fbeSmrgelse
1017206f32fbeSmrg   BUILDDOC=no
1017306f32fbeSmrgfi
10174a253d6aeSmrg
1017506f32fbeSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
10176a253d6aeSmrg
1017706f32fbeSmrgAC_MSG_RESULT([$BUILDDOC])
10178a253d6aeSmrg
1017906f32fbeSmrgAC_MSG_CHECKING([whether to build pdf documentation])
10180a253d6aeSmrg
1018106f32fbeSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
1018206f32fbeSmrg   BUILDPDFDOC=yes
1018306f32fbeSmrgelse
1018406f32fbeSmrg   BUILDPDFDOC=no
1018506f32fbeSmrgfi
10186a253d6aeSmrg
1018706f32fbeSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10188a253d6aeSmrg
1018906f32fbeSmrgAC_MSG_RESULT([$BUILDPDFDOC])
10190a253d6aeSmrg
1019106f32fbeSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
1019206f32fbeSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1019306f32fbeSmrgMAKE_PDF="$PS2PDF"
1019406f32fbeSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
10195a253d6aeSmrg
1019606f32fbeSmrgAC_SUBST(MAKE_TEXT)
1019706f32fbeSmrgAC_SUBST(MAKE_PS)
1019806f32fbeSmrgAC_SUBST(MAKE_PDF)
1019906f32fbeSmrgAC_SUBST(MAKE_HTML)
1020006f32fbeSmrg]) # XORG_CHECK_LINUXDOC
10201a253d6aeSmrg
1020206f32fbeSmrg# XORG_CHECK_DOCBOOK
1020306f32fbeSmrg# -------------------
1020406f32fbeSmrg# Minimum version: 1.0.0
1020506f32fbeSmrg#
1020606f32fbeSmrg# Checks for the ability to build output formats from SGML DocBook source.
1020706f32fbeSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1020806f32fbeSmrg# indicates whether the necessary tools and files are found and, if set,
1020906f32fbeSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1021006f32fbeSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1021106f32fbeSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10212a253d6aeSmrg
1021306f32fbeSmrgBUILDTXTDOC=no
1021406f32fbeSmrgBUILDPDFDOC=no
1021506f32fbeSmrgBUILDPSDOC=no
1021606f32fbeSmrgBUILDHTMLDOC=no
10217a253d6aeSmrg
1021806f32fbeSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1021906f32fbeSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1022006f32fbeSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1022106f32fbeSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1022225b89263Smrg
1022306f32fbeSmrgAC_MSG_CHECKING([whether to build text documentation])
1022406f32fbeSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
1022506f32fbeSmrg   test x$BUILD_TXTDOC != xno; then
1022606f32fbeSmrg	BUILDTXTDOC=yes
1022706f32fbeSmrgfi
1022806f32fbeSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1022906f32fbeSmrgAC_MSG_RESULT([$BUILDTXTDOC])
1023025b89263Smrg
1023106f32fbeSmrgAC_MSG_CHECKING([whether to build PDF documentation])
1023206f32fbeSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
1023306f32fbeSmrg   test x$BUILD_PDFDOC != xno; then
1023406f32fbeSmrg	BUILDPDFDOC=yes
1023506f32fbeSmrgfi
1023606f32fbeSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1023706f32fbeSmrgAC_MSG_RESULT([$BUILDPDFDOC])
10238a253d6aeSmrg
1023906f32fbeSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
1024006f32fbeSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
1024106f32fbeSmrg   test x$BUILD_PSDOC != xno; then
1024206f32fbeSmrg	BUILDPSDOC=yes
1024306f32fbeSmrgfi
1024406f32fbeSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1024506f32fbeSmrgAC_MSG_RESULT([$BUILDPSDOC])
10246a253d6aeSmrg
1024706f32fbeSmrgAC_MSG_CHECKING([whether to build HTML documentation])
1024806f32fbeSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
1024906f32fbeSmrg   test x$BUILD_HTMLDOC != xno; then
1025006f32fbeSmrg	BUILDHTMLDOC=yes
1025106f32fbeSmrgfi
1025206f32fbeSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1025306f32fbeSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
10254a253d6aeSmrg
1025506f32fbeSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1025606f32fbeSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1025706f32fbeSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1025806f32fbeSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
10259a253d6aeSmrg
1026006f32fbeSmrgAC_SUBST(MAKE_TEXT)
1026106f32fbeSmrgAC_SUBST(MAKE_PS)
1026206f32fbeSmrgAC_SUBST(MAKE_PDF)
1026306f32fbeSmrgAC_SUBST(MAKE_HTML)
1026406f32fbeSmrg]) # XORG_CHECK_DOCBOOK
10265a253d6aeSmrg
1026606f32fbeSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
1026706f32fbeSmrg# ----------------
1026806f32fbeSmrg# Minimum version: 1.5.0
1026906f32fbeSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1027006f32fbeSmrg#
1027106f32fbeSmrg# Documentation tools are not always available on all platforms and sometimes
1027206f32fbeSmrg# not at the appropriate level. This macro enables a module to test for the
1027306f32fbeSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1027406f32fbeSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
1027506f32fbeSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
1027606f32fbeSmrg# --with-xmlto assumes 'auto'.
1027706f32fbeSmrg#
1027806f32fbeSmrg# Interface to module:
1027906f32fbeSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
1028006f32fbeSmrg# XMLTO:	returns the path of the xmlto program found
1028106f32fbeSmrg#		returns the path set by the user in the environment
1028206f32fbeSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
1028306f32fbeSmrg#		'no' user instructs the module not to use xmlto
1028406f32fbeSmrg#
1028506f32fbeSmrg# Added in version 1.10.0
1028606f32fbeSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
1028706f32fbeSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
1028806f32fbeSmrg#
1028906f32fbeSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
1029006f32fbeSmrg#
1029106f32fbeSmrgAC_DEFUN([XORG_WITH_XMLTO],[
1029206f32fbeSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
1029306f32fbeSmrgm4_define([_defopt], m4_default([$2], [auto]))
1029406f32fbeSmrgAC_ARG_WITH(xmlto,
1029506f32fbeSmrg	AS_HELP_STRING([--with-xmlto],
1029606f32fbeSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
1029706f32fbeSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
1029806f32fbeSmrgm4_undefine([_defopt])
10299a253d6aeSmrg
1030006f32fbeSmrgif test "x$use_xmlto" = x"auto"; then
1030106f32fbeSmrg   AC_PATH_PROG([XMLTO], [xmlto])
1030206f32fbeSmrg   if test "x$XMLTO" = "x"; then
1030306f32fbeSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
1030406f32fbeSmrg	have_xmlto=no
1030506f32fbeSmrg   else
1030606f32fbeSmrg        have_xmlto=yes
1030706f32fbeSmrg   fi
1030806f32fbeSmrgelif test "x$use_xmlto" = x"yes" ; then
1030906f32fbeSmrg   AC_PATH_PROG([XMLTO], [xmlto])
1031006f32fbeSmrg   if test "x$XMLTO" = "x"; then
1031106f32fbeSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
1031206f32fbeSmrg   fi
1031306f32fbeSmrg   have_xmlto=yes
1031406f32fbeSmrgelif test "x$use_xmlto" = x"no" ; then
1031506f32fbeSmrg   if test "x$XMLTO" != "x"; then
1031606f32fbeSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
1031706f32fbeSmrg   fi
1031806f32fbeSmrg   have_xmlto=no
1031906f32fbeSmrgelse
1032006f32fbeSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
1032106f32fbeSmrgfi
10322a253d6aeSmrg
1032306f32fbeSmrg# Test for a minimum version of xmlto, if provided.
1032406f32fbeSmrgm4_ifval([$1],
1032506f32fbeSmrg[if test "$have_xmlto" = yes; then
1032606f32fbeSmrg    # scrape the xmlto version
1032706f32fbeSmrg    AC_MSG_CHECKING([the xmlto version])
1032806f32fbeSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
1032906f32fbeSmrg    AC_MSG_RESULT([$xmlto_version])
1033006f32fbeSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
1033106f32fbeSmrg        [if test "x$use_xmlto" = xauto; then
1033206f32fbeSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
1033306f32fbeSmrg            have_xmlto=no
1033406f32fbeSmrg        else
1033506f32fbeSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
1033606f32fbeSmrg        fi])
1033706f32fbeSmrgfi])
10338a253d6aeSmrg
1033906f32fbeSmrg# Test for the ability of xmlto to generate a text target
1034031637056Smrg#
1034131637056Smrg# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the
1034231637056Smrg# following test for empty XML docbook files.
1034331637056Smrg# For compatibility reasons use the following empty XML docbook file and if
1034431637056Smrg# it fails try it again with a non-empty XML file.
1034506f32fbeSmrghave_xmlto_text=no
1034606f32fbeSmrgcat > conftest.xml << "EOF"
1034706f32fbeSmrgEOF
1034806f32fbeSmrgAS_IF([test "$have_xmlto" = yes],
1034906f32fbeSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1035006f32fbeSmrg             [have_xmlto_text=yes],
1035131637056Smrg             [# Try it again with a non-empty XML file.
1035231637056Smrg              cat > conftest.xml << "EOF"
1035331637056Smrg<x></x>
1035431637056SmrgEOF
1035531637056Smrg              AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1035631637056Smrg                    [have_xmlto_text=yes],
1035731637056Smrg                    [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])])
1035806f32fbeSmrgrm -f conftest.xml
1035906f32fbeSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
1036006f32fbeSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
1036106f32fbeSmrg]) # XORG_WITH_XMLTO
10362a253d6aeSmrg
1036306f32fbeSmrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
1036406f32fbeSmrg# --------------------------------------------
1036506f32fbeSmrg# Minimum version: 1.12.0
1036606f32fbeSmrg# Minimum version for optional DEFAULT argument: 1.12.0
1036706f32fbeSmrg#
1036806f32fbeSmrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
1036906f32fbeSmrg# XML-based language used for the transformation of XML documents.
1037006f32fbeSmrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
1037106f32fbeSmrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
1037206f32fbeSmrg# The XSLT processor is often used as a standalone tool for transformations.
1037306f32fbeSmrg# It should not be assumed that this tool is used only to work with documnetation.
1037406f32fbeSmrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
1037506f32fbeSmrg#
1037606f32fbeSmrg# Interface to module:
1037706f32fbeSmrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
1037806f32fbeSmrg# XSLTPROC:	 returns the path of the xsltproc program found
1037906f32fbeSmrg#		 returns the path set by the user in the environment
1038006f32fbeSmrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
1038106f32fbeSmrg#		  'no' user instructs the module not to use xsltproc
1038206f32fbeSmrg# have_xsltproc: returns yes if xsltproc found in PATH or no
1038306f32fbeSmrg#
1038406f32fbeSmrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
1038506f32fbeSmrg#
1038606f32fbeSmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
1038706f32fbeSmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
1038806f32fbeSmrg# Preserves the interface, should it be implemented later
1038906f32fbeSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
1039006f32fbeSmrgm4_define([_defopt], m4_default([$2], [auto]))
1039106f32fbeSmrgAC_ARG_WITH(xsltproc,
1039206f32fbeSmrg	AS_HELP_STRING([--with-xsltproc],
1039306f32fbeSmrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
1039406f32fbeSmrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
1039506f32fbeSmrgm4_undefine([_defopt])
10396a253d6aeSmrg
1039706f32fbeSmrgif test "x$use_xsltproc" = x"auto"; then
1039806f32fbeSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
1039906f32fbeSmrg   if test "x$XSLTPROC" = "x"; then
1040006f32fbeSmrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
1040106f32fbeSmrg	have_xsltproc=no
1040206f32fbeSmrg   else
1040306f32fbeSmrg        have_xsltproc=yes
1040406f32fbeSmrg   fi
1040506f32fbeSmrgelif test "x$use_xsltproc" = x"yes" ; then
1040606f32fbeSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
1040706f32fbeSmrg   if test "x$XSLTPROC" = "x"; then
1040806f32fbeSmrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
1040906f32fbeSmrg   fi
1041006f32fbeSmrg   have_xsltproc=yes
1041106f32fbeSmrgelif test "x$use_xsltproc" = x"no" ; then
1041206f32fbeSmrg   if test "x$XSLTPROC" != "x"; then
1041306f32fbeSmrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
1041406f32fbeSmrg   fi
1041506f32fbeSmrg   have_xsltproc=no
1041606f32fbeSmrgelse
1041706f32fbeSmrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
1041806f32fbeSmrgfi
10419a253d6aeSmrg
1042006f32fbeSmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
1042106f32fbeSmrg]) # XORG_WITH_XSLTPROC
10422a253d6aeSmrg
1042306f32fbeSmrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
1042406f32fbeSmrg# ----------------------------------------
1042506f32fbeSmrg# Minimum version: 1.15.0
1042606f32fbeSmrg#
1042706f32fbeSmrg# PERL (Practical Extraction and Report Language) is a language optimized for
1042806f32fbeSmrg# scanning arbitrary text files, extracting information from those text files,
1042906f32fbeSmrg# and printing reports based on that information.
1043006f32fbeSmrg#
1043106f32fbeSmrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
1043206f32fbeSmrg#
1043306f32fbeSmrg# Interface to module:
1043406f32fbeSmrg# HAVE_PERL: used in makefiles to conditionally scan text files
1043506f32fbeSmrg# PERL:	     returns the path of the perl program found
1043606f32fbeSmrg#	     returns the path set by the user in the environment
1043706f32fbeSmrg# --with-perl: 'yes' user instructs the module to use perl
1043806f32fbeSmrg#	       'no' user instructs the module not to use perl
1043906f32fbeSmrg# have_perl: returns yes if perl found in PATH or no
1044006f32fbeSmrg#
1044106f32fbeSmrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
1044206f32fbeSmrg#
1044306f32fbeSmrgAC_DEFUN([XORG_WITH_PERL],[
1044406f32fbeSmrgAC_ARG_VAR([PERL], [Path to perl command])
1044506f32fbeSmrg# Preserves the interface, should it be implemented later
1044606f32fbeSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
1044706f32fbeSmrgm4_define([_defopt], m4_default([$2], [auto]))
1044806f32fbeSmrgAC_ARG_WITH(perl,
1044906f32fbeSmrg	AS_HELP_STRING([--with-perl],
1045006f32fbeSmrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
1045106f32fbeSmrg	   [use_perl=$withval], [use_perl=]_defopt)
1045206f32fbeSmrgm4_undefine([_defopt])
1045325b89263Smrg
1045406f32fbeSmrgif test "x$use_perl" = x"auto"; then
1045506f32fbeSmrg   AC_PATH_PROG([PERL], [perl])
1045606f32fbeSmrg   if test "x$PERL" = "x"; then
1045706f32fbeSmrg        AC_MSG_WARN([perl not found - cannot extract information and report])
1045806f32fbeSmrg	have_perl=no
1045906f32fbeSmrg   else
1046006f32fbeSmrg        have_perl=yes
1046106f32fbeSmrg   fi
1046206f32fbeSmrgelif test "x$use_perl" = x"yes" ; then
1046306f32fbeSmrg   AC_PATH_PROG([PERL], [perl])
1046406f32fbeSmrg   if test "x$PERL" = "x"; then
1046506f32fbeSmrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
1046606f32fbeSmrg   fi
1046706f32fbeSmrg   have_perl=yes
1046806f32fbeSmrgelif test "x$use_perl" = x"no" ; then
1046906f32fbeSmrg   if test "x$PERL" != "x"; then
1047006f32fbeSmrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
1047106f32fbeSmrg   fi
1047206f32fbeSmrg   have_perl=no
1047306f32fbeSmrgelse
1047406f32fbeSmrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
1047506f32fbeSmrgfi
1047625b89263Smrg
1047706f32fbeSmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
1047806f32fbeSmrg]) # XORG_WITH_PERL
1047925b89263Smrg
1048006f32fbeSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
1048106f32fbeSmrg# ----------------
1048206f32fbeSmrg# Minimum version: 1.5.0
1048306f32fbeSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1048406f32fbeSmrg#
1048506f32fbeSmrg# Documentation tools are not always available on all platforms and sometimes
1048606f32fbeSmrg# not at the appropriate level. This macro enables a module to test for the
1048706f32fbeSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1048806f32fbeSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
1048906f32fbeSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
1049006f32fbeSmrg# --with-asciidoc assumes 'auto'.
1049106f32fbeSmrg#
1049206f32fbeSmrg# Interface to module:
1049306f32fbeSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
1049406f32fbeSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
1049506f32fbeSmrg#		 returns the path set by the user in the environment
1049606f32fbeSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
1049706f32fbeSmrg#		  'no' user instructs the module not to use asciidoc
1049806f32fbeSmrg#
1049906f32fbeSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
1050006f32fbeSmrg#
1050106f32fbeSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
1050206f32fbeSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
1050306f32fbeSmrgm4_define([_defopt], m4_default([$2], [auto]))
1050406f32fbeSmrgAC_ARG_WITH(asciidoc,
1050506f32fbeSmrg	AS_HELP_STRING([--with-asciidoc],
1050606f32fbeSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
1050706f32fbeSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
1050806f32fbeSmrgm4_undefine([_defopt])
10509a253d6aeSmrg
1051006f32fbeSmrgif test "x$use_asciidoc" = x"auto"; then
1051106f32fbeSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1051206f32fbeSmrg   if test "x$ASCIIDOC" = "x"; then
1051306f32fbeSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
1051406f32fbeSmrg	have_asciidoc=no
1051506f32fbeSmrg   else
1051606f32fbeSmrg        have_asciidoc=yes
1051706f32fbeSmrg   fi
1051806f32fbeSmrgelif test "x$use_asciidoc" = x"yes" ; then
1051906f32fbeSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1052006f32fbeSmrg   if test "x$ASCIIDOC" = "x"; then
1052106f32fbeSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
1052206f32fbeSmrg   fi
1052306f32fbeSmrg   have_asciidoc=yes
1052406f32fbeSmrgelif test "x$use_asciidoc" = x"no" ; then
1052506f32fbeSmrg   if test "x$ASCIIDOC" != "x"; then
1052606f32fbeSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
1052706f32fbeSmrg   fi
1052806f32fbeSmrg   have_asciidoc=no
1052906f32fbeSmrgelse
1053006f32fbeSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
1053106f32fbeSmrgfi
1053206f32fbeSmrgm4_ifval([$1],
1053306f32fbeSmrg[if test "$have_asciidoc" = yes; then
1053406f32fbeSmrg    # scrape the asciidoc version
1053506f32fbeSmrg    AC_MSG_CHECKING([the asciidoc version])
1053606f32fbeSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
1053706f32fbeSmrg    AC_MSG_RESULT([$asciidoc_version])
1053806f32fbeSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
1053906f32fbeSmrg        [if test "x$use_asciidoc" = xauto; then
1054006f32fbeSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
1054106f32fbeSmrg            have_asciidoc=no
1054206f32fbeSmrg        else
1054306f32fbeSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
1054406f32fbeSmrg        fi])
1054506f32fbeSmrgfi])
1054606f32fbeSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
1054706f32fbeSmrg]) # XORG_WITH_ASCIIDOC
10548a253d6aeSmrg
1054906f32fbeSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
1055031637056Smrg# -------------------------------------------
1055106f32fbeSmrg# Minimum version: 1.5.0
1055206f32fbeSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1055331637056Smrg# Minimum version for optional DOT checking: 1.18.0
1055406f32fbeSmrg#
1055506f32fbeSmrg# Documentation tools are not always available on all platforms and sometimes
1055606f32fbeSmrg# not at the appropriate level. This macro enables a module to test for the
1055706f32fbeSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1055806f32fbeSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
1055906f32fbeSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
1056006f32fbeSmrg# --with-doxygen assumes 'auto'.
1056106f32fbeSmrg#
1056206f32fbeSmrg# Interface to module:
1056306f32fbeSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
1056406f32fbeSmrg# DOXYGEN:	 returns the path of the doxygen program found
1056506f32fbeSmrg#		 returns the path set by the user in the environment
1056606f32fbeSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
1056706f32fbeSmrg#		  'no' user instructs the module not to use doxygen
1056806f32fbeSmrg#
1056906f32fbeSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
1057006f32fbeSmrg#
1057106f32fbeSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
1057206f32fbeSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
1057331637056SmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
1057406f32fbeSmrgm4_define([_defopt], m4_default([$2], [auto]))
1057506f32fbeSmrgAC_ARG_WITH(doxygen,
1057606f32fbeSmrg	AS_HELP_STRING([--with-doxygen],
1057706f32fbeSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
1057806f32fbeSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
1057906f32fbeSmrgm4_undefine([_defopt])
10580a253d6aeSmrg
1058106f32fbeSmrgif test "x$use_doxygen" = x"auto"; then
1058206f32fbeSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1058306f32fbeSmrg   if test "x$DOXYGEN" = "x"; then
1058406f32fbeSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
1058506f32fbeSmrg	have_doxygen=no
1058606f32fbeSmrg   else
1058706f32fbeSmrg        have_doxygen=yes
1058806f32fbeSmrg   fi
1058906f32fbeSmrgelif test "x$use_doxygen" = x"yes" ; then
1059006f32fbeSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1059106f32fbeSmrg   if test "x$DOXYGEN" = "x"; then
1059206f32fbeSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
1059306f32fbeSmrg   fi
1059406f32fbeSmrg   have_doxygen=yes
1059506f32fbeSmrgelif test "x$use_doxygen" = x"no" ; then
1059606f32fbeSmrg   if test "x$DOXYGEN" != "x"; then
1059706f32fbeSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
1059806f32fbeSmrg   fi
1059906f32fbeSmrg   have_doxygen=no
1060006f32fbeSmrgelse
1060106f32fbeSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
1060206f32fbeSmrgfi
1060306f32fbeSmrgm4_ifval([$1],
1060406f32fbeSmrg[if test "$have_doxygen" = yes; then
1060506f32fbeSmrg    # scrape the doxygen version
1060606f32fbeSmrg    AC_MSG_CHECKING([the doxygen version])
1060706f32fbeSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
1060806f32fbeSmrg    AC_MSG_RESULT([$doxygen_version])
1060906f32fbeSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
1061006f32fbeSmrg        [if test "x$use_doxygen" = xauto; then
1061106f32fbeSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
1061206f32fbeSmrg            have_doxygen=no
1061306f32fbeSmrg        else
1061406f32fbeSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
1061506f32fbeSmrg        fi])
1061606f32fbeSmrgfi])
1061731637056Smrg
1061831637056Smrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
1061931637056Smrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
1062031637056Smrgdnl 	HAVE_DOT = @HAVE_DOT@
1062131637056SmrgHAVE_DOT=no
1062231637056Smrgif test "x$have_doxygen" = "xyes"; then
1062331637056Smrg  AC_PATH_PROG([DOT], [dot])
1062431637056Smrg    if test "x$DOT" != "x"; then
1062531637056Smrg      HAVE_DOT=yes
1062631637056Smrg    fi
1062731637056Smrgfi
1062831637056Smrg
1062931637056SmrgAC_SUBST([HAVE_DOT])
1063031637056SmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
1063106f32fbeSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
1063206f32fbeSmrg]) # XORG_WITH_DOXYGEN
10633a253d6aeSmrg
1063406f32fbeSmrg# XORG_WITH_GROFF([DEFAULT])
1063506f32fbeSmrg# ----------------
1063606f32fbeSmrg# Minimum version: 1.6.0
1063706f32fbeSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1063806f32fbeSmrg#
1063906f32fbeSmrg# Documentation tools are not always available on all platforms and sometimes
1064006f32fbeSmrg# not at the appropriate level. This macro enables a module to test for the
1064106f32fbeSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1064206f32fbeSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
1064306f32fbeSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
1064406f32fbeSmrg# --with-groff assumes 'auto'.
1064506f32fbeSmrg#
1064606f32fbeSmrg# Interface to module:
1064706f32fbeSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
1064806f32fbeSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
1064906f32fbeSmrg# HAVE_GROFF_MS: the -ms macros package
1065006f32fbeSmrg# GROFF:	 returns the path of the groff program found
1065106f32fbeSmrg#		 returns the path set by the user in the environment
1065206f32fbeSmrg# --with-groff:	 'yes' user instructs the module to use groff
1065306f32fbeSmrg#		 'no' user instructs the module not to use groff
1065406f32fbeSmrg#
1065506f32fbeSmrg# Added in version 1.9.0:
1065606f32fbeSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
1065706f32fbeSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
1065806f32fbeSmrg#		   psselect from the psutils package.
1065906f32fbeSmrg#		   the ghostcript package. Refer to the grohtml man pages
1066006f32fbeSmrg#
1066106f32fbeSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
1066206f32fbeSmrg#
1066306f32fbeSmrg# OS and distros often splits groff in a basic and full package, the former
1066406f32fbeSmrg# having the groff program and the later having devices, fonts and macros
1066506f32fbeSmrg# Checking for the groff executable is not enough.
1066606f32fbeSmrg#
1066706f32fbeSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
1066806f32fbeSmrg# unset HAVE_GROFF or GROFF env variables.
1066906f32fbeSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
1067006f32fbeSmrg#
1067106f32fbeSmrgAC_DEFUN([XORG_WITH_GROFF],[
1067206f32fbeSmrgAC_ARG_VAR([GROFF], [Path to groff command])
1067306f32fbeSmrgm4_define([_defopt], m4_default([$1], [auto]))
1067406f32fbeSmrgAC_ARG_WITH(groff,
1067506f32fbeSmrg	AS_HELP_STRING([--with-groff],
1067606f32fbeSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
1067706f32fbeSmrg	   [use_groff=$withval], [use_groff=]_defopt)
1067806f32fbeSmrgm4_undefine([_defopt])
10679a253d6aeSmrg
1068006f32fbeSmrgif test "x$use_groff" = x"auto"; then
1068106f32fbeSmrg   AC_PATH_PROG([GROFF], [groff])
1068206f32fbeSmrg   if test "x$GROFF" = "x"; then
1068306f32fbeSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
1068406f32fbeSmrg	have_groff=no
1068506f32fbeSmrg   else
1068606f32fbeSmrg        have_groff=yes
1068706f32fbeSmrg   fi
1068806f32fbeSmrgelif test "x$use_groff" = x"yes" ; then
1068906f32fbeSmrg   AC_PATH_PROG([GROFF], [groff])
1069006f32fbeSmrg   if test "x$GROFF" = "x"; then
1069106f32fbeSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
1069206f32fbeSmrg   fi
1069306f32fbeSmrg   have_groff=yes
1069406f32fbeSmrgelif test "x$use_groff" = x"no" ; then
1069506f32fbeSmrg   if test "x$GROFF" != "x"; then
1069606f32fbeSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
1069706f32fbeSmrg   fi
1069806f32fbeSmrg   have_groff=no
1069906f32fbeSmrgelse
1070006f32fbeSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
1070106f32fbeSmrgfi
10702a253d6aeSmrg
1070306f32fbeSmrg# We have groff, test for the presence of the macro packages
1070406f32fbeSmrgif test "x$have_groff" = x"yes"; then
1070506f32fbeSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
1070606f32fbeSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
1070706f32fbeSmrg        groff_ms_works=yes
1070806f32fbeSmrg    else
1070906f32fbeSmrg        groff_ms_works=no
1071006f32fbeSmrg    fi
1071106f32fbeSmrg    AC_MSG_RESULT([$groff_ms_works])
1071206f32fbeSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
1071306f32fbeSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
1071406f32fbeSmrg        groff_mm_works=yes
1071506f32fbeSmrg    else
1071606f32fbeSmrg        groff_mm_works=no
1071706f32fbeSmrg    fi
1071806f32fbeSmrg    AC_MSG_RESULT([$groff_mm_works])
1071906f32fbeSmrgfi
10720a253d6aeSmrg
1072106f32fbeSmrg# We have groff, test for HTML dependencies, one command per package
1072206f32fbeSmrgif test "x$have_groff" = x"yes"; then
1072306f32fbeSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
1072406f32fbeSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
1072506f32fbeSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
1072606f32fbeSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
1072706f32fbeSmrg      have_groff_html=yes
1072806f32fbeSmrg   else
1072906f32fbeSmrg      have_groff_html=no
1073006f32fbeSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
1073106f32fbeSmrg   fi
1073206f32fbeSmrgfi
10733a253d6aeSmrg
1073406f32fbeSmrg# Set Automake conditionals for Makefiles
1073506f32fbeSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
1073606f32fbeSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
1073706f32fbeSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
1073806f32fbeSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
1073906f32fbeSmrg]) # XORG_WITH_GROFF
10740a253d6aeSmrg
1074106f32fbeSmrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
1074206f32fbeSmrg# ---------------------------------------
1074306f32fbeSmrg# Minimum version: 1.6.0
1074406f32fbeSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1074506f32fbeSmrg# Minimum version for optional MIN-VERSION argument: 1.15.0
1074606f32fbeSmrg#
1074706f32fbeSmrg# Documentation tools are not always available on all platforms and sometimes
1074806f32fbeSmrg# not at the appropriate level. This macro enables a module to test for the
1074906f32fbeSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1075006f32fbeSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
1075106f32fbeSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
1075206f32fbeSmrg# --with-fop assumes 'auto'.
1075306f32fbeSmrg#
1075406f32fbeSmrg# Interface to module:
1075506f32fbeSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
1075606f32fbeSmrg# FOP:	 	returns the path of the fop program found
1075706f32fbeSmrg#		returns the path set by the user in the environment
1075806f32fbeSmrg# --with-fop: 	'yes' user instructs the module to use fop
1075906f32fbeSmrg#		'no' user instructs the module not to use fop
1076006f32fbeSmrg#
1076106f32fbeSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
1076206f32fbeSmrg#
1076306f32fbeSmrgAC_DEFUN([XORG_WITH_FOP],[
1076406f32fbeSmrgAC_ARG_VAR([FOP], [Path to fop command])
1076506f32fbeSmrgm4_define([_defopt], m4_default([$2], [auto]))
1076606f32fbeSmrgAC_ARG_WITH(fop,
1076706f32fbeSmrg	AS_HELP_STRING([--with-fop],
1076806f32fbeSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
1076906f32fbeSmrg	   [use_fop=$withval], [use_fop=]_defopt)
1077006f32fbeSmrgm4_undefine([_defopt])
10771a253d6aeSmrg
1077206f32fbeSmrgif test "x$use_fop" = x"auto"; then
1077306f32fbeSmrg   AC_PATH_PROG([FOP], [fop])
1077406f32fbeSmrg   if test "x$FOP" = "x"; then
1077506f32fbeSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
1077606f32fbeSmrg	have_fop=no
1077706f32fbeSmrg   else
1077806f32fbeSmrg        have_fop=yes
1077906f32fbeSmrg   fi
1078006f32fbeSmrgelif test "x$use_fop" = x"yes" ; then
1078106f32fbeSmrg   AC_PATH_PROG([FOP], [fop])
1078206f32fbeSmrg   if test "x$FOP" = "x"; then
1078306f32fbeSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
1078406f32fbeSmrg   fi
1078506f32fbeSmrg   have_fop=yes
1078606f32fbeSmrgelif test "x$use_fop" = x"no" ; then
1078706f32fbeSmrg   if test "x$FOP" != "x"; then
1078806f32fbeSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
1078906f32fbeSmrg   fi
1079006f32fbeSmrg   have_fop=no
1079106f32fbeSmrgelse
1079206f32fbeSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
1079306f32fbeSmrgfi
10794a253d6aeSmrg
1079506f32fbeSmrg# Test for a minimum version of fop, if provided.
1079606f32fbeSmrgm4_ifval([$1],
1079706f32fbeSmrg[if test "$have_fop" = yes; then
1079806f32fbeSmrg    # scrape the fop version
1079906f32fbeSmrg    AC_MSG_CHECKING([for fop minimum version])
1080006f32fbeSmrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
1080106f32fbeSmrg    AC_MSG_RESULT([$fop_version])
1080206f32fbeSmrg    AS_VERSION_COMPARE([$fop_version], [$1],
1080306f32fbeSmrg        [if test "x$use_fop" = xauto; then
1080406f32fbeSmrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
1080506f32fbeSmrg            have_fop=no
1080606f32fbeSmrg        else
1080706f32fbeSmrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
1080806f32fbeSmrg        fi])
1080906f32fbeSmrgfi])
1081006f32fbeSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
1081106f32fbeSmrg]) # XORG_WITH_FOP
10812a253d6aeSmrg
1081331637056Smrg# XORG_WITH_M4([MIN-VERSION])
1081431637056Smrg# ---------------------------
1081531637056Smrg# Minimum version: 1.19.0
1081631637056Smrg#
1081731637056Smrg# This macro attempts to locate an m4 macro processor which supports
1081831637056Smrg# -I option and is only useful for modules relying on M4 in order to
1081931637056Smrg# expand macros in source code files.
1082031637056Smrg#
1082131637056Smrg# Interface to module:
1082231637056Smrg# M4:	 	returns the path of the m4 program found
1082331637056Smrg#		returns the path set by the user in the environment
1082431637056Smrg#
1082531637056SmrgAC_DEFUN([XORG_WITH_M4], [
1082631637056SmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
1082731637056Smrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
1082831637056Smrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
1082931637056Smrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
1083031637056Smrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
1083131637056Smrg   [$PATH:/usr/gnu/bin])])
1083231637056Smrg
1083331637056SmrgAC_SUBST([M4], [$ac_cv_path_M4])
1083431637056Smrg]) # XORG_WITH_M4
1083531637056Smrg
1083606f32fbeSmrg# XORG_WITH_PS2PDF([DEFAULT])
1083706f32fbeSmrg# ----------------
1083806f32fbeSmrg# Minimum version: 1.6.0
1083906f32fbeSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1084006f32fbeSmrg#
1084106f32fbeSmrg# Documentation tools are not always available on all platforms and sometimes
1084206f32fbeSmrg# not at the appropriate level. This macro enables a module to test for the
1084306f32fbeSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
1084406f32fbeSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
1084506f32fbeSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
1084606f32fbeSmrg# --with-ps2pdf assumes 'auto'.
1084706f32fbeSmrg#
1084806f32fbeSmrg# Interface to module:
1084906f32fbeSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
1085006f32fbeSmrg# PS2PDF:	returns the path of the ps2pdf program found
1085106f32fbeSmrg#		returns the path set by the user in the environment
1085206f32fbeSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
1085306f32fbeSmrg#		 'no' user instructs the module not to use ps2pdf
1085406f32fbeSmrg#
1085506f32fbeSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
1085606f32fbeSmrg#
1085706f32fbeSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
1085806f32fbeSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
1085906f32fbeSmrgm4_define([_defopt], m4_default([$1], [auto]))
1086006f32fbeSmrgAC_ARG_WITH(ps2pdf,
1086106f32fbeSmrg	AS_HELP_STRING([--with-ps2pdf],
1086206f32fbeSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
1086306f32fbeSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
1086406f32fbeSmrgm4_undefine([_defopt])
10865a253d6aeSmrg
1086606f32fbeSmrgif test "x$use_ps2pdf" = x"auto"; then
1086706f32fbeSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1086806f32fbeSmrg   if test "x$PS2PDF" = "x"; then
1086906f32fbeSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
1087006f32fbeSmrg	have_ps2pdf=no
1087106f32fbeSmrg   else
1087206f32fbeSmrg        have_ps2pdf=yes
1087306f32fbeSmrg   fi
1087406f32fbeSmrgelif test "x$use_ps2pdf" = x"yes" ; then
1087506f32fbeSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1087606f32fbeSmrg   if test "x$PS2PDF" = "x"; then
1087706f32fbeSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
1087806f32fbeSmrg   fi
1087906f32fbeSmrg   have_ps2pdf=yes
1088006f32fbeSmrgelif test "x$use_ps2pdf" = x"no" ; then
1088106f32fbeSmrg   if test "x$PS2PDF" != "x"; then
1088206f32fbeSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
1088306f32fbeSmrg   fi
1088406f32fbeSmrg   have_ps2pdf=no
1088506f32fbeSmrgelse
1088606f32fbeSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
1088706f32fbeSmrgfi
1088806f32fbeSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
1088906f32fbeSmrg]) # XORG_WITH_PS2PDF
10890a253d6aeSmrg
1089106f32fbeSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
1089206f32fbeSmrg# ----------------
1089306f32fbeSmrg# Minimum version: 1.6.0
1089406f32fbeSmrg#
1089506f32fbeSmrg# Documentation tools are not always available on all platforms and sometimes
1089606f32fbeSmrg# not at the appropriate level. This macro enables a builder to skip all
1089706f32fbeSmrg# documentation targets except traditional man pages.
1089806f32fbeSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1089906f32fbeSmrg# maximum flexibilty in controlling documentation building.
1090006f32fbeSmrg# Refer to:
1090106f32fbeSmrg# XORG_WITH_XMLTO         --with-xmlto
1090206f32fbeSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1090306f32fbeSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1090406f32fbeSmrg# XORG_WITH_FOP           --with-fop
1090506f32fbeSmrg# XORG_WITH_GROFF         --with-groff
1090606f32fbeSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
1090706f32fbeSmrg#
1090806f32fbeSmrg# Interface to module:
1090906f32fbeSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
1091006f32fbeSmrg# --enable-docs: 'yes' user instructs the module to generate docs
1091106f32fbeSmrg#		 'no' user instructs the module not to generate docs
1091206f32fbeSmrg# parm1:	specify the default value, yes or no.
1091306f32fbeSmrg#
1091406f32fbeSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
1091506f32fbeSmrgm4_define([docs_default], m4_default([$1], [yes]))
1091606f32fbeSmrgAC_ARG_ENABLE(docs,
1091706f32fbeSmrg	AS_HELP_STRING([--enable-docs],
1091806f32fbeSmrg	   [Enable building the documentation (default: ]docs_default[)]),
1091906f32fbeSmrg	   [build_docs=$enableval], [build_docs=]docs_default)
1092006f32fbeSmrgm4_undefine([docs_default])
1092106f32fbeSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
1092206f32fbeSmrgAC_MSG_CHECKING([whether to build documentation])
1092306f32fbeSmrgAC_MSG_RESULT([$build_docs])
1092406f32fbeSmrg]) # XORG_ENABLE_DOCS
10925a253d6aeSmrg
1092606f32fbeSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
1092706f32fbeSmrg# ----------------
1092806f32fbeSmrg# Minimum version: 1.6.0
1092906f32fbeSmrg#
1093006f32fbeSmrg# This macro enables a builder to skip all developer documentation.
1093106f32fbeSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1093206f32fbeSmrg# maximum flexibilty in controlling documentation building.
1093306f32fbeSmrg# Refer to:
1093406f32fbeSmrg# XORG_WITH_XMLTO         --with-xmlto
1093506f32fbeSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1093606f32fbeSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1093706f32fbeSmrg# XORG_WITH_FOP           --with-fop
1093806f32fbeSmrg# XORG_WITH_GROFF         --with-groff
1093906f32fbeSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
1094006f32fbeSmrg#
1094106f32fbeSmrg# Interface to module:
1094206f32fbeSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
1094306f32fbeSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
1094406f32fbeSmrg#			'no' user instructs the module not to generate developer docs
1094506f32fbeSmrg# parm1:		specify the default value, yes or no.
1094606f32fbeSmrg#
1094706f32fbeSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
1094806f32fbeSmrgm4_define([devel_default], m4_default([$1], [yes]))
1094906f32fbeSmrgAC_ARG_ENABLE(devel-docs,
1095006f32fbeSmrg	AS_HELP_STRING([--enable-devel-docs],
1095106f32fbeSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
1095206f32fbeSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
1095306f32fbeSmrgm4_undefine([devel_default])
1095406f32fbeSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
1095506f32fbeSmrgAC_MSG_CHECKING([whether to build developer documentation])
1095606f32fbeSmrgAC_MSG_RESULT([$build_devel_docs])
1095706f32fbeSmrg]) # XORG_ENABLE_DEVEL_DOCS
1095825b89263Smrg
1095906f32fbeSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
1096006f32fbeSmrg# ----------------
1096106f32fbeSmrg# Minimum version: 1.6.0
1096206f32fbeSmrg#
1096306f32fbeSmrg# This macro enables a builder to skip all functional specification targets.
1096406f32fbeSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1096506f32fbeSmrg# maximum flexibilty in controlling documentation building.
1096606f32fbeSmrg# Refer to:
1096706f32fbeSmrg# XORG_WITH_XMLTO         --with-xmlto
1096806f32fbeSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1096906f32fbeSmrg# XORG_WITH_DOXYGEN       --with-doxygen
1097006f32fbeSmrg# XORG_WITH_FOP           --with-fop
1097106f32fbeSmrg# XORG_WITH_GROFF         --with-groff
1097206f32fbeSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
1097306f32fbeSmrg#
1097406f32fbeSmrg# Interface to module:
1097506f32fbeSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
1097606f32fbeSmrg# --enable-specs:	'yes' user instructs the module to generate specs
1097706f32fbeSmrg#			'no' user instructs the module not to generate specs
1097806f32fbeSmrg# parm1:		specify the default value, yes or no.
1097906f32fbeSmrg#
1098006f32fbeSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
1098106f32fbeSmrgm4_define([spec_default], m4_default([$1], [yes]))
1098206f32fbeSmrgAC_ARG_ENABLE(specs,
1098306f32fbeSmrg	AS_HELP_STRING([--enable-specs],
1098406f32fbeSmrg	   [Enable building the specs (default: ]spec_default[)]),
1098506f32fbeSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
1098606f32fbeSmrgm4_undefine([spec_default])
1098706f32fbeSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
1098806f32fbeSmrgAC_MSG_CHECKING([whether to build functional specifications])
1098906f32fbeSmrgAC_MSG_RESULT([$build_specs])
1099006f32fbeSmrg]) # XORG_ENABLE_SPECS
10991a253d6aeSmrg
1099206f32fbeSmrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
1099306f32fbeSmrg# ----------------------------------------------
1099406f32fbeSmrg# Minimum version: 1.13.0
1099506f32fbeSmrg#
1099606f32fbeSmrg# This macro enables a builder to enable/disable unit testing
1099706f32fbeSmrg# It makes no assumption about the test cases implementation
1099806f32fbeSmrg# Test cases may or may not use Automake "Support for test suites"
1099906f32fbeSmrg# They may or may not use the software utility library GLib
1100006f32fbeSmrg#
1100106f32fbeSmrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
1100206f32fbeSmrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
1100306f32fbeSmrg# The variable enable_unit_tests is used by other macros in this file.
1100406f32fbeSmrg#
1100506f32fbeSmrg# Interface to module:
1100606f32fbeSmrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
1100706f32fbeSmrg# enable_unit_tests:    used in configure.ac for additional configuration
1100806f32fbeSmrg# --enable-unit-tests:	'yes' user instructs the module to build tests
1100906f32fbeSmrg#			'no' user instructs the module not to build tests
1101006f32fbeSmrg# parm1:		specify the default value, yes or no.
1101106f32fbeSmrg#
1101206f32fbeSmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
1101306f32fbeSmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
1101406f32fbeSmrgAC_BEFORE([$0], [XORG_LD_WRAP])
1101506f32fbeSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
1101606f32fbeSmrgm4_define([_defopt], m4_default([$1], [auto]))
1101706f32fbeSmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
1101806f32fbeSmrg	[Enable building unit test cases (default: ]_defopt[)]),
1101906f32fbeSmrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
1102006f32fbeSmrgm4_undefine([_defopt])
1102106f32fbeSmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
1102206f32fbeSmrgAC_MSG_CHECKING([whether to build unit test cases])
1102306f32fbeSmrgAC_MSG_RESULT([$enable_unit_tests])
1102406f32fbeSmrg]) # XORG_ENABLE_UNIT_TESTS
11025a253d6aeSmrg
1102657ee1794Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
1102757ee1794Smrg# ------------------------------------------------------
1102857ee1794Smrg# Minimum version: 1.17.0
1102957ee1794Smrg#
1103057ee1794Smrg# This macro enables a builder to enable/disable integration testing
1103157ee1794Smrg# It makes no assumption about the test cases' implementation
1103257ee1794Smrg# Test cases may or may not use Automake "Support for test suites"
1103357ee1794Smrg#
1103457ee1794Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
1103557ee1794Smrg# usually requires less dependencies and may be built and run under less
1103657ee1794Smrg# stringent environments than integration tests.
1103757ee1794Smrg#
1103857ee1794Smrg# Interface to module:
1103957ee1794Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
1104057ee1794Smrg# enable_integration_tests:   used in configure.ac for additional configuration
1104157ee1794Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
1104257ee1794Smrg#                             'no' user instructs the module not to build tests
1104357ee1794Smrg# parm1:                      specify the default value, yes or no.
1104457ee1794Smrg#
1104557ee1794SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
1104657ee1794SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
1104757ee1794Smrgm4_define([_defopt], m4_default([$1], [auto]))
1104857ee1794SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
1104957ee1794Smrg	[Enable building integration test cases (default: ]_defopt[)]),
1105057ee1794Smrg	[enable_integration_tests=$enableval],
1105157ee1794Smrg	[enable_integration_tests=]_defopt)
1105257ee1794Smrgm4_undefine([_defopt])
1105357ee1794SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
1105457ee1794Smrg	[test "x$enable_integration_tests" != xno])
1105557ee1794SmrgAC_MSG_CHECKING([whether to build unit test cases])
1105657ee1794SmrgAC_MSG_RESULT([$enable_integration_tests])
1105757ee1794Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
1105857ee1794Smrg
1105906f32fbeSmrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
1106006f32fbeSmrg# ----------------------------------------
1106106f32fbeSmrg# Minimum version: 1.13.0
1106206f32fbeSmrg#
1106306f32fbeSmrg# GLib is a library which provides advanced data structures and functions.
1106406f32fbeSmrg# This macro enables a module to test for the presence of Glib.
1106506f32fbeSmrg#
1106606f32fbeSmrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
1106706f32fbeSmrg# Otherwise the value of $enable_unit_tests is blank.
1106806f32fbeSmrg#
1106957ee1794Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
1107057ee1794Smrg# test support usually requires less dependencies and may be built and run under
1107157ee1794Smrg# less stringent environments than integration tests.
1107257ee1794Smrg#
1107306f32fbeSmrg# Interface to module:
1107406f32fbeSmrg# HAVE_GLIB: used in makefiles to conditionally build targets
1107506f32fbeSmrg# with_glib: used in configure.ac to know if GLib has been found
1107606f32fbeSmrg# --with-glib:	'yes' user instructs the module to use glib
1107706f32fbeSmrg#		'no' user instructs the module not to use glib
1107806f32fbeSmrg#
1107906f32fbeSmrgAC_DEFUN([XORG_WITH_GLIB],[
1108006f32fbeSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
1108106f32fbeSmrgm4_define([_defopt], m4_default([$2], [auto]))
1108206f32fbeSmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
1108306f32fbeSmrg	[Use GLib library for unit testing (default: ]_defopt[)]),
1108406f32fbeSmrg	[with_glib=$withval], [with_glib=]_defopt)
1108506f32fbeSmrgm4_undefine([_defopt])
11086a253d6aeSmrg
1108706f32fbeSmrghave_glib=no
1108806f32fbeSmrg# Do not probe GLib if user explicitly disabled unit testing
1108906f32fbeSmrgif test "x$enable_unit_tests" != x"no"; then
1109006f32fbeSmrg  # Do not probe GLib if user explicitly disabled it
1109106f32fbeSmrg  if test "x$with_glib" != x"no"; then
1109206f32fbeSmrg    m4_ifval(
1109306f32fbeSmrg      [$1],
1109406f32fbeSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
1109506f32fbeSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
1109606f32fbeSmrg    )
1109706f32fbeSmrg  fi
1109806f32fbeSmrgfi
11099a253d6aeSmrg
1110006f32fbeSmrg# Not having GLib when unit testing has been explicitly requested is an error
1110106f32fbeSmrgif test "x$enable_unit_tests" = x"yes"; then
1110206f32fbeSmrg  if test "x$have_glib" = x"no"; then
1110306f32fbeSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1110406f32fbeSmrg  fi
1110506f32fbeSmrgfi
11106a253d6aeSmrg
1110706f32fbeSmrg# Having unit testing disabled when GLib has been explicitly requested is an error
1110806f32fbeSmrgif test "x$enable_unit_tests" = x"no"; then
1110906f32fbeSmrg  if test "x$with_glib" = x"yes"; then
1111006f32fbeSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1111106f32fbeSmrg  fi
1111206f32fbeSmrgfi
11113a253d6aeSmrg
1111406f32fbeSmrg# Not having GLib when it has been explicitly requested is an error
1111506f32fbeSmrgif test "x$with_glib" = x"yes"; then
1111606f32fbeSmrg  if test "x$have_glib" = x"no"; then
1111706f32fbeSmrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
1111806f32fbeSmrg  fi
1111906f32fbeSmrgfi
11120a253d6aeSmrg
1112106f32fbeSmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
1112206f32fbeSmrg]) # XORG_WITH_GLIB
11123a253d6aeSmrg
1112406f32fbeSmrg# XORG_LD_WRAP([required|optional])
1112506f32fbeSmrg# ---------------------------------
1112606f32fbeSmrg# Minimum version: 1.13.0
1112706f32fbeSmrg#
1112806f32fbeSmrg# Check if linker supports -wrap, passed via compiler flags
1112906f32fbeSmrg#
1113006f32fbeSmrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
1113106f32fbeSmrg# Otherwise the value of $enable_unit_tests is blank.
1113206f32fbeSmrg#
1113306f32fbeSmrg# Argument added in 1.16.0 - default is "required", to match existing behavior
1113406f32fbeSmrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
1113506f32fbeSmrg# available, an argument of "optional" allows use when some unit tests require
1113606f32fbeSmrg# ld -wrap and others do not.
1113706f32fbeSmrg#
1113806f32fbeSmrgAC_DEFUN([XORG_LD_WRAP],[
1113906f32fbeSmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
1114006f32fbeSmrg    [AC_LANG_PROGRAM([#include <stdlib.h>
1114106f32fbeSmrg                      void __wrap_exit(int status) { return; }],
1114206f32fbeSmrg                     [exit(0);])])
1114306f32fbeSmrg# Not having ld wrap when unit testing has been explicitly requested is an error
1114406f32fbeSmrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
1114506f32fbeSmrg  if test "x$have_ld_wrap" = x"no"; then
1114606f32fbeSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
1114706f32fbeSmrg  fi
1114806f32fbeSmrgfi
1114906f32fbeSmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
1115006f32fbeSmrg#
1115106f32fbeSmrg]) # XORG_LD_WRAP
11152a253d6aeSmrg
1115306f32fbeSmrg# XORG_CHECK_LINKER_FLAGS
1115406f32fbeSmrg# -----------------------
1115506f32fbeSmrg# SYNOPSIS
1115606f32fbeSmrg#
1115706f32fbeSmrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
1115806f32fbeSmrg#
1115906f32fbeSmrg# DESCRIPTION
1116006f32fbeSmrg#
1116106f32fbeSmrg#   Check whether the given linker FLAGS work with the current language's
1116206f32fbeSmrg#   linker, or whether they give an error.
1116306f32fbeSmrg#
1116406f32fbeSmrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
1116506f32fbeSmrg#   success/failure.
1116606f32fbeSmrg#
1116706f32fbeSmrg#   PROGRAM-SOURCE is the program source to link with, if needed
1116806f32fbeSmrg#
1116906f32fbeSmrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
1117006f32fbeSmrg#
1117106f32fbeSmrg# LICENSE
1117206f32fbeSmrg#
1117306f32fbeSmrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
1117406f32fbeSmrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
1117506f32fbeSmrg#   Copyright (c) 2009 Matteo Frigo
1117606f32fbeSmrg#
1117706f32fbeSmrg#   This program is free software: you can redistribute it and/or modify it
1117806f32fbeSmrg#   under the terms of the GNU General Public License as published by the
1117906f32fbeSmrg#   Free Software Foundation, either version 3 of the License, or (at your
1118006f32fbeSmrg#   option) any later version.
1118106f32fbeSmrg#
1118206f32fbeSmrg#   This program is distributed in the hope that it will be useful, but
1118306f32fbeSmrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
1118406f32fbeSmrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
1118506f32fbeSmrg#   Public License for more details.
1118606f32fbeSmrg#
1118706f32fbeSmrg#   You should have received a copy of the GNU General Public License along
1118806f32fbeSmrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
1118906f32fbeSmrg#
1119006f32fbeSmrg#   As a special exception, the respective Autoconf Macro's copyright owner
1119106f32fbeSmrg#   gives unlimited permission to copy, distribute and modify the configure
1119206f32fbeSmrg#   scripts that are the output of Autoconf when processing the Macro. You
1119306f32fbeSmrg#   need not follow the terms of the GNU General Public License when using
1119406f32fbeSmrg#   or distributing such scripts, even though portions of the text of the
1119506f32fbeSmrg#   Macro appear in them. The GNU General Public License (GPL) does govern
1119606f32fbeSmrg#   all other use of the material that constitutes the Autoconf Macro.
1119706f32fbeSmrg#
1119806f32fbeSmrg#   This special exception to the GPL applies to versions of the Autoconf
1119906f32fbeSmrg#   Macro released by the Autoconf Archive. When you make and distribute a
1120006f32fbeSmrg#   modified version of the Autoconf Macro, you may extend this special
1120106f32fbeSmrg#   exception to the GPL to apply to your modified version as well.#
1120206f32fbeSmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
1120306f32fbeSmrg[AC_MSG_CHECKING([whether the linker accepts $1])
1120406f32fbeSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
1120506f32fbeSmrgAS_LITERAL_IF([$1],
1120606f32fbeSmrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
1120706f32fbeSmrg      ax_save_FLAGS=$LDFLAGS
1120806f32fbeSmrg      LDFLAGS="$1"
1120906f32fbeSmrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
1121006f32fbeSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1121106f32fbeSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1121206f32fbeSmrg      LDFLAGS=$ax_save_FLAGS])],
1121306f32fbeSmrg  [ax_save_FLAGS=$LDFLAGS
1121406f32fbeSmrg   LDFLAGS="$1"
1121506f32fbeSmrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
1121606f32fbeSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1121706f32fbeSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1121806f32fbeSmrg   LDFLAGS=$ax_save_FLAGS])
1121906f32fbeSmrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
1122006f32fbeSmrgAC_MSG_RESULT($xorg_check_linker_flags)
1122106f32fbeSmrgif test "x$xorg_check_linker_flags" = xyes; then
1122206f32fbeSmrg	m4_default([$2], :)
1122306f32fbeSmrgelse
1122406f32fbeSmrg	m4_default([$3], :)
1122506f32fbeSmrgfi
1122606f32fbeSmrg]) # XORG_CHECK_LINKER_FLAGS
11227a253d6aeSmrg
1122806f32fbeSmrg# XORG_MEMORY_CHECK_FLAGS
1122906f32fbeSmrg# -----------------------
1123006f32fbeSmrg# Minimum version: 1.16.0
1123106f32fbeSmrg#
1123206f32fbeSmrg# This macro attempts to find appropriate memory checking functionality
1123306f32fbeSmrg# for various platforms which unit testing code may use to catch various
1123406f32fbeSmrg# forms of memory allocation and access errors in testing.
1123506f32fbeSmrg#
1123606f32fbeSmrg# Interface to module:
1123706f32fbeSmrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
1123806f32fbeSmrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
1123906f32fbeSmrg#
1124006f32fbeSmrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
1124106f32fbeSmrg#
1124206f32fbeSmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
11243a253d6aeSmrg
1124406f32fbeSmrgAC_REQUIRE([AC_CANONICAL_HOST])
1124506f32fbeSmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
1124606f32fbeSmrg           [Environment variables to enable memory checking in tests])
11247a253d6aeSmrg
1124806f32fbeSmrg# Check for different types of support on different platforms
1124906f32fbeSmrgcase $host_os in
1125006f32fbeSmrg    solaris*)
1125106f32fbeSmrg        AC_CHECK_LIB([umem], [umem_alloc],
1125206f32fbeSmrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
1125306f32fbeSmrg        ;;
1125406f32fbeSmrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
1125506f32fbeSmrg        # both directly and inverted, so should not be 0 or 255.
1125606f32fbeSmrg        malloc_debug_env='MALLOC_PERTURB_=15'
1125706f32fbeSmrg        ;;
1125806f32fbeSmrg    darwin*)
1125906f32fbeSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
1126006f32fbeSmrg        ;;
1126106f32fbeSmrg    *bsd*)
1126206f32fbeSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
1126306f32fbeSmrg        ;;
1126406f32fbeSmrgesac
11265ea133fd7Smrg
1126606f32fbeSmrg# User supplied flags override default flags
1126706f32fbeSmrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
1126806f32fbeSmrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
1126906f32fbeSmrgfi
11270a253d6aeSmrg
1127106f32fbeSmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
1127206f32fbeSmrg]) # XORG_WITH_LINT
11273a253d6aeSmrg
1127406f32fbeSmrg# XORG_CHECK_MALLOC_ZERO
1127506f32fbeSmrg# ----------------------
1127606f32fbeSmrg# Minimum version: 1.0.0
1127725b89263Smrg#
1127806f32fbeSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1127906f32fbeSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1128006f32fbeSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1128106f32fbeSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1128206f32fbeSmrgAC_ARG_ENABLE(malloc0returnsnull,
1128306f32fbeSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1128406f32fbeSmrg		       [malloc(0) returns NULL (default: auto)]),
1128506f32fbeSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1128606f32fbeSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
11287a253d6aeSmrg
1128806f32fbeSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1128906f32fbeSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1129031637056SmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
1129131637056Smrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
1129206f32fbeSmrg#include <stdlib.h>
1129306f32fbeSmrg],[
1129406f32fbeSmrg    char *m0, *r0, *c0, *p;
1129506f32fbeSmrg    m0 = malloc(0);
1129606f32fbeSmrg    p = malloc(10);
1129706f32fbeSmrg    r0 = realloc(p,0);
1129806f32fbeSmrg    c0 = calloc(0,10);
1129906f32fbeSmrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
1130006f32fbeSmrg])],
1130131637056Smrg		[xorg_cv_malloc0_returns_null=yes],
1130231637056Smrg		[xorg_cv_malloc0_returns_null=no])])
1130331637056SmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
1130406f32fbeSmrgfi
1130506f32fbeSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
11306a253d6aeSmrg
1130706f32fbeSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1130806f32fbeSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1130906f32fbeSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1131006f32fbeSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1131106f32fbeSmrgelse
1131206f32fbeSmrg	MALLOC_ZERO_CFLAGS=""
1131306f32fbeSmrg	XMALLOC_ZERO_CFLAGS=""
1131406f32fbeSmrg	XTMALLOC_ZERO_CFLAGS=""
1131506f32fbeSmrgfi
11316a253d6aeSmrg
1131706f32fbeSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1131806f32fbeSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1131906f32fbeSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1132006f32fbeSmrg]) # XORG_CHECK_MALLOC_ZERO
11321a253d6aeSmrg
1132206f32fbeSmrg# XORG_WITH_LINT()
1132306f32fbeSmrg# ----------------
1132406f32fbeSmrg# Minimum version: 1.1.0
1132506f32fbeSmrg#
1132606f32fbeSmrg# This macro enables the use of a tool that flags some suspicious and
1132706f32fbeSmrg# non-portable constructs (likely to be bugs) in C language source code.
1132806f32fbeSmrg# It will attempt to locate the tool and use appropriate options.
1132906f32fbeSmrg# There are various lint type tools on different platforms.
1133006f32fbeSmrg#
1133106f32fbeSmrg# Interface to module:
1133206f32fbeSmrg# LINT:		returns the path to the tool found on the platform
1133306f32fbeSmrg#		or the value set to LINT on the configure cmd line
1133406f32fbeSmrg#		also an Automake conditional
1133506f32fbeSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
1133606f32fbeSmrg#
1133706f32fbeSmrg# --with-lint:	'yes' user instructs the module to use lint
1133806f32fbeSmrg#		'no' user instructs the module not to use lint (default)
1133906f32fbeSmrg#
1134006f32fbeSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1134106f32fbeSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
1134206f32fbeSmrg#
1134306f32fbeSmrgAC_DEFUN([XORG_WITH_LINT],[
11344a253d6aeSmrg
1134506f32fbeSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
1134606f32fbeSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1134706f32fbeSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1134806f32fbeSmrg		[Use a lint-style source code checker (default: disabled)])],
1134906f32fbeSmrg		[use_lint=$withval], [use_lint=no])
11350a253d6aeSmrg
1135106f32fbeSmrg# Obtain platform specific info like program name and options
1135206f32fbeSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
1135306f32fbeSmrgcase $host_os in
1135406f32fbeSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
1135506f32fbeSmrg	lint_name=splint
1135606f32fbeSmrg	lint_options="-badflag"
1135706f32fbeSmrg	;;
1135806f32fbeSmrg  *freebsd* | *netbsd*)
1135906f32fbeSmrg	lint_name=lint
1136006f32fbeSmrg	lint_options="-u -b"
1136106f32fbeSmrg	;;
1136206f32fbeSmrg  *solaris*)
1136306f32fbeSmrg	lint_name=lint
1136406f32fbeSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1136506f32fbeSmrg	;;
1136606f32fbeSmrgesac
11367a253d6aeSmrg
1136806f32fbeSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
1136906f32fbeSmrgif test "x$use_lint" = x"yes" ; then
1137006f32fbeSmrg   AC_PATH_PROG([LINT], [$lint_name])
1137106f32fbeSmrg   if test "x$LINT" = "x"; then
1137206f32fbeSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
1137306f32fbeSmrg   fi
1137406f32fbeSmrgelif test "x$use_lint" = x"no" ; then
1137506f32fbeSmrg   if test "x$LINT" != "x"; then
1137606f32fbeSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
1137706f32fbeSmrg   fi
1137806f32fbeSmrgelse
1137906f32fbeSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
1138006f32fbeSmrgfi
11381a253d6aeSmrg
1138206f32fbeSmrg# User supplied flags override default flags
1138306f32fbeSmrgif test "x$LINT_FLAGS" != "x"; then
1138406f32fbeSmrg   lint_options=$LINT_FLAGS
1138506f32fbeSmrgfi
11386a253d6aeSmrg
1138706f32fbeSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
1138806f32fbeSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
11389a253d6aeSmrg
1139006f32fbeSmrg]) # XORG_WITH_LINT
11391ea133fd7Smrg
1139206f32fbeSmrg# XORG_LINT_LIBRARY(LIBNAME)
1139306f32fbeSmrg# --------------------------
1139406f32fbeSmrg# Minimum version: 1.1.0
1139506f32fbeSmrg#
1139606f32fbeSmrg# Sets up flags for building lint libraries for checking programs that call
1139706f32fbeSmrg# functions in the library.
1139806f32fbeSmrg#
1139906f32fbeSmrg# Interface to module:
1140006f32fbeSmrg# LINTLIB		- Automake variable with the name of lint library file to make
1140106f32fbeSmrg# MAKE_LINT_LIB		- Automake conditional
1140206f32fbeSmrg#
1140306f32fbeSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
1140406f32fbeSmrg#			  - 'no' user instructs the module not to create a lint library (default)
11405ea133fd7Smrg
1140606f32fbeSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
1140706f32fbeSmrgAC_REQUIRE([XORG_WITH_LINT])
1140806f32fbeSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1140906f32fbeSmrg	[Create lint library (default: disabled)])],
1141006f32fbeSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
11411a253d6aeSmrg
1141206f32fbeSmrgif test "x$make_lint_lib" = x"yes" ; then
1141306f32fbeSmrg   LINTLIB=llib-l$1.ln
1141406f32fbeSmrg   if test "x$LINT" = "x"; then
1141506f32fbeSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
1141606f32fbeSmrg   fi
1141706f32fbeSmrgelif test "x$make_lint_lib" != x"no" ; then
1141806f32fbeSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
1141906f32fbeSmrgfi
1142025b89263Smrg
1142106f32fbeSmrgAC_SUBST(LINTLIB)
1142206f32fbeSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1142325b89263Smrg
1142406f32fbeSmrg]) # XORG_LINT_LIBRARY
1142506f32fbeSmrg
1142606f32fbeSmrg# XORG_COMPILER_BRAND
1142706f32fbeSmrg# -------------------
1142806f32fbeSmrg# Minimum version: 1.14.0
1142906f32fbeSmrg#
1143006f32fbeSmrg# Checks for various brands of compilers and sets flags as appropriate:
1143106f32fbeSmrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
1143206f32fbeSmrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
1143306f32fbeSmrg#   clang compiler - sets CLANGCC to "yes"
1143406f32fbeSmrg#   Intel compiler - sets INTELCC to "yes"
1143506f32fbeSmrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
1143606f32fbeSmrg#
1143706f32fbeSmrgAC_DEFUN([XORG_COMPILER_BRAND], [
1143806f32fbeSmrgAC_LANG_CASE(
1143906f32fbeSmrg	[C], [
1144006f32fbeSmrg		AC_REQUIRE([AC_PROG_CC_C99])
1144106f32fbeSmrg	],
1144206f32fbeSmrg	[C++], [
1144306f32fbeSmrg		AC_REQUIRE([AC_PROG_CXX])
1144406f32fbeSmrg	]
1144506f32fbeSmrg)
1144606f32fbeSmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
1144706f32fbeSmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1144806f32fbeSmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1144906f32fbeSmrg]) # XORG_COMPILER_BRAND
1145025b89263Smrg
1145106f32fbeSmrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
1145206f32fbeSmrg# ---------------
1145306f32fbeSmrg# Minimum version: 1.16.0
1145406f32fbeSmrg#
1145506f32fbeSmrg# Test if the compiler works when passed the given flag as a command line argument.
1145606f32fbeSmrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
1145706f32fbeSmrg# next flag in the list until there are no more options.
1145806f32fbeSmrg#
1145906f32fbeSmrg# Note that this does not guarantee that the compiler supports the flag as some
1146006f32fbeSmrg# compilers will simply ignore arguments that they do not understand, but we do
1146106f32fbeSmrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
1146206f32fbeSmrg# -Werror=unused-command-line-argument
1146306f32fbeSmrg#
1146406f32fbeSmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
1146506f32fbeSmrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
1146606f32fbeSmrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
1146706f32fbeSmrg
1146806f32fbeSmrgAC_LANG_COMPILER_REQUIRE
1146906f32fbeSmrg
1147006f32fbeSmrgAC_LANG_CASE(
1147106f32fbeSmrg	[C], [
1147206f32fbeSmrg		AC_REQUIRE([AC_PROG_CC_C99])
1147306f32fbeSmrg		define([PREFIX], [C])
1147457ee1794Smrg		define([CACHE_PREFIX], [cc])
1147557ee1794Smrg		define([COMPILER], [$CC])
1147606f32fbeSmrg	],
1147706f32fbeSmrg	[C++], [
1147806f32fbeSmrg		define([PREFIX], [CXX])
1147957ee1794Smrg		define([CACHE_PREFIX], [cxx])
1148057ee1794Smrg		define([COMPILER], [$CXX])
1148106f32fbeSmrg	]
1148206f32fbeSmrg)
11483a253d6aeSmrg
1148406f32fbeSmrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
1148506f32fbeSmrg
1148657ee1794Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
1148706f32fbeSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1148857ee1794Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
1148957ee1794Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
1149006f32fbeSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1149157ee1794Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
1149257ee1794Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
1149357ee1794Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
1149406f32fbeSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1149506f32fbeSmrgfi
11496ea133fd7Smrg
1149757ee1794Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
1149857ee1794Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
1149906f32fbeSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1150006f32fbeSmrg	fi
1150106f32fbeSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1150257ee1794Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
1150357ee1794Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
1150406f32fbeSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1150557ee1794Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
1150657ee1794Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
1150757ee1794Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
1150806f32fbeSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1150906f32fbeSmrgfi
11510ea133fd7Smrg
1151106f32fbeSmrgfound="no"
1151206f32fbeSmrgm4_foreach([flag], m4_cdr($@), [
1151306f32fbeSmrg	if test $found = "no" ; then
1151431637056Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
1151506f32fbeSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1151606f32fbeSmrg		fi
1151706f32fbeSmrg
1151831637056Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
1151906f32fbeSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1152006f32fbeSmrg		fi
1152106f32fbeSmrg
1152206f32fbeSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
1152306f32fbeSmrg
1152406f32fbeSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
1152557ee1794Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
1152657ee1794Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
1152757ee1794Smrg		AC_CACHE_VAL($cacheid,
1152806f32fbeSmrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
1152957ee1794Smrg					     [eval $cacheid=yes],
1153057ee1794Smrg					     [eval $cacheid=no])])
1153106f32fbeSmrg
1153206f32fbeSmrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1153306f32fbeSmrg
1153457ee1794Smrg		eval supported=\$$cacheid
1153506f32fbeSmrg		AC_MSG_RESULT([$supported])
1153606f32fbeSmrg		if test "$supported" = "yes" ; then
1153706f32fbeSmrg			$1="$$1 ]flag["
1153806f32fbeSmrg			found="yes"
1153906f32fbeSmrg		fi
1154006f32fbeSmrg	fi
1154106f32fbeSmrg])
1154206f32fbeSmrg]) # XORG_TESTSET_CFLAG
11543a253d6aeSmrg
1154406f32fbeSmrg# XORG_COMPILER_FLAGS
1154506f32fbeSmrg# ---------------
1154606f32fbeSmrg# Minimum version: 1.16.0
1154706f32fbeSmrg#
1154806f32fbeSmrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
1154906f32fbeSmrg# arguments supported by the selected compiler which do NOT alter the generated
1155006f32fbeSmrg# code.  These arguments will cause the compiler to print various warnings
1155106f32fbeSmrg# during compilation AND turn a conservative set of warnings into errors.
1155206f32fbeSmrg#
1155306f32fbeSmrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
1155406f32fbeSmrg# future versions of util-macros as options are added to new compilers.
1155506f32fbeSmrg#
1155606f32fbeSmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
1155706f32fbeSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
1155806f32fbeSmrg
1155906f32fbeSmrgAC_ARG_ENABLE(selective-werror,
1156006f32fbeSmrg              AS_HELP_STRING([--disable-selective-werror],
1156106f32fbeSmrg                             [Turn off selective compiler errors. (default: enabled)]),
1156206f32fbeSmrg              [SELECTIVE_WERROR=$enableval],
1156306f32fbeSmrg              [SELECTIVE_WERROR=yes])
1156406f32fbeSmrg
1156506f32fbeSmrgAC_LANG_CASE(
1156606f32fbeSmrg        [C], [
1156706f32fbeSmrg                define([PREFIX], [C])
1156806f32fbeSmrg        ],
1156906f32fbeSmrg        [C++], [
1157006f32fbeSmrg                define([PREFIX], [CXX])
1157106f32fbeSmrg        ]
1157206f32fbeSmrg)
1157306f32fbeSmrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
1157406f32fbeSmrgif test "x$SUNCC" = "xyes"; then
1157506f32fbeSmrg    [BASE_]PREFIX[FLAGS]="-v"
1157606f32fbeSmrgelse
1157706f32fbeSmrg    [BASE_]PREFIX[FLAGS]=""
1157806f32fbeSmrgfi
11579a253d6aeSmrg
1158006f32fbeSmrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
1158106f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
1158206f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
1158306f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
1158406f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
1158506f32fbeSmrg
1158606f32fbeSmrgAC_LANG_CASE(
1158706f32fbeSmrg	[C], [
1158806f32fbeSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
1158906f32fbeSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
1159006f32fbeSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
1159106f32fbeSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
1159231637056Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
1159306f32fbeSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
1159406f32fbeSmrg	]
1159506f32fbeSmrg)
11596a253d6aeSmrg
1159706f32fbeSmrg# This chunk adds additional warnings that could catch undesired effects.
1159806f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
1159906f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
1160006f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
1160106f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
1160206f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
1160306f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
1160431637056SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
1160506f32fbeSmrg
1160606f32fbeSmrg# These are currently disabled because they are noisy.  They will be enabled
1160706f32fbeSmrg# in the future once the codebase is sufficiently modernized to silence
1160806f32fbeSmrg# them.  For now, I don't want them to drown out the other warnings.
1160906f32fbeSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
1161006f32fbeSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
1161131637056Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
1161206f32fbeSmrg
1161306f32fbeSmrg# Turn some warnings into errors, so we don't accidently get successful builds
1161406f32fbeSmrg# when there are problems that should be fixed.
1161506f32fbeSmrg
1161606f32fbeSmrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
1161706f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
1161806f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
1161906f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
1162006f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
1162106f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
1162206f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
1162306f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
1162406f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
1162506f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
1162606f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
1162706f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
1162806f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
1162906f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
1163006f32fbeSmrgelse
1163106f32fbeSmrgAC_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])
1163206f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
1163306f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
1163406f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
1163506f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
1163606f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
1163706f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
1163806f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
1163906f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
1164006f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
1164106f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
1164206f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
1164306f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
1164406f32fbeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
1164506f32fbeSmrgfi
1164625b89263Smrg
1164706f32fbeSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
1164806f32fbeSmrg]) # XORG_COMPILER_FLAGS
1164925b89263Smrg
1165006f32fbeSmrg# XORG_CWARNFLAGS
1165106f32fbeSmrg# ---------------
1165206f32fbeSmrg# Minimum version: 1.2.0
1165306f32fbeSmrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
11654ea133fd7Smrg#
1165506f32fbeSmrg# Defines CWARNFLAGS to enable C compiler warnings.
11656ea133fd7Smrg#
1165706f32fbeSmrg# This function is deprecated because it defines -fno-strict-aliasing
1165806f32fbeSmrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
1165906f32fbeSmrg# is needed, then it should be added explicitly in the module when
1166006f32fbeSmrg# it is updated to use BASE_CFLAGS.
1166106f32fbeSmrg#
1166206f32fbeSmrgAC_DEFUN([XORG_CWARNFLAGS], [
1166306f32fbeSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
1166406f32fbeSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
1166506f32fbeSmrgAC_LANG_CASE(
1166606f32fbeSmrg	[C], [
1166706f32fbeSmrg		CWARNFLAGS="$BASE_CFLAGS"
1166806f32fbeSmrg		if  test "x$GCC" = xyes ; then
1166906f32fbeSmrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
1167006f32fbeSmrg		fi
1167106f32fbeSmrg		AC_SUBST(CWARNFLAGS)
1167206f32fbeSmrg	]
1167306f32fbeSmrg)
1167406f32fbeSmrg]) # XORG_CWARNFLAGS
11675a253d6aeSmrg
1167606f32fbeSmrg# XORG_STRICT_OPTION
1167706f32fbeSmrg# -----------------------
1167806f32fbeSmrg# Minimum version: 1.3.0
1167906f32fbeSmrg#
1168006f32fbeSmrg# Add configure option to enable strict compilation flags, such as treating
1168106f32fbeSmrg# warnings as fatal errors.
1168206f32fbeSmrg# If --enable-strict-compilation is passed to configure, adds strict flags to
1168306f32fbeSmrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
1168406f32fbeSmrg#
1168506f32fbeSmrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
1168606f32fbeSmrg# when strict compilation is unconditionally desired.
1168706f32fbeSmrgAC_DEFUN([XORG_STRICT_OPTION], [
1168806f32fbeSmrgAC_REQUIRE([XORG_CWARNFLAGS])
1168906f32fbeSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
11690ea133fd7Smrg
1169106f32fbeSmrgAC_ARG_ENABLE(strict-compilation,
1169206f32fbeSmrg			  AS_HELP_STRING([--enable-strict-compilation],
1169306f32fbeSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
1169406f32fbeSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
11695a253d6aeSmrg
1169606f32fbeSmrgAC_LANG_CASE(
1169706f32fbeSmrg        [C], [
1169806f32fbeSmrg                define([PREFIX], [C])
1169906f32fbeSmrg        ],
1170006f32fbeSmrg        [C++], [
1170106f32fbeSmrg                define([PREFIX], [CXX])
1170206f32fbeSmrg        ]
1170306f32fbeSmrg)
1170425b89263Smrg
1170506f32fbeSmrg[STRICT_]PREFIX[FLAGS]=""
1170606f32fbeSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
1170706f32fbeSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
1170825b89263Smrg
1170906f32fbeSmrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
1171006f32fbeSmrg# activate it with -Werror, so we add it here explicitly.
1171106f32fbeSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
11712a253d6aeSmrg
1171306f32fbeSmrgif test "x$STRICT_COMPILE" = "xyes"; then
1171406f32fbeSmrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
1171506f32fbeSmrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
1171606f32fbeSmrgfi
1171706f32fbeSmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
1171806f32fbeSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
1171906f32fbeSmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
1172006f32fbeSmrg]) # XORG_STRICT_OPTION
11721a253d6aeSmrg
1172206f32fbeSmrg# XORG_DEFAULT_OPTIONS
1172306f32fbeSmrg# --------------------
1172406f32fbeSmrg# Minimum version: 1.3.0
11725ea133fd7Smrg#
1172606f32fbeSmrg# Defines default options for X.Org modules.
11727ea133fd7Smrg#
1172806f32fbeSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
1172906f32fbeSmrgAC_REQUIRE([AC_PROG_INSTALL])
1173006f32fbeSmrgXORG_COMPILER_FLAGS
1173106f32fbeSmrgXORG_CWARNFLAGS
1173206f32fbeSmrgXORG_STRICT_OPTION
1173306f32fbeSmrgXORG_RELEASE_VERSION
1173406f32fbeSmrgXORG_CHANGELOG
1173506f32fbeSmrgXORG_INSTALL
1173606f32fbeSmrgXORG_MANPAGE_SECTIONS
1173706f32fbeSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
1173806f32fbeSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
1173906f32fbeSmrg]) # XORG_DEFAULT_OPTIONS
1174006f32fbeSmrg
1174106f32fbeSmrg# XORG_INSTALL()
1174206f32fbeSmrg# ----------------
1174306f32fbeSmrg# Minimum version: 1.4.0
11744ea133fd7Smrg#
1174506f32fbeSmrg# Defines the variable INSTALL_CMD as the command to copy
1174606f32fbeSmrg# INSTALL from $prefix/share/util-macros.
1174725b89263Smrg#
1174806f32fbeSmrgAC_DEFUN([XORG_INSTALL], [
1174906f32fbeSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
1175006f32fbeSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
1175106f32fbeSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
1175206f32fbeSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
1175306f32fbeSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
1175406f32fbeSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
1175506f32fbeSmrgAC_SUBST([INSTALL_CMD])
1175606f32fbeSmrg]) # XORG_INSTALL
1175706f32fbeSmrgdnl Copyright 2005 Red Hat, Inc
1175806f32fbeSmrgdnl
1175906f32fbeSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1176006f32fbeSmrgdnl documentation for any purpose is hereby granted without fee, provided that
1176106f32fbeSmrgdnl the above copyright notice appear in all copies and that both that
1176206f32fbeSmrgdnl copyright notice and this permission notice appear in supporting
1176306f32fbeSmrgdnl documentation.
1176406f32fbeSmrgdnl
1176506f32fbeSmrgdnl The above copyright notice and this permission notice shall be included
1176606f32fbeSmrgdnl in all copies or substantial portions of the Software.
1176706f32fbeSmrgdnl
1176806f32fbeSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1176906f32fbeSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1177006f32fbeSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1177106f32fbeSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1177206f32fbeSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1177306f32fbeSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1177406f32fbeSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
1177506f32fbeSmrgdnl
1177606f32fbeSmrgdnl Except as contained in this notice, the name of the copyright holders shall
1177706f32fbeSmrgdnl not be used in advertising or otherwise to promote the sale, use or
1177806f32fbeSmrgdnl other dealings in this Software without prior written authorization
1177906f32fbeSmrgdnl from the copyright holders.
1178006f32fbeSmrgdnl
1178125b89263Smrg
1178206f32fbeSmrg# XORG_RELEASE_VERSION
1178306f32fbeSmrg# --------------------
1178406f32fbeSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1178531637056Smrg
1178606f32fbeSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1178706f32fbeSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1178806f32fbeSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1178906f32fbeSmrg		[Major version of this package])
1179006f32fbeSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1179106f32fbeSmrg	if test "x$PVM" = "x"; then
1179206f32fbeSmrg		PVM="0"
1179306f32fbeSmrg	fi
1179406f32fbeSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1179506f32fbeSmrg		[$PVM],
1179606f32fbeSmrg		[Minor version of this package])
1179706f32fbeSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1179806f32fbeSmrg	if test "x$PVP" = "x"; then
1179906f32fbeSmrg		PVP="0"
1180006f32fbeSmrg	fi
1180106f32fbeSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1180206f32fbeSmrg		[$PVP],
1180306f32fbeSmrg		[Patch version of this package])
1180406f32fbeSmrg])
1180525b89263Smrg
1180606f32fbeSmrg# XORG_CHANGELOG()
1180706f32fbeSmrg# ----------------
1180806f32fbeSmrg# Minimum version: 1.2.0
1180906f32fbeSmrg#
1181006f32fbeSmrg# Defines the variable CHANGELOG_CMD as the command to generate
1181106f32fbeSmrg# ChangeLog from git.
1181206f32fbeSmrg#
1181306f32fbeSmrg#
1181406f32fbeSmrgAC_DEFUN([XORG_CHANGELOG], [
1181506f32fbeSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
1181606f32fbeSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
1181706f32fbeSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
1181806f32fbeSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
1181906f32fbeSmrgAC_SUBST([CHANGELOG_CMD])
1182006f32fbeSmrg]) # XORG_CHANGELOG
11821a253d6aeSmrg
11822