aclocal.m4 revision b242714c
1b242714cSmrg# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
28bd17e5fSmrg
38bd17e5fSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
4b042e37fSmrg
5b042e37fSmrg# This file is free software; the Free Software Foundation
6b042e37fSmrg# gives unlimited permission to copy and/or distribute it,
7b042e37fSmrg# with or without modifications, as long as this notice is preserved.
8b042e37fSmrg
9b042e37fSmrg# This program is distributed in the hope that it will be useful,
10b042e37fSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11b042e37fSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12b042e37fSmrg# PARTICULAR PURPOSE.
13b042e37fSmrg
148bd17e5fSmrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
158c4a8e55Smrgm4_ifndef([AC_AUTOCONF_VERSION],
168c4a8e55Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1767594505Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
1867594505Smrg[m4_warning([this file was generated for autoconf 2.69.
198c4a8e55SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
208c4a8e55SmrgIf you have problems, you may need to regenerate the build system entirely.
218bd17e5fSmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22b042e37fSmrg
2367594505Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
24b042e37fSmrg#
2567594505Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
2667594505Smrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
2767594505Smrg#                 Foundation, Inc.
2867594505Smrg#   Written by Gordon Matzigkeit, 1996
29b042e37fSmrg#
3067594505Smrg# This file is free software; the Free Software Foundation gives
3167594505Smrg# unlimited permission to copy and/or distribute it, with or without
3267594505Smrg# modifications, as long as this notice is preserved.
338c4a8e55Smrg
3467594505Smrgm4_define([_LT_COPYING], [dnl
3567594505Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
3667594505Smrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
3767594505Smrg#                 Foundation, Inc.
3867594505Smrg#   Written by Gordon Matzigkeit, 1996
39b042e37fSmrg#
4067594505Smrg#   This file is part of GNU Libtool.
41b042e37fSmrg#
4267594505Smrg# GNU Libtool is free software; you can redistribute it and/or
4367594505Smrg# modify it under the terms of the GNU General Public License as
4467594505Smrg# published by the Free Software Foundation; either version 2 of
4567594505Smrg# the License, or (at your option) any later version.
46b042e37fSmrg#
4767594505Smrg# As a special exception to the GNU General Public License,
4867594505Smrg# if you distribute this file as part of a program or library that
4967594505Smrg# is built using GNU Libtool, you may include this file under the
5067594505Smrg# same distribution terms that you use for the rest of that program.
51b042e37fSmrg#
5267594505Smrg# GNU Libtool is distributed in the hope that it will be useful,
5367594505Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
5467594505Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5567594505Smrg# GNU General Public License for more details.
56b042e37fSmrg#
5767594505Smrg# You should have received a copy of the GNU General Public License
5867594505Smrg# along with GNU Libtool; see the file COPYING.  If not, a copy
5967594505Smrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
6067594505Smrg# obtained by writing to the Free Software Foundation, Inc.,
6167594505Smrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
620597fb56Smrg])
63b042e37fSmrg
6467594505Smrg# serial 57 LT_INIT
65b042e37fSmrg
66b042e37fSmrg
6767594505Smrg# LT_PREREQ(VERSION)
6867594505Smrg# ------------------
6967594505Smrg# Complain and exit if this libtool version is less that VERSION.
7067594505Smrgm4_defun([LT_PREREQ],
7167594505Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
7267594505Smrg       [m4_default([$3],
7367594505Smrg		   [m4_fatal([Libtool version $1 or higher is required],
7467594505Smrg		             63)])],
7567594505Smrg       [$2])])
76b042e37fSmrg
77b042e37fSmrg
7867594505Smrg# _LT_CHECK_BUILDDIR
7967594505Smrg# ------------------
8067594505Smrg# Complain if the absolute build directory name contains unusual characters
8167594505Smrgm4_defun([_LT_CHECK_BUILDDIR],
8267594505Smrg[case `pwd` in
8367594505Smrg  *\ * | *\	*)
8467594505Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
8567594505Smrgesac
8667594505Smrg])
87b042e37fSmrg
88b042e37fSmrg
8967594505Smrg# LT_INIT([OPTIONS])
9067594505Smrg# ------------------
9167594505SmrgAC_DEFUN([LT_INIT],
9267594505Smrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
9367594505SmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
9467594505SmrgAC_BEFORE([$0], [LT_LANG])dnl
9567594505SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
9667594505SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
9767594505Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
98b042e37fSmrg
9967594505Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
10067594505Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
10167594505Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
10267594505Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
10367594505Smrgdnl unless we require an AC_DEFUNed macro:
10467594505SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
10567594505SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
10667594505SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
10767594505SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
10867594505Smrgm4_require([_LT_PROG_LTMAIN])dnl
109b042e37fSmrg
11067594505Smrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
111b042e37fSmrg
11267594505Smrgdnl Parse OPTIONS
11367594505Smrg_LT_SET_OPTIONS([$0], [$1])
114b042e37fSmrg
11567594505Smrg# This can be used to rebuild libtool when needed
11667594505SmrgLIBTOOL_DEPS="$ltmain"
117b042e37fSmrg
11867594505Smrg# Always use our own libtool.
11967594505SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
12067594505SmrgAC_SUBST(LIBTOOL)dnl
121b042e37fSmrg
12267594505Smrg_LT_SETUP
123b042e37fSmrg
12467594505Smrg# Only expand once:
12567594505Smrgm4_define([LT_INIT])
12667594505Smrg])# LT_INIT
127b042e37fSmrg
12867594505Smrg# Old names:
12967594505SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
13067594505SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
13167594505Smrgdnl aclocal-1.4 backwards compatibility:
13267594505Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
13367594505Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
134b042e37fSmrg
135b042e37fSmrg
13667594505Smrg# _LT_CC_BASENAME(CC)
13767594505Smrg# -------------------
13867594505Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
13967594505Smrgm4_defun([_LT_CC_BASENAME],
14067594505Smrg[for cc_temp in $1""; do
14167594505Smrg  case $cc_temp in
14267594505Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
14367594505Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
14467594505Smrg    \-*) ;;
14567594505Smrg    *) break;;
14667594505Smrg  esac
14767594505Smrgdone
14867594505Smrgcc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
149706b6b52Smrg])
150b042e37fSmrg
151b042e37fSmrg
15267594505Smrg# _LT_FILEUTILS_DEFAULTS
15367594505Smrg# ----------------------
15467594505Smrg# It is okay to use these file commands and assume they have been set
15567594505Smrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
15667594505Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
15767594505Smrg[: ${CP="cp -f"}
15867594505Smrg: ${MV="mv -f"}
15967594505Smrg: ${RM="rm -f"}
16067594505Smrg])# _LT_FILEUTILS_DEFAULTS
161b042e37fSmrg
162b042e37fSmrg
16367594505Smrg# _LT_SETUP
16467594505Smrg# ---------
16567594505Smrgm4_defun([_LT_SETUP],
16667594505Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
16767594505SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
16867594505SmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
16967594505SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
170b042e37fSmrg
17167594505Smrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
17267594505Smrgdnl
17367594505Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
17467594505Smrg_LT_DECL([], [host], [0])dnl
17567594505Smrg_LT_DECL([], [host_os], [0])dnl
17667594505Smrgdnl
17767594505Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
17867594505Smrg_LT_DECL([], [build], [0])dnl
17967594505Smrg_LT_DECL([], [build_os], [0])dnl
18067594505Smrgdnl
18167594505SmrgAC_REQUIRE([AC_PROG_CC])dnl
18267594505SmrgAC_REQUIRE([LT_PATH_LD])dnl
18367594505SmrgAC_REQUIRE([LT_PATH_NM])dnl
18467594505Smrgdnl
18567594505SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
18667594505Smrgtest -z "$LN_S" && LN_S="ln -s"
18767594505Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
18867594505Smrgdnl
18967594505SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
19067594505Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
19167594505Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
19267594505Smrgdnl
19367594505Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
19467594505Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
19567594505Smrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
19667594505Smrgm4_require([_LT_CMD_RELOAD])dnl
19767594505Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
19867594505Smrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
19967594505Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
20067594505Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
20167594505Smrgm4_require([_LT_WITH_SYSROOT])dnl
2028c4a8e55Smrg
20367594505Smrg_LT_CONFIG_LIBTOOL_INIT([
20467594505Smrg# See if we are running on zsh, and set the options which allow our
20567594505Smrg# commands through without removal of \ escapes INIT.
20667594505Smrgif test -n "\${ZSH_VERSION+set}" ; then
20767594505Smrg   setopt NO_GLOB_SUBST
20867594505Smrgfi
2098bd17e5fSmrg])
21067594505Smrgif test -n "${ZSH_VERSION+set}" ; then
21167594505Smrg   setopt NO_GLOB_SUBST
21267594505Smrgfi
2138c4a8e55Smrg
21467594505Smrg_LT_CHECK_OBJDIR
2158c4a8e55Smrg
21667594505Smrgm4_require([_LT_TAG_COMPILER])dnl
217fc98c8e2Smrg
21867594505Smrgcase $host_os in
21967594505Smrgaix3*)
22067594505Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
22167594505Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
22267594505Smrg  # vanish in a puff of smoke.
22367594505Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
22467594505Smrg    COLLECT_NAMES=
22567594505Smrg    export COLLECT_NAMES
2268bd17e5fSmrg  fi
22767594505Smrg  ;;
22867594505Smrgesac
2298c4a8e55Smrg
23067594505Smrg# Global variables:
23167594505Smrgofile=libtool
23267594505Smrgcan_build_shared=yes
2338c4a8e55Smrg
23467594505Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
23567594505Smrg# which needs '.lib').
23667594505Smrglibext=a
2378c4a8e55Smrg
23867594505Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
2398c4a8e55Smrg
24067594505Smrgold_CC="$CC"
24167594505Smrgold_CFLAGS="$CFLAGS"
242fc98c8e2Smrg
24367594505Smrg# Set sane defaults for various variables
24467594505Smrgtest -z "$CC" && CC=cc
24567594505Smrgtest -z "$LTCC" && LTCC=$CC
24667594505Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
24767594505Smrgtest -z "$LD" && LD=ld
24867594505Smrgtest -z "$ac_objext" && ac_objext=o
249fc98c8e2Smrg
25067594505Smrg_LT_CC_BASENAME([$compiler])
251fc98c8e2Smrg
25267594505Smrg# Only perform the check for file, if the check method requires it
25367594505Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
25467594505Smrgcase $deplibs_check_method in
25567594505Smrgfile_magic*)
25667594505Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
25767594505Smrg    _LT_PATH_MAGIC
25867594505Smrg  fi
25967594505Smrg  ;;
26067594505Smrgesac
261fc98c8e2Smrg
26267594505Smrg# Use C for the default configuration in the libtool script
26367594505SmrgLT_SUPPORTED_TAG([CC])
26467594505Smrg_LT_LANG_C_CONFIG
26567594505Smrg_LT_LANG_DEFAULT_CONFIG
26667594505Smrg_LT_CONFIG_COMMANDS
26767594505Smrg])# _LT_SETUP
268fc98c8e2Smrg
2698c4a8e55Smrg
27067594505Smrg# _LT_PREPARE_SED_QUOTE_VARS
27167594505Smrg# --------------------------
27267594505Smrg# Define a few sed substitution that help us do robust quoting.
27367594505Smrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
27467594505Smrg[# Backslashify metacharacters that are still active within
27567594505Smrg# double-quoted strings.
27667594505Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
277b042e37fSmrg
27867594505Smrg# Same as above, but do not quote variable references.
27967594505Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
280b042e37fSmrg
28167594505Smrg# Sed substitution to delay expansion of an escaped shell variable in a
28267594505Smrg# double_quote_subst'ed string.
28367594505Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
284b042e37fSmrg
28567594505Smrg# Sed substitution to delay expansion of an escaped single quote.
28667594505Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
287b042e37fSmrg
28867594505Smrg# Sed substitution to avoid accidental globbing in evaled expressions
28967594505Smrgno_glob_subst='s/\*/\\\*/g'
29067594505Smrg])
291706b6b52Smrg
29267594505Smrg# _LT_PROG_LTMAIN
29367594505Smrg# ---------------
29467594505Smrg# Note that this code is called both from `configure', and `config.status'
29567594505Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
29667594505Smrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
29767594505Smrg# so we pass a copy along to make sure it has a sensible value anyway.
29867594505Smrgm4_defun([_LT_PROG_LTMAIN],
29967594505Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
30067594505Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
30167594505Smrgltmain="$ac_aux_dir/ltmain.sh"
30267594505Smrg])# _LT_PROG_LTMAIN
303b042e37fSmrg
304b042e37fSmrg
305b042e37fSmrg
30667594505Smrg# So that we can recreate a full libtool script including additional
30767594505Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
30867594505Smrg# in macros and then make a single call at the end using the `libtool'
30967594505Smrg# label.
310b042e37fSmrg
311b042e37fSmrg
31267594505Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
31367594505Smrg# ----------------------------------------
31467594505Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
31567594505Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
31667594505Smrg[m4_ifval([$1],
31767594505Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
31867594505Smrg                     [$1
31967594505Smrg])])])
320b042e37fSmrg
32167594505Smrg# Initialize.
32267594505Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
323b042e37fSmrg
32467594505Smrg
32567594505Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
3268bd17e5fSmrg# ------------------------------
32767594505Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
32867594505Smrgm4_define([_LT_CONFIG_LIBTOOL],
32967594505Smrg[m4_ifval([$1],
33067594505Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
33167594505Smrg                     [$1
33267594505Smrg])])])
333b042e37fSmrg
33467594505Smrg# Initialize.
33567594505Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
33667594505Smrg
33767594505Smrg
33867594505Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
33967594505Smrg# -----------------------------------------------------
34067594505Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
34167594505Smrg[_LT_CONFIG_LIBTOOL([$1])
34267594505Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
3430597fb56Smrg])
344b042e37fSmrg
345b042e37fSmrg
34667594505Smrg# _LT_FORMAT_COMMENT([COMMENT])
34767594505Smrg# -----------------------------
34867594505Smrg# Add leading comment marks to the start of each line, and a trailing
34967594505Smrg# full-stop to the whole comment if one is not present already.
35067594505Smrgm4_define([_LT_FORMAT_COMMENT],
35167594505Smrg[m4_ifval([$1], [
35267594505Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
35367594505Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
35467594505Smrg)])
355b042e37fSmrg
356b042e37fSmrg
357b042e37fSmrg
3588c4a8e55Smrg
3598c4a8e55Smrg
36067594505Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
36167594505Smrg# -------------------------------------------------------------------
36267594505Smrg# CONFIGNAME is the name given to the value in the libtool script.
36367594505Smrg# VARNAME is the (base) name used in the configure script.
36467594505Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
36567594505Smrg# VARNAME.  Any other value will be used directly.
36667594505Smrgm4_define([_LT_DECL],
36767594505Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
36867594505Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
36967594505Smrg	[m4_ifval([$1], [$1], [$2])])
37067594505Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
37167594505Smrg    m4_ifval([$4],
37267594505Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
37367594505Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
37467594505Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
37567594505Smrg])
376fc98c8e2Smrg
377fc98c8e2Smrg
37867594505Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
37967594505Smrg# --------------------------------------------------------
38067594505Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
381fc98c8e2Smrg
382fc98c8e2Smrg
38367594505Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
38467594505Smrg# ------------------------------------------------
38567594505Smrgm4_define([lt_decl_tag_varnames],
38667594505Smrg[_lt_decl_filter([tagged?], [yes], $@)])
387fc98c8e2Smrg
388b042e37fSmrg
38967594505Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
39067594505Smrg# ---------------------------------------------------------
39167594505Smrgm4_define([_lt_decl_filter],
39267594505Smrg[m4_case([$#],
39367594505Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
39467594505Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
39567594505Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
39667594505Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
39767594505Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
39867594505Smrg])
399b042e37fSmrg
4008c4a8e55Smrg
40167594505Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
40267594505Smrg# --------------------------------------------------
40367594505Smrgm4_define([lt_decl_quote_varnames],
40467594505Smrg[_lt_decl_filter([value], [1], $@)])
4058bd17e5fSmrg
406b042e37fSmrg
40767594505Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
40867594505Smrg# ---------------------------------------------------
40967594505Smrgm4_define([lt_decl_dquote_varnames],
41067594505Smrg[_lt_decl_filter([value], [2], $@)])
411b042e37fSmrg
41267594505Smrg
41367594505Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
41467594505Smrg# ---------------------------------------------------
41567594505Smrgm4_define([lt_decl_varnames_tagged],
41667594505Smrg[m4_assert([$# <= 2])dnl
41767594505Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
41867594505Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
41967594505Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
42067594505Smrgm4_define([_lt_decl_varnames_tagged],
42167594505Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
42267594505Smrg
42367594505Smrg
42467594505Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
42567594505Smrg# ------------------------------------------------
42667594505Smrgm4_define([lt_decl_all_varnames],
42767594505Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
42867594505Smrg     m4_if([$2], [],
42967594505Smrg	   m4_quote(lt_decl_varnames),
43067594505Smrg	m4_quote(m4_shift($@))))[]dnl
4310597fb56Smrg])
43267594505Smrgm4_define([_lt_decl_all_varnames],
43367594505Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
43467594505Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
4358c4a8e55Smrg])
436b042e37fSmrg
437b042e37fSmrg
43867594505Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
43967594505Smrg# ------------------------------------
44067594505Smrg# Quote a variable value, and forward it to `config.status' so that its
44167594505Smrg# declaration there will have the same value as in `configure'.  VARNAME
44267594505Smrg# must have a single quote delimited value for this to work.
44367594505Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
44467594505Smrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
445b042e37fSmrg
446b042e37fSmrg
44767594505Smrg# _LT_CONFIG_STATUS_DECLARATIONS
44867594505Smrg# ------------------------------
44967594505Smrg# We delimit libtool config variables with single quotes, so when
45067594505Smrg# we write them to config.status, we have to be sure to quote all
45167594505Smrg# embedded single quotes properly.  In configure, this macro expands
45267594505Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
45367594505Smrg#
45467594505Smrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
45567594505Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
45667594505Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
45767594505Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
458b042e37fSmrg
459b042e37fSmrg
46067594505Smrg# _LT_LIBTOOL_TAGS
46167594505Smrg# ----------------
46267594505Smrg# Output comment and list of tags supported by the script
46367594505Smrgm4_defun([_LT_LIBTOOL_TAGS],
46467594505Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
46567594505Smrgavailable_tags="_LT_TAGS"dnl
46667594505Smrg])
467b042e37fSmrg
468b042e37fSmrg
46967594505Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
47067594505Smrg# -----------------------------------
47167594505Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
47267594505Smrg# expand to a commented shell variable setting:
4738bd17e5fSmrg#
47467594505Smrg#    # Some comment about what VAR is for.
47567594505Smrg#    visible_name=$lt_internal_name
47667594505Smrgm4_define([_LT_LIBTOOL_DECLARE],
47767594505Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
47867594505Smrg					   [description])))[]dnl
47967594505Smrgm4_pushdef([_libtool_name],
48067594505Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
48167594505Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
48267594505Smrg    [0], [_libtool_name=[$]$1],
48367594505Smrg    [1], [_libtool_name=$lt_[]$1],
48467594505Smrg    [2], [_libtool_name=$lt_[]$1],
48567594505Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
48667594505Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
48767594505Smrg])
488b042e37fSmrg
489b042e37fSmrg
49067594505Smrg# _LT_LIBTOOL_CONFIG_VARS
49167594505Smrg# -----------------------
49267594505Smrg# Produce commented declarations of non-tagged libtool config variables
49367594505Smrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
49467594505Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
49567594505Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
49667594505Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
49767594505Smrg[m4_foreach([_lt_var],
49867594505Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
49967594505Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
5008bd17e5fSmrg
501b042e37fSmrg
50267594505Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
50367594505Smrg# -------------------------
50467594505Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
50567594505Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
50667594505Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
507706b6b52Smrg
508706b6b52Smrg
50967594505Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
51067594505Smrg# ------------------------------
51167594505Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
512b042e37fSmrg
513b042e37fSmrg
51467594505Smrg# _LT_CONFIG_COMMANDS
51567594505Smrg# -------------------
51667594505Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
51767594505Smrg# variables for single and double quote escaping we saved from calls
51867594505Smrg# to _LT_DECL, we can put quote escaped variables declarations
51967594505Smrg# into `config.status', and then the shell code to quote escape them in
52067594505Smrg# for loops in `config.status'.  Finally, any additional code accumulated
52167594505Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
52267594505Smrgm4_defun([_LT_CONFIG_COMMANDS],
52367594505Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
52467594505Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
52567594505Smrg	dnl instead of duplicating it all over again into config.status,
52667594505Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
52767594505Smrg	dnl needs to know what name is stored there:
52867594505Smrg        [AC_CONFIG_COMMANDS([libtool],
52967594505Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
53067594505Smrg    dnl If the libtool generation code is destined for config.status,
53167594505Smrg    dnl expand the accumulated commands and init code now:
53267594505Smrg    [AC_CONFIG_COMMANDS([libtool],
53367594505Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
53467594505Smrg])#_LT_CONFIG_COMMANDS
53567594505Smrg
53667594505Smrg
53767594505Smrg# Initialize.
53867594505Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
53967594505Smrg[
54067594505Smrg
54167594505Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
54267594505Smrg# if CDPATH is set.
54367594505Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
54467594505Smrg
54567594505Smrgsed_quote_subst='$sed_quote_subst'
54667594505Smrgdouble_quote_subst='$double_quote_subst'
54767594505Smrgdelay_variable_subst='$delay_variable_subst'
54867594505Smrg_LT_CONFIG_STATUS_DECLARATIONS
54967594505SmrgLTCC='$LTCC'
55067594505SmrgLTCFLAGS='$LTCFLAGS'
55167594505Smrgcompiler='$compiler_DEFAULT'
55267594505Smrg
55367594505Smrg# A function that is used when there is no print builtin or printf.
55467594505Smrgfunc_fallback_echo ()
55567594505Smrg{
55667594505Smrg  eval 'cat <<_LTECHO_EOF
55767594505Smrg\$[]1
55867594505Smrg_LTECHO_EOF'
55967594505Smrg}
56067594505Smrg
56167594505Smrg# Quote evaled strings.
56267594505Smrgfor var in lt_decl_all_varnames([[ \
56367594505Smrg]], lt_decl_quote_varnames); do
56467594505Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
56567594505Smrg    *[[\\\\\\\`\\"\\\$]]*)
56667594505Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
5670597fb56Smrg      ;;
56867594505Smrg    *)
56967594505Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
5700597fb56Smrg      ;;
57167594505Smrg    esac
57267594505Smrgdone
57367594505Smrg
57467594505Smrg# Double-quote double-evaled strings.
57567594505Smrgfor var in lt_decl_all_varnames([[ \
57667594505Smrg]], lt_decl_dquote_varnames); do
57767594505Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
57867594505Smrg    *[[\\\\\\\`\\"\\\$]]*)
57967594505Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
5808bd17e5fSmrg      ;;
58167594505Smrg    *)
58267594505Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
5830597fb56Smrg      ;;
584706b6b52Smrg    esac
58567594505Smrgdone
586b042e37fSmrg
58767594505Smrg_LT_OUTPUT_LIBTOOL_INIT
58867594505Smrg])
5898bd17e5fSmrg
59067594505Smrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
59167594505Smrg# ------------------------------------
59267594505Smrg# Generate a child script FILE with all initialization necessary to
59367594505Smrg# reuse the environment learned by the parent script, and make the
59467594505Smrg# file executable.  If COMMENT is supplied, it is inserted after the
59567594505Smrg# `#!' sequence but before initialization text begins.  After this
59667594505Smrg# macro, additional text can be appended to FILE to form the body of
59767594505Smrg# the child script.  The macro ends with non-zero status if the
59867594505Smrg# file could not be fully written (such as if the disk is full).
59967594505Smrgm4_ifdef([AS_INIT_GENERATED],
60067594505Smrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
60167594505Smrg[m4_defun([_LT_GENERATED_FILE_INIT],
60267594505Smrg[m4_require([AS_PREPARE])]dnl
60367594505Smrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
60467594505Smrg[lt_write_fail=0
60567594505Smrgcat >$1 <<_ASEOF || lt_write_fail=1
60667594505Smrg#! $SHELL
60767594505Smrg# Generated by $as_me.
60867594505Smrg$2
60967594505SmrgSHELL=\${CONFIG_SHELL-$SHELL}
61067594505Smrgexport SHELL
61167594505Smrg_ASEOF
61267594505Smrgcat >>$1 <<\_ASEOF || lt_write_fail=1
61367594505SmrgAS_SHELL_SANITIZE
61467594505Smrg_AS_PREPARE
61567594505Smrgexec AS_MESSAGE_FD>&1
61667594505Smrg_ASEOF
61767594505Smrgtest $lt_write_fail = 0 && chmod +x $1[]dnl
61867594505Smrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
619b042e37fSmrg
62067594505Smrg# LT_OUTPUT
62167594505Smrg# ---------
62267594505Smrg# This macro allows early generation of the libtool script (before
62367594505Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
62467594505Smrg# tests.
62567594505SmrgAC_DEFUN([LT_OUTPUT],
62667594505Smrg[: ${CONFIG_LT=./config.lt}
62767594505SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
62867594505Smrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
62967594505Smrg[# Run this file to recreate a libtool stub with the current configuration.])
630b042e37fSmrg
63167594505Smrgcat >>"$CONFIG_LT" <<\_LTEOF
63267594505Smrglt_cl_silent=false
63367594505Smrgexec AS_MESSAGE_LOG_FD>>config.log
63467594505Smrg{
63567594505Smrg  echo
63667594505Smrg  AS_BOX([Running $as_me.])
63767594505Smrg} >&AS_MESSAGE_LOG_FD
638b042e37fSmrg
63967594505Smrglt_cl_help="\
64067594505Smrg\`$as_me' creates a local libtool stub from the current configuration,
64167594505Smrgfor use in further configure time tests before the real libtool is
64267594505Smrggenerated.
643b042e37fSmrg
64467594505SmrgUsage: $[0] [[OPTIONS]]
645b042e37fSmrg
64667594505Smrg  -h, --help      print this help, then exit
64767594505Smrg  -V, --version   print version number, then exit
64867594505Smrg  -q, --quiet     do not print progress messages
64967594505Smrg  -d, --debug     don't remove temporary files
650b042e37fSmrg
65167594505SmrgReport bugs to <bug-libtool@gnu.org>."
652b042e37fSmrg
65367594505Smrglt_cl_version="\
65467594505Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
65567594505Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
65667594505Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
6578c4a8e55Smrg
65867594505SmrgCopyright (C) 2011 Free Software Foundation, Inc.
65967594505SmrgThis config.lt script is free software; the Free Software Foundation
66067594505Smrggives unlimited permision to copy, distribute and modify it."
6618c4a8e55Smrg
66267594505Smrgwhile test $[#] != 0
66367594505Smrgdo
66467594505Smrg  case $[1] in
66567594505Smrg    --version | --v* | -V )
66667594505Smrg      echo "$lt_cl_version"; exit 0 ;;
66767594505Smrg    --help | --h* | -h )
66867594505Smrg      echo "$lt_cl_help"; exit 0 ;;
66967594505Smrg    --debug | --d* | -d )
67067594505Smrg      debug=: ;;
67167594505Smrg    --quiet | --q* | --silent | --s* | -q )
67267594505Smrg      lt_cl_silent=: ;;
673b042e37fSmrg
67467594505Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
67567594505SmrgTry \`$[0] --help' for more information.]) ;;
676b042e37fSmrg
67767594505Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
67867594505SmrgTry \`$[0] --help' for more information.]) ;;
67967594505Smrg  esac
68067594505Smrg  shift
68167594505Smrgdone
6828c4a8e55Smrg
68367594505Smrgif $lt_cl_silent; then
68467594505Smrg  exec AS_MESSAGE_FD>/dev/null
68567594505Smrgfi
68667594505Smrg_LTEOF
6878c4a8e55Smrg
68867594505Smrgcat >>"$CONFIG_LT" <<_LTEOF
68967594505Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
69067594505Smrg_LTEOF
6918c4a8e55Smrg
69267594505Smrgcat >>"$CONFIG_LT" <<\_LTEOF
69367594505SmrgAC_MSG_NOTICE([creating $ofile])
69467594505Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
69567594505SmrgAS_EXIT(0)
69667594505Smrg_LTEOF
69767594505Smrgchmod +x "$CONFIG_LT"
6988c4a8e55Smrg
69967594505Smrg# configure is writing to config.log, but config.lt does its own redirection,
70067594505Smrg# appending to config.log, which fails on DOS, as config.log is still kept
70167594505Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
70267594505Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
70367594505Smrglt_cl_success=:
70467594505Smrgtest "$silent" = yes &&
70567594505Smrg  lt_config_lt_args="$lt_config_lt_args --quiet"
70667594505Smrgexec AS_MESSAGE_LOG_FD>/dev/null
70767594505Smrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
70867594505Smrgexec AS_MESSAGE_LOG_FD>>config.log
70967594505Smrg$lt_cl_success || AS_EXIT(1)
71067594505Smrg])# LT_OUTPUT
7118c4a8e55Smrg
712b042e37fSmrg
71367594505Smrg# _LT_CONFIG(TAG)
71467594505Smrg# ---------------
71567594505Smrg# If TAG is the built-in tag, create an initial libtool script with a
71667594505Smrg# default configuration from the untagged config vars.  Otherwise add code
71767594505Smrg# to config.status for appending the configuration named by TAG from the
71867594505Smrg# matching tagged config vars.
71967594505Smrgm4_defun([_LT_CONFIG],
72067594505Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
72167594505Smrg_LT_CONFIG_SAVE_COMMANDS([
72267594505Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
72367594505Smrg  m4_if(_LT_TAG, [C], [
72467594505Smrg    # See if we are running on zsh, and set the options which allow our
72567594505Smrg    # commands through without removal of \ escapes.
72667594505Smrg    if test -n "${ZSH_VERSION+set}" ; then
72767594505Smrg      setopt NO_GLOB_SUBST
72867594505Smrg    fi
729b042e37fSmrg
73067594505Smrg    cfgfile="${ofile}T"
73167594505Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
73267594505Smrg    $RM "$cfgfile"
733b042e37fSmrg
73467594505Smrg    cat <<_LT_EOF >> "$cfgfile"
73567594505Smrg#! $SHELL
736b042e37fSmrg
73767594505Smrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
73867594505Smrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
73967594505Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
74067594505Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
74167594505Smrg#
74267594505Smrg_LT_COPYING
74367594505Smrg_LT_LIBTOOL_TAGS
744b042e37fSmrg
74567594505Smrg# ### BEGIN LIBTOOL CONFIG
74667594505Smrg_LT_LIBTOOL_CONFIG_VARS
74767594505Smrg_LT_LIBTOOL_TAG_VARS
74867594505Smrg# ### END LIBTOOL CONFIG
74967594505Smrg
75067594505Smrg_LT_EOF
75167594505Smrg
75267594505Smrg  case $host_os in
75367594505Smrg  aix3*)
75467594505Smrg    cat <<\_LT_EOF >> "$cfgfile"
75567594505Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
75667594505Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
75767594505Smrg# vanish in a puff of smoke.
75867594505Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
75967594505Smrg  COLLECT_NAMES=
76067594505Smrg  export COLLECT_NAMES
76167594505Smrgfi
76267594505Smrg_LT_EOF
76367594505Smrg    ;;
7640597fb56Smrg  esac
765b042e37fSmrg
76667594505Smrg  _LT_PROG_LTMAIN
767b042e37fSmrg
76867594505Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
76967594505Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
77067594505Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
77167594505Smrg  # is reportedly fixed, but why not run on old versions too?
77267594505Smrg  sed '$q' "$ltmain" >> "$cfgfile" \
77367594505Smrg     || (rm -f "$cfgfile"; exit 1)
774b042e37fSmrg
77567594505Smrg  _LT_PROG_REPLACE_SHELLFNS
7768c4a8e55Smrg
77767594505Smrg   mv -f "$cfgfile" "$ofile" ||
77867594505Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
77967594505Smrg  chmod +x "$ofile"
78067594505Smrg],
78167594505Smrg[cat <<_LT_EOF >> "$ofile"
782706b6b52Smrg
78367594505Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
78467594505Smrgdnl in a comment (ie after a #).
78567594505Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
78667594505Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
78767594505Smrg# ### END LIBTOOL TAG CONFIG: $1
78867594505Smrg_LT_EOF
78967594505Smrg])dnl /m4_if
79067594505Smrg],
79167594505Smrg[m4_if([$1], [], [
79267594505Smrg    PACKAGE='$PACKAGE'
79367594505Smrg    VERSION='$VERSION'
79467594505Smrg    TIMESTAMP='$TIMESTAMP'
79567594505Smrg    RM='$RM'
79667594505Smrg    ofile='$ofile'], [])
79767594505Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
79867594505Smrg])# _LT_CONFIG
799706b6b52Smrg
800706b6b52Smrg
80167594505Smrg# LT_SUPPORTED_TAG(TAG)
80267594505Smrg# ---------------------
80367594505Smrg# Trace this macro to discover what tags are supported by the libtool
80467594505Smrg# --tag option, using:
80567594505Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
80667594505SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
807706b6b52Smrg
808706b6b52Smrg
80967594505Smrg# C support is built-in for now
81067594505Smrgm4_define([_LT_LANG_C_enabled], [])
81167594505Smrgm4_define([_LT_TAGS], [])
812bd23fbfaSmrg
813bd23fbfaSmrg
81467594505Smrg# LT_LANG(LANG)
81567594505Smrg# -------------
81667594505Smrg# Enable libtool support for the given language if not already enabled.
81767594505SmrgAC_DEFUN([LT_LANG],
81867594505Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
81967594505Smrgm4_case([$1],
82067594505Smrg  [C],			[_LT_LANG(C)],
82167594505Smrg  [C++],		[_LT_LANG(CXX)],
82267594505Smrg  [Go],			[_LT_LANG(GO)],
82367594505Smrg  [Java],		[_LT_LANG(GCJ)],
82467594505Smrg  [Fortran 77],		[_LT_LANG(F77)],
82567594505Smrg  [Fortran],		[_LT_LANG(FC)],
82667594505Smrg  [Windows Resource],	[_LT_LANG(RC)],
82767594505Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
82867594505Smrg    [_LT_LANG($1)],
82967594505Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
83067594505Smrg])# LT_LANG
831bd23fbfaSmrg
832bd23fbfaSmrg
83367594505Smrg# _LT_LANG(LANGNAME)
83467594505Smrg# ------------------
83567594505Smrgm4_defun([_LT_LANG],
83667594505Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
83767594505Smrg  [LT_SUPPORTED_TAG([$1])dnl
83867594505Smrg  m4_append([_LT_TAGS], [$1 ])dnl
83967594505Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
84067594505Smrg  _LT_LANG_$1_CONFIG($1)])dnl
84167594505Smrg])# _LT_LANG
8420597fb56Smrg
843bd23fbfaSmrg
84467594505Smrgm4_ifndef([AC_PROG_GO], [
84567594505Smrg# NOTE: This macro has been submitted for inclusion into   #
84667594505Smrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
84767594505Smrg#  a released version of Autoconf we should remove this    #
84867594505Smrg#  macro and use it instead.                               #
84967594505Smrgm4_defun([AC_PROG_GO],
85067594505Smrg[AC_LANG_PUSH(Go)dnl
85167594505SmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
85267594505SmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
85367594505Smrg_AC_ARG_VAR_LDFLAGS()dnl
85467594505SmrgAC_CHECK_TOOL(GOC, gccgo)
85567594505Smrgif test -z "$GOC"; then
85667594505Smrg  if test -n "$ac_tool_prefix"; then
85767594505Smrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
8588bd17e5fSmrg  fi
85967594505Smrgfi
86067594505Smrgif test -z "$GOC"; then
86167594505Smrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
86267594505Smrgfi
86367594505Smrg])#m4_defun
86467594505Smrg])#m4_ifndef
865706b6b52Smrg
866706b6b52Smrg
86767594505Smrg# _LT_LANG_DEFAULT_CONFIG
86867594505Smrg# -----------------------
86967594505Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
87067594505Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
87167594505Smrg  [LT_LANG(CXX)],
87267594505Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
873706b6b52Smrg
87467594505SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
87567594505Smrg  [LT_LANG(F77)],
87667594505Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
877b042e37fSmrg
87867594505SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
87967594505Smrg  [LT_LANG(FC)],
88067594505Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
881b042e37fSmrg
88267594505Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
88367594505Smrgdnl pulling things in needlessly.
88467594505SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
88567594505Smrg  [LT_LANG(GCJ)],
88667594505Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
88767594505Smrg    [LT_LANG(GCJ)],
88867594505Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
88967594505Smrg      [LT_LANG(GCJ)],
89067594505Smrg      [m4_ifdef([AC_PROG_GCJ],
89167594505Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
89267594505Smrg       m4_ifdef([A][M_PROG_GCJ],
89367594505Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
89467594505Smrg       m4_ifdef([LT_PROG_GCJ],
89567594505Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
896b042e37fSmrg
89767594505SmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
89867594505Smrg  [LT_LANG(GO)],
89967594505Smrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
900706b6b52Smrg
90167594505SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
90267594505Smrg  [LT_LANG(RC)],
90367594505Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
90467594505Smrg])# _LT_LANG_DEFAULT_CONFIG
905bd23fbfaSmrg
90667594505Smrg# Obsolete macros:
90767594505SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
90867594505SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
90967594505SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
91067594505SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
91167594505SmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
91267594505Smrgdnl aclocal-1.4 backwards compatibility:
91367594505Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
91467594505Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
91567594505Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
91667594505Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
91767594505Smrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
918b042e37fSmrg
919706b6b52Smrg
92067594505Smrg# _LT_TAG_COMPILER
92167594505Smrg# ----------------
92267594505Smrgm4_defun([_LT_TAG_COMPILER],
92367594505Smrg[AC_REQUIRE([AC_PROG_CC])dnl
924b042e37fSmrg
92567594505Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
92667594505Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
92767594505Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
92867594505Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
929706b6b52Smrg
93067594505Smrg# If no C compiler was specified, use CC.
93167594505SmrgLTCC=${LTCC-"$CC"}
932706b6b52Smrg
93367594505Smrg# If no C compiler flags were specified, use CFLAGS.
93467594505SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
935b042e37fSmrg
93667594505Smrg# Allow CC to be a program name with arguments.
93767594505Smrgcompiler=$CC
93867594505Smrg])# _LT_TAG_COMPILER
939bd23fbfaSmrg
940bd23fbfaSmrg
94167594505Smrg# _LT_COMPILER_BOILERPLATE
94267594505Smrg# ------------------------
94367594505Smrg# Check for compiler boilerplate output or warnings with
94467594505Smrg# the simple compiler test code.
94567594505Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
94667594505Smrg[m4_require([_LT_DECL_SED])dnl
94767594505Smrgac_outfile=conftest.$ac_objext
94867594505Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
94967594505Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
95067594505Smrg_lt_compiler_boilerplate=`cat conftest.err`
95167594505Smrg$RM conftest*
95267594505Smrg])# _LT_COMPILER_BOILERPLATE
953bd23fbfaSmrg
954bd23fbfaSmrg
95567594505Smrg# _LT_LINKER_BOILERPLATE
95667594505Smrg# ----------------------
95767594505Smrg# Check for linker boilerplate output or warnings with
95867594505Smrg# the simple link test code.
95967594505Smrgm4_defun([_LT_LINKER_BOILERPLATE],
96067594505Smrg[m4_require([_LT_DECL_SED])dnl
96167594505Smrgac_outfile=conftest.$ac_objext
96267594505Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
96367594505Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
96467594505Smrg_lt_linker_boilerplate=`cat conftest.err`
96567594505Smrg$RM -r conftest*
96667594505Smrg])# _LT_LINKER_BOILERPLATE
967bd23fbfaSmrg
96867594505Smrg# _LT_REQUIRED_DARWIN_CHECKS
96967594505Smrg# -------------------------
97067594505Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
97167594505Smrg  case $host_os in
97267594505Smrg    rhapsody* | darwin*)
97367594505Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
97467594505Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
97567594505Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
97667594505Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
97767594505Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
97867594505Smrg    _LT_DECL([], [DSYMUTIL], [1],
97967594505Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
98067594505Smrg    _LT_DECL([], [NMEDIT], [1],
98167594505Smrg      [Tool to change global to local symbols on Mac OS X])
98267594505Smrg    _LT_DECL([], [LIPO], [1],
98367594505Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
98467594505Smrg    _LT_DECL([], [OTOOL], [1],
98567594505Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
98667594505Smrg    _LT_DECL([], [OTOOL64], [1],
98767594505Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
988bd23fbfaSmrg
98967594505Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
99067594505Smrg      [lt_cv_apple_cc_single_mod=no
99167594505Smrg      if test -z "${LT_MULTI_MODULE}"; then
99267594505Smrg	# By default we will add the -single_module flag. You can override
99367594505Smrg	# by either setting the environment variable LT_MULTI_MODULE
99467594505Smrg	# non-empty at configure time, or by adding -multi_module to the
99567594505Smrg	# link flags.
99667594505Smrg	rm -rf libconftest.dylib*
99767594505Smrg	echo "int foo(void){return 1;}" > conftest.c
99867594505Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
99967594505Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
100067594505Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
100167594505Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
100267594505Smrg        _lt_result=$?
100367594505Smrg	# If there is a non-empty error log, and "single_module"
100467594505Smrg	# appears in it, assume the flag caused a linker warning
100567594505Smrg        if test -s conftest.err && $GREP single_module conftest.err; then
100667594505Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
100767594505Smrg	# Otherwise, if the output was created with a 0 exit code from
100867594505Smrg	# the compiler, it worked.
100967594505Smrg	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
101067594505Smrg	  lt_cv_apple_cc_single_mod=yes
101167594505Smrg	else
101267594505Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
101367594505Smrg	fi
101467594505Smrg	rm -rf libconftest.dylib*
101567594505Smrg	rm -f conftest.*
101667594505Smrg      fi])
1017bd23fbfaSmrg
101867594505Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
101967594505Smrg      [lt_cv_ld_exported_symbols_list],
102067594505Smrg      [lt_cv_ld_exported_symbols_list=no
102167594505Smrg      save_LDFLAGS=$LDFLAGS
102267594505Smrg      echo "_main" > conftest.sym
102367594505Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
102467594505Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
102567594505Smrg	[lt_cv_ld_exported_symbols_list=yes],
102667594505Smrg	[lt_cv_ld_exported_symbols_list=no])
102767594505Smrg	LDFLAGS="$save_LDFLAGS"
102867594505Smrg    ])
10290597fb56Smrg
103067594505Smrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
103167594505Smrg      [lt_cv_ld_force_load=no
103267594505Smrg      cat > conftest.c << _LT_EOF
103367594505Smrgint forced_loaded() { return 2;}
103467594505Smrg_LT_EOF
103567594505Smrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
103667594505Smrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
103767594505Smrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
103867594505Smrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
103967594505Smrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
104067594505Smrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
104167594505Smrg      cat > conftest.c << _LT_EOF
104267594505Smrgint main() { return 0;}
104367594505Smrg_LT_EOF
104467594505Smrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
104567594505Smrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
104667594505Smrg      _lt_result=$?
104767594505Smrg      if test -s conftest.err && $GREP force_load conftest.err; then
104867594505Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
104967594505Smrg      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
105067594505Smrg	lt_cv_ld_force_load=yes
105167594505Smrg      else
105267594505Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
105367594505Smrg      fi
105467594505Smrg        rm -f conftest.err libconftest.a conftest conftest.c
105567594505Smrg        rm -rf conftest.dSYM
105667594505Smrg    ])
105767594505Smrg    case $host_os in
105867594505Smrg    rhapsody* | darwin1.[[012]])
105967594505Smrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
106067594505Smrg    darwin1.*)
106167594505Smrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
106267594505Smrg    darwin*) # darwin 5.x on
106367594505Smrg      # if running on 10.5 or later, the deployment target defaults
106467594505Smrg      # to the OS version, if on x86, and 10.4, the deployment
106567594505Smrg      # target defaults to 10.4. Don't you love it?
106667594505Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
106767594505Smrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
106867594505Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
106967594505Smrg	10.[[012]]*)
107067594505Smrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
107167594505Smrg	10.*)
107267594505Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
107367594505Smrg      esac
107467594505Smrg    ;;
107567594505Smrg  esac
107667594505Smrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
107767594505Smrg      _lt_dar_single_mod='$single_module'
107867594505Smrg    fi
107967594505Smrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
108067594505Smrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
108167594505Smrg    else
108267594505Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
108367594505Smrg    fi
108467594505Smrg    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
108567594505Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
108667594505Smrg    else
108767594505Smrg      _lt_dsymutil=
108867594505Smrg    fi
108967594505Smrg    ;;
109067594505Smrg  esac
10918bd17e5fSmrg])
10920597fb56Smrg
10930597fb56Smrg
109467594505Smrg# _LT_DARWIN_LINKER_FEATURES([TAG])
109567594505Smrg# ---------------------------------
109667594505Smrg# Checks for linker and compiler features on darwin
109767594505Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
109867594505Smrg[
109967594505Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
110067594505Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
110167594505Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
110267594505Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
110367594505Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
110467594505Smrg  if test "$lt_cv_ld_force_load" = "yes"; then
110567594505Smrg    _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\"`'
110667594505Smrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
110767594505Smrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
110867594505Smrg  else
110967594505Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
111067594505Smrg  fi
111167594505Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
111267594505Smrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
111367594505Smrg  case $cc_basename in
111467594505Smrg     ifort*) _lt_dar_can_shared=yes ;;
111567594505Smrg     *) _lt_dar_can_shared=$GCC ;;
111667594505Smrg  esac
111767594505Smrg  if test "$_lt_dar_can_shared" = "yes"; then
111867594505Smrg    output_verbose_link_cmd=func_echo_all
111967594505Smrg    _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}"
112067594505Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
112167594505Smrg    _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}"
112267594505Smrg    _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}"
112367594505Smrg    m4_if([$1], [CXX],
112467594505Smrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
112567594505Smrg      _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}"
112667594505Smrg      _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}"
112767594505Smrg    fi
112867594505Smrg],[])
112967594505Smrg  else
113067594505Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
113167594505Smrg  fi
113267594505Smrg])
11330597fb56Smrg
113467594505Smrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
113567594505Smrg# ----------------------------------
113667594505Smrg# Links a minimal program and checks the executable
113767594505Smrg# for the system default hardcoded library path. In most cases,
113867594505Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
113967594505Smrg# the location of the communication and MPI libs are included too.
114067594505Smrg# If we don't find anything, use the default library path according
114167594505Smrg# to the aix ld manual.
114267594505Smrg# Store the results from the different compilers for each TAGNAME.
114367594505Smrg# Allow to override them for all tags through lt_cv_aix_libpath.
114467594505Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
114567594505Smrg[m4_require([_LT_DECL_SED])dnl
114667594505Smrgif test "${lt_cv_aix_libpath+set}" = set; then
114767594505Smrg  aix_libpath=$lt_cv_aix_libpath
114867594505Smrgelse
114967594505Smrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
115067594505Smrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
115167594505Smrg  lt_aix_libpath_sed='[
115267594505Smrg      /Import File Strings/,/^$/ {
115367594505Smrg	  /^0/ {
115467594505Smrg	      s/^0  *\([^ ]*\) *$/\1/
115567594505Smrg	      p
115667594505Smrg	  }
115767594505Smrg      }]'
115867594505Smrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
115967594505Smrg  # Check for a 64-bit object if we didn't find anything.
116067594505Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
116167594505Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
116267594505Smrg  fi],[])
116367594505Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
116467594505Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
116567594505Smrg  fi
116667594505Smrg  ])
116767594505Smrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
116867594505Smrgfi
116967594505Smrg])# _LT_SYS_MODULE_PATH_AIX
11700597fb56Smrg
1171bd23fbfaSmrg
117267594505Smrg# _LT_SHELL_INIT(ARG)
117367594505Smrg# -------------------
117467594505Smrgm4_define([_LT_SHELL_INIT],
117567594505Smrg[m4_divert_text([M4SH-INIT], [$1
117667594505Smrg])])# _LT_SHELL_INIT
1177b042e37fSmrg
1178b042e37fSmrg
1179b042e37fSmrg
118067594505Smrg# _LT_PROG_ECHO_BACKSLASH
118167594505Smrg# -----------------------
118267594505Smrg# Find how we can fake an echo command that does not interpret backslash.
118367594505Smrg# In particular, with Autoconf 2.60 or later we add some code to the start
118467594505Smrg# of the generated configure script which will find a shell with a builtin
118567594505Smrg# printf (which we can use as an echo command).
118667594505Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
118767594505Smrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
118867594505SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
118967594505SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1190b042e37fSmrg
119167594505SmrgAC_MSG_CHECKING([how to print strings])
119267594505Smrg# Test print first, because it will be a builtin if present.
119367594505Smrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
119467594505Smrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
119567594505Smrg  ECHO='print -r --'
119667594505Smrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
119767594505Smrg  ECHO='printf %s\n'
119867594505Smrgelse
119967594505Smrg  # Use this function as a fallback that always works.
120067594505Smrg  func_fallback_echo ()
120167594505Smrg  {
120267594505Smrg    eval 'cat <<_LTECHO_EOF
120367594505Smrg$[]1
120467594505Smrg_LTECHO_EOF'
120567594505Smrg  }
120667594505Smrg  ECHO='func_fallback_echo'
120767594505Smrgfi
1208b042e37fSmrg
120967594505Smrg# func_echo_all arg...
121067594505Smrg# Invoke $ECHO with all args, space-separated.
121167594505Smrgfunc_echo_all ()
121267594505Smrg{
121367594505Smrg    $ECHO "$*" 
121467594505Smrg}
1215b042e37fSmrg
121667594505Smrgcase "$ECHO" in
121767594505Smrg  printf*) AC_MSG_RESULT([printf]) ;;
121867594505Smrg  print*) AC_MSG_RESULT([print -r]) ;;
121967594505Smrg  *) AC_MSG_RESULT([cat]) ;;
122067594505Smrgesac
12210597fb56Smrg
122267594505Smrgm4_ifdef([_AS_DETECT_SUGGESTED],
122367594505Smrg[_AS_DETECT_SUGGESTED([
122467594505Smrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
122567594505Smrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
122667594505Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
122767594505Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
122867594505Smrg    PATH=/empty FPATH=/empty; export PATH FPATH
122967594505Smrg    test "X`printf %s $ECHO`" = "X$ECHO" \
123067594505Smrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
1231b042e37fSmrg
123267594505Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
123367594505Smrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
123467594505Smrg])# _LT_PROG_ECHO_BACKSLASH
1235b042e37fSmrg
1236b042e37fSmrg
12378bd17e5fSmrg# _LT_WITH_SYSROOT
12388bd17e5fSmrg# ----------------
12398bd17e5fSmrgAC_DEFUN([_LT_WITH_SYSROOT],
12408bd17e5fSmrg[AC_MSG_CHECKING([for sysroot])
12418bd17e5fSmrgAC_ARG_WITH([sysroot],
12428bd17e5fSmrg[  --with-sysroot[=DIR] Search for dependent libraries within DIR
12438bd17e5fSmrg                        (or the compiler's sysroot if not specified).],
12448bd17e5fSmrg[], [with_sysroot=no])
1245b042e37fSmrg
12468bd17e5fSmrgdnl lt_sysroot will always be passed unquoted.  We quote it here
12478bd17e5fSmrgdnl in case the user passed a directory name.
12488bd17e5fSmrglt_sysroot=
12498bd17e5fSmrgcase ${with_sysroot} in #(
12508bd17e5fSmrg yes)
12518bd17e5fSmrg   if test "$GCC" = yes; then
12528bd17e5fSmrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
12538bd17e5fSmrg   fi
12548bd17e5fSmrg   ;; #(
12558bd17e5fSmrg /*)
12568bd17e5fSmrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
12578bd17e5fSmrg   ;; #(
12588bd17e5fSmrg no|'')
12598bd17e5fSmrg   ;; #(
12608bd17e5fSmrg *)
12618bd17e5fSmrg   AC_MSG_RESULT([${with_sysroot}])
12628bd17e5fSmrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
12638bd17e5fSmrg   ;;
12648bd17e5fSmrgesac
12658bd17e5fSmrg
12668bd17e5fSmrg AC_MSG_RESULT([${lt_sysroot:-no}])
12678bd17e5fSmrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
12688bd17e5fSmrg[dependent libraries, and in which our libraries should be installed.])])
12698bd17e5fSmrg
12708bd17e5fSmrg# _LT_ENABLE_LOCK
12718bd17e5fSmrg# ---------------
12728bd17e5fSmrgm4_defun([_LT_ENABLE_LOCK],
12738bd17e5fSmrg[AC_ARG_ENABLE([libtool-lock],
12748bd17e5fSmrg  [AS_HELP_STRING([--disable-libtool-lock],
12758bd17e5fSmrg    [avoid locking (might break parallel builds)])])
12768bd17e5fSmrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
12778bd17e5fSmrg
12788bd17e5fSmrg# Some flags need to be propagated to the compiler or linker for good
12798bd17e5fSmrg# libtool support.
12808bd17e5fSmrgcase $host in
12818bd17e5fSmrgia64-*-hpux*)
12828bd17e5fSmrg  # Find out which ABI we are using.
12838bd17e5fSmrg  echo 'int i;' > conftest.$ac_ext
12848bd17e5fSmrg  if AC_TRY_EVAL(ac_compile); then
12858bd17e5fSmrg    case `/usr/bin/file conftest.$ac_objext` in
12868bd17e5fSmrg      *ELF-32*)
12878bd17e5fSmrg	HPUX_IA64_MODE="32"
12880597fb56Smrg	;;
12898bd17e5fSmrg      *ELF-64*)
12908bd17e5fSmrg	HPUX_IA64_MODE="64"
12918bd17e5fSmrg	;;
12928bd17e5fSmrg    esac
12938bd17e5fSmrg  fi
12948bd17e5fSmrg  rm -rf conftest*
12958bd17e5fSmrg  ;;
12968bd17e5fSmrg*-*-irix6*)
12978bd17e5fSmrg  # Find out which ABI we are using.
12988bd17e5fSmrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
12998bd17e5fSmrg  if AC_TRY_EVAL(ac_compile); then
13008bd17e5fSmrg    if test "$lt_cv_prog_gnu_ld" = yes; then
13018bd17e5fSmrg      case `/usr/bin/file conftest.$ac_objext` in
13028bd17e5fSmrg	*32-bit*)
13038bd17e5fSmrg	  LD="${LD-ld} -melf32bsmip"
13048bd17e5fSmrg	  ;;
13058bd17e5fSmrg	*N32*)
13068bd17e5fSmrg	  LD="${LD-ld} -melf32bmipn32"
13078bd17e5fSmrg	  ;;
13088bd17e5fSmrg	*64-bit*)
13098bd17e5fSmrg	  LD="${LD-ld} -melf64bmip"
13100597fb56Smrg	;;
13110597fb56Smrg      esac
13128bd17e5fSmrg    else
13138bd17e5fSmrg      case `/usr/bin/file conftest.$ac_objext` in
13148bd17e5fSmrg	*32-bit*)
13158bd17e5fSmrg	  LD="${LD-ld} -32"
13168bd17e5fSmrg	  ;;
13178bd17e5fSmrg	*N32*)
13188bd17e5fSmrg	  LD="${LD-ld} -n32"
13198bd17e5fSmrg	  ;;
13208bd17e5fSmrg	*64-bit*)
13218bd17e5fSmrg	  LD="${LD-ld} -64"
13228bd17e5fSmrg	  ;;
13238bd17e5fSmrg      esac
13248bd17e5fSmrg    fi
13250597fb56Smrg  fi
13268bd17e5fSmrg  rm -rf conftest*
13270597fb56Smrg  ;;
1328b042e37fSmrg
132967594505Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
13308bd17e5fSmrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
13318bd17e5fSmrg  # Find out which ABI we are using.
13328bd17e5fSmrg  echo 'int i;' > conftest.$ac_ext
13338bd17e5fSmrg  if AC_TRY_EVAL(ac_compile); then
13348bd17e5fSmrg    case `/usr/bin/file conftest.o` in
13358bd17e5fSmrg      *32-bit*)
13368bd17e5fSmrg	case $host in
13378bd17e5fSmrg	  x86_64-*kfreebsd*-gnu)
13388bd17e5fSmrg	    LD="${LD-ld} -m elf_i386_fbsd"
13398bd17e5fSmrg	    ;;
13408bd17e5fSmrg	  x86_64-*linux*)
1341b242714cSmrg	    case `/usr/bin/file conftest.o` in
1342b242714cSmrg	      *x86-64*)
1343b242714cSmrg		LD="${LD-ld} -m elf32_x86_64"
1344b242714cSmrg		;;
1345b242714cSmrg	      *)
1346b242714cSmrg		LD="${LD-ld} -m elf_i386"
1347b242714cSmrg		;;
1348b242714cSmrg	    esac
13498bd17e5fSmrg	    ;;
1350b242714cSmrg	  powerpc64le-*)
135167594505Smrg	    LD="${LD-ld} -m elf32lppclinux"
135267594505Smrg	    ;;
1353b242714cSmrg	  powerpc64-*)
13548bd17e5fSmrg	    LD="${LD-ld} -m elf32ppclinux"
13558bd17e5fSmrg	    ;;
13568bd17e5fSmrg	  s390x-*linux*)
13578bd17e5fSmrg	    LD="${LD-ld} -m elf_s390"
13588bd17e5fSmrg	    ;;
13598bd17e5fSmrg	  sparc64-*linux*)
13608bd17e5fSmrg	    LD="${LD-ld} -m elf32_sparc"
13618bd17e5fSmrg	    ;;
13628bd17e5fSmrg	esac
13638bd17e5fSmrg	;;
13648bd17e5fSmrg      *64-bit*)
13658bd17e5fSmrg	case $host in
13668bd17e5fSmrg	  x86_64-*kfreebsd*-gnu)
13678bd17e5fSmrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
13688bd17e5fSmrg	    ;;
13698bd17e5fSmrg	  x86_64-*linux*)
13708bd17e5fSmrg	    LD="${LD-ld} -m elf_x86_64"
13718bd17e5fSmrg	    ;;
1372b242714cSmrg	  powerpcle-*)
137367594505Smrg	    LD="${LD-ld} -m elf64lppc"
137467594505Smrg	    ;;
1375b242714cSmrg	  powerpc-*)
13768bd17e5fSmrg	    LD="${LD-ld} -m elf64ppc"
13778bd17e5fSmrg	    ;;
13788bd17e5fSmrg	  s390*-*linux*|s390*-*tpf*)
13798bd17e5fSmrg	    LD="${LD-ld} -m elf64_s390"
13808bd17e5fSmrg	    ;;
13818bd17e5fSmrg	  sparc*-*linux*)
13828bd17e5fSmrg	    LD="${LD-ld} -m elf64_sparc"
13838bd17e5fSmrg	    ;;
13848bd17e5fSmrg	esac
13858bd17e5fSmrg	;;
13868bd17e5fSmrg    esac
13878bd17e5fSmrg  fi
13888bd17e5fSmrg  rm -rf conftest*
13890597fb56Smrg  ;;
1390b042e37fSmrg
13918bd17e5fSmrg*-*-sco3.2v5*)
13928bd17e5fSmrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
13938bd17e5fSmrg  SAVE_CFLAGS="$CFLAGS"
13948bd17e5fSmrg  CFLAGS="$CFLAGS -belf"
13958bd17e5fSmrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
13968bd17e5fSmrg    [AC_LANG_PUSH(C)
13978bd17e5fSmrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
13988bd17e5fSmrg     AC_LANG_POP])
13998bd17e5fSmrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
14008bd17e5fSmrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
14018bd17e5fSmrg    CFLAGS="$SAVE_CFLAGS"
14028bd17e5fSmrg  fi
14030597fb56Smrg  ;;
14048bd17e5fSmrg*-*solaris*)
14058bd17e5fSmrg  # Find out which ABI we are using.
14068bd17e5fSmrg  echo 'int i;' > conftest.$ac_ext
14078bd17e5fSmrg  if AC_TRY_EVAL(ac_compile); then
14088bd17e5fSmrg    case `/usr/bin/file conftest.o` in
14098bd17e5fSmrg    *64-bit*)
14108bd17e5fSmrg      case $lt_cv_prog_gnu_ld in
14118bd17e5fSmrg      yes*)
14128bd17e5fSmrg        case $host in
14138bd17e5fSmrg        i?86-*-solaris*)
14148bd17e5fSmrg          LD="${LD-ld} -m elf_x86_64"
14158bd17e5fSmrg          ;;
14168bd17e5fSmrg        sparc*-*-solaris*)
14178bd17e5fSmrg          LD="${LD-ld} -m elf64_sparc"
14188bd17e5fSmrg          ;;
14198bd17e5fSmrg        esac
14208bd17e5fSmrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
14218bd17e5fSmrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
14228bd17e5fSmrg          LD="${LD-ld}_sol2"
14238bd17e5fSmrg        fi
14248bd17e5fSmrg        ;;
14258bd17e5fSmrg      *)
14268bd17e5fSmrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
14278bd17e5fSmrg	  LD="${LD-ld} -64"
14288bd17e5fSmrg	fi
14298bd17e5fSmrg	;;
14308bd17e5fSmrg      esac
14318bd17e5fSmrg      ;;
14328bd17e5fSmrg    esac
14338bd17e5fSmrg  fi
14348bd17e5fSmrg  rm -rf conftest*
14350597fb56Smrg  ;;
14368bd17e5fSmrgesac
14378c4a8e55Smrg
14388bd17e5fSmrgneed_locks="$enable_libtool_lock"
14398bd17e5fSmrg])# _LT_ENABLE_LOCK
1440b042e37fSmrg
14418c4a8e55Smrg
14428bd17e5fSmrg# _LT_PROG_AR
14438bd17e5fSmrg# -----------
14448bd17e5fSmrgm4_defun([_LT_PROG_AR],
14458bd17e5fSmrg[AC_CHECK_TOOLS(AR, [ar], false)
14468bd17e5fSmrg: ${AR=ar}
14478bd17e5fSmrg: ${AR_FLAGS=cru}
14488bd17e5fSmrg_LT_DECL([], [AR], [1], [The archiver])
14498bd17e5fSmrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
14508c4a8e55Smrg
14518bd17e5fSmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
14528bd17e5fSmrg  [lt_cv_ar_at_file=no
14538bd17e5fSmrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
14548bd17e5fSmrg     [echo conftest.$ac_objext > conftest.lst
14558bd17e5fSmrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
14568bd17e5fSmrg      AC_TRY_EVAL([lt_ar_try])
14578bd17e5fSmrg      if test "$ac_status" -eq 0; then
14588bd17e5fSmrg	# Ensure the archiver fails upon bogus file names.
14598bd17e5fSmrg	rm -f conftest.$ac_objext libconftest.a
14608bd17e5fSmrg	AC_TRY_EVAL([lt_ar_try])
14618bd17e5fSmrg	if test "$ac_status" -ne 0; then
14628bd17e5fSmrg          lt_cv_ar_at_file=@
14638bd17e5fSmrg        fi
14648bd17e5fSmrg      fi
14658bd17e5fSmrg      rm -f conftest.* libconftest.a
14668bd17e5fSmrg     ])
14678bd17e5fSmrg  ])
1468b042e37fSmrg
14698bd17e5fSmrgif test "x$lt_cv_ar_at_file" = xno; then
14708bd17e5fSmrg  archiver_list_spec=
14718bd17e5fSmrgelse
14728bd17e5fSmrg  archiver_list_spec=$lt_cv_ar_at_file
14738bd17e5fSmrgfi
14748bd17e5fSmrg_LT_DECL([], [archiver_list_spec], [1],
14758bd17e5fSmrg  [How to feed a file listing to the archiver])
14768bd17e5fSmrg])# _LT_PROG_AR
1477b042e37fSmrg
1478b042e37fSmrg
14798bd17e5fSmrg# _LT_CMD_OLD_ARCHIVE
14808bd17e5fSmrg# -------------------
14818bd17e5fSmrgm4_defun([_LT_CMD_OLD_ARCHIVE],
14828bd17e5fSmrg[_LT_PROG_AR
1483b042e37fSmrg
14848bd17e5fSmrgAC_CHECK_TOOL(STRIP, strip, :)
14858bd17e5fSmrgtest -z "$STRIP" && STRIP=:
14868bd17e5fSmrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1487b042e37fSmrg
14888bd17e5fSmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
14898bd17e5fSmrgtest -z "$RANLIB" && RANLIB=:
14908bd17e5fSmrg_LT_DECL([], [RANLIB], [1],
14918bd17e5fSmrg    [Commands used to install an old-style archive])
1492b042e37fSmrg
14938bd17e5fSmrg# Determine commands to create old-style static archives.
14948bd17e5fSmrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
14958bd17e5fSmrgold_postinstall_cmds='chmod 644 $oldlib'
14968bd17e5fSmrgold_postuninstall_cmds=
14978c4a8e55Smrg
14988bd17e5fSmrgif test -n "$RANLIB"; then
14998bd17e5fSmrg  case $host_os in
15008bd17e5fSmrg  openbsd*)
15018bd17e5fSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
15028bd17e5fSmrg    ;;
15038bd17e5fSmrg  *)
15048bd17e5fSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
15058bd17e5fSmrg    ;;
15068bd17e5fSmrg  esac
15078bd17e5fSmrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
15088bd17e5fSmrgfi
1509b042e37fSmrg
15108bd17e5fSmrgcase $host_os in
15118bd17e5fSmrg  darwin*)
15128bd17e5fSmrg    lock_old_archive_extraction=yes ;;
15138bd17e5fSmrg  *)
15148bd17e5fSmrg    lock_old_archive_extraction=no ;;
15158bd17e5fSmrgesac
15168bd17e5fSmrg_LT_DECL([], [old_postinstall_cmds], [2])
15178bd17e5fSmrg_LT_DECL([], [old_postuninstall_cmds], [2])
15188bd17e5fSmrg_LT_TAGDECL([], [old_archive_cmds], [2],
15198bd17e5fSmrg    [Commands used to build an old-style archive])
15208bd17e5fSmrg_LT_DECL([], [lock_old_archive_extraction], [0],
15218bd17e5fSmrg    [Whether to use a lock for old archive extraction])
15228bd17e5fSmrg])# _LT_CMD_OLD_ARCHIVE
1523b042e37fSmrg
1524b042e37fSmrg
15258bd17e5fSmrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
15268bd17e5fSmrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
15278bd17e5fSmrg# ----------------------------------------------------------------
15288bd17e5fSmrg# Check whether the given compiler option works
15298bd17e5fSmrgAC_DEFUN([_LT_COMPILER_OPTION],
15308bd17e5fSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
15318bd17e5fSmrgm4_require([_LT_DECL_SED])dnl
15328bd17e5fSmrgAC_CACHE_CHECK([$1], [$2],
15338bd17e5fSmrg  [$2=no
15348bd17e5fSmrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
15358bd17e5fSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
15368bd17e5fSmrg   lt_compiler_flag="$3"
15378bd17e5fSmrg   # Insert the option either (1) after the last *FLAGS variable, or
15388bd17e5fSmrg   # (2) before a word containing "conftest.", or (3) at the end.
15398bd17e5fSmrg   # Note that $ac_compile itself does not contain backslashes and begins
15408bd17e5fSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
15418bd17e5fSmrg   # The option is referenced via a variable to avoid confusing sed.
15428bd17e5fSmrg   lt_compile=`echo "$ac_compile" | $SED \
15438bd17e5fSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
15448bd17e5fSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
15458bd17e5fSmrg   -e 's:$: $lt_compiler_flag:'`
15468bd17e5fSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
15478bd17e5fSmrg   (eval "$lt_compile" 2>conftest.err)
15488bd17e5fSmrg   ac_status=$?
15498bd17e5fSmrg   cat conftest.err >&AS_MESSAGE_LOG_FD
15508bd17e5fSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
15518bd17e5fSmrg   if (exit $ac_status) && test -s "$ac_outfile"; then
15528bd17e5fSmrg     # The compiler can only warn and ignore the option if not recognized
15538bd17e5fSmrg     # So say no if there are warnings other than the usual output.
15548bd17e5fSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
15558bd17e5fSmrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
15568bd17e5fSmrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
15578bd17e5fSmrg       $2=yes
15588bd17e5fSmrg     fi
15598bd17e5fSmrg   fi
15608bd17e5fSmrg   $RM conftest*
15618bd17e5fSmrg])
15628bd17e5fSmrg
15638bd17e5fSmrgif test x"[$]$2" = xyes; then
15648bd17e5fSmrg    m4_if([$5], , :, [$5])
15650597fb56Smrgelse
15668bd17e5fSmrg    m4_if([$6], , :, [$6])
15670597fb56Smrgfi
15688bd17e5fSmrg])# _LT_COMPILER_OPTION
1569b042e37fSmrg
15700597fb56Smrg# Old name:
15718bd17e5fSmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
15720597fb56Smrgdnl aclocal-1.4 backwards compatibility:
15738bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1574706b6b52Smrg
1575706b6b52Smrg
15768bd17e5fSmrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
15778bd17e5fSmrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
15788bd17e5fSmrg# ----------------------------------------------------
15798bd17e5fSmrg# Check whether the given linker option works
15808bd17e5fSmrgAC_DEFUN([_LT_LINKER_OPTION],
15818bd17e5fSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
15828bd17e5fSmrgm4_require([_LT_DECL_SED])dnl
15838bd17e5fSmrgAC_CACHE_CHECK([$1], [$2],
15848bd17e5fSmrg  [$2=no
15858bd17e5fSmrg   save_LDFLAGS="$LDFLAGS"
15868bd17e5fSmrg   LDFLAGS="$LDFLAGS $3"
15878bd17e5fSmrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
15888bd17e5fSmrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
15898bd17e5fSmrg     # The linker can only warn and ignore the option if not recognized
15908bd17e5fSmrg     # So say no if there are warnings
15918bd17e5fSmrg     if test -s conftest.err; then
15928bd17e5fSmrg       # Append any errors to the config.log.
15938bd17e5fSmrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
15948bd17e5fSmrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
15958bd17e5fSmrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
15968bd17e5fSmrg       if diff conftest.exp conftest.er2 >/dev/null; then
15978bd17e5fSmrg         $2=yes
15988bd17e5fSmrg       fi
15998bd17e5fSmrg     else
16008bd17e5fSmrg       $2=yes
16018bd17e5fSmrg     fi
16028bd17e5fSmrg   fi
16038bd17e5fSmrg   $RM -r conftest*
16048bd17e5fSmrg   LDFLAGS="$save_LDFLAGS"
16058bd17e5fSmrg])
16068bd17e5fSmrg
16078bd17e5fSmrgif test x"[$]$2" = xyes; then
16088bd17e5fSmrg    m4_if([$4], , :, [$4])
16098bd17e5fSmrgelse
16108bd17e5fSmrg    m4_if([$5], , :, [$5])
16110597fb56Smrgfi
16128bd17e5fSmrg])# _LT_LINKER_OPTION
1613706b6b52Smrg
16148bd17e5fSmrg# Old name:
16158bd17e5fSmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
16168bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
16178bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1618706b6b52Smrg
1619706b6b52Smrg
16208bd17e5fSmrg# LT_CMD_MAX_LEN
16218bd17e5fSmrg#---------------
16228bd17e5fSmrgAC_DEFUN([LT_CMD_MAX_LEN],
16238bd17e5fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
16248bd17e5fSmrg# find the maximum length of command line arguments
16258bd17e5fSmrgAC_MSG_CHECKING([the maximum length of command line arguments])
16268bd17e5fSmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
16278bd17e5fSmrg  i=0
16288bd17e5fSmrg  teststring="ABCD"
1629b042e37fSmrg
16308bd17e5fSmrg  case $build_os in
16318bd17e5fSmrg  msdosdjgpp*)
16328bd17e5fSmrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
16338bd17e5fSmrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
16348bd17e5fSmrg    # during glob expansion).  Even if it were fixed, the result of this
16358bd17e5fSmrg    # check would be larger than it should be.
16368bd17e5fSmrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
16370597fb56Smrg    ;;
16388bd17e5fSmrg
16398bd17e5fSmrg  gnu*)
16408bd17e5fSmrg    # Under GNU Hurd, this test is not required because there is
16418bd17e5fSmrg    # no limit to the length of command line arguments.
16428bd17e5fSmrg    # Libtool will interpret -1 as no limit whatsoever
16438bd17e5fSmrg    lt_cv_sys_max_cmd_len=-1;
16440597fb56Smrg    ;;
1645b042e37fSmrg
16468bd17e5fSmrg  cygwin* | mingw* | cegcc*)
16478bd17e5fSmrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
16488bd17e5fSmrg    # about 5 minutes as the teststring grows exponentially.
16498bd17e5fSmrg    # Worse, since 9x/ME are not pre-emptively multitasking,
16508bd17e5fSmrg    # you end up with a "frozen" computer, even though with patience
16518bd17e5fSmrg    # the test eventually succeeds (with a max line length of 256k).
16528bd17e5fSmrg    # Instead, let's just punt: use the minimum linelength reported by
16538bd17e5fSmrg    # all of the supported platforms: 8192 (on NT/2K/XP).
16548bd17e5fSmrg    lt_cv_sys_max_cmd_len=8192;
16558bd17e5fSmrg    ;;
1656b042e37fSmrg
16578bd17e5fSmrg  mint*)
16588bd17e5fSmrg    # On MiNT this can take a long time and run out of memory.
16598bd17e5fSmrg    lt_cv_sys_max_cmd_len=8192;
16608bd17e5fSmrg    ;;
1661b042e37fSmrg
16628bd17e5fSmrg  amigaos*)
16638bd17e5fSmrg    # On AmigaOS with pdksh, this test takes hours, literally.
16648bd17e5fSmrg    # So we just punt and use a minimum line length of 8192.
16658bd17e5fSmrg    lt_cv_sys_max_cmd_len=8192;
16668bd17e5fSmrg    ;;
1667b042e37fSmrg
16688bd17e5fSmrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
16698bd17e5fSmrg    # This has been around since 386BSD, at least.  Likely further.
16708bd17e5fSmrg    if test -x /sbin/sysctl; then
16718bd17e5fSmrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
16728bd17e5fSmrg    elif test -x /usr/sbin/sysctl; then
16738bd17e5fSmrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
16748bd17e5fSmrg    else
16758bd17e5fSmrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
16768bd17e5fSmrg    fi
16778bd17e5fSmrg    # And add a safety zone
16788bd17e5fSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
16798bd17e5fSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
16808bd17e5fSmrg    ;;
1681b042e37fSmrg
16828bd17e5fSmrg  interix*)
16838bd17e5fSmrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
16848bd17e5fSmrg    lt_cv_sys_max_cmd_len=196608
16858bd17e5fSmrg    ;;
1686b042e37fSmrg
16878bd17e5fSmrg  os2*)
16888bd17e5fSmrg    # The test takes a long time on OS/2.
16898bd17e5fSmrg    lt_cv_sys_max_cmd_len=8192
16908bd17e5fSmrg    ;;
16918bd17e5fSmrg
16928bd17e5fSmrg  osf*)
16938bd17e5fSmrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
16948bd17e5fSmrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
16958bd17e5fSmrg    # nice to cause kernel panics so lets avoid the loop below.
16968bd17e5fSmrg    # First set a reasonable default.
16978bd17e5fSmrg    lt_cv_sys_max_cmd_len=16384
16988bd17e5fSmrg    #
16998bd17e5fSmrg    if test -x /sbin/sysconfig; then
17008bd17e5fSmrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
17018bd17e5fSmrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
17028bd17e5fSmrg      esac
17030597fb56Smrg    fi
17040597fb56Smrg    ;;
17058bd17e5fSmrg  sco3.2v5*)
17068bd17e5fSmrg    lt_cv_sys_max_cmd_len=102400
17078bd17e5fSmrg    ;;
17088bd17e5fSmrg  sysv5* | sco5v6* | sysv4.2uw2*)
17098bd17e5fSmrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
17108bd17e5fSmrg    if test -n "$kargmax"; then
17118bd17e5fSmrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
17120597fb56Smrg    else
17138bd17e5fSmrg      lt_cv_sys_max_cmd_len=32768
17140597fb56Smrg    fi
17150597fb56Smrg    ;;
17168bd17e5fSmrg  *)
17178bd17e5fSmrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1718b242714cSmrg    if test -n "$lt_cv_sys_max_cmd_len" && \
1719b242714cSmrg	test undefined != "$lt_cv_sys_max_cmd_len"; then
17208bd17e5fSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
17218bd17e5fSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
17228bd17e5fSmrg    else
17238bd17e5fSmrg      # Make teststring a little bigger before we do anything with it.
17248bd17e5fSmrg      # a 1K string should be a reasonable start.
17258bd17e5fSmrg      for i in 1 2 3 4 5 6 7 8 ; do
17268bd17e5fSmrg        teststring=$teststring$teststring
17278bd17e5fSmrg      done
17288bd17e5fSmrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
17298bd17e5fSmrg      # If test is not a shell built-in, we'll probably end up computing a
17308bd17e5fSmrg      # maximum length that is only half of the actual maximum length, but
17318bd17e5fSmrg      # we can't tell.
17328bd17e5fSmrg      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
17338bd17e5fSmrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
17348bd17e5fSmrg	      test $i != 17 # 1/2 MB should be enough
17358bd17e5fSmrg      do
17368bd17e5fSmrg        i=`expr $i + 1`
17378bd17e5fSmrg        teststring=$teststring$teststring
17388bd17e5fSmrg      done
17398bd17e5fSmrg      # Only check the string length outside the loop.
17408bd17e5fSmrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
17418bd17e5fSmrg      teststring=
17428bd17e5fSmrg      # Add a significant safety factor because C++ compilers can tack on
17438bd17e5fSmrg      # massive amounts of additional arguments before passing them to the
17448bd17e5fSmrg      # linker.  It appears as though 1/2 is a usable value.
17458bd17e5fSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
17468bd17e5fSmrg    fi
17478bd17e5fSmrg    ;;
17488bd17e5fSmrg  esac
17498bd17e5fSmrg])
17508bd17e5fSmrgif test -n $lt_cv_sys_max_cmd_len ; then
17518bd17e5fSmrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
17528bd17e5fSmrgelse
17538bd17e5fSmrg  AC_MSG_RESULT(none)
17548bd17e5fSmrgfi
17558bd17e5fSmrgmax_cmd_len=$lt_cv_sys_max_cmd_len
17568bd17e5fSmrg_LT_DECL([], [max_cmd_len], [0],
17578bd17e5fSmrg    [What is the maximum length of a command?])
17588bd17e5fSmrg])# LT_CMD_MAX_LEN
1759b042e37fSmrg
17608bd17e5fSmrg# Old name:
17618bd17e5fSmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
17628bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
17638bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
17648c4a8e55Smrg
1765b042e37fSmrg
17668bd17e5fSmrg# _LT_HEADER_DLFCN
17678bd17e5fSmrg# ----------------
17688bd17e5fSmrgm4_defun([_LT_HEADER_DLFCN],
17698bd17e5fSmrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
17708bd17e5fSmrg])# _LT_HEADER_DLFCN
1771b042e37fSmrg
1772b042e37fSmrg
17738bd17e5fSmrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
17748bd17e5fSmrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
17758bd17e5fSmrg# ----------------------------------------------------------------
17768bd17e5fSmrgm4_defun([_LT_TRY_DLOPEN_SELF],
17778bd17e5fSmrg[m4_require([_LT_HEADER_DLFCN])dnl
17788bd17e5fSmrgif test "$cross_compiling" = yes; then :
17798bd17e5fSmrg  [$4]
17808bd17e5fSmrgelse
17818bd17e5fSmrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
17828bd17e5fSmrg  lt_status=$lt_dlunknown
17838bd17e5fSmrg  cat > conftest.$ac_ext <<_LT_EOF
17848bd17e5fSmrg[#line $LINENO "configure"
17858bd17e5fSmrg#include "confdefs.h"
17868c4a8e55Smrg
17878bd17e5fSmrg#if HAVE_DLFCN_H
17888bd17e5fSmrg#include <dlfcn.h>
17898bd17e5fSmrg#endif
17908c4a8e55Smrg
17918bd17e5fSmrg#include <stdio.h>
1792b042e37fSmrg
17938bd17e5fSmrg#ifdef RTLD_GLOBAL
17948bd17e5fSmrg#  define LT_DLGLOBAL		RTLD_GLOBAL
17958bd17e5fSmrg#else
17968bd17e5fSmrg#  ifdef DL_GLOBAL
17978bd17e5fSmrg#    define LT_DLGLOBAL		DL_GLOBAL
17988bd17e5fSmrg#  else
17998bd17e5fSmrg#    define LT_DLGLOBAL		0
18008bd17e5fSmrg#  endif
18018bd17e5fSmrg#endif
1802b042e37fSmrg
18038bd17e5fSmrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
18048bd17e5fSmrg   find out it does not work in some platform. */
18058bd17e5fSmrg#ifndef LT_DLLAZY_OR_NOW
18068bd17e5fSmrg#  ifdef RTLD_LAZY
18078bd17e5fSmrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
18088bd17e5fSmrg#  else
18098bd17e5fSmrg#    ifdef DL_LAZY
18108bd17e5fSmrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
18118bd17e5fSmrg#    else
18128bd17e5fSmrg#      ifdef RTLD_NOW
18138bd17e5fSmrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
18148bd17e5fSmrg#      else
18158bd17e5fSmrg#        ifdef DL_NOW
18168bd17e5fSmrg#          define LT_DLLAZY_OR_NOW	DL_NOW
18178bd17e5fSmrg#        else
18188bd17e5fSmrg#          define LT_DLLAZY_OR_NOW	0
18198bd17e5fSmrg#        endif
18208bd17e5fSmrg#      endif
18218bd17e5fSmrg#    endif
18228bd17e5fSmrg#  endif
18238bd17e5fSmrg#endif
18248c4a8e55Smrg
18258bd17e5fSmrg/* When -fvisbility=hidden is used, assume the code has been annotated
18268bd17e5fSmrg   correspondingly for the symbols needed.  */
18278bd17e5fSmrg#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
18288bd17e5fSmrgint fnord () __attribute__((visibility("default")));
18298bd17e5fSmrg#endif
1830b042e37fSmrg
18318bd17e5fSmrgint fnord () { return 42; }
18328bd17e5fSmrgint main ()
18338bd17e5fSmrg{
18348bd17e5fSmrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
18358bd17e5fSmrg  int status = $lt_dlunknown;
1836b042e37fSmrg
18378bd17e5fSmrg  if (self)
18388bd17e5fSmrg    {
18398bd17e5fSmrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
18408bd17e5fSmrg      else
18418bd17e5fSmrg        {
18428bd17e5fSmrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
18438bd17e5fSmrg          else puts (dlerror ());
18448bd17e5fSmrg	}
18458bd17e5fSmrg      /* dlclose (self); */
18468bd17e5fSmrg    }
18478bd17e5fSmrg  else
18488bd17e5fSmrg    puts (dlerror ());
18498bd17e5fSmrg
18508bd17e5fSmrg  return status;
18518bd17e5fSmrg}]
18528bd17e5fSmrg_LT_EOF
18538bd17e5fSmrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
18548bd17e5fSmrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
18558bd17e5fSmrg    lt_status=$?
18568bd17e5fSmrg    case x$lt_status in
18578bd17e5fSmrg      x$lt_dlno_uscore) $1 ;;
18588bd17e5fSmrg      x$lt_dlneed_uscore) $2 ;;
18598bd17e5fSmrg      x$lt_dlunknown|x*) $3 ;;
18608bd17e5fSmrg    esac
18618bd17e5fSmrg  else :
18628bd17e5fSmrg    # compilation failed
18638bd17e5fSmrg    $3
18648bd17e5fSmrg  fi
18658bd17e5fSmrgfi
18668bd17e5fSmrgrm -fr conftest*
18678bd17e5fSmrg])# _LT_TRY_DLOPEN_SELF
18688bd17e5fSmrg
18698bd17e5fSmrg
18708bd17e5fSmrg# LT_SYS_DLOPEN_SELF
18718bd17e5fSmrg# ------------------
18728bd17e5fSmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
18738bd17e5fSmrg[m4_require([_LT_HEADER_DLFCN])dnl
18748bd17e5fSmrgif test "x$enable_dlopen" != xyes; then
18758bd17e5fSmrg  enable_dlopen=unknown
18768bd17e5fSmrg  enable_dlopen_self=unknown
18778bd17e5fSmrg  enable_dlopen_self_static=unknown
18788bd17e5fSmrgelse
18798bd17e5fSmrg  lt_cv_dlopen=no
18808bd17e5fSmrg  lt_cv_dlopen_libs=
18818bd17e5fSmrg
18828bd17e5fSmrg  case $host_os in
18838bd17e5fSmrg  beos*)
18848bd17e5fSmrg    lt_cv_dlopen="load_add_on"
18858bd17e5fSmrg    lt_cv_dlopen_libs=
18868bd17e5fSmrg    lt_cv_dlopen_self=yes
18870597fb56Smrg    ;;
18888bd17e5fSmrg
18898bd17e5fSmrg  mingw* | pw32* | cegcc*)
18908bd17e5fSmrg    lt_cv_dlopen="LoadLibrary"
18918bd17e5fSmrg    lt_cv_dlopen_libs=
18920597fb56Smrg    ;;
18938bd17e5fSmrg
18948bd17e5fSmrg  cygwin*)
18958bd17e5fSmrg    lt_cv_dlopen="dlopen"
18968bd17e5fSmrg    lt_cv_dlopen_libs=
18970597fb56Smrg    ;;
1898b042e37fSmrg
18998bd17e5fSmrg  darwin*)
19008bd17e5fSmrg  # if libdl is installed we need to link against it
19018bd17e5fSmrg    AC_CHECK_LIB([dl], [dlopen],
19028bd17e5fSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
19038bd17e5fSmrg    lt_cv_dlopen="dyld"
19048bd17e5fSmrg    lt_cv_dlopen_libs=
19058bd17e5fSmrg    lt_cv_dlopen_self=yes
19068bd17e5fSmrg    ])
19078bd17e5fSmrg    ;;
1908b042e37fSmrg
19098bd17e5fSmrg  *)
19108bd17e5fSmrg    AC_CHECK_FUNC([shl_load],
19118bd17e5fSmrg	  [lt_cv_dlopen="shl_load"],
19128bd17e5fSmrg      [AC_CHECK_LIB([dld], [shl_load],
19138bd17e5fSmrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
19148bd17e5fSmrg	[AC_CHECK_FUNC([dlopen],
19158bd17e5fSmrg	      [lt_cv_dlopen="dlopen"],
19168bd17e5fSmrg	  [AC_CHECK_LIB([dl], [dlopen],
19178bd17e5fSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
19188bd17e5fSmrg	    [AC_CHECK_LIB([svld], [dlopen],
19198bd17e5fSmrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
19208bd17e5fSmrg	      [AC_CHECK_LIB([dld], [dld_link],
19218bd17e5fSmrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
19228bd17e5fSmrg	      ])
19238bd17e5fSmrg	    ])
19248bd17e5fSmrg	  ])
19258bd17e5fSmrg	])
19268bd17e5fSmrg      ])
19278bd17e5fSmrg    ;;
19280597fb56Smrg  esac
1929b042e37fSmrg
19308bd17e5fSmrg  if test "x$lt_cv_dlopen" != xno; then
19318bd17e5fSmrg    enable_dlopen=yes
19320597fb56Smrg  else
19338bd17e5fSmrg    enable_dlopen=no
19340597fb56Smrg  fi
1935b042e37fSmrg
19368bd17e5fSmrg  case $lt_cv_dlopen in
19378bd17e5fSmrg  dlopen)
19388bd17e5fSmrg    save_CPPFLAGS="$CPPFLAGS"
19398bd17e5fSmrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1940b042e37fSmrg
19418bd17e5fSmrg    save_LDFLAGS="$LDFLAGS"
19428bd17e5fSmrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1943b042e37fSmrg
19448bd17e5fSmrg    save_LIBS="$LIBS"
19458bd17e5fSmrg    LIBS="$lt_cv_dlopen_libs $LIBS"
1946b042e37fSmrg
19478bd17e5fSmrg    AC_CACHE_CHECK([whether a program can dlopen itself],
19488bd17e5fSmrg	  lt_cv_dlopen_self, [dnl
19498bd17e5fSmrg	  _LT_TRY_DLOPEN_SELF(
19508bd17e5fSmrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
19518bd17e5fSmrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
19528bd17e5fSmrg    ])
19530597fb56Smrg
19548bd17e5fSmrg    if test "x$lt_cv_dlopen_self" = xyes; then
19558bd17e5fSmrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
19568bd17e5fSmrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
19578bd17e5fSmrg	  lt_cv_dlopen_self_static, [dnl
19588bd17e5fSmrg	  _LT_TRY_DLOPEN_SELF(
19598bd17e5fSmrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
19608bd17e5fSmrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
19618bd17e5fSmrg      ])
19628bd17e5fSmrg    fi
19630597fb56Smrg
19648bd17e5fSmrg    CPPFLAGS="$save_CPPFLAGS"
19658bd17e5fSmrg    LDFLAGS="$save_LDFLAGS"
19668bd17e5fSmrg    LIBS="$save_LIBS"
19670597fb56Smrg    ;;
19680597fb56Smrg  esac
19690597fb56Smrg
19708bd17e5fSmrg  case $lt_cv_dlopen_self in
19718bd17e5fSmrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
19728bd17e5fSmrg  *) enable_dlopen_self=unknown ;;
19738bd17e5fSmrg  esac
19740597fb56Smrg
19758bd17e5fSmrg  case $lt_cv_dlopen_self_static in
19768bd17e5fSmrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
19778bd17e5fSmrg  *) enable_dlopen_self_static=unknown ;;
19780597fb56Smrg  esac
19790597fb56Smrgfi
19808bd17e5fSmrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
19818bd17e5fSmrg	 [Whether dlopen is supported])
19828bd17e5fSmrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
19838bd17e5fSmrg	 [Whether dlopen of programs is supported])
19848bd17e5fSmrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
19858bd17e5fSmrg	 [Whether dlopen of statically linked programs is supported])
19868bd17e5fSmrg])# LT_SYS_DLOPEN_SELF
1987b042e37fSmrg
19888bd17e5fSmrg# Old name:
19898bd17e5fSmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
19908bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
19918bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1992b042e37fSmrg
1993b042e37fSmrg
19948bd17e5fSmrg# _LT_COMPILER_C_O([TAGNAME])
19958bd17e5fSmrg# ---------------------------
19968bd17e5fSmrg# Check to see if options -c and -o are simultaneously supported by compiler.
19978bd17e5fSmrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
19988bd17e5fSmrgm4_defun([_LT_COMPILER_C_O],
19998bd17e5fSmrg[m4_require([_LT_DECL_SED])dnl
20008bd17e5fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
20018bd17e5fSmrgm4_require([_LT_TAG_COMPILER])dnl
20028bd17e5fSmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
20038bd17e5fSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
20048bd17e5fSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
20058bd17e5fSmrg   $RM -r conftest 2>/dev/null
20068bd17e5fSmrg   mkdir conftest
20078bd17e5fSmrg   cd conftest
20088bd17e5fSmrg   mkdir out
20098bd17e5fSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
20100597fb56Smrg
20118bd17e5fSmrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
20128bd17e5fSmrg   # Insert the option either (1) after the last *FLAGS variable, or
20138bd17e5fSmrg   # (2) before a word containing "conftest.", or (3) at the end.
20148bd17e5fSmrg   # Note that $ac_compile itself does not contain backslashes and begins
20158bd17e5fSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
20168bd17e5fSmrg   lt_compile=`echo "$ac_compile" | $SED \
20178bd17e5fSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
20188bd17e5fSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
20198bd17e5fSmrg   -e 's:$: $lt_compiler_flag:'`
20208bd17e5fSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
20218bd17e5fSmrg   (eval "$lt_compile" 2>out/conftest.err)
20228bd17e5fSmrg   ac_status=$?
20238bd17e5fSmrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
20248bd17e5fSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
20258bd17e5fSmrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
20268bd17e5fSmrg   then
20278bd17e5fSmrg     # The compiler can only warn and ignore the option if not recognized
20288bd17e5fSmrg     # So say no if there are warnings
20298bd17e5fSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
20308bd17e5fSmrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
20318bd17e5fSmrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
20328bd17e5fSmrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
20338bd17e5fSmrg     fi
20348bd17e5fSmrg   fi
20358bd17e5fSmrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
20368bd17e5fSmrg   $RM conftest*
20378bd17e5fSmrg   # SGI C++ compiler will create directory out/ii_files/ for
20388bd17e5fSmrg   # template instantiation
20398bd17e5fSmrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
20408bd17e5fSmrg   $RM out/* && rmdir out
20418bd17e5fSmrg   cd ..
20428bd17e5fSmrg   $RM -r conftest
20438bd17e5fSmrg   $RM conftest*
20448bd17e5fSmrg])
20458bd17e5fSmrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
20468bd17e5fSmrg	[Does compiler simultaneously support -c and -o options?])
20478bd17e5fSmrg])# _LT_COMPILER_C_O
20488bd17e5fSmrg
20498bd17e5fSmrg
20508bd17e5fSmrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
20518bd17e5fSmrg# ----------------------------------
20528bd17e5fSmrg# Check to see if we can do hard links to lock some files if needed
20538bd17e5fSmrgm4_defun([_LT_COMPILER_FILE_LOCKS],
20548bd17e5fSmrg[m4_require([_LT_ENABLE_LOCK])dnl
20558bd17e5fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
20568bd17e5fSmrg_LT_COMPILER_C_O([$1])
20578bd17e5fSmrg
20588bd17e5fSmrghard_links="nottested"
20598bd17e5fSmrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
20608bd17e5fSmrg  # do not overwrite the value of need_locks provided by the user
20618bd17e5fSmrg  AC_MSG_CHECKING([if we can lock with hard links])
20628bd17e5fSmrg  hard_links=yes
20638bd17e5fSmrg  $RM conftest*
20648bd17e5fSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
20658bd17e5fSmrg  touch conftest.a
20668bd17e5fSmrg  ln conftest.a conftest.b 2>&5 || hard_links=no
20678bd17e5fSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
20688bd17e5fSmrg  AC_MSG_RESULT([$hard_links])
20698bd17e5fSmrg  if test "$hard_links" = no; then
20708bd17e5fSmrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
20718bd17e5fSmrg    need_locks=warn
2072706b6b52Smrg  fi
20730597fb56Smrgelse
20748bd17e5fSmrg  need_locks=no
20758bd17e5fSmrgfi
20768bd17e5fSmrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
20778bd17e5fSmrg])# _LT_COMPILER_FILE_LOCKS
20788bd17e5fSmrg
20798bd17e5fSmrg
20808bd17e5fSmrg# _LT_CHECK_OBJDIR
20818bd17e5fSmrg# ----------------
20828bd17e5fSmrgm4_defun([_LT_CHECK_OBJDIR],
20838bd17e5fSmrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
20848bd17e5fSmrg[rm -f .libs 2>/dev/null
20858bd17e5fSmrgmkdir .libs 2>/dev/null
20868bd17e5fSmrgif test -d .libs; then
20878bd17e5fSmrg  lt_cv_objdir=.libs
20888bd17e5fSmrgelse
20898bd17e5fSmrg  # MS-DOS does not allow filenames that begin with a dot.
20908bd17e5fSmrg  lt_cv_objdir=_libs
20918bd17e5fSmrgfi
20928bd17e5fSmrgrmdir .libs 2>/dev/null])
20938bd17e5fSmrgobjdir=$lt_cv_objdir
20948bd17e5fSmrg_LT_DECL([], [objdir], [0],
20958bd17e5fSmrg         [The name of the directory that contains temporary libtool files])dnl
20968bd17e5fSmrgm4_pattern_allow([LT_OBJDIR])dnl
20978bd17e5fSmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
20988bd17e5fSmrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
20998bd17e5fSmrg])# _LT_CHECK_OBJDIR
21008bd17e5fSmrg
21018bd17e5fSmrg
21028bd17e5fSmrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
21038bd17e5fSmrg# --------------------------------------
21048bd17e5fSmrg# Check hardcoding attributes.
21058bd17e5fSmrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
21068bd17e5fSmrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
21078bd17e5fSmrg_LT_TAGVAR(hardcode_action, $1)=
21088bd17e5fSmrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
21098bd17e5fSmrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
21108bd17e5fSmrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
21118bd17e5fSmrg
21128bd17e5fSmrg  # We can hardcode non-existent directories.
21138bd17e5fSmrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
21148bd17e5fSmrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
21158bd17e5fSmrg     # have to relink, otherwise we might link with an installed library
21168bd17e5fSmrg     # when we should be linking with a yet-to-be-installed one
21178bd17e5fSmrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
21188bd17e5fSmrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
21198bd17e5fSmrg    # Linking always hardcodes the temporary library directory.
21208bd17e5fSmrg    _LT_TAGVAR(hardcode_action, $1)=relink
2121706b6b52Smrg  else
21228bd17e5fSmrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
21238bd17e5fSmrg    _LT_TAGVAR(hardcode_action, $1)=immediate
2124bd23fbfaSmrg  fi
21258bd17e5fSmrgelse
21268bd17e5fSmrg  # We cannot hardcode anything, or else we can only hardcode existing
21278bd17e5fSmrg  # directories.
21288bd17e5fSmrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
2129bd23fbfaSmrgfi
21308bd17e5fSmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2131b042e37fSmrg
21328bd17e5fSmrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
21338bd17e5fSmrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
21348bd17e5fSmrg  # Fast installation is not supported
21358bd17e5fSmrg  enable_fast_install=no
21368bd17e5fSmrgelif test "$shlibpath_overrides_runpath" = yes ||
21378bd17e5fSmrg     test "$enable_shared" = no; then
21388bd17e5fSmrg  # Fast installation is not necessary
21398bd17e5fSmrg  enable_fast_install=needless
21408bd17e5fSmrgfi
21418bd17e5fSmrg_LT_TAGDECL([], [hardcode_action], [0],
21428bd17e5fSmrg    [How to hardcode a shared library path into an executable])
21438bd17e5fSmrg])# _LT_LINKER_HARDCODE_LIBPATH
2144b042e37fSmrg
2145b042e37fSmrg
21468bd17e5fSmrg# _LT_CMD_STRIPLIB
21478bd17e5fSmrg# ----------------
21488bd17e5fSmrgm4_defun([_LT_CMD_STRIPLIB],
21490597fb56Smrg[m4_require([_LT_DECL_EGREP])
21508bd17e5fSmrgstriplib=
21518bd17e5fSmrgold_striplib=
21528bd17e5fSmrgAC_MSG_CHECKING([whether stripping libraries is possible])
21538bd17e5fSmrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
21548bd17e5fSmrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
21558bd17e5fSmrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
21568bd17e5fSmrg  AC_MSG_RESULT([yes])
21578bd17e5fSmrgelse
21588bd17e5fSmrg# FIXME - insert some real tests, host_os isn't really good enough
21598bd17e5fSmrg  case $host_os in
21608bd17e5fSmrg  darwin*)
21618bd17e5fSmrg    if test -n "$STRIP" ; then
21628bd17e5fSmrg      striplib="$STRIP -x"
21638bd17e5fSmrg      old_striplib="$STRIP -S"
21648bd17e5fSmrg      AC_MSG_RESULT([yes])
21658bd17e5fSmrg    else
21668bd17e5fSmrg      AC_MSG_RESULT([no])
21678bd17e5fSmrg    fi
21680597fb56Smrg    ;;
21690597fb56Smrg  *)
21708bd17e5fSmrg    AC_MSG_RESULT([no])
21710597fb56Smrg    ;;
21720597fb56Smrg  esac
2173706b6b52Smrgfi
21748bd17e5fSmrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
21758bd17e5fSmrg_LT_DECL([], [striplib], [1])
21768bd17e5fSmrg])# _LT_CMD_STRIPLIB
2177b042e37fSmrg
2178b042e37fSmrg
21798bd17e5fSmrg# _LT_SYS_DYNAMIC_LINKER([TAG])
21808bd17e5fSmrg# -----------------------------
21818bd17e5fSmrg# PORTME Fill in your ld.so characteristics
21828bd17e5fSmrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
21830597fb56Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
21848bd17e5fSmrgm4_require([_LT_DECL_EGREP])dnl
21858bd17e5fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
21868bd17e5fSmrgm4_require([_LT_DECL_OBJDUMP])dnl
21878bd17e5fSmrgm4_require([_LT_DECL_SED])dnl
21888bd17e5fSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
21898bd17e5fSmrgAC_MSG_CHECKING([dynamic linker characteristics])
21908bd17e5fSmrgm4_if([$1],
21918bd17e5fSmrg	[], [
21920597fb56Smrgif test "$GCC" = yes; then
21938bd17e5fSmrg  case $host_os in
21948bd17e5fSmrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
21958bd17e5fSmrg    *) lt_awk_arg="/^libraries:/" ;;
21968bd17e5fSmrg  esac
21978bd17e5fSmrg  case $host_os in
21988bd17e5fSmrg    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
21998bd17e5fSmrg    *) lt_sed_strip_eq="s,=/,/,g" ;;
22008bd17e5fSmrg  esac
22018bd17e5fSmrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
22028bd17e5fSmrg  case $lt_search_path_spec in
22038bd17e5fSmrg  *\;*)
22048bd17e5fSmrg    # if the path contains ";" then we assume it to be the separator
22058bd17e5fSmrg    # otherwise default to the standard path separator (i.e. ":") - it is
22068bd17e5fSmrg    # assumed that no part of a normal pathname contains ";" but that should
22078bd17e5fSmrg    # okay in the real world where ";" in dirpaths is itself problematic.
22088bd17e5fSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
22098bd17e5fSmrg    ;;
22100597fb56Smrg  *)
22118bd17e5fSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
22128bd17e5fSmrg    ;;
22130597fb56Smrg  esac
22148bd17e5fSmrg  # Ok, now we have the path, separated by spaces, we can step through it
22158bd17e5fSmrg  # and add multilib dir if necessary.
22168bd17e5fSmrg  lt_tmp_lt_search_path_spec=
22178bd17e5fSmrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
22188bd17e5fSmrg  for lt_sys_path in $lt_search_path_spec; do
22198bd17e5fSmrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
22208bd17e5fSmrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
22218bd17e5fSmrg    else
22228bd17e5fSmrg      test -d "$lt_sys_path" && \
22238bd17e5fSmrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
22248bd17e5fSmrg    fi
22258bd17e5fSmrg  done
22268bd17e5fSmrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
22278bd17e5fSmrgBEGIN {RS=" "; FS="/|\n";} {
22288bd17e5fSmrg  lt_foo="";
22298bd17e5fSmrg  lt_count=0;
22308bd17e5fSmrg  for (lt_i = NF; lt_i > 0; lt_i--) {
22318bd17e5fSmrg    if ($lt_i != "" && $lt_i != ".") {
22328bd17e5fSmrg      if ($lt_i == "..") {
22338bd17e5fSmrg        lt_count++;
22348bd17e5fSmrg      } else {
22358bd17e5fSmrg        if (lt_count == 0) {
22368bd17e5fSmrg          lt_foo="/" $lt_i lt_foo;
22378bd17e5fSmrg        } else {
22388bd17e5fSmrg          lt_count--;
22398bd17e5fSmrg        }
22408bd17e5fSmrg      }
22418bd17e5fSmrg    }
22428bd17e5fSmrg  }
22438bd17e5fSmrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
22448bd17e5fSmrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
22458bd17e5fSmrg}'`
22468bd17e5fSmrg  # AWK program above erroneously prepends '/' to C:/dos/paths
22478bd17e5fSmrg  # for these hosts.
22488bd17e5fSmrg  case $host_os in
22498bd17e5fSmrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
22508bd17e5fSmrg      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
22518bd17e5fSmrg  esac
22528bd17e5fSmrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
22538bd17e5fSmrgelse
22548bd17e5fSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
22558bd17e5fSmrgfi])
22568bd17e5fSmrglibrary_names_spec=
22578bd17e5fSmrglibname_spec='lib$name'
22588bd17e5fSmrgsoname_spec=
22598bd17e5fSmrgshrext_cmds=".so"
22608bd17e5fSmrgpostinstall_cmds=
22618bd17e5fSmrgpostuninstall_cmds=
22628bd17e5fSmrgfinish_cmds=
22638bd17e5fSmrgfinish_eval=
22648bd17e5fSmrgshlibpath_var=
22658bd17e5fSmrgshlibpath_overrides_runpath=unknown
22668bd17e5fSmrgversion_type=none
22678bd17e5fSmrgdynamic_linker="$host_os ld.so"
22688bd17e5fSmrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
22698bd17e5fSmrgneed_lib_prefix=unknown
22708bd17e5fSmrghardcode_into_libs=no
2271bd23fbfaSmrg
22728bd17e5fSmrg# when you set need_version to no, make sure it does not cause -set_version
22738bd17e5fSmrg# flags to be left without arguments
22748bd17e5fSmrgneed_version=unknown
22750597fb56Smrg
22760597fb56Smrgcase $host_os in
22778bd17e5fSmrgaix3*)
22788bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
22798bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
22808bd17e5fSmrg  shlibpath_var=LIBPATH
22818bd17e5fSmrg
22828bd17e5fSmrg  # AIX 3 has no versioning support, so we append a major version to the name.
22838bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
22840597fb56Smrg  ;;
22858bd17e5fSmrg
22868bd17e5fSmrgaix[[4-9]]*)
22878bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
22888bd17e5fSmrg  need_lib_prefix=no
22898bd17e5fSmrg  need_version=no
22908bd17e5fSmrg  hardcode_into_libs=yes
22910597fb56Smrg  if test "$host_cpu" = ia64; then
22928bd17e5fSmrg    # AIX 5 supports IA64
22938bd17e5fSmrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
22948bd17e5fSmrg    shlibpath_var=LD_LIBRARY_PATH
22958bd17e5fSmrg  else
22968bd17e5fSmrg    # With GCC up to 2.95.x, collect2 would create an import file
22978bd17e5fSmrg    # for dependence libraries.  The import file would start with
22988bd17e5fSmrg    # the line `#! .'.  This would cause the generated library to
22998bd17e5fSmrg    # depend on `.', always an invalid library.  This was fixed in
23008bd17e5fSmrg    # development snapshots of GCC prior to 3.0.
23018bd17e5fSmrg    case $host_os in
23028bd17e5fSmrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
23038bd17e5fSmrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
23048bd17e5fSmrg	   echo ' yes '
23058bd17e5fSmrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
23068bd17e5fSmrg	:
23078bd17e5fSmrg      else
23088bd17e5fSmrg	can_build_shared=no
23098bd17e5fSmrg      fi
23108bd17e5fSmrg      ;;
23118bd17e5fSmrg    esac
23128bd17e5fSmrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
23138bd17e5fSmrg    # soname into executable. Probably we can add versioning support to
23148bd17e5fSmrg    # collect2, so additional links can be useful in future.
23158bd17e5fSmrg    if test "$aix_use_runtimelinking" = yes; then
23168bd17e5fSmrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
23178bd17e5fSmrg      # instead of lib<name>.a to let people know that these are not
23188bd17e5fSmrg      # typical AIX shared libraries.
23198bd17e5fSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
23208bd17e5fSmrg    else
23218bd17e5fSmrg      # We preserve .a as extension for shared libraries through AIX4.2
23228bd17e5fSmrg      # and later when we are not doing run time linking.
23238bd17e5fSmrg      library_names_spec='${libname}${release}.a $libname.a'
23248bd17e5fSmrg      soname_spec='${libname}${release}${shared_ext}$major'
23258bd17e5fSmrg    fi
23268bd17e5fSmrg    shlibpath_var=LIBPATH
23278bd17e5fSmrg  fi
2328706b6b52Smrg  ;;
23298c4a8e55Smrg
23308bd17e5fSmrgamigaos*)
23318bd17e5fSmrg  case $host_cpu in
23328bd17e5fSmrg  powerpc)
23338bd17e5fSmrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
23348bd17e5fSmrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
23358bd17e5fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
23368bd17e5fSmrg    ;;
23378bd17e5fSmrg  m68k)
23388bd17e5fSmrg    library_names_spec='$libname.ixlibrary $libname.a'
23398bd17e5fSmrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
23408bd17e5fSmrg    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'
23418bd17e5fSmrg    ;;
23428bd17e5fSmrg  esac
23438bd17e5fSmrg  ;;
2344bd23fbfaSmrg
23458bd17e5fSmrgbeos*)
23468bd17e5fSmrg  library_names_spec='${libname}${shared_ext}'
23478bd17e5fSmrg  dynamic_linker="$host_os ld.so"
23488bd17e5fSmrg  shlibpath_var=LIBRARY_PATH
23490597fb56Smrg  ;;
2350bd23fbfaSmrg
23518bd17e5fSmrgbsdi[[45]]*)
23528bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
23538bd17e5fSmrg  need_version=no
23548bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
23558bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
23568bd17e5fSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
23578bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
23588bd17e5fSmrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
23598bd17e5fSmrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
23608bd17e5fSmrg  # the default ld.so.conf also contains /usr/contrib/lib and
23618bd17e5fSmrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
23628bd17e5fSmrg  # libtool to hard-code these into programs
23638bd17e5fSmrg  ;;
2364bd23fbfaSmrg
23658bd17e5fSmrgcygwin* | mingw* | pw32* | cegcc*)
23668bd17e5fSmrg  version_type=windows
23678bd17e5fSmrg  shrext_cmds=".dll"
23688bd17e5fSmrg  need_version=no
23698bd17e5fSmrg  need_lib_prefix=no
2370bd23fbfaSmrg
23718bd17e5fSmrg  case $GCC,$cc_basename in
23728bd17e5fSmrg  yes,*)
23738bd17e5fSmrg    # gcc
23748bd17e5fSmrg    library_names_spec='$libname.dll.a'
23758bd17e5fSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
23768bd17e5fSmrg    postinstall_cmds='base_file=`basename \${file}`~
23778bd17e5fSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
23788bd17e5fSmrg      dldir=$destdir/`dirname \$dlpath`~
23798bd17e5fSmrg      test -d \$dldir || mkdir -p \$dldir~
23808bd17e5fSmrg      $install_prog $dir/$dlname \$dldir/$dlname~
23818bd17e5fSmrg      chmod a+x \$dldir/$dlname~
23828bd17e5fSmrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
23838bd17e5fSmrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
23848bd17e5fSmrg      fi'
23858bd17e5fSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
23868bd17e5fSmrg      dlpath=$dir/\$dldll~
23878bd17e5fSmrg       $RM \$dlpath'
23888bd17e5fSmrg    shlibpath_overrides_runpath=yes
23898c4a8e55Smrg
23908bd17e5fSmrg    case $host_os in
23918bd17e5fSmrg    cygwin*)
23928bd17e5fSmrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
23938bd17e5fSmrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
23948bd17e5fSmrgm4_if([$1], [],[
23958bd17e5fSmrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
23968bd17e5fSmrg      ;;
23978bd17e5fSmrg    mingw* | cegcc*)
23988bd17e5fSmrg      # MinGW DLLs use traditional 'lib' prefix
23998bd17e5fSmrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
24008bd17e5fSmrg      ;;
24018bd17e5fSmrg    pw32*)
24028bd17e5fSmrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
24038bd17e5fSmrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
24048bd17e5fSmrg      ;;
24058bd17e5fSmrg    esac
24068bd17e5fSmrg    dynamic_linker='Win32 ld.exe'
24078bd17e5fSmrg    ;;
2408706b6b52Smrg
24098bd17e5fSmrg  *,cl*)
24108bd17e5fSmrg    # Native MSVC
24118bd17e5fSmrg    libname_spec='$name'
24128bd17e5fSmrg    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
24138bd17e5fSmrg    library_names_spec='${libname}.dll.lib'
2414706b6b52Smrg
24158bd17e5fSmrg    case $build_os in
24168bd17e5fSmrg    mingw*)
24178bd17e5fSmrg      sys_lib_search_path_spec=
24188bd17e5fSmrg      lt_save_ifs=$IFS
24198bd17e5fSmrg      IFS=';'
24208bd17e5fSmrg      for lt_path in $LIB
24218bd17e5fSmrg      do
24228bd17e5fSmrg        IFS=$lt_save_ifs
24238bd17e5fSmrg        # Let DOS variable expansion print the short 8.3 style file name.
24248bd17e5fSmrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
24258bd17e5fSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
24268bd17e5fSmrg      done
24278bd17e5fSmrg      IFS=$lt_save_ifs
24288bd17e5fSmrg      # Convert to MSYS style.
24298bd17e5fSmrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
24308bd17e5fSmrg      ;;
24318bd17e5fSmrg    cygwin*)
24328bd17e5fSmrg      # Convert to unix form, then to dos form, then back to unix form
24338bd17e5fSmrg      # but this time dos style (no spaces!) so that the unix form looks
24348bd17e5fSmrg      # like /cygdrive/c/PROGRA~1:/cygdr...
24358bd17e5fSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
24368bd17e5fSmrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
24378bd17e5fSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
24388bd17e5fSmrg      ;;
24398bd17e5fSmrg    *)
24408bd17e5fSmrg      sys_lib_search_path_spec="$LIB"
24418bd17e5fSmrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
24428bd17e5fSmrg        # It is most probably a Windows format PATH.
24438bd17e5fSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
24440597fb56Smrg      else
24458bd17e5fSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
24460597fb56Smrg      fi
24478bd17e5fSmrg      # FIXME: find the short name or the path components, as spaces are
24488bd17e5fSmrg      # common. (e.g. "Program Files" -> "PROGRA~1")
24498bd17e5fSmrg      ;;
24508bd17e5fSmrg    esac
2451706b6b52Smrg
24528bd17e5fSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
24538bd17e5fSmrg    postinstall_cmds='base_file=`basename \${file}`~
24548bd17e5fSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
24558bd17e5fSmrg      dldir=$destdir/`dirname \$dlpath`~
24568bd17e5fSmrg      test -d \$dldir || mkdir -p \$dldir~
24578bd17e5fSmrg      $install_prog $dir/$dlname \$dldir/$dlname'
24588bd17e5fSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
24598bd17e5fSmrg      dlpath=$dir/\$dldll~
24608bd17e5fSmrg       $RM \$dlpath'
24618bd17e5fSmrg    shlibpath_overrides_runpath=yes
24628bd17e5fSmrg    dynamic_linker='Win32 link.exe'
24638bd17e5fSmrg    ;;
2464706b6b52Smrg
24658bd17e5fSmrg  *)
24668bd17e5fSmrg    # Assume MSVC wrapper
24678bd17e5fSmrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
24688bd17e5fSmrg    dynamic_linker='Win32 ld.exe'
24698bd17e5fSmrg    ;;
24708bd17e5fSmrg  esac
24718bd17e5fSmrg  # FIXME: first we should search . and the directory the executable is in
24728bd17e5fSmrg  shlibpath_var=PATH
24738bd17e5fSmrg  ;;
2474706b6b52Smrg
24758bd17e5fSmrgdarwin* | rhapsody*)
24768bd17e5fSmrg  dynamic_linker="$host_os dyld"
24778bd17e5fSmrg  version_type=darwin
24788bd17e5fSmrg  need_lib_prefix=no
24798bd17e5fSmrg  need_version=no
24808bd17e5fSmrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
24818bd17e5fSmrg  soname_spec='${libname}${release}${major}$shared_ext'
24828bd17e5fSmrg  shlibpath_overrides_runpath=yes
24838bd17e5fSmrg  shlibpath_var=DYLD_LIBRARY_PATH
24848bd17e5fSmrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
24858bd17e5fSmrgm4_if([$1], [],[
24868bd17e5fSmrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
24878bd17e5fSmrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
24888bd17e5fSmrg  ;;
2489706b6b52Smrg
24908bd17e5fSmrgdgux*)
24918bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
24928bd17e5fSmrg  need_lib_prefix=no
24938bd17e5fSmrg  need_version=no
24948bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
24958bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
24968bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
24978bd17e5fSmrg  ;;
2498706b6b52Smrg
24998bd17e5fSmrgfreebsd* | dragonfly*)
25008bd17e5fSmrg  # DragonFly does not have aout.  When/if they implement a new
25018bd17e5fSmrg  # versioning mechanism, adjust this.
25028bd17e5fSmrg  if test -x /usr/bin/objformat; then
25038bd17e5fSmrg    objformat=`/usr/bin/objformat`
25040597fb56Smrg  else
25058bd17e5fSmrg    case $host_os in
25068bd17e5fSmrg    freebsd[[23]].*) objformat=aout ;;
25078bd17e5fSmrg    *) objformat=elf ;;
25088bd17e5fSmrg    esac
25090597fb56Smrg  fi
25108bd17e5fSmrg  version_type=freebsd-$objformat
25118bd17e5fSmrg  case $version_type in
25128bd17e5fSmrg    freebsd-elf*)
25138bd17e5fSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
25148bd17e5fSmrg      need_version=no
25158bd17e5fSmrg      need_lib_prefix=no
25168bd17e5fSmrg      ;;
25178bd17e5fSmrg    freebsd-*)
25188bd17e5fSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
25198bd17e5fSmrg      need_version=yes
25208bd17e5fSmrg      ;;
25218bd17e5fSmrg  esac
25228bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
25238bd17e5fSmrg  case $host_os in
25248bd17e5fSmrg  freebsd2.*)
25258bd17e5fSmrg    shlibpath_overrides_runpath=yes
25268bd17e5fSmrg    ;;
25278bd17e5fSmrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
25288bd17e5fSmrg    shlibpath_overrides_runpath=yes
25298bd17e5fSmrg    hardcode_into_libs=yes
25308bd17e5fSmrg    ;;
25318bd17e5fSmrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
25328bd17e5fSmrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
25338bd17e5fSmrg    shlibpath_overrides_runpath=no
25348bd17e5fSmrg    hardcode_into_libs=yes
25358bd17e5fSmrg    ;;
25368bd17e5fSmrg  *) # from 4.6 on, and DragonFly
25378bd17e5fSmrg    shlibpath_overrides_runpath=yes
25388bd17e5fSmrg    hardcode_into_libs=yes
25398bd17e5fSmrg    ;;
25408bd17e5fSmrg  esac
25418bd17e5fSmrg  ;;
2542706b6b52Smrg
25438bd17e5fSmrghaiku*)
25448bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
25458bd17e5fSmrg  need_lib_prefix=no
25468bd17e5fSmrg  need_version=no
25478bd17e5fSmrg  dynamic_linker="$host_os runtime_loader"
25488bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
25498bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
25508bd17e5fSmrg  shlibpath_var=LIBRARY_PATH
25518bd17e5fSmrg  shlibpath_overrides_runpath=yes
25528bd17e5fSmrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
25538bd17e5fSmrg  hardcode_into_libs=yes
25548bd17e5fSmrg  ;;
2555706b6b52Smrg
25568bd17e5fSmrghpux9* | hpux10* | hpux11*)
25578bd17e5fSmrg  # Give a soname corresponding to the major version so that dld.sl refuses to
25588bd17e5fSmrg  # link against other versions.
25598bd17e5fSmrg  version_type=sunos
25608bd17e5fSmrg  need_lib_prefix=no
25618bd17e5fSmrg  need_version=no
25628bd17e5fSmrg  case $host_cpu in
25638bd17e5fSmrg  ia64*)
25648bd17e5fSmrg    shrext_cmds='.so'
25658bd17e5fSmrg    hardcode_into_libs=yes
25668bd17e5fSmrg    dynamic_linker="$host_os dld.so"
25678bd17e5fSmrg    shlibpath_var=LD_LIBRARY_PATH
25688bd17e5fSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
25698bd17e5fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
25708bd17e5fSmrg    soname_spec='${libname}${release}${shared_ext}$major'
25718bd17e5fSmrg    if test "X$HPUX_IA64_MODE" = X32; then
25728bd17e5fSmrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
25738bd17e5fSmrg    else
25748bd17e5fSmrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
25758bd17e5fSmrg    fi
25768bd17e5fSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
25778bd17e5fSmrg    ;;
25788bd17e5fSmrg  hppa*64*)
25798bd17e5fSmrg    shrext_cmds='.sl'
25808bd17e5fSmrg    hardcode_into_libs=yes
25818bd17e5fSmrg    dynamic_linker="$host_os dld.sl"
25828bd17e5fSmrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
25838bd17e5fSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
25848bd17e5fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
25858bd17e5fSmrg    soname_spec='${libname}${release}${shared_ext}$major'
25868bd17e5fSmrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
25878bd17e5fSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
25888bd17e5fSmrg    ;;
25898bd17e5fSmrg  *)
25908bd17e5fSmrg    shrext_cmds='.sl'
25918bd17e5fSmrg    dynamic_linker="$host_os dld.sl"
25928bd17e5fSmrg    shlibpath_var=SHLIB_PATH
25938bd17e5fSmrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
25948bd17e5fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
25958bd17e5fSmrg    soname_spec='${libname}${release}${shared_ext}$major'
25968bd17e5fSmrg    ;;
25978bd17e5fSmrg  esac
25988bd17e5fSmrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
25998bd17e5fSmrg  postinstall_cmds='chmod 555 $lib'
26008bd17e5fSmrg  # or fails outright, so override atomically:
26018bd17e5fSmrg  install_override_mode=555
26028bd17e5fSmrg  ;;
2603706b6b52Smrg
26048bd17e5fSmrginterix[[3-9]]*)
26058bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
26068bd17e5fSmrg  need_lib_prefix=no
26078bd17e5fSmrg  need_version=no
26088bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
26098bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
26108bd17e5fSmrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
26118bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
26128bd17e5fSmrg  shlibpath_overrides_runpath=no
26138bd17e5fSmrg  hardcode_into_libs=yes
26148bd17e5fSmrg  ;;
2615706b6b52Smrg
26168bd17e5fSmrgirix5* | irix6* | nonstopux*)
26178bd17e5fSmrg  case $host_os in
26188bd17e5fSmrg    nonstopux*) version_type=nonstopux ;;
26198bd17e5fSmrg    *)
26208bd17e5fSmrg	if test "$lt_cv_prog_gnu_ld" = yes; then
26218bd17e5fSmrg		version_type=linux # correct to gnu/linux during the next big refactor
26228bd17e5fSmrg	else
26238bd17e5fSmrg		version_type=irix
26248bd17e5fSmrg	fi ;;
26258bd17e5fSmrg  esac
26268bd17e5fSmrg  need_lib_prefix=no
26278bd17e5fSmrg  need_version=no
26288bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
26298bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
26308bd17e5fSmrg  case $host_os in
26318bd17e5fSmrg  irix5* | nonstopux*)
26328bd17e5fSmrg    libsuff= shlibsuff=
26338bd17e5fSmrg    ;;
26348bd17e5fSmrg  *)
26358bd17e5fSmrg    case $LD in # libtool.m4 will add one of these switches to LD
26368bd17e5fSmrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
26378bd17e5fSmrg      libsuff= shlibsuff= libmagic=32-bit;;
26388bd17e5fSmrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
26398bd17e5fSmrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
26408bd17e5fSmrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
26418bd17e5fSmrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
26428bd17e5fSmrg    *) libsuff= shlibsuff= libmagic=never-match;;
26438bd17e5fSmrg    esac
26448bd17e5fSmrg    ;;
26458bd17e5fSmrg  esac
26468bd17e5fSmrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
26478bd17e5fSmrg  shlibpath_overrides_runpath=no
26488bd17e5fSmrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
26498bd17e5fSmrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
26508bd17e5fSmrg  hardcode_into_libs=yes
26518bd17e5fSmrg  ;;
2652706b6b52Smrg
26538bd17e5fSmrg# No shared lib support for Linux oldld, aout, or coff.
26548bd17e5fSmrglinux*oldld* | linux*aout* | linux*coff*)
26558bd17e5fSmrg  dynamic_linker=no
26568bd17e5fSmrg  ;;
2657706b6b52Smrg
26588bd17e5fSmrg# This must be glibc/ELF.
2659b242714cSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
26608bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
26618bd17e5fSmrg  need_lib_prefix=no
26628bd17e5fSmrg  need_version=no
26638bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
26648bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
26658bd17e5fSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
26668bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
26678bd17e5fSmrg  shlibpath_overrides_runpath=no
26688bd17e5fSmrg
26698bd17e5fSmrg  # Some binutils ld are patched to set DT_RUNPATH
26708bd17e5fSmrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
26718bd17e5fSmrg    [lt_cv_shlibpath_overrides_runpath=no
26728bd17e5fSmrg    save_LDFLAGS=$LDFLAGS
26738bd17e5fSmrg    save_libdir=$libdir
26748bd17e5fSmrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
26758bd17e5fSmrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
26768bd17e5fSmrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
26778bd17e5fSmrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
26788bd17e5fSmrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
26798bd17e5fSmrg    LDFLAGS=$save_LDFLAGS
26808bd17e5fSmrg    libdir=$save_libdir
26818bd17e5fSmrg    ])
26828bd17e5fSmrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
26838bd17e5fSmrg
26848bd17e5fSmrg  # This implies no fast_install, which is unacceptable.
26858bd17e5fSmrg  # Some rework will be needed to allow for fast_install
26868bd17e5fSmrg  # before this can be enabled.
26878bd17e5fSmrg  hardcode_into_libs=yes
26888bd17e5fSmrg
26898bd17e5fSmrg  # Append ld.so.conf contents to the search path
26908bd17e5fSmrg  if test -f /etc/ld.so.conf; then
26918bd17e5fSmrg    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' ' '`
2692b242714cSmrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
26938bd17e5fSmrg  fi
26948bd17e5fSmrg
26958bd17e5fSmrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
26968bd17e5fSmrg  # powerpc, because MkLinux only supported shared libraries with the
26978bd17e5fSmrg  # GNU dynamic linker.  Since this was broken with cross compilers,
26988bd17e5fSmrg  # most powerpc-linux boxes support dynamic linking these days and
26998bd17e5fSmrg  # people can always --disable-shared, the test was removed, and we
27008bd17e5fSmrg  # assume the GNU/Linux dynamic linker is in use.
27018bd17e5fSmrg  dynamic_linker='GNU/Linux ld.so'
27028bd17e5fSmrg  ;;
27038bd17e5fSmrg
2704b242714cSmrgnetbsdelf*-gnu)
2705b242714cSmrg  version_type=linux
2706b242714cSmrg  need_lib_prefix=no
2707b242714cSmrg  need_version=no
2708b242714cSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2709b242714cSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2710b242714cSmrg  shlibpath_var=LD_LIBRARY_PATH
2711b242714cSmrg  shlibpath_overrides_runpath=no
2712b242714cSmrg  hardcode_into_libs=yes
2713b242714cSmrg  dynamic_linker='NetBSD ld.elf_so'
2714b242714cSmrg  ;;
2715b242714cSmrg
27168bd17e5fSmrgnetbsd*)
27178bd17e5fSmrg  version_type=sunos
27188bd17e5fSmrg  need_lib_prefix=no
27198bd17e5fSmrg  need_version=no
27208bd17e5fSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
27218bd17e5fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
27228bd17e5fSmrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
27238bd17e5fSmrg    dynamic_linker='NetBSD (a.out) ld.so'
27248bd17e5fSmrg  else
27258bd17e5fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
27268bd17e5fSmrg    soname_spec='${libname}${release}${shared_ext}$major'
27278bd17e5fSmrg    dynamic_linker='NetBSD ld.elf_so'
27288bd17e5fSmrg  fi
27298bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
27308bd17e5fSmrg  shlibpath_overrides_runpath=yes
27318bd17e5fSmrg  hardcode_into_libs=yes
27328bd17e5fSmrg  ;;
27338bd17e5fSmrg
27348bd17e5fSmrgnewsos6)
27358bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
27368bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
27378bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
27388bd17e5fSmrg  shlibpath_overrides_runpath=yes
27398bd17e5fSmrg  ;;
27408bd17e5fSmrg
27418bd17e5fSmrg*nto* | *qnx*)
27428bd17e5fSmrg  version_type=qnx
27438bd17e5fSmrg  need_lib_prefix=no
27448bd17e5fSmrg  need_version=no
27458bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
27468bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
27478bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
27488bd17e5fSmrg  shlibpath_overrides_runpath=no
27498bd17e5fSmrg  hardcode_into_libs=yes
27508bd17e5fSmrg  dynamic_linker='ldqnx.so'
27518bd17e5fSmrg  ;;
27528bd17e5fSmrg
27538bd17e5fSmrgopenbsd*)
27548bd17e5fSmrg  version_type=sunos
27558bd17e5fSmrg  sys_lib_dlsearch_path_spec="/usr/lib"
27568bd17e5fSmrg  need_lib_prefix=no
27578bd17e5fSmrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
27588bd17e5fSmrg  case $host_os in
27598bd17e5fSmrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
27608bd17e5fSmrg    *)				need_version=no  ;;
27618bd17e5fSmrg  esac
27628bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
27638bd17e5fSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
27648bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
27658bd17e5fSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
27668bd17e5fSmrg    case $host_os in
27678bd17e5fSmrg      openbsd2.[[89]] | openbsd2.[[89]].*)
27688bd17e5fSmrg	shlibpath_overrides_runpath=no
27690597fb56Smrg	;;
27700597fb56Smrg      *)
27718bd17e5fSmrg	shlibpath_overrides_runpath=yes
27720597fb56Smrg	;;
2773706b6b52Smrg      esac
2774706b6b52Smrg  else
27758bd17e5fSmrg    shlibpath_overrides_runpath=yes
2776706b6b52Smrg  fi
27778bd17e5fSmrg  ;;
2778706b6b52Smrg
27798bd17e5fSmrgos2*)
27808bd17e5fSmrg  libname_spec='$name'
27818bd17e5fSmrg  shrext_cmds=".dll"
27828bd17e5fSmrg  need_lib_prefix=no
27838bd17e5fSmrg  library_names_spec='$libname${shared_ext} $libname.a'
27848bd17e5fSmrg  dynamic_linker='OS/2 ld.exe'
27858bd17e5fSmrg  shlibpath_var=LIBPATH
27868bd17e5fSmrg  ;;
2787706b6b52Smrg
27888bd17e5fSmrgosf3* | osf4* | osf5*)
27898bd17e5fSmrg  version_type=osf
27908bd17e5fSmrg  need_lib_prefix=no
27918bd17e5fSmrg  need_version=no
27928bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
27938bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
27948bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
27958bd17e5fSmrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
27968bd17e5fSmrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
27978bd17e5fSmrg  ;;
27988c4a8e55Smrg
27998bd17e5fSmrgrdos*)
28008bd17e5fSmrg  dynamic_linker=no
28018bd17e5fSmrg  ;;
28028bd17e5fSmrg
28038bd17e5fSmrgsolaris*)
28048bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
28058bd17e5fSmrg  need_lib_prefix=no
28068bd17e5fSmrg  need_version=no
28078bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
28088bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
28098bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
28108bd17e5fSmrg  shlibpath_overrides_runpath=yes
28118bd17e5fSmrg  hardcode_into_libs=yes
28128bd17e5fSmrg  # ldd complains unless libraries are executable
28138bd17e5fSmrg  postinstall_cmds='chmod +x $lib'
28148bd17e5fSmrg  ;;
28158bd17e5fSmrg
28168bd17e5fSmrgsunos4*)
28178bd17e5fSmrg  version_type=sunos
28188bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
28198bd17e5fSmrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
28208bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
28218bd17e5fSmrg  shlibpath_overrides_runpath=yes
28228bd17e5fSmrg  if test "$with_gnu_ld" = yes; then
28238bd17e5fSmrg    need_lib_prefix=no
28248bd17e5fSmrg  fi
28258bd17e5fSmrg  need_version=yes
28268bd17e5fSmrg  ;;
28278c4a8e55Smrg
28288bd17e5fSmrgsysv4 | sysv4.3*)
28298bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
28308bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
28318bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
28328bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
28338bd17e5fSmrg  case $host_vendor in
28348bd17e5fSmrg    sni)
28358bd17e5fSmrg      shlibpath_overrides_runpath=no
28368bd17e5fSmrg      need_lib_prefix=no
28378bd17e5fSmrg      runpath_var=LD_RUN_PATH
28380597fb56Smrg      ;;
28398bd17e5fSmrg    siemens)
28408bd17e5fSmrg      need_lib_prefix=no
28410597fb56Smrg      ;;
28428bd17e5fSmrg    motorola)
28438bd17e5fSmrg      need_lib_prefix=no
28448bd17e5fSmrg      need_version=no
28458bd17e5fSmrg      shlibpath_overrides_runpath=no
28468bd17e5fSmrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
28470597fb56Smrg      ;;
28488bd17e5fSmrg  esac
28498bd17e5fSmrg  ;;
28508c4a8e55Smrg
28518bd17e5fSmrgsysv4*MP*)
28528bd17e5fSmrg  if test -d /usr/nec ;then
28538bd17e5fSmrg    version_type=linux # correct to gnu/linux during the next big refactor
28548bd17e5fSmrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
28558bd17e5fSmrg    soname_spec='$libname${shared_ext}.$major'
28568bd17e5fSmrg    shlibpath_var=LD_LIBRARY_PATH
28578bd17e5fSmrg  fi
28588bd17e5fSmrg  ;;
28598bd17e5fSmrg
28608bd17e5fSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
28618bd17e5fSmrg  version_type=freebsd-elf
28628bd17e5fSmrg  need_lib_prefix=no
28638bd17e5fSmrg  need_version=no
28648bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
28658bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
28668bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
28678bd17e5fSmrg  shlibpath_overrides_runpath=yes
28688bd17e5fSmrg  hardcode_into_libs=yes
28698bd17e5fSmrg  if test "$with_gnu_ld" = yes; then
28708bd17e5fSmrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
28718bd17e5fSmrg  else
28728bd17e5fSmrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
28738bd17e5fSmrg    case $host_os in
28748bd17e5fSmrg      sco3.2v5*)
28758bd17e5fSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
28760597fb56Smrg	;;
28778bd17e5fSmrg    esac
28788bd17e5fSmrg  fi
28798bd17e5fSmrg  sys_lib_dlsearch_path_spec='/usr/lib'
28808bd17e5fSmrg  ;;
2881b042e37fSmrg
28828bd17e5fSmrgtpf*)
28838bd17e5fSmrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
28848bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
28858bd17e5fSmrg  need_lib_prefix=no
28868bd17e5fSmrg  need_version=no
28878bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
28888bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
28898bd17e5fSmrg  shlibpath_overrides_runpath=no
28908bd17e5fSmrg  hardcode_into_libs=yes
28918bd17e5fSmrg  ;;
2892b042e37fSmrg
28938bd17e5fSmrguts4*)
28948bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
28958bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
28968bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
28978bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
28988bd17e5fSmrg  ;;
2899b042e37fSmrg
29008bd17e5fSmrg*)
29018bd17e5fSmrg  dynamic_linker=no
29028bd17e5fSmrg  ;;
29038bd17e5fSmrgesac
29048bd17e5fSmrgAC_MSG_RESULT([$dynamic_linker])
29058bd17e5fSmrgtest "$dynamic_linker" = no && can_build_shared=no
2906706b6b52Smrg
29078bd17e5fSmrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
29088bd17e5fSmrgif test "$GCC" = yes; then
29098bd17e5fSmrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
29108bd17e5fSmrgfi
2911b042e37fSmrg
29128bd17e5fSmrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
29138bd17e5fSmrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
29148bd17e5fSmrgfi
29158bd17e5fSmrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
29168bd17e5fSmrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
29178bd17e5fSmrgfi
29180597fb56Smrg
29198bd17e5fSmrg_LT_DECL([], [variables_saved_for_relink], [1],
29208bd17e5fSmrg    [Variables whose values should be saved in libtool wrapper scripts and
29218bd17e5fSmrg    restored at link time])
29228bd17e5fSmrg_LT_DECL([], [need_lib_prefix], [0],
29238bd17e5fSmrg    [Do we need the "lib" prefix for modules?])
29248bd17e5fSmrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
29258bd17e5fSmrg_LT_DECL([], [version_type], [0], [Library versioning type])
29268bd17e5fSmrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
29278bd17e5fSmrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
29288bd17e5fSmrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
29298bd17e5fSmrg    [Is shlibpath searched before the hard-coded library search path?])
29308bd17e5fSmrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
29318bd17e5fSmrg_LT_DECL([], [library_names_spec], [1],
29328bd17e5fSmrg    [[List of archive names.  First name is the real one, the rest are links.
29338bd17e5fSmrg    The last name is the one that the linker finds with -lNAME]])
29348bd17e5fSmrg_LT_DECL([], [soname_spec], [1],
29358bd17e5fSmrg    [[The coded name of the library, if different from the real name]])
29368bd17e5fSmrg_LT_DECL([], [install_override_mode], [1],
29378bd17e5fSmrg    [Permission mode override for installation of shared libraries])
29388bd17e5fSmrg_LT_DECL([], [postinstall_cmds], [2],
29398bd17e5fSmrg    [Command to use after installation of a shared archive])
29408bd17e5fSmrg_LT_DECL([], [postuninstall_cmds], [2],
29418bd17e5fSmrg    [Command to use after uninstallation of a shared archive])
29428bd17e5fSmrg_LT_DECL([], [finish_cmds], [2],
29438bd17e5fSmrg    [Commands used to finish a libtool library installation in a directory])
29448bd17e5fSmrg_LT_DECL([], [finish_eval], [1],
29458bd17e5fSmrg    [[As "finish_cmds", except a single script fragment to be evaled but
29468bd17e5fSmrg    not shown]])
29478bd17e5fSmrg_LT_DECL([], [hardcode_into_libs], [0],
29488bd17e5fSmrg    [Whether we should hardcode library paths into libraries])
29498bd17e5fSmrg_LT_DECL([], [sys_lib_search_path_spec], [2],
29508bd17e5fSmrg    [Compile-time system search path for libraries])
29518bd17e5fSmrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
29528bd17e5fSmrg    [Run-time system search path for libraries])
29538bd17e5fSmrg])# _LT_SYS_DYNAMIC_LINKER
2954b042e37fSmrg
2955b042e37fSmrg
29568bd17e5fSmrg# _LT_PATH_TOOL_PREFIX(TOOL)
29578bd17e5fSmrg# --------------------------
29588bd17e5fSmrg# find a file program which can recognize shared library
29598bd17e5fSmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
29608bd17e5fSmrg[m4_require([_LT_DECL_EGREP])dnl
29618bd17e5fSmrgAC_MSG_CHECKING([for $1])
29628bd17e5fSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
29638bd17e5fSmrg[case $MAGIC_CMD in
29648bd17e5fSmrg[[\\/*] |  ?:[\\/]*])
29658bd17e5fSmrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
29668bd17e5fSmrg  ;;
29678bd17e5fSmrg*)
29688bd17e5fSmrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
29698bd17e5fSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
29708bd17e5fSmrgdnl $ac_dummy forces splitting on constant user-supplied paths.
29718bd17e5fSmrgdnl POSIX.2 word splitting is done only on the output of word expansions,
29728bd17e5fSmrgdnl not every word.  This closes a longstanding sh security hole.
29738bd17e5fSmrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
29748bd17e5fSmrg  for ac_dir in $ac_dummy; do
29758bd17e5fSmrg    IFS="$lt_save_ifs"
29768bd17e5fSmrg    test -z "$ac_dir" && ac_dir=.
29778bd17e5fSmrg    if test -f $ac_dir/$1; then
29788bd17e5fSmrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
29798bd17e5fSmrg      if test -n "$file_magic_test_file"; then
29808bd17e5fSmrg	case $deplibs_check_method in
29818bd17e5fSmrg	"file_magic "*)
29828bd17e5fSmrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
29838bd17e5fSmrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
29848bd17e5fSmrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
29858bd17e5fSmrg	    $EGREP "$file_magic_regex" > /dev/null; then
29868bd17e5fSmrg	    :
29878bd17e5fSmrg	  else
29888bd17e5fSmrg	    cat <<_LT_EOF 1>&2
2989b042e37fSmrg
29908bd17e5fSmrg*** Warning: the command libtool uses to detect shared libraries,
29918bd17e5fSmrg*** $file_magic_cmd, produces output that libtool cannot recognize.
29928bd17e5fSmrg*** The result is that libtool may fail to recognize shared libraries
29938bd17e5fSmrg*** as such.  This will affect the creation of libtool libraries that
29948bd17e5fSmrg*** depend on shared libraries, but programs linked with such libtool
29958bd17e5fSmrg*** libraries will work regardless of this problem.  Nevertheless, you
29968bd17e5fSmrg*** may want to report the problem to your system manager and/or to
29978bd17e5fSmrg*** bug-libtool@gnu.org
2998b042e37fSmrg
29998bd17e5fSmrg_LT_EOF
30008bd17e5fSmrg	  fi ;;
30010597fb56Smrg	esac
30028bd17e5fSmrg      fi
30038bd17e5fSmrg      break
30048bd17e5fSmrg    fi
30058bd17e5fSmrg  done
30068bd17e5fSmrg  IFS="$lt_save_ifs"
30078bd17e5fSmrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
30088bd17e5fSmrg  ;;
30098bd17e5fSmrgesac])
30108bd17e5fSmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
30118bd17e5fSmrgif test -n "$MAGIC_CMD"; then
30128bd17e5fSmrg  AC_MSG_RESULT($MAGIC_CMD)
30138bd17e5fSmrgelse
30148bd17e5fSmrg  AC_MSG_RESULT(no)
30158bd17e5fSmrgfi
30168bd17e5fSmrg_LT_DECL([], [MAGIC_CMD], [0],
30178bd17e5fSmrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
30188bd17e5fSmrg])# _LT_PATH_TOOL_PREFIX
30190597fb56Smrg
30208bd17e5fSmrg# Old name:
30218bd17e5fSmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
30228bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
30238bd17e5fSmrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3024bd23fbfaSmrg
3025bd23fbfaSmrg
30268bd17e5fSmrg# _LT_PATH_MAGIC
30278bd17e5fSmrg# --------------
30288bd17e5fSmrg# find a file program which can recognize a shared library
30298bd17e5fSmrgm4_defun([_LT_PATH_MAGIC],
30308bd17e5fSmrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
30318bd17e5fSmrgif test -z "$lt_cv_path_MAGIC_CMD"; then
30328bd17e5fSmrg  if test -n "$ac_tool_prefix"; then
30338bd17e5fSmrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
30348bd17e5fSmrg  else
30358bd17e5fSmrg    MAGIC_CMD=:
30368bd17e5fSmrg  fi
30378bd17e5fSmrgfi
30388bd17e5fSmrg])# _LT_PATH_MAGIC
30390597fb56Smrg
30400597fb56Smrg
30418bd17e5fSmrg# LT_PATH_LD
30428bd17e5fSmrg# ----------
30438bd17e5fSmrg# find the pathname to the GNU or non-GNU linker
30448bd17e5fSmrgAC_DEFUN([LT_PATH_LD],
30458bd17e5fSmrg[AC_REQUIRE([AC_PROG_CC])dnl
30468bd17e5fSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
30478bd17e5fSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
30488bd17e5fSmrgm4_require([_LT_DECL_SED])dnl
30498bd17e5fSmrgm4_require([_LT_DECL_EGREP])dnl
30508bd17e5fSmrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3051bd23fbfaSmrg
30528bd17e5fSmrgAC_ARG_WITH([gnu-ld],
30538bd17e5fSmrg    [AS_HELP_STRING([--with-gnu-ld],
30548bd17e5fSmrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
30558bd17e5fSmrg    [test "$withval" = no || with_gnu_ld=yes],
30568bd17e5fSmrg    [with_gnu_ld=no])dnl
3057706b6b52Smrg
30588bd17e5fSmrgac_prog=ld
30598bd17e5fSmrgif test "$GCC" = yes; then
30608bd17e5fSmrg  # Check if gcc -print-prog-name=ld gives a path.
30618bd17e5fSmrg  AC_MSG_CHECKING([for ld used by $CC])
30628bd17e5fSmrg  case $host in
30638bd17e5fSmrg  *-*-mingw*)
30648bd17e5fSmrg    # gcc leaves a trailing carriage return which upsets mingw
30658bd17e5fSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
30668bd17e5fSmrg  *)
30678bd17e5fSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
30688bd17e5fSmrg  esac
30698bd17e5fSmrg  case $ac_prog in
30708bd17e5fSmrg    # Accept absolute paths.
30718bd17e5fSmrg    [[\\/]]* | ?:[[\\/]]*)
30728bd17e5fSmrg      re_direlt='/[[^/]][[^/]]*/\.\./'
30738bd17e5fSmrg      # Canonicalize the pathname of ld
30748bd17e5fSmrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
30758bd17e5fSmrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
30768bd17e5fSmrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
30778bd17e5fSmrg      done
30788bd17e5fSmrg      test -z "$LD" && LD="$ac_prog"
30790597fb56Smrg      ;;
30808bd17e5fSmrg  "")
30818bd17e5fSmrg    # If it fails, then pretend we aren't using GCC.
30828bd17e5fSmrg    ac_prog=ld
30838bd17e5fSmrg    ;;
30848bd17e5fSmrg  *)
30858bd17e5fSmrg    # If it is relative, then search for the first ld in PATH.
30868bd17e5fSmrg    with_gnu_ld=unknown
30878bd17e5fSmrg    ;;
30888bd17e5fSmrg  esac
30898bd17e5fSmrgelif test "$with_gnu_ld" = yes; then
30908bd17e5fSmrg  AC_MSG_CHECKING([for GNU ld])
30918bd17e5fSmrgelse
30928bd17e5fSmrg  AC_MSG_CHECKING([for non-GNU ld])
30938bd17e5fSmrgfi
30948bd17e5fSmrgAC_CACHE_VAL(lt_cv_path_LD,
30958bd17e5fSmrg[if test -z "$LD"; then
30968bd17e5fSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
30978bd17e5fSmrg  for ac_dir in $PATH; do
30988bd17e5fSmrg    IFS="$lt_save_ifs"
30998bd17e5fSmrg    test -z "$ac_dir" && ac_dir=.
31008bd17e5fSmrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
31018bd17e5fSmrg      lt_cv_path_LD="$ac_dir/$ac_prog"
31028bd17e5fSmrg      # Check to see if the program is GNU ld.  I'd rather use --version,
31038bd17e5fSmrg      # but apparently some variants of GNU ld only accept -v.
31048bd17e5fSmrg      # Break only if it was the GNU/non-GNU ld that we prefer.
31058bd17e5fSmrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
31068bd17e5fSmrg      *GNU* | *'with BFD'*)
31078bd17e5fSmrg	test "$with_gnu_ld" != no && break
31088bd17e5fSmrg	;;
31098bd17e5fSmrg      *)
31108bd17e5fSmrg	test "$with_gnu_ld" != yes && break
31118bd17e5fSmrg	;;
31128bd17e5fSmrg      esac
31138bd17e5fSmrg    fi
31148bd17e5fSmrg  done
31158bd17e5fSmrg  IFS="$lt_save_ifs"
31168bd17e5fSmrgelse
31178bd17e5fSmrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
31188bd17e5fSmrgfi])
31198bd17e5fSmrgLD="$lt_cv_path_LD"
31208bd17e5fSmrgif test -n "$LD"; then
31218bd17e5fSmrg  AC_MSG_RESULT($LD)
31228bd17e5fSmrgelse
31238bd17e5fSmrg  AC_MSG_RESULT(no)
31248bd17e5fSmrgfi
31258bd17e5fSmrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
31268bd17e5fSmrg_LT_PATH_LD_GNU
31278bd17e5fSmrgAC_SUBST([LD])
3128b042e37fSmrg
31298bd17e5fSmrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
31308bd17e5fSmrg])# LT_PATH_LD
3131b042e37fSmrg
31328bd17e5fSmrg# Old names:
31338bd17e5fSmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
31348bd17e5fSmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
31358bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
31368bd17e5fSmrgdnl AC_DEFUN([AM_PROG_LD], [])
31378bd17e5fSmrgdnl AC_DEFUN([AC_PROG_LD], [])
3138b042e37fSmrg
3139b042e37fSmrg
31408bd17e5fSmrg# _LT_PATH_LD_GNU
31418bd17e5fSmrg#- --------------
31428bd17e5fSmrgm4_defun([_LT_PATH_LD_GNU],
31438bd17e5fSmrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
31448bd17e5fSmrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
31458bd17e5fSmrgcase `$LD -v 2>&1 </dev/null` in
31468bd17e5fSmrg*GNU* | *'with BFD'*)
31478bd17e5fSmrg  lt_cv_prog_gnu_ld=yes
31488bd17e5fSmrg  ;;
31498bd17e5fSmrg*)
31508bd17e5fSmrg  lt_cv_prog_gnu_ld=no
31518bd17e5fSmrg  ;;
31528bd17e5fSmrgesac])
31538bd17e5fSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
31548bd17e5fSmrg])# _LT_PATH_LD_GNU
31558bd17e5fSmrg
31568bd17e5fSmrg
31578bd17e5fSmrg# _LT_CMD_RELOAD
31588bd17e5fSmrg# --------------
31598bd17e5fSmrg# find reload flag for linker
31608bd17e5fSmrg#   -- PORTME Some linkers may need a different reload flag.
31618bd17e5fSmrgm4_defun([_LT_CMD_RELOAD],
31628bd17e5fSmrg[AC_CACHE_CHECK([for $LD option to reload object files],
31638bd17e5fSmrg  lt_cv_ld_reload_flag,
31648bd17e5fSmrg  [lt_cv_ld_reload_flag='-r'])
31658bd17e5fSmrgreload_flag=$lt_cv_ld_reload_flag
31668bd17e5fSmrgcase $reload_flag in
31678bd17e5fSmrg"" | " "*) ;;
31688bd17e5fSmrg*) reload_flag=" $reload_flag" ;;
31698bd17e5fSmrgesac
31708bd17e5fSmrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
31710597fb56Smrgcase $host_os in
31728bd17e5fSmrg  cygwin* | mingw* | pw32* | cegcc*)
31738bd17e5fSmrg    if test "$GCC" != yes; then
31748bd17e5fSmrg      reload_cmds=false
31758bd17e5fSmrg    fi
3176706b6b52Smrg    ;;
31778bd17e5fSmrg  darwin*)
31788bd17e5fSmrg    if test "$GCC" = yes; then
31798bd17e5fSmrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
31808bd17e5fSmrg    else
31818bd17e5fSmrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
31828bd17e5fSmrg    fi
3183706b6b52Smrg    ;;
31840597fb56Smrgesac
31858bd17e5fSmrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
31868bd17e5fSmrg_LT_TAGDECL([], [reload_cmds], [2])dnl
31878bd17e5fSmrg])# _LT_CMD_RELOAD
3188706b6b52Smrg
3189706b6b52Smrg
31908bd17e5fSmrg# _LT_CHECK_MAGIC_METHOD
31918bd17e5fSmrg# ----------------------
31928bd17e5fSmrg# how to check for library dependencies
31938bd17e5fSmrg#  -- PORTME fill in with the dynamic library characteristics
31948bd17e5fSmrgm4_defun([_LT_CHECK_MAGIC_METHOD],
31958bd17e5fSmrg[m4_require([_LT_DECL_EGREP])
31968bd17e5fSmrgm4_require([_LT_DECL_OBJDUMP])
31978bd17e5fSmrgAC_CACHE_CHECK([how to recognize dependent libraries],
31988bd17e5fSmrglt_cv_deplibs_check_method,
31998bd17e5fSmrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
32008bd17e5fSmrglt_cv_file_magic_test_file=
32018bd17e5fSmrglt_cv_deplibs_check_method='unknown'
32028bd17e5fSmrg# Need to set the preceding variable on all platforms that support
32038bd17e5fSmrg# interlibrary dependencies.
32048bd17e5fSmrg# 'none' -- dependencies not supported.
32058bd17e5fSmrg# `unknown' -- same as none, but documents that we really don't know.
32068bd17e5fSmrg# 'pass_all' -- all dependencies passed with no checks.
32078bd17e5fSmrg# 'test_compile' -- check by making test program.
32088bd17e5fSmrg# 'file_magic [[regex]]' -- check by looking for files in library path
32098bd17e5fSmrg# which responds to the $file_magic_cmd with a given extended regex.
32108bd17e5fSmrg# If you have `file' or equivalent on your system and you're not sure
32118bd17e5fSmrg# whether `pass_all' will *always* work, you probably want this one.
3212b042e37fSmrg
32138bd17e5fSmrgcase $host_os in
32148bd17e5fSmrgaix[[4-9]]*)
32158bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
32168bd17e5fSmrg  ;;
32170597fb56Smrg
32188bd17e5fSmrgbeos*)
32198bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
32208bd17e5fSmrg  ;;
32210597fb56Smrg
32228bd17e5fSmrgbsdi[[45]]*)
32238bd17e5fSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
32248bd17e5fSmrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
32258bd17e5fSmrg  lt_cv_file_magic_test_file=/shlib/libc.so
32268bd17e5fSmrg  ;;
32278bd17e5fSmrg
32288bd17e5fSmrgcygwin*)
32298bd17e5fSmrg  # func_win32_libid is a shell function defined in ltmain.sh
32308bd17e5fSmrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
32318bd17e5fSmrg  lt_cv_file_magic_cmd='func_win32_libid'
32328bd17e5fSmrg  ;;
32338bd17e5fSmrg
32348bd17e5fSmrgmingw* | pw32*)
32358bd17e5fSmrg  # Base MSYS/MinGW do not provide the 'file' command needed by
32368bd17e5fSmrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
32378bd17e5fSmrg  # unless we find 'file', for example because we are cross-compiling.
32388bd17e5fSmrg  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
32398bd17e5fSmrg  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
32408bd17e5fSmrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
32418bd17e5fSmrg    lt_cv_file_magic_cmd='func_win32_libid'
32428bd17e5fSmrg  else
32438bd17e5fSmrg    # Keep this pattern in sync with the one in func_win32_libid.
32448bd17e5fSmrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
32458bd17e5fSmrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
32468bd17e5fSmrg  fi
32478bd17e5fSmrg  ;;
32488bd17e5fSmrg
32498bd17e5fSmrgcegcc*)
32508bd17e5fSmrg  # use the weaker test based on 'objdump'. See mingw*.
32518bd17e5fSmrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
32528bd17e5fSmrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
32538bd17e5fSmrg  ;;
32548bd17e5fSmrg
32558bd17e5fSmrgdarwin* | rhapsody*)
32568bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
32578bd17e5fSmrg  ;;
32588bd17e5fSmrg
32598bd17e5fSmrgfreebsd* | dragonfly*)
32608bd17e5fSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
32618bd17e5fSmrg    case $host_cpu in
32628bd17e5fSmrg    i*86 )
32638bd17e5fSmrg      # Not sure whether the presence of OpenBSD here was a mistake.
32648bd17e5fSmrg      # Let's accept both of them until this is cleared up.
32658bd17e5fSmrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
32668bd17e5fSmrg      lt_cv_file_magic_cmd=/usr/bin/file
32678bd17e5fSmrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
32680597fb56Smrg      ;;
32690597fb56Smrg    esac
32708bd17e5fSmrg  else
32718bd17e5fSmrg    lt_cv_deplibs_check_method=pass_all
32728bd17e5fSmrg  fi
32738bd17e5fSmrg  ;;
3274b042e37fSmrg
32758bd17e5fSmrghaiku*)
32768bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
32778bd17e5fSmrg  ;;
32788bd17e5fSmrg
32798bd17e5fSmrghpux10.20* | hpux11*)
32808bd17e5fSmrg  lt_cv_file_magic_cmd=/usr/bin/file
32818bd17e5fSmrg  case $host_cpu in
32828bd17e5fSmrg  ia64*)
32838bd17e5fSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
32848bd17e5fSmrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3285706b6b52Smrg    ;;
32868bd17e5fSmrg  hppa*64*)
32878bd17e5fSmrg    [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]']
32888bd17e5fSmrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
32890597fb56Smrg    ;;
32908bd17e5fSmrg  *)
32918bd17e5fSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
32928bd17e5fSmrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3293706b6b52Smrg    ;;
3294706b6b52Smrg  esac
32958bd17e5fSmrg  ;;
3296b042e37fSmrg
32978bd17e5fSmrginterix[[3-9]]*)
32988bd17e5fSmrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
32998bd17e5fSmrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
33008bd17e5fSmrg  ;;
3301b042e37fSmrg
33028bd17e5fSmrgirix5* | irix6* | nonstopux*)
33038bd17e5fSmrg  case $LD in
33048bd17e5fSmrg  *-32|*"-32 ") libmagic=32-bit;;
33058bd17e5fSmrg  *-n32|*"-n32 ") libmagic=N32;;
33068bd17e5fSmrg  *-64|*"-64 ") libmagic=64-bit;;
33078bd17e5fSmrg  *) libmagic=never-match;;
33088bd17e5fSmrg  esac
33098bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
33108bd17e5fSmrg  ;;
3311b042e37fSmrg
33128bd17e5fSmrg# This must be glibc/ELF.
3313b242714cSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
33148bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
33158bd17e5fSmrg  ;;
3316b042e37fSmrg
3317b242714cSmrgnetbsd* | netbsdelf*-gnu)
33188bd17e5fSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
33198bd17e5fSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
33208bd17e5fSmrg  else
33218bd17e5fSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
33228bd17e5fSmrg  fi
33238bd17e5fSmrg  ;;
3324b042e37fSmrg
33258bd17e5fSmrgnewos6*)
33268bd17e5fSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
33278bd17e5fSmrg  lt_cv_file_magic_cmd=/usr/bin/file
33288bd17e5fSmrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
33298bd17e5fSmrg  ;;
3330706b6b52Smrg
33318bd17e5fSmrg*nto* | *qnx*)
33328bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
33338bd17e5fSmrg  ;;
3334b042e37fSmrg
33358bd17e5fSmrgopenbsd*)
33368bd17e5fSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
33378bd17e5fSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
33388bd17e5fSmrg  else
33398bd17e5fSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
33408bd17e5fSmrg  fi
33418bd17e5fSmrg  ;;
3342b042e37fSmrg
33438bd17e5fSmrgosf3* | osf4* | osf5*)
33448bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
33458bd17e5fSmrg  ;;
33460597fb56Smrg
33478bd17e5fSmrgrdos*)
33488bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
33498bd17e5fSmrg  ;;
33500597fb56Smrg
33518bd17e5fSmrgsolaris*)
33528bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
33538bd17e5fSmrg  ;;
33540597fb56Smrg
33558bd17e5fSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
33568bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
33578bd17e5fSmrg  ;;
33580597fb56Smrg
33598bd17e5fSmrgsysv4 | sysv4.3*)
33608bd17e5fSmrg  case $host_vendor in
33618bd17e5fSmrg  motorola)
33628bd17e5fSmrg    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]]'
33638bd17e5fSmrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
33648bd17e5fSmrg    ;;
33658bd17e5fSmrg  ncr)
33668bd17e5fSmrg    lt_cv_deplibs_check_method=pass_all
33678bd17e5fSmrg    ;;
33688bd17e5fSmrg  sequent)
33698bd17e5fSmrg    lt_cv_file_magic_cmd='/bin/file'
33708bd17e5fSmrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
33718bd17e5fSmrg    ;;
33728bd17e5fSmrg  sni)
33738bd17e5fSmrg    lt_cv_file_magic_cmd='/bin/file'
33748bd17e5fSmrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
33758bd17e5fSmrg    lt_cv_file_magic_test_file=/lib/libc.so
33768bd17e5fSmrg    ;;
33778bd17e5fSmrg  siemens)
33788bd17e5fSmrg    lt_cv_deplibs_check_method=pass_all
33798bd17e5fSmrg    ;;
33808bd17e5fSmrg  pc)
33818bd17e5fSmrg    lt_cv_deplibs_check_method=pass_all
33828bd17e5fSmrg    ;;
33838bd17e5fSmrg  esac
33848bd17e5fSmrg  ;;
33850597fb56Smrg
33868bd17e5fSmrgtpf*)
33878bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
33888bd17e5fSmrg  ;;
33898bd17e5fSmrgesac
33908bd17e5fSmrg])
33918bd17e5fSmrg
33928bd17e5fSmrgfile_magic_glob=
33938bd17e5fSmrgwant_nocaseglob=no
33948bd17e5fSmrgif test "$build" = "$host"; then
33958bd17e5fSmrg  case $host_os in
33968bd17e5fSmrg  mingw* | pw32*)
33978bd17e5fSmrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
33988bd17e5fSmrg      want_nocaseglob=yes
33998bd17e5fSmrg    else
34008bd17e5fSmrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
34018bd17e5fSmrg    fi
34028bd17e5fSmrg    ;;
34038bd17e5fSmrg  esac
34048bd17e5fSmrgfi
34050597fb56Smrg
34068bd17e5fSmrgfile_magic_cmd=$lt_cv_file_magic_cmd
34078bd17e5fSmrgdeplibs_check_method=$lt_cv_deplibs_check_method
34088bd17e5fSmrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
34090597fb56Smrg
34108bd17e5fSmrg_LT_DECL([], [deplibs_check_method], [1],
34118bd17e5fSmrg    [Method to check whether dependent libraries are shared objects])
34128bd17e5fSmrg_LT_DECL([], [file_magic_cmd], [1],
34138bd17e5fSmrg    [Command to use when deplibs_check_method = "file_magic"])
34148bd17e5fSmrg_LT_DECL([], [file_magic_glob], [1],
34158bd17e5fSmrg    [How to find potential files when deplibs_check_method = "file_magic"])
34168bd17e5fSmrg_LT_DECL([], [want_nocaseglob], [1],
34178bd17e5fSmrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
34188bd17e5fSmrg])# _LT_CHECK_MAGIC_METHOD
34190597fb56Smrg
34208bd17e5fSmrg
34218bd17e5fSmrg# LT_PATH_NM
34228bd17e5fSmrg# ----------
34238bd17e5fSmrg# find the pathname to a BSD- or MS-compatible name lister
34248bd17e5fSmrgAC_DEFUN([LT_PATH_NM],
34258bd17e5fSmrg[AC_REQUIRE([AC_PROG_CC])dnl
34268bd17e5fSmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
34278bd17e5fSmrg[if test -n "$NM"; then
34288bd17e5fSmrg  # Let the user override the test.
34298bd17e5fSmrg  lt_cv_path_NM="$NM"
34308bd17e5fSmrgelse
34318bd17e5fSmrg  lt_nm_to_check="${ac_tool_prefix}nm"
34328bd17e5fSmrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
34338bd17e5fSmrg    lt_nm_to_check="$lt_nm_to_check nm"
34348bd17e5fSmrg  fi
34358bd17e5fSmrg  for lt_tmp_nm in $lt_nm_to_check; do
34368bd17e5fSmrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
34378bd17e5fSmrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
34388bd17e5fSmrg      IFS="$lt_save_ifs"
34398bd17e5fSmrg      test -z "$ac_dir" && ac_dir=.
34408bd17e5fSmrg      tmp_nm="$ac_dir/$lt_tmp_nm"
34418bd17e5fSmrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
34428bd17e5fSmrg	# Check to see if the nm accepts a BSD-compat flag.
34438bd17e5fSmrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
34448bd17e5fSmrg	#   nm: unknown option "B" ignored
34458bd17e5fSmrg	# Tru64's nm complains that /dev/null is an invalid object file
34468bd17e5fSmrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
34478bd17e5fSmrg	*/dev/null* | *'Invalid file or object type'*)
34488bd17e5fSmrg	  lt_cv_path_NM="$tmp_nm -B"
34498bd17e5fSmrg	  break
34508bd17e5fSmrg	  ;;
34518bd17e5fSmrg	*)
34528bd17e5fSmrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
34538bd17e5fSmrg	  */dev/null*)
34548bd17e5fSmrg	    lt_cv_path_NM="$tmp_nm -p"
34558bd17e5fSmrg	    break
34568bd17e5fSmrg	    ;;
34578bd17e5fSmrg	  *)
34588bd17e5fSmrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
34598bd17e5fSmrg	    continue # so that we can try to find one that supports BSD flags
34608bd17e5fSmrg	    ;;
34618bd17e5fSmrg	  esac
34620597fb56Smrg	  ;;
34630597fb56Smrg	esac
34640597fb56Smrg      fi
34658bd17e5fSmrg    done
34668bd17e5fSmrg    IFS="$lt_save_ifs"
34678bd17e5fSmrg  done
34688bd17e5fSmrg  : ${lt_cv_path_NM=no}
34698bd17e5fSmrgfi])
34708bd17e5fSmrgif test "$lt_cv_path_NM" != "no"; then
34718bd17e5fSmrg  NM="$lt_cv_path_NM"
34728bd17e5fSmrgelse
34738bd17e5fSmrg  # Didn't find any BSD compatible name lister, look for dumpbin.
34748bd17e5fSmrg  if test -n "$DUMPBIN"; then :
34758bd17e5fSmrg    # Let the user override the test.
34768bd17e5fSmrg  else
34778bd17e5fSmrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
34788bd17e5fSmrg    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
34798bd17e5fSmrg    *COFF*)
34808bd17e5fSmrg      DUMPBIN="$DUMPBIN -symbols"
3481706b6b52Smrg      ;;
34828bd17e5fSmrg    *)
34838bd17e5fSmrg      DUMPBIN=:
34840597fb56Smrg      ;;
34858bd17e5fSmrg    esac
34868bd17e5fSmrg  fi
34878bd17e5fSmrg  AC_SUBST([DUMPBIN])
34888bd17e5fSmrg  if test "$DUMPBIN" != ":"; then
34898bd17e5fSmrg    NM="$DUMPBIN"
34908bd17e5fSmrg  fi
34918bd17e5fSmrgfi
34928bd17e5fSmrgtest -z "$NM" && NM=nm
34938bd17e5fSmrgAC_SUBST([NM])
34948bd17e5fSmrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3495706b6b52Smrg
34968bd17e5fSmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
34978bd17e5fSmrg  [lt_cv_nm_interface="BSD nm"
34988bd17e5fSmrg  echo "int some_variable = 0;" > conftest.$ac_ext
34998bd17e5fSmrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
35008bd17e5fSmrg  (eval "$ac_compile" 2>conftest.err)
35018bd17e5fSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
35028bd17e5fSmrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
35038bd17e5fSmrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
35048bd17e5fSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
35058bd17e5fSmrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
35068bd17e5fSmrg  cat conftest.out >&AS_MESSAGE_LOG_FD
35078bd17e5fSmrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
35088bd17e5fSmrg    lt_cv_nm_interface="MS dumpbin"
35098bd17e5fSmrg  fi
35108bd17e5fSmrg  rm -f conftest*])
35118bd17e5fSmrg])# LT_PATH_NM
3512b042e37fSmrg
35138bd17e5fSmrg# Old names:
35148bd17e5fSmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
35158bd17e5fSmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
35168bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
35178bd17e5fSmrgdnl AC_DEFUN([AM_PROG_NM], [])
35188bd17e5fSmrgdnl AC_DEFUN([AC_PROG_NM], [])
3519b042e37fSmrg
35208bd17e5fSmrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
35218bd17e5fSmrg# --------------------------------
35228bd17e5fSmrg# how to determine the name of the shared library
35238bd17e5fSmrg# associated with a specific link library.
35248bd17e5fSmrg#  -- PORTME fill in with the dynamic library characteristics
35258bd17e5fSmrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
35268bd17e5fSmrg[m4_require([_LT_DECL_EGREP])
35278bd17e5fSmrgm4_require([_LT_DECL_OBJDUMP])
35288bd17e5fSmrgm4_require([_LT_DECL_DLLTOOL])
35298bd17e5fSmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
35308bd17e5fSmrglt_cv_sharedlib_from_linklib_cmd,
35318bd17e5fSmrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
3532b042e37fSmrg
35338bd17e5fSmrgcase $host_os in
35348bd17e5fSmrgcygwin* | mingw* | pw32* | cegcc*)
35358bd17e5fSmrg  # two different shell functions defined in ltmain.sh
35368bd17e5fSmrg  # decide which to use based on capabilities of $DLLTOOL
35378bd17e5fSmrg  case `$DLLTOOL --help 2>&1` in
35388bd17e5fSmrg  *--identify-strict*)
35398bd17e5fSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
35408bd17e5fSmrg    ;;
35418bd17e5fSmrg  *)
35428bd17e5fSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
35438bd17e5fSmrg    ;;
35448bd17e5fSmrg  esac
35458bd17e5fSmrg  ;;
35468bd17e5fSmrg*)
35478bd17e5fSmrg  # fallback: assume linklib IS sharedlib
35488bd17e5fSmrg  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
35498bd17e5fSmrg  ;;
35508bd17e5fSmrgesac
35518bd17e5fSmrg])
35528bd17e5fSmrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
35538bd17e5fSmrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3554b042e37fSmrg
35558bd17e5fSmrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
35568bd17e5fSmrg    [Command to associate shared and link libraries])
35578bd17e5fSmrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3558706b6b52Smrg
3559706b6b52Smrg
35608bd17e5fSmrg# _LT_PATH_MANIFEST_TOOL
35618bd17e5fSmrg# ----------------------
35628bd17e5fSmrg# locate the manifest tool
35638bd17e5fSmrgm4_defun([_LT_PATH_MANIFEST_TOOL],
35648bd17e5fSmrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
35658bd17e5fSmrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
35668bd17e5fSmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
35678bd17e5fSmrg  [lt_cv_path_mainfest_tool=no
35688bd17e5fSmrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
35698bd17e5fSmrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
35708bd17e5fSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
35718bd17e5fSmrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
35728bd17e5fSmrg    lt_cv_path_mainfest_tool=yes
35738bd17e5fSmrg  fi
35748bd17e5fSmrg  rm -f conftest*])
35758bd17e5fSmrgif test "x$lt_cv_path_mainfest_tool" != xyes; then
35768bd17e5fSmrg  MANIFEST_TOOL=:
35778bd17e5fSmrgfi
35788bd17e5fSmrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
35798bd17e5fSmrg])# _LT_PATH_MANIFEST_TOOL
3580706b6b52Smrg
3581706b6b52Smrg
35828bd17e5fSmrg# LT_LIB_M
35838bd17e5fSmrg# --------
35848bd17e5fSmrg# check for math library
35858bd17e5fSmrgAC_DEFUN([LT_LIB_M],
35868bd17e5fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
35878bd17e5fSmrgLIBM=
35888bd17e5fSmrgcase $host in
35898bd17e5fSmrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
35908bd17e5fSmrg  # These system don't have libm, or don't need it
35918bd17e5fSmrg  ;;
35928bd17e5fSmrg*-ncr-sysv4.3*)
35938bd17e5fSmrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
35948bd17e5fSmrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
35958bd17e5fSmrg  ;;
35968bd17e5fSmrg*)
35978bd17e5fSmrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
35988bd17e5fSmrg  ;;
35998bd17e5fSmrgesac
36008bd17e5fSmrgAC_SUBST([LIBM])
36018bd17e5fSmrg])# LT_LIB_M
3602b042e37fSmrg
36038bd17e5fSmrg# Old name:
36048bd17e5fSmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
36058bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
36068bd17e5fSmrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3607b042e37fSmrg
3608b042e37fSmrg
36098bd17e5fSmrg# _LT_COMPILER_NO_RTTI([TAGNAME])
36108bd17e5fSmrg# -------------------------------
36118bd17e5fSmrgm4_defun([_LT_COMPILER_NO_RTTI],
36128bd17e5fSmrg[m4_require([_LT_TAG_COMPILER])dnl
3613b042e37fSmrg
36148bd17e5fSmrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3615b042e37fSmrg
36168bd17e5fSmrgif test "$GCC" = yes; then
36178bd17e5fSmrg  case $cc_basename in
36188bd17e5fSmrg  nvcc*)
36198bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
36208bd17e5fSmrg  *)
36218bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
36228bd17e5fSmrg  esac
36238bd17e5fSmrg
36248bd17e5fSmrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
36258bd17e5fSmrg    lt_cv_prog_compiler_rtti_exceptions,
36268bd17e5fSmrg    [-fno-rtti -fno-exceptions], [],
36278bd17e5fSmrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
36288bd17e5fSmrgfi
36298bd17e5fSmrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
36308bd17e5fSmrg	[Compiler flag to turn off builtin functions])
36318bd17e5fSmrg])# _LT_COMPILER_NO_RTTI
3632b042e37fSmrg
3633b042e37fSmrg
36348bd17e5fSmrg# _LT_CMD_GLOBAL_SYMBOLS
36358bd17e5fSmrg# ----------------------
36368bd17e5fSmrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
36378bd17e5fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
36388bd17e5fSmrgAC_REQUIRE([AC_PROG_CC])dnl
36398bd17e5fSmrgAC_REQUIRE([AC_PROG_AWK])dnl
36408bd17e5fSmrgAC_REQUIRE([LT_PATH_NM])dnl
36418bd17e5fSmrgAC_REQUIRE([LT_PATH_LD])dnl
36428bd17e5fSmrgm4_require([_LT_DECL_SED])dnl
36438bd17e5fSmrgm4_require([_LT_DECL_EGREP])dnl
36448bd17e5fSmrgm4_require([_LT_TAG_COMPILER])dnl
36450597fb56Smrg
36468bd17e5fSmrg# Check for command to grab the raw symbol name followed by C symbol from nm.
36478bd17e5fSmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
36488bd17e5fSmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
36498bd17e5fSmrg[
36508bd17e5fSmrg# These are sane defaults that work on at least a few old systems.
36518bd17e5fSmrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3652b042e37fSmrg
36538bd17e5fSmrg# Character class describing NM global symbol codes.
36548bd17e5fSmrgsymcode='[[BCDEGRST]]'
3655b042e37fSmrg
36568bd17e5fSmrg# Regexp to match symbols that can be accessed directly from C.
36578bd17e5fSmrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3658b042e37fSmrg
36598bd17e5fSmrg# Define system-specific variables.
36608bd17e5fSmrgcase $host_os in
36618bd17e5fSmrgaix*)
36628bd17e5fSmrg  symcode='[[BCDT]]'
36638bd17e5fSmrg  ;;
36648bd17e5fSmrgcygwin* | mingw* | pw32* | cegcc*)
36658bd17e5fSmrg  symcode='[[ABCDGISTW]]'
36668bd17e5fSmrg  ;;
36678bd17e5fSmrghpux*)
36688bd17e5fSmrg  if test "$host_cpu" = ia64; then
36698bd17e5fSmrg    symcode='[[ABCDEGRST]]'
36708bd17e5fSmrg  fi
36718bd17e5fSmrg  ;;
36728bd17e5fSmrgirix* | nonstopux*)
36738bd17e5fSmrg  symcode='[[BCDEGRST]]'
36748bd17e5fSmrg  ;;
36758bd17e5fSmrgosf*)
36768bd17e5fSmrg  symcode='[[BCDEGQRST]]'
36778bd17e5fSmrg  ;;
36788bd17e5fSmrgsolaris*)
36798bd17e5fSmrg  symcode='[[BDRT]]'
36808bd17e5fSmrg  ;;
36818bd17e5fSmrgsco3.2v5*)
36828bd17e5fSmrg  symcode='[[DT]]'
36838bd17e5fSmrg  ;;
36848bd17e5fSmrgsysv4.2uw2*)
36858bd17e5fSmrg  symcode='[[DT]]'
36868bd17e5fSmrg  ;;
36878bd17e5fSmrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
36888bd17e5fSmrg  symcode='[[ABDT]]'
36898bd17e5fSmrg  ;;
36908bd17e5fSmrgsysv4)
36918bd17e5fSmrg  symcode='[[DFNSTU]]'
36928bd17e5fSmrg  ;;
36938bd17e5fSmrgesac
3694b042e37fSmrg
36958bd17e5fSmrg# If we're using GNU nm, then use its standard symbol codes.
36968bd17e5fSmrgcase `$NM -V 2>&1` in
36978bd17e5fSmrg*GNU* | *'with BFD'*)
36988bd17e5fSmrg  symcode='[[ABCDGIRSTW]]' ;;
36998bd17e5fSmrgesac
3700b042e37fSmrg
37018bd17e5fSmrg# Transform an extracted symbol line into a proper C declaration.
37028bd17e5fSmrg# Some systems (esp. on ia64) link data and code symbols differently,
37038bd17e5fSmrg# so use this general approach.
37048bd17e5fSmrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3705b042e37fSmrg
37068bd17e5fSmrg# Transform an extracted symbol line into symbol name and symbol address
37078bd17e5fSmrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
37088bd17e5fSmrglt_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'"
3709b042e37fSmrg
37108bd17e5fSmrg# Handle CRLF in mingw tool chain
37118bd17e5fSmrgopt_cr=
37128bd17e5fSmrgcase $build_os in
37138bd17e5fSmrgmingw*)
37148bd17e5fSmrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
37158bd17e5fSmrg  ;;
37168bd17e5fSmrgesac
3717b042e37fSmrg
37188bd17e5fSmrg# Try without a prefix underscore, then with it.
37198bd17e5fSmrgfor ac_symprfx in "" "_"; do
3720b042e37fSmrg
37218bd17e5fSmrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
37228bd17e5fSmrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
37238bd17e5fSmrg
37248bd17e5fSmrg  # Write the raw and C identifiers.
37258bd17e5fSmrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
37268bd17e5fSmrg    # Fake it for dumpbin and say T for any non-static function
37278bd17e5fSmrg    # and D for any global variable.
37288bd17e5fSmrg    # Also find C++ and __fastcall symbols from MSVC++,
37298bd17e5fSmrg    # which start with @ or ?.
37308bd17e5fSmrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
37318bd17e5fSmrg"     {last_section=section; section=\$ 3};"\
37328bd17e5fSmrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
37338bd17e5fSmrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
37348bd17e5fSmrg"     \$ 0!~/External *\|/{next};"\
37358bd17e5fSmrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
37368bd17e5fSmrg"     {if(hide[section]) next};"\
37378bd17e5fSmrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
37388bd17e5fSmrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
37398bd17e5fSmrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
37408bd17e5fSmrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
37418bd17e5fSmrg"     ' prfx=^$ac_symprfx]"
37428bd17e5fSmrg  else
37438bd17e5fSmrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
37448bd17e5fSmrg  fi
37458bd17e5fSmrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
3746b042e37fSmrg
37478bd17e5fSmrg  # Check to see that the pipe works correctly.
37488bd17e5fSmrg  pipe_works=no
3749b042e37fSmrg
37508bd17e5fSmrg  rm -f conftest*
37518bd17e5fSmrg  cat > conftest.$ac_ext <<_LT_EOF
37528bd17e5fSmrg#ifdef __cplusplus
37538bd17e5fSmrgextern "C" {
37548bd17e5fSmrg#endif
37558bd17e5fSmrgchar nm_test_var;
37568bd17e5fSmrgvoid nm_test_func(void);
37578bd17e5fSmrgvoid nm_test_func(void){}
37588bd17e5fSmrg#ifdef __cplusplus
37598bd17e5fSmrg}
37608bd17e5fSmrg#endif
37618bd17e5fSmrgint main(){nm_test_var='a';nm_test_func();return(0);}
37628bd17e5fSmrg_LT_EOF
3763b042e37fSmrg
37648bd17e5fSmrg  if AC_TRY_EVAL(ac_compile); then
37658bd17e5fSmrg    # Now try to grab the symbols.
37668bd17e5fSmrg    nlist=conftest.nm
37678bd17e5fSmrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
37688bd17e5fSmrg      # Try sorting and uniquifying the output.
37698bd17e5fSmrg      if sort "$nlist" | uniq > "$nlist"T; then
37708bd17e5fSmrg	mv -f "$nlist"T "$nlist"
37710597fb56Smrg      else
37728bd17e5fSmrg	rm -f "$nlist"T
37730597fb56Smrg      fi
3774b042e37fSmrg
37758bd17e5fSmrg      # Make sure that we snagged all the symbols we need.
37768bd17e5fSmrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
37778bd17e5fSmrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
37788bd17e5fSmrg	  cat <<_LT_EOF > conftest.$ac_ext
37798bd17e5fSmrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
37808bd17e5fSmrg#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
37818bd17e5fSmrg/* DATA imports from DLLs on WIN32 con't be const, because runtime
37828bd17e5fSmrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
37838bd17e5fSmrg# define LT@&t@_DLSYM_CONST
37848bd17e5fSmrg#elif defined(__osf__)
37858bd17e5fSmrg/* This system does not cope well with relocations in const data.  */
37868bd17e5fSmrg# define LT@&t@_DLSYM_CONST
37878bd17e5fSmrg#else
37888bd17e5fSmrg# define LT@&t@_DLSYM_CONST const
37898bd17e5fSmrg#endif
3790b042e37fSmrg
37918bd17e5fSmrg#ifdef __cplusplus
37928bd17e5fSmrgextern "C" {
37938bd17e5fSmrg#endif
3794b042e37fSmrg
37958bd17e5fSmrg_LT_EOF
37968bd17e5fSmrg	  # Now generate the symbol file.
37978bd17e5fSmrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
3798b042e37fSmrg
37998bd17e5fSmrg	  cat <<_LT_EOF >> conftest.$ac_ext
38008bd17e5fSmrg
38018bd17e5fSmrg/* The mapping between symbol names and symbols.  */
38028bd17e5fSmrgLT@&t@_DLSYM_CONST struct {
38038bd17e5fSmrg  const char *name;
38048bd17e5fSmrg  void       *address;
38058bd17e5fSmrg}
38068bd17e5fSmrglt__PROGRAM__LTX_preloaded_symbols[[]] =
38078bd17e5fSmrg{
38088bd17e5fSmrg  { "@PROGRAM@", (void *) 0 },
38098bd17e5fSmrg_LT_EOF
38108bd17e5fSmrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
38118bd17e5fSmrg	  cat <<\_LT_EOF >> conftest.$ac_ext
38128bd17e5fSmrg  {0, (void *) 0}
38138bd17e5fSmrg};
38148bd17e5fSmrg
38158bd17e5fSmrg/* This works around a problem in FreeBSD linker */
38168bd17e5fSmrg#ifdef FREEBSD_WORKAROUND
38178bd17e5fSmrgstatic const void *lt_preloaded_setup() {
38188bd17e5fSmrg  return lt__PROGRAM__LTX_preloaded_symbols;
38198bd17e5fSmrg}
38208bd17e5fSmrg#endif
38218bd17e5fSmrg
38228bd17e5fSmrg#ifdef __cplusplus
38238bd17e5fSmrg}
38248bd17e5fSmrg#endif
38258bd17e5fSmrg_LT_EOF
38268bd17e5fSmrg	  # Now try linking the two files.
38278bd17e5fSmrg	  mv conftest.$ac_objext conftstm.$ac_objext
38288bd17e5fSmrg	  lt_globsym_save_LIBS=$LIBS
38298bd17e5fSmrg	  lt_globsym_save_CFLAGS=$CFLAGS
38308bd17e5fSmrg	  LIBS="conftstm.$ac_objext"
38318bd17e5fSmrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
38328bd17e5fSmrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
38338bd17e5fSmrg	    pipe_works=yes
38348bd17e5fSmrg	  fi
38358bd17e5fSmrg	  LIBS=$lt_globsym_save_LIBS
38368bd17e5fSmrg	  CFLAGS=$lt_globsym_save_CFLAGS
38370597fb56Smrg	else
38388bd17e5fSmrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
38390597fb56Smrg	fi
38400597fb56Smrg      else
38418bd17e5fSmrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
38428bd17e5fSmrg      fi
38438bd17e5fSmrg    else
38448bd17e5fSmrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
38458bd17e5fSmrg    fi
38468bd17e5fSmrg  else
38478bd17e5fSmrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
38488bd17e5fSmrg    cat conftest.$ac_ext >&5
38498bd17e5fSmrg  fi
38508bd17e5fSmrg  rm -rf conftest* conftst*
38518bd17e5fSmrg
38528bd17e5fSmrg  # Do not use the global_symbol_pipe unless it works.
38538bd17e5fSmrg  if test "$pipe_works" = yes; then
38548bd17e5fSmrg    break
38558bd17e5fSmrg  else
38568bd17e5fSmrg    lt_cv_sys_global_symbol_pipe=
38578bd17e5fSmrg  fi
38588bd17e5fSmrgdone
38598bd17e5fSmrg])
38608bd17e5fSmrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
38618bd17e5fSmrg  lt_cv_sys_global_symbol_to_cdecl=
38628bd17e5fSmrgfi
38638bd17e5fSmrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
38648bd17e5fSmrg  AC_MSG_RESULT(failed)
38658bd17e5fSmrgelse
38668bd17e5fSmrg  AC_MSG_RESULT(ok)
38678bd17e5fSmrgfi
38688bd17e5fSmrg
38698bd17e5fSmrg# Response file support.
38708bd17e5fSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
38718bd17e5fSmrg  nm_file_list_spec='@'
38728bd17e5fSmrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
38738bd17e5fSmrg  nm_file_list_spec='@'
38748bd17e5fSmrgfi
38758bd17e5fSmrg
38768bd17e5fSmrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
38778bd17e5fSmrg    [Take the output of nm and produce a listing of raw symbols and C names])
38788bd17e5fSmrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
38798bd17e5fSmrg    [Transform the output of nm in a proper C declaration])
38808bd17e5fSmrg_LT_DECL([global_symbol_to_c_name_address],
38818bd17e5fSmrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
38828bd17e5fSmrg    [Transform the output of nm in a C name address pair])
38838bd17e5fSmrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
38848bd17e5fSmrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
38858bd17e5fSmrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
38868bd17e5fSmrg_LT_DECL([], [nm_file_list_spec], [1],
38878bd17e5fSmrg    [Specify filename containing input files for $NM])
38888bd17e5fSmrg]) # _LT_CMD_GLOBAL_SYMBOLS
38898bd17e5fSmrg
38908bd17e5fSmrg
38918bd17e5fSmrg# _LT_COMPILER_PIC([TAGNAME])
38928bd17e5fSmrg# ---------------------------
38938bd17e5fSmrgm4_defun([_LT_COMPILER_PIC],
38948bd17e5fSmrg[m4_require([_LT_TAG_COMPILER])dnl
38958bd17e5fSmrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
38968bd17e5fSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
38978bd17e5fSmrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
38988bd17e5fSmrg
38998bd17e5fSmrgm4_if([$1], [CXX], [
39008bd17e5fSmrg  # C++ specific cases for pic, static, wl, etc.
39018bd17e5fSmrg  if test "$GXX" = yes; then
39028bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
39038bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
39048bd17e5fSmrg
39058bd17e5fSmrg    case $host_os in
39068bd17e5fSmrg    aix*)
39078bd17e5fSmrg      # All AIX code is PIC.
39088bd17e5fSmrg      if test "$host_cpu" = ia64; then
39098bd17e5fSmrg	# AIX 5 now supports IA64 processor
39108bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
39110597fb56Smrg      fi
39120597fb56Smrg      ;;
3913b042e37fSmrg
39148bd17e5fSmrg    amigaos*)
39158bd17e5fSmrg      case $host_cpu in
39168bd17e5fSmrg      powerpc)
39178bd17e5fSmrg            # see comment about AmigaOS4 .so support
39188bd17e5fSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
39198bd17e5fSmrg        ;;
39208bd17e5fSmrg      m68k)
39218bd17e5fSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
39228bd17e5fSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
39238bd17e5fSmrg            # like `-m68040'.
39248bd17e5fSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
39258bd17e5fSmrg        ;;
39268bd17e5fSmrg      esac
39270597fb56Smrg      ;;
3928b042e37fSmrg
39298bd17e5fSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
39308bd17e5fSmrg      # PIC is the default for these OSes.
39310597fb56Smrg      ;;
39328bd17e5fSmrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
39338bd17e5fSmrg      # This hack is so that the source file can tell whether it is being
39348bd17e5fSmrg      # built for inclusion in a dll (and should export symbols for example).
39358bd17e5fSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
39368bd17e5fSmrg      # (--disable-auto-import) libraries
39378bd17e5fSmrg      m4_if([$1], [GCJ], [],
39388bd17e5fSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
39398bd17e5fSmrg      ;;
39408bd17e5fSmrg    darwin* | rhapsody*)
39418bd17e5fSmrg      # PIC is the default on this platform
39428bd17e5fSmrg      # Common symbols not allowed in MH_DYLIB files
39438bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
39448bd17e5fSmrg      ;;
39458bd17e5fSmrg    *djgpp*)
39468bd17e5fSmrg      # DJGPP does not support shared libraries at all
39478bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
39488bd17e5fSmrg      ;;
39498bd17e5fSmrg    haiku*)
39508bd17e5fSmrg      # PIC is the default for Haiku.
39518bd17e5fSmrg      # The "-static" flag exists, but is broken.
39528bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
39538bd17e5fSmrg      ;;
39548bd17e5fSmrg    interix[[3-9]]*)
39558bd17e5fSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
39568bd17e5fSmrg      # Instead, we relocate shared libraries at runtime.
39578bd17e5fSmrg      ;;
39588bd17e5fSmrg    sysv4*MP*)
39598bd17e5fSmrg      if test -d /usr/nec; then
39608bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
39610597fb56Smrg      fi
39620597fb56Smrg      ;;
39638bd17e5fSmrg    hpux*)
39648bd17e5fSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
39658bd17e5fSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
39668bd17e5fSmrg      # sets the default TLS model and affects inlining.
39678bd17e5fSmrg      case $host_cpu in
39688bd17e5fSmrg      hppa*64*)
39698bd17e5fSmrg	;;
39708bd17e5fSmrg      *)
39718bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
39728bd17e5fSmrg	;;
39738bd17e5fSmrg      esac
39748bd17e5fSmrg      ;;
39758bd17e5fSmrg    *qnx* | *nto*)
39768bd17e5fSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
39778bd17e5fSmrg      # it will coredump.
39788bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
39798bd17e5fSmrg      ;;
39808bd17e5fSmrg    *)
39818bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
39828bd17e5fSmrg      ;;
39838bd17e5fSmrg    esac
39848bd17e5fSmrg  else
39858bd17e5fSmrg    case $host_os in
39868bd17e5fSmrg      aix[[4-9]]*)
39878bd17e5fSmrg	# All AIX code is PIC.
39888bd17e5fSmrg	if test "$host_cpu" = ia64; then
39898bd17e5fSmrg	  # AIX 5 now supports IA64 processor
39908bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
39918bd17e5fSmrg	else
39928bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
39938bd17e5fSmrg	fi
39948bd17e5fSmrg	;;
39958bd17e5fSmrg      chorus*)
39968bd17e5fSmrg	case $cc_basename in
39978bd17e5fSmrg	cxch68*)
39988bd17e5fSmrg	  # Green Hills C++ Compiler
39998bd17e5fSmrg	  # _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"
40000597fb56Smrg	  ;;
40010597fb56Smrg	esac
40020597fb56Smrg	;;
40038bd17e5fSmrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
40048bd17e5fSmrg	# This hack is so that the source file can tell whether it is being
40058bd17e5fSmrg	# built for inclusion in a dll (and should export symbols for example).
40068bd17e5fSmrg	m4_if([$1], [GCJ], [],
40078bd17e5fSmrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
40088bd17e5fSmrg	;;
40098bd17e5fSmrg      dgux*)
40108bd17e5fSmrg	case $cc_basename in
40118bd17e5fSmrg	  ec++*)
40128bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
40138bd17e5fSmrg	    ;;
40148bd17e5fSmrg	  ghcx*)
40158bd17e5fSmrg	    # Green Hills C++ Compiler
40168bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
40178bd17e5fSmrg	    ;;
40188bd17e5fSmrg	  *)
40198bd17e5fSmrg	    ;;
40208bd17e5fSmrg	esac
40218bd17e5fSmrg	;;
40228bd17e5fSmrg      freebsd* | dragonfly*)
40238bd17e5fSmrg	# FreeBSD uses GNU C++
40248bd17e5fSmrg	;;
40258bd17e5fSmrg      hpux9* | hpux10* | hpux11*)
40268bd17e5fSmrg	case $cc_basename in
40278bd17e5fSmrg	  CC*)
40288bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40298bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
40308bd17e5fSmrg	    if test "$host_cpu" != ia64; then
40318bd17e5fSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
40328bd17e5fSmrg	    fi
40338bd17e5fSmrg	    ;;
40348bd17e5fSmrg	  aCC*)
40358bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40368bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
40378bd17e5fSmrg	    case $host_cpu in
40388bd17e5fSmrg	    hppa*64*|ia64*)
40398bd17e5fSmrg	      # +Z the default
40408bd17e5fSmrg	      ;;
40418bd17e5fSmrg	    *)
40428bd17e5fSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
40438bd17e5fSmrg	      ;;
40448bd17e5fSmrg	    esac
40458bd17e5fSmrg	    ;;
40468bd17e5fSmrg	  *)
40478bd17e5fSmrg	    ;;
40488bd17e5fSmrg	esac
40498bd17e5fSmrg	;;
40508bd17e5fSmrg      interix*)
40518bd17e5fSmrg	# This is c89, which is MS Visual C++ (no shared libs)
40528bd17e5fSmrg	# Anyone wants to do a port?
40538bd17e5fSmrg	;;
40548bd17e5fSmrg      irix5* | irix6* | nonstopux*)
40558bd17e5fSmrg	case $cc_basename in
40568bd17e5fSmrg	  CC*)
40578bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40588bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
40598bd17e5fSmrg	    # CC pic flag -KPIC is the default.
40608bd17e5fSmrg	    ;;
40618bd17e5fSmrg	  *)
40628bd17e5fSmrg	    ;;
40638bd17e5fSmrg	esac
40648bd17e5fSmrg	;;
4065b242714cSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
40668bd17e5fSmrg	case $cc_basename in
40678bd17e5fSmrg	  KCC*)
40688bd17e5fSmrg	    # KAI C++ Compiler
40698bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
40708bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
40718bd17e5fSmrg	    ;;
40728bd17e5fSmrg	  ecpc* )
40738bd17e5fSmrg	    # old Intel C++ for x86_64 which still supported -KPIC.
40748bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40758bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
40768bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
40778bd17e5fSmrg	    ;;
40788bd17e5fSmrg	  icpc* )
40798bd17e5fSmrg	    # Intel C++, used to be incompatible with GCC.
40808bd17e5fSmrg	    # ICC 10 doesn't accept -KPIC any more.
40818bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40828bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
40838bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
40848bd17e5fSmrg	    ;;
40858bd17e5fSmrg	  pgCC* | pgcpp*)
40868bd17e5fSmrg	    # Portland Group C++ compiler
40878bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40888bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
40898bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
40908bd17e5fSmrg	    ;;
40918bd17e5fSmrg	  cxx*)
40928bd17e5fSmrg	    # Compaq C++
40938bd17e5fSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
40948bd17e5fSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
40958bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
40968bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
40978bd17e5fSmrg	    ;;
40988bd17e5fSmrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
40998bd17e5fSmrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
41008bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
41018bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
41028bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
41038bd17e5fSmrg	    ;;
41048bd17e5fSmrg	  *)
41058bd17e5fSmrg	    case `$CC -V 2>&1 | sed 5q` in
41068bd17e5fSmrg	    *Sun\ C*)
41078bd17e5fSmrg	      # Sun C++ 5.9
41088bd17e5fSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
41098bd17e5fSmrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41108bd17e5fSmrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
41118bd17e5fSmrg	      ;;
41128bd17e5fSmrg	    esac
41138bd17e5fSmrg	    ;;
41148bd17e5fSmrg	esac
41158bd17e5fSmrg	;;
41168bd17e5fSmrg      lynxos*)
41178bd17e5fSmrg	;;
41188bd17e5fSmrg      m88k*)
41198bd17e5fSmrg	;;
41208bd17e5fSmrg      mvs*)
41218bd17e5fSmrg	case $cc_basename in
41228bd17e5fSmrg	  cxx*)
41238bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
41248bd17e5fSmrg	    ;;
41258bd17e5fSmrg	  *)
41268bd17e5fSmrg	    ;;
41278bd17e5fSmrg	esac
41288bd17e5fSmrg	;;
4129b242714cSmrg      netbsd* | netbsdelf*-gnu)
41300597fb56Smrg	;;
41318bd17e5fSmrg      *qnx* | *nto*)
41328bd17e5fSmrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
41338bd17e5fSmrg        # it will coredump.
41348bd17e5fSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
41350597fb56Smrg        ;;
41368bd17e5fSmrg      osf3* | osf4* | osf5*)
41378bd17e5fSmrg	case $cc_basename in
41388bd17e5fSmrg	  KCC*)
41398bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
41408bd17e5fSmrg	    ;;
41418bd17e5fSmrg	  RCC*)
41428bd17e5fSmrg	    # Rational C++ 2.4.1
41438bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
41448bd17e5fSmrg	    ;;
41458bd17e5fSmrg	  cxx*)
41468bd17e5fSmrg	    # Digital/Compaq C++
41478bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
41488bd17e5fSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
41498bd17e5fSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
41508bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
41518bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
41528bd17e5fSmrg	    ;;
41538bd17e5fSmrg	  *)
41548bd17e5fSmrg	    ;;
41558bd17e5fSmrg	esac
41560597fb56Smrg	;;
41578bd17e5fSmrg      psos*)
41588bd17e5fSmrg	;;
41598bd17e5fSmrg      solaris*)
41608bd17e5fSmrg	case $cc_basename in
41618bd17e5fSmrg	  CC* | sunCC*)
41628bd17e5fSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
41638bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
41648bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41658bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
41668bd17e5fSmrg	    ;;
41678bd17e5fSmrg	  gcx*)
41688bd17e5fSmrg	    # Green Hills C++ Compiler
41698bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
41708bd17e5fSmrg	    ;;
41718bd17e5fSmrg	  *)
41728bd17e5fSmrg	    ;;
41738bd17e5fSmrg	esac
41748bd17e5fSmrg	;;
41758bd17e5fSmrg      sunos4*)
41768bd17e5fSmrg	case $cc_basename in
41778bd17e5fSmrg	  CC*)
41788bd17e5fSmrg	    # Sun C++ 4.x
41798bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
41808bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41818bd17e5fSmrg	    ;;
41828bd17e5fSmrg	  lcc*)
41838bd17e5fSmrg	    # Lucid
41848bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
41858bd17e5fSmrg	    ;;
41868bd17e5fSmrg	  *)
41878bd17e5fSmrg	    ;;
41888bd17e5fSmrg	esac
41898bd17e5fSmrg	;;
41908bd17e5fSmrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
41918bd17e5fSmrg	case $cc_basename in
41928bd17e5fSmrg	  CC*)
41938bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
41948bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
41958bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41968bd17e5fSmrg	    ;;
41978bd17e5fSmrg	esac
41988bd17e5fSmrg	;;
41998bd17e5fSmrg      tandem*)
42008bd17e5fSmrg	case $cc_basename in
42018bd17e5fSmrg	  NCC*)
42028bd17e5fSmrg	    # NonStop-UX NCC 3.20
42038bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
42048bd17e5fSmrg	    ;;
42058bd17e5fSmrg	  *)
42068bd17e5fSmrg	    ;;
42078bd17e5fSmrg	esac
42088bd17e5fSmrg	;;
42098bd17e5fSmrg      vxworks*)
42108bd17e5fSmrg	;;
42118bd17e5fSmrg      *)
42128bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
42130597fb56Smrg	;;
42148c4a8e55Smrg    esac
42158c4a8e55Smrg  fi
42168bd17e5fSmrg],
42178bd17e5fSmrg[
42188bd17e5fSmrg  if test "$GCC" = yes; then
42198bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
42208bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4221b042e37fSmrg
42228bd17e5fSmrg    case $host_os in
42238bd17e5fSmrg      aix*)
42248bd17e5fSmrg      # All AIX code is PIC.
42258bd17e5fSmrg      if test "$host_cpu" = ia64; then
42268bd17e5fSmrg	# AIX 5 now supports IA64 processor
42278bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
42288bd17e5fSmrg      fi
42298bd17e5fSmrg      ;;
42300597fb56Smrg
42318bd17e5fSmrg    amigaos*)
42328bd17e5fSmrg      case $host_cpu in
42338bd17e5fSmrg      powerpc)
42348bd17e5fSmrg            # see comment about AmigaOS4 .so support
42358bd17e5fSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42368bd17e5fSmrg        ;;
42378bd17e5fSmrg      m68k)
42388bd17e5fSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
42398bd17e5fSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
42408bd17e5fSmrg            # like `-m68040'.
42418bd17e5fSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
42428bd17e5fSmrg        ;;
42438bd17e5fSmrg      esac
42448bd17e5fSmrg      ;;
4245b042e37fSmrg
42468bd17e5fSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
42478bd17e5fSmrg      # PIC is the default for these OSes.
42488bd17e5fSmrg      ;;
4249b042e37fSmrg
42508bd17e5fSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
42518bd17e5fSmrg      # This hack is so that the source file can tell whether it is being
42528bd17e5fSmrg      # built for inclusion in a dll (and should export symbols for example).
42538bd17e5fSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
42548bd17e5fSmrg      # (--disable-auto-import) libraries
42558bd17e5fSmrg      m4_if([$1], [GCJ], [],
42568bd17e5fSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
42578bd17e5fSmrg      ;;
42588c4a8e55Smrg
42598bd17e5fSmrg    darwin* | rhapsody*)
42608bd17e5fSmrg      # PIC is the default on this platform
42618bd17e5fSmrg      # Common symbols not allowed in MH_DYLIB files
42628bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
42638bd17e5fSmrg      ;;
4264b042e37fSmrg
42658bd17e5fSmrg    haiku*)
42668bd17e5fSmrg      # PIC is the default for Haiku.
42678bd17e5fSmrg      # The "-static" flag exists, but is broken.
42688bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
42698bd17e5fSmrg      ;;
4270b042e37fSmrg
42718bd17e5fSmrg    hpux*)
42728bd17e5fSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
42738bd17e5fSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
42748bd17e5fSmrg      # sets the default TLS model and affects inlining.
42758bd17e5fSmrg      case $host_cpu in
42768bd17e5fSmrg      hppa*64*)
42778bd17e5fSmrg	# +Z the default
42788bd17e5fSmrg	;;
42798bd17e5fSmrg      *)
42808bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42818bd17e5fSmrg	;;
42828bd17e5fSmrg      esac
42838bd17e5fSmrg      ;;
42848c4a8e55Smrg
42858bd17e5fSmrg    interix[[3-9]]*)
42868bd17e5fSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
42878bd17e5fSmrg      # Instead, we relocate shared libraries at runtime.
42888bd17e5fSmrg      ;;
42898c4a8e55Smrg
42908bd17e5fSmrg    msdosdjgpp*)
42918bd17e5fSmrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
42928bd17e5fSmrg      # on systems that don't support them.
42938bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
42948bd17e5fSmrg      enable_shared=no
42958bd17e5fSmrg      ;;
42968c4a8e55Smrg
42978bd17e5fSmrg    *nto* | *qnx*)
42988bd17e5fSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
42998bd17e5fSmrg      # it will coredump.
43008bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
43018bd17e5fSmrg      ;;
43028c4a8e55Smrg
43038bd17e5fSmrg    sysv4*MP*)
43048bd17e5fSmrg      if test -d /usr/nec; then
43058bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
43068bd17e5fSmrg      fi
43078bd17e5fSmrg      ;;
43088c4a8e55Smrg
43098bd17e5fSmrg    *)
43108bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
43118bd17e5fSmrg      ;;
43128bd17e5fSmrg    esac
43138bd17e5fSmrg
43148bd17e5fSmrg    case $cc_basename in
43158bd17e5fSmrg    nvcc*) # Cuda Compiler Driver 2.2
43168bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
43178bd17e5fSmrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
43188bd17e5fSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
43198bd17e5fSmrg      fi
43208bd17e5fSmrg      ;;
43218bd17e5fSmrg    esac
43220597fb56Smrg  else
43238bd17e5fSmrg    # PORTME Check for flag to pass linker flags through the system compiler.
43248bd17e5fSmrg    case $host_os in
43258bd17e5fSmrg    aix*)
43268bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43278bd17e5fSmrg      if test "$host_cpu" = ia64; then
43288bd17e5fSmrg	# AIX 5 now supports IA64 processor
43298bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
43308bd17e5fSmrg      else
43318bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
43328bd17e5fSmrg      fi
43338bd17e5fSmrg      ;;
4334b042e37fSmrg
43358bd17e5fSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
43368bd17e5fSmrg      # This hack is so that the source file can tell whether it is being
43378bd17e5fSmrg      # built for inclusion in a dll (and should export symbols for example).
43388bd17e5fSmrg      m4_if([$1], [GCJ], [],
43398bd17e5fSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
43408bd17e5fSmrg      ;;
4341bd23fbfaSmrg
43428bd17e5fSmrg    hpux9* | hpux10* | hpux11*)
43438bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43448bd17e5fSmrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
43458bd17e5fSmrg      # not for PA HP-UX.
43468bd17e5fSmrg      case $host_cpu in
43478bd17e5fSmrg      hppa*64*|ia64*)
43488bd17e5fSmrg	# +Z the default
43498bd17e5fSmrg	;;
43508bd17e5fSmrg      *)
43518bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
43528bd17e5fSmrg	;;
43538bd17e5fSmrg      esac
43548bd17e5fSmrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
43558bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
43568bd17e5fSmrg      ;;
4357b042e37fSmrg
43588bd17e5fSmrg    irix5* | irix6* | nonstopux*)
43598bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43608bd17e5fSmrg      # PIC (with -KPIC) is the default.
43618bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
43628bd17e5fSmrg      ;;
4363b042e37fSmrg
4364b242714cSmrg    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
43658bd17e5fSmrg      case $cc_basename in
43668bd17e5fSmrg      # old Intel for x86_64 which still supported -KPIC.
43678bd17e5fSmrg      ecc*)
43688bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43698bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
43708bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
43718bd17e5fSmrg        ;;
43728bd17e5fSmrg      # icc used to be incompatible with GCC.
43738bd17e5fSmrg      # ICC 10 doesn't accept -KPIC any more.
43748bd17e5fSmrg      icc* | ifort*)
43758bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43768bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
43778bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
43788bd17e5fSmrg        ;;
43798bd17e5fSmrg      # Lahey Fortran 8.1.
43808bd17e5fSmrg      lf95*)
43818bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43828bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
43838bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
43848bd17e5fSmrg	;;
43858bd17e5fSmrg      nagfor*)
43868bd17e5fSmrg	# NAG Fortran compiler
43878bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
43888bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
43898bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
43908bd17e5fSmrg	;;
43918bd17e5fSmrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
43928bd17e5fSmrg        # Portland Group compilers (*not* the Pentium gcc compiler,
43938bd17e5fSmrg	# which looks to be a dead project)
43948bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43958bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
43968bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
43978bd17e5fSmrg        ;;
43988bd17e5fSmrg      ccc*)
43998bd17e5fSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44008bd17e5fSmrg        # All Alpha code is PIC.
44018bd17e5fSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
44028bd17e5fSmrg        ;;
44038bd17e5fSmrg      xl* | bgxl* | bgf* | mpixl*)
44048bd17e5fSmrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
44058bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44068bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
44078bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
44088bd17e5fSmrg	;;
44098bd17e5fSmrg      *)
44108bd17e5fSmrg	case `$CC -V 2>&1 | sed 5q` in
44118bd17e5fSmrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
44128bd17e5fSmrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
44138bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44148bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44158bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
44168bd17e5fSmrg	  ;;
44178bd17e5fSmrg	*Sun\ F* | *Sun*Fortran*)
44188bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44198bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44208bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
44218bd17e5fSmrg	  ;;
44228bd17e5fSmrg	*Sun\ C*)
44238bd17e5fSmrg	  # Sun C 5.9
44248bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44258bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44268bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44278bd17e5fSmrg	  ;;
44288bd17e5fSmrg        *Intel*\ [[CF]]*Compiler*)
44298bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44308bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
44318bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
44328bd17e5fSmrg	  ;;
44338bd17e5fSmrg	*Portland\ Group*)
44348bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44358bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
44368bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44378bd17e5fSmrg	  ;;
44388bd17e5fSmrg	esac
44398bd17e5fSmrg	;;
44408bd17e5fSmrg      esac
44418bd17e5fSmrg      ;;
4442b042e37fSmrg
44438bd17e5fSmrg    newsos6)
44448bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44458bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44468bd17e5fSmrg      ;;
4447b042e37fSmrg
44488bd17e5fSmrg    *nto* | *qnx*)
44498bd17e5fSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
44508bd17e5fSmrg      # it will coredump.
44518bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
44528bd17e5fSmrg      ;;
4453b042e37fSmrg
44548bd17e5fSmrg    osf3* | osf4* | osf5*)
44558bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44568bd17e5fSmrg      # All OSF/1 code is PIC.
44578bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
44588bd17e5fSmrg      ;;
44598bd17e5fSmrg
44608bd17e5fSmrg    rdos*)
44618bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
44628bd17e5fSmrg      ;;
44630597fb56Smrg
44648bd17e5fSmrg    solaris*)
44658bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44668bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44678bd17e5fSmrg      case $cc_basename in
44688bd17e5fSmrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
44698bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
44708bd17e5fSmrg      *)
44718bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
44728bd17e5fSmrg      esac
44738bd17e5fSmrg      ;;
44740597fb56Smrg
44758bd17e5fSmrg    sunos4*)
44768bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
44778bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
44788bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44798bd17e5fSmrg      ;;
44800597fb56Smrg
44818bd17e5fSmrg    sysv4 | sysv4.2uw2* | sysv4.3*)
44828bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44838bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44848bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44858bd17e5fSmrg      ;;
4486b042e37fSmrg
44878bd17e5fSmrg    sysv4*MP*)
44888bd17e5fSmrg      if test -d /usr/nec ;then
44898bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
44908bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44918bd17e5fSmrg      fi
44928bd17e5fSmrg      ;;
4493bd23fbfaSmrg
44948bd17e5fSmrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
44958bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44968bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44978bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44988bd17e5fSmrg      ;;
4499b042e37fSmrg
45008bd17e5fSmrg    unicos*)
45018bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
45028bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
45038bd17e5fSmrg      ;;
45048c4a8e55Smrg
45058bd17e5fSmrg    uts4*)
45068bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
45078bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
45088bd17e5fSmrg      ;;
45098c4a8e55Smrg
45108bd17e5fSmrg    *)
45118bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
45128bd17e5fSmrg      ;;
45138bd17e5fSmrg    esac
45148bd17e5fSmrg  fi
45158bd17e5fSmrg])
45168bd17e5fSmrgcase $host_os in
45178bd17e5fSmrg  # For platforms which do not support PIC, -DPIC is meaningless:
45188bd17e5fSmrg  *djgpp*)
45198bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
45208bd17e5fSmrg    ;;
45218bd17e5fSmrg  *)
45228bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
45238bd17e5fSmrg    ;;
45248bd17e5fSmrgesac
4525b042e37fSmrg
45268bd17e5fSmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
45278bd17e5fSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
45288bd17e5fSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
45298bd17e5fSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
45308c4a8e55Smrg
45318bd17e5fSmrg#
45328bd17e5fSmrg# Check to make sure the PIC flag actually works.
45338bd17e5fSmrg#
45348bd17e5fSmrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
45358bd17e5fSmrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
45368bd17e5fSmrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
45378bd17e5fSmrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
45388bd17e5fSmrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
45398bd17e5fSmrg     "" | " "*) ;;
45408bd17e5fSmrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
45418bd17e5fSmrg     esac],
45428bd17e5fSmrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
45438bd17e5fSmrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
45448bd17e5fSmrgfi
45458bd17e5fSmrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
45468bd17e5fSmrg	[Additional compiler flags for building library objects])
45470597fb56Smrg
45488bd17e5fSmrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
45498bd17e5fSmrg	[How to pass a linker flag through the compiler])
45508bd17e5fSmrg#
45518bd17e5fSmrg# Check to make sure the static flag actually works.
45528bd17e5fSmrg#
45538bd17e5fSmrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
45548bd17e5fSmrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
45558bd17e5fSmrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
45568bd17e5fSmrg  $lt_tmp_static_flag,
45578bd17e5fSmrg  [],
45588bd17e5fSmrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
45598bd17e5fSmrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
45608bd17e5fSmrg	[Compiler flag to prevent dynamic linking])
45618bd17e5fSmrg])# _LT_COMPILER_PIC
4562b042e37fSmrg
45630597fb56Smrg
45648bd17e5fSmrg# _LT_LINKER_SHLIBS([TAGNAME])
45658bd17e5fSmrg# ----------------------------
45668bd17e5fSmrg# See if the linker supports building shared libraries.
45678bd17e5fSmrgm4_defun([_LT_LINKER_SHLIBS],
45688bd17e5fSmrg[AC_REQUIRE([LT_PATH_LD])dnl
45698bd17e5fSmrgAC_REQUIRE([LT_PATH_NM])dnl
45708bd17e5fSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
45718bd17e5fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
45728bd17e5fSmrgm4_require([_LT_DECL_EGREP])dnl
45738bd17e5fSmrgm4_require([_LT_DECL_SED])dnl
45748bd17e5fSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
45758bd17e5fSmrgm4_require([_LT_TAG_COMPILER])dnl
45768bd17e5fSmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
45778bd17e5fSmrgm4_if([$1], [CXX], [
45788bd17e5fSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
45798bd17e5fSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
45808bd17e5fSmrg  case $host_os in
45818bd17e5fSmrg  aix[[4-9]]*)
45828bd17e5fSmrg    # If we're using GNU nm, then we don't want the "-C" option.
45838bd17e5fSmrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
45848bd17e5fSmrg    # Also, AIX nm treats weak defined symbols like other global defined
45858bd17e5fSmrg    # symbols, whereas GNU nm marks them as "W".
45868bd17e5fSmrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
45878bd17e5fSmrg      _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'
45888bd17e5fSmrg    else
45898bd17e5fSmrg      _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'
45908bd17e5fSmrg    fi
45918bd17e5fSmrg    ;;
45928bd17e5fSmrg  pw32*)
45938bd17e5fSmrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
45948bd17e5fSmrg    ;;
45958bd17e5fSmrg  cygwin* | mingw* | cegcc*)
45968bd17e5fSmrg    case $cc_basename in
45978bd17e5fSmrg    cl*)
45988bd17e5fSmrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
45998bd17e5fSmrg      ;;
46008bd17e5fSmrg    *)
46018bd17e5fSmrg      _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'
46028bd17e5fSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
46038bd17e5fSmrg      ;;
46048bd17e5fSmrg    esac
46058bd17e5fSmrg    ;;
4606b242714cSmrg  linux* | k*bsd*-gnu | gnu*)
4607b242714cSmrg    _LT_TAGVAR(link_all_deplibs, $1)=no
4608b242714cSmrg    ;;
46098bd17e5fSmrg  *)
46108bd17e5fSmrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
46118bd17e5fSmrg    ;;
46128bd17e5fSmrg  esac
46138bd17e5fSmrg], [
46148bd17e5fSmrg  runpath_var=
46158bd17e5fSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=
46168bd17e5fSmrg  _LT_TAGVAR(always_export_symbols, $1)=no
46178bd17e5fSmrg  _LT_TAGVAR(archive_cmds, $1)=
46188bd17e5fSmrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
46198bd17e5fSmrg  _LT_TAGVAR(compiler_needs_object, $1)=no
46208bd17e5fSmrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
46218bd17e5fSmrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
46228bd17e5fSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
46238bd17e5fSmrg  _LT_TAGVAR(hardcode_automatic, $1)=no
46248bd17e5fSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
46258bd17e5fSmrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
46268bd17e5fSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
46278bd17e5fSmrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
46288bd17e5fSmrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
46298bd17e5fSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
46308bd17e5fSmrg  _LT_TAGVAR(inherit_rpath, $1)=no
46318bd17e5fSmrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
46328bd17e5fSmrg  _LT_TAGVAR(module_cmds, $1)=
46338bd17e5fSmrg  _LT_TAGVAR(module_expsym_cmds, $1)=
46348bd17e5fSmrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
46358bd17e5fSmrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
46368bd17e5fSmrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
46378bd17e5fSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
46388bd17e5fSmrg  # include_expsyms should be a list of space-separated symbols to be *always*
46398bd17e5fSmrg  # included in the symbol list
46408bd17e5fSmrg  _LT_TAGVAR(include_expsyms, $1)=
46418bd17e5fSmrg  # exclude_expsyms can be an extended regexp of symbols to exclude
46428bd17e5fSmrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
46438bd17e5fSmrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
46448bd17e5fSmrg  # as well as any symbol that contains `d'.
46458bd17e5fSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
46468bd17e5fSmrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
46478bd17e5fSmrg  # platforms (ab)use it in PIC code, but their linkers get confused if
46488bd17e5fSmrg  # the symbol is explicitly referenced.  Since portable code cannot
46498bd17e5fSmrg  # rely on this symbol name, it's probably fine to never include it in
46508bd17e5fSmrg  # preloaded symbol tables.
46518bd17e5fSmrg  # Exclude shared library initialization/finalization symbols.
46528bd17e5fSmrgdnl Note also adjust exclude_expsyms for C++ above.
46538bd17e5fSmrg  extract_expsyms_cmds=
46548bd17e5fSmrg
46558bd17e5fSmrg  case $host_os in
46568bd17e5fSmrg  cygwin* | mingw* | pw32* | cegcc*)
46578bd17e5fSmrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
46588bd17e5fSmrg    # When not using gcc, we currently assume that we are using
46598bd17e5fSmrg    # Microsoft Visual C++.
46608bd17e5fSmrg    if test "$GCC" != yes; then
46618bd17e5fSmrg      with_gnu_ld=no
46628bd17e5fSmrg    fi
46638bd17e5fSmrg    ;;
46648bd17e5fSmrg  interix*)
46658bd17e5fSmrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
46668bd17e5fSmrg    with_gnu_ld=yes
46678bd17e5fSmrg    ;;
46688bd17e5fSmrg  openbsd*)
46698bd17e5fSmrg    with_gnu_ld=no
46708bd17e5fSmrg    ;;
4671b242714cSmrg  linux* | k*bsd*-gnu | gnu*)
4672b242714cSmrg    _LT_TAGVAR(link_all_deplibs, $1)=no
4673b242714cSmrg    ;;
46748bd17e5fSmrg  esac
46750597fb56Smrg
46768bd17e5fSmrg  _LT_TAGVAR(ld_shlibs, $1)=yes
46770597fb56Smrg
46788bd17e5fSmrg  # On some targets, GNU ld is compatible enough with the native linker
46798bd17e5fSmrg  # that we're better off using the native interface for both.
46808bd17e5fSmrg  lt_use_gnu_ld_interface=no
46818bd17e5fSmrg  if test "$with_gnu_ld" = yes; then
46828bd17e5fSmrg    case $host_os in
46838bd17e5fSmrg      aix*)
46848bd17e5fSmrg	# The AIX port of GNU ld has always aspired to compatibility
46858bd17e5fSmrg	# with the native linker.  However, as the warning in the GNU ld
46868bd17e5fSmrg	# block says, versions before 2.19.5* couldn't really create working
46878bd17e5fSmrg	# shared libraries, regardless of the interface used.
46888bd17e5fSmrg	case `$LD -v 2>&1` in
46898bd17e5fSmrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
46908bd17e5fSmrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
46918bd17e5fSmrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
46928bd17e5fSmrg	  *)
46938bd17e5fSmrg	    lt_use_gnu_ld_interface=yes
46948bd17e5fSmrg	    ;;
4695706b6b52Smrg	esac
46968c4a8e55Smrg	;;
46978bd17e5fSmrg      *)
46988bd17e5fSmrg	lt_use_gnu_ld_interface=yes
4699bd23fbfaSmrg	;;
47008bd17e5fSmrg    esac
47018bd17e5fSmrg  fi
47020597fb56Smrg
47038bd17e5fSmrg  if test "$lt_use_gnu_ld_interface" = yes; then
47048bd17e5fSmrg    # If archive_cmds runs LD, not CC, wlarc should be empty
47058bd17e5fSmrg    wlarc='${wl}'
47060597fb56Smrg
47078bd17e5fSmrg    # Set some defaults for GNU ld with shared library support. These
47088bd17e5fSmrg    # are reset later if shared libraries are not supported. Putting them
47098bd17e5fSmrg    # here allows them to be overridden if necessary.
47108bd17e5fSmrg    runpath_var=LD_RUN_PATH
47118bd17e5fSmrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
47128bd17e5fSmrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
47138bd17e5fSmrg    # ancient GNU ld didn't support --whole-archive et. al.
47148bd17e5fSmrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
47158bd17e5fSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
47168bd17e5fSmrg    else
47178bd17e5fSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
47188bd17e5fSmrg    fi
47198bd17e5fSmrg    supports_anon_versioning=no
47208bd17e5fSmrg    case `$LD -v 2>&1` in
47218bd17e5fSmrg      *GNU\ gold*) supports_anon_versioning=yes ;;
47228bd17e5fSmrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
47238bd17e5fSmrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
47248bd17e5fSmrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
47258bd17e5fSmrg      *\ 2.11.*) ;; # other 2.11 versions
47268bd17e5fSmrg      *) supports_anon_versioning=yes ;;
47278bd17e5fSmrg    esac
47280597fb56Smrg
47298bd17e5fSmrg    # See if GNU ld supports shared libraries.
47308bd17e5fSmrg    case $host_os in
47318bd17e5fSmrg    aix[[3-9]]*)
47328bd17e5fSmrg      # On AIX/PPC, the GNU linker is very broken
47338bd17e5fSmrg      if test "$host_cpu" != ia64; then
47348bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
47358bd17e5fSmrg	cat <<_LT_EOF 1>&2
47368bd17e5fSmrg
47378bd17e5fSmrg*** Warning: the GNU linker, at least up to release 2.19, is reported
47388bd17e5fSmrg*** to be unable to reliably create shared libraries on AIX.
47398bd17e5fSmrg*** Therefore, libtool is disabling shared libraries support.  If you
47408bd17e5fSmrg*** really care for shared libraries, you may want to install binutils
47418bd17e5fSmrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
47428bd17e5fSmrg*** You will then need to restart the configuration process.
47438bd17e5fSmrg
47448bd17e5fSmrg_LT_EOF
47458bd17e5fSmrg      fi
47468bd17e5fSmrg      ;;
47470597fb56Smrg
47488bd17e5fSmrg    amigaos*)
47498bd17e5fSmrg      case $host_cpu in
47508bd17e5fSmrg      powerpc)
47518bd17e5fSmrg            # see comment about AmigaOS4 .so support
47528bd17e5fSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
47538bd17e5fSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
47540597fb56Smrg        ;;
47558bd17e5fSmrg      m68k)
47568bd17e5fSmrg            _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)'
47578bd17e5fSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
47588bd17e5fSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
47590597fb56Smrg        ;;
47608bd17e5fSmrg      esac
47618bd17e5fSmrg      ;;
47620597fb56Smrg
47638bd17e5fSmrg    beos*)
47648bd17e5fSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
47658bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
47668bd17e5fSmrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
47678bd17e5fSmrg	# support --undefined.  This deserves some investigation.  FIXME
47688bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
47698bd17e5fSmrg      else
47708bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
47718bd17e5fSmrg      fi
47728bd17e5fSmrg      ;;
47730597fb56Smrg
47748bd17e5fSmrg    cygwin* | mingw* | pw32* | cegcc*)
47758bd17e5fSmrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
47768bd17e5fSmrg      # as there is no search path for DLLs.
47778bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
47788bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
47798bd17e5fSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
47808bd17e5fSmrg      _LT_TAGVAR(always_export_symbols, $1)=no
47818bd17e5fSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
47828bd17e5fSmrg      _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'
47838bd17e5fSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
47840597fb56Smrg
47858bd17e5fSmrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
47868bd17e5fSmrg        _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'
47878bd17e5fSmrg	# If the export-symbols file already is a .def file (1st line
47888bd17e5fSmrg	# is EXPORTS), use it as is; otherwise, prepend...
47898bd17e5fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
47908bd17e5fSmrg	  cp $export_symbols $output_objdir/$soname.def;
47918bd17e5fSmrg	else
47928bd17e5fSmrg	  echo EXPORTS > $output_objdir/$soname.def;
47938bd17e5fSmrg	  cat $export_symbols >> $output_objdir/$soname.def;
47948bd17e5fSmrg	fi~
47958bd17e5fSmrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
47968bd17e5fSmrg      else
47978bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
47988bd17e5fSmrg      fi
47998bd17e5fSmrg      ;;
48000597fb56Smrg
48018bd17e5fSmrg    haiku*)
48028bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
48038bd17e5fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
48048bd17e5fSmrg      ;;
48050597fb56Smrg
48068bd17e5fSmrg    interix[[3-9]]*)
48078bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=no
48088bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
48098bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
48108bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
48118bd17e5fSmrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
48128bd17e5fSmrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
48138bd17e5fSmrg      # default) and relocated if they conflict, which is a slow very memory
48148bd17e5fSmrg      # consuming and fragmenting process.  To avoid this, we pick a random,
48158bd17e5fSmrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
48168bd17e5fSmrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
48178bd17e5fSmrg      _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'
48188bd17e5fSmrg      _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'
48198bd17e5fSmrg      ;;
48200597fb56Smrg
48218bd17e5fSmrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
48228bd17e5fSmrg      tmp_diet=no
48238bd17e5fSmrg      if test "$host_os" = linux-dietlibc; then
48248bd17e5fSmrg	case $cc_basename in
48258bd17e5fSmrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
48268bd17e5fSmrg	esac
48278bd17e5fSmrg      fi
48288bd17e5fSmrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
48298bd17e5fSmrg	 && test "$tmp_diet" = no
48308bd17e5fSmrg      then
48318bd17e5fSmrg	tmp_addflag=' $pic_flag'
48328bd17e5fSmrg	tmp_sharedflag='-shared'
48338bd17e5fSmrg	case $cc_basename,$host_cpu in
48348bd17e5fSmrg        pgcc*)				# Portland Group C compiler
48358bd17e5fSmrg	  _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'
48368bd17e5fSmrg	  tmp_addflag=' $pic_flag'
48378bd17e5fSmrg	  ;;
48388bd17e5fSmrg	pgf77* | pgf90* | pgf95* | pgfortran*)
48398bd17e5fSmrg					# Portland Group f77 and f90 compilers
48408bd17e5fSmrg	  _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'
48418bd17e5fSmrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
48428bd17e5fSmrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
48438bd17e5fSmrg	  tmp_addflag=' -i_dynamic' ;;
48448bd17e5fSmrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
48458bd17e5fSmrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
48468bd17e5fSmrg	ifc* | ifort*)			# Intel Fortran compiler
48478bd17e5fSmrg	  tmp_addflag=' -nofor_main' ;;
48488bd17e5fSmrg	lf95*)				# Lahey Fortran 8.1
48498bd17e5fSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
48508bd17e5fSmrg	  tmp_sharedflag='--shared' ;;
48518bd17e5fSmrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
48528bd17e5fSmrg	  tmp_sharedflag='-qmkshrobj'
48538bd17e5fSmrg	  tmp_addflag= ;;
48548bd17e5fSmrg	nvcc*)	# Cuda Compiler Driver 2.2
48558bd17e5fSmrg	  _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'
48568bd17e5fSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
48578bd17e5fSmrg	  ;;
48588bd17e5fSmrg	esac
48598bd17e5fSmrg	case `$CC -V 2>&1 | sed 5q` in
48608bd17e5fSmrg	*Sun\ C*)			# Sun C 5.9
48618bd17e5fSmrg	  _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'
48628bd17e5fSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
48638bd17e5fSmrg	  tmp_sharedflag='-G' ;;
48648bd17e5fSmrg	*Sun\ F*)			# Sun Fortran 8.3
48658bd17e5fSmrg	  tmp_sharedflag='-G' ;;
48668bd17e5fSmrg	esac
48678bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
48680597fb56Smrg
48698bd17e5fSmrg        if test "x$supports_anon_versioning" = xyes; then
48708bd17e5fSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
48718bd17e5fSmrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
48728bd17e5fSmrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
48738bd17e5fSmrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
48748bd17e5fSmrg        fi
48750597fb56Smrg
48768bd17e5fSmrg	case $cc_basename in
48778bd17e5fSmrg	xlf* | bgf* | bgxlf* | mpixlf*)
48788bd17e5fSmrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
48798bd17e5fSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
48808bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
48818bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
48828bd17e5fSmrg	  if test "x$supports_anon_versioning" = xyes; then
48838bd17e5fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
48848bd17e5fSmrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
48858bd17e5fSmrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
48868bd17e5fSmrg	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
48878bd17e5fSmrg	  fi
48888bd17e5fSmrg	  ;;
48898bd17e5fSmrg	esac
48908bd17e5fSmrg      else
48918bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
48928bd17e5fSmrg      fi
48938bd17e5fSmrg      ;;
48940597fb56Smrg
4895b242714cSmrg    netbsd* | netbsdelf*-gnu)
48968bd17e5fSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
48978bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
48988bd17e5fSmrg	wlarc=
48998bd17e5fSmrg      else
49008bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
49018bd17e5fSmrg	_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'
49028bd17e5fSmrg      fi
49038bd17e5fSmrg      ;;
49040597fb56Smrg
49058bd17e5fSmrg    solaris*)
49068bd17e5fSmrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
49078bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
49088bd17e5fSmrg	cat <<_LT_EOF 1>&2
49090597fb56Smrg
49108bd17e5fSmrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
49118bd17e5fSmrg*** create shared libraries on Solaris systems.  Therefore, libtool
49128bd17e5fSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
49138bd17e5fSmrg*** binutils to release 2.9.1 or newer.  Another option is to modify
49148bd17e5fSmrg*** your PATH or compiler configuration so that the native linker is
49158bd17e5fSmrg*** used, and then restart.
49160597fb56Smrg
49178bd17e5fSmrg_LT_EOF
49188bd17e5fSmrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
49198bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
49208bd17e5fSmrg	_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'
49218bd17e5fSmrg      else
49228bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
49238bd17e5fSmrg      fi
49248bd17e5fSmrg      ;;
49250597fb56Smrg
49268bd17e5fSmrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
49278bd17e5fSmrg      case `$LD -v 2>&1` in
49288bd17e5fSmrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
49298bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
49308bd17e5fSmrg	cat <<_LT_EOF 1>&2
49310597fb56Smrg
49328bd17e5fSmrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
49338bd17e5fSmrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
49348bd17e5fSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
49358bd17e5fSmrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
49368bd17e5fSmrg*** your PATH or compiler configuration so that the native linker is
49378bd17e5fSmrg*** used, and then restart.
49380597fb56Smrg
49398bd17e5fSmrg_LT_EOF
49408bd17e5fSmrg	;;
49418bd17e5fSmrg	*)
49428bd17e5fSmrg	  # For security reasons, it is highly recommended that you always
49438bd17e5fSmrg	  # use absolute paths for naming shared libraries, and exclude the
49448bd17e5fSmrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
49458bd17e5fSmrg	  # requires that you compile everything twice, which is a pain.
49468bd17e5fSmrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
49470597fb56Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
49488bd17e5fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
49498bd17e5fSmrg	    _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'
49508bd17e5fSmrg	  else
49518bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
49528bd17e5fSmrg	  fi
49538bd17e5fSmrg	;;
49548bd17e5fSmrg      esac
49558bd17e5fSmrg      ;;
49560597fb56Smrg
49578bd17e5fSmrg    sunos4*)
49588bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
49598bd17e5fSmrg      wlarc=
49608bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
49618bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
49628bd17e5fSmrg      ;;
49638bd17e5fSmrg
49648bd17e5fSmrg    *)
49658bd17e5fSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
49668bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
49678bd17e5fSmrg	_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'
49688bd17e5fSmrg      else
49698bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
49708bd17e5fSmrg      fi
49718bd17e5fSmrg      ;;
49728bd17e5fSmrg    esac
49738bd17e5fSmrg
49748bd17e5fSmrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
49758bd17e5fSmrg      runpath_var=
49768bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
49778bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
49788bd17e5fSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
49798bd17e5fSmrg    fi
49808bd17e5fSmrg  else
49818bd17e5fSmrg    # PORTME fill in a description of your system's linker (not GNU ld)
49828bd17e5fSmrg    case $host_os in
49838bd17e5fSmrg    aix3*)
49848bd17e5fSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
49858bd17e5fSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
49868bd17e5fSmrg      _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'
49878bd17e5fSmrg      # Note: this linker hardcodes the directories in LIBPATH if there
49888bd17e5fSmrg      # are no directories specified by -L.
49898bd17e5fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
49908bd17e5fSmrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
49918bd17e5fSmrg	# Neither direct hardcoding nor static linking is supported with a
49928bd17e5fSmrg	# broken collect2.
49938bd17e5fSmrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
49948bd17e5fSmrg      fi
49958bd17e5fSmrg      ;;
49968bd17e5fSmrg
49978bd17e5fSmrg    aix[[4-9]]*)
49988bd17e5fSmrg      if test "$host_cpu" = ia64; then
49998bd17e5fSmrg	# On IA64, the linker does run time linking by default, so we don't
50008bd17e5fSmrg	# have to do anything special.
50018bd17e5fSmrg	aix_use_runtimelinking=no
50028bd17e5fSmrg	exp_sym_flag='-Bexport'
50038bd17e5fSmrg	no_entry_flag=""
50048bd17e5fSmrg      else
50058bd17e5fSmrg	# If we're using GNU nm, then we don't want the "-C" option.
50068bd17e5fSmrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
50078bd17e5fSmrg	# Also, AIX nm treats weak defined symbols like other global
50088bd17e5fSmrg	# defined symbols, whereas GNU nm marks them as "W".
50098bd17e5fSmrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
50108bd17e5fSmrg	  _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'
50118bd17e5fSmrg	else
50128bd17e5fSmrg	  _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'
50138bd17e5fSmrg	fi
50148bd17e5fSmrg	aix_use_runtimelinking=no
50150597fb56Smrg
50168bd17e5fSmrg	# Test if we are trying to use run time linking or normal
50178bd17e5fSmrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
50188bd17e5fSmrg	# need to do runtime linking.
50198bd17e5fSmrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
50208bd17e5fSmrg	  for ld_flag in $LDFLAGS; do
50218bd17e5fSmrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
50228bd17e5fSmrg	    aix_use_runtimelinking=yes
50238bd17e5fSmrg	    break
50248bd17e5fSmrg	  fi
50258bd17e5fSmrg	  done
50268bd17e5fSmrg	  ;;
50278c4a8e55Smrg	esac
50280597fb56Smrg
50298bd17e5fSmrg	exp_sym_flag='-bexport'
50308bd17e5fSmrg	no_entry_flag='-bnoentry'
50318bd17e5fSmrg      fi
50320597fb56Smrg
50338bd17e5fSmrg      # When large executables or shared objects are built, AIX ld can
50348bd17e5fSmrg      # have problems creating the table of contents.  If linking a library
50358bd17e5fSmrg      # or program results in "error TOC overflow" add -mminimal-toc to
50368bd17e5fSmrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
50378bd17e5fSmrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
50380597fb56Smrg
50398bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)=''
50408bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
50418bd17e5fSmrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
50428bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
50438bd17e5fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
50448bd17e5fSmrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
50458bd17e5fSmrg
50468bd17e5fSmrg      if test "$GCC" = yes; then
50478bd17e5fSmrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
50488bd17e5fSmrg	# We only want to do this on AIX 4.2 and lower, the check
50498bd17e5fSmrg	# below for broken collect2 doesn't work under 4.3+
50508bd17e5fSmrg	  collect2name=`${CC} -print-prog-name=collect2`
50518bd17e5fSmrg	  if test -f "$collect2name" &&
50528bd17e5fSmrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
50538bd17e5fSmrg	  then
50548bd17e5fSmrg	  # We have reworked collect2
50558bd17e5fSmrg	  :
50568bd17e5fSmrg	  else
50578bd17e5fSmrg	  # We have old collect2
50588bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
50598bd17e5fSmrg	  # It fails to find uninstalled libraries when the uninstalled
50608bd17e5fSmrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
50618bd17e5fSmrg	  # to unsupported forces relinking
50628bd17e5fSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
50638bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
50648bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
50658bd17e5fSmrg	  fi
50668bd17e5fSmrg	  ;;
50678c4a8e55Smrg	esac
50688bd17e5fSmrg	shared_flag='-shared'
50698bd17e5fSmrg	if test "$aix_use_runtimelinking" = yes; then
50708bd17e5fSmrg	  shared_flag="$shared_flag "'${wl}-G'
50718bd17e5fSmrg	fi
5072b242714cSmrg	_LT_TAGVAR(link_all_deplibs, $1)=no
50738bd17e5fSmrg      else
50748bd17e5fSmrg	# not using gcc
50758bd17e5fSmrg	if test "$host_cpu" = ia64; then
50768bd17e5fSmrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
50778bd17e5fSmrg	# chokes on -Wl,-G. The following line is correct:
50788bd17e5fSmrg	  shared_flag='-G'
50798bd17e5fSmrg	else
50808bd17e5fSmrg	  if test "$aix_use_runtimelinking" = yes; then
50818bd17e5fSmrg	    shared_flag='${wl}-G'
50828bd17e5fSmrg	  else
50838bd17e5fSmrg	    shared_flag='${wl}-bM:SRE'
50848bd17e5fSmrg	  fi
50858bd17e5fSmrg	fi
50868bd17e5fSmrg      fi
50870597fb56Smrg
50888bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
50898bd17e5fSmrg      # It seems that -bexpall does not export symbols beginning with
50908bd17e5fSmrg      # underscore (_), so it is better to generate a list of symbols to export.
50918bd17e5fSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
50928bd17e5fSmrg      if test "$aix_use_runtimelinking" = yes; then
50938bd17e5fSmrg	# Warning - without using the other runtime loading flags (-brtl),
50948bd17e5fSmrg	# -berok will link without error, but may produce a broken library.
50958bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
50968bd17e5fSmrg        # Determine the default libpath from the value encoded in an
50978bd17e5fSmrg        # empty executable.
50988bd17e5fSmrg        _LT_SYS_MODULE_PATH_AIX([$1])
50998bd17e5fSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
51008bd17e5fSmrg        _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"
51018bd17e5fSmrg      else
51028bd17e5fSmrg	if test "$host_cpu" = ia64; then
51038bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
51048bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
51058bd17e5fSmrg	  _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"
51068bd17e5fSmrg	else
51078bd17e5fSmrg	 # Determine the default libpath from the value encoded in an
51088bd17e5fSmrg	 # empty executable.
51098bd17e5fSmrg	 _LT_SYS_MODULE_PATH_AIX([$1])
51108bd17e5fSmrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
51118bd17e5fSmrg	  # Warning - without using the other run time loading flags,
51128bd17e5fSmrg	  # -berok will link without error, but may produce a broken library.
51138bd17e5fSmrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
51148bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
51158bd17e5fSmrg	  if test "$with_gnu_ld" = yes; then
51168bd17e5fSmrg	    # We only use this code for GNU lds that support --whole-archive.
51178bd17e5fSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
51188bd17e5fSmrg	  else
51198bd17e5fSmrg	    # Exported symbols can be pulled into shared objects from archives
51208bd17e5fSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
51218bd17e5fSmrg	  fi
51228bd17e5fSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
51238bd17e5fSmrg	  # This is similar to how AIX traditionally builds its shared libraries.
51248bd17e5fSmrg	  _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'
51250597fb56Smrg	fi
51268bd17e5fSmrg      fi
51278bd17e5fSmrg      ;;
51280597fb56Smrg
51298bd17e5fSmrg    amigaos*)
51308bd17e5fSmrg      case $host_cpu in
51318bd17e5fSmrg      powerpc)
51328bd17e5fSmrg            # see comment about AmigaOS4 .so support
51338bd17e5fSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
51348bd17e5fSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
51358bd17e5fSmrg        ;;
51368bd17e5fSmrg      m68k)
51378bd17e5fSmrg            _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)'
51388bd17e5fSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
51398bd17e5fSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
51408bd17e5fSmrg        ;;
51418bd17e5fSmrg      esac
51428bd17e5fSmrg      ;;
51430597fb56Smrg
51448bd17e5fSmrg    bsdi[[45]]*)
51458bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
51468bd17e5fSmrg      ;;
51470597fb56Smrg
51488bd17e5fSmrg    cygwin* | mingw* | pw32* | cegcc*)
51498bd17e5fSmrg      # When not using gcc, we currently assume that we are using
51508bd17e5fSmrg      # Microsoft Visual C++.
51518bd17e5fSmrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
51528bd17e5fSmrg      # no search path for DLLs.
51538bd17e5fSmrg      case $cc_basename in
51548bd17e5fSmrg      cl*)
51558bd17e5fSmrg	# Native MSVC
51568bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
51578bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
51588bd17e5fSmrg	_LT_TAGVAR(always_export_symbols, $1)=yes
51598bd17e5fSmrg	_LT_TAGVAR(file_list_spec, $1)='@'
51608bd17e5fSmrg	# Tell ltmain to make .lib files, not .a files.
51618bd17e5fSmrg	libext=lib
51628bd17e5fSmrg	# Tell ltmain to make .dll files, not .so files.
51638bd17e5fSmrg	shrext_cmds=".dll"
51648bd17e5fSmrg	# FIXME: Setting linknames here is a bad hack.
51658bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
51668bd17e5fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
51678bd17e5fSmrg	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
51688bd17e5fSmrg	  else
51698bd17e5fSmrg	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
51708bd17e5fSmrg	  fi~
51718bd17e5fSmrg	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
51728bd17e5fSmrg	  linknames='
51738bd17e5fSmrg	# The linker will not automatically build a static lib if we build a DLL.
51748bd17e5fSmrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
51758bd17e5fSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
51768bd17e5fSmrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
51778bd17e5fSmrg	_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'
51788bd17e5fSmrg	# Don't use ranlib
51798bd17e5fSmrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
51808bd17e5fSmrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
51818bd17e5fSmrg	  lt_tool_outputfile="@TOOL_OUTPUT@"~
51828bd17e5fSmrg	  case $lt_outputfile in
51838bd17e5fSmrg	    *.exe|*.EXE) ;;
51848bd17e5fSmrg	    *)
51858bd17e5fSmrg	      lt_outputfile="$lt_outputfile.exe"
51868bd17e5fSmrg	      lt_tool_outputfile="$lt_tool_outputfile.exe"
51878bd17e5fSmrg	      ;;
51888bd17e5fSmrg	  esac~
51898bd17e5fSmrg	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
51908bd17e5fSmrg	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
51918bd17e5fSmrg	    $RM "$lt_outputfile.manifest";
51928bd17e5fSmrg	  fi'
51938bd17e5fSmrg	;;
51948bd17e5fSmrg      *)
51958bd17e5fSmrg	# Assume MSVC wrapper
51968bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
51978bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
51988bd17e5fSmrg	# Tell ltmain to make .lib files, not .a files.
51998bd17e5fSmrg	libext=lib
52008bd17e5fSmrg	# Tell ltmain to make .dll files, not .so files.
52018bd17e5fSmrg	shrext_cmds=".dll"
52028bd17e5fSmrg	# FIXME: Setting linknames here is a bad hack.
52038bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
52048bd17e5fSmrg	# The linker will automatically build a .lib file if we build a DLL.
52058bd17e5fSmrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
52068bd17e5fSmrg	# FIXME: Should let the user specify the lib program.
52078bd17e5fSmrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
52088bd17e5fSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5209706b6b52Smrg	;;
52108bd17e5fSmrg      esac
52118bd17e5fSmrg      ;;
5212706b6b52Smrg
52138bd17e5fSmrg    darwin* | rhapsody*)
52148bd17e5fSmrg      _LT_DARWIN_LINKER_FEATURES($1)
52158bd17e5fSmrg      ;;
5216706b6b52Smrg
52178bd17e5fSmrg    dgux*)
52188bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
52198bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
52208bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
52218bd17e5fSmrg      ;;
5222706b6b52Smrg
52238bd17e5fSmrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
52248bd17e5fSmrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
52258bd17e5fSmrg    # does not break anything, and helps significantly (at the cost of a little
52268bd17e5fSmrg    # extra space).
52278bd17e5fSmrg    freebsd2.2*)
52288bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
52298bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
52308bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
52318bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
52328bd17e5fSmrg      ;;
52330597fb56Smrg
52348bd17e5fSmrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
52358bd17e5fSmrg    freebsd2.*)
52368bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
52378bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
52388bd17e5fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
52398bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
52408bd17e5fSmrg      ;;
5241706b6b52Smrg
52428bd17e5fSmrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
52438bd17e5fSmrg    freebsd* | dragonfly*)
52448bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
52458bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
52468bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
52478bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
52488bd17e5fSmrg      ;;
5249706b6b52Smrg
52508bd17e5fSmrg    hpux9*)
52518bd17e5fSmrg      if test "$GCC" = yes; then
52528bd17e5fSmrg	_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'
52538bd17e5fSmrg      else
52548bd17e5fSmrg	_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'
52558bd17e5fSmrg      fi
52568bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
52578bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
52588bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5259706b6b52Smrg
52608bd17e5fSmrg      # hardcode_minus_L: Not really in the search PATH,
52618bd17e5fSmrg      # but as the default location of the library.
52628bd17e5fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
52638bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
52648bd17e5fSmrg      ;;
5265706b6b52Smrg
52668bd17e5fSmrg    hpux10*)
52678bd17e5fSmrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
52688bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
52698bd17e5fSmrg      else
52708bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
52718bd17e5fSmrg      fi
52728bd17e5fSmrg      if test "$with_gnu_ld" = no; then
52738bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
52748bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
52758bd17e5fSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
52768bd17e5fSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
52778bd17e5fSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
52788bd17e5fSmrg	# hardcode_minus_L: Not really in the search PATH,
52798bd17e5fSmrg	# but as the default location of the library.
52808bd17e5fSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
52818bd17e5fSmrg      fi
52828bd17e5fSmrg      ;;
5283b042e37fSmrg
52848bd17e5fSmrg    hpux11*)
52858bd17e5fSmrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
52868bd17e5fSmrg	case $host_cpu in
52878bd17e5fSmrg	hppa*64*)
52888bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
52898bd17e5fSmrg	  ;;
52908bd17e5fSmrg	ia64*)
52918bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
52928bd17e5fSmrg	  ;;
52938bd17e5fSmrg	*)
52948bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
52958bd17e5fSmrg	  ;;
52968bd17e5fSmrg	esac
52978bd17e5fSmrg      else
52988bd17e5fSmrg	case $host_cpu in
52998bd17e5fSmrg	hppa*64*)
53008bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
53018bd17e5fSmrg	  ;;
53028bd17e5fSmrg	ia64*)
53038bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
53048bd17e5fSmrg	  ;;
53058bd17e5fSmrg	*)
53068bd17e5fSmrg	m4_if($1, [], [
53078bd17e5fSmrg	  # Older versions of the 11.00 compiler do not understand -b yet
53088bd17e5fSmrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
53098bd17e5fSmrg	  _LT_LINKER_OPTION([if $CC understands -b],
53108bd17e5fSmrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
53118bd17e5fSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
53128bd17e5fSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
53138bd17e5fSmrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
53148bd17e5fSmrg	  ;;
53158bd17e5fSmrg	esac
53168bd17e5fSmrg      fi
53178bd17e5fSmrg      if test "$with_gnu_ld" = no; then
53188bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
53198bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
53208c4a8e55Smrg
53218bd17e5fSmrg	case $host_cpu in
53228bd17e5fSmrg	hppa*64*|ia64*)
53238bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
53248bd17e5fSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
53258bd17e5fSmrg	  ;;
53268bd17e5fSmrg	*)
53278bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
53288bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
53298bd17e5fSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5330b042e37fSmrg
53318bd17e5fSmrg	  # hardcode_minus_L: Not really in the search PATH,
53328bd17e5fSmrg	  # but as the default location of the library.
53338bd17e5fSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
53348bd17e5fSmrg	  ;;
53358bd17e5fSmrg	esac
53368bd17e5fSmrg      fi
53378bd17e5fSmrg      ;;
5338b042e37fSmrg
53398bd17e5fSmrg    irix5* | irix6* | nonstopux*)
53408bd17e5fSmrg      if test "$GCC" = yes; then
53418bd17e5fSmrg	_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'
53428bd17e5fSmrg	# Try to use the -exported_symbol ld option, if it does not
53438bd17e5fSmrg	# work, assume that -exports_file does not work either and
53448bd17e5fSmrg	# implicitly export all symbols.
53458bd17e5fSmrg	# This should be the same for all languages, so no per-tag cache variable.
53468bd17e5fSmrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
53478bd17e5fSmrg	  [lt_cv_irix_exported_symbol],
53488bd17e5fSmrg	  [save_LDFLAGS="$LDFLAGS"
53498bd17e5fSmrg	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
53508bd17e5fSmrg	   AC_LINK_IFELSE(
53518bd17e5fSmrg	     [AC_LANG_SOURCE(
53528bd17e5fSmrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
53538bd17e5fSmrg			      [C++], [[int foo (void) { return 0; }]],
53548bd17e5fSmrg			      [Fortran 77], [[
53558bd17e5fSmrg      subroutine foo
53568bd17e5fSmrg      end]],
53578bd17e5fSmrg			      [Fortran], [[
53588bd17e5fSmrg      subroutine foo
53598bd17e5fSmrg      end]])])],
53608bd17e5fSmrg	      [lt_cv_irix_exported_symbol=yes],
53618bd17e5fSmrg	      [lt_cv_irix_exported_symbol=no])
53628bd17e5fSmrg           LDFLAGS="$save_LDFLAGS"])
53638bd17e5fSmrg	if test "$lt_cv_irix_exported_symbol" = yes; then
53648bd17e5fSmrg          _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'
53658bd17e5fSmrg	fi
53668bd17e5fSmrg      else
53678bd17e5fSmrg	_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'
53688bd17e5fSmrg	_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'
53698bd17e5fSmrg      fi
53708bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
53718bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
53728bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
53738bd17e5fSmrg      _LT_TAGVAR(inherit_rpath, $1)=yes
53748bd17e5fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
53758bd17e5fSmrg      ;;
5376b042e37fSmrg
5377b242714cSmrg    netbsd* | netbsdelf*-gnu)
53788bd17e5fSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
53798bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
53808bd17e5fSmrg      else
53818bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
53828bd17e5fSmrg      fi
53838bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
53848bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
53858bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
53868bd17e5fSmrg      ;;
53878c4a8e55Smrg
53888bd17e5fSmrg    newsos6)
53898bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
53908bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
53918bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
53928bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
53938bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
53948bd17e5fSmrg      ;;
53958c4a8e55Smrg
53968bd17e5fSmrg    *nto* | *qnx*)
53978bd17e5fSmrg      ;;
53988c4a8e55Smrg
53998bd17e5fSmrg    openbsd*)
54008bd17e5fSmrg      if test -f /usr/libexec/ld.so; then
54018bd17e5fSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
54028bd17e5fSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
54038bd17e5fSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
54048bd17e5fSmrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
54058bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
54068bd17e5fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
54078bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
54088bd17e5fSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
54098bd17e5fSmrg	else
54108bd17e5fSmrg	  case $host_os in
54118bd17e5fSmrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
54128bd17e5fSmrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
54138bd17e5fSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
54148bd17e5fSmrg	     ;;
54158bd17e5fSmrg	   *)
54168bd17e5fSmrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
54178bd17e5fSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
54188bd17e5fSmrg	     ;;
54198bd17e5fSmrg	  esac
54208bd17e5fSmrg	fi
54218bd17e5fSmrg      else
54228bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
54238bd17e5fSmrg      fi
54248bd17e5fSmrg      ;;
5425b042e37fSmrg
54268bd17e5fSmrg    os2*)
54278bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
54288bd17e5fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
54298bd17e5fSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
54308bd17e5fSmrg      _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'
54318bd17e5fSmrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
54328bd17e5fSmrg      ;;
5433b042e37fSmrg
54348bd17e5fSmrg    osf3*)
54358bd17e5fSmrg      if test "$GCC" = yes; then
54368bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
54378bd17e5fSmrg	_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'
54388bd17e5fSmrg      else
54398bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
54408bd17e5fSmrg	_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'
54418bd17e5fSmrg      fi
54428bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
54438bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
54448bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
54458bd17e5fSmrg      ;;
54460597fb56Smrg
54478bd17e5fSmrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
54488bd17e5fSmrg      if test "$GCC" = yes; then
54498bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
54508bd17e5fSmrg	_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'
54518bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
54528bd17e5fSmrg      else
54538bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
54548bd17e5fSmrg	_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'
54558bd17e5fSmrg	_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~
54568bd17e5fSmrg	$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'
54570597fb56Smrg
54588bd17e5fSmrg	# Both c and cxx compiler support -rpath directly
54598bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
54608bd17e5fSmrg      fi
54618bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
54628bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
54638bd17e5fSmrg      ;;
54640597fb56Smrg
54658bd17e5fSmrg    solaris*)
54668bd17e5fSmrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
54678bd17e5fSmrg      if test "$GCC" = yes; then
54688bd17e5fSmrg	wlarc='${wl}'
54698bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
54708bd17e5fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
54718bd17e5fSmrg	  $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'
54728bd17e5fSmrg      else
54738bd17e5fSmrg	case `$CC -V 2>&1` in
54748bd17e5fSmrg	*"Compilers 5.0"*)
54758bd17e5fSmrg	  wlarc=''
54768bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
54778bd17e5fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
54788bd17e5fSmrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
54798c4a8e55Smrg	  ;;
54800597fb56Smrg	*)
54818bd17e5fSmrg	  wlarc='${wl}'
54828bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
54838bd17e5fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
54848bd17e5fSmrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
54858c4a8e55Smrg	  ;;
54868bd17e5fSmrg	esac
54878bd17e5fSmrg      fi
54888bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
54898bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
54908bd17e5fSmrg      case $host_os in
54918bd17e5fSmrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
54928bd17e5fSmrg      *)
54938bd17e5fSmrg	# The compiler driver will combine and reorder linker options,
54948bd17e5fSmrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
54958bd17e5fSmrg	# but is careful enough not to reorder.
54968bd17e5fSmrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
54978bd17e5fSmrg	if test "$GCC" = yes; then
54988bd17e5fSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
54998bd17e5fSmrg	else
55008bd17e5fSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
55018bd17e5fSmrg	fi
55028bd17e5fSmrg	;;
55038c4a8e55Smrg      esac
55048bd17e5fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
55058c4a8e55Smrg      ;;
5506b042e37fSmrg
55078bd17e5fSmrg    sunos4*)
55088bd17e5fSmrg      if test "x$host_vendor" = xsequent; then
55098bd17e5fSmrg	# Use $CC to link under sequent, because it throws in some extra .o
55108bd17e5fSmrg	# files that make .init and .fini sections work.
55118bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
55128bd17e5fSmrg      else
55138bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
55148bd17e5fSmrg      fi
55158bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
55168bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
55178bd17e5fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
55188bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55198bd17e5fSmrg      ;;
5520b042e37fSmrg
55218bd17e5fSmrg    sysv4)
55228bd17e5fSmrg      case $host_vendor in
55238bd17e5fSmrg	sni)
55248bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
55258bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
55268bd17e5fSmrg	;;
55278bd17e5fSmrg	siemens)
55288bd17e5fSmrg	  ## LD is ld it makes a PLAMLIB
55298bd17e5fSmrg	  ## CC just makes a GrossModule.
55308bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
55318bd17e5fSmrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
55328bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
55338bd17e5fSmrg        ;;
55348bd17e5fSmrg	motorola)
55358bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
55368bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
55378bd17e5fSmrg	;;
55388bd17e5fSmrg      esac
55398bd17e5fSmrg      runpath_var='LD_RUN_PATH'
55408bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5541706b6b52Smrg      ;;
5542b042e37fSmrg
55438bd17e5fSmrg    sysv4.3*)
55448bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
55458bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55468bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
55478bd17e5fSmrg      ;;
55488c4a8e55Smrg
55498bd17e5fSmrg    sysv4*MP*)
55508bd17e5fSmrg      if test -d /usr/nec; then
55518bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
55528bd17e5fSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55538bd17e5fSmrg	runpath_var=LD_RUN_PATH
55548bd17e5fSmrg	hardcode_runpath_var=yes
55558bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
55568bd17e5fSmrg      fi
55578bd17e5fSmrg      ;;
55588c4a8e55Smrg
55598bd17e5fSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
55608bd17e5fSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
55618bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
55628bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55638bd17e5fSmrg      runpath_var='LD_RUN_PATH'
55640597fb56Smrg
55658bd17e5fSmrg      if test "$GCC" = yes; then
55668bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55678bd17e5fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55688bd17e5fSmrg      else
55698bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55708bd17e5fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55718bd17e5fSmrg      fi
55728bd17e5fSmrg      ;;
55730597fb56Smrg
55748bd17e5fSmrg    sysv5* | sco3.2v5* | sco5v6*)
55758bd17e5fSmrg      # Note: We can NOT use -z defs as we might desire, because we do not
55768bd17e5fSmrg      # link with -lc, and that would cause any symbols used from libc to
55778bd17e5fSmrg      # always be unresolved, which means just about no library would
55788bd17e5fSmrg      # ever link correctly.  If we're not using GNU ld we use -z text
55798bd17e5fSmrg      # though, which does catch some bad symbols but isn't as heavy-handed
55808bd17e5fSmrg      # as -z defs.
55818bd17e5fSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
55828bd17e5fSmrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
55838bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
55848bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55858bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
55868bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
55878bd17e5fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
55888bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
55898bd17e5fSmrg      runpath_var='LD_RUN_PATH'
55900597fb56Smrg
55918bd17e5fSmrg      if test "$GCC" = yes; then
55928bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55938bd17e5fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55948bd17e5fSmrg      else
55958bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55968bd17e5fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55978bd17e5fSmrg      fi
55988bd17e5fSmrg      ;;
55990597fb56Smrg
56008bd17e5fSmrg    uts4*)
56018bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
56028bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
56038bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
56048bd17e5fSmrg      ;;
56050597fb56Smrg
56068bd17e5fSmrg    *)
56078bd17e5fSmrg      _LT_TAGVAR(ld_shlibs, $1)=no
56088bd17e5fSmrg      ;;
56098bd17e5fSmrg    esac
56100597fb56Smrg
56118bd17e5fSmrg    if test x$host_vendor = xsni; then
56128bd17e5fSmrg      case $host in
56138bd17e5fSmrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
56148bd17e5fSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
56158bd17e5fSmrg	;;
56168bd17e5fSmrg      esac
56178bd17e5fSmrg    fi
56188bd17e5fSmrg  fi
56198bd17e5fSmrg])
56208bd17e5fSmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
56218bd17e5fSmrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
56220597fb56Smrg
56238bd17e5fSmrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
56240597fb56Smrg
56258bd17e5fSmrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
56268bd17e5fSmrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
56278bd17e5fSmrg_LT_DECL([], [extract_expsyms_cmds], [2],
56288bd17e5fSmrg    [The commands to extract the exported symbol list from a shared archive])
56290597fb56Smrg
56308bd17e5fSmrg#
56318bd17e5fSmrg# Do we need to explicitly link libc?
56328bd17e5fSmrg#
56338bd17e5fSmrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
56348bd17e5fSmrgx|xyes)
56358bd17e5fSmrg  # Assume -lc should be added
56368bd17e5fSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
56370597fb56Smrg
56388bd17e5fSmrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
56398bd17e5fSmrg    case $_LT_TAGVAR(archive_cmds, $1) in
56408bd17e5fSmrg    *'~'*)
56418bd17e5fSmrg      # FIXME: we may have to deal with multi-command sequences.
56428bd17e5fSmrg      ;;
56438bd17e5fSmrg    '$CC '*)
56448bd17e5fSmrg      # Test whether the compiler implicitly links with -lc since on some
56458bd17e5fSmrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
56468bd17e5fSmrg      # to ld, don't add -lc before -lgcc.
56478bd17e5fSmrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
56488bd17e5fSmrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
56498bd17e5fSmrg	[$RM conftest*
56508bd17e5fSmrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
56510597fb56Smrg
56528bd17e5fSmrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
56538bd17e5fSmrg	  soname=conftest
56548bd17e5fSmrg	  lib=conftest
56558bd17e5fSmrg	  libobjs=conftest.$ac_objext
56568bd17e5fSmrg	  deplibs=
56578bd17e5fSmrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
56588bd17e5fSmrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
56598bd17e5fSmrg	  compiler_flags=-v
56608bd17e5fSmrg	  linker_flags=-v
56618bd17e5fSmrg	  verstring=
56628bd17e5fSmrg	  output_objdir=.
56638bd17e5fSmrg	  libname=conftest
56648bd17e5fSmrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
56658bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
56668bd17e5fSmrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
56678bd17e5fSmrg	  then
56688bd17e5fSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
56698bd17e5fSmrg	  else
56708bd17e5fSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
56718bd17e5fSmrg	  fi
56728bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
56738bd17e5fSmrg	else
56748bd17e5fSmrg	  cat conftest.err 1>&5
56758bd17e5fSmrg	fi
56768bd17e5fSmrg	$RM conftest*
56778bd17e5fSmrg	])
56788bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
56798bd17e5fSmrg      ;;
56808bd17e5fSmrg    esac
56818bd17e5fSmrg  fi
56828bd17e5fSmrg  ;;
56830597fb56Smrgesac
56840597fb56Smrg
56858bd17e5fSmrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
56868bd17e5fSmrg    [Whether or not to add -lc for building shared libraries])
56878bd17e5fSmrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
56888bd17e5fSmrg    [enable_shared_with_static_runtimes], [0],
56898bd17e5fSmrg    [Whether or not to disallow shared libs when runtime libs are static])
56908bd17e5fSmrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
56918bd17e5fSmrg    [Compiler flag to allow reflexive dlopens])
56928bd17e5fSmrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
56938bd17e5fSmrg    [Compiler flag to generate shared objects directly from archives])
56948bd17e5fSmrg_LT_TAGDECL([], [compiler_needs_object], [1],
56958bd17e5fSmrg    [Whether the compiler copes with passing no objects directly])
56968bd17e5fSmrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
56978bd17e5fSmrg    [Create an old-style archive from a shared archive])
56988bd17e5fSmrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
56998bd17e5fSmrg    [Create a temporary old-style archive to link instead of a shared archive])
57008bd17e5fSmrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
57018bd17e5fSmrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
57028bd17e5fSmrg_LT_TAGDECL([], [module_cmds], [2],
57038bd17e5fSmrg    [Commands used to build a loadable module if different from building
57048bd17e5fSmrg    a shared archive.])
57058bd17e5fSmrg_LT_TAGDECL([], [module_expsym_cmds], [2])
57068bd17e5fSmrg_LT_TAGDECL([], [with_gnu_ld], [1],
57078bd17e5fSmrg    [Whether we are building with GNU ld or not])
57088bd17e5fSmrg_LT_TAGDECL([], [allow_undefined_flag], [1],
57098bd17e5fSmrg    [Flag that allows shared libraries with undefined symbols to be built])
57108bd17e5fSmrg_LT_TAGDECL([], [no_undefined_flag], [1],
57118bd17e5fSmrg    [Flag that enforces no undefined symbols])
57128bd17e5fSmrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
57138bd17e5fSmrg    [Flag to hardcode $libdir into a binary during linking.
57148bd17e5fSmrg    This must work even if $libdir does not exist])
57158bd17e5fSmrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
57168bd17e5fSmrg    [Whether we need a single "-rpath" flag with a separated argument])
57178bd17e5fSmrg_LT_TAGDECL([], [hardcode_direct], [0],
57188bd17e5fSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
57198bd17e5fSmrg    DIR into the resulting binary])
57208bd17e5fSmrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
57218bd17e5fSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
57228bd17e5fSmrg    DIR into the resulting binary and the resulting library dependency is
57238bd17e5fSmrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
57248bd17e5fSmrg    library is relocated])
57258bd17e5fSmrg_LT_TAGDECL([], [hardcode_minus_L], [0],
57268bd17e5fSmrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
57278bd17e5fSmrg    into the resulting binary])
57288bd17e5fSmrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
57298bd17e5fSmrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
57308bd17e5fSmrg    into the resulting binary])
57318bd17e5fSmrg_LT_TAGDECL([], [hardcode_automatic], [0],
57328bd17e5fSmrg    [Set to "yes" if building a shared library automatically hardcodes DIR
57338bd17e5fSmrg    into the library and all subsequent libraries and executables linked
57348bd17e5fSmrg    against it])
57358bd17e5fSmrg_LT_TAGDECL([], [inherit_rpath], [0],
57368bd17e5fSmrg    [Set to yes if linker adds runtime paths of dependent libraries
57378bd17e5fSmrg    to runtime path list])
57388bd17e5fSmrg_LT_TAGDECL([], [link_all_deplibs], [0],
57398bd17e5fSmrg    [Whether libtool must link a program against all its dependency libraries])
57408bd17e5fSmrg_LT_TAGDECL([], [always_export_symbols], [0],
57418bd17e5fSmrg    [Set to "yes" if exported symbols are required])
57428bd17e5fSmrg_LT_TAGDECL([], [export_symbols_cmds], [2],
57438bd17e5fSmrg    [The commands to list exported symbols])
57448bd17e5fSmrg_LT_TAGDECL([], [exclude_expsyms], [1],
57458bd17e5fSmrg    [Symbols that should not be listed in the preloaded symbols])
57468bd17e5fSmrg_LT_TAGDECL([], [include_expsyms], [1],
57478bd17e5fSmrg    [Symbols that must always be exported])
57488bd17e5fSmrg_LT_TAGDECL([], [prelink_cmds], [2],
57498bd17e5fSmrg    [Commands necessary for linking programs (against libraries) with templates])
57508bd17e5fSmrg_LT_TAGDECL([], [postlink_cmds], [2],
57518bd17e5fSmrg    [Commands necessary for finishing linking programs])
57528bd17e5fSmrg_LT_TAGDECL([], [file_list_spec], [1],
57538bd17e5fSmrg    [Specify filename containing input files])
57548bd17e5fSmrgdnl FIXME: Not yet implemented
57558bd17e5fSmrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
57568bd17e5fSmrgdnl    [Compiler flag to generate thread safe objects])
57578bd17e5fSmrg])# _LT_LINKER_SHLIBS
5758b042e37fSmrg
5759b042e37fSmrg
57608bd17e5fSmrg# _LT_LANG_C_CONFIG([TAG])
57618bd17e5fSmrg# ------------------------
57628bd17e5fSmrg# Ensure that the configuration variables for a C compiler are suitably
57638bd17e5fSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
57648bd17e5fSmrg# the compiler configuration to `libtool'.
57658bd17e5fSmrgm4_defun([_LT_LANG_C_CONFIG],
57668bd17e5fSmrg[m4_require([_LT_DECL_EGREP])dnl
57678bd17e5fSmrglt_save_CC="$CC"
57688bd17e5fSmrgAC_LANG_PUSH(C)
5769b042e37fSmrg
57708bd17e5fSmrg# Source file extension for C test sources.
57718bd17e5fSmrgac_ext=c
5772b042e37fSmrg
57738bd17e5fSmrg# Object file extension for compiled C test sources.
57748bd17e5fSmrgobjext=o
57758bd17e5fSmrg_LT_TAGVAR(objext, $1)=$objext
5776bd23fbfaSmrg
57778bd17e5fSmrg# Code to be used in simple compile tests
57788bd17e5fSmrglt_simple_compile_test_code="int some_variable = 0;"
5779b042e37fSmrg
57808bd17e5fSmrg# Code to be used in simple link tests
57818bd17e5fSmrglt_simple_link_test_code='int main(){return(0);}'
5782b042e37fSmrg
57838bd17e5fSmrg_LT_TAG_COMPILER
57848bd17e5fSmrg# Save the default compiler, since it gets overwritten when the other
57858bd17e5fSmrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
57868bd17e5fSmrgcompiler_DEFAULT=$CC
5787b042e37fSmrg
57888bd17e5fSmrg# save warnings/boilerplate of simple test code
57898bd17e5fSmrg_LT_COMPILER_BOILERPLATE
57908bd17e5fSmrg_LT_LINKER_BOILERPLATE
5791b042e37fSmrg
57928bd17e5fSmrgif test -n "$compiler"; then
57938bd17e5fSmrg  _LT_COMPILER_NO_RTTI($1)
57948bd17e5fSmrg  _LT_COMPILER_PIC($1)
57958bd17e5fSmrg  _LT_COMPILER_C_O($1)
57968bd17e5fSmrg  _LT_COMPILER_FILE_LOCKS($1)
57978bd17e5fSmrg  _LT_LINKER_SHLIBS($1)
57988bd17e5fSmrg  _LT_SYS_DYNAMIC_LINKER($1)
57998bd17e5fSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
58008bd17e5fSmrg  LT_SYS_DLOPEN_SELF
58018bd17e5fSmrg  _LT_CMD_STRIPLIB
5802b042e37fSmrg
58038bd17e5fSmrg  # Report which library types will actually be built
58048bd17e5fSmrg  AC_MSG_CHECKING([if libtool supports shared libraries])
58058bd17e5fSmrg  AC_MSG_RESULT([$can_build_shared])
58060597fb56Smrg
58078bd17e5fSmrg  AC_MSG_CHECKING([whether to build shared libraries])
58088bd17e5fSmrg  test "$can_build_shared" = "no" && enable_shared=no
58090597fb56Smrg
58108bd17e5fSmrg  # On AIX, shared libraries and static libraries use the same namespace, and
58118bd17e5fSmrg  # are all built from PIC.
58128bd17e5fSmrg  case $host_os in
58138bd17e5fSmrg  aix3*)
58148bd17e5fSmrg    test "$enable_shared" = yes && enable_static=no
58158bd17e5fSmrg    if test -n "$RANLIB"; then
58168bd17e5fSmrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
58178bd17e5fSmrg      postinstall_cmds='$RANLIB $lib'
58188bd17e5fSmrg    fi
58198bd17e5fSmrg    ;;
58200597fb56Smrg
58218bd17e5fSmrg  aix[[4-9]]*)
58228bd17e5fSmrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
58238bd17e5fSmrg      test "$enable_shared" = yes && enable_static=no
58240597fb56Smrg    fi
5825706b6b52Smrg    ;;
5826706b6b52Smrg  esac
58278bd17e5fSmrg  AC_MSG_RESULT([$enable_shared])
5828b042e37fSmrg
58298bd17e5fSmrg  AC_MSG_CHECKING([whether to build static libraries])
58308bd17e5fSmrg  # Make sure either enable_shared or enable_static is yes.
58318bd17e5fSmrg  test "$enable_shared" = yes || enable_static=yes
58328bd17e5fSmrg  AC_MSG_RESULT([$enable_static])
58338bd17e5fSmrg
58348bd17e5fSmrg  _LT_CONFIG($1)
58350597fb56Smrgfi
58368bd17e5fSmrgAC_LANG_POP
58378bd17e5fSmrgCC="$lt_save_CC"
58388bd17e5fSmrg])# _LT_LANG_C_CONFIG
5839b042e37fSmrg
58400597fb56Smrg
58418bd17e5fSmrg# _LT_LANG_CXX_CONFIG([TAG])
58420597fb56Smrg# --------------------------
58438bd17e5fSmrg# Ensure that the configuration variables for a C++ compiler are suitably
58448bd17e5fSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
58458bd17e5fSmrg# the compiler configuration to `libtool'.
58468bd17e5fSmrgm4_defun([_LT_LANG_CXX_CONFIG],
58478bd17e5fSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
58488bd17e5fSmrgm4_require([_LT_DECL_EGREP])dnl
58498bd17e5fSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
58508bd17e5fSmrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
58518bd17e5fSmrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
58528bd17e5fSmrg    (test "X$CXX" != "Xg++"))) ; then
58538bd17e5fSmrg  AC_PROG_CXXCPP
58548bd17e5fSmrgelse
58558bd17e5fSmrg  _lt_caught_CXX_error=yes
58560597fb56Smrgfi
58570597fb56Smrg
58588bd17e5fSmrgAC_LANG_PUSH(C++)
58590597fb56Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
58600597fb56Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
58610597fb56Smrg_LT_TAGVAR(always_export_symbols, $1)=no
58620597fb56Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
58638bd17e5fSmrg_LT_TAGVAR(compiler_needs_object, $1)=no
58640597fb56Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
58650597fb56Smrg_LT_TAGVAR(hardcode_direct, $1)=no
58660597fb56Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
58670597fb56Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
58680597fb56Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
58690597fb56Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
58708bd17e5fSmrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
58710597fb56Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
58720597fb56Smrg_LT_TAGVAR(inherit_rpath, $1)=no
58730597fb56Smrg_LT_TAGVAR(module_cmds, $1)=
58740597fb56Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
58750597fb56Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
58760597fb56Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
58770597fb56Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
58780597fb56Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
58790597fb56Smrg_LT_TAGVAR(no_undefined_flag, $1)=
58800597fb56Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
58810597fb56Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
58820597fb56Smrg
58838bd17e5fSmrg# Source file extension for C++ test sources.
58848bd17e5fSmrgac_ext=cpp
58850597fb56Smrg
58868bd17e5fSmrg# Object file extension for compiled C++ test sources.
58870597fb56Smrgobjext=o
58880597fb56Smrg_LT_TAGVAR(objext, $1)=$objext
58890597fb56Smrg
58900597fb56Smrg# No sense in running all these tests if we already determined that
58918bd17e5fSmrg# the CXX compiler isn't working.  Some variables (like enable_shared)
58920597fb56Smrg# are currently assumed to apply to all compilers on this platform,
58930597fb56Smrg# and will be corrupted by setting them based on a non-working compiler.
58948bd17e5fSmrgif test "$_lt_caught_CXX_error" != yes; then
58950597fb56Smrg  # Code to be used in simple compile tests
58968bd17e5fSmrg  lt_simple_compile_test_code="int some_variable = 0;"
58970597fb56Smrg
58980597fb56Smrg  # Code to be used in simple link tests
58998bd17e5fSmrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
59000597fb56Smrg
59010597fb56Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
59020597fb56Smrg  _LT_TAG_COMPILER
59030597fb56Smrg
59040597fb56Smrg  # save warnings/boilerplate of simple test code
59050597fb56Smrg  _LT_COMPILER_BOILERPLATE
59060597fb56Smrg  _LT_LINKER_BOILERPLATE
59070597fb56Smrg
59080597fb56Smrg  # Allow CC to be a program name with arguments.
59098bd17e5fSmrg  lt_save_CC=$CC
59100597fb56Smrg  lt_save_CFLAGS=$CFLAGS
59118bd17e5fSmrg  lt_save_LD=$LD
59128bd17e5fSmrg  lt_save_GCC=$GCC
59138bd17e5fSmrg  GCC=$GXX
59148bd17e5fSmrg  lt_save_with_gnu_ld=$with_gnu_ld
59158bd17e5fSmrg  lt_save_path_LD=$lt_cv_path_LD
59168bd17e5fSmrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
59178bd17e5fSmrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
59188bd17e5fSmrg  else
59198bd17e5fSmrg    $as_unset lt_cv_prog_gnu_ld
59208bd17e5fSmrg  fi
59218bd17e5fSmrg  if test -n "${lt_cv_path_LDCXX+set}"; then
59228bd17e5fSmrg    lt_cv_path_LD=$lt_cv_path_LDCXX
59238bd17e5fSmrg  else
59248bd17e5fSmrg    $as_unset lt_cv_path_LD
59258bd17e5fSmrg  fi
59268bd17e5fSmrg  test -z "${LDCXX+set}" || LD=$LDCXX
59278bd17e5fSmrg  CC=${CXX-"c++"}
59288bd17e5fSmrg  CFLAGS=$CXXFLAGS
59290597fb56Smrg  compiler=$CC
59300597fb56Smrg  _LT_TAGVAR(compiler, $1)=$CC
59310597fb56Smrg  _LT_CC_BASENAME([$compiler])
59328c4a8e55Smrg
59338bd17e5fSmrg  if test -n "$compiler"; then
59348bd17e5fSmrg    # We don't want -fno-exception when compiling C++ code, so set the
59358bd17e5fSmrg    # no_builtin_flag separately
59368bd17e5fSmrg    if test "$GXX" = yes; then
59378bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
59388bd17e5fSmrg    else
59398bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
59408bd17e5fSmrg    fi
59418c4a8e55Smrg
59428bd17e5fSmrg    if test "$GXX" = yes; then
59438bd17e5fSmrg      # Set up default GNU C++ configuration
5944b042e37fSmrg
59458bd17e5fSmrg      LT_PATH_LD
59468c4a8e55Smrg
59478bd17e5fSmrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
59488bd17e5fSmrg      # archiving commands below assume that GNU ld is being used.
59498bd17e5fSmrg      if test "$with_gnu_ld" = yes; then
59508bd17e5fSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
59518bd17e5fSmrg        _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'
59528c4a8e55Smrg
59538bd17e5fSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
59548bd17e5fSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5955b042e37fSmrg
59568bd17e5fSmrg        # If archive_cmds runs LD, not CC, wlarc should be empty
59578bd17e5fSmrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
59588bd17e5fSmrg        #     investigate it a little bit more. (MM)
59598bd17e5fSmrg        wlarc='${wl}'
5960b042e37fSmrg
59618bd17e5fSmrg        # ancient GNU ld didn't support --whole-archive et. al.
59628bd17e5fSmrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
59638bd17e5fSmrg	  $GREP 'no-whole-archive' > /dev/null; then
59648bd17e5fSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
59658bd17e5fSmrg        else
59668bd17e5fSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
59678bd17e5fSmrg        fi
59688bd17e5fSmrg      else
59698bd17e5fSmrg        with_gnu_ld=no
59708bd17e5fSmrg        wlarc=
5971b042e37fSmrg
59728bd17e5fSmrg        # A generic and very simple default shared library creation
59738bd17e5fSmrg        # command for GNU C++ for the case where it uses the native
59748bd17e5fSmrg        # linker, instead of GNU ld.  If possible, this setting should
59758bd17e5fSmrg        # overridden to take advantage of the native linker features on
59768bd17e5fSmrg        # the platform it is being used on.
59778bd17e5fSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
59788bd17e5fSmrg      fi
5979b042e37fSmrg
59808bd17e5fSmrg      # Commands to make compiler produce verbose output that lists
59818bd17e5fSmrg      # what "hidden" libraries, object files and flags are used when
59828bd17e5fSmrg      # linking a shared library.
59838bd17e5fSmrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
5984b042e37fSmrg
59858bd17e5fSmrg    else
59868bd17e5fSmrg      GXX=no
59878bd17e5fSmrg      with_gnu_ld=no
59888bd17e5fSmrg      wlarc=
59898bd17e5fSmrg    fi
5990b042e37fSmrg
59918bd17e5fSmrg    # PORTME: fill in a description of your system's C++ link characteristics
59928bd17e5fSmrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
59938bd17e5fSmrg    _LT_TAGVAR(ld_shlibs, $1)=yes
59940597fb56Smrg    case $host_os in
59950597fb56Smrg      aix3*)
59968bd17e5fSmrg        # FIXME: insert proper C++ library support
59978bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
59980597fb56Smrg        ;;
59990597fb56Smrg      aix[[4-9]]*)
60008bd17e5fSmrg        if test "$host_cpu" = ia64; then
60018bd17e5fSmrg          # On IA64, the linker does run time linking by default, so we don't
60028bd17e5fSmrg          # have to do anything special.
60038bd17e5fSmrg          aix_use_runtimelinking=no
60048bd17e5fSmrg          exp_sym_flag='-Bexport'
60058bd17e5fSmrg          no_entry_flag=""
60068bd17e5fSmrg        else
60078bd17e5fSmrg          aix_use_runtimelinking=no
6008b042e37fSmrg
60098bd17e5fSmrg          # Test if we are trying to use run time linking or normal
60108bd17e5fSmrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
60118bd17e5fSmrg          # need to do runtime linking.
60128bd17e5fSmrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
60138bd17e5fSmrg	    for ld_flag in $LDFLAGS; do
60148bd17e5fSmrg	      case $ld_flag in
60158bd17e5fSmrg	      *-brtl*)
60168bd17e5fSmrg	        aix_use_runtimelinking=yes
60178bd17e5fSmrg	        break
60188bd17e5fSmrg	        ;;
60198bd17e5fSmrg	      esac
60208bd17e5fSmrg	    done
60218bd17e5fSmrg	    ;;
60228bd17e5fSmrg          esac
6023b042e37fSmrg
60248bd17e5fSmrg          exp_sym_flag='-bexport'
60258bd17e5fSmrg          no_entry_flag='-bnoentry'
60268bd17e5fSmrg        fi
6027b042e37fSmrg
60288bd17e5fSmrg        # When large executables or shared objects are built, AIX ld can
60298bd17e5fSmrg        # have problems creating the table of contents.  If linking a library
60308bd17e5fSmrg        # or program results in "error TOC overflow" add -mminimal-toc to
60318bd17e5fSmrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
60328bd17e5fSmrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6033b042e37fSmrg
60348bd17e5fSmrg        _LT_TAGVAR(archive_cmds, $1)=''
60358bd17e5fSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
60368bd17e5fSmrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
60378bd17e5fSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
60388bd17e5fSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
60398bd17e5fSmrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6040b042e37fSmrg
60418bd17e5fSmrg        if test "$GXX" = yes; then
60428bd17e5fSmrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
60438bd17e5fSmrg          # We only want to do this on AIX 4.2 and lower, the check
60448bd17e5fSmrg          # below for broken collect2 doesn't work under 4.3+
60458bd17e5fSmrg	  collect2name=`${CC} -print-prog-name=collect2`
60468bd17e5fSmrg	  if test -f "$collect2name" &&
60478bd17e5fSmrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
60488bd17e5fSmrg	  then
60498bd17e5fSmrg	    # We have reworked collect2
60508bd17e5fSmrg	    :
60518bd17e5fSmrg	  else
60528bd17e5fSmrg	    # We have old collect2
60538bd17e5fSmrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
60548bd17e5fSmrg	    # It fails to find uninstalled libraries when the uninstalled
60558bd17e5fSmrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
60568bd17e5fSmrg	    # to unsupported forces relinking
60578bd17e5fSmrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
60588bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
60598bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
60608bd17e5fSmrg	  fi
60618bd17e5fSmrg          esac
60628bd17e5fSmrg          shared_flag='-shared'
60638bd17e5fSmrg	  if test "$aix_use_runtimelinking" = yes; then
60648bd17e5fSmrg	    shared_flag="$shared_flag "'${wl}-G'
60658bd17e5fSmrg	  fi
60668bd17e5fSmrg        else
60678bd17e5fSmrg          # not using gcc
60688bd17e5fSmrg          if test "$host_cpu" = ia64; then
60698bd17e5fSmrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
60708bd17e5fSmrg	  # chokes on -Wl,-G. The following line is correct:
60718bd17e5fSmrg	  shared_flag='-G'
60728bd17e5fSmrg          else
60738bd17e5fSmrg	    if test "$aix_use_runtimelinking" = yes; then
60748bd17e5fSmrg	      shared_flag='${wl}-G'
60758bd17e5fSmrg	    else
60768bd17e5fSmrg	      shared_flag='${wl}-bM:SRE'
60778bd17e5fSmrg	    fi
60788bd17e5fSmrg          fi
60798bd17e5fSmrg        fi
6080706b6b52Smrg
60818bd17e5fSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
60828bd17e5fSmrg        # It seems that -bexpall does not export symbols beginning with
60838bd17e5fSmrg        # underscore (_), so it is better to generate a list of symbols to
60848bd17e5fSmrg	# export.
60858bd17e5fSmrg        _LT_TAGVAR(always_export_symbols, $1)=yes
60868bd17e5fSmrg        if test "$aix_use_runtimelinking" = yes; then
60878bd17e5fSmrg          # Warning - without using the other runtime loading flags (-brtl),
60888bd17e5fSmrg          # -berok will link without error, but may produce a broken library.
60898bd17e5fSmrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
60908bd17e5fSmrg          # Determine the default libpath from the value encoded in an empty
60918bd17e5fSmrg          # executable.
60928bd17e5fSmrg          _LT_SYS_MODULE_PATH_AIX([$1])
60938bd17e5fSmrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
60948c4a8e55Smrg
60958bd17e5fSmrg          _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"
60968bd17e5fSmrg        else
60978bd17e5fSmrg          if test "$host_cpu" = ia64; then
60988bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
60998bd17e5fSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
61008bd17e5fSmrg	    _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"
61018bd17e5fSmrg          else
61028bd17e5fSmrg	    # Determine the default libpath from the value encoded in an
61038bd17e5fSmrg	    # empty executable.
61048bd17e5fSmrg	    _LT_SYS_MODULE_PATH_AIX([$1])
61058bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
61068bd17e5fSmrg	    # Warning - without using the other run time loading flags,
61078bd17e5fSmrg	    # -berok will link without error, but may produce a broken library.
61088bd17e5fSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
61098bd17e5fSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
61108bd17e5fSmrg	    if test "$with_gnu_ld" = yes; then
61118bd17e5fSmrg	      # We only use this code for GNU lds that support --whole-archive.
61128bd17e5fSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
61138bd17e5fSmrg	    else
61148bd17e5fSmrg	      # Exported symbols can be pulled into shared objects from archives
61158bd17e5fSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
61168bd17e5fSmrg	    fi
61178bd17e5fSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
61188bd17e5fSmrg	    # This is similar to how AIX traditionally builds its shared
61198bd17e5fSmrg	    # libraries.
61208bd17e5fSmrg	    _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'
61218bd17e5fSmrg          fi
61228bd17e5fSmrg        fi
61238bd17e5fSmrg        ;;
61248c4a8e55Smrg
61258bd17e5fSmrg      beos*)
61268bd17e5fSmrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
61278bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
61288bd17e5fSmrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
61298bd17e5fSmrg	  # support --undefined.  This deserves some investigation.  FIXME
61308bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
61318bd17e5fSmrg	else
61328bd17e5fSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
61338bd17e5fSmrg	fi
61348bd17e5fSmrg	;;
61358c4a8e55Smrg
61368bd17e5fSmrg      chorus*)
61378bd17e5fSmrg        case $cc_basename in
61388bd17e5fSmrg          *)
61398bd17e5fSmrg	  # FIXME: insert proper C++ library support
61408bd17e5fSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
61418bd17e5fSmrg	  ;;
61428bd17e5fSmrg        esac
61438bd17e5fSmrg        ;;
61448c4a8e55Smrg
61458bd17e5fSmrg      cygwin* | mingw* | pw32* | cegcc*)
61468bd17e5fSmrg	case $GXX,$cc_basename in
61478bd17e5fSmrg	,cl* | no,cl*)
61488bd17e5fSmrg	  # Native MSVC
61498bd17e5fSmrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
61508bd17e5fSmrg	  # no search path for DLLs.
61518bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
61528bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
61538bd17e5fSmrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
61548bd17e5fSmrg	  _LT_TAGVAR(file_list_spec, $1)='@'
61558bd17e5fSmrg	  # Tell ltmain to make .lib files, not .a files.
61568bd17e5fSmrg	  libext=lib
61578bd17e5fSmrg	  # Tell ltmain to make .dll files, not .so files.
61588bd17e5fSmrg	  shrext_cmds=".dll"
61598bd17e5fSmrg	  # FIXME: Setting linknames here is a bad hack.
61608bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
61618bd17e5fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
61628bd17e5fSmrg	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
61638bd17e5fSmrg	    else
61648bd17e5fSmrg	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
61658bd17e5fSmrg	    fi~
61668bd17e5fSmrg	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
61678bd17e5fSmrg	    linknames='
61688bd17e5fSmrg	  # The linker will not automatically build a static lib if we build a DLL.
61698bd17e5fSmrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
61708bd17e5fSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
61718bd17e5fSmrg	  # Don't use ranlib
61728bd17e5fSmrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
61738bd17e5fSmrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
61748bd17e5fSmrg	    lt_tool_outputfile="@TOOL_OUTPUT@"~
61758bd17e5fSmrg	    case $lt_outputfile in
61768bd17e5fSmrg	      *.exe|*.EXE) ;;
61778bd17e5fSmrg	      *)
61788bd17e5fSmrg		lt_outputfile="$lt_outputfile.exe"
61798bd17e5fSmrg		lt_tool_outputfile="$lt_tool_outputfile.exe"
61808bd17e5fSmrg		;;
61818bd17e5fSmrg	    esac~
61828bd17e5fSmrg	    func_to_tool_file "$lt_outputfile"~
61838bd17e5fSmrg	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
61848bd17e5fSmrg	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
61858bd17e5fSmrg	      $RM "$lt_outputfile.manifest";
61868bd17e5fSmrg	    fi'
61878bd17e5fSmrg	  ;;
61888bd17e5fSmrg	*)
61898bd17e5fSmrg	  # g++
61908bd17e5fSmrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
61918bd17e5fSmrg	  # as there is no search path for DLLs.
61928bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
61938bd17e5fSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
61948bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
61958bd17e5fSmrg	  _LT_TAGVAR(always_export_symbols, $1)=no
61968bd17e5fSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
61978c4a8e55Smrg
61988bd17e5fSmrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
61998bd17e5fSmrg	    _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'
62008bd17e5fSmrg	    # If the export-symbols file already is a .def file (1st line
62018bd17e5fSmrg	    # is EXPORTS), use it as is; otherwise, prepend...
62028bd17e5fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
62038bd17e5fSmrg	      cp $export_symbols $output_objdir/$soname.def;
62048bd17e5fSmrg	    else
62058bd17e5fSmrg	      echo EXPORTS > $output_objdir/$soname.def;
62068bd17e5fSmrg	      cat $export_symbols >> $output_objdir/$soname.def;
62078bd17e5fSmrg	    fi~
62088bd17e5fSmrg	    $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'
62098bd17e5fSmrg	  else
62108bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
62118bd17e5fSmrg	  fi
62128bd17e5fSmrg	  ;;
62138bd17e5fSmrg	esac
62148bd17e5fSmrg	;;
62158bd17e5fSmrg      darwin* | rhapsody*)
62168bd17e5fSmrg        _LT_DARWIN_LINKER_FEATURES($1)
62178bd17e5fSmrg	;;
6218b042e37fSmrg
62198bd17e5fSmrg      dgux*)
62208bd17e5fSmrg        case $cc_basename in
62218bd17e5fSmrg          ec++*)
62228bd17e5fSmrg	    # FIXME: insert proper C++ library support
62238bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
62248bd17e5fSmrg	    ;;
62258bd17e5fSmrg          ghcx*)
62268bd17e5fSmrg	    # Green Hills C++ Compiler
62278bd17e5fSmrg	    # FIXME: insert proper C++ library support
62288bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
62298bd17e5fSmrg	    ;;
62308bd17e5fSmrg          *)
62318bd17e5fSmrg	    # FIXME: insert proper C++ library support
62328bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
62338bd17e5fSmrg	    ;;
62348bd17e5fSmrg        esac
62358bd17e5fSmrg        ;;
62368c4a8e55Smrg
62378bd17e5fSmrg      freebsd2.*)
62388bd17e5fSmrg        # C++ shared libraries reported to be fairly broken before
62398bd17e5fSmrg	# switch to ELF
62408bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
62418bd17e5fSmrg        ;;
62428c4a8e55Smrg
62438bd17e5fSmrg      freebsd-elf*)
62448bd17e5fSmrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
62458bd17e5fSmrg        ;;
6246b042e37fSmrg
62478bd17e5fSmrg      freebsd* | dragonfly*)
62488bd17e5fSmrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
62498bd17e5fSmrg        # conventions
62508bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
62518bd17e5fSmrg        ;;
6252b042e37fSmrg
62538bd17e5fSmrg      haiku*)
62548bd17e5fSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
62558bd17e5fSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
62568bd17e5fSmrg        ;;
62578c4a8e55Smrg
62588bd17e5fSmrg      hpux9*)
62598bd17e5fSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
62608bd17e5fSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
62618bd17e5fSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
62628bd17e5fSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
62638bd17e5fSmrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
62648bd17e5fSmrg				             # but as the default
62658bd17e5fSmrg				             # location of the library.
62668c4a8e55Smrg
62678bd17e5fSmrg        case $cc_basename in
62688bd17e5fSmrg          CC*)
62698bd17e5fSmrg            # FIXME: insert proper C++ library support
62708bd17e5fSmrg            _LT_TAGVAR(ld_shlibs, $1)=no
62718bd17e5fSmrg            ;;
62728bd17e5fSmrg          aCC*)
62738bd17e5fSmrg            _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'
62748bd17e5fSmrg            # Commands to make compiler produce verbose output that lists
62758bd17e5fSmrg            # what "hidden" libraries, object files and flags are used when
62768bd17e5fSmrg            # linking a shared library.
62778bd17e5fSmrg            #
62788bd17e5fSmrg            # There doesn't appear to be a way to prevent this compiler from
62798bd17e5fSmrg            # explicitly linking system object files so we need to strip them
62808bd17e5fSmrg            # from the output so that they don't get included in the library
62818bd17e5fSmrg            # dependencies.
62828bd17e5fSmrg            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"'
62838bd17e5fSmrg            ;;
62848bd17e5fSmrg          *)
62858bd17e5fSmrg            if test "$GXX" = yes; then
62868bd17e5fSmrg              _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'
62878bd17e5fSmrg            else
62888bd17e5fSmrg              # FIXME: insert proper C++ library support
62898bd17e5fSmrg              _LT_TAGVAR(ld_shlibs, $1)=no
62908bd17e5fSmrg            fi
62918bd17e5fSmrg            ;;
62928bd17e5fSmrg        esac
62938bd17e5fSmrg        ;;
62948c4a8e55Smrg
62958bd17e5fSmrg      hpux10*|hpux11*)
62968bd17e5fSmrg        if test $with_gnu_ld = no; then
62978bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
62988bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
62998c4a8e55Smrg
63008bd17e5fSmrg          case $host_cpu in
63018bd17e5fSmrg            hppa*64*|ia64*)
63028bd17e5fSmrg              ;;
63038bd17e5fSmrg            *)
63048bd17e5fSmrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
63058bd17e5fSmrg              ;;
63068bd17e5fSmrg          esac
63078bd17e5fSmrg        fi
63088bd17e5fSmrg        case $host_cpu in
63098bd17e5fSmrg          hppa*64*|ia64*)
63108bd17e5fSmrg            _LT_TAGVAR(hardcode_direct, $1)=no
63118bd17e5fSmrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
63128bd17e5fSmrg            ;;
63138bd17e5fSmrg          *)
63148bd17e5fSmrg            _LT_TAGVAR(hardcode_direct, $1)=yes
63158bd17e5fSmrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
63168bd17e5fSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
63178bd17e5fSmrg					         # but as the default
63188bd17e5fSmrg					         # location of the library.
63198bd17e5fSmrg            ;;
63208bd17e5fSmrg        esac
6321706b6b52Smrg
63228bd17e5fSmrg        case $cc_basename in
63238bd17e5fSmrg          CC*)
63248bd17e5fSmrg	    # FIXME: insert proper C++ library support
63258bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
63268bd17e5fSmrg	    ;;
63278bd17e5fSmrg          aCC*)
63288bd17e5fSmrg	    case $host_cpu in
63298bd17e5fSmrg	      hppa*64*)
63308bd17e5fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
63318bd17e5fSmrg	        ;;
63328bd17e5fSmrg	      ia64*)
63338bd17e5fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
63348bd17e5fSmrg	        ;;
63358bd17e5fSmrg	      *)
63368bd17e5fSmrg	        _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'
63378bd17e5fSmrg	        ;;
63388bd17e5fSmrg	    esac
63398bd17e5fSmrg	    # Commands to make compiler produce verbose output that lists
63408bd17e5fSmrg	    # what "hidden" libraries, object files and flags are used when
63418bd17e5fSmrg	    # linking a shared library.
63428bd17e5fSmrg	    #
63438bd17e5fSmrg	    # There doesn't appear to be a way to prevent this compiler from
63448bd17e5fSmrg	    # explicitly linking system object files so we need to strip them
63458bd17e5fSmrg	    # from the output so that they don't get included in the library
63468bd17e5fSmrg	    # dependencies.
63478bd17e5fSmrg	    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"'
63488bd17e5fSmrg	    ;;
63498bd17e5fSmrg          *)
63508bd17e5fSmrg	    if test "$GXX" = yes; then
63518bd17e5fSmrg	      if test $with_gnu_ld = no; then
63528bd17e5fSmrg	        case $host_cpu in
63538bd17e5fSmrg	          hppa*64*)
63548bd17e5fSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
63558bd17e5fSmrg	            ;;
63568bd17e5fSmrg	          ia64*)
63578bd17e5fSmrg	            _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'
63588bd17e5fSmrg	            ;;
63598bd17e5fSmrg	          *)
63608bd17e5fSmrg	            _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'
63618bd17e5fSmrg	            ;;
63628bd17e5fSmrg	        esac
63638bd17e5fSmrg	      fi
63648bd17e5fSmrg	    else
63658bd17e5fSmrg	      # FIXME: insert proper C++ library support
63668bd17e5fSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
63678bd17e5fSmrg	    fi
63688bd17e5fSmrg	    ;;
63698bd17e5fSmrg        esac
63708bd17e5fSmrg        ;;
6371b042e37fSmrg
63728bd17e5fSmrg      interix[[3-9]]*)
63738bd17e5fSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
63748bd17e5fSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
63758bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
63768bd17e5fSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
63778bd17e5fSmrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
63788bd17e5fSmrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
63798bd17e5fSmrg	# default) and relocated if they conflict, which is a slow very memory
63808bd17e5fSmrg	# consuming and fragmenting process.  To avoid this, we pick a random,
63818bd17e5fSmrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
63828bd17e5fSmrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
63838bd17e5fSmrg	_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'
63848bd17e5fSmrg	_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'
63858bd17e5fSmrg	;;
63868bd17e5fSmrg      irix5* | irix6*)
63878bd17e5fSmrg        case $cc_basename in
63888bd17e5fSmrg          CC*)
63898bd17e5fSmrg	    # SGI C++
63908bd17e5fSmrg	    _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'
63918c4a8e55Smrg
63928bd17e5fSmrg	    # Archives containing C++ object files must be created using
63938bd17e5fSmrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
63948bd17e5fSmrg	    # necessary to make sure instantiated templates are included
63958bd17e5fSmrg	    # in the archive.
63968bd17e5fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
63978bd17e5fSmrg	    ;;
63988bd17e5fSmrg          *)
63998bd17e5fSmrg	    if test "$GXX" = yes; then
64008bd17e5fSmrg	      if test "$with_gnu_ld" = no; then
64018bd17e5fSmrg	        _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'
64028bd17e5fSmrg	      else
64038bd17e5fSmrg	        _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'
64048bd17e5fSmrg	      fi
64058bd17e5fSmrg	    fi
64068bd17e5fSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
64078bd17e5fSmrg	    ;;
64088bd17e5fSmrg        esac
64098bd17e5fSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
64108bd17e5fSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
64118bd17e5fSmrg        _LT_TAGVAR(inherit_rpath, $1)=yes
64128bd17e5fSmrg        ;;
64138c4a8e55Smrg
6414b242714cSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
64158bd17e5fSmrg        case $cc_basename in
64168bd17e5fSmrg          KCC*)
64178bd17e5fSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
64188c4a8e55Smrg
64198bd17e5fSmrg	    # KCC will only create a shared library if the output file
64208bd17e5fSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
64218bd17e5fSmrg	    # to its proper name (with version) after linking.
64228bd17e5fSmrg	    _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'
64238bd17e5fSmrg	    _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'
64248bd17e5fSmrg	    # Commands to make compiler produce verbose output that lists
64258bd17e5fSmrg	    # what "hidden" libraries, object files and flags are used when
64268bd17e5fSmrg	    # linking a shared library.
64278bd17e5fSmrg	    #
64288bd17e5fSmrg	    # There doesn't appear to be a way to prevent this compiler from
64298bd17e5fSmrg	    # explicitly linking system object files so we need to strip them
64308bd17e5fSmrg	    # from the output so that they don't get included in the library
64318bd17e5fSmrg	    # dependencies.
64328bd17e5fSmrg	    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"'
64338c4a8e55Smrg
64348bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
64358bd17e5fSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
64368c4a8e55Smrg
64378bd17e5fSmrg	    # Archives containing C++ object files must be created using
64388bd17e5fSmrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
64398bd17e5fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
64408bd17e5fSmrg	    ;;
64418bd17e5fSmrg	  icpc* | ecpc* )
64428bd17e5fSmrg	    # Intel C++
64438bd17e5fSmrg	    with_gnu_ld=yes
64448bd17e5fSmrg	    # version 8.0 and above of icpc choke on multiply defined symbols
64458bd17e5fSmrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
64468bd17e5fSmrg	    # earlier do not add the objects themselves.
64478bd17e5fSmrg	    case `$CC -V 2>&1` in
64488bd17e5fSmrg	      *"Version 7."*)
64498bd17e5fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
64508bd17e5fSmrg		_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'
64518bd17e5fSmrg		;;
64528bd17e5fSmrg	      *)  # Version 8.0 or newer
64538bd17e5fSmrg	        tmp_idyn=
64548bd17e5fSmrg	        case $host_cpu in
64558bd17e5fSmrg		  ia64*) tmp_idyn=' -i_dynamic';;
64568bd17e5fSmrg		esac
64578bd17e5fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
64588bd17e5fSmrg		_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'
64598bd17e5fSmrg		;;
64608bd17e5fSmrg	    esac
64618bd17e5fSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
64628bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
64638bd17e5fSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
64648bd17e5fSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
64658bd17e5fSmrg	    ;;
64668bd17e5fSmrg          pgCC* | pgcpp*)
64678bd17e5fSmrg            # Portland Group C++ compiler
64688bd17e5fSmrg	    case `$CC -V` in
64698bd17e5fSmrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
64708bd17e5fSmrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
64718bd17e5fSmrg		rm -rf $tpldir~
64728bd17e5fSmrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
64738bd17e5fSmrg		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
64748bd17e5fSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
64758bd17e5fSmrg		rm -rf $tpldir~
64768bd17e5fSmrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
64778bd17e5fSmrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
64788bd17e5fSmrg		$RANLIB $oldlib'
64798bd17e5fSmrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
64808bd17e5fSmrg		rm -rf $tpldir~
64818bd17e5fSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
64828bd17e5fSmrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
64838bd17e5fSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
64848bd17e5fSmrg		rm -rf $tpldir~
64858bd17e5fSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
64868bd17e5fSmrg		$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'
64878bd17e5fSmrg	      ;;
64888bd17e5fSmrg	    *) # Version 6 and above use weak symbols
64898bd17e5fSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
64908bd17e5fSmrg	      _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'
64918bd17e5fSmrg	      ;;
64928bd17e5fSmrg	    esac
64938c4a8e55Smrg
64948bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
64958bd17e5fSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
64968bd17e5fSmrg	    _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'
64978bd17e5fSmrg            ;;
64988bd17e5fSmrg	  cxx*)
64998bd17e5fSmrg	    # Compaq C++
65008bd17e5fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
65018bd17e5fSmrg	    _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'
65028c4a8e55Smrg
65038bd17e5fSmrg	    runpath_var=LD_RUN_PATH
65048bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
65058bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6506706b6b52Smrg
65078bd17e5fSmrg	    # Commands to make compiler produce verbose output that lists
65088bd17e5fSmrg	    # what "hidden" libraries, object files and flags are used when
65098bd17e5fSmrg	    # linking a shared library.
65108bd17e5fSmrg	    #
65118bd17e5fSmrg	    # There doesn't appear to be a way to prevent this compiler from
65128bd17e5fSmrg	    # explicitly linking system object files so we need to strip them
65138bd17e5fSmrg	    # from the output so that they don't get included in the library
65148bd17e5fSmrg	    # dependencies.
65158bd17e5fSmrg	    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'
65168bd17e5fSmrg	    ;;
65178bd17e5fSmrg	  xl* | mpixl* | bgxl*)
65188bd17e5fSmrg	    # IBM XL 8.0 on PPC, with GNU ld
65198bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
65208bd17e5fSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
65218bd17e5fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
65228bd17e5fSmrg	    if test "x$supports_anon_versioning" = xyes; then
65238bd17e5fSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
65248bd17e5fSmrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
65258bd17e5fSmrg		echo "local: *; };" >> $output_objdir/$libname.ver~
65268bd17e5fSmrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
65278bd17e5fSmrg	    fi
65288bd17e5fSmrg	    ;;
65298bd17e5fSmrg	  *)
65308bd17e5fSmrg	    case `$CC -V 2>&1 | sed 5q` in
65318bd17e5fSmrg	    *Sun\ C*)
65328bd17e5fSmrg	      # Sun C++ 5.9
65338bd17e5fSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
65348bd17e5fSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
65358bd17e5fSmrg	      _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'
65368bd17e5fSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
65378bd17e5fSmrg	      _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'
65388bd17e5fSmrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
6539706b6b52Smrg
65408bd17e5fSmrg	      # Not sure whether something based on
65418bd17e5fSmrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
65428bd17e5fSmrg	      # would be better.
65438bd17e5fSmrg	      output_verbose_link_cmd='func_echo_all'
65448c4a8e55Smrg
65458bd17e5fSmrg	      # Archives containing C++ object files must be created using
65468bd17e5fSmrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
65478bd17e5fSmrg	      # necessary to make sure instantiated templates are included
65488bd17e5fSmrg	      # in the archive.
65498bd17e5fSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
65508bd17e5fSmrg	      ;;
65518bd17e5fSmrg	    esac
65528bd17e5fSmrg	    ;;
65538bd17e5fSmrg	esac
65548bd17e5fSmrg	;;
65558c4a8e55Smrg
65568bd17e5fSmrg      lynxos*)
65578bd17e5fSmrg        # FIXME: insert proper C++ library support
65588bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
65598bd17e5fSmrg	;;
65608c4a8e55Smrg
65618bd17e5fSmrg      m88k*)
65628bd17e5fSmrg        # FIXME: insert proper C++ library support
65638bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
65648bd17e5fSmrg	;;
65658c4a8e55Smrg
65668bd17e5fSmrg      mvs*)
65678bd17e5fSmrg        case $cc_basename in
65688bd17e5fSmrg          cxx*)
65698bd17e5fSmrg	    # FIXME: insert proper C++ library support
65708bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
65718bd17e5fSmrg	    ;;
65728bd17e5fSmrg	  *)
65738bd17e5fSmrg	    # FIXME: insert proper C++ library support
65748bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
65758bd17e5fSmrg	    ;;
65768bd17e5fSmrg	esac
65778bd17e5fSmrg	;;
65788c4a8e55Smrg
65798bd17e5fSmrg      netbsd*)
65808bd17e5fSmrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
65818bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
65828bd17e5fSmrg	  wlarc=
65838bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
65848bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
65858bd17e5fSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65868bd17e5fSmrg	fi
65878bd17e5fSmrg	# Workaround some broken pre-1.5 toolchains
65888bd17e5fSmrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
65898bd17e5fSmrg	;;
6590b042e37fSmrg
65918bd17e5fSmrg      *nto* | *qnx*)
65928bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
65938bd17e5fSmrg	;;
6594b042e37fSmrg
65958bd17e5fSmrg      openbsd2*)
65968bd17e5fSmrg        # C++ shared libraries are fairly broken
65978bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
65988bd17e5fSmrg	;;
6599b042e37fSmrg
66008bd17e5fSmrg      openbsd*)
66018bd17e5fSmrg	if test -f /usr/libexec/ld.so; then
66028bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
66038bd17e5fSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
66048bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
66058bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
66068bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
66078bd17e5fSmrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
66088bd17e5fSmrg	    _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'
66098bd17e5fSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
66108bd17e5fSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
66118bd17e5fSmrg	  fi
66128bd17e5fSmrg	  output_verbose_link_cmd=func_echo_all
66138bd17e5fSmrg	else
66148bd17e5fSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
66158bd17e5fSmrg	fi
66168bd17e5fSmrg	;;
6617b042e37fSmrg
66188bd17e5fSmrg      osf3* | osf4* | osf5*)
66198bd17e5fSmrg        case $cc_basename in
66208bd17e5fSmrg          KCC*)
66218bd17e5fSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
66220597fb56Smrg
66238bd17e5fSmrg	    # KCC will only create a shared library if the output file
66248bd17e5fSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
66258bd17e5fSmrg	    # to its proper name (with version) after linking.
66268bd17e5fSmrg	    _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'
66270597fb56Smrg
66288bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
66298bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
66300597fb56Smrg
66318bd17e5fSmrg	    # Archives containing C++ object files must be created using
66328bd17e5fSmrg	    # the KAI C++ compiler.
66338bd17e5fSmrg	    case $host in
66348bd17e5fSmrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
66358bd17e5fSmrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
66368bd17e5fSmrg	    esac
66378bd17e5fSmrg	    ;;
66388bd17e5fSmrg          RCC*)
66398bd17e5fSmrg	    # Rational C++ 2.4.1
66408bd17e5fSmrg	    # FIXME: insert proper C++ library support
66418bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
66428bd17e5fSmrg	    ;;
66438bd17e5fSmrg          cxx*)
66448bd17e5fSmrg	    case $host in
66458bd17e5fSmrg	      osf3*)
66468bd17e5fSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
66478bd17e5fSmrg	        _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'
66488bd17e5fSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
66498bd17e5fSmrg		;;
66508bd17e5fSmrg	      *)
66518bd17e5fSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
66528bd17e5fSmrg	        _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'
66538bd17e5fSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
66548bd17e5fSmrg	          echo "-hidden">> $lib.exp~
66558bd17e5fSmrg	          $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~
66568bd17e5fSmrg	          $RM $lib.exp'
66578bd17e5fSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
66588bd17e5fSmrg		;;
66598bd17e5fSmrg	    esac
66600597fb56Smrg
66618bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
66620597fb56Smrg
66638bd17e5fSmrg	    # Commands to make compiler produce verbose output that lists
66648bd17e5fSmrg	    # what "hidden" libraries, object files and flags are used when
66658bd17e5fSmrg	    # linking a shared library.
66668bd17e5fSmrg	    #
66678bd17e5fSmrg	    # There doesn't appear to be a way to prevent this compiler from
66688bd17e5fSmrg	    # explicitly linking system object files so we need to strip them
66698bd17e5fSmrg	    # from the output so that they don't get included in the library
66708bd17e5fSmrg	    # dependencies.
66718bd17e5fSmrg	    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"'
66728bd17e5fSmrg	    ;;
66738bd17e5fSmrg	  *)
66748bd17e5fSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
66758bd17e5fSmrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
66768bd17e5fSmrg	      case $host in
66778bd17e5fSmrg	        osf3*)
66788bd17e5fSmrg	          _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'
66798bd17e5fSmrg		  ;;
66808bd17e5fSmrg	        *)
66818bd17e5fSmrg	          _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'
66828bd17e5fSmrg		  ;;
66838bd17e5fSmrg	      esac
66840597fb56Smrg
66858bd17e5fSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
66868bd17e5fSmrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
66870597fb56Smrg
66888bd17e5fSmrg	      # Commands to make compiler produce verbose output that lists
66898bd17e5fSmrg	      # what "hidden" libraries, object files and flags are used when
66908bd17e5fSmrg	      # linking a shared library.
66918bd17e5fSmrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6692b042e37fSmrg
66938bd17e5fSmrg	    else
66948bd17e5fSmrg	      # FIXME: insert proper C++ library support
66958bd17e5fSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
66968bd17e5fSmrg	    fi
66978bd17e5fSmrg	    ;;
66988bd17e5fSmrg        esac
66998bd17e5fSmrg        ;;
6700b042e37fSmrg
67018bd17e5fSmrg      psos*)
67028bd17e5fSmrg        # FIXME: insert proper C++ library support
67038bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
67048bd17e5fSmrg        ;;
6705b042e37fSmrg
67068bd17e5fSmrg      sunos4*)
67078bd17e5fSmrg        case $cc_basename in
67088bd17e5fSmrg          CC*)
67098bd17e5fSmrg	    # Sun C++ 4.x
67108bd17e5fSmrg	    # FIXME: insert proper C++ library support
67118bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67128bd17e5fSmrg	    ;;
67138bd17e5fSmrg          lcc*)
67148bd17e5fSmrg	    # Lucid
67158bd17e5fSmrg	    # FIXME: insert proper C++ library support
67168bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67178bd17e5fSmrg	    ;;
67188bd17e5fSmrg          *)
67198bd17e5fSmrg	    # FIXME: insert proper C++ library support
67208bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67218bd17e5fSmrg	    ;;
67228bd17e5fSmrg        esac
67238bd17e5fSmrg        ;;
6724b042e37fSmrg
67258bd17e5fSmrg      solaris*)
67268bd17e5fSmrg        case $cc_basename in
67278bd17e5fSmrg          CC* | sunCC*)
67288bd17e5fSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
67298bd17e5fSmrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
67308bd17e5fSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
67318bd17e5fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
67328bd17e5fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
67338bd17e5fSmrg	      $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'
6734b042e37fSmrg
67358bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
67368bd17e5fSmrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
67378bd17e5fSmrg	    case $host_os in
67388bd17e5fSmrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
67398bd17e5fSmrg	      *)
67408bd17e5fSmrg		# The compiler driver will combine and reorder linker options,
67418bd17e5fSmrg		# but understands `-z linker_flag'.
67428bd17e5fSmrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
67438bd17e5fSmrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
67448bd17e5fSmrg	        ;;
67458bd17e5fSmrg	    esac
67468bd17e5fSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6747b042e37fSmrg
67488bd17e5fSmrg	    output_verbose_link_cmd='func_echo_all'
6749b042e37fSmrg
67508bd17e5fSmrg	    # Archives containing C++ object files must be created using
67518bd17e5fSmrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
67528bd17e5fSmrg	    # necessary to make sure instantiated templates are included
67538bd17e5fSmrg	    # in the archive.
67548bd17e5fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
67558bd17e5fSmrg	    ;;
67568bd17e5fSmrg          gcx*)
67578bd17e5fSmrg	    # Green Hills C++ Compiler
67588bd17e5fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6759b042e37fSmrg
67608bd17e5fSmrg	    # The C++ compiler must be used to create the archive.
67618bd17e5fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
67628bd17e5fSmrg	    ;;
67638bd17e5fSmrg          *)
67648bd17e5fSmrg	    # GNU C++ compiler with Solaris linker
67658bd17e5fSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
67668bd17e5fSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
67678bd17e5fSmrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
67688bd17e5fSmrg	        _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'
67698bd17e5fSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
67708bd17e5fSmrg		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6771b042e37fSmrg
67728bd17e5fSmrg	        # Commands to make compiler produce verbose output that lists
67738bd17e5fSmrg	        # what "hidden" libraries, object files and flags are used when
67748bd17e5fSmrg	        # linking a shared library.
67758bd17e5fSmrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
67768bd17e5fSmrg	      else
67778bd17e5fSmrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
67788bd17e5fSmrg	        # platform.
67798bd17e5fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
67808bd17e5fSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
67818bd17e5fSmrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6782b042e37fSmrg
67838bd17e5fSmrg	        # Commands to make compiler produce verbose output that lists
67848bd17e5fSmrg	        # what "hidden" libraries, object files and flags are used when
67858bd17e5fSmrg	        # linking a shared library.
67868bd17e5fSmrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
67878bd17e5fSmrg	      fi
6788b042e37fSmrg
67898bd17e5fSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
67908bd17e5fSmrg	      case $host_os in
67918bd17e5fSmrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
67928bd17e5fSmrg		*)
67938bd17e5fSmrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
67948bd17e5fSmrg		  ;;
67958bd17e5fSmrg	      esac
67968bd17e5fSmrg	    fi
67978bd17e5fSmrg	    ;;
67988bd17e5fSmrg        esac
67998bd17e5fSmrg        ;;
6800706b6b52Smrg
68018bd17e5fSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
68028bd17e5fSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
68038bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
68048bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
68058bd17e5fSmrg      runpath_var='LD_RUN_PATH'
68060597fb56Smrg
68078bd17e5fSmrg      case $cc_basename in
68088bd17e5fSmrg        CC*)
68098bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68108bd17e5fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68118bd17e5fSmrg	  ;;
68128bd17e5fSmrg	*)
68138bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68148bd17e5fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68158bd17e5fSmrg	  ;;
68168bd17e5fSmrg      esac
68178bd17e5fSmrg      ;;
68180597fb56Smrg
68198bd17e5fSmrg      sysv5* | sco3.2v5* | sco5v6*)
68208bd17e5fSmrg	# Note: We can NOT use -z defs as we might desire, because we do not
68218bd17e5fSmrg	# link with -lc, and that would cause any symbols used from libc to
68228bd17e5fSmrg	# always be unresolved, which means just about no library would
68238bd17e5fSmrg	# ever link correctly.  If we're not using GNU ld we use -z text
68248bd17e5fSmrg	# though, which does catch some bad symbols but isn't as heavy-handed
68258bd17e5fSmrg	# as -z defs.
68268bd17e5fSmrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
68278bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
68288bd17e5fSmrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
68298bd17e5fSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
68308bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
68318bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
68328bd17e5fSmrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
68338bd17e5fSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
68348bd17e5fSmrg	runpath_var='LD_RUN_PATH'
68358bd17e5fSmrg
68368bd17e5fSmrg	case $cc_basename in
68378bd17e5fSmrg          CC*)
68388bd17e5fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68398bd17e5fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68408bd17e5fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
68418bd17e5fSmrg	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
68428bd17e5fSmrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
68438bd17e5fSmrg	      '"$_LT_TAGVAR(reload_cmds, $1)"
68448bd17e5fSmrg	    ;;
68458bd17e5fSmrg	  *)
68468bd17e5fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68478bd17e5fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68488bd17e5fSmrg	    ;;
68498bd17e5fSmrg	esac
68508bd17e5fSmrg      ;;
68510597fb56Smrg
68528bd17e5fSmrg      tandem*)
68538bd17e5fSmrg        case $cc_basename in
68548bd17e5fSmrg          NCC*)
68558bd17e5fSmrg	    # NonStop-UX NCC 3.20
68568bd17e5fSmrg	    # FIXME: insert proper C++ library support
68578bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
68588bd17e5fSmrg	    ;;
68598bd17e5fSmrg          *)
68608bd17e5fSmrg	    # FIXME: insert proper C++ library support
68618bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
68628bd17e5fSmrg	    ;;
68638bd17e5fSmrg        esac
68648bd17e5fSmrg        ;;
68650597fb56Smrg
68668bd17e5fSmrg      vxworks*)
68678bd17e5fSmrg        # FIXME: insert proper C++ library support
68688bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
68698bd17e5fSmrg        ;;
68700597fb56Smrg
68718bd17e5fSmrg      *)
68728bd17e5fSmrg        # FIXME: insert proper C++ library support
68738bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
68748bd17e5fSmrg        ;;
68758bd17e5fSmrg    esac
68760597fb56Smrg
68778bd17e5fSmrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
68788bd17e5fSmrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
68790597fb56Smrg
68808bd17e5fSmrg    _LT_TAGVAR(GCC, $1)="$GXX"
68818bd17e5fSmrg    _LT_TAGVAR(LD, $1)="$LD"
6882b042e37fSmrg
68838bd17e5fSmrg    ## CAVEAT EMPTOR:
68848bd17e5fSmrg    ## There is no encapsulation within the following macros, do not change
68858bd17e5fSmrg    ## the running order or otherwise move them around unless you know exactly
68868bd17e5fSmrg    ## what you are doing...
68878bd17e5fSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
68888bd17e5fSmrg    _LT_COMPILER_PIC($1)
68898bd17e5fSmrg    _LT_COMPILER_C_O($1)
68908bd17e5fSmrg    _LT_COMPILER_FILE_LOCKS($1)
68918bd17e5fSmrg    _LT_LINKER_SHLIBS($1)
68928bd17e5fSmrg    _LT_SYS_DYNAMIC_LINKER($1)
68938bd17e5fSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
6894b042e37fSmrg
68958bd17e5fSmrg    _LT_CONFIG($1)
68968bd17e5fSmrg  fi # test -n "$compiler"
6897b042e37fSmrg
68988bd17e5fSmrg  CC=$lt_save_CC
68998bd17e5fSmrg  CFLAGS=$lt_save_CFLAGS
69008bd17e5fSmrg  LDCXX=$LD
69018bd17e5fSmrg  LD=$lt_save_LD
69028bd17e5fSmrg  GCC=$lt_save_GCC
69038bd17e5fSmrg  with_gnu_ld=$lt_save_with_gnu_ld
69048bd17e5fSmrg  lt_cv_path_LDCXX=$lt_cv_path_LD
69058bd17e5fSmrg  lt_cv_path_LD=$lt_save_path_LD
69068bd17e5fSmrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
69078bd17e5fSmrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
69088bd17e5fSmrgfi # test "$_lt_caught_CXX_error" != yes
6909b042e37fSmrg
69108bd17e5fSmrgAC_LANG_POP
69118bd17e5fSmrg])# _LT_LANG_CXX_CONFIG
6912b042e37fSmrg
6913b042e37fSmrg
69148bd17e5fSmrg# _LT_FUNC_STRIPNAME_CNF
69158bd17e5fSmrg# ----------------------
69168bd17e5fSmrg# func_stripname_cnf prefix suffix name
69178bd17e5fSmrg# strip PREFIX and SUFFIX off of NAME.
69188bd17e5fSmrg# PREFIX and SUFFIX must not contain globbing or regex special
69198bd17e5fSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
69208bd17e5fSmrg# dot (in which case that matches only a dot).
69218bd17e5fSmrg#
69228bd17e5fSmrg# This function is identical to the (non-XSI) version of func_stripname,
69238bd17e5fSmrg# except this one can be used by m4 code that may be executed by configure,
69248bd17e5fSmrg# rather than the libtool script.
69258bd17e5fSmrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
69268bd17e5fSmrgAC_REQUIRE([_LT_DECL_SED])
69278bd17e5fSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
69288bd17e5fSmrgfunc_stripname_cnf ()
69298bd17e5fSmrg{
69308bd17e5fSmrg  case ${2} in
69318bd17e5fSmrg  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
69328bd17e5fSmrg  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
69338bd17e5fSmrg  esac
69348bd17e5fSmrg} # func_stripname_cnf
69358bd17e5fSmrg])# _LT_FUNC_STRIPNAME_CNF
6936b042e37fSmrg
69378bd17e5fSmrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
69388bd17e5fSmrg# ---------------------------------
69398bd17e5fSmrg# Figure out "hidden" library dependencies from verbose
69408bd17e5fSmrg# compiler output when linking a shared library.
69418bd17e5fSmrg# Parse the compiler output and extract the necessary
69428bd17e5fSmrg# objects, libraries and library flags.
69438bd17e5fSmrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
69448bd17e5fSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
69458bd17e5fSmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
69468bd17e5fSmrg# Dependencies to place before and after the object being linked:
69478bd17e5fSmrg_LT_TAGVAR(predep_objects, $1)=
69488bd17e5fSmrg_LT_TAGVAR(postdep_objects, $1)=
69498bd17e5fSmrg_LT_TAGVAR(predeps, $1)=
69508bd17e5fSmrg_LT_TAGVAR(postdeps, $1)=
69518bd17e5fSmrg_LT_TAGVAR(compiler_lib_search_path, $1)=
6952b042e37fSmrg
69538bd17e5fSmrgdnl we can't use the lt_simple_compile_test_code here,
69548bd17e5fSmrgdnl because it contains code intended for an executable,
69558bd17e5fSmrgdnl not a library.  It's possible we should let each
69568bd17e5fSmrgdnl tag define a new lt_????_link_test_code variable,
69578bd17e5fSmrgdnl but it's only used here...
69588bd17e5fSmrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
69598bd17e5fSmrgint a;
69608bd17e5fSmrgvoid foo (void) { a = 0; }
69618bd17e5fSmrg_LT_EOF
69628bd17e5fSmrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
69638bd17e5fSmrgclass Foo
69648bd17e5fSmrg{
69658bd17e5fSmrgpublic:
69668bd17e5fSmrg  Foo (void) { a = 0; }
69678bd17e5fSmrgprivate:
69688bd17e5fSmrg  int a;
69698bd17e5fSmrg};
69708bd17e5fSmrg_LT_EOF
69718bd17e5fSmrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
69728bd17e5fSmrg      subroutine foo
69738bd17e5fSmrg      implicit none
69748bd17e5fSmrg      integer*4 a
69758bd17e5fSmrg      a=0
69768bd17e5fSmrg      return
69778bd17e5fSmrg      end
69788bd17e5fSmrg_LT_EOF
69798bd17e5fSmrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
69808bd17e5fSmrg      subroutine foo
69818bd17e5fSmrg      implicit none
69828bd17e5fSmrg      integer a
69838bd17e5fSmrg      a=0
69848bd17e5fSmrg      return
69858bd17e5fSmrg      end
69868bd17e5fSmrg_LT_EOF
69878bd17e5fSmrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
69888bd17e5fSmrgpublic class foo {
69898bd17e5fSmrg  private int a;
69908bd17e5fSmrg  public void bar (void) {
69918bd17e5fSmrg    a = 0;
69928bd17e5fSmrg  }
69938bd17e5fSmrg};
69948bd17e5fSmrg_LT_EOF
69958bd17e5fSmrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
69968bd17e5fSmrgpackage foo
69978bd17e5fSmrgfunc foo() {
69988bd17e5fSmrg}
69998bd17e5fSmrg_LT_EOF
70008bd17e5fSmrg])
7001b042e37fSmrg
70028bd17e5fSmrg_lt_libdeps_save_CFLAGS=$CFLAGS
70038bd17e5fSmrgcase "$CC $CFLAGS " in #(
70048bd17e5fSmrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
70058bd17e5fSmrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
70068bd17e5fSmrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
70078bd17e5fSmrgesac
7008b042e37fSmrg
70098bd17e5fSmrgdnl Parse the compiler output and extract the necessary
70108bd17e5fSmrgdnl objects, libraries and library flags.
70118bd17e5fSmrgif AC_TRY_EVAL(ac_compile); then
70128bd17e5fSmrg  # Parse the compiler output and extract the necessary
70138bd17e5fSmrg  # objects, libraries and library flags.
7014b042e37fSmrg
70158bd17e5fSmrg  # Sentinel used to keep track of whether or not we are before
70168bd17e5fSmrg  # the conftest object file.
70178bd17e5fSmrg  pre_test_object_deps_done=no
7018b042e37fSmrg
70198bd17e5fSmrg  for p in `eval "$output_verbose_link_cmd"`; do
70208bd17e5fSmrg    case ${prev}${p} in
7021b042e37fSmrg
70228bd17e5fSmrg    -L* | -R* | -l*)
70238bd17e5fSmrg       # Some compilers place space between "-{L,R}" and the path.
70248bd17e5fSmrg       # Remove the space.
70258bd17e5fSmrg       if test $p = "-L" ||
70268bd17e5fSmrg          test $p = "-R"; then
70278bd17e5fSmrg	 prev=$p
70288bd17e5fSmrg	 continue
70298bd17e5fSmrg       fi
70300597fb56Smrg
70318bd17e5fSmrg       # Expand the sysroot to ease extracting the directories later.
70328bd17e5fSmrg       if test -z "$prev"; then
70338bd17e5fSmrg         case $p in
70348bd17e5fSmrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
70358bd17e5fSmrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
70368bd17e5fSmrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
70378bd17e5fSmrg         esac
70388bd17e5fSmrg       fi
70398bd17e5fSmrg       case $p in
70408bd17e5fSmrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
70418bd17e5fSmrg       esac
70428bd17e5fSmrg       if test "$pre_test_object_deps_done" = no; then
70438bd17e5fSmrg	 case ${prev} in
70448bd17e5fSmrg	 -L | -R)
70458bd17e5fSmrg	   # Internal compiler library paths should come after those
70468bd17e5fSmrg	   # provided the user.  The postdeps already come after the
70478bd17e5fSmrg	   # user supplied libs so there is no need to process them.
70488bd17e5fSmrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
70498bd17e5fSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
70508bd17e5fSmrg	   else
70518bd17e5fSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
70528bd17e5fSmrg	   fi
70538bd17e5fSmrg	   ;;
70548bd17e5fSmrg	 # The "-l" case would never come before the object being
70558bd17e5fSmrg	 # linked, so don't bother handling this case.
70568bd17e5fSmrg	 esac
70578bd17e5fSmrg       else
70588bd17e5fSmrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
70598bd17e5fSmrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
70608bd17e5fSmrg	 else
70618bd17e5fSmrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
70628bd17e5fSmrg	 fi
70638bd17e5fSmrg       fi
70648bd17e5fSmrg       prev=
70658bd17e5fSmrg       ;;
70660597fb56Smrg
70678bd17e5fSmrg    *.lto.$objext) ;; # Ignore GCC LTO objects
70688bd17e5fSmrg    *.$objext)
70698bd17e5fSmrg       # This assumes that the test object file only shows up
70708bd17e5fSmrg       # once in the compiler output.
70718bd17e5fSmrg       if test "$p" = "conftest.$objext"; then
70728bd17e5fSmrg	 pre_test_object_deps_done=yes
70738bd17e5fSmrg	 continue
70748bd17e5fSmrg       fi
70750597fb56Smrg
70768bd17e5fSmrg       if test "$pre_test_object_deps_done" = no; then
70778bd17e5fSmrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
70788bd17e5fSmrg	   _LT_TAGVAR(predep_objects, $1)="$p"
70798bd17e5fSmrg	 else
70808bd17e5fSmrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
70818bd17e5fSmrg	 fi
70828bd17e5fSmrg       else
70838bd17e5fSmrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
70848bd17e5fSmrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
70858bd17e5fSmrg	 else
70868bd17e5fSmrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
70878bd17e5fSmrg	 fi
70888bd17e5fSmrg       fi
70898bd17e5fSmrg       ;;
70900597fb56Smrg
70918bd17e5fSmrg    *) ;; # Ignore the rest.
70920597fb56Smrg
70930597fb56Smrg    esac
70948bd17e5fSmrg  done
70958bd17e5fSmrg
70968bd17e5fSmrg  # Clean up.
70978bd17e5fSmrg  rm -f a.out a.exe
70988bd17e5fSmrgelse
70998bd17e5fSmrg  echo "libtool.m4: error: problem compiling $1 test program"
71008bd17e5fSmrgfi
71018bd17e5fSmrg
71028bd17e5fSmrg$RM -f confest.$objext
71038bd17e5fSmrgCFLAGS=$_lt_libdeps_save_CFLAGS
71048bd17e5fSmrg
71058bd17e5fSmrg# PORTME: override above test on systems where it is broken
71068bd17e5fSmrgm4_if([$1], [CXX],
71078bd17e5fSmrg[case $host_os in
71088bd17e5fSmrginterix[[3-9]]*)
71098bd17e5fSmrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
71108bd17e5fSmrg  # hack all around it, let's just trust "g++" to DTRT.
71118bd17e5fSmrg  _LT_TAGVAR(predep_objects,$1)=
71128bd17e5fSmrg  _LT_TAGVAR(postdep_objects,$1)=
71138bd17e5fSmrg  _LT_TAGVAR(postdeps,$1)=
71148bd17e5fSmrg  ;;
71158bd17e5fSmrg
71168bd17e5fSmrglinux*)
71178bd17e5fSmrg  case `$CC -V 2>&1 | sed 5q` in
71188bd17e5fSmrg  *Sun\ C*)
71198bd17e5fSmrg    # Sun C++ 5.9
71208bd17e5fSmrg
71218bd17e5fSmrg    # The more standards-conforming stlport4 library is
71228bd17e5fSmrg    # incompatible with the Cstd library. Avoid specifying
71238bd17e5fSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
71248bd17e5fSmrg    # -library=stlport4 depends on it.
71258bd17e5fSmrg    case " $CXX $CXXFLAGS " in
71268bd17e5fSmrg    *" -library=stlport4 "*)
71278bd17e5fSmrg      solaris_use_stlport4=yes
71288bd17e5fSmrg      ;;
71290597fb56Smrg    esac
71308bd17e5fSmrg
71318bd17e5fSmrg    if test "$solaris_use_stlport4" != yes; then
71328bd17e5fSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
71338bd17e5fSmrg    fi
7134706b6b52Smrg    ;;
71358bd17e5fSmrg  esac
71368bd17e5fSmrg  ;;
7137b042e37fSmrg
71388bd17e5fSmrgsolaris*)
71398bd17e5fSmrg  case $cc_basename in
71408bd17e5fSmrg  CC* | sunCC*)
71418bd17e5fSmrg    # The more standards-conforming stlport4 library is
71428bd17e5fSmrg    # incompatible with the Cstd library. Avoid specifying
71438bd17e5fSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
71448bd17e5fSmrg    # -library=stlport4 depends on it.
71458bd17e5fSmrg    case " $CXX $CXXFLAGS " in
71468bd17e5fSmrg    *" -library=stlport4 "*)
71478bd17e5fSmrg      solaris_use_stlport4=yes
71488bd17e5fSmrg      ;;
71490597fb56Smrg    esac
71508bd17e5fSmrg
71518bd17e5fSmrg    # Adding this requires a known-good setup of shared libraries for
71528bd17e5fSmrg    # Sun compiler versions before 5.6, else PIC objects from an old
71538bd17e5fSmrg    # archive will be linked into the output, leading to subtle bugs.
71548bd17e5fSmrg    if test "$solaris_use_stlport4" != yes; then
71558bd17e5fSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
71568bd17e5fSmrg    fi
71570597fb56Smrg    ;;
71588bd17e5fSmrg  esac
71598bd17e5fSmrg  ;;
71600597fb56Smrgesac
71610597fb56Smrg])
7162b042e37fSmrg
71638bd17e5fSmrgcase " $_LT_TAGVAR(postdeps, $1) " in
71648bd17e5fSmrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
71658bd17e5fSmrgesac
71668bd17e5fSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
71678bd17e5fSmrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
71688bd17e5fSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
71698bd17e5fSmrgfi
71708bd17e5fSmrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
71718bd17e5fSmrg    [The directories searched by this compiler when creating a shared library])
71728bd17e5fSmrg_LT_TAGDECL([], [predep_objects], [1],
71738bd17e5fSmrg    [Dependencies to place before and after the objects being linked to
71748bd17e5fSmrg    create a shared library])
71758bd17e5fSmrg_LT_TAGDECL([], [postdep_objects], [1])
71768bd17e5fSmrg_LT_TAGDECL([], [predeps], [1])
71778bd17e5fSmrg_LT_TAGDECL([], [postdeps], [1])
71788bd17e5fSmrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
71798bd17e5fSmrg    [The library search path used internally by the compiler when linking
71808bd17e5fSmrg    a shared library])
71818bd17e5fSmrg])# _LT_SYS_HIDDEN_LIBDEPS
71828c4a8e55Smrg
71838c4a8e55Smrg
71848bd17e5fSmrg# _LT_LANG_F77_CONFIG([TAG])
71858bd17e5fSmrg# --------------------------
71868bd17e5fSmrg# Ensure that the configuration variables for a Fortran 77 compiler are
71878bd17e5fSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
71888bd17e5fSmrg# to write the compiler configuration to `libtool'.
71898bd17e5fSmrgm4_defun([_LT_LANG_F77_CONFIG],
71908bd17e5fSmrg[AC_LANG_PUSH(Fortran 77)
71918bd17e5fSmrgif test -z "$F77" || test "X$F77" = "Xno"; then
71928bd17e5fSmrg  _lt_disable_F77=yes
71938bd17e5fSmrgfi
7194b042e37fSmrg
71958bd17e5fSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
71968bd17e5fSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
71978bd17e5fSmrg_LT_TAGVAR(always_export_symbols, $1)=no
71988bd17e5fSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
71998bd17e5fSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
72008bd17e5fSmrg_LT_TAGVAR(hardcode_direct, $1)=no
72018bd17e5fSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
72028bd17e5fSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
72038bd17e5fSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
72048bd17e5fSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
72058bd17e5fSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
72068bd17e5fSmrg_LT_TAGVAR(inherit_rpath, $1)=no
72078bd17e5fSmrg_LT_TAGVAR(module_cmds, $1)=
72088bd17e5fSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
72098bd17e5fSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
72108bd17e5fSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
72118bd17e5fSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
72128bd17e5fSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
72138bd17e5fSmrg_LT_TAGVAR(no_undefined_flag, $1)=
72148bd17e5fSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
72158bd17e5fSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7216b042e37fSmrg
72178bd17e5fSmrg# Source file extension for f77 test sources.
72188bd17e5fSmrgac_ext=f
7219b042e37fSmrg
72208bd17e5fSmrg# Object file extension for compiled f77 test sources.
72218bd17e5fSmrgobjext=o
72228bd17e5fSmrg_LT_TAGVAR(objext, $1)=$objext
72238c4a8e55Smrg
72248bd17e5fSmrg# No sense in running all these tests if we already determined that
72258bd17e5fSmrg# the F77 compiler isn't working.  Some variables (like enable_shared)
72268bd17e5fSmrg# are currently assumed to apply to all compilers on this platform,
72278bd17e5fSmrg# and will be corrupted by setting them based on a non-working compiler.
72288bd17e5fSmrgif test "$_lt_disable_F77" != yes; then
72298bd17e5fSmrg  # Code to be used in simple compile tests
72308bd17e5fSmrg  lt_simple_compile_test_code="\
72318bd17e5fSmrg      subroutine t
72328bd17e5fSmrg      return
72338bd17e5fSmrg      end
72348bd17e5fSmrg"
72358c4a8e55Smrg
72368bd17e5fSmrg  # Code to be used in simple link tests
72378bd17e5fSmrg  lt_simple_link_test_code="\
72388bd17e5fSmrg      program t
72398bd17e5fSmrg      end
72408bd17e5fSmrg"
72418c4a8e55Smrg
72428bd17e5fSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
72438bd17e5fSmrg  _LT_TAG_COMPILER
7244b042e37fSmrg
72458bd17e5fSmrg  # save warnings/boilerplate of simple test code
72468bd17e5fSmrg  _LT_COMPILER_BOILERPLATE
72478bd17e5fSmrg  _LT_LINKER_BOILERPLATE
7248b042e37fSmrg
72498bd17e5fSmrg  # Allow CC to be a program name with arguments.
72508bd17e5fSmrg  lt_save_CC="$CC"
72518bd17e5fSmrg  lt_save_GCC=$GCC
72528bd17e5fSmrg  lt_save_CFLAGS=$CFLAGS
72538bd17e5fSmrg  CC=${F77-"f77"}
72548bd17e5fSmrg  CFLAGS=$FFLAGS
72558bd17e5fSmrg  compiler=$CC
72568bd17e5fSmrg  _LT_TAGVAR(compiler, $1)=$CC
72578bd17e5fSmrg  _LT_CC_BASENAME([$compiler])
72588bd17e5fSmrg  GCC=$G77
72598bd17e5fSmrg  if test -n "$compiler"; then
72608bd17e5fSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
72618bd17e5fSmrg    AC_MSG_RESULT([$can_build_shared])
72628c4a8e55Smrg
72638bd17e5fSmrg    AC_MSG_CHECKING([whether to build shared libraries])
72648bd17e5fSmrg    test "$can_build_shared" = "no" && enable_shared=no
7265b042e37fSmrg
72668bd17e5fSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
72678bd17e5fSmrg    # are all built from PIC.
72688bd17e5fSmrg    case $host_os in
72698bd17e5fSmrg      aix3*)
72708bd17e5fSmrg        test "$enable_shared" = yes && enable_static=no
72718bd17e5fSmrg        if test -n "$RANLIB"; then
72728bd17e5fSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
72738bd17e5fSmrg          postinstall_cmds='$RANLIB $lib'
72748bd17e5fSmrg        fi
72758bd17e5fSmrg        ;;
72768bd17e5fSmrg      aix[[4-9]]*)
72778bd17e5fSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
72788bd17e5fSmrg	  test "$enable_shared" = yes && enable_static=no
72798bd17e5fSmrg	fi
72808bd17e5fSmrg        ;;
72818bd17e5fSmrg    esac
72828bd17e5fSmrg    AC_MSG_RESULT([$enable_shared])
7283b042e37fSmrg
72848bd17e5fSmrg    AC_MSG_CHECKING([whether to build static libraries])
72858bd17e5fSmrg    # Make sure either enable_shared or enable_static is yes.
72868bd17e5fSmrg    test "$enable_shared" = yes || enable_static=yes
72878bd17e5fSmrg    AC_MSG_RESULT([$enable_static])
7288b042e37fSmrg
72898bd17e5fSmrg    _LT_TAGVAR(GCC, $1)="$G77"
72908bd17e5fSmrg    _LT_TAGVAR(LD, $1)="$LD"
7291b042e37fSmrg
72928bd17e5fSmrg    ## CAVEAT EMPTOR:
72938bd17e5fSmrg    ## There is no encapsulation within the following macros, do not change
72948bd17e5fSmrg    ## the running order or otherwise move them around unless you know exactly
72958bd17e5fSmrg    ## what you are doing...
72968bd17e5fSmrg    _LT_COMPILER_PIC($1)
72978bd17e5fSmrg    _LT_COMPILER_C_O($1)
72988bd17e5fSmrg    _LT_COMPILER_FILE_LOCKS($1)
72998bd17e5fSmrg    _LT_LINKER_SHLIBS($1)
73008bd17e5fSmrg    _LT_SYS_DYNAMIC_LINKER($1)
73018bd17e5fSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7302b042e37fSmrg
73038bd17e5fSmrg    _LT_CONFIG($1)
73048bd17e5fSmrg  fi # test -n "$compiler"
7305b042e37fSmrg
73068bd17e5fSmrg  GCC=$lt_save_GCC
73078bd17e5fSmrg  CC="$lt_save_CC"
73088bd17e5fSmrg  CFLAGS="$lt_save_CFLAGS"
73098bd17e5fSmrgfi # test "$_lt_disable_F77" != yes
7310b042e37fSmrg
73118bd17e5fSmrgAC_LANG_POP
73128bd17e5fSmrg])# _LT_LANG_F77_CONFIG
7313706b6b52Smrg
7314706b6b52Smrg
73158bd17e5fSmrg# _LT_LANG_FC_CONFIG([TAG])
73168bd17e5fSmrg# -------------------------
73178bd17e5fSmrg# Ensure that the configuration variables for a Fortran compiler are
73188bd17e5fSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
73198bd17e5fSmrg# to write the compiler configuration to `libtool'.
73208bd17e5fSmrgm4_defun([_LT_LANG_FC_CONFIG],
73218bd17e5fSmrg[AC_LANG_PUSH(Fortran)
7322706b6b52Smrg
73238bd17e5fSmrgif test -z "$FC" || test "X$FC" = "Xno"; then
73248bd17e5fSmrg  _lt_disable_FC=yes
73258bd17e5fSmrgfi
7326706b6b52Smrg
73278bd17e5fSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
73288bd17e5fSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
73298bd17e5fSmrg_LT_TAGVAR(always_export_symbols, $1)=no
73308bd17e5fSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
73318bd17e5fSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
73328bd17e5fSmrg_LT_TAGVAR(hardcode_direct, $1)=no
73338bd17e5fSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
73348bd17e5fSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
73358bd17e5fSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
73368bd17e5fSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
73378bd17e5fSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
73388bd17e5fSmrg_LT_TAGVAR(inherit_rpath, $1)=no
73398bd17e5fSmrg_LT_TAGVAR(module_cmds, $1)=
73408bd17e5fSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
73418bd17e5fSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
73428bd17e5fSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
73438bd17e5fSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
73448bd17e5fSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
73458bd17e5fSmrg_LT_TAGVAR(no_undefined_flag, $1)=
73468bd17e5fSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
73478bd17e5fSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7348b042e37fSmrg
73498bd17e5fSmrg# Source file extension for fc test sources.
73508bd17e5fSmrgac_ext=${ac_fc_srcext-f}
73518c4a8e55Smrg
73528bd17e5fSmrg# Object file extension for compiled fc test sources.
73538bd17e5fSmrgobjext=o
73548bd17e5fSmrg_LT_TAGVAR(objext, $1)=$objext
73558c4a8e55Smrg
73568bd17e5fSmrg# No sense in running all these tests if we already determined that
73578bd17e5fSmrg# the FC compiler isn't working.  Some variables (like enable_shared)
73588bd17e5fSmrg# are currently assumed to apply to all compilers on this platform,
73598bd17e5fSmrg# and will be corrupted by setting them based on a non-working compiler.
73608bd17e5fSmrgif test "$_lt_disable_FC" != yes; then
73618bd17e5fSmrg  # Code to be used in simple compile tests
73628bd17e5fSmrg  lt_simple_compile_test_code="\
73638bd17e5fSmrg      subroutine t
73648bd17e5fSmrg      return
73658bd17e5fSmrg      end
73668bd17e5fSmrg"
7367b042e37fSmrg
73688bd17e5fSmrg  # Code to be used in simple link tests
73698bd17e5fSmrg  lt_simple_link_test_code="\
73708bd17e5fSmrg      program t
73718bd17e5fSmrg      end
73728bd17e5fSmrg"
7373b042e37fSmrg
73748bd17e5fSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
73758bd17e5fSmrg  _LT_TAG_COMPILER
73768c4a8e55Smrg
73778bd17e5fSmrg  # save warnings/boilerplate of simple test code
73788bd17e5fSmrg  _LT_COMPILER_BOILERPLATE
73798bd17e5fSmrg  _LT_LINKER_BOILERPLATE
7380b042e37fSmrg
73818bd17e5fSmrg  # Allow CC to be a program name with arguments.
73828bd17e5fSmrg  lt_save_CC="$CC"
73838bd17e5fSmrg  lt_save_GCC=$GCC
73848bd17e5fSmrg  lt_save_CFLAGS=$CFLAGS
73858bd17e5fSmrg  CC=${FC-"f95"}
73868bd17e5fSmrg  CFLAGS=$FCFLAGS
73878bd17e5fSmrg  compiler=$CC
73888bd17e5fSmrg  GCC=$ac_cv_fc_compiler_gnu
7389b042e37fSmrg
73908bd17e5fSmrg  _LT_TAGVAR(compiler, $1)=$CC
73918bd17e5fSmrg  _LT_CC_BASENAME([$compiler])
7392bd23fbfaSmrg
73938bd17e5fSmrg  if test -n "$compiler"; then
73948bd17e5fSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
73958bd17e5fSmrg    AC_MSG_RESULT([$can_build_shared])
73968bd17e5fSmrg
73978bd17e5fSmrg    AC_MSG_CHECKING([whether to build shared libraries])
73988bd17e5fSmrg    test "$can_build_shared" = "no" && enable_shared=no
73998bd17e5fSmrg
74008bd17e5fSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
74018bd17e5fSmrg    # are all built from PIC.
74028bd17e5fSmrg    case $host_os in
74038bd17e5fSmrg      aix3*)
74048bd17e5fSmrg        test "$enable_shared" = yes && enable_static=no
74058bd17e5fSmrg        if test -n "$RANLIB"; then
74068bd17e5fSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
74078bd17e5fSmrg          postinstall_cmds='$RANLIB $lib'
74088bd17e5fSmrg        fi
74098bd17e5fSmrg        ;;
74108bd17e5fSmrg      aix[[4-9]]*)
74118bd17e5fSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
74128bd17e5fSmrg	  test "$enable_shared" = yes && enable_static=no
74130597fb56Smrg	fi
74148bd17e5fSmrg        ;;
74158bd17e5fSmrg    esac
74168bd17e5fSmrg    AC_MSG_RESULT([$enable_shared])
74170597fb56Smrg
74188bd17e5fSmrg    AC_MSG_CHECKING([whether to build static libraries])
74198bd17e5fSmrg    # Make sure either enable_shared or enable_static is yes.
74208bd17e5fSmrg    test "$enable_shared" = yes || enable_static=yes
74218bd17e5fSmrg    AC_MSG_RESULT([$enable_static])
7422b042e37fSmrg
74238bd17e5fSmrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
74248bd17e5fSmrg    _LT_TAGVAR(LD, $1)="$LD"
7425b042e37fSmrg
74268bd17e5fSmrg    ## CAVEAT EMPTOR:
74278bd17e5fSmrg    ## There is no encapsulation within the following macros, do not change
74288bd17e5fSmrg    ## the running order or otherwise move them around unless you know exactly
74298bd17e5fSmrg    ## what you are doing...
74308bd17e5fSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
74318bd17e5fSmrg    _LT_COMPILER_PIC($1)
74328bd17e5fSmrg    _LT_COMPILER_C_O($1)
74338bd17e5fSmrg    _LT_COMPILER_FILE_LOCKS($1)
74348bd17e5fSmrg    _LT_LINKER_SHLIBS($1)
74358bd17e5fSmrg    _LT_SYS_DYNAMIC_LINKER($1)
74368bd17e5fSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7437b042e37fSmrg
74388bd17e5fSmrg    _LT_CONFIG($1)
74398bd17e5fSmrg  fi # test -n "$compiler"
7440b042e37fSmrg
74418bd17e5fSmrg  GCC=$lt_save_GCC
74428bd17e5fSmrg  CC=$lt_save_CC
74438bd17e5fSmrg  CFLAGS=$lt_save_CFLAGS
74448bd17e5fSmrgfi # test "$_lt_disable_FC" != yes
7445b042e37fSmrg
74468bd17e5fSmrgAC_LANG_POP
74478bd17e5fSmrg])# _LT_LANG_FC_CONFIG
74488bd17e5fSmrg
74498bd17e5fSmrg
74508bd17e5fSmrg# _LT_LANG_GCJ_CONFIG([TAG])
74518bd17e5fSmrg# --------------------------
74528bd17e5fSmrg# Ensure that the configuration variables for the GNU Java Compiler compiler
74538bd17e5fSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
74548bd17e5fSmrg# to write the compiler configuration to `libtool'.
74558bd17e5fSmrgm4_defun([_LT_LANG_GCJ_CONFIG],
74568bd17e5fSmrg[AC_REQUIRE([LT_PROG_GCJ])dnl
74578bd17e5fSmrgAC_LANG_SAVE
7458b042e37fSmrg
74598bd17e5fSmrg# Source file extension for Java test sources.
74608bd17e5fSmrgac_ext=java
7461706b6b52Smrg
74628bd17e5fSmrg# Object file extension for compiled Java test sources.
74638bd17e5fSmrgobjext=o
74648bd17e5fSmrg_LT_TAGVAR(objext, $1)=$objext
7465b042e37fSmrg
74668bd17e5fSmrg# Code to be used in simple compile tests
74678bd17e5fSmrglt_simple_compile_test_code="class foo {}"
7468b042e37fSmrg
74698bd17e5fSmrg# Code to be used in simple link tests
74708bd17e5fSmrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
7471b042e37fSmrg
74728bd17e5fSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
74738bd17e5fSmrg_LT_TAG_COMPILER
7474b042e37fSmrg
74758bd17e5fSmrg# save warnings/boilerplate of simple test code
74768bd17e5fSmrg_LT_COMPILER_BOILERPLATE
74778bd17e5fSmrg_LT_LINKER_BOILERPLATE
7478b042e37fSmrg
74798bd17e5fSmrg# Allow CC to be a program name with arguments.
74808bd17e5fSmrglt_save_CC=$CC
74818bd17e5fSmrglt_save_CFLAGS=$CFLAGS
74828bd17e5fSmrglt_save_GCC=$GCC
74838bd17e5fSmrgGCC=yes
74848bd17e5fSmrgCC=${GCJ-"gcj"}
74858bd17e5fSmrgCFLAGS=$GCJFLAGS
74868bd17e5fSmrgcompiler=$CC
74878bd17e5fSmrg_LT_TAGVAR(compiler, $1)=$CC
74888bd17e5fSmrg_LT_TAGVAR(LD, $1)="$LD"
74898bd17e5fSmrg_LT_CC_BASENAME([$compiler])
74900597fb56Smrg
74918bd17e5fSmrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
74928bd17e5fSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7493b042e37fSmrg
74948bd17e5fSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
74958bd17e5fSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
74968bd17e5fSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7497b042e37fSmrg
74988bd17e5fSmrgif test -n "$compiler"; then
74998bd17e5fSmrg  _LT_COMPILER_NO_RTTI($1)
75008bd17e5fSmrg  _LT_COMPILER_PIC($1)
75018bd17e5fSmrg  _LT_COMPILER_C_O($1)
75028bd17e5fSmrg  _LT_COMPILER_FILE_LOCKS($1)
75038bd17e5fSmrg  _LT_LINKER_SHLIBS($1)
75048bd17e5fSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
7505b042e37fSmrg
75068bd17e5fSmrg  _LT_CONFIG($1)
75078bd17e5fSmrgfi
7508b042e37fSmrg
75098bd17e5fSmrgAC_LANG_RESTORE
7510706b6b52Smrg
75118bd17e5fSmrgGCC=$lt_save_GCC
75128bd17e5fSmrgCC=$lt_save_CC
75138bd17e5fSmrgCFLAGS=$lt_save_CFLAGS
75148bd17e5fSmrg])# _LT_LANG_GCJ_CONFIG
7515b042e37fSmrg
7516b042e37fSmrg
75178bd17e5fSmrg# _LT_LANG_GO_CONFIG([TAG])
75188bd17e5fSmrg# --------------------------
75198bd17e5fSmrg# Ensure that the configuration variables for the GNU Go compiler
75208bd17e5fSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
75218bd17e5fSmrg# to write the compiler configuration to `libtool'.
75228bd17e5fSmrgm4_defun([_LT_LANG_GO_CONFIG],
75238bd17e5fSmrg[AC_REQUIRE([LT_PROG_GO])dnl
75248bd17e5fSmrgAC_LANG_SAVE
75258c4a8e55Smrg
75268bd17e5fSmrg# Source file extension for Go test sources.
75278bd17e5fSmrgac_ext=go
75288c4a8e55Smrg
75298bd17e5fSmrg# Object file extension for compiled Go test sources.
75308bd17e5fSmrgobjext=o
75318bd17e5fSmrg_LT_TAGVAR(objext, $1)=$objext
7532b042e37fSmrg
75338bd17e5fSmrg# Code to be used in simple compile tests
75348bd17e5fSmrglt_simple_compile_test_code="package main; func main() { }"
7535b042e37fSmrg
75368bd17e5fSmrg# Code to be used in simple link tests
75378bd17e5fSmrglt_simple_link_test_code='package main; func main() { }'
75388c4a8e55Smrg
75398bd17e5fSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
75408bd17e5fSmrg_LT_TAG_COMPILER
7541b042e37fSmrg
75428bd17e5fSmrg# save warnings/boilerplate of simple test code
75438bd17e5fSmrg_LT_COMPILER_BOILERPLATE
75448bd17e5fSmrg_LT_LINKER_BOILERPLATE
75450597fb56Smrg
75468bd17e5fSmrg# Allow CC to be a program name with arguments.
75478bd17e5fSmrglt_save_CC=$CC
75488bd17e5fSmrglt_save_CFLAGS=$CFLAGS
75498bd17e5fSmrglt_save_GCC=$GCC
75508bd17e5fSmrgGCC=yes
75518bd17e5fSmrgCC=${GOC-"gccgo"}
75528bd17e5fSmrgCFLAGS=$GOFLAGS
75538bd17e5fSmrgcompiler=$CC
75548bd17e5fSmrg_LT_TAGVAR(compiler, $1)=$CC
75558bd17e5fSmrg_LT_TAGVAR(LD, $1)="$LD"
75568bd17e5fSmrg_LT_CC_BASENAME([$compiler])
75570597fb56Smrg
75588bd17e5fSmrg# Go did not exist at the time GCC didn't implicitly link libc in.
75598bd17e5fSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7560b042e37fSmrg
75618bd17e5fSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
75628bd17e5fSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
75638bd17e5fSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7564b042e37fSmrg
75658bd17e5fSmrgif test -n "$compiler"; then
75668bd17e5fSmrg  _LT_COMPILER_NO_RTTI($1)
75678bd17e5fSmrg  _LT_COMPILER_PIC($1)
75688bd17e5fSmrg  _LT_COMPILER_C_O($1)
75698bd17e5fSmrg  _LT_COMPILER_FILE_LOCKS($1)
75708bd17e5fSmrg  _LT_LINKER_SHLIBS($1)
75718bd17e5fSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
7572b042e37fSmrg
75738bd17e5fSmrg  _LT_CONFIG($1)
75748bd17e5fSmrgfi
7575b042e37fSmrg
75768bd17e5fSmrgAC_LANG_RESTORE
7577b042e37fSmrg
75788bd17e5fSmrgGCC=$lt_save_GCC
75798bd17e5fSmrgCC=$lt_save_CC
75808bd17e5fSmrgCFLAGS=$lt_save_CFLAGS
75818bd17e5fSmrg])# _LT_LANG_GO_CONFIG
7582b042e37fSmrg
7583b042e37fSmrg
75848bd17e5fSmrg# _LT_LANG_RC_CONFIG([TAG])
75858bd17e5fSmrg# -------------------------
75868bd17e5fSmrg# Ensure that the configuration variables for the Windows resource compiler
75878bd17e5fSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
75888bd17e5fSmrg# to write the compiler configuration to `libtool'.
75898bd17e5fSmrgm4_defun([_LT_LANG_RC_CONFIG],
75908bd17e5fSmrg[AC_REQUIRE([LT_PROG_RC])dnl
75918bd17e5fSmrgAC_LANG_SAVE
7592b042e37fSmrg
75938bd17e5fSmrg# Source file extension for RC test sources.
75948bd17e5fSmrgac_ext=rc
7595b042e37fSmrg
75968bd17e5fSmrg# Object file extension for compiled RC test sources.
75978bd17e5fSmrgobjext=o
75988bd17e5fSmrg_LT_TAGVAR(objext, $1)=$objext
7599b042e37fSmrg
76008bd17e5fSmrg# Code to be used in simple compile tests
76018bd17e5fSmrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
7602b042e37fSmrg
76038bd17e5fSmrg# Code to be used in simple link tests
76048bd17e5fSmrglt_simple_link_test_code="$lt_simple_compile_test_code"
7605b042e37fSmrg
76068bd17e5fSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
76078bd17e5fSmrg_LT_TAG_COMPILER
7608b042e37fSmrg
76098bd17e5fSmrg# save warnings/boilerplate of simple test code
76108bd17e5fSmrg_LT_COMPILER_BOILERPLATE
76118bd17e5fSmrg_LT_LINKER_BOILERPLATE
7612b042e37fSmrg
76138bd17e5fSmrg# Allow CC to be a program name with arguments.
76148bd17e5fSmrglt_save_CC="$CC"
76158bd17e5fSmrglt_save_CFLAGS=$CFLAGS
76168bd17e5fSmrglt_save_GCC=$GCC
76178bd17e5fSmrgGCC=
76188bd17e5fSmrgCC=${RC-"windres"}
76198bd17e5fSmrgCFLAGS=
76208bd17e5fSmrgcompiler=$CC
76218bd17e5fSmrg_LT_TAGVAR(compiler, $1)=$CC
76228bd17e5fSmrg_LT_CC_BASENAME([$compiler])
76238bd17e5fSmrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
7624b042e37fSmrg
76258bd17e5fSmrgif test -n "$compiler"; then
76268bd17e5fSmrg  :
76278bd17e5fSmrg  _LT_CONFIG($1)
76288bd17e5fSmrgfi
7629b042e37fSmrg
76308bd17e5fSmrgGCC=$lt_save_GCC
76318bd17e5fSmrgAC_LANG_RESTORE
76328bd17e5fSmrgCC=$lt_save_CC
76338bd17e5fSmrgCFLAGS=$lt_save_CFLAGS
76348bd17e5fSmrg])# _LT_LANG_RC_CONFIG
7635b042e37fSmrg
7636b042e37fSmrg
76378bd17e5fSmrg# LT_PROG_GCJ
76388bd17e5fSmrg# -----------
76398bd17e5fSmrgAC_DEFUN([LT_PROG_GCJ],
76408bd17e5fSmrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
76418bd17e5fSmrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
76428bd17e5fSmrg    [AC_CHECK_TOOL(GCJ, gcj,)
76438bd17e5fSmrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
76448bd17e5fSmrg      AC_SUBST(GCJFLAGS)])])[]dnl
76458bd17e5fSmrg])
7646b042e37fSmrg
76478bd17e5fSmrg# Old name:
76488bd17e5fSmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
76498bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
76508bd17e5fSmrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
7651b042e37fSmrg
76520597fb56Smrg
76538bd17e5fSmrg# LT_PROG_GO
76548bd17e5fSmrg# ----------
76558bd17e5fSmrgAC_DEFUN([LT_PROG_GO],
76568bd17e5fSmrg[AC_CHECK_TOOL(GOC, gccgo,)
76578bd17e5fSmrg])
7658b042e37fSmrg
76598c4a8e55Smrg
76608bd17e5fSmrg# LT_PROG_RC
76618bd17e5fSmrg# ----------
76628bd17e5fSmrgAC_DEFUN([LT_PROG_RC],
76638bd17e5fSmrg[AC_CHECK_TOOL(RC, windres,)
76648bd17e5fSmrg])
7665b042e37fSmrg
76668bd17e5fSmrg# Old name:
76678bd17e5fSmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
76688bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
76698bd17e5fSmrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
7670b042e37fSmrg
7671b042e37fSmrg
76728bd17e5fSmrg# _LT_DECL_EGREP
76738bd17e5fSmrg# --------------
76748bd17e5fSmrg# If we don't have a new enough Autoconf to choose the best grep
76758bd17e5fSmrg# available, choose the one first in the user's PATH.
76768bd17e5fSmrgm4_defun([_LT_DECL_EGREP],
76778bd17e5fSmrg[AC_REQUIRE([AC_PROG_EGREP])dnl
76788bd17e5fSmrgAC_REQUIRE([AC_PROG_FGREP])dnl
76798bd17e5fSmrgtest -z "$GREP" && GREP=grep
76808bd17e5fSmrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
76818bd17e5fSmrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
76828bd17e5fSmrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
76838bd17e5fSmrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
76848bd17e5fSmrgAC_SUBST([GREP])
76858bd17e5fSmrg])
7686b042e37fSmrg
7687b042e37fSmrg
76888bd17e5fSmrg# _LT_DECL_OBJDUMP
76898bd17e5fSmrg# --------------
76908bd17e5fSmrg# If we don't have a new enough Autoconf to choose the best objdump
76918bd17e5fSmrg# available, choose the one first in the user's PATH.
76928bd17e5fSmrgm4_defun([_LT_DECL_OBJDUMP],
76938bd17e5fSmrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
76948bd17e5fSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
76958bd17e5fSmrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
76968bd17e5fSmrgAC_SUBST([OBJDUMP])
76970597fb56Smrg])
7698b042e37fSmrg
76998bd17e5fSmrg# _LT_DECL_DLLTOOL
77008bd17e5fSmrg# ----------------
77018bd17e5fSmrg# Ensure DLLTOOL variable is set.
77028bd17e5fSmrgm4_defun([_LT_DECL_DLLTOOL],
77038bd17e5fSmrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
77048bd17e5fSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
77058bd17e5fSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
77068bd17e5fSmrgAC_SUBST([DLLTOOL])
77078bd17e5fSmrg])
7708b042e37fSmrg
77098bd17e5fSmrg# _LT_DECL_SED
77108bd17e5fSmrg# ------------
77118bd17e5fSmrg# Check for a fully-functional sed program, that truncates
77128bd17e5fSmrg# as few characters as possible.  Prefer GNU sed if found.
77138bd17e5fSmrgm4_defun([_LT_DECL_SED],
77148bd17e5fSmrg[AC_PROG_SED
77158bd17e5fSmrgtest -z "$SED" && SED=sed
77168bd17e5fSmrgXsed="$SED -e 1s/^X//"
77178bd17e5fSmrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
77188bd17e5fSmrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
77198bd17e5fSmrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
77208bd17e5fSmrg])# _LT_DECL_SED
7721b042e37fSmrg
77228bd17e5fSmrgm4_ifndef([AC_PROG_SED], [
77238bd17e5fSmrg# NOTE: This macro has been submitted for inclusion into   #
77248bd17e5fSmrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
77258bd17e5fSmrg#  a released version of Autoconf we should remove this    #
77268bd17e5fSmrg#  macro and use it instead.                               #
7727b042e37fSmrg
77288bd17e5fSmrgm4_defun([AC_PROG_SED],
77298bd17e5fSmrg[AC_MSG_CHECKING([for a sed that does not truncate output])
77308bd17e5fSmrgAC_CACHE_VAL(lt_cv_path_SED,
77318bd17e5fSmrg[# Loop through the user's path and test for sed and gsed.
77328bd17e5fSmrg# Then use that list of sed's as ones to test for truncation.
77338bd17e5fSmrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
77348bd17e5fSmrgfor as_dir in $PATH
77358bd17e5fSmrgdo
77368bd17e5fSmrg  IFS=$as_save_IFS
77378bd17e5fSmrg  test -z "$as_dir" && as_dir=.
77388bd17e5fSmrg  for lt_ac_prog in sed gsed; do
77398bd17e5fSmrg    for ac_exec_ext in '' $ac_executable_extensions; do
77408bd17e5fSmrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
77418bd17e5fSmrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
77428bd17e5fSmrg      fi
77438bd17e5fSmrg    done
77448bd17e5fSmrg  done
77458bd17e5fSmrgdone
77468bd17e5fSmrgIFS=$as_save_IFS
77478bd17e5fSmrglt_ac_max=0
77488bd17e5fSmrglt_ac_count=0
77498bd17e5fSmrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
77508bd17e5fSmrg# along with /bin/sed that truncates output.
77518bd17e5fSmrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
77528bd17e5fSmrg  test ! -f $lt_ac_sed && continue
77538bd17e5fSmrg  cat /dev/null > conftest.in
77548bd17e5fSmrg  lt_ac_count=0
77558bd17e5fSmrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
77568bd17e5fSmrg  # Check for GNU sed and select it if it is found.
77578bd17e5fSmrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
77588bd17e5fSmrg    lt_cv_path_SED=$lt_ac_sed
77598bd17e5fSmrg    break
77608bd17e5fSmrg  fi
77618bd17e5fSmrg  while true; do
77628bd17e5fSmrg    cat conftest.in conftest.in >conftest.tmp
77638bd17e5fSmrg    mv conftest.tmp conftest.in
77648bd17e5fSmrg    cp conftest.in conftest.nl
77658bd17e5fSmrg    echo >>conftest.nl
77668bd17e5fSmrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
77678bd17e5fSmrg    cmp -s conftest.out conftest.nl || break
77688bd17e5fSmrg    # 10000 chars as input seems more than enough
77698bd17e5fSmrg    test $lt_ac_count -gt 10 && break
77708bd17e5fSmrg    lt_ac_count=`expr $lt_ac_count + 1`
77718bd17e5fSmrg    if test $lt_ac_count -gt $lt_ac_max; then
77728bd17e5fSmrg      lt_ac_max=$lt_ac_count
77738bd17e5fSmrg      lt_cv_path_SED=$lt_ac_sed
77748bd17e5fSmrg    fi
77758bd17e5fSmrg  done
77768bd17e5fSmrgdone
77770597fb56Smrg])
77788bd17e5fSmrgSED=$lt_cv_path_SED
77798bd17e5fSmrgAC_SUBST([SED])
77808bd17e5fSmrgAC_MSG_RESULT([$SED])
77818bd17e5fSmrg])#AC_PROG_SED
77828bd17e5fSmrg])#m4_ifndef
77838c4a8e55Smrg
77848bd17e5fSmrg# Old name:
77858bd17e5fSmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
77868bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
77878bd17e5fSmrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
77880597fb56Smrg
77890597fb56Smrg
77908bd17e5fSmrg# _LT_CHECK_SHELL_FEATURES
77918bd17e5fSmrg# ------------------------
77928bd17e5fSmrg# Find out whether the shell is Bourne or XSI compatible,
77938bd17e5fSmrg# or has some other useful features.
77948bd17e5fSmrgm4_defun([_LT_CHECK_SHELL_FEATURES],
77958bd17e5fSmrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
77968bd17e5fSmrg# Try some XSI features
77978bd17e5fSmrgxsi_shell=no
77988bd17e5fSmrg( _lt_dummy="a/b/c"
77998bd17e5fSmrg  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
78008bd17e5fSmrg      = c,a/b,b/c, \
78018bd17e5fSmrg    && eval 'test $(( 1 + 1 )) -eq 2 \
78028bd17e5fSmrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
78038bd17e5fSmrg  && xsi_shell=yes
78048bd17e5fSmrgAC_MSG_RESULT([$xsi_shell])
78058bd17e5fSmrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
78060597fb56Smrg
78078bd17e5fSmrgAC_MSG_CHECKING([whether the shell understands "+="])
78088bd17e5fSmrglt_shell_append=no
78098bd17e5fSmrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
78108bd17e5fSmrg    >/dev/null 2>&1 \
78118bd17e5fSmrg  && lt_shell_append=yes
78128bd17e5fSmrgAC_MSG_RESULT([$lt_shell_append])
78138bd17e5fSmrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
78148c4a8e55Smrg
78158bd17e5fSmrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
78168bd17e5fSmrg  lt_unset=unset
78178bd17e5fSmrgelse
78188bd17e5fSmrg  lt_unset=false
78198bd17e5fSmrgfi
78208bd17e5fSmrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
78218c4a8e55Smrg
78228bd17e5fSmrg# test EBCDIC or ASCII
78238bd17e5fSmrgcase `echo X|tr X '\101'` in
78248bd17e5fSmrg A) # ASCII based system
78258bd17e5fSmrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
78268bd17e5fSmrg  lt_SP2NL='tr \040 \012'
78278bd17e5fSmrg  lt_NL2SP='tr \015\012 \040\040'
78288bd17e5fSmrg  ;;
78298bd17e5fSmrg *) # EBCDIC based system
78308bd17e5fSmrg  lt_SP2NL='tr \100 \n'
78318bd17e5fSmrg  lt_NL2SP='tr \r\n \100\100'
78328bd17e5fSmrg  ;;
78338bd17e5fSmrgesac
78348bd17e5fSmrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
78358bd17e5fSmrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
78368bd17e5fSmrg])# _LT_CHECK_SHELL_FEATURES
78378c4a8e55Smrg
78388c4a8e55Smrg
78398bd17e5fSmrg# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
78408bd17e5fSmrg# ------------------------------------------------------
78418bd17e5fSmrg# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
78428bd17e5fSmrg# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
78438bd17e5fSmrgm4_defun([_LT_PROG_FUNCTION_REPLACE],
78448bd17e5fSmrg[dnl {
78458bd17e5fSmrgsed -e '/^$1 ()$/,/^} # $1 /c\
78468bd17e5fSmrg$1 ()\
78478bd17e5fSmrg{\
78488bd17e5fSmrgm4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
78498bd17e5fSmrg} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
78508bd17e5fSmrg  && mv -f "$cfgfile.tmp" "$cfgfile" \
78518bd17e5fSmrg    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
78528bd17e5fSmrgtest 0 -eq $? || _lt_function_replace_fail=:
78538bd17e5fSmrg])
7854bd23fbfaSmrg
78558c4a8e55Smrg
78568bd17e5fSmrg# _LT_PROG_REPLACE_SHELLFNS
78578bd17e5fSmrg# -------------------------
78588bd17e5fSmrg# Replace existing portable implementations of several shell functions with
78598bd17e5fSmrg# equivalent extended shell implementations where those features are available..
78608bd17e5fSmrgm4_defun([_LT_PROG_REPLACE_SHELLFNS],
78618bd17e5fSmrg[if test x"$xsi_shell" = xyes; then
78628bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
78638bd17e5fSmrg    case ${1} in
78648bd17e5fSmrg      */*) func_dirname_result="${1%/*}${2}" ;;
78658bd17e5fSmrg      *  ) func_dirname_result="${3}" ;;
78668bd17e5fSmrg    esac])
7867bd23fbfaSmrg
78688bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
78698bd17e5fSmrg    func_basename_result="${1##*/}"])
7870bd23fbfaSmrg
78718bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
78728bd17e5fSmrg    case ${1} in
78738bd17e5fSmrg      */*) func_dirname_result="${1%/*}${2}" ;;
78748bd17e5fSmrg      *  ) func_dirname_result="${3}" ;;
78758bd17e5fSmrg    esac
78768bd17e5fSmrg    func_basename_result="${1##*/}"])
78778c4a8e55Smrg
78788bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
78798bd17e5fSmrg    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
78808bd17e5fSmrg    # positional parameters, so assign one to ordinary parameter first.
78818bd17e5fSmrg    func_stripname_result=${3}
78828bd17e5fSmrg    func_stripname_result=${func_stripname_result#"${1}"}
78838bd17e5fSmrg    func_stripname_result=${func_stripname_result%"${2}"}])
7884b042e37fSmrg
78858bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
78868bd17e5fSmrg    func_split_long_opt_name=${1%%=*}
78878bd17e5fSmrg    func_split_long_opt_arg=${1#*=}])
7888b042e37fSmrg
78898bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
78908bd17e5fSmrg    func_split_short_opt_arg=${1#??}
78918bd17e5fSmrg    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
7892b042e37fSmrg
78938bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
78948bd17e5fSmrg    case ${1} in
78958bd17e5fSmrg      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
78968bd17e5fSmrg      *)    func_lo2o_result=${1} ;;
78978bd17e5fSmrg    esac])
7898b042e37fSmrg
78998bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
7900b042e37fSmrg
79018bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
7902b042e37fSmrg
79038bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
79048bd17e5fSmrgfi
7905b042e37fSmrg
79068bd17e5fSmrgif test x"$lt_shell_append" = xyes; then
79078bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
7908b042e37fSmrg
79098bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
79108bd17e5fSmrg    func_quote_for_eval "${2}"
79118bd17e5fSmrgdnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
79128bd17e5fSmrg    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
79130597fb56Smrg
79148bd17e5fSmrg  # Save a `func_append' function call where possible by direct use of '+='
79158bd17e5fSmrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
79168bd17e5fSmrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
79178bd17e5fSmrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
79188bd17e5fSmrg  test 0 -eq $? || _lt_function_replace_fail=:
7919706b6b52Smrgelse
79208bd17e5fSmrg  # Save a `func_append' function call even when '+=' is not available
79218bd17e5fSmrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
79228bd17e5fSmrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
79238bd17e5fSmrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
79248bd17e5fSmrg  test 0 -eq $? || _lt_function_replace_fail=:
79258bd17e5fSmrgfi
7926b042e37fSmrg
79278bd17e5fSmrgif test x"$_lt_function_replace_fail" = x":"; then
79288bd17e5fSmrg  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
79298bd17e5fSmrgfi
79308bd17e5fSmrg])
7931b042e37fSmrg
79328bd17e5fSmrg# _LT_PATH_CONVERSION_FUNCTIONS
79338bd17e5fSmrg# -----------------------------
79348bd17e5fSmrg# Determine which file name conversion functions should be used by
79358bd17e5fSmrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
79368bd17e5fSmrg# for certain cross-compile configurations and native mingw.
79378bd17e5fSmrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
79388bd17e5fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
79398bd17e5fSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
79408bd17e5fSmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
79418bd17e5fSmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
79428bd17e5fSmrg[case $host in
79438bd17e5fSmrg  *-*-mingw* )
79448bd17e5fSmrg    case $build in
79458bd17e5fSmrg      *-*-mingw* ) # actually msys
79468bd17e5fSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
79478bd17e5fSmrg        ;;
79488bd17e5fSmrg      *-*-cygwin* )
79498bd17e5fSmrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
79508bd17e5fSmrg        ;;
79518bd17e5fSmrg      * ) # otherwise, assume *nix
79528bd17e5fSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
79538bd17e5fSmrg        ;;
79548bd17e5fSmrg    esac
79558bd17e5fSmrg    ;;
79568bd17e5fSmrg  *-*-cygwin* )
79578bd17e5fSmrg    case $build in
79588bd17e5fSmrg      *-*-mingw* ) # actually msys
79598bd17e5fSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
79608bd17e5fSmrg        ;;
79618bd17e5fSmrg      *-*-cygwin* )
79628bd17e5fSmrg        lt_cv_to_host_file_cmd=func_convert_file_noop
79638bd17e5fSmrg        ;;
79648bd17e5fSmrg      * ) # otherwise, assume *nix
79658bd17e5fSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
79668bd17e5fSmrg        ;;
79678bd17e5fSmrg    esac
79688bd17e5fSmrg    ;;
79698bd17e5fSmrg  * ) # unhandled hosts (and "normal" native builds)
79708bd17e5fSmrg    lt_cv_to_host_file_cmd=func_convert_file_noop
79718bd17e5fSmrg    ;;
79728bd17e5fSmrgesac
79738bd17e5fSmrg])
79748bd17e5fSmrgto_host_file_cmd=$lt_cv_to_host_file_cmd
79758bd17e5fSmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
79768bd17e5fSmrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
79778bd17e5fSmrg         [0], [convert $build file names to $host format])dnl
79788bd17e5fSmrg
79798bd17e5fSmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
79808bd17e5fSmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
79818bd17e5fSmrg[#assume ordinary cross tools, or native build.
79828bd17e5fSmrglt_cv_to_tool_file_cmd=func_convert_file_noop
79838bd17e5fSmrgcase $host in
79848bd17e5fSmrg  *-*-mingw* )
79858bd17e5fSmrg    case $build in
79868bd17e5fSmrg      *-*-mingw* ) # actually msys
79878bd17e5fSmrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
79888bd17e5fSmrg        ;;
79898bd17e5fSmrg    esac
79908bd17e5fSmrg    ;;
79918bd17e5fSmrgesac
79928bd17e5fSmrg])
79938bd17e5fSmrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
79948bd17e5fSmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
79958bd17e5fSmrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
79968bd17e5fSmrg         [0], [convert $build files to toolchain format])dnl
79978bd17e5fSmrg])# _LT_PATH_CONVERSION_FUNCTIONS
79988bd17e5fSmrg
79998bd17e5fSmrg# Helper functions for option handling.                    -*- Autoconf -*-
80000597fb56Smrg#
80018bd17e5fSmrg#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
80028bd17e5fSmrg#   Inc.
80038bd17e5fSmrg#   Written by Gary V. Vaughan, 2004
80040597fb56Smrg#
80058bd17e5fSmrg# This file is free software; the Free Software Foundation gives
80068bd17e5fSmrg# unlimited permission to copy and/or distribute it, with or without
80078bd17e5fSmrg# modifications, as long as this notice is preserved.
8008b042e37fSmrg
80098bd17e5fSmrg# serial 7 ltoptions.m4
8010b042e37fSmrg
80118bd17e5fSmrg# This is to help aclocal find these macros, as it can't see m4_define.
80128bd17e5fSmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
80138bd17e5fSmrg
80148bd17e5fSmrg
80158bd17e5fSmrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
80168bd17e5fSmrg# ------------------------------------------
80178bd17e5fSmrgm4_define([_LT_MANGLE_OPTION],
80188bd17e5fSmrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
8019b042e37fSmrg
8020706b6b52Smrg
80218bd17e5fSmrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
80228bd17e5fSmrg# ---------------------------------------
80238bd17e5fSmrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
80248bd17e5fSmrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
80258bd17e5fSmrg# saved as a flag.
80268bd17e5fSmrgm4_define([_LT_SET_OPTION],
80278bd17e5fSmrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
80288bd17e5fSmrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
80298bd17e5fSmrg        _LT_MANGLE_DEFUN([$1], [$2]),
80308bd17e5fSmrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
80318bd17e5fSmrg])
8032b042e37fSmrg
8033b042e37fSmrg
80348bd17e5fSmrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
80358bd17e5fSmrg# ------------------------------------------------------------
80368bd17e5fSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
80378bd17e5fSmrgm4_define([_LT_IF_OPTION],
80388bd17e5fSmrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
8039b042e37fSmrg
80408c4a8e55Smrg
80418bd17e5fSmrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
80428bd17e5fSmrg# -------------------------------------------------------
80438bd17e5fSmrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
80448bd17e5fSmrg# are set.
80458bd17e5fSmrgm4_define([_LT_UNLESS_OPTIONS],
80468bd17e5fSmrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
80478bd17e5fSmrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
80488bd17e5fSmrg		      [m4_define([$0_found])])])[]dnl
80498bd17e5fSmrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
80508bd17e5fSmrg])[]dnl
80518bd17e5fSmrg])
80520597fb56Smrg
80538c4a8e55Smrg
80548bd17e5fSmrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
80558bd17e5fSmrg# ----------------------------------------
80568bd17e5fSmrg# OPTION-LIST is a space-separated list of Libtool options associated
80578bd17e5fSmrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
80588bd17e5fSmrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
80598bd17e5fSmrg# the unknown option and exit.
80608bd17e5fSmrgm4_defun([_LT_SET_OPTIONS],
80618bd17e5fSmrg[# Set options
80628bd17e5fSmrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
80638bd17e5fSmrg    [_LT_SET_OPTION([$1], _LT_Option)])
80648c4a8e55Smrg
80658bd17e5fSmrgm4_if([$1],[LT_INIT],[
80668bd17e5fSmrg  dnl
80678bd17e5fSmrg  dnl Simply set some default values (i.e off) if boolean options were not
80688bd17e5fSmrg  dnl specified:
80698bd17e5fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
80708bd17e5fSmrg  ])
80718bd17e5fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
80728bd17e5fSmrg  ])
80738bd17e5fSmrg  dnl
80748bd17e5fSmrg  dnl If no reference was made to various pairs of opposing options, then
80758bd17e5fSmrg  dnl we run the default mode handler for the pair.  For example, if neither
80768bd17e5fSmrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
80778bd17e5fSmrg  dnl archives by default:
80788bd17e5fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
80798bd17e5fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
80808bd17e5fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
80818bd17e5fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
80828bd17e5fSmrg  		   [_LT_ENABLE_FAST_INSTALL])
80838bd17e5fSmrg  ])
80848bd17e5fSmrg])# _LT_SET_OPTIONS
80858c4a8e55Smrg
80868c4a8e55Smrg
80878c4a8e55Smrg
80888bd17e5fSmrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
80898bd17e5fSmrg# -----------------------------------------
80908bd17e5fSmrgm4_define([_LT_MANGLE_DEFUN],
80918bd17e5fSmrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
80928c4a8e55Smrg
80938c4a8e55Smrg
80948bd17e5fSmrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
80958bd17e5fSmrg# -----------------------------------------------
80968bd17e5fSmrgm4_define([LT_OPTION_DEFINE],
80978bd17e5fSmrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
80988bd17e5fSmrg])# LT_OPTION_DEFINE
80998c4a8e55Smrg
81008c4a8e55Smrg
81018bd17e5fSmrg# dlopen
81028bd17e5fSmrg# ------
81038bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
81048bd17e5fSmrg])
81058c4a8e55Smrg
81068bd17e5fSmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
81078bd17e5fSmrg[_LT_SET_OPTION([LT_INIT], [dlopen])
81088bd17e5fSmrgAC_DIAGNOSE([obsolete],
81098bd17e5fSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
81108bd17e5fSmrgput the `dlopen' option into LT_INIT's first parameter.])
81118bd17e5fSmrg])
8112b042e37fSmrg
81138bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
81148bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
8115b042e37fSmrg
8116b042e37fSmrg
81178bd17e5fSmrg# win32-dll
81188bd17e5fSmrg# ---------
81198bd17e5fSmrg# Declare package support for building win32 dll's.
81208bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
81218bd17e5fSmrg[enable_win32_dll=yes
8122b042e37fSmrg
81238bd17e5fSmrgcase $host in
81248bd17e5fSmrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
81258bd17e5fSmrg  AC_CHECK_TOOL(AS, as, false)
81268bd17e5fSmrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
81278bd17e5fSmrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
81288bd17e5fSmrg  ;;
81298bd17e5fSmrgesac
81308bd17e5fSmrg
81318bd17e5fSmrgtest -z "$AS" && AS=as
81328bd17e5fSmrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
81338bd17e5fSmrg
81348bd17e5fSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
81358bd17e5fSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
81368bd17e5fSmrg
81378bd17e5fSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
81388bd17e5fSmrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
81398bd17e5fSmrg])# win32-dll
8140b042e37fSmrg
81418bd17e5fSmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
81428bd17e5fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
81438bd17e5fSmrg_LT_SET_OPTION([LT_INIT], [win32-dll])
81448bd17e5fSmrgAC_DIAGNOSE([obsolete],
81458bd17e5fSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
81468bd17e5fSmrgput the `win32-dll' option into LT_INIT's first parameter.])
81478bd17e5fSmrg])
8148b042e37fSmrg
81498bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
81508bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
8151b042e37fSmrg
8152b042e37fSmrg
81538bd17e5fSmrg# _LT_ENABLE_SHARED([DEFAULT])
81548bd17e5fSmrg# ----------------------------
81558bd17e5fSmrg# implement the --enable-shared flag, and supports the `shared' and
81568bd17e5fSmrg# `disable-shared' LT_INIT options.
81578bd17e5fSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
81588bd17e5fSmrgm4_define([_LT_ENABLE_SHARED],
81598bd17e5fSmrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
81608bd17e5fSmrgAC_ARG_ENABLE([shared],
81618bd17e5fSmrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
81628bd17e5fSmrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
81638bd17e5fSmrg    [p=${PACKAGE-default}
81648bd17e5fSmrg    case $enableval in
81658bd17e5fSmrg    yes) enable_shared=yes ;;
81668bd17e5fSmrg    no) enable_shared=no ;;
81678bd17e5fSmrg    *)
81688bd17e5fSmrg      enable_shared=no
81698bd17e5fSmrg      # Look at the argument we got.  We use all the common list separators.
81708bd17e5fSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
81718bd17e5fSmrg      for pkg in $enableval; do
81728bd17e5fSmrg	IFS="$lt_save_ifs"
81738bd17e5fSmrg	if test "X$pkg" = "X$p"; then
81748bd17e5fSmrg	  enable_shared=yes
81758bd17e5fSmrg	fi
81768bd17e5fSmrg      done
81778bd17e5fSmrg      IFS="$lt_save_ifs"
81788bd17e5fSmrg      ;;
81798bd17e5fSmrg    esac],
81808bd17e5fSmrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
8181b042e37fSmrg
81828bd17e5fSmrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
81838bd17e5fSmrg	[Whether or not to build shared libraries])
81848bd17e5fSmrg])# _LT_ENABLE_SHARED
8185b042e37fSmrg
81868bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
81878bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
81880597fb56Smrg
81898bd17e5fSmrg# Old names:
81908bd17e5fSmrgAC_DEFUN([AC_ENABLE_SHARED],
81918bd17e5fSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
81928bd17e5fSmrg])
8193b042e37fSmrg
81948bd17e5fSmrgAC_DEFUN([AC_DISABLE_SHARED],
81958bd17e5fSmrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
81968bd17e5fSmrg])
8197b042e37fSmrg
81988bd17e5fSmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
81998bd17e5fSmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
8200b042e37fSmrg
82018bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
82028bd17e5fSmrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
82038bd17e5fSmrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
8204b042e37fSmrg
8205b042e37fSmrg
8206b042e37fSmrg
82078bd17e5fSmrg# _LT_ENABLE_STATIC([DEFAULT])
82088bd17e5fSmrg# ----------------------------
82098bd17e5fSmrg# implement the --enable-static flag, and support the `static' and
82108bd17e5fSmrg# `disable-static' LT_INIT options.
82118bd17e5fSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
82128bd17e5fSmrgm4_define([_LT_ENABLE_STATIC],
82138bd17e5fSmrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
82148bd17e5fSmrgAC_ARG_ENABLE([static],
82158bd17e5fSmrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
82168bd17e5fSmrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
82178bd17e5fSmrg    [p=${PACKAGE-default}
82188bd17e5fSmrg    case $enableval in
82198bd17e5fSmrg    yes) enable_static=yes ;;
82208bd17e5fSmrg    no) enable_static=no ;;
82218bd17e5fSmrg    *)
82228bd17e5fSmrg     enable_static=no
82238bd17e5fSmrg      # Look at the argument we got.  We use all the common list separators.
82248bd17e5fSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
82258bd17e5fSmrg      for pkg in $enableval; do
82268bd17e5fSmrg	IFS="$lt_save_ifs"
82278bd17e5fSmrg	if test "X$pkg" = "X$p"; then
82288bd17e5fSmrg	  enable_static=yes
82298bd17e5fSmrg	fi
82308bd17e5fSmrg      done
82318bd17e5fSmrg      IFS="$lt_save_ifs"
82328bd17e5fSmrg      ;;
82338bd17e5fSmrg    esac],
82348bd17e5fSmrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
82358c4a8e55Smrg
82368bd17e5fSmrg    _LT_DECL([build_old_libs], [enable_static], [0],
82378bd17e5fSmrg	[Whether or not to build static libraries])
82388bd17e5fSmrg])# _LT_ENABLE_STATIC
82398c4a8e55Smrg
82408bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
82418bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
8242b042e37fSmrg
82438bd17e5fSmrg# Old names:
82448bd17e5fSmrgAC_DEFUN([AC_ENABLE_STATIC],
82458bd17e5fSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
82468bd17e5fSmrg])
82478c4a8e55Smrg
82488bd17e5fSmrgAC_DEFUN([AC_DISABLE_STATIC],
82498bd17e5fSmrg[_LT_SET_OPTION([LT_INIT], [disable-static])
82508bd17e5fSmrg])
8251706b6b52Smrg
82528bd17e5fSmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
82538bd17e5fSmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
82548c4a8e55Smrg
825567594505Smrgdnl aclocal-1.4 backwards compatibility:
825667594505Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
825767594505Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
825867594505Smrg
825967594505Smrg
826067594505Smrg
826167594505Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
826267594505Smrg# ----------------------------------
826367594505Smrg# implement the --enable-fast-install flag, and support the `fast-install'
826467594505Smrg# and `disable-fast-install' LT_INIT options.
826567594505Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
826667594505Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
826767594505Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
826867594505SmrgAC_ARG_ENABLE([fast-install],
826967594505Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
827067594505Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
827167594505Smrg    [p=${PACKAGE-default}
827267594505Smrg    case $enableval in
827367594505Smrg    yes) enable_fast_install=yes ;;
827467594505Smrg    no) enable_fast_install=no ;;
827567594505Smrg    *)
827667594505Smrg      enable_fast_install=no
827767594505Smrg      # Look at the argument we got.  We use all the common list separators.
827867594505Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
827967594505Smrg      for pkg in $enableval; do
828067594505Smrg	IFS="$lt_save_ifs"
828167594505Smrg	if test "X$pkg" = "X$p"; then
828267594505Smrg	  enable_fast_install=yes
828367594505Smrg	fi
828467594505Smrg      done
828567594505Smrg      IFS="$lt_save_ifs"
828667594505Smrg      ;;
828767594505Smrg    esac],
828867594505Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
828967594505Smrg
829067594505Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
829167594505Smrg	 [Whether or not to optimize for fast installation])dnl
829267594505Smrg])# _LT_ENABLE_FAST_INSTALL
829367594505Smrg
829467594505SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
829567594505SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
829667594505Smrg
829767594505Smrg# Old names:
829867594505SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
829967594505Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
830067594505SmrgAC_DIAGNOSE([obsolete],
830167594505Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
830267594505Smrgthe `fast-install' option into LT_INIT's first parameter.])
830367594505Smrg])
830467594505Smrg
830567594505SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
830667594505Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
830767594505SmrgAC_DIAGNOSE([obsolete],
830867594505Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
830967594505Smrgthe `disable-fast-install' option into LT_INIT's first parameter.])
831067594505Smrg])
831167594505Smrg
831267594505Smrgdnl aclocal-1.4 backwards compatibility:
831367594505Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
831467594505Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
831567594505Smrg
831667594505Smrg
831767594505Smrg# _LT_WITH_PIC([MODE])
831867594505Smrg# --------------------
831967594505Smrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
832067594505Smrg# LT_INIT options.
832167594505Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
832267594505Smrgm4_define([_LT_WITH_PIC],
832367594505Smrg[AC_ARG_WITH([pic],
832467594505Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
832567594505Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
832667594505Smrg    [lt_p=${PACKAGE-default}
832767594505Smrg    case $withval in
832867594505Smrg    yes|no) pic_mode=$withval ;;
832967594505Smrg    *)
833067594505Smrg      pic_mode=default
833167594505Smrg      # Look at the argument we got.  We use all the common list separators.
833267594505Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
833367594505Smrg      for lt_pkg in $withval; do
833467594505Smrg	IFS="$lt_save_ifs"
833567594505Smrg	if test "X$lt_pkg" = "X$lt_p"; then
833667594505Smrg	  pic_mode=yes
833767594505Smrg	fi
833867594505Smrg      done
833967594505Smrg      IFS="$lt_save_ifs"
834067594505Smrg      ;;
834167594505Smrg    esac],
834267594505Smrg    [pic_mode=default])
834367594505Smrg
834467594505Smrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
834567594505Smrg
834667594505Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
834767594505Smrg])# _LT_WITH_PIC
834867594505Smrg
834967594505SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
835067594505SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
835167594505Smrg
835267594505Smrg# Old name:
835367594505SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
835467594505Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
835567594505SmrgAC_DIAGNOSE([obsolete],
835667594505Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
835767594505Smrgput the `pic-only' option into LT_INIT's first parameter.])
835867594505Smrg])
835967594505Smrg
836067594505Smrgdnl aclocal-1.4 backwards compatibility:
836167594505Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
836267594505Smrg
836367594505Smrg
836467594505Smrgm4_define([_LTDL_MODE], [])
836567594505SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
836667594505Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
836767594505SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
836867594505Smrg		 [m4_define([_LTDL_MODE], [recursive])])
836967594505SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
837067594505Smrg		 [m4_define([_LTDL_MODE], [subproject])])
837167594505Smrg
837267594505Smrgm4_define([_LTDL_TYPE], [])
837367594505SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
837467594505Smrg		 [m4_define([_LTDL_TYPE], [installable])])
837567594505SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
837667594505Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
837767594505Smrg
837867594505Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
837967594505Smrg#
838067594505Smrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
838167594505Smrg# Written by Gary V. Vaughan, 2004
838267594505Smrg#
838367594505Smrg# This file is free software; the Free Software Foundation gives
838467594505Smrg# unlimited permission to copy and/or distribute it, with or without
838567594505Smrg# modifications, as long as this notice is preserved.
838667594505Smrg
838767594505Smrg# serial 6 ltsugar.m4
838867594505Smrg
838967594505Smrg# This is to help aclocal find these macros, as it can't see m4_define.
839067594505SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
839167594505Smrg
839267594505Smrg
839367594505Smrg# lt_join(SEP, ARG1, [ARG2...])
839467594505Smrg# -----------------------------
839567594505Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
839667594505Smrg# associated separator.
839767594505Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
839867594505Smrg# versions in m4sugar had bugs.
839967594505Smrgm4_define([lt_join],
840067594505Smrg[m4_if([$#], [1], [],
840167594505Smrg       [$#], [2], [[$2]],
840267594505Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
840367594505Smrgm4_define([_lt_join],
840467594505Smrg[m4_if([$#$2], [2], [],
840567594505Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
840667594505Smrg
840767594505Smrg
840867594505Smrg# lt_car(LIST)
840967594505Smrg# lt_cdr(LIST)
841067594505Smrg# ------------
841167594505Smrg# Manipulate m4 lists.
841267594505Smrg# These macros are necessary as long as will still need to support
841367594505Smrg# Autoconf-2.59 which quotes differently.
841467594505Smrgm4_define([lt_car], [[$1]])
841567594505Smrgm4_define([lt_cdr],
841667594505Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
841767594505Smrg       [$#], 1, [],
841867594505Smrg       [m4_dquote(m4_shift($@))])])
841967594505Smrgm4_define([lt_unquote], $1)
842067594505Smrg
842167594505Smrg
842267594505Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
842367594505Smrg# ------------------------------------------
842467594505Smrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
842567594505Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
842667594505Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
842767594505Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
842867594505Smrg# than defined and empty).
842967594505Smrg#
843067594505Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
843167594505Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
843267594505Smrgm4_define([lt_append],
843367594505Smrg[m4_define([$1],
843467594505Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
843567594505Smrg
843667594505Smrg
843767594505Smrg
843867594505Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
843967594505Smrg# ----------------------------------------------------------
844067594505Smrg# Produce a SEP delimited list of all paired combinations of elements of
844167594505Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
844267594505Smrg# has the form PREFIXmINFIXSUFFIXn.
844367594505Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
844467594505Smrgm4_define([lt_combine],
844567594505Smrg[m4_if(m4_eval([$# > 3]), [1],
844667594505Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
844767594505Smrg[[m4_foreach([_Lt_prefix], [$2],
844867594505Smrg	     [m4_foreach([_Lt_suffix],
844967594505Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
845067594505Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
845167594505Smrg
845267594505Smrg
845367594505Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
845467594505Smrg# -----------------------------------------------------------------------
845567594505Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
845667594505Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
845767594505Smrgm4_define([lt_if_append_uniq],
845867594505Smrg[m4_ifdef([$1],
845967594505Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
846067594505Smrg		 [lt_append([$1], [$2], [$3])$4],
846167594505Smrg		 [$5])],
846267594505Smrg	  [lt_append([$1], [$2], [$3])$4])])
846367594505Smrg
846467594505Smrg
846567594505Smrg# lt_dict_add(DICT, KEY, VALUE)
846667594505Smrg# -----------------------------
846767594505Smrgm4_define([lt_dict_add],
846867594505Smrg[m4_define([$1($2)], [$3])])
846967594505Smrg
847067594505Smrg
847167594505Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
847267594505Smrg# --------------------------------------------
847367594505Smrgm4_define([lt_dict_add_subkey],
847467594505Smrg[m4_define([$1($2:$3)], [$4])])
847567594505Smrg
847667594505Smrg
847767594505Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
847867594505Smrg# ----------------------------------
847967594505Smrgm4_define([lt_dict_fetch],
848067594505Smrg[m4_ifval([$3],
848167594505Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
848267594505Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
848367594505Smrg
848467594505Smrg
848567594505Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
848667594505Smrg# -----------------------------------------------------------------
848767594505Smrgm4_define([lt_if_dict_fetch],
848867594505Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
848967594505Smrg	[$5],
849067594505Smrg    [$6])])
849167594505Smrg
84920597fb56Smrg
849367594505Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
849467594505Smrg# --------------------------------------------------------------
849567594505Smrgm4_define([lt_dict_filter],
849667594505Smrg[m4_if([$5], [], [],
849767594505Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
849867594505Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
849967594505Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
850067594505Smrg])
85010597fb56Smrg
850267594505Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
850367594505Smrg#
850467594505Smrg#   Copyright (C) 2004 Free Software Foundation, Inc.
850567594505Smrg#   Written by Scott James Remnant, 2004
850667594505Smrg#
850767594505Smrg# This file is free software; the Free Software Foundation gives
850867594505Smrg# unlimited permission to copy and/or distribute it, with or without
850967594505Smrg# modifications, as long as this notice is preserved.
85100597fb56Smrg
851167594505Smrg# @configure_input@
85128c4a8e55Smrg
851367594505Smrg# serial 3337 ltversion.m4
851467594505Smrg# This file is part of GNU Libtool
85158c4a8e55Smrg
851667594505Smrgm4_define([LT_PACKAGE_VERSION], [2.4.2])
851767594505Smrgm4_define([LT_PACKAGE_REVISION], [1.3337])
85188c4a8e55Smrg
851967594505SmrgAC_DEFUN([LTVERSION_VERSION],
852067594505Smrg[macro_version='2.4.2'
852167594505Smrgmacro_revision='1.3337'
852267594505Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
852367594505Smrg_LT_DECL(, macro_revision, 0)
85248bd17e5fSmrg])
85258c4a8e55Smrg
852667594505Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
852767594505Smrg#
852867594505Smrg#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
852967594505Smrg#   Written by Scott James Remnant, 2004.
853067594505Smrg#
853167594505Smrg# This file is free software; the Free Software Foundation gives
853267594505Smrg# unlimited permission to copy and/or distribute it, with or without
853367594505Smrg# modifications, as long as this notice is preserved.
85348c4a8e55Smrg
853567594505Smrg# serial 5 lt~obsolete.m4
85368c4a8e55Smrg
853767594505Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
853867594505Smrg#
853967594505Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
854067594505Smrg# which have later been changed to m4_define as they aren't part of the
854167594505Smrg# exported API, or moved to Autoconf or Automake where they belong.
854267594505Smrg#
854367594505Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
854467594505Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
854567594505Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
854667594505Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
854767594505Smrg# and doesn't know about Autoconf macros at all.)
854867594505Smrg#
854967594505Smrg# So we provide this file, which has a silly filename so it's always
855067594505Smrg# included after everything else.  This provides aclocal with the
855167594505Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
855267594505Smrg# because those macros already exist, or will be overwritten later.
855367594505Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
855467594505Smrg#
855567594505Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
855667594505Smrg# Yes, that means every name once taken will need to remain here until
855767594505Smrg# we give up compatibility with versions before 1.7, at which point
855867594505Smrg# we need to keep only those names which we still refer to.
85598c4a8e55Smrg
856067594505Smrg# This is to help aclocal find these macros, as it can't see m4_define.
856167594505SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
85628bd17e5fSmrg
856367594505Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
856467594505Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
856567594505Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
856667594505Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
856767594505Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
856867594505Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
856967594505Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
857067594505Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
857167594505Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
857267594505Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
857367594505Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
857467594505Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
857567594505Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
857667594505Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
857767594505Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
857867594505Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
857967594505Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
858067594505Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
858167594505Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
858267594505Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
858367594505Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
858467594505Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
858567594505Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
858667594505Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
858767594505Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
858867594505Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
858967594505Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
859067594505Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
859167594505Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
859267594505Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
859367594505Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
859467594505Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
859567594505Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
859667594505Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
859767594505Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
859867594505Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
859967594505Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
860067594505Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
860167594505Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
860267594505Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
860367594505Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
860467594505Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
860567594505Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
860667594505Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
860767594505Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
860867594505Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
860967594505Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
861067594505Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
861167594505Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
861267594505Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
861367594505Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
861467594505Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
861567594505Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
861667594505Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
861767594505Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
861867594505Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
861967594505Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
862067594505Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
862167594505Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
862267594505Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
862367594505Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
86248bd17e5fSmrg
862567594505Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
862667594505Smrg# serial 1 (pkg-config-0.24)
862767594505Smrg# 
862867594505Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
862967594505Smrg#
863067594505Smrg# This program is free software; you can redistribute it and/or modify
863167594505Smrg# it under the terms of the GNU General Public License as published by
863267594505Smrg# the Free Software Foundation; either version 2 of the License, or
863367594505Smrg# (at your option) any later version.
863467594505Smrg#
863567594505Smrg# This program is distributed in the hope that it will be useful, but
863667594505Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
863767594505Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
863867594505Smrg# General Public License for more details.
863967594505Smrg#
864067594505Smrg# You should have received a copy of the GNU General Public License
864167594505Smrg# along with this program; if not, write to the Free Software
864267594505Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
864367594505Smrg#
864467594505Smrg# As a special exception to the GNU General Public License, if you
864567594505Smrg# distribute this file as part of a program that contains a
864667594505Smrg# configuration script generated by Autoconf, you may include it under
864767594505Smrg# the same distribution terms that you use for the rest of that program.
86488c4a8e55Smrg
864967594505Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
865067594505Smrg# ----------------------------------
865167594505SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
865267594505Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
865367594505Smrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
865467594505Smrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
865567594505SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
865667594505SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
865767594505SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
86588c4a8e55Smrg
865967594505Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
866067594505Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
866167594505Smrgfi
866267594505Smrgif test -n "$PKG_CONFIG"; then
866367594505Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
866467594505Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
866567594505Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
866667594505Smrg		AC_MSG_RESULT([yes])
866767594505Smrg	else
866867594505Smrg		AC_MSG_RESULT([no])
866967594505Smrg		PKG_CONFIG=""
867067594505Smrg	fi
867167594505Smrgfi[]dnl
867267594505Smrg])# PKG_PROG_PKG_CONFIG
86738bd17e5fSmrg
867467594505Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
867567594505Smrg#
867667594505Smrg# Check to see whether a particular set of modules exists.  Similar
867767594505Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
867867594505Smrg#
867967594505Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
868067594505Smrg# only at the first occurence in configure.ac, so if the first place
868167594505Smrg# it's called might be skipped (such as if it is within an "if", you
868267594505Smrg# have to call PKG_CHECK_EXISTS manually
868367594505Smrg# --------------------------------------------------------------
868467594505SmrgAC_DEFUN([PKG_CHECK_EXISTS],
868567594505Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
868667594505Smrgif test -n "$PKG_CONFIG" && \
868767594505Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
868867594505Smrg  m4_default([$2], [:])
868967594505Smrgm4_ifvaln([$3], [else
869067594505Smrg  $3])dnl
869167594505Smrgfi])
86928bd17e5fSmrg
869367594505Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
869467594505Smrg# ---------------------------------------------
869567594505Smrgm4_define([_PKG_CONFIG],
869667594505Smrg[if test -n "$$1"; then
869767594505Smrg    pkg_cv_[]$1="$$1"
869867594505Smrg elif test -n "$PKG_CONFIG"; then
869967594505Smrg    PKG_CHECK_EXISTS([$3],
870067594505Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
870167594505Smrg		      test "x$?" != "x0" && pkg_failed=yes ],
870267594505Smrg		     [pkg_failed=yes])
870367594505Smrg else
870467594505Smrg    pkg_failed=untried
870567594505Smrgfi[]dnl
870667594505Smrg])# _PKG_CONFIG
87078bd17e5fSmrg
870867594505Smrg# _PKG_SHORT_ERRORS_SUPPORTED
870967594505Smrg# -----------------------------
871067594505SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
871167594505Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
871267594505Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
871367594505Smrg        _pkg_short_errors_supported=yes
871467594505Smrgelse
871567594505Smrg        _pkg_short_errors_supported=no
871667594505Smrgfi[]dnl
871767594505Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
87188bd17e5fSmrg
87198bd17e5fSmrg
872067594505Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
872167594505Smrg# [ACTION-IF-NOT-FOUND])
87220597fb56Smrg#
87230597fb56Smrg#
872467594505Smrg# Note that if there is a possibility the first call to
872567594505Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
872667594505Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
872767594505Smrg#
872867594505Smrg#
872967594505Smrg# --------------------------------------------------------------
873067594505SmrgAC_DEFUN([PKG_CHECK_MODULES],
873167594505Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
873267594505SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
873367594505SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
87348bd17e5fSmrg
873567594505Smrgpkg_failed=no
873667594505SmrgAC_MSG_CHECKING([for $1])
87378bd17e5fSmrg
873867594505Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
873967594505Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
87408bd17e5fSmrg
874167594505Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
874267594505Smrgand $1[]_LIBS to avoid the need to call pkg-config.
874367594505SmrgSee the pkg-config man page for more details.])
87448bd17e5fSmrg
874567594505Smrgif test $pkg_failed = yes; then
874667594505Smrg   	AC_MSG_RESULT([no])
874767594505Smrg        _PKG_SHORT_ERRORS_SUPPORTED
874867594505Smrg        if test $_pkg_short_errors_supported = yes; then
874967594505Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
875067594505Smrg        else 
875167594505Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
875267594505Smrg        fi
875367594505Smrg	# Put the nasty error message in config.log where it belongs
875467594505Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
87558bd17e5fSmrg
875667594505Smrg	m4_default([$4], [AC_MSG_ERROR(
875767594505Smrg[Package requirements ($2) were not met:
87588bd17e5fSmrg
875967594505Smrg$$1_PKG_ERRORS
87608bd17e5fSmrg
876167594505SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
876267594505Smrginstalled software in a non-standard prefix.
87638bd17e5fSmrg
876467594505Smrg_PKG_TEXT])[]dnl
876567594505Smrg        ])
876667594505Smrgelif test $pkg_failed = untried; then
876767594505Smrg     	AC_MSG_RESULT([no])
876867594505Smrg	m4_default([$4], [AC_MSG_FAILURE(
876967594505Smrg[The pkg-config script could not be found or is too old.  Make sure it
877067594505Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
877167594505Smrgpath to pkg-config.
877267594505Smrg
877367594505Smrg_PKG_TEXT
87748c4a8e55Smrg
877567594505SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
877667594505Smrg        ])
877767594505Smrgelse
877867594505Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
877967594505Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
878067594505Smrg        AC_MSG_RESULT([yes])
878167594505Smrg	$3
878267594505Smrgfi[]dnl
878367594505Smrg])# PKG_CHECK_MODULES
87848c4a8e55Smrg
8785b242714cSmrg# Copyright (C) 2002-2013 Free Software Foundation, Inc.
8786b242714cSmrg#
8787b242714cSmrg# This file is free software; the Free Software Foundation
8788b242714cSmrg# gives unlimited permission to copy and/or distribute it,
8789b242714cSmrg# with or without modifications, as long as this notice is preserved.
87908c4a8e55Smrg
8791b242714cSmrg# AM_AUTOMAKE_VERSION(VERSION)
8792b242714cSmrg# ----------------------------
8793b242714cSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
8794b242714cSmrg# generated from the m4 files accompanying Automake X.Y.
8795b242714cSmrg# (This private macro should not be called outside this file.)
8796b242714cSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
8797b242714cSmrg[am__api_version='1.14'
8798b242714cSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
8799b242714cSmrgdnl require some minimum version.  Point them to the right macro.
8800b242714cSmrgm4_if([$1], [1.14.1], [],
8801b242714cSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
8802b242714cSmrg])
88038c4a8e55Smrg
8804b242714cSmrg# _AM_AUTOCONF_VERSION(VERSION)
8805b242714cSmrg# -----------------------------
8806b242714cSmrg# aclocal traces this macro to find the Autoconf version.
8807b242714cSmrg# This is a private macro too.  Using m4_define simplifies
8808b242714cSmrg# the logic in aclocal, which can simply ignore this definition.
8809b242714cSmrgm4_define([_AM_AUTOCONF_VERSION], [])
88108c4a8e55Smrg
8811b242714cSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
8812b242714cSmrg# -------------------------------
8813b242714cSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
8814b242714cSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
8815b242714cSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
8816b242714cSmrg[AM_AUTOMAKE_VERSION([1.14.1])dnl
8817b242714cSmrgm4_ifndef([AC_AUTOCONF_VERSION],
8818b242714cSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
8819b242714cSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
88208c4a8e55Smrg
8821b242714cSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
88228c4a8e55Smrg
8823b242714cSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
882467594505Smrg#
8825b242714cSmrg# This file is free software; the Free Software Foundation
8826b242714cSmrg# gives unlimited permission to copy and/or distribute it,
8827b242714cSmrg# with or without modifications, as long as this notice is preserved.
8828b242714cSmrg
8829b242714cSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
8830b242714cSmrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
8831b242714cSmrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
883267594505Smrg#
8833b242714cSmrg# Of course, Automake must honor this variable whenever it calls a
8834b242714cSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
8835b242714cSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
8836b242714cSmrg# depending on how configure is run.  This is pretty annoying, since
8837b242714cSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
8838b242714cSmrg# source directory, any form will work fine, but in subdirectories a
8839b242714cSmrg# relative path needs to be adjusted first.
884067594505Smrg#
8841b242714cSmrg# $ac_aux_dir/missing
8842b242714cSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
8843b242714cSmrg# $top_srcdir/$ac_aux_dir/missing
8844b242714cSmrg#    fails if $ac_aux_dir is absolute,
8845b242714cSmrg#    fails when called from a subdirectory in a VPATH build with
8846b242714cSmrg#          a relative $ac_aux_dir
884767594505Smrg#
8848b242714cSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
8849b242714cSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
8850b242714cSmrg# harmless because $srcdir is '.', but things will broke when you
8851b242714cSmrg# start a VPATH build or use an absolute $srcdir.
885267594505Smrg#
8853b242714cSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
8854b242714cSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
8855b242714cSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
8856b242714cSmrg# and then we would define $MISSING as
8857b242714cSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
8858b242714cSmrg# This will work as long as MISSING is not called from configure, because
8859b242714cSmrg# unfortunately $(top_srcdir) has no meaning in configure.
8860b242714cSmrg# However there are other variables, like CC, which are often used in
8861b242714cSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
8862b242714cSmrg#
8863b242714cSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
8864b242714cSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
8865b242714cSmrg# configured tree to be moved without reconfiguration.
88668c4a8e55Smrg
8867b242714cSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
8868b242714cSmrg[dnl Rely on autoconf to set up CDPATH properly.
8869b242714cSmrgAC_PREREQ([2.50])dnl
8870b242714cSmrg# expand $ac_aux_dir to an absolute path
8871b242714cSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
8872b242714cSmrg])
88730597fb56Smrg
8874b242714cSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
8875b242714cSmrg
8876b242714cSmrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
8877b242714cSmrg#
8878b242714cSmrg# This file is free software; the Free Software Foundation
8879b242714cSmrg# gives unlimited permission to copy and/or distribute it,
8880b242714cSmrg# with or without modifications, as long as this notice is preserved.
8881b242714cSmrg
8882b242714cSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
8883b242714cSmrg# -------------------------------------
8884b242714cSmrg# Define a conditional.
8885b242714cSmrgAC_DEFUN([AM_CONDITIONAL],
8886b242714cSmrg[AC_PREREQ([2.52])dnl
8887b242714cSmrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
8888b242714cSmrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
8889b242714cSmrgAC_SUBST([$1_TRUE])dnl
8890b242714cSmrgAC_SUBST([$1_FALSE])dnl
8891b242714cSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
8892b242714cSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
8893b242714cSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
8894b242714cSmrgif $2; then
8895b242714cSmrg  $1_TRUE=
8896b242714cSmrg  $1_FALSE='#'
889767594505Smrgelse
8898b242714cSmrg  $1_TRUE='#'
8899b242714cSmrg  $1_FALSE=
890067594505Smrgfi
8901b242714cSmrgAC_CONFIG_COMMANDS_PRE(
8902b242714cSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
8903b242714cSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
8904b242714cSmrgUsually this means the macro was only invoked conditionally.]])
8905b242714cSmrgfi])])
89068c4a8e55Smrg
8907b242714cSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
890867594505Smrg#
8909b242714cSmrg# This file is free software; the Free Software Foundation
8910b242714cSmrg# gives unlimited permission to copy and/or distribute it,
8911b242714cSmrg# with or without modifications, as long as this notice is preserved.
89128c4a8e55Smrg
89138bd17e5fSmrg
8914b242714cSmrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
8915b242714cSmrg# written in clear, in which case automake, when reading aclocal.m4,
8916b242714cSmrg# will think it sees a *use*, and therefore will trigger all it's
8917b242714cSmrg# C support machinery.  Also note that it means that autoscan, seeing
8918b242714cSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
89198c4a8e55Smrg
89208c4a8e55Smrg
8921b242714cSmrg# _AM_DEPENDENCIES(NAME)
8922b242714cSmrg# ----------------------
8923b242714cSmrg# See how the compiler implements dependency checking.
8924b242714cSmrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
8925b242714cSmrg# We try a few techniques and use that to set a single cache variable.
8926b242714cSmrg#
8927b242714cSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
8928b242714cSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
8929b242714cSmrg# dependency, and given that the user is not expected to run this macro,
8930b242714cSmrg# just rely on AC_PROG_CC.
8931b242714cSmrgAC_DEFUN([_AM_DEPENDENCIES],
8932b242714cSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
8933b242714cSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
8934b242714cSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
8935b242714cSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
89368c4a8e55Smrg
8937b242714cSmrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
8938b242714cSmrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
8939b242714cSmrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
8940b242714cSmrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
8941b242714cSmrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
8942b242714cSmrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
8943b242714cSmrg                    [depcc="$$1"   am_compiler_list=])
8944706b6b52Smrg
8945b242714cSmrgAC_CACHE_CHECK([dependency style of $depcc],
8946b242714cSmrg               [am_cv_$1_dependencies_compiler_type],
8947b242714cSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
8948b242714cSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
8949b242714cSmrg  # making bogus files that we don't know about and never remove.  For
8950b242714cSmrg  # instance it was reported that on HP-UX the gcc test will end up
8951b242714cSmrg  # making a dummy file named 'D' -- because '-MD' means "put the output
8952b242714cSmrg  # in D".
8953b242714cSmrg  rm -rf conftest.dir
8954b242714cSmrg  mkdir conftest.dir
8955b242714cSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
8956b242714cSmrg  # using a relative directory.
8957b242714cSmrg  cp "$am_depcomp" conftest.dir
8958b242714cSmrg  cd conftest.dir
8959b242714cSmrg  # We will build objects and dependencies in a subdirectory because
8960b242714cSmrg  # it helps to detect inapplicable dependency modes.  For instance
8961b242714cSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
8962b242714cSmrg  # side effect of compilation, but ICC will put the dependencies in
8963b242714cSmrg  # the current directory while Tru64 will put them in the object
8964b242714cSmrg  # directory.
8965b242714cSmrg  mkdir sub
8966706b6b52Smrg
8967b242714cSmrg  am_cv_$1_dependencies_compiler_type=none
8968b242714cSmrg  if test "$am_compiler_list" = ""; then
8969b242714cSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
8970b242714cSmrg  fi
8971b242714cSmrg  am__universal=false
8972b242714cSmrg  m4_case([$1], [CC],
8973b242714cSmrg    [case " $depcc " in #(
8974b242714cSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
8975b242714cSmrg     esac],
8976b242714cSmrg    [CXX],
8977b242714cSmrg    [case " $depcc " in #(
8978b242714cSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
8979b242714cSmrg     esac])
89808bd17e5fSmrg
8981b242714cSmrg  for depmode in $am_compiler_list; do
8982b242714cSmrg    # Setup a source with many dependencies, because some compilers
8983b242714cSmrg    # like to wrap large dependency lists on column 80 (with \), and
8984b242714cSmrg    # we should not choose a depcomp mode which is confused by this.
8985b242714cSmrg    #
8986b242714cSmrg    # We need to recreate these files for each test, as the compiler may
8987b242714cSmrg    # overwrite some of them when testing with obscure command lines.
8988b242714cSmrg    # This happens at least with the AIX C compiler.
8989b242714cSmrg    : > sub/conftest.c
8990b242714cSmrg    for i in 1 2 3 4 5 6; do
8991b242714cSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
8992b242714cSmrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
8993b242714cSmrg      # Solaris 10 /bin/sh.
8994b242714cSmrg      echo '/* dummy */' > sub/conftst$i.h
8995b242714cSmrg    done
8996b242714cSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
89978bd17e5fSmrg
8998b242714cSmrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
8999b242714cSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
9000b242714cSmrg    # handle '-M -o', and we need to detect this.  Also, some Intel
9001b242714cSmrg    # versions had trouble with output in subdirs.
9002b242714cSmrg    am__obj=sub/conftest.${OBJEXT-o}
9003b242714cSmrg    am__minus_obj="-o $am__obj"
9004b242714cSmrg    case $depmode in
9005b242714cSmrg    gcc)
9006b242714cSmrg      # This depmode causes a compiler race in universal mode.
9007b242714cSmrg      test "$am__universal" = false || continue
9008b242714cSmrg      ;;
9009b242714cSmrg    nosideeffect)
9010b242714cSmrg      # After this tag, mechanisms are not by side-effect, so they'll
9011b242714cSmrg      # only be used when explicitly requested.
9012b242714cSmrg      if test "x$enable_dependency_tracking" = xyes; then
9013b242714cSmrg	continue
9014b242714cSmrg      else
9015b242714cSmrg	break
9016b242714cSmrg      fi
9017b242714cSmrg      ;;
9018b242714cSmrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
9019b242714cSmrg      # This compiler won't grok '-c -o', but also, the minuso test has
9020b242714cSmrg      # not run yet.  These depmodes are late enough in the game, and
9021b242714cSmrg      # so weak that their functioning should not be impacted.
9022b242714cSmrg      am__obj=conftest.${OBJEXT-o}
9023b242714cSmrg      am__minus_obj=
9024b242714cSmrg      ;;
9025b242714cSmrg    none) break ;;
9026b242714cSmrg    esac
9027b242714cSmrg    if depmode=$depmode \
9028b242714cSmrg       source=sub/conftest.c object=$am__obj \
9029b242714cSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
9030b242714cSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
9031b242714cSmrg         >/dev/null 2>conftest.err &&
9032b242714cSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
9033b242714cSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
9034b242714cSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
9035b242714cSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
9036b242714cSmrg      # icc doesn't choke on unknown options, it will just issue warnings
9037b242714cSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
9038b242714cSmrg      # that says an option was ignored or not supported.
9039b242714cSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
9040b242714cSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
9041b242714cSmrg      # The diagnosis changed in icc 8.0:
9042b242714cSmrg      #   icc: Command line remark: option '-MP' not supported
9043b242714cSmrg      if (grep 'ignoring option' conftest.err ||
9044b242714cSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
9045b242714cSmrg        am_cv_$1_dependencies_compiler_type=$depmode
9046b242714cSmrg        break
9047b242714cSmrg      fi
9048b242714cSmrg    fi
9049b242714cSmrg  done
90508bd17e5fSmrg
9051b242714cSmrg  cd ..
9052b242714cSmrg  rm -rf conftest.dir
905367594505Smrgelse
9054b242714cSmrg  am_cv_$1_dependencies_compiler_type=none
905567594505Smrgfi
9056b242714cSmrg])
9057b242714cSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
9058b242714cSmrgAM_CONDITIONAL([am__fastdep$1], [
9059b242714cSmrg  test "x$enable_dependency_tracking" != xno \
9060b242714cSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
9061b242714cSmrg])
90628bd17e5fSmrg
90638bd17e5fSmrg
9064b242714cSmrg# AM_SET_DEPDIR
9065b242714cSmrg# -------------
9066b242714cSmrg# Choose a directory name for dependency files.
9067b242714cSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
9068b242714cSmrgAC_DEFUN([AM_SET_DEPDIR],
9069b242714cSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
9070b242714cSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
9071b242714cSmrg])
907267594505Smrg
907367594505Smrg
9074b242714cSmrg# AM_DEP_TRACK
9075b242714cSmrg# ------------
9076b242714cSmrgAC_DEFUN([AM_DEP_TRACK],
9077b242714cSmrg[AC_ARG_ENABLE([dependency-tracking], [dnl
9078b242714cSmrgAS_HELP_STRING(
9079b242714cSmrg  [--enable-dependency-tracking],
9080b242714cSmrg  [do not reject slow dependency extractors])
9081b242714cSmrgAS_HELP_STRING(
9082b242714cSmrg  [--disable-dependency-tracking],
9083b242714cSmrg  [speeds up one-time build])])
9084b242714cSmrgif test "x$enable_dependency_tracking" != xno; then
9085b242714cSmrg  am_depcomp="$ac_aux_dir/depcomp"
9086b242714cSmrg  AMDEPBACKSLASH='\'
9087b242714cSmrg  am__nodep='_no'
9088706b6b52Smrgfi
9089b242714cSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
9090b242714cSmrgAC_SUBST([AMDEPBACKSLASH])dnl
9091b242714cSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
9092b242714cSmrgAC_SUBST([am__nodep])dnl
9093b242714cSmrg_AM_SUBST_NOTMAKE([am__nodep])dnl
9094b242714cSmrg])
90958c4a8e55Smrg
9096b242714cSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
90978c4a8e55Smrg
9098b242714cSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
9099b242714cSmrg#
9100b242714cSmrg# This file is free software; the Free Software Foundation
9101b242714cSmrg# gives unlimited permission to copy and/or distribute it,
9102b242714cSmrg# with or without modifications, as long as this notice is preserved.
91038c4a8e55Smrg
91048c4a8e55Smrg
9105b242714cSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
9106b242714cSmrg# ------------------------------
9107b242714cSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
9108b242714cSmrg[{
9109b242714cSmrg  # Older Autoconf quotes --file arguments for eval, but not when files
9110b242714cSmrg  # are listed without --file.  Let's play safe and only enable the eval
9111b242714cSmrg  # if we detect the quoting.
9112b242714cSmrg  case $CONFIG_FILES in
9113b242714cSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
9114b242714cSmrg  *)   set x $CONFIG_FILES ;;
9115b242714cSmrg  esac
9116b242714cSmrg  shift
9117b242714cSmrg  for mf
9118b242714cSmrg  do
9119b242714cSmrg    # Strip MF so we end up with the name of the file.
9120b242714cSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
9121b242714cSmrg    # Check whether this is an Automake generated Makefile or not.
9122b242714cSmrg    # We used to match only the files named 'Makefile.in', but
9123b242714cSmrg    # some people rename them; so instead we look at the file content.
9124b242714cSmrg    # Grep'ing the first line is not enough: some people post-process
9125b242714cSmrg    # each Makefile.in and add a new line on top of each file to say so.
9126b242714cSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
9127b242714cSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
9128b242714cSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
9129b242714cSmrg      dirpart=`AS_DIRNAME("$mf")`
9130b242714cSmrg    else
9131b242714cSmrg      continue
9132b242714cSmrg    fi
9133b242714cSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
9134b242714cSmrg    # from the Makefile without running 'make'.
9135b242714cSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
9136b242714cSmrg    test -z "$DEPDIR" && continue
9137b242714cSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
9138b242714cSmrg    test -z "$am__include" && continue
9139b242714cSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
9140b242714cSmrg    # Find all dependency output files, they are included files with
9141b242714cSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
9142b242714cSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
9143b242714cSmrg    # expansion.
9144b242714cSmrg    for file in `sed -n "
9145b242714cSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
9146b242714cSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
9147b242714cSmrg      # Make sure the directory exists.
9148b242714cSmrg      test -f "$dirpart/$file" && continue
9149b242714cSmrg      fdir=`AS_DIRNAME(["$file"])`
9150b242714cSmrg      AS_MKDIR_P([$dirpart/$fdir])
9151b242714cSmrg      # echo "creating $dirpart/$file"
9152b242714cSmrg      echo '# dummy' > "$dirpart/$file"
9153b242714cSmrg    done
9154b242714cSmrg  done
9155b242714cSmrg}
9156b242714cSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
91578c4a8e55Smrg
91588c4a8e55Smrg
9159b242714cSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
9160b242714cSmrg# -----------------------------
9161b242714cSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
916267594505Smrg#
9163b242714cSmrg# This code is only required when automatic dependency tracking
9164b242714cSmrg# is enabled.  FIXME.  This creates each '.P' file that we will
9165b242714cSmrg# need in order to bootstrap the dependency handling code.
9166b242714cSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
9167b242714cSmrg[AC_CONFIG_COMMANDS([depfiles],
9168b242714cSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
9169b242714cSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
9170b242714cSmrg])
91718c4a8e55Smrg
9172b242714cSmrg# Do all the work for Automake.                             -*- Autoconf -*-
91738c4a8e55Smrg
9174b242714cSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
9175b242714cSmrg#
9176b242714cSmrg# This file is free software; the Free Software Foundation
9177b242714cSmrg# gives unlimited permission to copy and/or distribute it,
9178b242714cSmrg# with or without modifications, as long as this notice is preserved.
91798c4a8e55Smrg
9180b242714cSmrg# This macro actually does too much.  Some checks are only needed if
9181b242714cSmrg# your package does certain things.  But this isn't really a big deal.
91828c4a8e55Smrg
9183b242714cSmrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
9184b242714cSmrgm4_define([AC_PROG_CC],
9185b242714cSmrgm4_defn([AC_PROG_CC])
9186b242714cSmrg[_AM_PROG_CC_C_O
9187b242714cSmrg])
91888c4a8e55Smrg
9189b242714cSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
9190b242714cSmrg# AM_INIT_AUTOMAKE([OPTIONS])
9191b242714cSmrg# -----------------------------------------------
9192b242714cSmrg# The call with PACKAGE and VERSION arguments is the old style
9193b242714cSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
9194b242714cSmrg# and VERSION should now be passed to AC_INIT and removed from
9195b242714cSmrg# the call to AM_INIT_AUTOMAKE.
9196b242714cSmrg# We support both call styles for the transition.  After
9197b242714cSmrg# the next Automake release, Autoconf can make the AC_INIT
9198b242714cSmrg# arguments mandatory, and then we can depend on a new Autoconf
9199b242714cSmrg# release and drop the old call support.
9200b242714cSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
9201b242714cSmrg[AC_PREREQ([2.65])dnl
9202b242714cSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
9203b242714cSmrgdnl the ones we care about.
9204b242714cSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
9205b242714cSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
9206b242714cSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
9207b242714cSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
9208b242714cSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
9209b242714cSmrg  # is not polluted with repeated "-I."
9210b242714cSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
9211b242714cSmrg  # test to see if srcdir already configured
9212b242714cSmrg  if test -f $srcdir/config.status; then
9213b242714cSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
9214b242714cSmrg  fi
921567594505Smrgfi
9216bd23fbfaSmrg
9217b242714cSmrg# test whether we have cygpath
9218b242714cSmrgif test -z "$CYGPATH_W"; then
9219b242714cSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
9220b242714cSmrg    CYGPATH_W='cygpath -w'
9221b242714cSmrg  else
9222b242714cSmrg    CYGPATH_W=echo
9223b242714cSmrg  fi
922467594505Smrgfi
9225b242714cSmrgAC_SUBST([CYGPATH_W])
9226bd23fbfaSmrg
9227b242714cSmrg# Define the identity of the package.
9228b242714cSmrgdnl Distinguish between old-style and new-style calls.
9229b242714cSmrgm4_ifval([$2],
9230b242714cSmrg[AC_DIAGNOSE([obsolete],
9231b242714cSmrg             [$0: two- and three-arguments forms are deprecated.])
9232b242714cSmrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
9233b242714cSmrg AC_SUBST([PACKAGE], [$1])dnl
9234b242714cSmrg AC_SUBST([VERSION], [$2])],
9235b242714cSmrg[_AM_SET_OPTIONS([$1])dnl
9236b242714cSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
9237b242714cSmrgm4_if(
9238b242714cSmrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
9239b242714cSmrg  [ok:ok],,
9240b242714cSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
9241b242714cSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
9242b242714cSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
92438c4a8e55Smrg
9244b242714cSmrg_AM_IF_OPTION([no-define],,
9245b242714cSmrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
9246b242714cSmrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
92478c4a8e55Smrg
9248b242714cSmrg# Some tools Automake needs.
9249b242714cSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
9250b242714cSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
9251b242714cSmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
9252b242714cSmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
9253b242714cSmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
9254b242714cSmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
9255b242714cSmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
9256b242714cSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
9257b242714cSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
9258b242714cSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
9259b242714cSmrg# For better backward compatibility.  To be removed once Automake 1.9.x
9260b242714cSmrg# dies out for good.  For more background, see:
9261b242714cSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
9262b242714cSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
9263b242714cSmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
9264b242714cSmrg# We need awk for the "check" target.  The system "awk" is bad on
9265b242714cSmrg# some platforms.
9266b242714cSmrgAC_REQUIRE([AC_PROG_AWK])dnl
9267b242714cSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
9268b242714cSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
9269b242714cSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
9270b242714cSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
9271b242714cSmrg			     [_AM_PROG_TAR([v7])])])
9272b242714cSmrg_AM_IF_OPTION([no-dependencies],,
9273b242714cSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
9274b242714cSmrg		  [_AM_DEPENDENCIES([CC])],
9275b242714cSmrg		  [m4_define([AC_PROG_CC],
9276b242714cSmrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
9277b242714cSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
9278b242714cSmrg		  [_AM_DEPENDENCIES([CXX])],
9279b242714cSmrg		  [m4_define([AC_PROG_CXX],
9280b242714cSmrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
9281b242714cSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
9282b242714cSmrg		  [_AM_DEPENDENCIES([OBJC])],
9283b242714cSmrg		  [m4_define([AC_PROG_OBJC],
9284b242714cSmrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
9285b242714cSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
9286b242714cSmrg		  [_AM_DEPENDENCIES([OBJCXX])],
9287b242714cSmrg		  [m4_define([AC_PROG_OBJCXX],
9288b242714cSmrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
9289b242714cSmrg])
9290b242714cSmrgAC_REQUIRE([AM_SILENT_RULES])dnl
9291b242714cSmrgdnl The testsuite driver may need to know about EXEEXT, so add the
9292b242714cSmrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
9293b242714cSmrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
9294b242714cSmrgAC_CONFIG_COMMANDS_PRE(dnl
9295b242714cSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
9296b242714cSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
92970597fb56Smrg
9298b242714cSmrg# POSIX will say in a future version that running "rm -f" with no argument
9299b242714cSmrg# is OK; and we want to be able to make that assumption in our Makefile
9300b242714cSmrg# recipes.  So use an aggressive probe to check that the usage we want is
9301b242714cSmrg# actually supported "in the wild" to an acceptable degree.
9302b242714cSmrg# See automake bug#10828.
9303b242714cSmrg# To make any issue more visible, cause the running configure to be aborted
9304b242714cSmrg# by default if the 'rm' program in use doesn't match our expectations; the
9305b242714cSmrg# user can still override this though.
9306b242714cSmrgif rm -f && rm -fr && rm -rf; then : OK; else
9307b242714cSmrg  cat >&2 <<'END'
9308b242714cSmrgOops!
9309b242714cSmrg
9310b242714cSmrgYour 'rm' program seems unable to run without file operands specified
9311b242714cSmrgon the command line, even when the '-f' option is present.  This is contrary
9312b242714cSmrgto the behaviour of most rm programs out there, and not conforming with
9313b242714cSmrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
9314b242714cSmrg
9315b242714cSmrgPlease tell bug-automake@gnu.org about your system, including the value
9316b242714cSmrgof your $PATH and any error possibly output before this message.  This
9317b242714cSmrgcan help us improve future automake versions.
93188c4a8e55Smrg
9319b242714cSmrgEND
9320b242714cSmrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
9321b242714cSmrg    echo 'Configuration will proceed anyway, since you have set the' >&2
9322b242714cSmrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
9323b242714cSmrg    echo >&2
9324b242714cSmrg  else
9325b242714cSmrg    cat >&2 <<'END'
9326b242714cSmrgAborting the configuration process, to ensure you take notice of the issue.
9327b242714cSmrg
9328b242714cSmrgYou can download and install GNU coreutils to get an 'rm' implementation
9329b242714cSmrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
9330b242714cSmrg
9331b242714cSmrgIf you want to complete the configuration process using your problematic
9332b242714cSmrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
9333b242714cSmrgto "yes", and re-run configure.
9334b242714cSmrg
9335b242714cSmrgEND
9336b242714cSmrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
9337b242714cSmrg  fi
933867594505Smrgfi])
93390597fb56Smrg
9340b242714cSmrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
9341b242714cSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
9342b242714cSmrgdnl mangled by Autoconf and run in a shell conditional statement.
9343b242714cSmrgm4_define([_AC_COMPILER_EXEEXT],
9344b242714cSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
93458c4a8e55Smrg
9346b242714cSmrg# When config.status generates a header, we must update the stamp-h file.
9347b242714cSmrg# This file resides in the same directory as the config header
9348b242714cSmrg# that is generated.  The stamp files are numbered to have different names.
9349b242714cSmrg
9350b242714cSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
9351b242714cSmrg# loop where config.status creates the headers, so we can generate
9352b242714cSmrg# our stamp files there.
9353b242714cSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
9354b242714cSmrg[# Compute $1's index in $config_headers.
9355b242714cSmrg_am_arg=$1
9356b242714cSmrg_am_stamp_count=1
9357b242714cSmrgfor _am_header in $config_headers :; do
9358b242714cSmrg  case $_am_header in
9359b242714cSmrg    $_am_arg | $_am_arg:* )
9360b242714cSmrg      break ;;
9361b242714cSmrg    * )
9362b242714cSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
9363b242714cSmrg  esac
9364b242714cSmrgdone
9365b242714cSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
9366b242714cSmrg
9367b242714cSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
936867594505Smrg#
9369b242714cSmrg# This file is free software; the Free Software Foundation
9370b242714cSmrg# gives unlimited permission to copy and/or distribute it,
9371b242714cSmrg# with or without modifications, as long as this notice is preserved.
9372b242714cSmrg
9373b242714cSmrg# AM_PROG_INSTALL_SH
9374b242714cSmrg# ------------------
9375b242714cSmrg# Define $install_sh.
9376b242714cSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
9377b242714cSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
9378b242714cSmrgif test x"${install_sh}" != xset; then
9379b242714cSmrg  case $am_aux_dir in
9380b242714cSmrg  *\ * | *\	*)
9381b242714cSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
9382b242714cSmrg  *)
9383b242714cSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
9384b242714cSmrg  esac
9385b242714cSmrgfi
9386b242714cSmrgAC_SUBST([install_sh])])
9387b242714cSmrg
9388b242714cSmrg# Copyright (C) 2003-2013 Free Software Foundation, Inc.
938967594505Smrg#
9390b242714cSmrg# This file is free software; the Free Software Foundation
9391b242714cSmrg# gives unlimited permission to copy and/or distribute it,
9392b242714cSmrg# with or without modifications, as long as this notice is preserved.
9393706b6b52Smrg
9394b242714cSmrg# Check whether the underlying file-system supports filenames
9395b242714cSmrg# with a leading dot.  For instance MS-DOS doesn't.
9396b242714cSmrgAC_DEFUN([AM_SET_LEADING_DOT],
9397b242714cSmrg[rm -rf .tst 2>/dev/null
9398b242714cSmrgmkdir .tst 2>/dev/null
9399b242714cSmrgif test -d .tst; then
9400b242714cSmrg  am__leading_dot=.
940167594505Smrgelse
9402b242714cSmrg  am__leading_dot=_
94038bd17e5fSmrgfi
9404b242714cSmrgrmdir .tst 2>/dev/null
9405b242714cSmrgAC_SUBST([am__leading_dot])])
94060597fb56Smrg
9407b242714cSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
94080597fb56Smrg
9409b242714cSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
941067594505Smrg#
9411b242714cSmrg# This file is free software; the Free Software Foundation
9412b242714cSmrg# gives unlimited permission to copy and/or distribute it,
9413b242714cSmrg# with or without modifications, as long as this notice is preserved.
94140597fb56Smrg
9415b242714cSmrg# AM_MAKE_INCLUDE()
9416b242714cSmrg# -----------------
9417b242714cSmrg# Check to see how make treats includes.
9418b242714cSmrgAC_DEFUN([AM_MAKE_INCLUDE],
9419b242714cSmrg[am_make=${MAKE-make}
9420b242714cSmrgcat > confinc << 'END'
9421b242714cSmrgam__doit:
9422b242714cSmrg	@echo this is the am__doit target
9423b242714cSmrg.PHONY: am__doit
9424b242714cSmrgEND
9425b242714cSmrg# If we don't find an include directive, just comment out the code.
9426b242714cSmrgAC_MSG_CHECKING([for style of include used by $am_make])
9427b242714cSmrgam__include="#"
9428b242714cSmrgam__quote=
9429b242714cSmrg_am_result=none
9430b242714cSmrg# First try GNU make style include.
9431b242714cSmrgecho "include confinc" > confmf
9432b242714cSmrg# Ignore all kinds of additional output from 'make'.
9433b242714cSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
9434b242714cSmrg*the\ am__doit\ target*)
9435b242714cSmrg  am__include=include
9436b242714cSmrg  am__quote=
9437b242714cSmrg  _am_result=GNU
9438b242714cSmrg  ;;
9439b242714cSmrgesac
9440b242714cSmrg# Now try BSD make style include.
9441b242714cSmrgif test "$am__include" = "#"; then
9442b242714cSmrg   echo '.include "confinc"' > confmf
9443b242714cSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
9444b242714cSmrg   *the\ am__doit\ target*)
9445b242714cSmrg     am__include=.include
9446b242714cSmrg     am__quote="\""
9447b242714cSmrg     _am_result=BSD
9448b242714cSmrg     ;;
9449b242714cSmrg   esac
94508bd17e5fSmrgfi
9451b242714cSmrgAC_SUBST([am__include])
9452b242714cSmrgAC_SUBST([am__quote])
9453b242714cSmrgAC_MSG_RESULT([$_am_result])
9454b242714cSmrgrm -f confinc confmf
9455b242714cSmrg])
94560597fb56Smrg
9457b242714cSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
94580597fb56Smrg
9459b242714cSmrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
946067594505Smrg#
9461b242714cSmrg# This file is free software; the Free Software Foundation
9462b242714cSmrg# gives unlimited permission to copy and/or distribute it,
9463b242714cSmrg# with or without modifications, as long as this notice is preserved.
94648c4a8e55Smrg
9465b242714cSmrg# AM_MISSING_PROG(NAME, PROGRAM)
9466b242714cSmrg# ------------------------------
9467b242714cSmrgAC_DEFUN([AM_MISSING_PROG],
9468b242714cSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
9469b242714cSmrg$1=${$1-"${am_missing_run}$2"}
9470b242714cSmrgAC_SUBST($1)])
9471b242714cSmrg
9472b242714cSmrg# AM_MISSING_HAS_RUN
9473b242714cSmrg# ------------------
9474b242714cSmrg# Define MISSING if not defined so far and test if it is modern enough.
9475b242714cSmrg# If it is, set am_missing_run to use it, otherwise, to nothing.
9476b242714cSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
9477b242714cSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
9478b242714cSmrgAC_REQUIRE_AUX_FILE([missing])dnl
9479b242714cSmrgif test x"${MISSING+set}" != xset; then
9480b242714cSmrg  case $am_aux_dir in
9481b242714cSmrg  *\ * | *\	*)
9482b242714cSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
9483b242714cSmrg  *)
9484b242714cSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
9485b242714cSmrg  esac
9486b242714cSmrgfi
9487b242714cSmrg# Use eval to expand $SHELL
9488b242714cSmrgif eval "$MISSING --is-lightweight"; then
9489b242714cSmrg  am_missing_run="$MISSING "
949067594505Smrgelse
9491b242714cSmrg  am_missing_run=
9492b242714cSmrg  AC_MSG_WARN(['missing' script is too old or missing])
949367594505Smrgfi
9494b242714cSmrg])
94950597fb56Smrg
9496b242714cSmrg# Helper functions for option handling.                     -*- Autoconf -*-
9497b242714cSmrg
9498b242714cSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
949967594505Smrg#
9500b242714cSmrg# This file is free software; the Free Software Foundation
9501b242714cSmrg# gives unlimited permission to copy and/or distribute it,
9502b242714cSmrg# with or without modifications, as long as this notice is preserved.
95038bd17e5fSmrg
9504b242714cSmrg# _AM_MANGLE_OPTION(NAME)
9505b242714cSmrg# -----------------------
9506b242714cSmrgAC_DEFUN([_AM_MANGLE_OPTION],
9507b242714cSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
95088c4a8e55Smrg
9509b242714cSmrg# _AM_SET_OPTION(NAME)
9510b242714cSmrg# --------------------
9511b242714cSmrg# Set option NAME.  Presently that only means defining a flag for this option.
9512b242714cSmrgAC_DEFUN([_AM_SET_OPTION],
9513b242714cSmrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
95140597fb56Smrg
9515b242714cSmrg# _AM_SET_OPTIONS(OPTIONS)
9516b242714cSmrg# ------------------------
9517b242714cSmrg# OPTIONS is a space-separated list of Automake options.
9518b242714cSmrgAC_DEFUN([_AM_SET_OPTIONS],
9519b242714cSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
952067594505Smrg
9521b242714cSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
9522b242714cSmrg# -------------------------------------------
9523b242714cSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
9524b242714cSmrgAC_DEFUN([_AM_IF_OPTION],
9525b242714cSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
95260597fb56Smrg
9527b242714cSmrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
9528b242714cSmrg#
9529b242714cSmrg# This file is free software; the Free Software Foundation
9530b242714cSmrg# gives unlimited permission to copy and/or distribute it,
9531b242714cSmrg# with or without modifications, as long as this notice is preserved.
95320597fb56Smrg
9533b242714cSmrg# _AM_PROG_CC_C_O
9534b242714cSmrg# ---------------
9535b242714cSmrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
9536b242714cSmrg# to automatically call this.
9537b242714cSmrgAC_DEFUN([_AM_PROG_CC_C_O],
9538b242714cSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
9539b242714cSmrgAC_REQUIRE_AUX_FILE([compile])dnl
9540b242714cSmrgAC_LANG_PUSH([C])dnl
9541b242714cSmrgAC_CACHE_CHECK(
9542b242714cSmrg  [whether $CC understands -c and -o together],
9543b242714cSmrg  [am_cv_prog_cc_c_o],
9544b242714cSmrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
9545b242714cSmrg  # Make sure it works both with $CC and with simple cc.
9546b242714cSmrg  # Following AC_PROG_CC_C_O, we do the test twice because some
9547b242714cSmrg  # compilers refuse to overwrite an existing .o file with -o,
9548b242714cSmrg  # though they will create one.
9549b242714cSmrg  am_cv_prog_cc_c_o=yes
9550b242714cSmrg  for am_i in 1 2; do
9551b242714cSmrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
9552b242714cSmrg         && test -f conftest2.$ac_objext; then
9553b242714cSmrg      : OK
955467594505Smrg    else
9555b242714cSmrg      am_cv_prog_cc_c_o=no
9556b242714cSmrg      break
955767594505Smrg    fi
9558b242714cSmrg  done
9559b242714cSmrg  rm -f core conftest*
9560b242714cSmrg  unset am_i])
9561b242714cSmrgif test "$am_cv_prog_cc_c_o" != yes; then
9562b242714cSmrg   # Losing compiler, so override with the script.
9563b242714cSmrg   # FIXME: It is wrong to rewrite CC.
9564b242714cSmrg   # But if we don't then we get into trouble of one sort or another.
9565b242714cSmrg   # A longer-term fix would be to have automake use am__CC in this case,
9566b242714cSmrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
9567b242714cSmrg   CC="$am_aux_dir/compile $CC"
956867594505Smrgfi
9569b242714cSmrgAC_LANG_POP([C])])
95708bd17e5fSmrg
9571b242714cSmrg# For backward compatibility.
9572b242714cSmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
95738bd17e5fSmrg
9574b242714cSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
957567594505Smrg#
9576b242714cSmrg# This file is free software; the Free Software Foundation
9577b242714cSmrg# gives unlimited permission to copy and/or distribute it,
9578b242714cSmrg# with or without modifications, as long as this notice is preserved.
95790597fb56Smrg
9580b242714cSmrg# AM_RUN_LOG(COMMAND)
9581b242714cSmrg# -------------------
9582b242714cSmrg# Run COMMAND, save the exit status in ac_status, and log it.
9583b242714cSmrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
9584b242714cSmrgAC_DEFUN([AM_RUN_LOG],
9585b242714cSmrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
9586b242714cSmrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
9587b242714cSmrg   ac_status=$?
9588b242714cSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
9589b242714cSmrg   (exit $ac_status); }])
95908c4a8e55Smrg
9591b242714cSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
9592bd23fbfaSmrg
9593b242714cSmrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
959467594505Smrg#
9595b242714cSmrg# This file is free software; the Free Software Foundation
9596b242714cSmrg# gives unlimited permission to copy and/or distribute it,
9597b242714cSmrg# with or without modifications, as long as this notice is preserved.
95980597fb56Smrg
9599b242714cSmrg# AM_SANITY_CHECK
9600b242714cSmrg# ---------------
9601b242714cSmrgAC_DEFUN([AM_SANITY_CHECK],
9602b242714cSmrg[AC_MSG_CHECKING([whether build environment is sane])
9603b242714cSmrg# Reject unsafe characters in $srcdir or the absolute working directory
9604b242714cSmrg# name.  Accept space and tab only in the latter.
9605b242714cSmrgam_lf='
9606b242714cSmrg'
9607b242714cSmrgcase `pwd` in
9608b242714cSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
9609b242714cSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
9610b242714cSmrgesac
9611b242714cSmrgcase $srcdir in
9612b242714cSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
9613b242714cSmrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
9614b242714cSmrgesac
96158c4a8e55Smrg
9616b242714cSmrg# Do 'set' in a subshell so we don't clobber the current shell's
9617b242714cSmrg# arguments.  Must try -L first in case configure is actually a
9618b242714cSmrg# symlink; some systems play weird games with the mod time of symlinks
9619b242714cSmrg# (eg FreeBSD returns the mod time of the symlink's containing
9620b242714cSmrg# directory).
9621b242714cSmrgif (
9622b242714cSmrg   am_has_slept=no
9623b242714cSmrg   for am_try in 1 2; do
9624b242714cSmrg     echo "timestamp, slept: $am_has_slept" > conftest.file
9625b242714cSmrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
9626b242714cSmrg     if test "$[*]" = "X"; then
9627b242714cSmrg	# -L didn't work.
9628b242714cSmrg	set X `ls -t "$srcdir/configure" conftest.file`
9629b242714cSmrg     fi
9630b242714cSmrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
9631b242714cSmrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
96328c4a8e55Smrg
9633b242714cSmrg	# If neither matched, then we have a broken ls.  This can happen
9634b242714cSmrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
9635b242714cSmrg	# broken ls alias from the environment.  This has actually
9636b242714cSmrg	# happened.  Such a system could not be considered "sane".
9637b242714cSmrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
9638b242714cSmrg  alias in your environment])
9639b242714cSmrg     fi
9640b242714cSmrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
9641b242714cSmrg       break
9642b242714cSmrg     fi
9643b242714cSmrg     # Just in case.
9644b242714cSmrg     sleep 1
9645b242714cSmrg     am_has_slept=yes
9646b242714cSmrg   done
9647b242714cSmrg   test "$[2]" = conftest.file
9648b242714cSmrg   )
9649b242714cSmrgthen
9650b242714cSmrg   # Ok.
9651b242714cSmrg   :
9652b242714cSmrgelse
9653b242714cSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
9654b242714cSmrgCheck your system clock])
9655b242714cSmrgfi
9656b242714cSmrgAC_MSG_RESULT([yes])
9657b242714cSmrg# If we didn't sleep, we still need to ensure time stamps of config.status and
9658b242714cSmrg# generated files are strictly newer.
9659b242714cSmrgam_sleep_pid=
9660b242714cSmrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
9661b242714cSmrg  ( sleep 1 ) &
9662b242714cSmrg  am_sleep_pid=$!
9663b242714cSmrgfi
9664b242714cSmrgAC_CONFIG_COMMANDS_PRE(
9665b242714cSmrg  [AC_MSG_CHECKING([that generated files are newer than configure])
9666b242714cSmrg   if test -n "$am_sleep_pid"; then
9667b242714cSmrg     # Hide warnings about reused PIDs.
9668b242714cSmrg     wait $am_sleep_pid 2>/dev/null
96698bd17e5fSmrg   fi
9670b242714cSmrg   AC_MSG_RESULT([done])])
9671b242714cSmrgrm -f conftest.file
9672b242714cSmrg])
9673b242714cSmrg
9674b242714cSmrg# Copyright (C) 2009-2013 Free Software Foundation, Inc.
9675b242714cSmrg#
9676b242714cSmrg# This file is free software; the Free Software Foundation
9677b242714cSmrg# gives unlimited permission to copy and/or distribute it,
9678b242714cSmrg# with or without modifications, as long as this notice is preserved.
9679b242714cSmrg
9680b242714cSmrg# AM_SILENT_RULES([DEFAULT])
9681b242714cSmrg# --------------------------
9682b242714cSmrg# Enable less verbose build rules; with the default set to DEFAULT
9683b242714cSmrg# ("yes" being less verbose, "no" or empty being verbose).
9684b242714cSmrgAC_DEFUN([AM_SILENT_RULES],
9685b242714cSmrg[AC_ARG_ENABLE([silent-rules], [dnl
9686b242714cSmrgAS_HELP_STRING(
9687b242714cSmrg  [--enable-silent-rules],
9688b242714cSmrg  [less verbose build output (undo: "make V=1")])
9689b242714cSmrgAS_HELP_STRING(
9690b242714cSmrg  [--disable-silent-rules],
9691b242714cSmrg  [verbose build output (undo: "make V=0")])dnl
9692b242714cSmrg])
9693b242714cSmrgcase $enable_silent_rules in @%:@ (((
9694b242714cSmrg  yes) AM_DEFAULT_VERBOSITY=0;;
9695b242714cSmrg   no) AM_DEFAULT_VERBOSITY=1;;
9696b242714cSmrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
9697b242714cSmrgesac
9698b242714cSmrgdnl
9699b242714cSmrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
9700b242714cSmrgdnl do not support nested variable expansions.
9701b242714cSmrgdnl See automake bug#9928 and bug#10237.
9702b242714cSmrgam_make=${MAKE-make}
9703b242714cSmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
9704b242714cSmrg   [am_cv_make_support_nested_variables],
9705b242714cSmrg   [if AS_ECHO([['TRUE=$(BAR$(V))
9706b242714cSmrgBAR0=false
9707b242714cSmrgBAR1=true
9708b242714cSmrgV=1
9709b242714cSmrgam__doit:
9710b242714cSmrg	@$(TRUE)
9711b242714cSmrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
9712b242714cSmrg  am_cv_make_support_nested_variables=yes
97138bd17e5fSmrgelse
9714b242714cSmrg  am_cv_make_support_nested_variables=no
9715b242714cSmrgfi])
9716b242714cSmrgif test $am_cv_make_support_nested_variables = yes; then
9717b242714cSmrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
9718b242714cSmrg  AM_V='$(V)'
9719b242714cSmrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
9720b242714cSmrgelse
9721b242714cSmrg  AM_V=$AM_DEFAULT_VERBOSITY
9722b242714cSmrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
97238bd17e5fSmrgfi
9724b242714cSmrgAC_SUBST([AM_V])dnl
9725b242714cSmrgAM_SUBST_NOTMAKE([AM_V])dnl
9726b242714cSmrgAC_SUBST([AM_DEFAULT_V])dnl
9727b242714cSmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
9728b242714cSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
9729b242714cSmrgAM_BACKSLASH='\'
9730b242714cSmrgAC_SUBST([AM_BACKSLASH])dnl
9731b242714cSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
9732b242714cSmrg])
97338c4a8e55Smrg
9734b242714cSmrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
973567594505Smrg#
9736b242714cSmrg# This file is free software; the Free Software Foundation
9737b242714cSmrg# gives unlimited permission to copy and/or distribute it,
9738b242714cSmrg# with or without modifications, as long as this notice is preserved.
9739b242714cSmrg
9740b242714cSmrg# AM_PROG_INSTALL_STRIP
9741b242714cSmrg# ---------------------
9742b242714cSmrg# One issue with vendor 'install' (even GNU) is that you can't
9743b242714cSmrg# specify the program used to strip binaries.  This is especially
9744b242714cSmrg# annoying in cross-compiling environments, where the build's strip
9745b242714cSmrg# is unlikely to handle the host's binaries.
9746b242714cSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
9747b242714cSmrg# always use install-sh in "make install-strip", and initialize
9748b242714cSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
9749b242714cSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
9750b242714cSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
9751b242714cSmrg# Installed binaries are usually stripped using 'strip' when the user
9752b242714cSmrg# run "make install-strip".  However 'strip' might not be the right
9753b242714cSmrg# tool to use in cross-compilation environments, therefore Automake
9754b242714cSmrg# will honor the 'STRIP' environment variable to overrule this program.
9755b242714cSmrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
9756b242714cSmrgif test "$cross_compiling" != no; then
9757b242714cSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
9758b242714cSmrgfi
9759b242714cSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
9760b242714cSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
9761b242714cSmrg
9762b242714cSmrg# Copyright (C) 2006-2013 Free Software Foundation, Inc.
976367594505Smrg#
9764b242714cSmrg# This file is free software; the Free Software Foundation
9765b242714cSmrg# gives unlimited permission to copy and/or distribute it,
9766b242714cSmrg# with or without modifications, as long as this notice is preserved.
9767b242714cSmrg
9768b242714cSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
9769b242714cSmrg# ---------------------------
9770b242714cSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
9771b242714cSmrg# This macro is traced by Automake.
9772b242714cSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
9773b242714cSmrg
9774b242714cSmrg# AM_SUBST_NOTMAKE(VARIABLE)
9775b242714cSmrg# --------------------------
9776b242714cSmrg# Public sister of _AM_SUBST_NOTMAKE.
9777b242714cSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
9778b242714cSmrg
9779b242714cSmrg# Check how to create a tarball.                            -*- Autoconf -*-
9780b242714cSmrg
9781b242714cSmrg# Copyright (C) 2004-2013 Free Software Foundation, Inc.
978267594505Smrg#
9783b242714cSmrg# This file is free software; the Free Software Foundation
9784b242714cSmrg# gives unlimited permission to copy and/or distribute it,
9785b242714cSmrg# with or without modifications, as long as this notice is preserved.
97868c4a8e55Smrg
9787b242714cSmrg# _AM_PROG_TAR(FORMAT)
9788b242714cSmrg# --------------------
9789b242714cSmrg# Check how to create a tarball in format FORMAT.
9790b242714cSmrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
979167594505Smrg#
9792b242714cSmrg# Substitute a variable $(am__tar) that is a command
9793b242714cSmrg# writing to stdout a FORMAT-tarball containing the directory
9794b242714cSmrg# $tardir.
9795b242714cSmrg#     tardir=directory && $(am__tar) > result.tar
979667594505Smrg#
9797b242714cSmrg# Substitute a variable $(am__untar) that extract such
9798b242714cSmrg# a tarball read from stdin.
9799b242714cSmrg#     $(am__untar) < result.tar
980067594505Smrg#
9801b242714cSmrgAC_DEFUN([_AM_PROG_TAR],
9802b242714cSmrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
9803b242714cSmrg# in the wild :-(  We should find a proper way to deprecate it ...
9804b242714cSmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
98058c4a8e55Smrg
9806b242714cSmrg# We'll loop over all known methods to create a tar archive until one works.
9807b242714cSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
980867594505Smrg
9809b242714cSmrgm4_if([$1], [v7],
9810b242714cSmrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
98118bd17e5fSmrg
9812b242714cSmrg  [m4_case([$1],
9813b242714cSmrg    [ustar],
9814b242714cSmrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
9815b242714cSmrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
9816b242714cSmrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
9817b242714cSmrg      # and bug#13588).
9818b242714cSmrg      am_max_uid=2097151 # 2^21 - 1
9819b242714cSmrg      am_max_gid=$am_max_uid
9820b242714cSmrg      # The $UID and $GID variables are not portable, so we need to resort
9821b242714cSmrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
9822b242714cSmrg      # below are definitely unexpected, so allow the users to see them
9823b242714cSmrg      # (that is, avoid stderr redirection).
9824b242714cSmrg      am_uid=`id -u || echo unknown`
9825b242714cSmrg      am_gid=`id -g || echo unknown`
9826b242714cSmrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
9827b242714cSmrg      if test $am_uid -le $am_max_uid; then
9828b242714cSmrg         AC_MSG_RESULT([yes])
9829b242714cSmrg      else
9830b242714cSmrg         AC_MSG_RESULT([no])
9831b242714cSmrg         _am_tools=none
9832b242714cSmrg      fi
9833b242714cSmrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
9834b242714cSmrg      if test $am_gid -le $am_max_gid; then
9835b242714cSmrg         AC_MSG_RESULT([yes])
9836b242714cSmrg      else
9837b242714cSmrg        AC_MSG_RESULT([no])
9838b242714cSmrg        _am_tools=none
9839b242714cSmrg      fi],
98408c4a8e55Smrg
9841b242714cSmrg  [pax],
9842b242714cSmrg    [],
98438c4a8e55Smrg
9844b242714cSmrg  [m4_fatal([Unknown tar format])])
98458c4a8e55Smrg
9846b242714cSmrg  AC_MSG_CHECKING([how to create a $1 tar archive])
98478c4a8e55Smrg
9848b242714cSmrg  # Go ahead even if we have the value already cached.  We do so because we
9849b242714cSmrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
9850b242714cSmrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
985167594505Smrg
9852b242714cSmrg  for _am_tool in $_am_tools; do
9853b242714cSmrg    case $_am_tool in
9854b242714cSmrg    gnutar)
9855b242714cSmrg      for _am_tar in tar gnutar gtar; do
9856b242714cSmrg        AM_RUN_LOG([$_am_tar --version]) && break
9857b242714cSmrg      done
9858b242714cSmrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
9859b242714cSmrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
9860b242714cSmrg      am__untar="$_am_tar -xf -"
9861b242714cSmrg      ;;
9862b242714cSmrg    plaintar)
9863b242714cSmrg      # Must skip GNU tar: if it does not support --format= it doesn't create
9864b242714cSmrg      # ustar tarball either.
9865b242714cSmrg      (tar --version) >/dev/null 2>&1 && continue
9866b242714cSmrg      am__tar='tar chf - "$$tardir"'
9867b242714cSmrg      am__tar_='tar chf - "$tardir"'
9868b242714cSmrg      am__untar='tar xf -'
9869b242714cSmrg      ;;
9870b242714cSmrg    pax)
9871b242714cSmrg      am__tar='pax -L -x $1 -w "$$tardir"'
9872b242714cSmrg      am__tar_='pax -L -x $1 -w "$tardir"'
9873b242714cSmrg      am__untar='pax -r'
9874b242714cSmrg      ;;
9875b242714cSmrg    cpio)
9876b242714cSmrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
9877b242714cSmrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
9878b242714cSmrg      am__untar='cpio -i -H $1 -d'
9879b242714cSmrg      ;;
9880b242714cSmrg    none)
9881b242714cSmrg      am__tar=false
9882b242714cSmrg      am__tar_=false
9883b242714cSmrg      am__untar=false
9884b242714cSmrg      ;;
9885b242714cSmrg    esac
988667594505Smrg
9887b242714cSmrg    # If the value was cached, stop now.  We just wanted to have am__tar
9888b242714cSmrg    # and am__untar set.
9889b242714cSmrg    test -n "${am_cv_prog_tar_$1}" && break
989067594505Smrg
9891b242714cSmrg    # tar/untar a dummy directory, and stop if the command works.
9892b242714cSmrg    rm -rf conftest.dir
9893b242714cSmrg    mkdir conftest.dir
9894b242714cSmrg    echo GrepMe > conftest.dir/file
9895b242714cSmrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
9896b242714cSmrg    rm -rf conftest.dir
9897b242714cSmrg    if test -s conftest.tar; then
9898b242714cSmrg      AM_RUN_LOG([$am__untar <conftest.tar])
9899b242714cSmrg      AM_RUN_LOG([cat conftest.dir/file])
9900b242714cSmrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
9901b242714cSmrg    fi
9902b242714cSmrg  done
9903b242714cSmrg  rm -rf conftest.dir
99048c4a8e55Smrg
9905b242714cSmrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
9906b242714cSmrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
9907b242714cSmrg
9908b242714cSmrgAC_SUBST([am__tar])
9909b242714cSmrgAC_SUBST([am__untar])
9910b242714cSmrg]) # _AM_PROG_TAR
9911b242714cSmrg
9912b242714cSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
9913b242714cSmrgdnl
9914b242714cSmrgdnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
9915b242714cSmrgdnl
9916b242714cSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
9917b242714cSmrgdnl copy of this software and associated documentation files (the "Software"),
9918b242714cSmrgdnl to deal in the Software without restriction, including without limitation
9919b242714cSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
9920b242714cSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
9921b242714cSmrgdnl Software is furnished to do so, subject to the following conditions:
9922b242714cSmrgdnl
9923b242714cSmrgdnl The above copyright notice and this permission notice (including the next
9924b242714cSmrgdnl paragraph) shall be included in all copies or substantial portions of the
9925b242714cSmrgdnl Software.
9926b242714cSmrgdnl
9927b242714cSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9928b242714cSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9929b242714cSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
9930b242714cSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9931b242714cSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9932b242714cSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
9933b242714cSmrgdnl DEALINGS IN THE SOFTWARE.
9934b242714cSmrg
9935b242714cSmrg# XORG_MACROS_VERSION(required-version)
9936b242714cSmrg# -------------------------------------
9937b242714cSmrg# Minimum version: 1.1.0
993867594505Smrg#
9939b242714cSmrg# If you're using a macro added in Version 1.1 or newer, include this in
9940b242714cSmrg# your configure.ac with the minimum required version, such as:
9941b242714cSmrg# XORG_MACROS_VERSION(1.1)
994267594505Smrg#
9943b242714cSmrg# To ensure that this macro is defined, also add:
9944b242714cSmrg# m4_ifndef([XORG_MACROS_VERSION],
9945b242714cSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
994667594505Smrg#
994767594505Smrg#
9948b242714cSmrg# See the "minimum version" comment for each macro you use to see what
9949b242714cSmrg# version you require.
9950b242714cSmrgm4_defun([XORG_MACROS_VERSION],[
9951b242714cSmrgm4_define([vers_have], [1.19.0])
9952b242714cSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
9953b242714cSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
9954b242714cSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
9955b242714cSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
9956b242714cSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
9957b242714cSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
9958b242714cSmrgm4_undefine([vers_have])
9959b242714cSmrgm4_undefine([maj_have])
9960b242714cSmrgm4_undefine([maj_needed])
9961b242714cSmrg]) # XORG_MACROS_VERSION
9962b242714cSmrg
9963b242714cSmrg# XORG_PROG_RAWCPP()
9964b242714cSmrg# ------------------
9965b242714cSmrg# Minimum version: 1.0.0
996667594505Smrg#
9967b242714cSmrg# Find cpp program and necessary flags for use in pre-processing text files
9968b242714cSmrg# such as man pages and config files
9969b242714cSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
9970b242714cSmrgAC_REQUIRE([AC_PROG_CPP])
9971b242714cSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
9972b242714cSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9973b242714cSmrg
9974b242714cSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
9975b242714cSmrg# which is not the best choice for supporting other OS'es, but covers most
9976b242714cSmrg# of the ones we need for now.
9977b242714cSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
9978b242714cSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
9979b242714cSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9980b242714cSmrg	AC_MSG_RESULT([no])
99810597fb56Smrgelse
9982b242714cSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9983b242714cSmrg		RAWCPPFLAGS=-undef
9984b242714cSmrg		AC_MSG_RESULT([yes])
9985b242714cSmrg	# under Cygwin unix is still defined even with -undef
9986b242714cSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9987b242714cSmrg		RAWCPPFLAGS="-undef -ansi"
9988b242714cSmrg		AC_MSG_RESULT([yes, with -ansi])
9989b242714cSmrg	else
9990b242714cSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9991b242714cSmrg	fi
99920597fb56Smrgfi
9993b242714cSmrgrm -f conftest.$ac_ext
99948c4a8e55Smrg
9995b242714cSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
9996b242714cSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
9997b242714cSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9998b242714cSmrg	AC_MSG_RESULT([no])
9999b242714cSmrgelse
10000b242714cSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
10001b242714cSmrg		TRADITIONALCPPFLAGS="-traditional"
10002b242714cSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
10003b242714cSmrg		AC_MSG_RESULT([yes])
10004b242714cSmrg	else
10005b242714cSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
10006b242714cSmrg	fi
10007b242714cSmrgfi
10008b242714cSmrgrm -f conftest.$ac_ext
10009b242714cSmrgAC_SUBST(RAWCPPFLAGS)
10010b242714cSmrgAC_SUBST(TRADITIONALCPPFLAGS)
10011b242714cSmrg]) # XORG_PROG_RAWCPP
10012b242714cSmrg
10013b242714cSmrg# XORG_MANPAGE_SECTIONS()
1001467594505Smrg# -----------------------
10015b242714cSmrg# Minimum version: 1.0.0
100168bd17e5fSmrg#
10017b242714cSmrg# Determine which sections man pages go in for the different man page types
10018b242714cSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
10019b242714cSmrg# Not sure if there's any better way than just hardcoding by OS name.
10020b242714cSmrg# Override default settings by setting environment variables
10021b242714cSmrg# Added MAN_SUBSTS in version 1.8
10022b242714cSmrg# Added AC_PROG_SED in version 1.8
100238c4a8e55Smrg
10024b242714cSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1002567594505SmrgAC_REQUIRE([AC_CANONICAL_HOST])
10026b242714cSmrgAC_REQUIRE([AC_PROG_SED])
1002767594505Smrg
10028b242714cSmrgif test x$APP_MAN_SUFFIX = x    ; then
10029b242714cSmrg    APP_MAN_SUFFIX=1
10030b242714cSmrgfi
10031b242714cSmrgif test x$APP_MAN_DIR = x    ; then
10032b242714cSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
10033b242714cSmrgfi
1003467594505Smrg
10035b242714cSmrgif test x$LIB_MAN_SUFFIX = x    ; then
10036b242714cSmrg    LIB_MAN_SUFFIX=3
10037b242714cSmrgfi
10038b242714cSmrgif test x$LIB_MAN_DIR = x    ; then
10039b242714cSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
1004067594505Smrgfi
1004167594505Smrg
10042b242714cSmrgif test x$FILE_MAN_SUFFIX = x    ; then
10043b242714cSmrg    case $host_os in
10044b242714cSmrg	# Solaris 2.0 - 11 use SysV man page sections
10045b242714cSmrg	solaris2.?|solaris2.1[[01]])	FILE_MAN_SUFFIX=4  ;;
10046b242714cSmrg	*)				FILE_MAN_SUFFIX=5  ;;
10047b242714cSmrg    esac
10048b242714cSmrgfi
10049b242714cSmrgif test x$FILE_MAN_DIR = x    ; then
10050b242714cSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
10051b242714cSmrgfi
1005267594505Smrg
10053b242714cSmrgif test x$MISC_MAN_SUFFIX = x    ; then
10054b242714cSmrg    case $host_os in
10055b242714cSmrg	# Solaris 2.0 - 11 use SysV man page sections
10056b242714cSmrg	solaris2.?|solaris2.1[[01]])	MISC_MAN_SUFFIX=5  ;;
10057b242714cSmrg	*)				MISC_MAN_SUFFIX=7  ;;
10058b242714cSmrg    esac
10059b242714cSmrgfi
10060b242714cSmrgif test x$MISC_MAN_DIR = x    ; then
10061b242714cSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
10062b242714cSmrgfi
1006367594505Smrg
10064b242714cSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
10065b242714cSmrg    case $host_os in
10066b242714cSmrg	# Solaris 2.0 - 11 use SysV man page sections
10067b242714cSmrg	solaris2.?|solaris2.1[[01]])	DRIVER_MAN_SUFFIX=7  ;;
10068b242714cSmrg	*)				DRIVER_MAN_SUFFIX=4  ;;
10069b242714cSmrg    esac
10070b242714cSmrgfi
10071b242714cSmrgif test x$DRIVER_MAN_DIR = x    ; then
10072b242714cSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1007367594505Smrgfi
1007467594505Smrg
10075b242714cSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
10076b242714cSmrg    case $host_os in
10077b242714cSmrg	# Solaris 2.0 - 11 use SysV man page sections
10078b242714cSmrg	solaris2.?|solaris2.1[[01]])	ADMIN_MAN_SUFFIX=1m ;;
10079b242714cSmrg	*)				ADMIN_MAN_SUFFIX=8  ;;
10080b242714cSmrg    esac
10081b242714cSmrgfi
10082b242714cSmrgif test x$ADMIN_MAN_DIR = x    ; then
10083b242714cSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
100848bd17e5fSmrgfi
100858c4a8e55Smrg
1008667594505Smrg
10087b242714cSmrgAC_SUBST([APP_MAN_SUFFIX])
10088b242714cSmrgAC_SUBST([LIB_MAN_SUFFIX])
10089b242714cSmrgAC_SUBST([FILE_MAN_SUFFIX])
10090b242714cSmrgAC_SUBST([MISC_MAN_SUFFIX])
10091b242714cSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
10092b242714cSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
10093b242714cSmrgAC_SUBST([APP_MAN_DIR])
10094b242714cSmrgAC_SUBST([LIB_MAN_DIR])
10095b242714cSmrgAC_SUBST([FILE_MAN_DIR])
10096b242714cSmrgAC_SUBST([MISC_MAN_DIR])
10097b242714cSmrgAC_SUBST([DRIVER_MAN_DIR])
10098b242714cSmrgAC_SUBST([ADMIN_MAN_DIR])
10099b242714cSmrg
10100b242714cSmrgXORG_MAN_PAGE="X Version 11"
10101b242714cSmrgAC_SUBST([XORG_MAN_PAGE])
10102b242714cSmrgMAN_SUBSTS="\
10103b242714cSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
10104b242714cSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
10105b242714cSmrg	-e 's|__xservername__|Xorg|g' \
10106b242714cSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
10107b242714cSmrg	-e 's|__projectroot__|\$(prefix)|g' \
10108b242714cSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
10109b242714cSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
10110b242714cSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
10111b242714cSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
10112b242714cSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
10113b242714cSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
10114b242714cSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
10115b242714cSmrgAC_SUBST([MAN_SUBSTS])
10116b242714cSmrg
10117b242714cSmrg]) # XORG_MANPAGE_SECTIONS
10118b242714cSmrg
10119b242714cSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
10120b242714cSmrg# ------------------------
10121b242714cSmrg# Minimum version: 1.7.0
101228bd17e5fSmrg#
10123b242714cSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
10124b242714cSmrg# provided by xorg-sgml-doctools, if installed.
10125b242714cSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
10126b242714cSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
10127b242714cSmrgXORG_SGML_PATH=
10128b242714cSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
10129b242714cSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
10130b242714cSmrg    [m4_ifval([$1],[:],
10131b242714cSmrg        [if test x"$cross_compiling" != x"yes" ; then
10132b242714cSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
10133b242714cSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
10134b242714cSmrg         fi])
10135b242714cSmrg    ])
10136b242714cSmrg
10137b242714cSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
10138b242714cSmrg# the path and the name of the doc stylesheet
10139b242714cSmrgif test "x$XORG_SGML_PATH" != "x" ; then
10140b242714cSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
10141b242714cSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
10142b242714cSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
10143b242714cSmrgelse
10144b242714cSmrg   AC_MSG_RESULT([no])
10145b242714cSmrgfi
10146b242714cSmrg
10147b242714cSmrgAC_SUBST(XORG_SGML_PATH)
10148b242714cSmrgAC_SUBST(STYLESHEET_SRCDIR)
10149b242714cSmrgAC_SUBST(XSL_STYLESHEET)
10150b242714cSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
10151b242714cSmrg]) # XORG_CHECK_SGML_DOCTOOLS
10152b242714cSmrg
10153b242714cSmrg# XORG_CHECK_LINUXDOC
10154b242714cSmrg# -------------------
10155b242714cSmrg# Minimum version: 1.0.0
101568bd17e5fSmrg#
10157b242714cSmrg# Defines the variable MAKE_TEXT if the necessary tools and
10158b242714cSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
10159b242714cSmrg# Whether or not the necessary tools and files are found can be checked
10160b242714cSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
10161b242714cSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
10162b242714cSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10163b242714cSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
101648bd17e5fSmrg
10165b242714cSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1016667594505Smrg
10167b242714cSmrgAC_MSG_CHECKING([whether to build documentation])
1016867594505Smrg
10169b242714cSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
10170b242714cSmrg   BUILDDOC=yes
101710597fb56Smrgelse
10172b242714cSmrg   BUILDDOC=no
101730597fb56Smrgfi
101748c4a8e55Smrg
10175b242714cSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
101768c4a8e55Smrg
10177b242714cSmrgAC_MSG_RESULT([$BUILDDOC])
1017867594505Smrg
10179b242714cSmrgAC_MSG_CHECKING([whether to build pdf documentation])
1018067594505Smrg
10181b242714cSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
10182b242714cSmrg   BUILDPDFDOC=yes
10183b242714cSmrgelse
10184b242714cSmrg   BUILDPDFDOC=no
10185b242714cSmrgfi
1018667594505Smrg
10187b242714cSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1018867594505Smrg
10189b242714cSmrgAC_MSG_RESULT([$BUILDPDFDOC])
101908c4a8e55Smrg
10191b242714cSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
10192b242714cSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
10193b242714cSmrgMAKE_PDF="$PS2PDF"
10194b242714cSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
101958c4a8e55Smrg
10196b242714cSmrgAC_SUBST(MAKE_TEXT)
10197b242714cSmrgAC_SUBST(MAKE_PS)
10198b242714cSmrgAC_SUBST(MAKE_PDF)
10199b242714cSmrgAC_SUBST(MAKE_HTML)
10200b242714cSmrg]) # XORG_CHECK_LINUXDOC
1020167594505Smrg
10202b242714cSmrg# XORG_CHECK_DOCBOOK
1020367594505Smrg# -------------------
10204b242714cSmrg# Minimum version: 1.0.0
102058bd17e5fSmrg#
10206b242714cSmrg# Checks for the ability to build output formats from SGML DocBook source.
10207b242714cSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
10208b242714cSmrg# indicates whether the necessary tools and files are found and, if set,
10209b242714cSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
10210b242714cSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
10211b242714cSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1021267594505Smrg
10213b242714cSmrgBUILDTXTDOC=no
10214b242714cSmrgBUILDPDFDOC=no
10215b242714cSmrgBUILDPSDOC=no
10216b242714cSmrgBUILDHTMLDOC=no
1021767594505Smrg
10218b242714cSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
10219b242714cSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
10220b242714cSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
10221b242714cSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1022267594505Smrg
10223b242714cSmrgAC_MSG_CHECKING([whether to build text documentation])
10224b242714cSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
10225b242714cSmrg   test x$BUILD_TXTDOC != xno; then
10226b242714cSmrg	BUILDTXTDOC=yes
102278bd17e5fSmrgfi
10228b242714cSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
10229b242714cSmrgAC_MSG_RESULT([$BUILDTXTDOC])
10230706b6b52Smrg
10231b242714cSmrgAC_MSG_CHECKING([whether to build PDF documentation])
10232b242714cSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
10233b242714cSmrg   test x$BUILD_PDFDOC != xno; then
10234b242714cSmrg	BUILDPDFDOC=yes
1023567594505Smrgfi
10236b242714cSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10237b242714cSmrgAC_MSG_RESULT([$BUILDPDFDOC])
1023867594505Smrg
10239b242714cSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
10240b242714cSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
10241b242714cSmrg   test x$BUILD_PSDOC != xno; then
10242b242714cSmrg	BUILDPSDOC=yes
10243b242714cSmrgfi
10244b242714cSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
10245b242714cSmrgAC_MSG_RESULT([$BUILDPSDOC])
1024667594505Smrg
10247b242714cSmrgAC_MSG_CHECKING([whether to build HTML documentation])
10248b242714cSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
10249b242714cSmrg   test x$BUILD_HTMLDOC != xno; then
10250b242714cSmrg	BUILDHTMLDOC=yes
10251b242714cSmrgfi
10252b242714cSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
10253b242714cSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
1025467594505Smrg
10255b242714cSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
10256b242714cSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
10257b242714cSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
10258b242714cSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
1025967594505Smrg
10260b242714cSmrgAC_SUBST(MAKE_TEXT)
10261b242714cSmrgAC_SUBST(MAKE_PS)
10262b242714cSmrgAC_SUBST(MAKE_PDF)
10263b242714cSmrgAC_SUBST(MAKE_HTML)
10264b242714cSmrg]) # XORG_CHECK_DOCBOOK
102658bd17e5fSmrg
10266b242714cSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
10267b242714cSmrg# ----------------
10268b242714cSmrg# Minimum version: 1.5.0
10269b242714cSmrg# Minimum version for optional DEFAULT argument: 1.11.0
102708bd17e5fSmrg#
10271b242714cSmrg# Documentation tools are not always available on all platforms and sometimes
10272b242714cSmrg# not at the appropriate level. This macro enables a module to test for the
10273b242714cSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10274b242714cSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
10275b242714cSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
10276b242714cSmrg# --with-xmlto assumes 'auto'.
102778bd17e5fSmrg#
10278b242714cSmrg# Interface to module:
10279b242714cSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
10280b242714cSmrg# XMLTO:	returns the path of the xmlto program found
10281b242714cSmrg#		returns the path set by the user in the environment
10282b242714cSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
10283b242714cSmrg#		'no' user instructs the module not to use xmlto
102848bd17e5fSmrg#
10285b242714cSmrg# Added in version 1.10.0
10286b242714cSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
10287b242714cSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
10288b242714cSmrg#
10289b242714cSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
10290b242714cSmrg#
10291b242714cSmrgAC_DEFUN([XORG_WITH_XMLTO],[
10292b242714cSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
10293b242714cSmrgm4_define([_defopt], m4_default([$2], [auto]))
10294b242714cSmrgAC_ARG_WITH(xmlto,
10295b242714cSmrg	AS_HELP_STRING([--with-xmlto],
10296b242714cSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
10297b242714cSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
10298b242714cSmrgm4_undefine([_defopt])
1029967594505Smrg
10300b242714cSmrgif test "x$use_xmlto" = x"auto"; then
10301b242714cSmrg   AC_PATH_PROG([XMLTO], [xmlto])
10302b242714cSmrg   if test "x$XMLTO" = "x"; then
10303b242714cSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
10304b242714cSmrg	have_xmlto=no
10305b242714cSmrg   else
10306b242714cSmrg        have_xmlto=yes
10307b242714cSmrg   fi
10308b242714cSmrgelif test "x$use_xmlto" = x"yes" ; then
10309b242714cSmrg   AC_PATH_PROG([XMLTO], [xmlto])
10310b242714cSmrg   if test "x$XMLTO" = "x"; then
10311b242714cSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
10312b242714cSmrg   fi
10313b242714cSmrg   have_xmlto=yes
10314b242714cSmrgelif test "x$use_xmlto" = x"no" ; then
10315b242714cSmrg   if test "x$XMLTO" != "x"; then
10316b242714cSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
10317b242714cSmrg   fi
10318b242714cSmrg   have_xmlto=no
103198bd17e5fSmrgelse
10320b242714cSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
103218bd17e5fSmrgfi
103228c4a8e55Smrg
10323b242714cSmrg# Test for a minimum version of xmlto, if provided.
10324b242714cSmrgm4_ifval([$1],
10325b242714cSmrg[if test "$have_xmlto" = yes; then
10326b242714cSmrg    # scrape the xmlto version
10327b242714cSmrg    AC_MSG_CHECKING([the xmlto version])
10328b242714cSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
10329b242714cSmrg    AC_MSG_RESULT([$xmlto_version])
10330b242714cSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
10331b242714cSmrg        [if test "x$use_xmlto" = xauto; then
10332b242714cSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
10333b242714cSmrg            have_xmlto=no
10334b242714cSmrg        else
10335b242714cSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
10336b242714cSmrg        fi])
10337b242714cSmrgfi])
103388c4a8e55Smrg
10339b242714cSmrg# Test for the ability of xmlto to generate a text target
10340b242714cSmrg#
10341b242714cSmrg# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the
10342b242714cSmrg# following test for empty XML docbook files.
10343b242714cSmrg# For compatibility reasons use the following empty XML docbook file and if
10344b242714cSmrg# it fails try it again with a non-empty XML file.
10345b242714cSmrghave_xmlto_text=no
10346b242714cSmrgcat > conftest.xml << "EOF"
10347b242714cSmrgEOF
10348b242714cSmrgAS_IF([test "$have_xmlto" = yes],
10349b242714cSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
10350b242714cSmrg             [have_xmlto_text=yes],
10351b242714cSmrg             [# Try it again with a non-empty XML file.
10352b242714cSmrg              cat > conftest.xml << "EOF"
10353b242714cSmrg<x></x>
10354b242714cSmrgEOF
10355b242714cSmrg              AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
10356b242714cSmrg                    [have_xmlto_text=yes],
10357b242714cSmrg                    [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])])
10358b242714cSmrgrm -f conftest.xml
10359b242714cSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
10360b242714cSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
10361b242714cSmrg]) # XORG_WITH_XMLTO
1036267594505Smrg
10363b242714cSmrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
10364b242714cSmrg# --------------------------------------------
10365b242714cSmrg# Minimum version: 1.12.0
10366b242714cSmrg# Minimum version for optional DEFAULT argument: 1.12.0
10367b242714cSmrg#
10368b242714cSmrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
10369b242714cSmrg# XML-based language used for the transformation of XML documents.
10370b242714cSmrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
10371b242714cSmrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
10372b242714cSmrg# The XSLT processor is often used as a standalone tool for transformations.
10373b242714cSmrg# It should not be assumed that this tool is used only to work with documnetation.
10374b242714cSmrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
10375b242714cSmrg#
10376b242714cSmrg# Interface to module:
10377b242714cSmrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
10378b242714cSmrg# XSLTPROC:	 returns the path of the xsltproc program found
10379b242714cSmrg#		 returns the path set by the user in the environment
10380b242714cSmrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
10381b242714cSmrg#		  'no' user instructs the module not to use xsltproc
10382b242714cSmrg# have_xsltproc: returns yes if xsltproc found in PATH or no
10383b242714cSmrg#
10384b242714cSmrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
10385b242714cSmrg#
10386b242714cSmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
10387b242714cSmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
10388b242714cSmrg# Preserves the interface, should it be implemented later
10389b242714cSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
10390b242714cSmrgm4_define([_defopt], m4_default([$2], [auto]))
10391b242714cSmrgAC_ARG_WITH(xsltproc,
10392b242714cSmrg	AS_HELP_STRING([--with-xsltproc],
10393b242714cSmrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
10394b242714cSmrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
10395b242714cSmrgm4_undefine([_defopt])
1039667594505Smrg
10397b242714cSmrgif test "x$use_xsltproc" = x"auto"; then
10398b242714cSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
10399b242714cSmrg   if test "x$XSLTPROC" = "x"; then
10400b242714cSmrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
10401b242714cSmrg	have_xsltproc=no
10402b242714cSmrg   else
10403b242714cSmrg        have_xsltproc=yes
10404b242714cSmrg   fi
10405b242714cSmrgelif test "x$use_xsltproc" = x"yes" ; then
10406b242714cSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
10407b242714cSmrg   if test "x$XSLTPROC" = "x"; then
10408b242714cSmrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
10409b242714cSmrg   fi
10410b242714cSmrg   have_xsltproc=yes
10411b242714cSmrgelif test "x$use_xsltproc" = x"no" ; then
10412b242714cSmrg   if test "x$XSLTPROC" != "x"; then
10413b242714cSmrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
10414b242714cSmrg   fi
10415b242714cSmrg   have_xsltproc=no
1041667594505Smrgelse
10417b242714cSmrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
1041867594505Smrgfi
104190597fb56Smrg
10420b242714cSmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
10421b242714cSmrg]) # XORG_WITH_XSLTPROC
104220597fb56Smrg
10423b242714cSmrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
10424b242714cSmrg# ----------------------------------------
10425b242714cSmrg# Minimum version: 1.15.0
104268bd17e5fSmrg#
10427b242714cSmrg# PERL (Practical Extraction and Report Language) is a language optimized for
10428b242714cSmrg# scanning arbitrary text files, extracting information from those text files,
10429b242714cSmrg# and printing reports based on that information.
104308bd17e5fSmrg#
10431b242714cSmrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
104328bd17e5fSmrg#
10433b242714cSmrg# Interface to module:
10434b242714cSmrg# HAVE_PERL: used in makefiles to conditionally scan text files
10435b242714cSmrg# PERL:	     returns the path of the perl program found
10436b242714cSmrg#	     returns the path set by the user in the environment
10437b242714cSmrg# --with-perl: 'yes' user instructs the module to use perl
10438b242714cSmrg#	       'no' user instructs the module not to use perl
10439b242714cSmrg# have_perl: returns yes if perl found in PATH or no
104408bd17e5fSmrg#
10441b242714cSmrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
104428bd17e5fSmrg#
10443b242714cSmrgAC_DEFUN([XORG_WITH_PERL],[
10444b242714cSmrgAC_ARG_VAR([PERL], [Path to perl command])
10445b242714cSmrg# Preserves the interface, should it be implemented later
10446b242714cSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
10447b242714cSmrgm4_define([_defopt], m4_default([$2], [auto]))
10448b242714cSmrgAC_ARG_WITH(perl,
10449b242714cSmrg	AS_HELP_STRING([--with-perl],
10450b242714cSmrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
10451b242714cSmrg	   [use_perl=$withval], [use_perl=]_defopt)
10452b242714cSmrgm4_undefine([_defopt])
104538c4a8e55Smrg
10454b242714cSmrgif test "x$use_perl" = x"auto"; then
10455b242714cSmrg   AC_PATH_PROG([PERL], [perl])
10456b242714cSmrg   if test "x$PERL" = "x"; then
10457b242714cSmrg        AC_MSG_WARN([perl not found - cannot extract information and report])
10458b242714cSmrg	have_perl=no
10459b242714cSmrg   else
10460b242714cSmrg        have_perl=yes
10461b242714cSmrg   fi
10462b242714cSmrgelif test "x$use_perl" = x"yes" ; then
10463b242714cSmrg   AC_PATH_PROG([PERL], [perl])
10464b242714cSmrg   if test "x$PERL" = "x"; then
10465b242714cSmrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
10466b242714cSmrg   fi
10467b242714cSmrg   have_perl=yes
10468b242714cSmrgelif test "x$use_perl" = x"no" ; then
10469b242714cSmrg   if test "x$PERL" != "x"; then
10470b242714cSmrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
10471b242714cSmrg   fi
10472b242714cSmrg   have_perl=no
10473b242714cSmrgelse
10474b242714cSmrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
1047567594505Smrgfi
104768c4a8e55Smrg
10477b242714cSmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
10478b242714cSmrg]) # XORG_WITH_PERL
1047967594505Smrg
10480b242714cSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
1048167594505Smrg# ----------------
10482b242714cSmrg# Minimum version: 1.5.0
10483b242714cSmrg# Minimum version for optional DEFAULT argument: 1.11.0
104848bd17e5fSmrg#
10485b242714cSmrg# Documentation tools are not always available on all platforms and sometimes
10486b242714cSmrg# not at the appropriate level. This macro enables a module to test for the
10487b242714cSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10488b242714cSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
10489b242714cSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
10490b242714cSmrg# --with-asciidoc assumes 'auto'.
10491b242714cSmrg#
10492b242714cSmrg# Interface to module:
10493b242714cSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
10494b242714cSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
10495b242714cSmrg#		 returns the path set by the user in the environment
10496b242714cSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
10497b242714cSmrg#		  'no' user instructs the module not to use asciidoc
10498b242714cSmrg#
10499b242714cSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
10500b242714cSmrg#
10501b242714cSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
10502b242714cSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
10503b242714cSmrgm4_define([_defopt], m4_default([$2], [auto]))
10504b242714cSmrgAC_ARG_WITH(asciidoc,
10505b242714cSmrg	AS_HELP_STRING([--with-asciidoc],
10506b242714cSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
10507b242714cSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
10508b242714cSmrgm4_undefine([_defopt])
1050967594505Smrg
10510b242714cSmrgif test "x$use_asciidoc" = x"auto"; then
10511b242714cSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10512b242714cSmrg   if test "x$ASCIIDOC" = "x"; then
10513b242714cSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
10514b242714cSmrg	have_asciidoc=no
10515b242714cSmrg   else
10516b242714cSmrg        have_asciidoc=yes
10517b242714cSmrg   fi
10518b242714cSmrgelif test "x$use_asciidoc" = x"yes" ; then
10519b242714cSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10520b242714cSmrg   if test "x$ASCIIDOC" = "x"; then
10521b242714cSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
10522b242714cSmrg   fi
10523b242714cSmrg   have_asciidoc=yes
10524b242714cSmrgelif test "x$use_asciidoc" = x"no" ; then
10525b242714cSmrg   if test "x$ASCIIDOC" != "x"; then
10526b242714cSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
10527b242714cSmrg   fi
10528b242714cSmrg   have_asciidoc=no
10529b242714cSmrgelse
10530b242714cSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
10531b242714cSmrgfi
10532b242714cSmrgm4_ifval([$1],
10533b242714cSmrg[if test "$have_asciidoc" = yes; then
10534b242714cSmrg    # scrape the asciidoc version
10535b242714cSmrg    AC_MSG_CHECKING([the asciidoc version])
10536b242714cSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
10537b242714cSmrg    AC_MSG_RESULT([$asciidoc_version])
10538b242714cSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
10539b242714cSmrg        [if test "x$use_asciidoc" = xauto; then
10540b242714cSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
10541b242714cSmrg            have_asciidoc=no
10542b242714cSmrg        else
10543b242714cSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
10544b242714cSmrg        fi])
10545b242714cSmrgfi])
10546b242714cSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
10547b242714cSmrg]) # XORG_WITH_ASCIIDOC
105488c4a8e55Smrg
10549b242714cSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
10550b242714cSmrg# -------------------------------------------
10551b242714cSmrg# Minimum version: 1.5.0
10552b242714cSmrg# Minimum version for optional DEFAULT argument: 1.11.0
10553b242714cSmrg# Minimum version for optional DOT checking: 1.18.0
105548bd17e5fSmrg#
10555b242714cSmrg# Documentation tools are not always available on all platforms and sometimes
10556b242714cSmrg# not at the appropriate level. This macro enables a module to test for the
10557b242714cSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10558b242714cSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
10559b242714cSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
10560b242714cSmrg# --with-doxygen assumes 'auto'.
105618bd17e5fSmrg#
10562b242714cSmrg# Interface to module:
10563b242714cSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
10564b242714cSmrg# DOXYGEN:	 returns the path of the doxygen program found
10565b242714cSmrg#		 returns the path set by the user in the environment
10566b242714cSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
10567b242714cSmrg#		  'no' user instructs the module not to use doxygen
105688bd17e5fSmrg#
10569b242714cSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
105708bd17e5fSmrg#
10571b242714cSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
10572b242714cSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
10573b242714cSmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
10574b242714cSmrgm4_define([_defopt], m4_default([$2], [auto]))
10575b242714cSmrgAC_ARG_WITH(doxygen,
10576b242714cSmrg	AS_HELP_STRING([--with-doxygen],
10577b242714cSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
10578b242714cSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
10579b242714cSmrgm4_undefine([_defopt])
1058067594505Smrg
10581b242714cSmrgif test "x$use_doxygen" = x"auto"; then
10582b242714cSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
10583b242714cSmrg   if test "x$DOXYGEN" = "x"; then
10584b242714cSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
10585b242714cSmrg	have_doxygen=no
10586b242714cSmrg   else
10587b242714cSmrg        have_doxygen=yes
10588b242714cSmrg   fi
10589b242714cSmrgelif test "x$use_doxygen" = x"yes" ; then
10590b242714cSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
10591b242714cSmrg   if test "x$DOXYGEN" = "x"; then
10592b242714cSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
10593b242714cSmrg   fi
10594b242714cSmrg   have_doxygen=yes
10595b242714cSmrgelif test "x$use_doxygen" = x"no" ; then
10596b242714cSmrg   if test "x$DOXYGEN" != "x"; then
10597b242714cSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
10598b242714cSmrg   fi
10599b242714cSmrg   have_doxygen=no
10600b242714cSmrgelse
10601b242714cSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
10602b242714cSmrgfi
10603b242714cSmrgm4_ifval([$1],
10604b242714cSmrg[if test "$have_doxygen" = yes; then
10605b242714cSmrg    # scrape the doxygen version
10606b242714cSmrg    AC_MSG_CHECKING([the doxygen version])
10607b242714cSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
10608b242714cSmrg    AC_MSG_RESULT([$doxygen_version])
10609b242714cSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
10610b242714cSmrg        [if test "x$use_doxygen" = xauto; then
10611b242714cSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
10612b242714cSmrg            have_doxygen=no
10613b242714cSmrg        else
10614b242714cSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
10615b242714cSmrg        fi])
10616b242714cSmrgfi])
1061767594505Smrg
10618b242714cSmrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
10619b242714cSmrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
10620b242714cSmrgdnl 	HAVE_DOT = @HAVE_DOT@
10621b242714cSmrgHAVE_DOT=no
10622b242714cSmrgif test "x$have_doxygen" = "xyes"; then
10623b242714cSmrg  AC_PATH_PROG([DOT], [dot])
10624b242714cSmrg    if test "x$DOT" != "x"; then
10625b242714cSmrg      HAVE_DOT=yes
10626b242714cSmrg    fi
10627b242714cSmrgfi
1062867594505Smrg
10629b242714cSmrgAC_SUBST([HAVE_DOT])
10630b242714cSmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
10631b242714cSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
10632b242714cSmrg]) # XORG_WITH_DOXYGEN
1063367594505Smrg
10634b242714cSmrg# XORG_WITH_GROFF([DEFAULT])
10635b242714cSmrg# ----------------
10636b242714cSmrg# Minimum version: 1.6.0
10637b242714cSmrg# Minimum version for optional DEFAULT argument: 1.11.0
106388bd17e5fSmrg#
10639b242714cSmrg# Documentation tools are not always available on all platforms and sometimes
10640b242714cSmrg# not at the appropriate level. This macro enables a module to test for the
10641b242714cSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10642b242714cSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
10643b242714cSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
10644b242714cSmrg# --with-groff assumes 'auto'.
106458bd17e5fSmrg#
10646b242714cSmrg# Interface to module:
10647b242714cSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
10648b242714cSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
10649b242714cSmrg# HAVE_GROFF_MS: the -ms macros package
10650b242714cSmrg# GROFF:	 returns the path of the groff program found
10651b242714cSmrg#		 returns the path set by the user in the environment
10652b242714cSmrg# --with-groff:	 'yes' user instructs the module to use groff
10653b242714cSmrg#		 'no' user instructs the module not to use groff
106548bd17e5fSmrg#
10655b242714cSmrg# Added in version 1.9.0:
10656b242714cSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
10657b242714cSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
10658b242714cSmrg#		   psselect from the psutils package.
10659b242714cSmrg#		   the ghostcript package. Refer to the grohtml man pages
106608bd17e5fSmrg#
10661b242714cSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
106628bd17e5fSmrg#
10663b242714cSmrg# OS and distros often splits groff in a basic and full package, the former
10664b242714cSmrg# having the groff program and the later having devices, fonts and macros
10665b242714cSmrg# Checking for the groff executable is not enough.
106668bd17e5fSmrg#
10667b242714cSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
10668b242714cSmrg# unset HAVE_GROFF or GROFF env variables.
10669b242714cSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
10670b242714cSmrg#
10671b242714cSmrgAC_DEFUN([XORG_WITH_GROFF],[
10672b242714cSmrgAC_ARG_VAR([GROFF], [Path to groff command])
10673b242714cSmrgm4_define([_defopt], m4_default([$1], [auto]))
10674b242714cSmrgAC_ARG_WITH(groff,
10675b242714cSmrg	AS_HELP_STRING([--with-groff],
10676b242714cSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
10677b242714cSmrg	   [use_groff=$withval], [use_groff=]_defopt)
10678b242714cSmrgm4_undefine([_defopt])
1067967594505Smrg
10680b242714cSmrgif test "x$use_groff" = x"auto"; then
10681b242714cSmrg   AC_PATH_PROG([GROFF], [groff])
10682b242714cSmrg   if test "x$GROFF" = "x"; then
10683b242714cSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
10684b242714cSmrg	have_groff=no
10685b242714cSmrg   else
10686b242714cSmrg        have_groff=yes
10687b242714cSmrg   fi
10688b242714cSmrgelif test "x$use_groff" = x"yes" ; then
10689b242714cSmrg   AC_PATH_PROG([GROFF], [groff])
10690b242714cSmrg   if test "x$GROFF" = "x"; then
10691b242714cSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
10692b242714cSmrg   fi
10693b242714cSmrg   have_groff=yes
10694b242714cSmrgelif test "x$use_groff" = x"no" ; then
10695b242714cSmrg   if test "x$GROFF" != "x"; then
10696b242714cSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
10697b242714cSmrg   fi
10698b242714cSmrg   have_groff=no
10699b242714cSmrgelse
10700b242714cSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
10701b242714cSmrgfi
1070267594505Smrg
10703b242714cSmrg# We have groff, test for the presence of the macro packages
10704b242714cSmrgif test "x$have_groff" = x"yes"; then
10705b242714cSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
10706b242714cSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
10707b242714cSmrg        groff_ms_works=yes
10708b242714cSmrg    else
10709b242714cSmrg        groff_ms_works=no
10710b242714cSmrg    fi
10711b242714cSmrg    AC_MSG_RESULT([$groff_ms_works])
10712b242714cSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
10713b242714cSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
10714b242714cSmrg        groff_mm_works=yes
10715b242714cSmrg    else
10716b242714cSmrg        groff_mm_works=no
10717b242714cSmrg    fi
10718b242714cSmrg    AC_MSG_RESULT([$groff_mm_works])
10719b242714cSmrgfi
1072067594505Smrg
10721b242714cSmrg# We have groff, test for HTML dependencies, one command per package
10722b242714cSmrgif test "x$have_groff" = x"yes"; then
10723b242714cSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
10724b242714cSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
10725b242714cSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
10726b242714cSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
10727b242714cSmrg      have_groff_html=yes
10728b242714cSmrg   else
10729b242714cSmrg      have_groff_html=no
10730b242714cSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
10731b242714cSmrg   fi
10732b242714cSmrgfi
10733b242714cSmrg
10734b242714cSmrg# Set Automake conditionals for Makefiles
10735b242714cSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
10736b242714cSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
10737b242714cSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
10738b242714cSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
10739b242714cSmrg]) # XORG_WITH_GROFF
10740b242714cSmrg
10741b242714cSmrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
10742b242714cSmrg# ---------------------------------------
10743b242714cSmrg# Minimum version: 1.6.0
10744b242714cSmrg# Minimum version for optional DEFAULT argument: 1.11.0
10745b242714cSmrg# Minimum version for optional MIN-VERSION argument: 1.15.0
107468bd17e5fSmrg#
10747b242714cSmrg# Documentation tools are not always available on all platforms and sometimes
10748b242714cSmrg# not at the appropriate level. This macro enables a module to test for the
10749b242714cSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10750b242714cSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
10751b242714cSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
10752b242714cSmrg# --with-fop assumes 'auto'.
10753b242714cSmrg#
10754b242714cSmrg# Interface to module:
10755b242714cSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
10756b242714cSmrg# FOP:	 	returns the path of the fop program found
10757b242714cSmrg#		returns the path set by the user in the environment
10758b242714cSmrg# --with-fop: 	'yes' user instructs the module to use fop
10759b242714cSmrg#		'no' user instructs the module not to use fop
10760b242714cSmrg#
10761b242714cSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
10762b242714cSmrg#
10763b242714cSmrgAC_DEFUN([XORG_WITH_FOP],[
10764b242714cSmrgAC_ARG_VAR([FOP], [Path to fop command])
10765b242714cSmrgm4_define([_defopt], m4_default([$2], [auto]))
10766b242714cSmrgAC_ARG_WITH(fop,
10767b242714cSmrg	AS_HELP_STRING([--with-fop],
10768b242714cSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
10769b242714cSmrg	   [use_fop=$withval], [use_fop=]_defopt)
10770b242714cSmrgm4_undefine([_defopt])
1077167594505Smrg
10772b242714cSmrgif test "x$use_fop" = x"auto"; then
10773b242714cSmrg   AC_PATH_PROG([FOP], [fop])
10774b242714cSmrg   if test "x$FOP" = "x"; then
10775b242714cSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
10776b242714cSmrg	have_fop=no
10777b242714cSmrg   else
10778b242714cSmrg        have_fop=yes
10779b242714cSmrg   fi
10780b242714cSmrgelif test "x$use_fop" = x"yes" ; then
10781b242714cSmrg   AC_PATH_PROG([FOP], [fop])
10782b242714cSmrg   if test "x$FOP" = "x"; then
10783b242714cSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
10784b242714cSmrg   fi
10785b242714cSmrg   have_fop=yes
10786b242714cSmrgelif test "x$use_fop" = x"no" ; then
10787b242714cSmrg   if test "x$FOP" != "x"; then
10788b242714cSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
10789b242714cSmrg   fi
10790b242714cSmrg   have_fop=no
107918bd17e5fSmrgelse
10792b242714cSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
107938bd17e5fSmrgfi
107948bd17e5fSmrg
10795b242714cSmrg# Test for a minimum version of fop, if provided.
10796b242714cSmrgm4_ifval([$1],
10797b242714cSmrg[if test "$have_fop" = yes; then
10798b242714cSmrg    # scrape the fop version
10799b242714cSmrg    AC_MSG_CHECKING([for fop minimum version])
10800b242714cSmrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
10801b242714cSmrg    AC_MSG_RESULT([$fop_version])
10802b242714cSmrg    AS_VERSION_COMPARE([$fop_version], [$1],
10803b242714cSmrg        [if test "x$use_fop" = xauto; then
10804b242714cSmrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
10805b242714cSmrg            have_fop=no
10806b242714cSmrg        else
10807b242714cSmrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
10808b242714cSmrg        fi])
10809b242714cSmrgfi])
10810b242714cSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
10811b242714cSmrg]) # XORG_WITH_FOP
108128c4a8e55Smrg
10813b242714cSmrg# XORG_WITH_M4([MIN-VERSION])
10814b242714cSmrg# ---------------------------
10815b242714cSmrg# Minimum version: 1.19.0
10816b242714cSmrg#
10817b242714cSmrg# This macro attempts to locate an m4 macro processor which supports
10818b242714cSmrg# -I option and is only useful for modules relying on M4 in order to
10819b242714cSmrg# expand macros in source code files.
10820b242714cSmrg#
10821b242714cSmrg# Interface to module:
10822b242714cSmrg# M4:	 	returns the path of the m4 program found
10823b242714cSmrg#		returns the path set by the user in the environment
10824b242714cSmrg#
10825b242714cSmrgAC_DEFUN([XORG_WITH_M4], [
10826b242714cSmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
10827b242714cSmrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
10828b242714cSmrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
10829b242714cSmrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
10830b242714cSmrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
10831b242714cSmrg   [$PATH:/usr/gnu/bin])])
1083267594505Smrg
10833b242714cSmrgAC_SUBST([M4], [$ac_cv_path_M4])
10834b242714cSmrg]) # XORG_WITH_M4
1083567594505Smrg
10836b242714cSmrg# XORG_WITH_PS2PDF([DEFAULT])
10837b242714cSmrg# ----------------
10838b242714cSmrg# Minimum version: 1.6.0
10839b242714cSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1084067594505Smrg#
10841b242714cSmrg# Documentation tools are not always available on all platforms and sometimes
10842b242714cSmrg# not at the appropriate level. This macro enables a module to test for the
10843b242714cSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10844b242714cSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
10845b242714cSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
10846b242714cSmrg# --with-ps2pdf assumes 'auto'.
10847b242714cSmrg#
10848b242714cSmrg# Interface to module:
10849b242714cSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
10850b242714cSmrg# PS2PDF:	returns the path of the ps2pdf program found
10851b242714cSmrg#		returns the path set by the user in the environment
10852b242714cSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
10853b242714cSmrg#		 'no' user instructs the module not to use ps2pdf
10854b242714cSmrg#
10855b242714cSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
10856b242714cSmrg#
10857b242714cSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
10858b242714cSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
10859b242714cSmrgm4_define([_defopt], m4_default([$1], [auto]))
10860b242714cSmrgAC_ARG_WITH(ps2pdf,
10861b242714cSmrg	AS_HELP_STRING([--with-ps2pdf],
10862b242714cSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
10863b242714cSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
10864b242714cSmrgm4_undefine([_defopt])
1086567594505Smrg
10866b242714cSmrgif test "x$use_ps2pdf" = x"auto"; then
10867b242714cSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
10868b242714cSmrg   if test "x$PS2PDF" = "x"; then
10869b242714cSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
10870b242714cSmrg	have_ps2pdf=no
10871b242714cSmrg   else
10872b242714cSmrg        have_ps2pdf=yes
10873b242714cSmrg   fi
10874b242714cSmrgelif test "x$use_ps2pdf" = x"yes" ; then
10875b242714cSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
10876b242714cSmrg   if test "x$PS2PDF" = "x"; then
10877b242714cSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
10878b242714cSmrg   fi
10879b242714cSmrg   have_ps2pdf=yes
10880b242714cSmrgelif test "x$use_ps2pdf" = x"no" ; then
10881b242714cSmrg   if test "x$PS2PDF" != "x"; then
10882b242714cSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
10883b242714cSmrg   fi
10884b242714cSmrg   have_ps2pdf=no
108850597fb56Smrgelse
10886b242714cSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
108870597fb56Smrgfi
10888b242714cSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
10889b242714cSmrg]) # XORG_WITH_PS2PDF
1089067594505Smrg
10891b242714cSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
10892b242714cSmrg# ----------------
10893b242714cSmrg# Minimum version: 1.6.0
1089467594505Smrg#
10895b242714cSmrg# Documentation tools are not always available on all platforms and sometimes
10896b242714cSmrg# not at the appropriate level. This macro enables a builder to skip all
10897b242714cSmrg# documentation targets except traditional man pages.
10898b242714cSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10899b242714cSmrg# maximum flexibilty in controlling documentation building.
10900b242714cSmrg# Refer to:
10901b242714cSmrg# XORG_WITH_XMLTO         --with-xmlto
10902b242714cSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10903b242714cSmrg# XORG_WITH_DOXYGEN       --with-doxygen
10904b242714cSmrg# XORG_WITH_FOP           --with-fop
10905b242714cSmrg# XORG_WITH_GROFF         --with-groff
10906b242714cSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
10907b242714cSmrg#
10908b242714cSmrg# Interface to module:
10909b242714cSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
10910b242714cSmrg# --enable-docs: 'yes' user instructs the module to generate docs
10911b242714cSmrg#		 'no' user instructs the module not to generate docs
10912b242714cSmrg# parm1:	specify the default value, yes or no.
10913b242714cSmrg#
10914b242714cSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
10915b242714cSmrgm4_define([docs_default], m4_default([$1], [yes]))
10916b242714cSmrgAC_ARG_ENABLE(docs,
10917b242714cSmrg	AS_HELP_STRING([--enable-docs],
10918b242714cSmrg	   [Enable building the documentation (default: ]docs_default[)]),
10919b242714cSmrg	   [build_docs=$enableval], [build_docs=]docs_default)
10920b242714cSmrgm4_undefine([docs_default])
10921b242714cSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
10922b242714cSmrgAC_MSG_CHECKING([whether to build documentation])
10923b242714cSmrgAC_MSG_RESULT([$build_docs])
10924b242714cSmrg]) # XORG_ENABLE_DOCS
109258c4a8e55Smrg
10926b242714cSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
10927b242714cSmrg# ----------------
10928b242714cSmrg# Minimum version: 1.6.0
10929b242714cSmrg#
10930b242714cSmrg# This macro enables a builder to skip all developer documentation.
10931b242714cSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10932b242714cSmrg# maximum flexibilty in controlling documentation building.
10933b242714cSmrg# Refer to:
10934b242714cSmrg# XORG_WITH_XMLTO         --with-xmlto
10935b242714cSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10936b242714cSmrg# XORG_WITH_DOXYGEN       --with-doxygen
10937b242714cSmrg# XORG_WITH_FOP           --with-fop
10938b242714cSmrg# XORG_WITH_GROFF         --with-groff
10939b242714cSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
10940b242714cSmrg#
10941b242714cSmrg# Interface to module:
10942b242714cSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
10943b242714cSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
10944b242714cSmrg#			'no' user instructs the module not to generate developer docs
10945b242714cSmrg# parm1:		specify the default value, yes or no.
10946b242714cSmrg#
10947b242714cSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
10948b242714cSmrgm4_define([devel_default], m4_default([$1], [yes]))
10949b242714cSmrgAC_ARG_ENABLE(devel-docs,
10950b242714cSmrg	AS_HELP_STRING([--enable-devel-docs],
10951b242714cSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
10952b242714cSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
10953b242714cSmrgm4_undefine([devel_default])
10954b242714cSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
10955b242714cSmrgAC_MSG_CHECKING([whether to build developer documentation])
10956b242714cSmrgAC_MSG_RESULT([$build_devel_docs])
10957b242714cSmrg]) # XORG_ENABLE_DEVEL_DOCS
109588c4a8e55Smrg
10959b242714cSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
10960b242714cSmrg# ----------------
10961b242714cSmrg# Minimum version: 1.6.0
10962b242714cSmrg#
10963b242714cSmrg# This macro enables a builder to skip all functional specification targets.
10964b242714cSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10965b242714cSmrg# maximum flexibilty in controlling documentation building.
10966b242714cSmrg# Refer to:
10967b242714cSmrg# XORG_WITH_XMLTO         --with-xmlto
10968b242714cSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10969b242714cSmrg# XORG_WITH_DOXYGEN       --with-doxygen
10970b242714cSmrg# XORG_WITH_FOP           --with-fop
10971b242714cSmrg# XORG_WITH_GROFF         --with-groff
10972b242714cSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
10973b242714cSmrg#
10974b242714cSmrg# Interface to module:
10975b242714cSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
10976b242714cSmrg# --enable-specs:	'yes' user instructs the module to generate specs
10977b242714cSmrg#			'no' user instructs the module not to generate specs
10978b242714cSmrg# parm1:		specify the default value, yes or no.
10979b242714cSmrg#
10980b242714cSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
10981b242714cSmrgm4_define([spec_default], m4_default([$1], [yes]))
10982b242714cSmrgAC_ARG_ENABLE(specs,
10983b242714cSmrg	AS_HELP_STRING([--enable-specs],
10984b242714cSmrg	   [Enable building the specs (default: ]spec_default[)]),
10985b242714cSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
10986b242714cSmrgm4_undefine([spec_default])
10987b242714cSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
10988b242714cSmrgAC_MSG_CHECKING([whether to build functional specifications])
10989b242714cSmrgAC_MSG_RESULT([$build_specs])
10990b242714cSmrg]) # XORG_ENABLE_SPECS
109918c4a8e55Smrg
10992b242714cSmrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
10993b242714cSmrg# ----------------------------------------------
10994b242714cSmrg# Minimum version: 1.13.0
109958bd17e5fSmrg#
10996b242714cSmrg# This macro enables a builder to enable/disable unit testing
10997b242714cSmrg# It makes no assumption about the test cases implementation
10998b242714cSmrg# Test cases may or may not use Automake "Support for test suites"
10999b242714cSmrg# They may or may not use the software utility library GLib
11000b242714cSmrg#
11001b242714cSmrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
11002b242714cSmrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
11003b242714cSmrg# The variable enable_unit_tests is used by other macros in this file.
11004b242714cSmrg#
11005b242714cSmrg# Interface to module:
11006b242714cSmrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
11007b242714cSmrg# enable_unit_tests:    used in configure.ac for additional configuration
11008b242714cSmrg# --enable-unit-tests:	'yes' user instructs the module to build tests
11009b242714cSmrg#			'no' user instructs the module not to build tests
11010b242714cSmrg# parm1:		specify the default value, yes or no.
11011b242714cSmrg#
11012b242714cSmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
11013b242714cSmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
11014b242714cSmrgAC_BEFORE([$0], [XORG_LD_WRAP])
11015b242714cSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
11016b242714cSmrgm4_define([_defopt], m4_default([$1], [auto]))
11017b242714cSmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
11018b242714cSmrg	[Enable building unit test cases (default: ]_defopt[)]),
11019b242714cSmrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
11020b242714cSmrgm4_undefine([_defopt])
11021b242714cSmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
11022b242714cSmrgAC_MSG_CHECKING([whether to build unit test cases])
11023b242714cSmrgAC_MSG_RESULT([$enable_unit_tests])
11024b242714cSmrg]) # XORG_ENABLE_UNIT_TESTS
1102567594505Smrg
11026b242714cSmrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
11027b242714cSmrg# ------------------------------------------------------
11028b242714cSmrg# Minimum version: 1.17.0
11029b242714cSmrg#
11030b242714cSmrg# This macro enables a builder to enable/disable integration testing
11031b242714cSmrg# It makes no assumption about the test cases' implementation
11032b242714cSmrg# Test cases may or may not use Automake "Support for test suites"
11033b242714cSmrg#
11034b242714cSmrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
11035b242714cSmrg# usually requires less dependencies and may be built and run under less
11036b242714cSmrg# stringent environments than integration tests.
11037b242714cSmrg#
11038b242714cSmrg# Interface to module:
11039b242714cSmrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
11040b242714cSmrg# enable_integration_tests:   used in configure.ac for additional configuration
11041b242714cSmrg# --enable-integration-tests: 'yes' user instructs the module to build tests
11042b242714cSmrg#                             'no' user instructs the module not to build tests
11043b242714cSmrg# parm1:                      specify the default value, yes or no.
11044b242714cSmrg#
11045b242714cSmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
11046b242714cSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
11047b242714cSmrgm4_define([_defopt], m4_default([$1], [auto]))
11048b242714cSmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
11049b242714cSmrg	[Enable building integration test cases (default: ]_defopt[)]),
11050b242714cSmrg	[enable_integration_tests=$enableval],
11051b242714cSmrg	[enable_integration_tests=]_defopt)
11052b242714cSmrgm4_undefine([_defopt])
11053b242714cSmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
11054b242714cSmrg	[test "x$enable_integration_tests" != xno])
11055b242714cSmrgAC_MSG_CHECKING([whether to build unit test cases])
11056b242714cSmrgAC_MSG_RESULT([$enable_integration_tests])
11057b242714cSmrg]) # XORG_ENABLE_INTEGRATION_TESTS
1105867594505Smrg
11059b242714cSmrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
11060b242714cSmrg# ----------------------------------------
11061b242714cSmrg# Minimum version: 1.13.0
110628bd17e5fSmrg#
11063b242714cSmrg# GLib is a library which provides advanced data structures and functions.
11064b242714cSmrg# This macro enables a module to test for the presence of Glib.
11065b242714cSmrg#
11066b242714cSmrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
11067b242714cSmrg# Otherwise the value of $enable_unit_tests is blank.
11068b242714cSmrg#
11069b242714cSmrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
11070b242714cSmrg# test support usually requires less dependencies and may be built and run under
11071b242714cSmrg# less stringent environments than integration tests.
11072b242714cSmrg#
11073b242714cSmrg# Interface to module:
11074b242714cSmrg# HAVE_GLIB: used in makefiles to conditionally build targets
11075b242714cSmrg# with_glib: used in configure.ac to know if GLib has been found
11076b242714cSmrg# --with-glib:	'yes' user instructs the module to use glib
11077b242714cSmrg#		'no' user instructs the module not to use glib
11078b242714cSmrg#
11079b242714cSmrgAC_DEFUN([XORG_WITH_GLIB],[
11080b242714cSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
11081b242714cSmrgm4_define([_defopt], m4_default([$2], [auto]))
11082b242714cSmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
11083b242714cSmrg	[Use GLib library for unit testing (default: ]_defopt[)]),
11084b242714cSmrg	[with_glib=$withval], [with_glib=]_defopt)
11085b242714cSmrgm4_undefine([_defopt])
11086b042e37fSmrg
11087b242714cSmrghave_glib=no
11088b242714cSmrg# Do not probe GLib if user explicitly disabled unit testing
11089b242714cSmrgif test "x$enable_unit_tests" != x"no"; then
11090b242714cSmrg  # Do not probe GLib if user explicitly disabled it
11091b242714cSmrg  if test "x$with_glib" != x"no"; then
11092b242714cSmrg    m4_ifval(
11093b242714cSmrg      [$1],
11094b242714cSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
11095b242714cSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
11096b242714cSmrg    )
11097b242714cSmrg  fi
11098b242714cSmrgfi
11099b042e37fSmrg
11100b242714cSmrg# Not having GLib when unit testing has been explicitly requested is an error
11101b242714cSmrgif test "x$enable_unit_tests" = x"yes"; then
11102b242714cSmrg  if test "x$have_glib" = x"no"; then
11103b242714cSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1110467594505Smrg  fi
111050597fb56Smrgfi
111060597fb56Smrg
11107b242714cSmrg# Having unit testing disabled when GLib has been explicitly requested is an error
11108b242714cSmrgif test "x$enable_unit_tests" = x"no"; then
11109b242714cSmrg  if test "x$with_glib" = x"yes"; then
11110b242714cSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1111167594505Smrg  fi
1111267594505Smrgfi
111138bd17e5fSmrg
11114b242714cSmrg# Not having GLib when it has been explicitly requested is an error
11115b242714cSmrgif test "x$with_glib" = x"yes"; then
11116b242714cSmrg  if test "x$have_glib" = x"no"; then
11117b242714cSmrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
11118b242714cSmrg  fi
11119b242714cSmrgfi
111208bd17e5fSmrg
11121b242714cSmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
11122b242714cSmrg]) # XORG_WITH_GLIB
111238bd17e5fSmrg
11124b242714cSmrg# XORG_LD_WRAP([required|optional])
11125b242714cSmrg# ---------------------------------
11126b242714cSmrg# Minimum version: 1.13.0
11127b242714cSmrg#
11128b242714cSmrg# Check if linker supports -wrap, passed via compiler flags
11129b242714cSmrg#
11130b242714cSmrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
11131b242714cSmrg# Otherwise the value of $enable_unit_tests is blank.
11132b242714cSmrg#
11133b242714cSmrg# Argument added in 1.16.0 - default is "required", to match existing behavior
11134b242714cSmrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
11135b242714cSmrg# available, an argument of "optional" allows use when some unit tests require
11136b242714cSmrg# ld -wrap and others do not.
11137b242714cSmrg#
11138b242714cSmrgAC_DEFUN([XORG_LD_WRAP],[
11139b242714cSmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
11140b242714cSmrg    [AC_LANG_PROGRAM([#include <stdlib.h>
11141b242714cSmrg                      void __wrap_exit(int status) { return; }],
11142b242714cSmrg                     [exit(0);])])
11143b242714cSmrg# Not having ld wrap when unit testing has been explicitly requested is an error
11144b242714cSmrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
11145b242714cSmrg  if test "x$have_ld_wrap" = x"no"; then
11146b242714cSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
11147b242714cSmrg  fi
11148b242714cSmrgfi
11149b242714cSmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
11150b242714cSmrg#
11151b242714cSmrg]) # XORG_LD_WRAP
11152b242714cSmrg
11153b242714cSmrg# XORG_CHECK_LINKER_FLAGS
11154b242714cSmrg# -----------------------
11155b242714cSmrg# SYNOPSIS
11156b242714cSmrg#
11157b242714cSmrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
11158b242714cSmrg#
11159b242714cSmrg# DESCRIPTION
11160b242714cSmrg#
11161b242714cSmrg#   Check whether the given linker FLAGS work with the current language's
11162b242714cSmrg#   linker, or whether they give an error.
11163b242714cSmrg#
11164b242714cSmrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
11165b242714cSmrg#   success/failure.
11166b242714cSmrg#
11167b242714cSmrg#   PROGRAM-SOURCE is the program source to link with, if needed
11168b242714cSmrg#
11169b242714cSmrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
11170b242714cSmrg#
11171b242714cSmrg# LICENSE
11172b242714cSmrg#
11173b242714cSmrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
11174b242714cSmrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
11175b242714cSmrg#   Copyright (c) 2009 Matteo Frigo
11176b242714cSmrg#
11177b242714cSmrg#   This program is free software: you can redistribute it and/or modify it
11178b242714cSmrg#   under the terms of the GNU General Public License as published by the
11179b242714cSmrg#   Free Software Foundation, either version 3 of the License, or (at your
11180b242714cSmrg#   option) any later version.
11181b242714cSmrg#
11182b242714cSmrg#   This program is distributed in the hope that it will be useful, but
11183b242714cSmrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
11184b242714cSmrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11185b242714cSmrg#   Public License for more details.
11186b242714cSmrg#
11187b242714cSmrg#   You should have received a copy of the GNU General Public License along
11188b242714cSmrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
11189b242714cSmrg#
11190b242714cSmrg#   As a special exception, the respective Autoconf Macro's copyright owner
11191b242714cSmrg#   gives unlimited permission to copy, distribute and modify the configure
11192b242714cSmrg#   scripts that are the output of Autoconf when processing the Macro. You
11193b242714cSmrg#   need not follow the terms of the GNU General Public License when using
11194b242714cSmrg#   or distributing such scripts, even though portions of the text of the
11195b242714cSmrg#   Macro appear in them. The GNU General Public License (GPL) does govern
11196b242714cSmrg#   all other use of the material that constitutes the Autoconf Macro.
11197b242714cSmrg#
11198b242714cSmrg#   This special exception to the GPL applies to versions of the Autoconf
11199b242714cSmrg#   Macro released by the Autoconf Archive. When you make and distribute a
11200b242714cSmrg#   modified version of the Autoconf Macro, you may extend this special
11201b242714cSmrg#   exception to the GPL to apply to your modified version as well.#
11202b242714cSmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
11203b242714cSmrg[AC_MSG_CHECKING([whether the linker accepts $1])
11204b242714cSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
11205b242714cSmrgAS_LITERAL_IF([$1],
11206b242714cSmrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
11207b242714cSmrg      ax_save_FLAGS=$LDFLAGS
11208b242714cSmrg      LDFLAGS="$1"
11209b242714cSmrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
11210b242714cSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
11211b242714cSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
11212b242714cSmrg      LDFLAGS=$ax_save_FLAGS])],
11213b242714cSmrg  [ax_save_FLAGS=$LDFLAGS
11214b242714cSmrg   LDFLAGS="$1"
11215b242714cSmrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
11216b242714cSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
11217b242714cSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
11218b242714cSmrg   LDFLAGS=$ax_save_FLAGS])
11219b242714cSmrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
11220b242714cSmrgAC_MSG_RESULT($xorg_check_linker_flags)
11221b242714cSmrgif test "x$xorg_check_linker_flags" = xyes; then
11222b242714cSmrg	m4_default([$2], :)
11223b242714cSmrgelse
11224b242714cSmrg	m4_default([$3], :)
11225b242714cSmrgfi
11226b242714cSmrg]) # XORG_CHECK_LINKER_FLAGS
1122767594505Smrg
11228b242714cSmrg# XORG_MEMORY_CHECK_FLAGS
11229b242714cSmrg# -----------------------
11230b242714cSmrg# Minimum version: 1.16.0
11231b242714cSmrg#
11232b242714cSmrg# This macro attempts to find appropriate memory checking functionality
11233b242714cSmrg# for various platforms which unit testing code may use to catch various
11234b242714cSmrg# forms of memory allocation and access errors in testing.
11235b242714cSmrg#
11236b242714cSmrg# Interface to module:
11237b242714cSmrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
11238b242714cSmrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
11239b242714cSmrg#
11240b242714cSmrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
11241b242714cSmrg#
11242b242714cSmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
11243b242714cSmrg
11244b242714cSmrgAC_REQUIRE([AC_CANONICAL_HOST])
11245b242714cSmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
11246b242714cSmrg           [Environment variables to enable memory checking in tests])
112478c4a8e55Smrg
11248b242714cSmrg# Check for different types of support on different platforms
11249b242714cSmrgcase $host_os in
11250b242714cSmrg    solaris*)
11251b242714cSmrg        AC_CHECK_LIB([umem], [umem_alloc],
11252b242714cSmrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
11253b242714cSmrg        ;;
11254b242714cSmrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
11255b242714cSmrg        # both directly and inverted, so should not be 0 or 255.
11256b242714cSmrg        malloc_debug_env='MALLOC_PERTURB_=15'
11257b242714cSmrg        ;;
11258b242714cSmrg    darwin*)
11259b242714cSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
11260b242714cSmrg        ;;
11261b242714cSmrg    *bsd*)
11262b242714cSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
11263b242714cSmrg        ;;
11264b242714cSmrgesac
112658c4a8e55Smrg
11266b242714cSmrg# User supplied flags override default flags
11267b242714cSmrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
11268b242714cSmrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
11269b242714cSmrgfi
112708c4a8e55Smrg
11271b242714cSmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
11272b242714cSmrg]) # XORG_WITH_LINT
112738c4a8e55Smrg
11274b242714cSmrg# XORG_CHECK_MALLOC_ZERO
11275b242714cSmrg# ----------------------
11276b242714cSmrg# Minimum version: 1.0.0
1127767594505Smrg#
11278b242714cSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
11279b242714cSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
11280b242714cSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
11281b242714cSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
11282b242714cSmrgAC_ARG_ENABLE(malloc0returnsnull,
11283b242714cSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
11284b242714cSmrg		       [malloc(0) returns NULL (default: auto)]),
11285b242714cSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
11286b242714cSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
112878c4a8e55Smrg
11288b242714cSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
11289b242714cSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
11290b242714cSmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
11291b242714cSmrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
11292b242714cSmrg#include <stdlib.h>
11293b242714cSmrg],[
11294b242714cSmrg    char *m0, *r0, *c0, *p;
11295b242714cSmrg    m0 = malloc(0);
11296b242714cSmrg    p = malloc(10);
11297b242714cSmrg    r0 = realloc(p,0);
11298b242714cSmrg    c0 = calloc(0,10);
11299b242714cSmrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
11300b242714cSmrg])],
11301b242714cSmrg		[xorg_cv_malloc0_returns_null=yes],
11302b242714cSmrg		[xorg_cv_malloc0_returns_null=no])])
11303b242714cSmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
113048bd17e5fSmrgfi
11305b242714cSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
11306706b6b52Smrg
11307b242714cSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
11308b242714cSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
11309b242714cSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
11310b242714cSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1131167594505Smrgelse
11312b242714cSmrg	MALLOC_ZERO_CFLAGS=""
11313b242714cSmrg	XMALLOC_ZERO_CFLAGS=""
11314b242714cSmrg	XTMALLOC_ZERO_CFLAGS=""
1131567594505Smrgfi
11316706b6b52Smrg
11317b242714cSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
11318b242714cSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
11319b242714cSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
11320b242714cSmrg]) # XORG_CHECK_MALLOC_ZERO
11321706b6b52Smrg
11322b242714cSmrg# XORG_WITH_LINT()
11323b242714cSmrg# ----------------
11324b242714cSmrg# Minimum version: 1.1.0
1132567594505Smrg#
11326b242714cSmrg# This macro enables the use of a tool that flags some suspicious and
11327b242714cSmrg# non-portable constructs (likely to be bugs) in C language source code.
11328b242714cSmrg# It will attempt to locate the tool and use appropriate options.
11329b242714cSmrg# There are various lint type tools on different platforms.
113308bd17e5fSmrg#
11331b242714cSmrg# Interface to module:
11332b242714cSmrg# LINT:		returns the path to the tool found on the platform
11333b242714cSmrg#		or the value set to LINT on the configure cmd line
11334b242714cSmrg#		also an Automake conditional
11335b242714cSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
11336b242714cSmrg#
11337b242714cSmrg# --with-lint:	'yes' user instructs the module to use lint
11338b242714cSmrg#		'no' user instructs the module not to use lint (default)
11339b242714cSmrg#
11340b242714cSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
11341b242714cSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
11342b242714cSmrg#
11343b242714cSmrgAC_DEFUN([XORG_WITH_LINT],[
113448c4a8e55Smrg
11345b242714cSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
11346b242714cSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
11347b242714cSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
11348b242714cSmrg		[Use a lint-style source code checker (default: disabled)])],
11349b242714cSmrg		[use_lint=$withval], [use_lint=no])
113508c4a8e55Smrg
11351b242714cSmrg# Obtain platform specific info like program name and options
11352b242714cSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
11353b242714cSmrgcase $host_os in
11354b242714cSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
11355b242714cSmrg	lint_name=splint
11356b242714cSmrg	lint_options="-badflag"
11357b242714cSmrg	;;
11358b242714cSmrg  *freebsd* | *netbsd*)
11359b242714cSmrg	lint_name=lint
11360b242714cSmrg	lint_options="-u -b"
11361b242714cSmrg	;;
11362b242714cSmrg  *solaris*)
11363b242714cSmrg	lint_name=lint
11364b242714cSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
11365b242714cSmrg	;;
11366b242714cSmrgesac
11367b242714cSmrg
11368b242714cSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
11369b242714cSmrgif test "x$use_lint" = x"yes" ; then
11370b242714cSmrg   AC_PATH_PROG([LINT], [$lint_name])
11371b242714cSmrg   if test "x$LINT" = "x"; then
11372b242714cSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
11373b242714cSmrg   fi
11374b242714cSmrgelif test "x$use_lint" = x"no" ; then
11375b242714cSmrg   if test "x$LINT" != "x"; then
11376b242714cSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
11377b242714cSmrg   fi
113780597fb56Smrgelse
11379b242714cSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
113800597fb56Smrgfi
11381706b6b52Smrg
11382b242714cSmrg# User supplied flags override default flags
11383b242714cSmrgif test "x$LINT_FLAGS" != "x"; then
11384b242714cSmrg   lint_options=$LINT_FLAGS
11385b242714cSmrgfi
1138667594505Smrg
11387b242714cSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
11388b242714cSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
1138967594505Smrg
11390b242714cSmrg]) # XORG_WITH_LINT
1139167594505Smrg
11392b242714cSmrg# XORG_LINT_LIBRARY(LIBNAME)
11393b242714cSmrg# --------------------------
11394b242714cSmrg# Minimum version: 1.1.0
11395b242714cSmrg#
11396b242714cSmrg# Sets up flags for building lint libraries for checking programs that call
11397b242714cSmrg# functions in the library.
11398b242714cSmrg#
11399b242714cSmrg# Interface to module:
11400b242714cSmrg# LINTLIB		- Automake variable with the name of lint library file to make
11401b242714cSmrg# MAKE_LINT_LIB		- Automake conditional
11402b242714cSmrg#
11403b242714cSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
11404b242714cSmrg#			  - 'no' user instructs the module not to create a lint library (default)
1140567594505Smrg
11406b242714cSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
11407b242714cSmrgAC_REQUIRE([XORG_WITH_LINT])
11408b242714cSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
11409b242714cSmrg	[Create lint library (default: disabled)])],
11410b242714cSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
11411706b6b52Smrg
11412b242714cSmrgif test "x$make_lint_lib" = x"yes" ; then
11413b242714cSmrg   LINTLIB=llib-l$1.ln
11414b242714cSmrg   if test "x$LINT" = "x"; then
11415b242714cSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
11416b242714cSmrg   fi
11417b242714cSmrgelif test "x$make_lint_lib" != x"no" ; then
11418b242714cSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
11419b242714cSmrgfi
11420706b6b52Smrg
11421b242714cSmrgAC_SUBST(LINTLIB)
11422b242714cSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
11423706b6b52Smrg
11424b242714cSmrg]) # XORG_LINT_LIBRARY
11425b242714cSmrg
11426b242714cSmrg# XORG_COMPILER_BRAND
11427b242714cSmrg# -------------------
11428b242714cSmrg# Minimum version: 1.14.0
1142967594505Smrg#
11430b242714cSmrg# Checks for various brands of compilers and sets flags as appropriate:
11431b242714cSmrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
11432b242714cSmrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
11433b242714cSmrg#   clang compiler - sets CLANGCC to "yes"
11434b242714cSmrg#   Intel compiler - sets INTELCC to "yes"
11435b242714cSmrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
11436b242714cSmrg#
11437b242714cSmrgAC_DEFUN([XORG_COMPILER_BRAND], [
11438b242714cSmrgAC_LANG_CASE(
11439b242714cSmrg	[C], [
11440b242714cSmrg		AC_REQUIRE([AC_PROG_CC_C99])
11441b242714cSmrg	],
11442b242714cSmrg	[C++], [
11443b242714cSmrg		AC_REQUIRE([AC_PROG_CXX])
11444b242714cSmrg	]
11445b242714cSmrg)
11446b242714cSmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
11447b242714cSmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
11448b242714cSmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
11449b242714cSmrg]) # XORG_COMPILER_BRAND
114500597fb56Smrg
11451b242714cSmrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
1145267594505Smrg# ---------------
11453b242714cSmrg# Minimum version: 1.16.0
11454b242714cSmrg#
11455b242714cSmrg# Test if the compiler works when passed the given flag as a command line argument.
11456b242714cSmrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
11457b242714cSmrg# next flag in the list until there are no more options.
11458b242714cSmrg#
11459b242714cSmrg# Note that this does not guarantee that the compiler supports the flag as some
11460b242714cSmrg# compilers will simply ignore arguments that they do not understand, but we do
11461b242714cSmrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
11462b242714cSmrg# -Werror=unused-command-line-argument
11463b242714cSmrg#
11464b242714cSmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
11465b242714cSmrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11466b242714cSmrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
114670597fb56Smrg
11468b242714cSmrgAC_LANG_COMPILER_REQUIRE
1146967594505Smrg
11470b242714cSmrgAC_LANG_CASE(
11471b242714cSmrg	[C], [
11472b242714cSmrg		AC_REQUIRE([AC_PROG_CC_C99])
11473b242714cSmrg		define([PREFIX], [C])
11474b242714cSmrg		define([CACHE_PREFIX], [cc])
11475b242714cSmrg		define([COMPILER], [$CC])
11476b242714cSmrg	],
11477b242714cSmrg	[C++], [
11478b242714cSmrg		define([PREFIX], [CXX])
11479b242714cSmrg		define([CACHE_PREFIX], [cxx])
11480b242714cSmrg		define([COMPILER], [$CXX])
11481b242714cSmrg	]
11482b242714cSmrg)
11483b242714cSmrg
11484b242714cSmrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
11485b242714cSmrg
11486b242714cSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
11487b242714cSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11488b242714cSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
11489b242714cSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
11490b242714cSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11491b242714cSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
11492b242714cSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
11493b242714cSmrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
11494b242714cSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
114950597fb56Smrgfi
11496b242714cSmrg
11497b242714cSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
11498b242714cSmrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
11499b242714cSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11500b242714cSmrg	fi
11501b242714cSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11502b242714cSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
11503b242714cSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
11504b242714cSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11505b242714cSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
11506b242714cSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
11507b242714cSmrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
11508b242714cSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1150967594505Smrgfi
11510b242714cSmrg
11511b242714cSmrgfound="no"
11512b242714cSmrgm4_foreach([flag], m4_cdr($@), [
11513b242714cSmrg	if test $found = "no" ; then
11514b242714cSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
11515b242714cSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11516b242714cSmrg		fi
11517b242714cSmrg
11518b242714cSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
11519b242714cSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11520b242714cSmrg		fi
11521b242714cSmrg
11522b242714cSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
11523b242714cSmrg
11524b242714cSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
11525b242714cSmrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
11526b242714cSmrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
11527b242714cSmrg		AC_CACHE_VAL($cacheid,
11528b242714cSmrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
11529b242714cSmrg					     [eval $cacheid=yes],
11530b242714cSmrg					     [eval $cacheid=no])])
11531b242714cSmrg
11532b242714cSmrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11533b242714cSmrg
11534b242714cSmrg		eval supported=\$$cacheid
11535b242714cSmrg		AC_MSG_RESULT([$supported])
11536b242714cSmrg		if test "$supported" = "yes" ; then
11537b242714cSmrg			$1="$$1 ]flag["
11538b242714cSmrg			found="yes"
11539b242714cSmrg		fi
11540b242714cSmrg	fi
1154167594505Smrg])
11542b242714cSmrg]) # XORG_TESTSET_CFLAG
115430597fb56Smrg
11544b242714cSmrg# XORG_COMPILER_FLAGS
11545b242714cSmrg# ---------------
11546b242714cSmrg# Minimum version: 1.16.0
115478bd17e5fSmrg#
11548b242714cSmrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
11549b242714cSmrg# arguments supported by the selected compiler which do NOT alter the generated
11550b242714cSmrg# code.  These arguments will cause the compiler to print various warnings
11551b242714cSmrg# during compilation AND turn a conservative set of warnings into errors.
11552b242714cSmrg#
11553b242714cSmrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
11554b242714cSmrg# future versions of util-macros as options are added to new compilers.
11555b242714cSmrg#
11556b242714cSmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
11557b242714cSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
115588c4a8e55Smrg
11559b242714cSmrgAC_ARG_ENABLE(selective-werror,
11560b242714cSmrg              AS_HELP_STRING([--disable-selective-werror],
11561b242714cSmrg                             [Turn off selective compiler errors. (default: enabled)]),
11562b242714cSmrg              [SELECTIVE_WERROR=$enableval],
11563b242714cSmrg              [SELECTIVE_WERROR=yes])
11564b242714cSmrg
11565b242714cSmrgAC_LANG_CASE(
11566b242714cSmrg        [C], [
11567b242714cSmrg                define([PREFIX], [C])
11568b242714cSmrg        ],
11569b242714cSmrg        [C++], [
11570b242714cSmrg                define([PREFIX], [CXX])
11571b242714cSmrg        ]
11572b242714cSmrg)
11573b242714cSmrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
11574b242714cSmrgif test "x$SUNCC" = "xyes"; then
11575b242714cSmrg    [BASE_]PREFIX[FLAGS]="-v"
1157667594505Smrgelse
11577b242714cSmrg    [BASE_]PREFIX[FLAGS]=""
1157867594505Smrgfi
1157967594505Smrg
11580b242714cSmrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
11581b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
11582b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
11583b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
11584b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
1158567594505Smrg
11586b242714cSmrgAC_LANG_CASE(
11587b242714cSmrg	[C], [
11588b242714cSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
11589b242714cSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
11590b242714cSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
11591b242714cSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
11592b242714cSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
11593b242714cSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
11594b242714cSmrg	]
11595b242714cSmrg)
115968c4a8e55Smrg
11597b242714cSmrg# This chunk adds additional warnings that could catch undesired effects.
11598b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
11599b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
11600b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
11601b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
11602b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
11603b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
11604b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
116058c4a8e55Smrg
11606b242714cSmrg# These are currently disabled because they are noisy.  They will be enabled
11607b242714cSmrg# in the future once the codebase is sufficiently modernized to silence
11608b242714cSmrg# them.  For now, I don't want them to drown out the other warnings.
11609b242714cSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
11610b242714cSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
11611b242714cSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
11612706b6b52Smrg
11613b242714cSmrg# Turn some warnings into errors, so we don't accidently get successful builds
11614b242714cSmrg# when there are problems that should be fixed.
11615706b6b52Smrg
11616b242714cSmrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
11617b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
11618b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
11619b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
11620b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
11621b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
11622b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
11623b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
11624b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
11625b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
11626b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
11627b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
11628b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
11629b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
11630b242714cSmrgelse
11631b242714cSmrgAC_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])
11632b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
11633b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
11634b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
11635b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
11636b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
11637b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
11638b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
11639b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
11640b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
11641b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
11642b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
11643b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
11644b242714cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
11645b242714cSmrgfi
116468c4a8e55Smrg
11647b242714cSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
11648b242714cSmrg]) # XORG_COMPILER_FLAGS
116498c4a8e55Smrg
11650b242714cSmrg# XORG_CWARNFLAGS
11651b242714cSmrg# ---------------
11652b242714cSmrg# Minimum version: 1.2.0
11653b242714cSmrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
116548bd17e5fSmrg#
11655b242714cSmrg# Defines CWARNFLAGS to enable C compiler warnings.
116568bd17e5fSmrg#
11657b242714cSmrg# This function is deprecated because it defines -fno-strict-aliasing
11658b242714cSmrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
11659b242714cSmrg# is needed, then it should be added explicitly in the module when
11660b242714cSmrg# it is updated to use BASE_CFLAGS.
11661b242714cSmrg#
11662b242714cSmrgAC_DEFUN([XORG_CWARNFLAGS], [
11663b242714cSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
11664b242714cSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
11665b242714cSmrgAC_LANG_CASE(
11666b242714cSmrg	[C], [
11667b242714cSmrg		CWARNFLAGS="$BASE_CFLAGS"
11668b242714cSmrg		if  test "x$GCC" = xyes ; then
11669b242714cSmrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
11670b242714cSmrg		fi
11671b242714cSmrg		AC_SUBST(CWARNFLAGS)
11672b242714cSmrg	]
11673b242714cSmrg)
11674b242714cSmrg]) # XORG_CWARNFLAGS
11675fc98c8e2Smrg
11676b242714cSmrg# XORG_STRICT_OPTION
11677b242714cSmrg# -----------------------
11678b242714cSmrg# Minimum version: 1.3.0
11679b242714cSmrg#
11680b242714cSmrg# Add configure option to enable strict compilation flags, such as treating
11681b242714cSmrg# warnings as fatal errors.
11682b242714cSmrg# If --enable-strict-compilation is passed to configure, adds strict flags to
11683b242714cSmrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
11684b242714cSmrg#
11685b242714cSmrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
11686b242714cSmrg# when strict compilation is unconditionally desired.
11687b242714cSmrgAC_DEFUN([XORG_STRICT_OPTION], [
11688b242714cSmrgAC_REQUIRE([XORG_CWARNFLAGS])
11689b242714cSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
116900597fb56Smrg
11691b242714cSmrgAC_ARG_ENABLE(strict-compilation,
11692b242714cSmrg			  AS_HELP_STRING([--enable-strict-compilation],
11693b242714cSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
11694b242714cSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1169567594505Smrg
11696b242714cSmrgAC_LANG_CASE(
11697b242714cSmrg        [C], [
11698b242714cSmrg                define([PREFIX], [C])
11699b242714cSmrg        ],
11700b242714cSmrg        [C++], [
11701b242714cSmrg                define([PREFIX], [CXX])
11702b242714cSmrg        ]
11703b242714cSmrg)
1170467594505Smrg
11705b242714cSmrg[STRICT_]PREFIX[FLAGS]=""
11706b242714cSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
11707b242714cSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
1170867594505Smrg
11709b242714cSmrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
11710b242714cSmrg# activate it with -Werror, so we add it here explicitly.
11711b242714cSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
1171267594505Smrg
11713b242714cSmrgif test "x$STRICT_COMPILE" = "xyes"; then
11714b242714cSmrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
11715b242714cSmrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
11716b242714cSmrgfi
11717b242714cSmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
11718b242714cSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
11719b242714cSmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
11720b242714cSmrg]) # XORG_STRICT_OPTION
1172167594505Smrg
11722b242714cSmrg# XORG_DEFAULT_OPTIONS
11723b242714cSmrg# --------------------
11724b242714cSmrg# Minimum version: 1.3.0
11725b242714cSmrg#
11726b242714cSmrg# Defines default options for X.Org modules.
11727b242714cSmrg#
11728b242714cSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
11729b242714cSmrgAC_REQUIRE([AC_PROG_INSTALL])
11730b242714cSmrgXORG_COMPILER_FLAGS
11731b242714cSmrgXORG_CWARNFLAGS
11732b242714cSmrgXORG_STRICT_OPTION
11733b242714cSmrgXORG_RELEASE_VERSION
11734b242714cSmrgXORG_CHANGELOG
11735b242714cSmrgXORG_INSTALL
11736b242714cSmrgXORG_MANPAGE_SECTIONS
11737b242714cSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
11738b242714cSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
11739b242714cSmrg]) # XORG_DEFAULT_OPTIONS
1174067594505Smrg
11741b242714cSmrg# XORG_INSTALL()
11742b242714cSmrg# ----------------
11743b242714cSmrg# Minimum version: 1.4.0
11744b242714cSmrg#
11745b242714cSmrg# Defines the variable INSTALL_CMD as the command to copy
11746b242714cSmrg# INSTALL from $prefix/share/util-macros.
11747b242714cSmrg#
11748b242714cSmrgAC_DEFUN([XORG_INSTALL], [
11749b242714cSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
11750b242714cSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
11751b242714cSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
11752b242714cSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
11753b242714cSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
11754b242714cSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
11755b242714cSmrgAC_SUBST([INSTALL_CMD])
11756b242714cSmrg]) # XORG_INSTALL
11757b242714cSmrgdnl Copyright 2005 Red Hat, Inc
11758b242714cSmrgdnl
11759b242714cSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
11760b242714cSmrgdnl documentation for any purpose is hereby granted without fee, provided that
11761b242714cSmrgdnl the above copyright notice appear in all copies and that both that
11762b242714cSmrgdnl copyright notice and this permission notice appear in supporting
11763b242714cSmrgdnl documentation.
11764b242714cSmrgdnl
11765b242714cSmrgdnl The above copyright notice and this permission notice shall be included
11766b242714cSmrgdnl in all copies or substantial portions of the Software.
11767b242714cSmrgdnl
11768b242714cSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11769b242714cSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11770b242714cSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11771b242714cSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11772b242714cSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11773b242714cSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11774b242714cSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
11775b242714cSmrgdnl
11776b242714cSmrgdnl Except as contained in this notice, the name of the copyright holders shall
11777b242714cSmrgdnl not be used in advertising or otherwise to promote the sale, use or
11778b242714cSmrgdnl other dealings in this Software without prior written authorization
11779b242714cSmrgdnl from the copyright holders.
11780b242714cSmrgdnl
1178167594505Smrg
11782b242714cSmrg# XORG_RELEASE_VERSION
11783b242714cSmrg# --------------------
11784b242714cSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1178567594505Smrg
11786b242714cSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
11787b242714cSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
11788b242714cSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
11789b242714cSmrg		[Major version of this package])
11790b242714cSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
11791b242714cSmrg	if test "x$PVM" = "x"; then
11792b242714cSmrg		PVM="0"
11793b242714cSmrg	fi
11794b242714cSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
11795b242714cSmrg		[$PVM],
11796b242714cSmrg		[Minor version of this package])
11797b242714cSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
11798b242714cSmrg	if test "x$PVP" = "x"; then
11799b242714cSmrg		PVP="0"
11800b242714cSmrg	fi
11801b242714cSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
11802b242714cSmrg		[$PVP],
11803b242714cSmrg		[Patch version of this package])
11804b242714cSmrg])
1180567594505Smrg
11806b242714cSmrg# XORG_CHANGELOG()
11807b242714cSmrg# ----------------
11808b242714cSmrg# Minimum version: 1.2.0
11809b242714cSmrg#
11810b242714cSmrg# Defines the variable CHANGELOG_CMD as the command to generate
11811b242714cSmrg# ChangeLog from git.
11812b242714cSmrg#
11813b242714cSmrg#
11814b242714cSmrgAC_DEFUN([XORG_CHANGELOG], [
11815b242714cSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
11816b242714cSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
11817b242714cSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
11818b242714cSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
11819b242714cSmrgAC_SUBST([CHANGELOG_CMD])
11820b242714cSmrg]) # XORG_CHANGELOG
11821b042e37fSmrg
11822