aclocal.m4 revision 67594505
167594505Smrg# generated automatically by aclocal 1.13.4 -*- 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*)
13418bd17e5fSmrg	    LD="${LD-ld} -m elf_i386"
13428bd17e5fSmrg	    ;;
134367594505Smrg	  powerpc64le-*linux*)
134467594505Smrg	    LD="${LD-ld} -m elf32lppclinux"
134567594505Smrg	    ;;
134667594505Smrg	  powerpc64-*linux*)
13478bd17e5fSmrg	    LD="${LD-ld} -m elf32ppclinux"
13488bd17e5fSmrg	    ;;
13498bd17e5fSmrg	  s390x-*linux*)
13508bd17e5fSmrg	    LD="${LD-ld} -m elf_s390"
13518bd17e5fSmrg	    ;;
13528bd17e5fSmrg	  sparc64-*linux*)
13538bd17e5fSmrg	    LD="${LD-ld} -m elf32_sparc"
13548bd17e5fSmrg	    ;;
13558bd17e5fSmrg	esac
13568bd17e5fSmrg	;;
13578bd17e5fSmrg      *64-bit*)
13588bd17e5fSmrg	case $host in
13598bd17e5fSmrg	  x86_64-*kfreebsd*-gnu)
13608bd17e5fSmrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
13618bd17e5fSmrg	    ;;
13628bd17e5fSmrg	  x86_64-*linux*)
13638bd17e5fSmrg	    LD="${LD-ld} -m elf_x86_64"
13648bd17e5fSmrg	    ;;
136567594505Smrg	  powerpcle-*linux*)
136667594505Smrg	    LD="${LD-ld} -m elf64lppc"
136767594505Smrg	    ;;
136867594505Smrg	  powerpc-*linux*)
13698bd17e5fSmrg	    LD="${LD-ld} -m elf64ppc"
13708bd17e5fSmrg	    ;;
13718bd17e5fSmrg	  s390*-*linux*|s390*-*tpf*)
13728bd17e5fSmrg	    LD="${LD-ld} -m elf64_s390"
13738bd17e5fSmrg	    ;;
13748bd17e5fSmrg	  sparc*-*linux*)
13758bd17e5fSmrg	    LD="${LD-ld} -m elf64_sparc"
13768bd17e5fSmrg	    ;;
13778bd17e5fSmrg	esac
13788bd17e5fSmrg	;;
13798bd17e5fSmrg    esac
13808bd17e5fSmrg  fi
13818bd17e5fSmrg  rm -rf conftest*
13820597fb56Smrg  ;;
1383b042e37fSmrg
13848bd17e5fSmrg*-*-sco3.2v5*)
13858bd17e5fSmrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
13868bd17e5fSmrg  SAVE_CFLAGS="$CFLAGS"
13878bd17e5fSmrg  CFLAGS="$CFLAGS -belf"
13888bd17e5fSmrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
13898bd17e5fSmrg    [AC_LANG_PUSH(C)
13908bd17e5fSmrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
13918bd17e5fSmrg     AC_LANG_POP])
13928bd17e5fSmrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
13938bd17e5fSmrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
13948bd17e5fSmrg    CFLAGS="$SAVE_CFLAGS"
13958bd17e5fSmrg  fi
13960597fb56Smrg  ;;
13978bd17e5fSmrg*-*solaris*)
13988bd17e5fSmrg  # Find out which ABI we are using.
13998bd17e5fSmrg  echo 'int i;' > conftest.$ac_ext
14008bd17e5fSmrg  if AC_TRY_EVAL(ac_compile); then
14018bd17e5fSmrg    case `/usr/bin/file conftest.o` in
14028bd17e5fSmrg    *64-bit*)
14038bd17e5fSmrg      case $lt_cv_prog_gnu_ld in
14048bd17e5fSmrg      yes*)
14058bd17e5fSmrg        case $host in
14068bd17e5fSmrg        i?86-*-solaris*)
14078bd17e5fSmrg          LD="${LD-ld} -m elf_x86_64"
14088bd17e5fSmrg          ;;
14098bd17e5fSmrg        sparc*-*-solaris*)
14108bd17e5fSmrg          LD="${LD-ld} -m elf64_sparc"
14118bd17e5fSmrg          ;;
14128bd17e5fSmrg        esac
14138bd17e5fSmrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
14148bd17e5fSmrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
14158bd17e5fSmrg          LD="${LD-ld}_sol2"
14168bd17e5fSmrg        fi
14178bd17e5fSmrg        ;;
14188bd17e5fSmrg      *)
14198bd17e5fSmrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
14208bd17e5fSmrg	  LD="${LD-ld} -64"
14218bd17e5fSmrg	fi
14228bd17e5fSmrg	;;
14238bd17e5fSmrg      esac
14248bd17e5fSmrg      ;;
14258bd17e5fSmrg    esac
14268bd17e5fSmrg  fi
14278bd17e5fSmrg  rm -rf conftest*
14280597fb56Smrg  ;;
14298bd17e5fSmrgesac
14308c4a8e55Smrg
14318bd17e5fSmrgneed_locks="$enable_libtool_lock"
14328bd17e5fSmrg])# _LT_ENABLE_LOCK
1433b042e37fSmrg
14348c4a8e55Smrg
14358bd17e5fSmrg# _LT_PROG_AR
14368bd17e5fSmrg# -----------
14378bd17e5fSmrgm4_defun([_LT_PROG_AR],
14388bd17e5fSmrg[AC_CHECK_TOOLS(AR, [ar], false)
14398bd17e5fSmrg: ${AR=ar}
14408bd17e5fSmrg: ${AR_FLAGS=cru}
14418bd17e5fSmrg_LT_DECL([], [AR], [1], [The archiver])
14428bd17e5fSmrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
14438c4a8e55Smrg
14448bd17e5fSmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
14458bd17e5fSmrg  [lt_cv_ar_at_file=no
14468bd17e5fSmrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
14478bd17e5fSmrg     [echo conftest.$ac_objext > conftest.lst
14488bd17e5fSmrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
14498bd17e5fSmrg      AC_TRY_EVAL([lt_ar_try])
14508bd17e5fSmrg      if test "$ac_status" -eq 0; then
14518bd17e5fSmrg	# Ensure the archiver fails upon bogus file names.
14528bd17e5fSmrg	rm -f conftest.$ac_objext libconftest.a
14538bd17e5fSmrg	AC_TRY_EVAL([lt_ar_try])
14548bd17e5fSmrg	if test "$ac_status" -ne 0; then
14558bd17e5fSmrg          lt_cv_ar_at_file=@
14568bd17e5fSmrg        fi
14578bd17e5fSmrg      fi
14588bd17e5fSmrg      rm -f conftest.* libconftest.a
14598bd17e5fSmrg     ])
14608bd17e5fSmrg  ])
1461b042e37fSmrg
14628bd17e5fSmrgif test "x$lt_cv_ar_at_file" = xno; then
14638bd17e5fSmrg  archiver_list_spec=
14648bd17e5fSmrgelse
14658bd17e5fSmrg  archiver_list_spec=$lt_cv_ar_at_file
14668bd17e5fSmrgfi
14678bd17e5fSmrg_LT_DECL([], [archiver_list_spec], [1],
14688bd17e5fSmrg  [How to feed a file listing to the archiver])
14698bd17e5fSmrg])# _LT_PROG_AR
1470b042e37fSmrg
1471b042e37fSmrg
14728bd17e5fSmrg# _LT_CMD_OLD_ARCHIVE
14738bd17e5fSmrg# -------------------
14748bd17e5fSmrgm4_defun([_LT_CMD_OLD_ARCHIVE],
14758bd17e5fSmrg[_LT_PROG_AR
1476b042e37fSmrg
14778bd17e5fSmrgAC_CHECK_TOOL(STRIP, strip, :)
14788bd17e5fSmrgtest -z "$STRIP" && STRIP=:
14798bd17e5fSmrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1480b042e37fSmrg
14818bd17e5fSmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
14828bd17e5fSmrgtest -z "$RANLIB" && RANLIB=:
14838bd17e5fSmrg_LT_DECL([], [RANLIB], [1],
14848bd17e5fSmrg    [Commands used to install an old-style archive])
1485b042e37fSmrg
14868bd17e5fSmrg# Determine commands to create old-style static archives.
14878bd17e5fSmrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
14888bd17e5fSmrgold_postinstall_cmds='chmod 644 $oldlib'
14898bd17e5fSmrgold_postuninstall_cmds=
14908c4a8e55Smrg
14918bd17e5fSmrgif test -n "$RANLIB"; then
14928bd17e5fSmrg  case $host_os in
14938bd17e5fSmrg  openbsd*)
14948bd17e5fSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
14958bd17e5fSmrg    ;;
14968bd17e5fSmrg  *)
14978bd17e5fSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
14988bd17e5fSmrg    ;;
14998bd17e5fSmrg  esac
15008bd17e5fSmrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
15018bd17e5fSmrgfi
1502b042e37fSmrg
15038bd17e5fSmrgcase $host_os in
15048bd17e5fSmrg  darwin*)
15058bd17e5fSmrg    lock_old_archive_extraction=yes ;;
15068bd17e5fSmrg  *)
15078bd17e5fSmrg    lock_old_archive_extraction=no ;;
15088bd17e5fSmrgesac
15098bd17e5fSmrg_LT_DECL([], [old_postinstall_cmds], [2])
15108bd17e5fSmrg_LT_DECL([], [old_postuninstall_cmds], [2])
15118bd17e5fSmrg_LT_TAGDECL([], [old_archive_cmds], [2],
15128bd17e5fSmrg    [Commands used to build an old-style archive])
15138bd17e5fSmrg_LT_DECL([], [lock_old_archive_extraction], [0],
15148bd17e5fSmrg    [Whether to use a lock for old archive extraction])
15158bd17e5fSmrg])# _LT_CMD_OLD_ARCHIVE
1516b042e37fSmrg
1517b042e37fSmrg
15188bd17e5fSmrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
15198bd17e5fSmrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
15208bd17e5fSmrg# ----------------------------------------------------------------
15218bd17e5fSmrg# Check whether the given compiler option works
15228bd17e5fSmrgAC_DEFUN([_LT_COMPILER_OPTION],
15238bd17e5fSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
15248bd17e5fSmrgm4_require([_LT_DECL_SED])dnl
15258bd17e5fSmrgAC_CACHE_CHECK([$1], [$2],
15268bd17e5fSmrg  [$2=no
15278bd17e5fSmrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
15288bd17e5fSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
15298bd17e5fSmrg   lt_compiler_flag="$3"
15308bd17e5fSmrg   # Insert the option either (1) after the last *FLAGS variable, or
15318bd17e5fSmrg   # (2) before a word containing "conftest.", or (3) at the end.
15328bd17e5fSmrg   # Note that $ac_compile itself does not contain backslashes and begins
15338bd17e5fSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
15348bd17e5fSmrg   # The option is referenced via a variable to avoid confusing sed.
15358bd17e5fSmrg   lt_compile=`echo "$ac_compile" | $SED \
15368bd17e5fSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
15378bd17e5fSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
15388bd17e5fSmrg   -e 's:$: $lt_compiler_flag:'`
15398bd17e5fSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
15408bd17e5fSmrg   (eval "$lt_compile" 2>conftest.err)
15418bd17e5fSmrg   ac_status=$?
15428bd17e5fSmrg   cat conftest.err >&AS_MESSAGE_LOG_FD
15438bd17e5fSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
15448bd17e5fSmrg   if (exit $ac_status) && test -s "$ac_outfile"; then
15458bd17e5fSmrg     # The compiler can only warn and ignore the option if not recognized
15468bd17e5fSmrg     # So say no if there are warnings other than the usual output.
15478bd17e5fSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
15488bd17e5fSmrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
15498bd17e5fSmrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
15508bd17e5fSmrg       $2=yes
15518bd17e5fSmrg     fi
15528bd17e5fSmrg   fi
15538bd17e5fSmrg   $RM conftest*
15548bd17e5fSmrg])
15558bd17e5fSmrg
15568bd17e5fSmrgif test x"[$]$2" = xyes; then
15578bd17e5fSmrg    m4_if([$5], , :, [$5])
15580597fb56Smrgelse
15598bd17e5fSmrg    m4_if([$6], , :, [$6])
15600597fb56Smrgfi
15618bd17e5fSmrg])# _LT_COMPILER_OPTION
1562b042e37fSmrg
15630597fb56Smrg# Old name:
15648bd17e5fSmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
15650597fb56Smrgdnl aclocal-1.4 backwards compatibility:
15668bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1567706b6b52Smrg
1568706b6b52Smrg
15698bd17e5fSmrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
15708bd17e5fSmrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
15718bd17e5fSmrg# ----------------------------------------------------
15728bd17e5fSmrg# Check whether the given linker option works
15738bd17e5fSmrgAC_DEFUN([_LT_LINKER_OPTION],
15748bd17e5fSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
15758bd17e5fSmrgm4_require([_LT_DECL_SED])dnl
15768bd17e5fSmrgAC_CACHE_CHECK([$1], [$2],
15778bd17e5fSmrg  [$2=no
15788bd17e5fSmrg   save_LDFLAGS="$LDFLAGS"
15798bd17e5fSmrg   LDFLAGS="$LDFLAGS $3"
15808bd17e5fSmrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
15818bd17e5fSmrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
15828bd17e5fSmrg     # The linker can only warn and ignore the option if not recognized
15838bd17e5fSmrg     # So say no if there are warnings
15848bd17e5fSmrg     if test -s conftest.err; then
15858bd17e5fSmrg       # Append any errors to the config.log.
15868bd17e5fSmrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
15878bd17e5fSmrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
15888bd17e5fSmrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
15898bd17e5fSmrg       if diff conftest.exp conftest.er2 >/dev/null; then
15908bd17e5fSmrg         $2=yes
15918bd17e5fSmrg       fi
15928bd17e5fSmrg     else
15938bd17e5fSmrg       $2=yes
15948bd17e5fSmrg     fi
15958bd17e5fSmrg   fi
15968bd17e5fSmrg   $RM -r conftest*
15978bd17e5fSmrg   LDFLAGS="$save_LDFLAGS"
15988bd17e5fSmrg])
15998bd17e5fSmrg
16008bd17e5fSmrgif test x"[$]$2" = xyes; then
16018bd17e5fSmrg    m4_if([$4], , :, [$4])
16028bd17e5fSmrgelse
16038bd17e5fSmrg    m4_if([$5], , :, [$5])
16040597fb56Smrgfi
16058bd17e5fSmrg])# _LT_LINKER_OPTION
1606706b6b52Smrg
16078bd17e5fSmrg# Old name:
16088bd17e5fSmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
16098bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
16108bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1611706b6b52Smrg
1612706b6b52Smrg
16138bd17e5fSmrg# LT_CMD_MAX_LEN
16148bd17e5fSmrg#---------------
16158bd17e5fSmrgAC_DEFUN([LT_CMD_MAX_LEN],
16168bd17e5fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
16178bd17e5fSmrg# find the maximum length of command line arguments
16188bd17e5fSmrgAC_MSG_CHECKING([the maximum length of command line arguments])
16198bd17e5fSmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
16208bd17e5fSmrg  i=0
16218bd17e5fSmrg  teststring="ABCD"
1622b042e37fSmrg
16238bd17e5fSmrg  case $build_os in
16248bd17e5fSmrg  msdosdjgpp*)
16258bd17e5fSmrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
16268bd17e5fSmrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
16278bd17e5fSmrg    # during glob expansion).  Even if it were fixed, the result of this
16288bd17e5fSmrg    # check would be larger than it should be.
16298bd17e5fSmrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
16300597fb56Smrg    ;;
16318bd17e5fSmrg
16328bd17e5fSmrg  gnu*)
16338bd17e5fSmrg    # Under GNU Hurd, this test is not required because there is
16348bd17e5fSmrg    # no limit to the length of command line arguments.
16358bd17e5fSmrg    # Libtool will interpret -1 as no limit whatsoever
16368bd17e5fSmrg    lt_cv_sys_max_cmd_len=-1;
16370597fb56Smrg    ;;
1638b042e37fSmrg
16398bd17e5fSmrg  cygwin* | mingw* | cegcc*)
16408bd17e5fSmrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
16418bd17e5fSmrg    # about 5 minutes as the teststring grows exponentially.
16428bd17e5fSmrg    # Worse, since 9x/ME are not pre-emptively multitasking,
16438bd17e5fSmrg    # you end up with a "frozen" computer, even though with patience
16448bd17e5fSmrg    # the test eventually succeeds (with a max line length of 256k).
16458bd17e5fSmrg    # Instead, let's just punt: use the minimum linelength reported by
16468bd17e5fSmrg    # all of the supported platforms: 8192 (on NT/2K/XP).
16478bd17e5fSmrg    lt_cv_sys_max_cmd_len=8192;
16488bd17e5fSmrg    ;;
1649b042e37fSmrg
16508bd17e5fSmrg  mint*)
16518bd17e5fSmrg    # On MiNT this can take a long time and run out of memory.
16528bd17e5fSmrg    lt_cv_sys_max_cmd_len=8192;
16538bd17e5fSmrg    ;;
1654b042e37fSmrg
16558bd17e5fSmrg  amigaos*)
16568bd17e5fSmrg    # On AmigaOS with pdksh, this test takes hours, literally.
16578bd17e5fSmrg    # So we just punt and use a minimum line length of 8192.
16588bd17e5fSmrg    lt_cv_sys_max_cmd_len=8192;
16598bd17e5fSmrg    ;;
1660b042e37fSmrg
16618bd17e5fSmrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
16628bd17e5fSmrg    # This has been around since 386BSD, at least.  Likely further.
16638bd17e5fSmrg    if test -x /sbin/sysctl; then
16648bd17e5fSmrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
16658bd17e5fSmrg    elif test -x /usr/sbin/sysctl; then
16668bd17e5fSmrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
16678bd17e5fSmrg    else
16688bd17e5fSmrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
16698bd17e5fSmrg    fi
16708bd17e5fSmrg    # And add a safety zone
16718bd17e5fSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
16728bd17e5fSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
16738bd17e5fSmrg    ;;
1674b042e37fSmrg
16758bd17e5fSmrg  interix*)
16768bd17e5fSmrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
16778bd17e5fSmrg    lt_cv_sys_max_cmd_len=196608
16788bd17e5fSmrg    ;;
1679b042e37fSmrg
16808bd17e5fSmrg  os2*)
16818bd17e5fSmrg    # The test takes a long time on OS/2.
16828bd17e5fSmrg    lt_cv_sys_max_cmd_len=8192
16838bd17e5fSmrg    ;;
16848bd17e5fSmrg
16858bd17e5fSmrg  osf*)
16868bd17e5fSmrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
16878bd17e5fSmrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
16888bd17e5fSmrg    # nice to cause kernel panics so lets avoid the loop below.
16898bd17e5fSmrg    # First set a reasonable default.
16908bd17e5fSmrg    lt_cv_sys_max_cmd_len=16384
16918bd17e5fSmrg    #
16928bd17e5fSmrg    if test -x /sbin/sysconfig; then
16938bd17e5fSmrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
16948bd17e5fSmrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
16958bd17e5fSmrg      esac
16960597fb56Smrg    fi
16970597fb56Smrg    ;;
16988bd17e5fSmrg  sco3.2v5*)
16998bd17e5fSmrg    lt_cv_sys_max_cmd_len=102400
17008bd17e5fSmrg    ;;
17018bd17e5fSmrg  sysv5* | sco5v6* | sysv4.2uw2*)
17028bd17e5fSmrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
17038bd17e5fSmrg    if test -n "$kargmax"; then
17048bd17e5fSmrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
17050597fb56Smrg    else
17068bd17e5fSmrg      lt_cv_sys_max_cmd_len=32768
17070597fb56Smrg    fi
17080597fb56Smrg    ;;
17098bd17e5fSmrg  *)
17108bd17e5fSmrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
17118bd17e5fSmrg    if test -n "$lt_cv_sys_max_cmd_len"; then
17128bd17e5fSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
17138bd17e5fSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
17148bd17e5fSmrg    else
17158bd17e5fSmrg      # Make teststring a little bigger before we do anything with it.
17168bd17e5fSmrg      # a 1K string should be a reasonable start.
17178bd17e5fSmrg      for i in 1 2 3 4 5 6 7 8 ; do
17188bd17e5fSmrg        teststring=$teststring$teststring
17198bd17e5fSmrg      done
17208bd17e5fSmrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
17218bd17e5fSmrg      # If test is not a shell built-in, we'll probably end up computing a
17228bd17e5fSmrg      # maximum length that is only half of the actual maximum length, but
17238bd17e5fSmrg      # we can't tell.
17248bd17e5fSmrg      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
17258bd17e5fSmrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
17268bd17e5fSmrg	      test $i != 17 # 1/2 MB should be enough
17278bd17e5fSmrg      do
17288bd17e5fSmrg        i=`expr $i + 1`
17298bd17e5fSmrg        teststring=$teststring$teststring
17308bd17e5fSmrg      done
17318bd17e5fSmrg      # Only check the string length outside the loop.
17328bd17e5fSmrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
17338bd17e5fSmrg      teststring=
17348bd17e5fSmrg      # Add a significant safety factor because C++ compilers can tack on
17358bd17e5fSmrg      # massive amounts of additional arguments before passing them to the
17368bd17e5fSmrg      # linker.  It appears as though 1/2 is a usable value.
17378bd17e5fSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
17388bd17e5fSmrg    fi
17398bd17e5fSmrg    ;;
17408bd17e5fSmrg  esac
17418bd17e5fSmrg])
17428bd17e5fSmrgif test -n $lt_cv_sys_max_cmd_len ; then
17438bd17e5fSmrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
17448bd17e5fSmrgelse
17458bd17e5fSmrg  AC_MSG_RESULT(none)
17468bd17e5fSmrgfi
17478bd17e5fSmrgmax_cmd_len=$lt_cv_sys_max_cmd_len
17488bd17e5fSmrg_LT_DECL([], [max_cmd_len], [0],
17498bd17e5fSmrg    [What is the maximum length of a command?])
17508bd17e5fSmrg])# LT_CMD_MAX_LEN
1751b042e37fSmrg
17528bd17e5fSmrg# Old name:
17538bd17e5fSmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
17548bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
17558bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
17568c4a8e55Smrg
1757b042e37fSmrg
17588bd17e5fSmrg# _LT_HEADER_DLFCN
17598bd17e5fSmrg# ----------------
17608bd17e5fSmrgm4_defun([_LT_HEADER_DLFCN],
17618bd17e5fSmrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
17628bd17e5fSmrg])# _LT_HEADER_DLFCN
1763b042e37fSmrg
1764b042e37fSmrg
17658bd17e5fSmrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
17668bd17e5fSmrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
17678bd17e5fSmrg# ----------------------------------------------------------------
17688bd17e5fSmrgm4_defun([_LT_TRY_DLOPEN_SELF],
17698bd17e5fSmrg[m4_require([_LT_HEADER_DLFCN])dnl
17708bd17e5fSmrgif test "$cross_compiling" = yes; then :
17718bd17e5fSmrg  [$4]
17728bd17e5fSmrgelse
17738bd17e5fSmrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
17748bd17e5fSmrg  lt_status=$lt_dlunknown
17758bd17e5fSmrg  cat > conftest.$ac_ext <<_LT_EOF
17768bd17e5fSmrg[#line $LINENO "configure"
17778bd17e5fSmrg#include "confdefs.h"
17788c4a8e55Smrg
17798bd17e5fSmrg#if HAVE_DLFCN_H
17808bd17e5fSmrg#include <dlfcn.h>
17818bd17e5fSmrg#endif
17828c4a8e55Smrg
17838bd17e5fSmrg#include <stdio.h>
1784b042e37fSmrg
17858bd17e5fSmrg#ifdef RTLD_GLOBAL
17868bd17e5fSmrg#  define LT_DLGLOBAL		RTLD_GLOBAL
17878bd17e5fSmrg#else
17888bd17e5fSmrg#  ifdef DL_GLOBAL
17898bd17e5fSmrg#    define LT_DLGLOBAL		DL_GLOBAL
17908bd17e5fSmrg#  else
17918bd17e5fSmrg#    define LT_DLGLOBAL		0
17928bd17e5fSmrg#  endif
17938bd17e5fSmrg#endif
1794b042e37fSmrg
17958bd17e5fSmrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
17968bd17e5fSmrg   find out it does not work in some platform. */
17978bd17e5fSmrg#ifndef LT_DLLAZY_OR_NOW
17988bd17e5fSmrg#  ifdef RTLD_LAZY
17998bd17e5fSmrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
18008bd17e5fSmrg#  else
18018bd17e5fSmrg#    ifdef DL_LAZY
18028bd17e5fSmrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
18038bd17e5fSmrg#    else
18048bd17e5fSmrg#      ifdef RTLD_NOW
18058bd17e5fSmrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
18068bd17e5fSmrg#      else
18078bd17e5fSmrg#        ifdef DL_NOW
18088bd17e5fSmrg#          define LT_DLLAZY_OR_NOW	DL_NOW
18098bd17e5fSmrg#        else
18108bd17e5fSmrg#          define LT_DLLAZY_OR_NOW	0
18118bd17e5fSmrg#        endif
18128bd17e5fSmrg#      endif
18138bd17e5fSmrg#    endif
18148bd17e5fSmrg#  endif
18158bd17e5fSmrg#endif
18168c4a8e55Smrg
18178bd17e5fSmrg/* When -fvisbility=hidden is used, assume the code has been annotated
18188bd17e5fSmrg   correspondingly for the symbols needed.  */
18198bd17e5fSmrg#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
18208bd17e5fSmrgint fnord () __attribute__((visibility("default")));
18218bd17e5fSmrg#endif
1822b042e37fSmrg
18238bd17e5fSmrgint fnord () { return 42; }
18248bd17e5fSmrgint main ()
18258bd17e5fSmrg{
18268bd17e5fSmrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
18278bd17e5fSmrg  int status = $lt_dlunknown;
1828b042e37fSmrg
18298bd17e5fSmrg  if (self)
18308bd17e5fSmrg    {
18318bd17e5fSmrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
18328bd17e5fSmrg      else
18338bd17e5fSmrg        {
18348bd17e5fSmrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
18358bd17e5fSmrg          else puts (dlerror ());
18368bd17e5fSmrg	}
18378bd17e5fSmrg      /* dlclose (self); */
18388bd17e5fSmrg    }
18398bd17e5fSmrg  else
18408bd17e5fSmrg    puts (dlerror ());
18418bd17e5fSmrg
18428bd17e5fSmrg  return status;
18438bd17e5fSmrg}]
18448bd17e5fSmrg_LT_EOF
18458bd17e5fSmrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
18468bd17e5fSmrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
18478bd17e5fSmrg    lt_status=$?
18488bd17e5fSmrg    case x$lt_status in
18498bd17e5fSmrg      x$lt_dlno_uscore) $1 ;;
18508bd17e5fSmrg      x$lt_dlneed_uscore) $2 ;;
18518bd17e5fSmrg      x$lt_dlunknown|x*) $3 ;;
18528bd17e5fSmrg    esac
18538bd17e5fSmrg  else :
18548bd17e5fSmrg    # compilation failed
18558bd17e5fSmrg    $3
18568bd17e5fSmrg  fi
18578bd17e5fSmrgfi
18588bd17e5fSmrgrm -fr conftest*
18598bd17e5fSmrg])# _LT_TRY_DLOPEN_SELF
18608bd17e5fSmrg
18618bd17e5fSmrg
18628bd17e5fSmrg# LT_SYS_DLOPEN_SELF
18638bd17e5fSmrg# ------------------
18648bd17e5fSmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
18658bd17e5fSmrg[m4_require([_LT_HEADER_DLFCN])dnl
18668bd17e5fSmrgif test "x$enable_dlopen" != xyes; then
18678bd17e5fSmrg  enable_dlopen=unknown
18688bd17e5fSmrg  enable_dlopen_self=unknown
18698bd17e5fSmrg  enable_dlopen_self_static=unknown
18708bd17e5fSmrgelse
18718bd17e5fSmrg  lt_cv_dlopen=no
18728bd17e5fSmrg  lt_cv_dlopen_libs=
18738bd17e5fSmrg
18748bd17e5fSmrg  case $host_os in
18758bd17e5fSmrg  beos*)
18768bd17e5fSmrg    lt_cv_dlopen="load_add_on"
18778bd17e5fSmrg    lt_cv_dlopen_libs=
18788bd17e5fSmrg    lt_cv_dlopen_self=yes
18790597fb56Smrg    ;;
18808bd17e5fSmrg
18818bd17e5fSmrg  mingw* | pw32* | cegcc*)
18828bd17e5fSmrg    lt_cv_dlopen="LoadLibrary"
18838bd17e5fSmrg    lt_cv_dlopen_libs=
18840597fb56Smrg    ;;
18858bd17e5fSmrg
18868bd17e5fSmrg  cygwin*)
18878bd17e5fSmrg    lt_cv_dlopen="dlopen"
18888bd17e5fSmrg    lt_cv_dlopen_libs=
18890597fb56Smrg    ;;
1890b042e37fSmrg
18918bd17e5fSmrg  darwin*)
18928bd17e5fSmrg  # if libdl is installed we need to link against it
18938bd17e5fSmrg    AC_CHECK_LIB([dl], [dlopen],
18948bd17e5fSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
18958bd17e5fSmrg    lt_cv_dlopen="dyld"
18968bd17e5fSmrg    lt_cv_dlopen_libs=
18978bd17e5fSmrg    lt_cv_dlopen_self=yes
18988bd17e5fSmrg    ])
18998bd17e5fSmrg    ;;
1900b042e37fSmrg
19018bd17e5fSmrg  *)
19028bd17e5fSmrg    AC_CHECK_FUNC([shl_load],
19038bd17e5fSmrg	  [lt_cv_dlopen="shl_load"],
19048bd17e5fSmrg      [AC_CHECK_LIB([dld], [shl_load],
19058bd17e5fSmrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
19068bd17e5fSmrg	[AC_CHECK_FUNC([dlopen],
19078bd17e5fSmrg	      [lt_cv_dlopen="dlopen"],
19088bd17e5fSmrg	  [AC_CHECK_LIB([dl], [dlopen],
19098bd17e5fSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
19108bd17e5fSmrg	    [AC_CHECK_LIB([svld], [dlopen],
19118bd17e5fSmrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
19128bd17e5fSmrg	      [AC_CHECK_LIB([dld], [dld_link],
19138bd17e5fSmrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
19148bd17e5fSmrg	      ])
19158bd17e5fSmrg	    ])
19168bd17e5fSmrg	  ])
19178bd17e5fSmrg	])
19188bd17e5fSmrg      ])
19198bd17e5fSmrg    ;;
19200597fb56Smrg  esac
1921b042e37fSmrg
19228bd17e5fSmrg  if test "x$lt_cv_dlopen" != xno; then
19238bd17e5fSmrg    enable_dlopen=yes
19240597fb56Smrg  else
19258bd17e5fSmrg    enable_dlopen=no
19260597fb56Smrg  fi
1927b042e37fSmrg
19288bd17e5fSmrg  case $lt_cv_dlopen in
19298bd17e5fSmrg  dlopen)
19308bd17e5fSmrg    save_CPPFLAGS="$CPPFLAGS"
19318bd17e5fSmrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1932b042e37fSmrg
19338bd17e5fSmrg    save_LDFLAGS="$LDFLAGS"
19348bd17e5fSmrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1935b042e37fSmrg
19368bd17e5fSmrg    save_LIBS="$LIBS"
19378bd17e5fSmrg    LIBS="$lt_cv_dlopen_libs $LIBS"
1938b042e37fSmrg
19398bd17e5fSmrg    AC_CACHE_CHECK([whether a program can dlopen itself],
19408bd17e5fSmrg	  lt_cv_dlopen_self, [dnl
19418bd17e5fSmrg	  _LT_TRY_DLOPEN_SELF(
19428bd17e5fSmrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
19438bd17e5fSmrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
19448bd17e5fSmrg    ])
19450597fb56Smrg
19468bd17e5fSmrg    if test "x$lt_cv_dlopen_self" = xyes; then
19478bd17e5fSmrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
19488bd17e5fSmrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
19498bd17e5fSmrg	  lt_cv_dlopen_self_static, [dnl
19508bd17e5fSmrg	  _LT_TRY_DLOPEN_SELF(
19518bd17e5fSmrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
19528bd17e5fSmrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
19538bd17e5fSmrg      ])
19548bd17e5fSmrg    fi
19550597fb56Smrg
19568bd17e5fSmrg    CPPFLAGS="$save_CPPFLAGS"
19578bd17e5fSmrg    LDFLAGS="$save_LDFLAGS"
19588bd17e5fSmrg    LIBS="$save_LIBS"
19590597fb56Smrg    ;;
19600597fb56Smrg  esac
19610597fb56Smrg
19628bd17e5fSmrg  case $lt_cv_dlopen_self in
19638bd17e5fSmrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
19648bd17e5fSmrg  *) enable_dlopen_self=unknown ;;
19658bd17e5fSmrg  esac
19660597fb56Smrg
19678bd17e5fSmrg  case $lt_cv_dlopen_self_static in
19688bd17e5fSmrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
19698bd17e5fSmrg  *) enable_dlopen_self_static=unknown ;;
19700597fb56Smrg  esac
19710597fb56Smrgfi
19728bd17e5fSmrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
19738bd17e5fSmrg	 [Whether dlopen is supported])
19748bd17e5fSmrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
19758bd17e5fSmrg	 [Whether dlopen of programs is supported])
19768bd17e5fSmrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
19778bd17e5fSmrg	 [Whether dlopen of statically linked programs is supported])
19788bd17e5fSmrg])# LT_SYS_DLOPEN_SELF
1979b042e37fSmrg
19808bd17e5fSmrg# Old name:
19818bd17e5fSmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
19828bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
19838bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1984b042e37fSmrg
1985b042e37fSmrg
19868bd17e5fSmrg# _LT_COMPILER_C_O([TAGNAME])
19878bd17e5fSmrg# ---------------------------
19888bd17e5fSmrg# Check to see if options -c and -o are simultaneously supported by compiler.
19898bd17e5fSmrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
19908bd17e5fSmrgm4_defun([_LT_COMPILER_C_O],
19918bd17e5fSmrg[m4_require([_LT_DECL_SED])dnl
19928bd17e5fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
19938bd17e5fSmrgm4_require([_LT_TAG_COMPILER])dnl
19948bd17e5fSmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
19958bd17e5fSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
19968bd17e5fSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
19978bd17e5fSmrg   $RM -r conftest 2>/dev/null
19988bd17e5fSmrg   mkdir conftest
19998bd17e5fSmrg   cd conftest
20008bd17e5fSmrg   mkdir out
20018bd17e5fSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
20020597fb56Smrg
20038bd17e5fSmrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
20048bd17e5fSmrg   # Insert the option either (1) after the last *FLAGS variable, or
20058bd17e5fSmrg   # (2) before a word containing "conftest.", or (3) at the end.
20068bd17e5fSmrg   # Note that $ac_compile itself does not contain backslashes and begins
20078bd17e5fSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
20088bd17e5fSmrg   lt_compile=`echo "$ac_compile" | $SED \
20098bd17e5fSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
20108bd17e5fSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
20118bd17e5fSmrg   -e 's:$: $lt_compiler_flag:'`
20128bd17e5fSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
20138bd17e5fSmrg   (eval "$lt_compile" 2>out/conftest.err)
20148bd17e5fSmrg   ac_status=$?
20158bd17e5fSmrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
20168bd17e5fSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
20178bd17e5fSmrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
20188bd17e5fSmrg   then
20198bd17e5fSmrg     # The compiler can only warn and ignore the option if not recognized
20208bd17e5fSmrg     # So say no if there are warnings
20218bd17e5fSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
20228bd17e5fSmrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
20238bd17e5fSmrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
20248bd17e5fSmrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
20258bd17e5fSmrg     fi
20268bd17e5fSmrg   fi
20278bd17e5fSmrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
20288bd17e5fSmrg   $RM conftest*
20298bd17e5fSmrg   # SGI C++ compiler will create directory out/ii_files/ for
20308bd17e5fSmrg   # template instantiation
20318bd17e5fSmrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
20328bd17e5fSmrg   $RM out/* && rmdir out
20338bd17e5fSmrg   cd ..
20348bd17e5fSmrg   $RM -r conftest
20358bd17e5fSmrg   $RM conftest*
20368bd17e5fSmrg])
20378bd17e5fSmrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
20388bd17e5fSmrg	[Does compiler simultaneously support -c and -o options?])
20398bd17e5fSmrg])# _LT_COMPILER_C_O
20408bd17e5fSmrg
20418bd17e5fSmrg
20428bd17e5fSmrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
20438bd17e5fSmrg# ----------------------------------
20448bd17e5fSmrg# Check to see if we can do hard links to lock some files if needed
20458bd17e5fSmrgm4_defun([_LT_COMPILER_FILE_LOCKS],
20468bd17e5fSmrg[m4_require([_LT_ENABLE_LOCK])dnl
20478bd17e5fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
20488bd17e5fSmrg_LT_COMPILER_C_O([$1])
20498bd17e5fSmrg
20508bd17e5fSmrghard_links="nottested"
20518bd17e5fSmrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
20528bd17e5fSmrg  # do not overwrite the value of need_locks provided by the user
20538bd17e5fSmrg  AC_MSG_CHECKING([if we can lock with hard links])
20548bd17e5fSmrg  hard_links=yes
20558bd17e5fSmrg  $RM conftest*
20568bd17e5fSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
20578bd17e5fSmrg  touch conftest.a
20588bd17e5fSmrg  ln conftest.a conftest.b 2>&5 || hard_links=no
20598bd17e5fSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
20608bd17e5fSmrg  AC_MSG_RESULT([$hard_links])
20618bd17e5fSmrg  if test "$hard_links" = no; then
20628bd17e5fSmrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
20638bd17e5fSmrg    need_locks=warn
2064706b6b52Smrg  fi
20650597fb56Smrgelse
20668bd17e5fSmrg  need_locks=no
20678bd17e5fSmrgfi
20688bd17e5fSmrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
20698bd17e5fSmrg])# _LT_COMPILER_FILE_LOCKS
20708bd17e5fSmrg
20718bd17e5fSmrg
20728bd17e5fSmrg# _LT_CHECK_OBJDIR
20738bd17e5fSmrg# ----------------
20748bd17e5fSmrgm4_defun([_LT_CHECK_OBJDIR],
20758bd17e5fSmrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
20768bd17e5fSmrg[rm -f .libs 2>/dev/null
20778bd17e5fSmrgmkdir .libs 2>/dev/null
20788bd17e5fSmrgif test -d .libs; then
20798bd17e5fSmrg  lt_cv_objdir=.libs
20808bd17e5fSmrgelse
20818bd17e5fSmrg  # MS-DOS does not allow filenames that begin with a dot.
20828bd17e5fSmrg  lt_cv_objdir=_libs
20838bd17e5fSmrgfi
20848bd17e5fSmrgrmdir .libs 2>/dev/null])
20858bd17e5fSmrgobjdir=$lt_cv_objdir
20868bd17e5fSmrg_LT_DECL([], [objdir], [0],
20878bd17e5fSmrg         [The name of the directory that contains temporary libtool files])dnl
20888bd17e5fSmrgm4_pattern_allow([LT_OBJDIR])dnl
20898bd17e5fSmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
20908bd17e5fSmrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
20918bd17e5fSmrg])# _LT_CHECK_OBJDIR
20928bd17e5fSmrg
20938bd17e5fSmrg
20948bd17e5fSmrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
20958bd17e5fSmrg# --------------------------------------
20968bd17e5fSmrg# Check hardcoding attributes.
20978bd17e5fSmrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
20988bd17e5fSmrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
20998bd17e5fSmrg_LT_TAGVAR(hardcode_action, $1)=
21008bd17e5fSmrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
21018bd17e5fSmrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
21028bd17e5fSmrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
21038bd17e5fSmrg
21048bd17e5fSmrg  # We can hardcode non-existent directories.
21058bd17e5fSmrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
21068bd17e5fSmrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
21078bd17e5fSmrg     # have to relink, otherwise we might link with an installed library
21088bd17e5fSmrg     # when we should be linking with a yet-to-be-installed one
21098bd17e5fSmrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
21108bd17e5fSmrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
21118bd17e5fSmrg    # Linking always hardcodes the temporary library directory.
21128bd17e5fSmrg    _LT_TAGVAR(hardcode_action, $1)=relink
2113706b6b52Smrg  else
21148bd17e5fSmrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
21158bd17e5fSmrg    _LT_TAGVAR(hardcode_action, $1)=immediate
2116bd23fbfaSmrg  fi
21178bd17e5fSmrgelse
21188bd17e5fSmrg  # We cannot hardcode anything, or else we can only hardcode existing
21198bd17e5fSmrg  # directories.
21208bd17e5fSmrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
2121bd23fbfaSmrgfi
21228bd17e5fSmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2123b042e37fSmrg
21248bd17e5fSmrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
21258bd17e5fSmrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
21268bd17e5fSmrg  # Fast installation is not supported
21278bd17e5fSmrg  enable_fast_install=no
21288bd17e5fSmrgelif test "$shlibpath_overrides_runpath" = yes ||
21298bd17e5fSmrg     test "$enable_shared" = no; then
21308bd17e5fSmrg  # Fast installation is not necessary
21318bd17e5fSmrg  enable_fast_install=needless
21328bd17e5fSmrgfi
21338bd17e5fSmrg_LT_TAGDECL([], [hardcode_action], [0],
21348bd17e5fSmrg    [How to hardcode a shared library path into an executable])
21358bd17e5fSmrg])# _LT_LINKER_HARDCODE_LIBPATH
2136b042e37fSmrg
2137b042e37fSmrg
21388bd17e5fSmrg# _LT_CMD_STRIPLIB
21398bd17e5fSmrg# ----------------
21408bd17e5fSmrgm4_defun([_LT_CMD_STRIPLIB],
21410597fb56Smrg[m4_require([_LT_DECL_EGREP])
21428bd17e5fSmrgstriplib=
21438bd17e5fSmrgold_striplib=
21448bd17e5fSmrgAC_MSG_CHECKING([whether stripping libraries is possible])
21458bd17e5fSmrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
21468bd17e5fSmrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
21478bd17e5fSmrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
21488bd17e5fSmrg  AC_MSG_RESULT([yes])
21498bd17e5fSmrgelse
21508bd17e5fSmrg# FIXME - insert some real tests, host_os isn't really good enough
21518bd17e5fSmrg  case $host_os in
21528bd17e5fSmrg  darwin*)
21538bd17e5fSmrg    if test -n "$STRIP" ; then
21548bd17e5fSmrg      striplib="$STRIP -x"
21558bd17e5fSmrg      old_striplib="$STRIP -S"
21568bd17e5fSmrg      AC_MSG_RESULT([yes])
21578bd17e5fSmrg    else
21588bd17e5fSmrg      AC_MSG_RESULT([no])
21598bd17e5fSmrg    fi
21600597fb56Smrg    ;;
21610597fb56Smrg  *)
21628bd17e5fSmrg    AC_MSG_RESULT([no])
21630597fb56Smrg    ;;
21640597fb56Smrg  esac
2165706b6b52Smrgfi
21668bd17e5fSmrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
21678bd17e5fSmrg_LT_DECL([], [striplib], [1])
21688bd17e5fSmrg])# _LT_CMD_STRIPLIB
2169b042e37fSmrg
2170b042e37fSmrg
21718bd17e5fSmrg# _LT_SYS_DYNAMIC_LINKER([TAG])
21728bd17e5fSmrg# -----------------------------
21738bd17e5fSmrg# PORTME Fill in your ld.so characteristics
21748bd17e5fSmrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
21750597fb56Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
21768bd17e5fSmrgm4_require([_LT_DECL_EGREP])dnl
21778bd17e5fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
21788bd17e5fSmrgm4_require([_LT_DECL_OBJDUMP])dnl
21798bd17e5fSmrgm4_require([_LT_DECL_SED])dnl
21808bd17e5fSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
21818bd17e5fSmrgAC_MSG_CHECKING([dynamic linker characteristics])
21828bd17e5fSmrgm4_if([$1],
21838bd17e5fSmrg	[], [
21840597fb56Smrgif test "$GCC" = yes; then
21858bd17e5fSmrg  case $host_os in
21868bd17e5fSmrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
21878bd17e5fSmrg    *) lt_awk_arg="/^libraries:/" ;;
21888bd17e5fSmrg  esac
21898bd17e5fSmrg  case $host_os in
21908bd17e5fSmrg    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
21918bd17e5fSmrg    *) lt_sed_strip_eq="s,=/,/,g" ;;
21928bd17e5fSmrg  esac
21938bd17e5fSmrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
21948bd17e5fSmrg  case $lt_search_path_spec in
21958bd17e5fSmrg  *\;*)
21968bd17e5fSmrg    # if the path contains ";" then we assume it to be the separator
21978bd17e5fSmrg    # otherwise default to the standard path separator (i.e. ":") - it is
21988bd17e5fSmrg    # assumed that no part of a normal pathname contains ";" but that should
21998bd17e5fSmrg    # okay in the real world where ";" in dirpaths is itself problematic.
22008bd17e5fSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
22018bd17e5fSmrg    ;;
22020597fb56Smrg  *)
22038bd17e5fSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
22048bd17e5fSmrg    ;;
22050597fb56Smrg  esac
22068bd17e5fSmrg  # Ok, now we have the path, separated by spaces, we can step through it
22078bd17e5fSmrg  # and add multilib dir if necessary.
22088bd17e5fSmrg  lt_tmp_lt_search_path_spec=
22098bd17e5fSmrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
22108bd17e5fSmrg  for lt_sys_path in $lt_search_path_spec; do
22118bd17e5fSmrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
22128bd17e5fSmrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
22138bd17e5fSmrg    else
22148bd17e5fSmrg      test -d "$lt_sys_path" && \
22158bd17e5fSmrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
22168bd17e5fSmrg    fi
22178bd17e5fSmrg  done
22188bd17e5fSmrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
22198bd17e5fSmrgBEGIN {RS=" "; FS="/|\n";} {
22208bd17e5fSmrg  lt_foo="";
22218bd17e5fSmrg  lt_count=0;
22228bd17e5fSmrg  for (lt_i = NF; lt_i > 0; lt_i--) {
22238bd17e5fSmrg    if ($lt_i != "" && $lt_i != ".") {
22248bd17e5fSmrg      if ($lt_i == "..") {
22258bd17e5fSmrg        lt_count++;
22268bd17e5fSmrg      } else {
22278bd17e5fSmrg        if (lt_count == 0) {
22288bd17e5fSmrg          lt_foo="/" $lt_i lt_foo;
22298bd17e5fSmrg        } else {
22308bd17e5fSmrg          lt_count--;
22318bd17e5fSmrg        }
22328bd17e5fSmrg      }
22338bd17e5fSmrg    }
22348bd17e5fSmrg  }
22358bd17e5fSmrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
22368bd17e5fSmrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
22378bd17e5fSmrg}'`
22388bd17e5fSmrg  # AWK program above erroneously prepends '/' to C:/dos/paths
22398bd17e5fSmrg  # for these hosts.
22408bd17e5fSmrg  case $host_os in
22418bd17e5fSmrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
22428bd17e5fSmrg      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
22438bd17e5fSmrg  esac
22448bd17e5fSmrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
22458bd17e5fSmrgelse
22468bd17e5fSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
22478bd17e5fSmrgfi])
22488bd17e5fSmrglibrary_names_spec=
22498bd17e5fSmrglibname_spec='lib$name'
22508bd17e5fSmrgsoname_spec=
22518bd17e5fSmrgshrext_cmds=".so"
22528bd17e5fSmrgpostinstall_cmds=
22538bd17e5fSmrgpostuninstall_cmds=
22548bd17e5fSmrgfinish_cmds=
22558bd17e5fSmrgfinish_eval=
22568bd17e5fSmrgshlibpath_var=
22578bd17e5fSmrgshlibpath_overrides_runpath=unknown
22588bd17e5fSmrgversion_type=none
22598bd17e5fSmrgdynamic_linker="$host_os ld.so"
22608bd17e5fSmrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
22618bd17e5fSmrgneed_lib_prefix=unknown
22628bd17e5fSmrghardcode_into_libs=no
2263bd23fbfaSmrg
22648bd17e5fSmrg# when you set need_version to no, make sure it does not cause -set_version
22658bd17e5fSmrg# flags to be left without arguments
22668bd17e5fSmrgneed_version=unknown
22670597fb56Smrg
22680597fb56Smrgcase $host_os in
22698bd17e5fSmrgaix3*)
22708bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
22718bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
22728bd17e5fSmrg  shlibpath_var=LIBPATH
22738bd17e5fSmrg
22748bd17e5fSmrg  # AIX 3 has no versioning support, so we append a major version to the name.
22758bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
22760597fb56Smrg  ;;
22778bd17e5fSmrg
22788bd17e5fSmrgaix[[4-9]]*)
22798bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
22808bd17e5fSmrg  need_lib_prefix=no
22818bd17e5fSmrg  need_version=no
22828bd17e5fSmrg  hardcode_into_libs=yes
22830597fb56Smrg  if test "$host_cpu" = ia64; then
22848bd17e5fSmrg    # AIX 5 supports IA64
22858bd17e5fSmrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
22868bd17e5fSmrg    shlibpath_var=LD_LIBRARY_PATH
22878bd17e5fSmrg  else
22888bd17e5fSmrg    # With GCC up to 2.95.x, collect2 would create an import file
22898bd17e5fSmrg    # for dependence libraries.  The import file would start with
22908bd17e5fSmrg    # the line `#! .'.  This would cause the generated library to
22918bd17e5fSmrg    # depend on `.', always an invalid library.  This was fixed in
22928bd17e5fSmrg    # development snapshots of GCC prior to 3.0.
22938bd17e5fSmrg    case $host_os in
22948bd17e5fSmrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
22958bd17e5fSmrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
22968bd17e5fSmrg	   echo ' yes '
22978bd17e5fSmrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
22988bd17e5fSmrg	:
22998bd17e5fSmrg      else
23008bd17e5fSmrg	can_build_shared=no
23018bd17e5fSmrg      fi
23028bd17e5fSmrg      ;;
23038bd17e5fSmrg    esac
23048bd17e5fSmrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
23058bd17e5fSmrg    # soname into executable. Probably we can add versioning support to
23068bd17e5fSmrg    # collect2, so additional links can be useful in future.
23078bd17e5fSmrg    if test "$aix_use_runtimelinking" = yes; then
23088bd17e5fSmrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
23098bd17e5fSmrg      # instead of lib<name>.a to let people know that these are not
23108bd17e5fSmrg      # typical AIX shared libraries.
23118bd17e5fSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
23128bd17e5fSmrg    else
23138bd17e5fSmrg      # We preserve .a as extension for shared libraries through AIX4.2
23148bd17e5fSmrg      # and later when we are not doing run time linking.
23158bd17e5fSmrg      library_names_spec='${libname}${release}.a $libname.a'
23168bd17e5fSmrg      soname_spec='${libname}${release}${shared_ext}$major'
23178bd17e5fSmrg    fi
23188bd17e5fSmrg    shlibpath_var=LIBPATH
23198bd17e5fSmrg  fi
2320706b6b52Smrg  ;;
23218c4a8e55Smrg
23228bd17e5fSmrgamigaos*)
23238bd17e5fSmrg  case $host_cpu in
23248bd17e5fSmrg  powerpc)
23258bd17e5fSmrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
23268bd17e5fSmrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
23278bd17e5fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
23288bd17e5fSmrg    ;;
23298bd17e5fSmrg  m68k)
23308bd17e5fSmrg    library_names_spec='$libname.ixlibrary $libname.a'
23318bd17e5fSmrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
23328bd17e5fSmrg    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'
23338bd17e5fSmrg    ;;
23348bd17e5fSmrg  esac
23358bd17e5fSmrg  ;;
2336bd23fbfaSmrg
23378bd17e5fSmrgbeos*)
23388bd17e5fSmrg  library_names_spec='${libname}${shared_ext}'
23398bd17e5fSmrg  dynamic_linker="$host_os ld.so"
23408bd17e5fSmrg  shlibpath_var=LIBRARY_PATH
23410597fb56Smrg  ;;
2342bd23fbfaSmrg
23438bd17e5fSmrgbsdi[[45]]*)
23448bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
23458bd17e5fSmrg  need_version=no
23468bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
23478bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
23488bd17e5fSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
23498bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
23508bd17e5fSmrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
23518bd17e5fSmrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
23528bd17e5fSmrg  # the default ld.so.conf also contains /usr/contrib/lib and
23538bd17e5fSmrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
23548bd17e5fSmrg  # libtool to hard-code these into programs
23558bd17e5fSmrg  ;;
2356bd23fbfaSmrg
23578bd17e5fSmrgcygwin* | mingw* | pw32* | cegcc*)
23588bd17e5fSmrg  version_type=windows
23598bd17e5fSmrg  shrext_cmds=".dll"
23608bd17e5fSmrg  need_version=no
23618bd17e5fSmrg  need_lib_prefix=no
2362bd23fbfaSmrg
23638bd17e5fSmrg  case $GCC,$cc_basename in
23648bd17e5fSmrg  yes,*)
23658bd17e5fSmrg    # gcc
23668bd17e5fSmrg    library_names_spec='$libname.dll.a'
23678bd17e5fSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
23688bd17e5fSmrg    postinstall_cmds='base_file=`basename \${file}`~
23698bd17e5fSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
23708bd17e5fSmrg      dldir=$destdir/`dirname \$dlpath`~
23718bd17e5fSmrg      test -d \$dldir || mkdir -p \$dldir~
23728bd17e5fSmrg      $install_prog $dir/$dlname \$dldir/$dlname~
23738bd17e5fSmrg      chmod a+x \$dldir/$dlname~
23748bd17e5fSmrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
23758bd17e5fSmrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
23768bd17e5fSmrg      fi'
23778bd17e5fSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
23788bd17e5fSmrg      dlpath=$dir/\$dldll~
23798bd17e5fSmrg       $RM \$dlpath'
23808bd17e5fSmrg    shlibpath_overrides_runpath=yes
23818c4a8e55Smrg
23828bd17e5fSmrg    case $host_os in
23838bd17e5fSmrg    cygwin*)
23848bd17e5fSmrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
23858bd17e5fSmrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
23868bd17e5fSmrgm4_if([$1], [],[
23878bd17e5fSmrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
23888bd17e5fSmrg      ;;
23898bd17e5fSmrg    mingw* | cegcc*)
23908bd17e5fSmrg      # MinGW DLLs use traditional 'lib' prefix
23918bd17e5fSmrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
23928bd17e5fSmrg      ;;
23938bd17e5fSmrg    pw32*)
23948bd17e5fSmrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
23958bd17e5fSmrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
23968bd17e5fSmrg      ;;
23978bd17e5fSmrg    esac
23988bd17e5fSmrg    dynamic_linker='Win32 ld.exe'
23998bd17e5fSmrg    ;;
2400706b6b52Smrg
24018bd17e5fSmrg  *,cl*)
24028bd17e5fSmrg    # Native MSVC
24038bd17e5fSmrg    libname_spec='$name'
24048bd17e5fSmrg    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
24058bd17e5fSmrg    library_names_spec='${libname}.dll.lib'
2406706b6b52Smrg
24078bd17e5fSmrg    case $build_os in
24088bd17e5fSmrg    mingw*)
24098bd17e5fSmrg      sys_lib_search_path_spec=
24108bd17e5fSmrg      lt_save_ifs=$IFS
24118bd17e5fSmrg      IFS=';'
24128bd17e5fSmrg      for lt_path in $LIB
24138bd17e5fSmrg      do
24148bd17e5fSmrg        IFS=$lt_save_ifs
24158bd17e5fSmrg        # Let DOS variable expansion print the short 8.3 style file name.
24168bd17e5fSmrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
24178bd17e5fSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
24188bd17e5fSmrg      done
24198bd17e5fSmrg      IFS=$lt_save_ifs
24208bd17e5fSmrg      # Convert to MSYS style.
24218bd17e5fSmrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
24228bd17e5fSmrg      ;;
24238bd17e5fSmrg    cygwin*)
24248bd17e5fSmrg      # Convert to unix form, then to dos form, then back to unix form
24258bd17e5fSmrg      # but this time dos style (no spaces!) so that the unix form looks
24268bd17e5fSmrg      # like /cygdrive/c/PROGRA~1:/cygdr...
24278bd17e5fSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
24288bd17e5fSmrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
24298bd17e5fSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
24308bd17e5fSmrg      ;;
24318bd17e5fSmrg    *)
24328bd17e5fSmrg      sys_lib_search_path_spec="$LIB"
24338bd17e5fSmrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
24348bd17e5fSmrg        # It is most probably a Windows format PATH.
24358bd17e5fSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
24360597fb56Smrg      else
24378bd17e5fSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
24380597fb56Smrg      fi
24398bd17e5fSmrg      # FIXME: find the short name or the path components, as spaces are
24408bd17e5fSmrg      # common. (e.g. "Program Files" -> "PROGRA~1")
24418bd17e5fSmrg      ;;
24428bd17e5fSmrg    esac
2443706b6b52Smrg
24448bd17e5fSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
24458bd17e5fSmrg    postinstall_cmds='base_file=`basename \${file}`~
24468bd17e5fSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
24478bd17e5fSmrg      dldir=$destdir/`dirname \$dlpath`~
24488bd17e5fSmrg      test -d \$dldir || mkdir -p \$dldir~
24498bd17e5fSmrg      $install_prog $dir/$dlname \$dldir/$dlname'
24508bd17e5fSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
24518bd17e5fSmrg      dlpath=$dir/\$dldll~
24528bd17e5fSmrg       $RM \$dlpath'
24538bd17e5fSmrg    shlibpath_overrides_runpath=yes
24548bd17e5fSmrg    dynamic_linker='Win32 link.exe'
24558bd17e5fSmrg    ;;
2456706b6b52Smrg
24578bd17e5fSmrg  *)
24588bd17e5fSmrg    # Assume MSVC wrapper
24598bd17e5fSmrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
24608bd17e5fSmrg    dynamic_linker='Win32 ld.exe'
24618bd17e5fSmrg    ;;
24628bd17e5fSmrg  esac
24638bd17e5fSmrg  # FIXME: first we should search . and the directory the executable is in
24648bd17e5fSmrg  shlibpath_var=PATH
24658bd17e5fSmrg  ;;
2466706b6b52Smrg
24678bd17e5fSmrgdarwin* | rhapsody*)
24688bd17e5fSmrg  dynamic_linker="$host_os dyld"
24698bd17e5fSmrg  version_type=darwin
24708bd17e5fSmrg  need_lib_prefix=no
24718bd17e5fSmrg  need_version=no
24728bd17e5fSmrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
24738bd17e5fSmrg  soname_spec='${libname}${release}${major}$shared_ext'
24748bd17e5fSmrg  shlibpath_overrides_runpath=yes
24758bd17e5fSmrg  shlibpath_var=DYLD_LIBRARY_PATH
24768bd17e5fSmrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
24778bd17e5fSmrgm4_if([$1], [],[
24788bd17e5fSmrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
24798bd17e5fSmrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
24808bd17e5fSmrg  ;;
2481706b6b52Smrg
24828bd17e5fSmrgdgux*)
24838bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
24848bd17e5fSmrg  need_lib_prefix=no
24858bd17e5fSmrg  need_version=no
24868bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
24878bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
24888bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
24898bd17e5fSmrg  ;;
2490706b6b52Smrg
24918bd17e5fSmrgfreebsd* | dragonfly*)
24928bd17e5fSmrg  # DragonFly does not have aout.  When/if they implement a new
24938bd17e5fSmrg  # versioning mechanism, adjust this.
24948bd17e5fSmrg  if test -x /usr/bin/objformat; then
24958bd17e5fSmrg    objformat=`/usr/bin/objformat`
24960597fb56Smrg  else
24978bd17e5fSmrg    case $host_os in
24988bd17e5fSmrg    freebsd[[23]].*) objformat=aout ;;
24998bd17e5fSmrg    *) objformat=elf ;;
25008bd17e5fSmrg    esac
25010597fb56Smrg  fi
25028bd17e5fSmrg  version_type=freebsd-$objformat
25038bd17e5fSmrg  case $version_type in
25048bd17e5fSmrg    freebsd-elf*)
25058bd17e5fSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
25068bd17e5fSmrg      need_version=no
25078bd17e5fSmrg      need_lib_prefix=no
25088bd17e5fSmrg      ;;
25098bd17e5fSmrg    freebsd-*)
25108bd17e5fSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
25118bd17e5fSmrg      need_version=yes
25128bd17e5fSmrg      ;;
25138bd17e5fSmrg  esac
25148bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
25158bd17e5fSmrg  case $host_os in
25168bd17e5fSmrg  freebsd2.*)
25178bd17e5fSmrg    shlibpath_overrides_runpath=yes
25188bd17e5fSmrg    ;;
25198bd17e5fSmrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
25208bd17e5fSmrg    shlibpath_overrides_runpath=yes
25218bd17e5fSmrg    hardcode_into_libs=yes
25228bd17e5fSmrg    ;;
25238bd17e5fSmrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
25248bd17e5fSmrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
25258bd17e5fSmrg    shlibpath_overrides_runpath=no
25268bd17e5fSmrg    hardcode_into_libs=yes
25278bd17e5fSmrg    ;;
25288bd17e5fSmrg  *) # from 4.6 on, and DragonFly
25298bd17e5fSmrg    shlibpath_overrides_runpath=yes
25308bd17e5fSmrg    hardcode_into_libs=yes
25318bd17e5fSmrg    ;;
25328bd17e5fSmrg  esac
25338bd17e5fSmrg  ;;
2534706b6b52Smrg
25358bd17e5fSmrggnu*)
25368bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
25378bd17e5fSmrg  need_lib_prefix=no
25388bd17e5fSmrg  need_version=no
25398bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
25408bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
25418bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
25428bd17e5fSmrg  shlibpath_overrides_runpath=no
25438bd17e5fSmrg  hardcode_into_libs=yes
25448bd17e5fSmrg  ;;
2545706b6b52Smrg
25468bd17e5fSmrghaiku*)
25478bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
25488bd17e5fSmrg  need_lib_prefix=no
25498bd17e5fSmrg  need_version=no
25508bd17e5fSmrg  dynamic_linker="$host_os runtime_loader"
25518bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
25528bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
25538bd17e5fSmrg  shlibpath_var=LIBRARY_PATH
25548bd17e5fSmrg  shlibpath_overrides_runpath=yes
25558bd17e5fSmrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
25568bd17e5fSmrg  hardcode_into_libs=yes
25578bd17e5fSmrg  ;;
2558706b6b52Smrg
25598bd17e5fSmrghpux9* | hpux10* | hpux11*)
25608bd17e5fSmrg  # Give a soname corresponding to the major version so that dld.sl refuses to
25618bd17e5fSmrg  # link against other versions.
25628bd17e5fSmrg  version_type=sunos
25638bd17e5fSmrg  need_lib_prefix=no
25648bd17e5fSmrg  need_version=no
25658bd17e5fSmrg  case $host_cpu in
25668bd17e5fSmrg  ia64*)
25678bd17e5fSmrg    shrext_cmds='.so'
25688bd17e5fSmrg    hardcode_into_libs=yes
25698bd17e5fSmrg    dynamic_linker="$host_os dld.so"
25708bd17e5fSmrg    shlibpath_var=LD_LIBRARY_PATH
25718bd17e5fSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
25728bd17e5fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
25738bd17e5fSmrg    soname_spec='${libname}${release}${shared_ext}$major'
25748bd17e5fSmrg    if test "X$HPUX_IA64_MODE" = X32; then
25758bd17e5fSmrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
25768bd17e5fSmrg    else
25778bd17e5fSmrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
25788bd17e5fSmrg    fi
25798bd17e5fSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
25808bd17e5fSmrg    ;;
25818bd17e5fSmrg  hppa*64*)
25828bd17e5fSmrg    shrext_cmds='.sl'
25838bd17e5fSmrg    hardcode_into_libs=yes
25848bd17e5fSmrg    dynamic_linker="$host_os dld.sl"
25858bd17e5fSmrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
25868bd17e5fSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
25878bd17e5fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
25888bd17e5fSmrg    soname_spec='${libname}${release}${shared_ext}$major'
25898bd17e5fSmrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
25908bd17e5fSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
25918bd17e5fSmrg    ;;
25928bd17e5fSmrg  *)
25938bd17e5fSmrg    shrext_cmds='.sl'
25948bd17e5fSmrg    dynamic_linker="$host_os dld.sl"
25958bd17e5fSmrg    shlibpath_var=SHLIB_PATH
25968bd17e5fSmrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
25978bd17e5fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
25988bd17e5fSmrg    soname_spec='${libname}${release}${shared_ext}$major'
25998bd17e5fSmrg    ;;
26008bd17e5fSmrg  esac
26018bd17e5fSmrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
26028bd17e5fSmrg  postinstall_cmds='chmod 555 $lib'
26038bd17e5fSmrg  # or fails outright, so override atomically:
26048bd17e5fSmrg  install_override_mode=555
26058bd17e5fSmrg  ;;
2606706b6b52Smrg
26078bd17e5fSmrginterix[[3-9]]*)
26088bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
26098bd17e5fSmrg  need_lib_prefix=no
26108bd17e5fSmrg  need_version=no
26118bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
26128bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
26138bd17e5fSmrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
26148bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
26158bd17e5fSmrg  shlibpath_overrides_runpath=no
26168bd17e5fSmrg  hardcode_into_libs=yes
26178bd17e5fSmrg  ;;
2618706b6b52Smrg
26198bd17e5fSmrgirix5* | irix6* | nonstopux*)
26208bd17e5fSmrg  case $host_os in
26218bd17e5fSmrg    nonstopux*) version_type=nonstopux ;;
26228bd17e5fSmrg    *)
26238bd17e5fSmrg	if test "$lt_cv_prog_gnu_ld" = yes; then
26248bd17e5fSmrg		version_type=linux # correct to gnu/linux during the next big refactor
26258bd17e5fSmrg	else
26268bd17e5fSmrg		version_type=irix
26278bd17e5fSmrg	fi ;;
26288bd17e5fSmrg  esac
26298bd17e5fSmrg  need_lib_prefix=no
26308bd17e5fSmrg  need_version=no
26318bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
26328bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
26338bd17e5fSmrg  case $host_os in
26348bd17e5fSmrg  irix5* | nonstopux*)
26358bd17e5fSmrg    libsuff= shlibsuff=
26368bd17e5fSmrg    ;;
26378bd17e5fSmrg  *)
26388bd17e5fSmrg    case $LD in # libtool.m4 will add one of these switches to LD
26398bd17e5fSmrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
26408bd17e5fSmrg      libsuff= shlibsuff= libmagic=32-bit;;
26418bd17e5fSmrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
26428bd17e5fSmrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
26438bd17e5fSmrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
26448bd17e5fSmrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
26458bd17e5fSmrg    *) libsuff= shlibsuff= libmagic=never-match;;
26468bd17e5fSmrg    esac
26478bd17e5fSmrg    ;;
26488bd17e5fSmrg  esac
26498bd17e5fSmrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
26508bd17e5fSmrg  shlibpath_overrides_runpath=no
26518bd17e5fSmrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
26528bd17e5fSmrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
26538bd17e5fSmrg  hardcode_into_libs=yes
26548bd17e5fSmrg  ;;
2655706b6b52Smrg
26568bd17e5fSmrg# No shared lib support for Linux oldld, aout, or coff.
26578bd17e5fSmrglinux*oldld* | linux*aout* | linux*coff*)
26588bd17e5fSmrg  dynamic_linker=no
26598bd17e5fSmrg  ;;
2660706b6b52Smrg
26618bd17e5fSmrg# This must be glibc/ELF.
26628bd17e5fSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
26638bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
26648bd17e5fSmrg  need_lib_prefix=no
26658bd17e5fSmrg  need_version=no
26668bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
26678bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
26688bd17e5fSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
26698bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
26708bd17e5fSmrg  shlibpath_overrides_runpath=no
26718bd17e5fSmrg
26728bd17e5fSmrg  # Some binutils ld are patched to set DT_RUNPATH
26738bd17e5fSmrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
26748bd17e5fSmrg    [lt_cv_shlibpath_overrides_runpath=no
26758bd17e5fSmrg    save_LDFLAGS=$LDFLAGS
26768bd17e5fSmrg    save_libdir=$libdir
26778bd17e5fSmrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
26788bd17e5fSmrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
26798bd17e5fSmrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
26808bd17e5fSmrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
26818bd17e5fSmrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
26828bd17e5fSmrg    LDFLAGS=$save_LDFLAGS
26838bd17e5fSmrg    libdir=$save_libdir
26848bd17e5fSmrg    ])
26858bd17e5fSmrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
26868bd17e5fSmrg
26878bd17e5fSmrg  # This implies no fast_install, which is unacceptable.
26888bd17e5fSmrg  # Some rework will be needed to allow for fast_install
26898bd17e5fSmrg  # before this can be enabled.
26908bd17e5fSmrg  hardcode_into_libs=yes
26918bd17e5fSmrg
269267594505Smrg  # Add ABI-specific directories to the system library path.
269367594505Smrg  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
269467594505Smrg
26958bd17e5fSmrg  # Append ld.so.conf contents to the search path
26968bd17e5fSmrg  if test -f /etc/ld.so.conf; then
26978bd17e5fSmrg    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' ' '`
269867594505Smrg    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
269967594505Smrg
27008bd17e5fSmrg  fi
27018bd17e5fSmrg
27028bd17e5fSmrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
27038bd17e5fSmrg  # powerpc, because MkLinux only supported shared libraries with the
27048bd17e5fSmrg  # GNU dynamic linker.  Since this was broken with cross compilers,
27058bd17e5fSmrg  # most powerpc-linux boxes support dynamic linking these days and
27068bd17e5fSmrg  # people can always --disable-shared, the test was removed, and we
27078bd17e5fSmrg  # assume the GNU/Linux dynamic linker is in use.
27088bd17e5fSmrg  dynamic_linker='GNU/Linux ld.so'
27098bd17e5fSmrg  ;;
27108bd17e5fSmrg
27118bd17e5fSmrgnetbsd*)
27128bd17e5fSmrg  version_type=sunos
27138bd17e5fSmrg  need_lib_prefix=no
27148bd17e5fSmrg  need_version=no
27158bd17e5fSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
27168bd17e5fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
27178bd17e5fSmrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
27188bd17e5fSmrg    dynamic_linker='NetBSD (a.out) ld.so'
27198bd17e5fSmrg  else
27208bd17e5fSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
27218bd17e5fSmrg    soname_spec='${libname}${release}${shared_ext}$major'
27228bd17e5fSmrg    dynamic_linker='NetBSD ld.elf_so'
27238bd17e5fSmrg  fi
27248bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
27258bd17e5fSmrg  shlibpath_overrides_runpath=yes
27268bd17e5fSmrg  hardcode_into_libs=yes
27278bd17e5fSmrg  ;;
27288bd17e5fSmrg
27298bd17e5fSmrgnewsos6)
27308bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
27318bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
27328bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
27338bd17e5fSmrg  shlibpath_overrides_runpath=yes
27348bd17e5fSmrg  ;;
27358bd17e5fSmrg
27368bd17e5fSmrg*nto* | *qnx*)
27378bd17e5fSmrg  version_type=qnx
27388bd17e5fSmrg  need_lib_prefix=no
27398bd17e5fSmrg  need_version=no
27408bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
27418bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
27428bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
27438bd17e5fSmrg  shlibpath_overrides_runpath=no
27448bd17e5fSmrg  hardcode_into_libs=yes
27458bd17e5fSmrg  dynamic_linker='ldqnx.so'
27468bd17e5fSmrg  ;;
27478bd17e5fSmrg
27488bd17e5fSmrgopenbsd*)
27498bd17e5fSmrg  version_type=sunos
27508bd17e5fSmrg  sys_lib_dlsearch_path_spec="/usr/lib"
27518bd17e5fSmrg  need_lib_prefix=no
27528bd17e5fSmrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
27538bd17e5fSmrg  case $host_os in
27548bd17e5fSmrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
27558bd17e5fSmrg    *)				need_version=no  ;;
27568bd17e5fSmrg  esac
27578bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
27588bd17e5fSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
27598bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
27608bd17e5fSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
27618bd17e5fSmrg    case $host_os in
27628bd17e5fSmrg      openbsd2.[[89]] | openbsd2.[[89]].*)
27638bd17e5fSmrg	shlibpath_overrides_runpath=no
27640597fb56Smrg	;;
27650597fb56Smrg      *)
27668bd17e5fSmrg	shlibpath_overrides_runpath=yes
27670597fb56Smrg	;;
2768706b6b52Smrg      esac
2769706b6b52Smrg  else
27708bd17e5fSmrg    shlibpath_overrides_runpath=yes
2771706b6b52Smrg  fi
27728bd17e5fSmrg  ;;
2773706b6b52Smrg
27748bd17e5fSmrgos2*)
27758bd17e5fSmrg  libname_spec='$name'
27768bd17e5fSmrg  shrext_cmds=".dll"
27778bd17e5fSmrg  need_lib_prefix=no
27788bd17e5fSmrg  library_names_spec='$libname${shared_ext} $libname.a'
27798bd17e5fSmrg  dynamic_linker='OS/2 ld.exe'
27808bd17e5fSmrg  shlibpath_var=LIBPATH
27818bd17e5fSmrg  ;;
2782706b6b52Smrg
27838bd17e5fSmrgosf3* | osf4* | osf5*)
27848bd17e5fSmrg  version_type=osf
27858bd17e5fSmrg  need_lib_prefix=no
27868bd17e5fSmrg  need_version=no
27878bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
27888bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
27898bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
27908bd17e5fSmrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
27918bd17e5fSmrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
27928bd17e5fSmrg  ;;
27938c4a8e55Smrg
27948bd17e5fSmrgrdos*)
27958bd17e5fSmrg  dynamic_linker=no
27968bd17e5fSmrg  ;;
27978bd17e5fSmrg
27988bd17e5fSmrgsolaris*)
27998bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
28008bd17e5fSmrg  need_lib_prefix=no
28018bd17e5fSmrg  need_version=no
28028bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
28038bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
28048bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
28058bd17e5fSmrg  shlibpath_overrides_runpath=yes
28068bd17e5fSmrg  hardcode_into_libs=yes
28078bd17e5fSmrg  # ldd complains unless libraries are executable
28088bd17e5fSmrg  postinstall_cmds='chmod +x $lib'
28098bd17e5fSmrg  ;;
28108bd17e5fSmrg
28118bd17e5fSmrgsunos4*)
28128bd17e5fSmrg  version_type=sunos
28138bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
28148bd17e5fSmrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
28158bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
28168bd17e5fSmrg  shlibpath_overrides_runpath=yes
28178bd17e5fSmrg  if test "$with_gnu_ld" = yes; then
28188bd17e5fSmrg    need_lib_prefix=no
28198bd17e5fSmrg  fi
28208bd17e5fSmrg  need_version=yes
28218bd17e5fSmrg  ;;
28228c4a8e55Smrg
28238bd17e5fSmrgsysv4 | sysv4.3*)
28248bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
28258bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
28268bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
28278bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
28288bd17e5fSmrg  case $host_vendor in
28298bd17e5fSmrg    sni)
28308bd17e5fSmrg      shlibpath_overrides_runpath=no
28318bd17e5fSmrg      need_lib_prefix=no
28328bd17e5fSmrg      runpath_var=LD_RUN_PATH
28330597fb56Smrg      ;;
28348bd17e5fSmrg    siemens)
28358bd17e5fSmrg      need_lib_prefix=no
28360597fb56Smrg      ;;
28378bd17e5fSmrg    motorola)
28388bd17e5fSmrg      need_lib_prefix=no
28398bd17e5fSmrg      need_version=no
28408bd17e5fSmrg      shlibpath_overrides_runpath=no
28418bd17e5fSmrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
28420597fb56Smrg      ;;
28438bd17e5fSmrg  esac
28448bd17e5fSmrg  ;;
28458c4a8e55Smrg
28468bd17e5fSmrgsysv4*MP*)
28478bd17e5fSmrg  if test -d /usr/nec ;then
28488bd17e5fSmrg    version_type=linux # correct to gnu/linux during the next big refactor
28498bd17e5fSmrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
28508bd17e5fSmrg    soname_spec='$libname${shared_ext}.$major'
28518bd17e5fSmrg    shlibpath_var=LD_LIBRARY_PATH
28528bd17e5fSmrg  fi
28538bd17e5fSmrg  ;;
28548bd17e5fSmrg
28558bd17e5fSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
28568bd17e5fSmrg  version_type=freebsd-elf
28578bd17e5fSmrg  need_lib_prefix=no
28588bd17e5fSmrg  need_version=no
28598bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
28608bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
28618bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
28628bd17e5fSmrg  shlibpath_overrides_runpath=yes
28638bd17e5fSmrg  hardcode_into_libs=yes
28648bd17e5fSmrg  if test "$with_gnu_ld" = yes; then
28658bd17e5fSmrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
28668bd17e5fSmrg  else
28678bd17e5fSmrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
28688bd17e5fSmrg    case $host_os in
28698bd17e5fSmrg      sco3.2v5*)
28708bd17e5fSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
28710597fb56Smrg	;;
28728bd17e5fSmrg    esac
28738bd17e5fSmrg  fi
28748bd17e5fSmrg  sys_lib_dlsearch_path_spec='/usr/lib'
28758bd17e5fSmrg  ;;
2876b042e37fSmrg
28778bd17e5fSmrgtpf*)
28788bd17e5fSmrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
28798bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
28808bd17e5fSmrg  need_lib_prefix=no
28818bd17e5fSmrg  need_version=no
28828bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
28838bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
28848bd17e5fSmrg  shlibpath_overrides_runpath=no
28858bd17e5fSmrg  hardcode_into_libs=yes
28868bd17e5fSmrg  ;;
2887b042e37fSmrg
28888bd17e5fSmrguts4*)
28898bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
28908bd17e5fSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
28918bd17e5fSmrg  soname_spec='${libname}${release}${shared_ext}$major'
28928bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
28938bd17e5fSmrg  ;;
2894b042e37fSmrg
28958bd17e5fSmrg*)
28968bd17e5fSmrg  dynamic_linker=no
28978bd17e5fSmrg  ;;
28988bd17e5fSmrgesac
28998bd17e5fSmrgAC_MSG_RESULT([$dynamic_linker])
29008bd17e5fSmrgtest "$dynamic_linker" = no && can_build_shared=no
2901706b6b52Smrg
29028bd17e5fSmrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
29038bd17e5fSmrgif test "$GCC" = yes; then
29048bd17e5fSmrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
29058bd17e5fSmrgfi
2906b042e37fSmrg
29078bd17e5fSmrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
29088bd17e5fSmrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
29098bd17e5fSmrgfi
29108bd17e5fSmrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
29118bd17e5fSmrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
29128bd17e5fSmrgfi
29130597fb56Smrg
29148bd17e5fSmrg_LT_DECL([], [variables_saved_for_relink], [1],
29158bd17e5fSmrg    [Variables whose values should be saved in libtool wrapper scripts and
29168bd17e5fSmrg    restored at link time])
29178bd17e5fSmrg_LT_DECL([], [need_lib_prefix], [0],
29188bd17e5fSmrg    [Do we need the "lib" prefix for modules?])
29198bd17e5fSmrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
29208bd17e5fSmrg_LT_DECL([], [version_type], [0], [Library versioning type])
29218bd17e5fSmrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
29228bd17e5fSmrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
29238bd17e5fSmrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
29248bd17e5fSmrg    [Is shlibpath searched before the hard-coded library search path?])
29258bd17e5fSmrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
29268bd17e5fSmrg_LT_DECL([], [library_names_spec], [1],
29278bd17e5fSmrg    [[List of archive names.  First name is the real one, the rest are links.
29288bd17e5fSmrg    The last name is the one that the linker finds with -lNAME]])
29298bd17e5fSmrg_LT_DECL([], [soname_spec], [1],
29308bd17e5fSmrg    [[The coded name of the library, if different from the real name]])
29318bd17e5fSmrg_LT_DECL([], [install_override_mode], [1],
29328bd17e5fSmrg    [Permission mode override for installation of shared libraries])
29338bd17e5fSmrg_LT_DECL([], [postinstall_cmds], [2],
29348bd17e5fSmrg    [Command to use after installation of a shared archive])
29358bd17e5fSmrg_LT_DECL([], [postuninstall_cmds], [2],
29368bd17e5fSmrg    [Command to use after uninstallation of a shared archive])
29378bd17e5fSmrg_LT_DECL([], [finish_cmds], [2],
29388bd17e5fSmrg    [Commands used to finish a libtool library installation in a directory])
29398bd17e5fSmrg_LT_DECL([], [finish_eval], [1],
29408bd17e5fSmrg    [[As "finish_cmds", except a single script fragment to be evaled but
29418bd17e5fSmrg    not shown]])
29428bd17e5fSmrg_LT_DECL([], [hardcode_into_libs], [0],
29438bd17e5fSmrg    [Whether we should hardcode library paths into libraries])
29448bd17e5fSmrg_LT_DECL([], [sys_lib_search_path_spec], [2],
29458bd17e5fSmrg    [Compile-time system search path for libraries])
29468bd17e5fSmrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
29478bd17e5fSmrg    [Run-time system search path for libraries])
29488bd17e5fSmrg])# _LT_SYS_DYNAMIC_LINKER
2949b042e37fSmrg
2950b042e37fSmrg
29518bd17e5fSmrg# _LT_PATH_TOOL_PREFIX(TOOL)
29528bd17e5fSmrg# --------------------------
29538bd17e5fSmrg# find a file program which can recognize shared library
29548bd17e5fSmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
29558bd17e5fSmrg[m4_require([_LT_DECL_EGREP])dnl
29568bd17e5fSmrgAC_MSG_CHECKING([for $1])
29578bd17e5fSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
29588bd17e5fSmrg[case $MAGIC_CMD in
29598bd17e5fSmrg[[\\/*] |  ?:[\\/]*])
29608bd17e5fSmrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
29618bd17e5fSmrg  ;;
29628bd17e5fSmrg*)
29638bd17e5fSmrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
29648bd17e5fSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
29658bd17e5fSmrgdnl $ac_dummy forces splitting on constant user-supplied paths.
29668bd17e5fSmrgdnl POSIX.2 word splitting is done only on the output of word expansions,
29678bd17e5fSmrgdnl not every word.  This closes a longstanding sh security hole.
29688bd17e5fSmrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
29698bd17e5fSmrg  for ac_dir in $ac_dummy; do
29708bd17e5fSmrg    IFS="$lt_save_ifs"
29718bd17e5fSmrg    test -z "$ac_dir" && ac_dir=.
29728bd17e5fSmrg    if test -f $ac_dir/$1; then
29738bd17e5fSmrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
29748bd17e5fSmrg      if test -n "$file_magic_test_file"; then
29758bd17e5fSmrg	case $deplibs_check_method in
29768bd17e5fSmrg	"file_magic "*)
29778bd17e5fSmrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
29788bd17e5fSmrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
29798bd17e5fSmrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
29808bd17e5fSmrg	    $EGREP "$file_magic_regex" > /dev/null; then
29818bd17e5fSmrg	    :
29828bd17e5fSmrg	  else
29838bd17e5fSmrg	    cat <<_LT_EOF 1>&2
2984b042e37fSmrg
29858bd17e5fSmrg*** Warning: the command libtool uses to detect shared libraries,
29868bd17e5fSmrg*** $file_magic_cmd, produces output that libtool cannot recognize.
29878bd17e5fSmrg*** The result is that libtool may fail to recognize shared libraries
29888bd17e5fSmrg*** as such.  This will affect the creation of libtool libraries that
29898bd17e5fSmrg*** depend on shared libraries, but programs linked with such libtool
29908bd17e5fSmrg*** libraries will work regardless of this problem.  Nevertheless, you
29918bd17e5fSmrg*** may want to report the problem to your system manager and/or to
29928bd17e5fSmrg*** bug-libtool@gnu.org
2993b042e37fSmrg
29948bd17e5fSmrg_LT_EOF
29958bd17e5fSmrg	  fi ;;
29960597fb56Smrg	esac
29978bd17e5fSmrg      fi
29988bd17e5fSmrg      break
29998bd17e5fSmrg    fi
30008bd17e5fSmrg  done
30018bd17e5fSmrg  IFS="$lt_save_ifs"
30028bd17e5fSmrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
30038bd17e5fSmrg  ;;
30048bd17e5fSmrgesac])
30058bd17e5fSmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
30068bd17e5fSmrgif test -n "$MAGIC_CMD"; then
30078bd17e5fSmrg  AC_MSG_RESULT($MAGIC_CMD)
30088bd17e5fSmrgelse
30098bd17e5fSmrg  AC_MSG_RESULT(no)
30108bd17e5fSmrgfi
30118bd17e5fSmrg_LT_DECL([], [MAGIC_CMD], [0],
30128bd17e5fSmrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
30138bd17e5fSmrg])# _LT_PATH_TOOL_PREFIX
30140597fb56Smrg
30158bd17e5fSmrg# Old name:
30168bd17e5fSmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
30178bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
30188bd17e5fSmrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3019bd23fbfaSmrg
3020bd23fbfaSmrg
30218bd17e5fSmrg# _LT_PATH_MAGIC
30228bd17e5fSmrg# --------------
30238bd17e5fSmrg# find a file program which can recognize a shared library
30248bd17e5fSmrgm4_defun([_LT_PATH_MAGIC],
30258bd17e5fSmrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
30268bd17e5fSmrgif test -z "$lt_cv_path_MAGIC_CMD"; then
30278bd17e5fSmrg  if test -n "$ac_tool_prefix"; then
30288bd17e5fSmrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
30298bd17e5fSmrg  else
30308bd17e5fSmrg    MAGIC_CMD=:
30318bd17e5fSmrg  fi
30328bd17e5fSmrgfi
30338bd17e5fSmrg])# _LT_PATH_MAGIC
30340597fb56Smrg
30350597fb56Smrg
30368bd17e5fSmrg# LT_PATH_LD
30378bd17e5fSmrg# ----------
30388bd17e5fSmrg# find the pathname to the GNU or non-GNU linker
30398bd17e5fSmrgAC_DEFUN([LT_PATH_LD],
30408bd17e5fSmrg[AC_REQUIRE([AC_PROG_CC])dnl
30418bd17e5fSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
30428bd17e5fSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
30438bd17e5fSmrgm4_require([_LT_DECL_SED])dnl
30448bd17e5fSmrgm4_require([_LT_DECL_EGREP])dnl
30458bd17e5fSmrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3046bd23fbfaSmrg
30478bd17e5fSmrgAC_ARG_WITH([gnu-ld],
30488bd17e5fSmrg    [AS_HELP_STRING([--with-gnu-ld],
30498bd17e5fSmrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
30508bd17e5fSmrg    [test "$withval" = no || with_gnu_ld=yes],
30518bd17e5fSmrg    [with_gnu_ld=no])dnl
3052706b6b52Smrg
30538bd17e5fSmrgac_prog=ld
30548bd17e5fSmrgif test "$GCC" = yes; then
30558bd17e5fSmrg  # Check if gcc -print-prog-name=ld gives a path.
30568bd17e5fSmrg  AC_MSG_CHECKING([for ld used by $CC])
30578bd17e5fSmrg  case $host in
30588bd17e5fSmrg  *-*-mingw*)
30598bd17e5fSmrg    # gcc leaves a trailing carriage return which upsets mingw
30608bd17e5fSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
30618bd17e5fSmrg  *)
30628bd17e5fSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
30638bd17e5fSmrg  esac
30648bd17e5fSmrg  case $ac_prog in
30658bd17e5fSmrg    # Accept absolute paths.
30668bd17e5fSmrg    [[\\/]]* | ?:[[\\/]]*)
30678bd17e5fSmrg      re_direlt='/[[^/]][[^/]]*/\.\./'
30688bd17e5fSmrg      # Canonicalize the pathname of ld
30698bd17e5fSmrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
30708bd17e5fSmrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
30718bd17e5fSmrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
30728bd17e5fSmrg      done
30738bd17e5fSmrg      test -z "$LD" && LD="$ac_prog"
30740597fb56Smrg      ;;
30758bd17e5fSmrg  "")
30768bd17e5fSmrg    # If it fails, then pretend we aren't using GCC.
30778bd17e5fSmrg    ac_prog=ld
30788bd17e5fSmrg    ;;
30798bd17e5fSmrg  *)
30808bd17e5fSmrg    # If it is relative, then search for the first ld in PATH.
30818bd17e5fSmrg    with_gnu_ld=unknown
30828bd17e5fSmrg    ;;
30838bd17e5fSmrg  esac
30848bd17e5fSmrgelif test "$with_gnu_ld" = yes; then
30858bd17e5fSmrg  AC_MSG_CHECKING([for GNU ld])
30868bd17e5fSmrgelse
30878bd17e5fSmrg  AC_MSG_CHECKING([for non-GNU ld])
30888bd17e5fSmrgfi
30898bd17e5fSmrgAC_CACHE_VAL(lt_cv_path_LD,
30908bd17e5fSmrg[if test -z "$LD"; then
30918bd17e5fSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
30928bd17e5fSmrg  for ac_dir in $PATH; do
30938bd17e5fSmrg    IFS="$lt_save_ifs"
30948bd17e5fSmrg    test -z "$ac_dir" && ac_dir=.
30958bd17e5fSmrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
30968bd17e5fSmrg      lt_cv_path_LD="$ac_dir/$ac_prog"
30978bd17e5fSmrg      # Check to see if the program is GNU ld.  I'd rather use --version,
30988bd17e5fSmrg      # but apparently some variants of GNU ld only accept -v.
30998bd17e5fSmrg      # Break only if it was the GNU/non-GNU ld that we prefer.
31008bd17e5fSmrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
31018bd17e5fSmrg      *GNU* | *'with BFD'*)
31028bd17e5fSmrg	test "$with_gnu_ld" != no && break
31038bd17e5fSmrg	;;
31048bd17e5fSmrg      *)
31058bd17e5fSmrg	test "$with_gnu_ld" != yes && break
31068bd17e5fSmrg	;;
31078bd17e5fSmrg      esac
31088bd17e5fSmrg    fi
31098bd17e5fSmrg  done
31108bd17e5fSmrg  IFS="$lt_save_ifs"
31118bd17e5fSmrgelse
31128bd17e5fSmrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
31138bd17e5fSmrgfi])
31148bd17e5fSmrgLD="$lt_cv_path_LD"
31158bd17e5fSmrgif test -n "$LD"; then
31168bd17e5fSmrg  AC_MSG_RESULT($LD)
31178bd17e5fSmrgelse
31188bd17e5fSmrg  AC_MSG_RESULT(no)
31198bd17e5fSmrgfi
31208bd17e5fSmrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
31218bd17e5fSmrg_LT_PATH_LD_GNU
31228bd17e5fSmrgAC_SUBST([LD])
3123b042e37fSmrg
31248bd17e5fSmrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
31258bd17e5fSmrg])# LT_PATH_LD
3126b042e37fSmrg
31278bd17e5fSmrg# Old names:
31288bd17e5fSmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
31298bd17e5fSmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
31308bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
31318bd17e5fSmrgdnl AC_DEFUN([AM_PROG_LD], [])
31328bd17e5fSmrgdnl AC_DEFUN([AC_PROG_LD], [])
3133b042e37fSmrg
3134b042e37fSmrg
31358bd17e5fSmrg# _LT_PATH_LD_GNU
31368bd17e5fSmrg#- --------------
31378bd17e5fSmrgm4_defun([_LT_PATH_LD_GNU],
31388bd17e5fSmrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
31398bd17e5fSmrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
31408bd17e5fSmrgcase `$LD -v 2>&1 </dev/null` in
31418bd17e5fSmrg*GNU* | *'with BFD'*)
31428bd17e5fSmrg  lt_cv_prog_gnu_ld=yes
31438bd17e5fSmrg  ;;
31448bd17e5fSmrg*)
31458bd17e5fSmrg  lt_cv_prog_gnu_ld=no
31468bd17e5fSmrg  ;;
31478bd17e5fSmrgesac])
31488bd17e5fSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
31498bd17e5fSmrg])# _LT_PATH_LD_GNU
31508bd17e5fSmrg
31518bd17e5fSmrg
31528bd17e5fSmrg# _LT_CMD_RELOAD
31538bd17e5fSmrg# --------------
31548bd17e5fSmrg# find reload flag for linker
31558bd17e5fSmrg#   -- PORTME Some linkers may need a different reload flag.
31568bd17e5fSmrgm4_defun([_LT_CMD_RELOAD],
31578bd17e5fSmrg[AC_CACHE_CHECK([for $LD option to reload object files],
31588bd17e5fSmrg  lt_cv_ld_reload_flag,
31598bd17e5fSmrg  [lt_cv_ld_reload_flag='-r'])
31608bd17e5fSmrgreload_flag=$lt_cv_ld_reload_flag
31618bd17e5fSmrgcase $reload_flag in
31628bd17e5fSmrg"" | " "*) ;;
31638bd17e5fSmrg*) reload_flag=" $reload_flag" ;;
31648bd17e5fSmrgesac
31658bd17e5fSmrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
31660597fb56Smrgcase $host_os in
31678bd17e5fSmrg  cygwin* | mingw* | pw32* | cegcc*)
31688bd17e5fSmrg    if test "$GCC" != yes; then
31698bd17e5fSmrg      reload_cmds=false
31708bd17e5fSmrg    fi
3171706b6b52Smrg    ;;
31728bd17e5fSmrg  darwin*)
31738bd17e5fSmrg    if test "$GCC" = yes; then
31748bd17e5fSmrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
31758bd17e5fSmrg    else
31768bd17e5fSmrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
31778bd17e5fSmrg    fi
3178706b6b52Smrg    ;;
31790597fb56Smrgesac
31808bd17e5fSmrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
31818bd17e5fSmrg_LT_TAGDECL([], [reload_cmds], [2])dnl
31828bd17e5fSmrg])# _LT_CMD_RELOAD
3183706b6b52Smrg
3184706b6b52Smrg
31858bd17e5fSmrg# _LT_CHECK_MAGIC_METHOD
31868bd17e5fSmrg# ----------------------
31878bd17e5fSmrg# how to check for library dependencies
31888bd17e5fSmrg#  -- PORTME fill in with the dynamic library characteristics
31898bd17e5fSmrgm4_defun([_LT_CHECK_MAGIC_METHOD],
31908bd17e5fSmrg[m4_require([_LT_DECL_EGREP])
31918bd17e5fSmrgm4_require([_LT_DECL_OBJDUMP])
31928bd17e5fSmrgAC_CACHE_CHECK([how to recognize dependent libraries],
31938bd17e5fSmrglt_cv_deplibs_check_method,
31948bd17e5fSmrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
31958bd17e5fSmrglt_cv_file_magic_test_file=
31968bd17e5fSmrglt_cv_deplibs_check_method='unknown'
31978bd17e5fSmrg# Need to set the preceding variable on all platforms that support
31988bd17e5fSmrg# interlibrary dependencies.
31998bd17e5fSmrg# 'none' -- dependencies not supported.
32008bd17e5fSmrg# `unknown' -- same as none, but documents that we really don't know.
32018bd17e5fSmrg# 'pass_all' -- all dependencies passed with no checks.
32028bd17e5fSmrg# 'test_compile' -- check by making test program.
32038bd17e5fSmrg# 'file_magic [[regex]]' -- check by looking for files in library path
32048bd17e5fSmrg# which responds to the $file_magic_cmd with a given extended regex.
32058bd17e5fSmrg# If you have `file' or equivalent on your system and you're not sure
32068bd17e5fSmrg# whether `pass_all' will *always* work, you probably want this one.
3207b042e37fSmrg
32088bd17e5fSmrgcase $host_os in
32098bd17e5fSmrgaix[[4-9]]*)
32108bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
32118bd17e5fSmrg  ;;
32120597fb56Smrg
32138bd17e5fSmrgbeos*)
32148bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
32158bd17e5fSmrg  ;;
32160597fb56Smrg
32178bd17e5fSmrgbsdi[[45]]*)
32188bd17e5fSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
32198bd17e5fSmrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
32208bd17e5fSmrg  lt_cv_file_magic_test_file=/shlib/libc.so
32218bd17e5fSmrg  ;;
32228bd17e5fSmrg
32238bd17e5fSmrgcygwin*)
32248bd17e5fSmrg  # func_win32_libid is a shell function defined in ltmain.sh
32258bd17e5fSmrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
32268bd17e5fSmrg  lt_cv_file_magic_cmd='func_win32_libid'
32278bd17e5fSmrg  ;;
32288bd17e5fSmrg
32298bd17e5fSmrgmingw* | pw32*)
32308bd17e5fSmrg  # Base MSYS/MinGW do not provide the 'file' command needed by
32318bd17e5fSmrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
32328bd17e5fSmrg  # unless we find 'file', for example because we are cross-compiling.
32338bd17e5fSmrg  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
32348bd17e5fSmrg  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
32358bd17e5fSmrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
32368bd17e5fSmrg    lt_cv_file_magic_cmd='func_win32_libid'
32378bd17e5fSmrg  else
32388bd17e5fSmrg    # Keep this pattern in sync with the one in func_win32_libid.
32398bd17e5fSmrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
32408bd17e5fSmrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
32418bd17e5fSmrg  fi
32428bd17e5fSmrg  ;;
32438bd17e5fSmrg
32448bd17e5fSmrgcegcc*)
32458bd17e5fSmrg  # use the weaker test based on 'objdump'. See mingw*.
32468bd17e5fSmrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
32478bd17e5fSmrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
32488bd17e5fSmrg  ;;
32498bd17e5fSmrg
32508bd17e5fSmrgdarwin* | rhapsody*)
32518bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
32528bd17e5fSmrg  ;;
32538bd17e5fSmrg
32548bd17e5fSmrgfreebsd* | dragonfly*)
32558bd17e5fSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
32568bd17e5fSmrg    case $host_cpu in
32578bd17e5fSmrg    i*86 )
32588bd17e5fSmrg      # Not sure whether the presence of OpenBSD here was a mistake.
32598bd17e5fSmrg      # Let's accept both of them until this is cleared up.
32608bd17e5fSmrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
32618bd17e5fSmrg      lt_cv_file_magic_cmd=/usr/bin/file
32628bd17e5fSmrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
32630597fb56Smrg      ;;
32640597fb56Smrg    esac
32658bd17e5fSmrg  else
32668bd17e5fSmrg    lt_cv_deplibs_check_method=pass_all
32678bd17e5fSmrg  fi
32688bd17e5fSmrg  ;;
3269b042e37fSmrg
32708bd17e5fSmrggnu*)
32718bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
32728bd17e5fSmrg  ;;
32738bd17e5fSmrg
32748bd17e5fSmrghaiku*)
32758bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
32768bd17e5fSmrg  ;;
32778bd17e5fSmrg
32788bd17e5fSmrghpux10.20* | hpux11*)
32798bd17e5fSmrg  lt_cv_file_magic_cmd=/usr/bin/file
32808bd17e5fSmrg  case $host_cpu in
32818bd17e5fSmrg  ia64*)
32828bd17e5fSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
32838bd17e5fSmrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3284706b6b52Smrg    ;;
32858bd17e5fSmrg  hppa*64*)
32868bd17e5fSmrg    [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]']
32878bd17e5fSmrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
32880597fb56Smrg    ;;
32898bd17e5fSmrg  *)
32908bd17e5fSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
32918bd17e5fSmrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3292706b6b52Smrg    ;;
3293706b6b52Smrg  esac
32948bd17e5fSmrg  ;;
3295b042e37fSmrg
32968bd17e5fSmrginterix[[3-9]]*)
32978bd17e5fSmrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
32988bd17e5fSmrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
32998bd17e5fSmrg  ;;
3300b042e37fSmrg
33018bd17e5fSmrgirix5* | irix6* | nonstopux*)
33028bd17e5fSmrg  case $LD in
33038bd17e5fSmrg  *-32|*"-32 ") libmagic=32-bit;;
33048bd17e5fSmrg  *-n32|*"-n32 ") libmagic=N32;;
33058bd17e5fSmrg  *-64|*"-64 ") libmagic=64-bit;;
33068bd17e5fSmrg  *) libmagic=never-match;;
33078bd17e5fSmrg  esac
33088bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
33098bd17e5fSmrg  ;;
3310b042e37fSmrg
33118bd17e5fSmrg# This must be glibc/ELF.
33128bd17e5fSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
33138bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
33148bd17e5fSmrg  ;;
3315b042e37fSmrg
33168bd17e5fSmrgnetbsd*)
33178bd17e5fSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
33188bd17e5fSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
33198bd17e5fSmrg  else
33208bd17e5fSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
33218bd17e5fSmrg  fi
33228bd17e5fSmrg  ;;
3323b042e37fSmrg
33248bd17e5fSmrgnewos6*)
33258bd17e5fSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
33268bd17e5fSmrg  lt_cv_file_magic_cmd=/usr/bin/file
33278bd17e5fSmrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
33288bd17e5fSmrg  ;;
3329706b6b52Smrg
33308bd17e5fSmrg*nto* | *qnx*)
33318bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
33328bd17e5fSmrg  ;;
3333b042e37fSmrg
33348bd17e5fSmrgopenbsd*)
33358bd17e5fSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
33368bd17e5fSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
33378bd17e5fSmrg  else
33388bd17e5fSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
33398bd17e5fSmrg  fi
33408bd17e5fSmrg  ;;
3341b042e37fSmrg
33428bd17e5fSmrgosf3* | osf4* | osf5*)
33438bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
33448bd17e5fSmrg  ;;
33450597fb56Smrg
33468bd17e5fSmrgrdos*)
33478bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
33488bd17e5fSmrg  ;;
33490597fb56Smrg
33508bd17e5fSmrgsolaris*)
33518bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
33528bd17e5fSmrg  ;;
33530597fb56Smrg
33548bd17e5fSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
33558bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
33568bd17e5fSmrg  ;;
33570597fb56Smrg
33588bd17e5fSmrgsysv4 | sysv4.3*)
33598bd17e5fSmrg  case $host_vendor in
33608bd17e5fSmrg  motorola)
33618bd17e5fSmrg    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]]'
33628bd17e5fSmrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
33638bd17e5fSmrg    ;;
33648bd17e5fSmrg  ncr)
33658bd17e5fSmrg    lt_cv_deplibs_check_method=pass_all
33668bd17e5fSmrg    ;;
33678bd17e5fSmrg  sequent)
33688bd17e5fSmrg    lt_cv_file_magic_cmd='/bin/file'
33698bd17e5fSmrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
33708bd17e5fSmrg    ;;
33718bd17e5fSmrg  sni)
33728bd17e5fSmrg    lt_cv_file_magic_cmd='/bin/file'
33738bd17e5fSmrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
33748bd17e5fSmrg    lt_cv_file_magic_test_file=/lib/libc.so
33758bd17e5fSmrg    ;;
33768bd17e5fSmrg  siemens)
33778bd17e5fSmrg    lt_cv_deplibs_check_method=pass_all
33788bd17e5fSmrg    ;;
33798bd17e5fSmrg  pc)
33808bd17e5fSmrg    lt_cv_deplibs_check_method=pass_all
33818bd17e5fSmrg    ;;
33828bd17e5fSmrg  esac
33838bd17e5fSmrg  ;;
33840597fb56Smrg
33858bd17e5fSmrgtpf*)
33868bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
33878bd17e5fSmrg  ;;
33888bd17e5fSmrgesac
33898bd17e5fSmrg])
33908bd17e5fSmrg
33918bd17e5fSmrgfile_magic_glob=
33928bd17e5fSmrgwant_nocaseglob=no
33938bd17e5fSmrgif test "$build" = "$host"; then
33948bd17e5fSmrg  case $host_os in
33958bd17e5fSmrg  mingw* | pw32*)
33968bd17e5fSmrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
33978bd17e5fSmrg      want_nocaseglob=yes
33988bd17e5fSmrg    else
33998bd17e5fSmrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
34008bd17e5fSmrg    fi
34018bd17e5fSmrg    ;;
34028bd17e5fSmrg  esac
34038bd17e5fSmrgfi
34040597fb56Smrg
34058bd17e5fSmrgfile_magic_cmd=$lt_cv_file_magic_cmd
34068bd17e5fSmrgdeplibs_check_method=$lt_cv_deplibs_check_method
34078bd17e5fSmrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
34080597fb56Smrg
34098bd17e5fSmrg_LT_DECL([], [deplibs_check_method], [1],
34108bd17e5fSmrg    [Method to check whether dependent libraries are shared objects])
34118bd17e5fSmrg_LT_DECL([], [file_magic_cmd], [1],
34128bd17e5fSmrg    [Command to use when deplibs_check_method = "file_magic"])
34138bd17e5fSmrg_LT_DECL([], [file_magic_glob], [1],
34148bd17e5fSmrg    [How to find potential files when deplibs_check_method = "file_magic"])
34158bd17e5fSmrg_LT_DECL([], [want_nocaseglob], [1],
34168bd17e5fSmrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
34178bd17e5fSmrg])# _LT_CHECK_MAGIC_METHOD
34180597fb56Smrg
34198bd17e5fSmrg
34208bd17e5fSmrg# LT_PATH_NM
34218bd17e5fSmrg# ----------
34228bd17e5fSmrg# find the pathname to a BSD- or MS-compatible name lister
34238bd17e5fSmrgAC_DEFUN([LT_PATH_NM],
34248bd17e5fSmrg[AC_REQUIRE([AC_PROG_CC])dnl
34258bd17e5fSmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
34268bd17e5fSmrg[if test -n "$NM"; then
34278bd17e5fSmrg  # Let the user override the test.
34288bd17e5fSmrg  lt_cv_path_NM="$NM"
34298bd17e5fSmrgelse
34308bd17e5fSmrg  lt_nm_to_check="${ac_tool_prefix}nm"
34318bd17e5fSmrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
34328bd17e5fSmrg    lt_nm_to_check="$lt_nm_to_check nm"
34338bd17e5fSmrg  fi
34348bd17e5fSmrg  for lt_tmp_nm in $lt_nm_to_check; do
34358bd17e5fSmrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
34368bd17e5fSmrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
34378bd17e5fSmrg      IFS="$lt_save_ifs"
34388bd17e5fSmrg      test -z "$ac_dir" && ac_dir=.
34398bd17e5fSmrg      tmp_nm="$ac_dir/$lt_tmp_nm"
34408bd17e5fSmrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
34418bd17e5fSmrg	# Check to see if the nm accepts a BSD-compat flag.
34428bd17e5fSmrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
34438bd17e5fSmrg	#   nm: unknown option "B" ignored
34448bd17e5fSmrg	# Tru64's nm complains that /dev/null is an invalid object file
34458bd17e5fSmrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
34468bd17e5fSmrg	*/dev/null* | *'Invalid file or object type'*)
34478bd17e5fSmrg	  lt_cv_path_NM="$tmp_nm -B"
34488bd17e5fSmrg	  break
34498bd17e5fSmrg	  ;;
34508bd17e5fSmrg	*)
34518bd17e5fSmrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
34528bd17e5fSmrg	  */dev/null*)
34538bd17e5fSmrg	    lt_cv_path_NM="$tmp_nm -p"
34548bd17e5fSmrg	    break
34558bd17e5fSmrg	    ;;
34568bd17e5fSmrg	  *)
34578bd17e5fSmrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
34588bd17e5fSmrg	    continue # so that we can try to find one that supports BSD flags
34598bd17e5fSmrg	    ;;
34608bd17e5fSmrg	  esac
34610597fb56Smrg	  ;;
34620597fb56Smrg	esac
34630597fb56Smrg      fi
34648bd17e5fSmrg    done
34658bd17e5fSmrg    IFS="$lt_save_ifs"
34668bd17e5fSmrg  done
34678bd17e5fSmrg  : ${lt_cv_path_NM=no}
34688bd17e5fSmrgfi])
34698bd17e5fSmrgif test "$lt_cv_path_NM" != "no"; then
34708bd17e5fSmrg  NM="$lt_cv_path_NM"
34718bd17e5fSmrgelse
34728bd17e5fSmrg  # Didn't find any BSD compatible name lister, look for dumpbin.
34738bd17e5fSmrg  if test -n "$DUMPBIN"; then :
34748bd17e5fSmrg    # Let the user override the test.
34758bd17e5fSmrg  else
34768bd17e5fSmrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
34778bd17e5fSmrg    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
34788bd17e5fSmrg    *COFF*)
34798bd17e5fSmrg      DUMPBIN="$DUMPBIN -symbols"
3480706b6b52Smrg      ;;
34818bd17e5fSmrg    *)
34828bd17e5fSmrg      DUMPBIN=:
34830597fb56Smrg      ;;
34848bd17e5fSmrg    esac
34858bd17e5fSmrg  fi
34868bd17e5fSmrg  AC_SUBST([DUMPBIN])
34878bd17e5fSmrg  if test "$DUMPBIN" != ":"; then
34888bd17e5fSmrg    NM="$DUMPBIN"
34898bd17e5fSmrg  fi
34908bd17e5fSmrgfi
34918bd17e5fSmrgtest -z "$NM" && NM=nm
34928bd17e5fSmrgAC_SUBST([NM])
34938bd17e5fSmrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3494706b6b52Smrg
34958bd17e5fSmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
34968bd17e5fSmrg  [lt_cv_nm_interface="BSD nm"
34978bd17e5fSmrg  echo "int some_variable = 0;" > conftest.$ac_ext
34988bd17e5fSmrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
34998bd17e5fSmrg  (eval "$ac_compile" 2>conftest.err)
35008bd17e5fSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
35018bd17e5fSmrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
35028bd17e5fSmrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
35038bd17e5fSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
35048bd17e5fSmrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
35058bd17e5fSmrg  cat conftest.out >&AS_MESSAGE_LOG_FD
35068bd17e5fSmrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
35078bd17e5fSmrg    lt_cv_nm_interface="MS dumpbin"
35088bd17e5fSmrg  fi
35098bd17e5fSmrg  rm -f conftest*])
35108bd17e5fSmrg])# LT_PATH_NM
3511b042e37fSmrg
35128bd17e5fSmrg# Old names:
35138bd17e5fSmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
35148bd17e5fSmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
35158bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
35168bd17e5fSmrgdnl AC_DEFUN([AM_PROG_NM], [])
35178bd17e5fSmrgdnl AC_DEFUN([AC_PROG_NM], [])
3518b042e37fSmrg
35198bd17e5fSmrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
35208bd17e5fSmrg# --------------------------------
35218bd17e5fSmrg# how to determine the name of the shared library
35228bd17e5fSmrg# associated with a specific link library.
35238bd17e5fSmrg#  -- PORTME fill in with the dynamic library characteristics
35248bd17e5fSmrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
35258bd17e5fSmrg[m4_require([_LT_DECL_EGREP])
35268bd17e5fSmrgm4_require([_LT_DECL_OBJDUMP])
35278bd17e5fSmrgm4_require([_LT_DECL_DLLTOOL])
35288bd17e5fSmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
35298bd17e5fSmrglt_cv_sharedlib_from_linklib_cmd,
35308bd17e5fSmrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
3531b042e37fSmrg
35328bd17e5fSmrgcase $host_os in
35338bd17e5fSmrgcygwin* | mingw* | pw32* | cegcc*)
35348bd17e5fSmrg  # two different shell functions defined in ltmain.sh
35358bd17e5fSmrg  # decide which to use based on capabilities of $DLLTOOL
35368bd17e5fSmrg  case `$DLLTOOL --help 2>&1` in
35378bd17e5fSmrg  *--identify-strict*)
35388bd17e5fSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
35398bd17e5fSmrg    ;;
35408bd17e5fSmrg  *)
35418bd17e5fSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
35428bd17e5fSmrg    ;;
35438bd17e5fSmrg  esac
35448bd17e5fSmrg  ;;
35458bd17e5fSmrg*)
35468bd17e5fSmrg  # fallback: assume linklib IS sharedlib
35478bd17e5fSmrg  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
35488bd17e5fSmrg  ;;
35498bd17e5fSmrgesac
35508bd17e5fSmrg])
35518bd17e5fSmrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
35528bd17e5fSmrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3553b042e37fSmrg
35548bd17e5fSmrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
35558bd17e5fSmrg    [Command to associate shared and link libraries])
35568bd17e5fSmrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3557706b6b52Smrg
3558706b6b52Smrg
35598bd17e5fSmrg# _LT_PATH_MANIFEST_TOOL
35608bd17e5fSmrg# ----------------------
35618bd17e5fSmrg# locate the manifest tool
35628bd17e5fSmrgm4_defun([_LT_PATH_MANIFEST_TOOL],
35638bd17e5fSmrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
35648bd17e5fSmrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
35658bd17e5fSmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
35668bd17e5fSmrg  [lt_cv_path_mainfest_tool=no
35678bd17e5fSmrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
35688bd17e5fSmrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
35698bd17e5fSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
35708bd17e5fSmrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
35718bd17e5fSmrg    lt_cv_path_mainfest_tool=yes
35728bd17e5fSmrg  fi
35738bd17e5fSmrg  rm -f conftest*])
35748bd17e5fSmrgif test "x$lt_cv_path_mainfest_tool" != xyes; then
35758bd17e5fSmrg  MANIFEST_TOOL=:
35768bd17e5fSmrgfi
35778bd17e5fSmrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
35788bd17e5fSmrg])# _LT_PATH_MANIFEST_TOOL
3579706b6b52Smrg
3580706b6b52Smrg
35818bd17e5fSmrg# LT_LIB_M
35828bd17e5fSmrg# --------
35838bd17e5fSmrg# check for math library
35848bd17e5fSmrgAC_DEFUN([LT_LIB_M],
35858bd17e5fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
35868bd17e5fSmrgLIBM=
35878bd17e5fSmrgcase $host in
35888bd17e5fSmrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
35898bd17e5fSmrg  # These system don't have libm, or don't need it
35908bd17e5fSmrg  ;;
35918bd17e5fSmrg*-ncr-sysv4.3*)
35928bd17e5fSmrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
35938bd17e5fSmrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
35948bd17e5fSmrg  ;;
35958bd17e5fSmrg*)
35968bd17e5fSmrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
35978bd17e5fSmrg  ;;
35988bd17e5fSmrgesac
35998bd17e5fSmrgAC_SUBST([LIBM])
36008bd17e5fSmrg])# LT_LIB_M
3601b042e37fSmrg
36028bd17e5fSmrg# Old name:
36038bd17e5fSmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
36048bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
36058bd17e5fSmrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3606b042e37fSmrg
3607b042e37fSmrg
36088bd17e5fSmrg# _LT_COMPILER_NO_RTTI([TAGNAME])
36098bd17e5fSmrg# -------------------------------
36108bd17e5fSmrgm4_defun([_LT_COMPILER_NO_RTTI],
36118bd17e5fSmrg[m4_require([_LT_TAG_COMPILER])dnl
3612b042e37fSmrg
36138bd17e5fSmrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3614b042e37fSmrg
36158bd17e5fSmrgif test "$GCC" = yes; then
36168bd17e5fSmrg  case $cc_basename in
36178bd17e5fSmrg  nvcc*)
36188bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
36198bd17e5fSmrg  *)
36208bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
36218bd17e5fSmrg  esac
36228bd17e5fSmrg
36238bd17e5fSmrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
36248bd17e5fSmrg    lt_cv_prog_compiler_rtti_exceptions,
36258bd17e5fSmrg    [-fno-rtti -fno-exceptions], [],
36268bd17e5fSmrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
36278bd17e5fSmrgfi
36288bd17e5fSmrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
36298bd17e5fSmrg	[Compiler flag to turn off builtin functions])
36308bd17e5fSmrg])# _LT_COMPILER_NO_RTTI
3631b042e37fSmrg
3632b042e37fSmrg
36338bd17e5fSmrg# _LT_CMD_GLOBAL_SYMBOLS
36348bd17e5fSmrg# ----------------------
36358bd17e5fSmrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
36368bd17e5fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
36378bd17e5fSmrgAC_REQUIRE([AC_PROG_CC])dnl
36388bd17e5fSmrgAC_REQUIRE([AC_PROG_AWK])dnl
36398bd17e5fSmrgAC_REQUIRE([LT_PATH_NM])dnl
36408bd17e5fSmrgAC_REQUIRE([LT_PATH_LD])dnl
36418bd17e5fSmrgm4_require([_LT_DECL_SED])dnl
36428bd17e5fSmrgm4_require([_LT_DECL_EGREP])dnl
36438bd17e5fSmrgm4_require([_LT_TAG_COMPILER])dnl
36440597fb56Smrg
36458bd17e5fSmrg# Check for command to grab the raw symbol name followed by C symbol from nm.
36468bd17e5fSmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
36478bd17e5fSmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
36488bd17e5fSmrg[
36498bd17e5fSmrg# These are sane defaults that work on at least a few old systems.
36508bd17e5fSmrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3651b042e37fSmrg
36528bd17e5fSmrg# Character class describing NM global symbol codes.
36538bd17e5fSmrgsymcode='[[BCDEGRST]]'
3654b042e37fSmrg
36558bd17e5fSmrg# Regexp to match symbols that can be accessed directly from C.
36568bd17e5fSmrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3657b042e37fSmrg
36588bd17e5fSmrg# Define system-specific variables.
36598bd17e5fSmrgcase $host_os in
36608bd17e5fSmrgaix*)
36618bd17e5fSmrg  symcode='[[BCDT]]'
36628bd17e5fSmrg  ;;
36638bd17e5fSmrgcygwin* | mingw* | pw32* | cegcc*)
36648bd17e5fSmrg  symcode='[[ABCDGISTW]]'
36658bd17e5fSmrg  ;;
36668bd17e5fSmrghpux*)
36678bd17e5fSmrg  if test "$host_cpu" = ia64; then
36688bd17e5fSmrg    symcode='[[ABCDEGRST]]'
36698bd17e5fSmrg  fi
36708bd17e5fSmrg  ;;
36718bd17e5fSmrgirix* | nonstopux*)
36728bd17e5fSmrg  symcode='[[BCDEGRST]]'
36738bd17e5fSmrg  ;;
36748bd17e5fSmrgosf*)
36758bd17e5fSmrg  symcode='[[BCDEGQRST]]'
36768bd17e5fSmrg  ;;
36778bd17e5fSmrgsolaris*)
36788bd17e5fSmrg  symcode='[[BDRT]]'
36798bd17e5fSmrg  ;;
36808bd17e5fSmrgsco3.2v5*)
36818bd17e5fSmrg  symcode='[[DT]]'
36828bd17e5fSmrg  ;;
36838bd17e5fSmrgsysv4.2uw2*)
36848bd17e5fSmrg  symcode='[[DT]]'
36858bd17e5fSmrg  ;;
36868bd17e5fSmrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
36878bd17e5fSmrg  symcode='[[ABDT]]'
36888bd17e5fSmrg  ;;
36898bd17e5fSmrgsysv4)
36908bd17e5fSmrg  symcode='[[DFNSTU]]'
36918bd17e5fSmrg  ;;
36928bd17e5fSmrgesac
3693b042e37fSmrg
36948bd17e5fSmrg# If we're using GNU nm, then use its standard symbol codes.
36958bd17e5fSmrgcase `$NM -V 2>&1` in
36968bd17e5fSmrg*GNU* | *'with BFD'*)
36978bd17e5fSmrg  symcode='[[ABCDGIRSTW]]' ;;
36988bd17e5fSmrgesac
3699b042e37fSmrg
37008bd17e5fSmrg# Transform an extracted symbol line into a proper C declaration.
37018bd17e5fSmrg# Some systems (esp. on ia64) link data and code symbols differently,
37028bd17e5fSmrg# so use this general approach.
37038bd17e5fSmrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3704b042e37fSmrg
37058bd17e5fSmrg# Transform an extracted symbol line into symbol name and symbol address
37068bd17e5fSmrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
37078bd17e5fSmrglt_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'"
3708b042e37fSmrg
37098bd17e5fSmrg# Handle CRLF in mingw tool chain
37108bd17e5fSmrgopt_cr=
37118bd17e5fSmrgcase $build_os in
37128bd17e5fSmrgmingw*)
37138bd17e5fSmrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
37148bd17e5fSmrg  ;;
37158bd17e5fSmrgesac
3716b042e37fSmrg
37178bd17e5fSmrg# Try without a prefix underscore, then with it.
37188bd17e5fSmrgfor ac_symprfx in "" "_"; do
3719b042e37fSmrg
37208bd17e5fSmrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
37218bd17e5fSmrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
37228bd17e5fSmrg
37238bd17e5fSmrg  # Write the raw and C identifiers.
37248bd17e5fSmrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
37258bd17e5fSmrg    # Fake it for dumpbin and say T for any non-static function
37268bd17e5fSmrg    # and D for any global variable.
37278bd17e5fSmrg    # Also find C++ and __fastcall symbols from MSVC++,
37288bd17e5fSmrg    # which start with @ or ?.
37298bd17e5fSmrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
37308bd17e5fSmrg"     {last_section=section; section=\$ 3};"\
37318bd17e5fSmrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
37328bd17e5fSmrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
37338bd17e5fSmrg"     \$ 0!~/External *\|/{next};"\
37348bd17e5fSmrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
37358bd17e5fSmrg"     {if(hide[section]) next};"\
37368bd17e5fSmrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
37378bd17e5fSmrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
37388bd17e5fSmrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
37398bd17e5fSmrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
37408bd17e5fSmrg"     ' prfx=^$ac_symprfx]"
37418bd17e5fSmrg  else
37428bd17e5fSmrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
37438bd17e5fSmrg  fi
37448bd17e5fSmrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
3745b042e37fSmrg
37468bd17e5fSmrg  # Check to see that the pipe works correctly.
37478bd17e5fSmrg  pipe_works=no
3748b042e37fSmrg
37498bd17e5fSmrg  rm -f conftest*
37508bd17e5fSmrg  cat > conftest.$ac_ext <<_LT_EOF
37518bd17e5fSmrg#ifdef __cplusplus
37528bd17e5fSmrgextern "C" {
37538bd17e5fSmrg#endif
37548bd17e5fSmrgchar nm_test_var;
37558bd17e5fSmrgvoid nm_test_func(void);
37568bd17e5fSmrgvoid nm_test_func(void){}
37578bd17e5fSmrg#ifdef __cplusplus
37588bd17e5fSmrg}
37598bd17e5fSmrg#endif
37608bd17e5fSmrgint main(){nm_test_var='a';nm_test_func();return(0);}
37618bd17e5fSmrg_LT_EOF
3762b042e37fSmrg
37638bd17e5fSmrg  if AC_TRY_EVAL(ac_compile); then
37648bd17e5fSmrg    # Now try to grab the symbols.
37658bd17e5fSmrg    nlist=conftest.nm
37668bd17e5fSmrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
37678bd17e5fSmrg      # Try sorting and uniquifying the output.
37688bd17e5fSmrg      if sort "$nlist" | uniq > "$nlist"T; then
37698bd17e5fSmrg	mv -f "$nlist"T "$nlist"
37700597fb56Smrg      else
37718bd17e5fSmrg	rm -f "$nlist"T
37720597fb56Smrg      fi
3773b042e37fSmrg
37748bd17e5fSmrg      # Make sure that we snagged all the symbols we need.
37758bd17e5fSmrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
37768bd17e5fSmrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
37778bd17e5fSmrg	  cat <<_LT_EOF > conftest.$ac_ext
37788bd17e5fSmrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
37798bd17e5fSmrg#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
37808bd17e5fSmrg/* DATA imports from DLLs on WIN32 con't be const, because runtime
37818bd17e5fSmrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
37828bd17e5fSmrg# define LT@&t@_DLSYM_CONST
37838bd17e5fSmrg#elif defined(__osf__)
37848bd17e5fSmrg/* This system does not cope well with relocations in const data.  */
37858bd17e5fSmrg# define LT@&t@_DLSYM_CONST
37868bd17e5fSmrg#else
37878bd17e5fSmrg# define LT@&t@_DLSYM_CONST const
37888bd17e5fSmrg#endif
3789b042e37fSmrg
37908bd17e5fSmrg#ifdef __cplusplus
37918bd17e5fSmrgextern "C" {
37928bd17e5fSmrg#endif
3793b042e37fSmrg
37948bd17e5fSmrg_LT_EOF
37958bd17e5fSmrg	  # Now generate the symbol file.
37968bd17e5fSmrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
3797b042e37fSmrg
37988bd17e5fSmrg	  cat <<_LT_EOF >> conftest.$ac_ext
37998bd17e5fSmrg
38008bd17e5fSmrg/* The mapping between symbol names and symbols.  */
38018bd17e5fSmrgLT@&t@_DLSYM_CONST struct {
38028bd17e5fSmrg  const char *name;
38038bd17e5fSmrg  void       *address;
38048bd17e5fSmrg}
38058bd17e5fSmrglt__PROGRAM__LTX_preloaded_symbols[[]] =
38068bd17e5fSmrg{
38078bd17e5fSmrg  { "@PROGRAM@", (void *) 0 },
38088bd17e5fSmrg_LT_EOF
38098bd17e5fSmrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
38108bd17e5fSmrg	  cat <<\_LT_EOF >> conftest.$ac_ext
38118bd17e5fSmrg  {0, (void *) 0}
38128bd17e5fSmrg};
38138bd17e5fSmrg
38148bd17e5fSmrg/* This works around a problem in FreeBSD linker */
38158bd17e5fSmrg#ifdef FREEBSD_WORKAROUND
38168bd17e5fSmrgstatic const void *lt_preloaded_setup() {
38178bd17e5fSmrg  return lt__PROGRAM__LTX_preloaded_symbols;
38188bd17e5fSmrg}
38198bd17e5fSmrg#endif
38208bd17e5fSmrg
38218bd17e5fSmrg#ifdef __cplusplus
38228bd17e5fSmrg}
38238bd17e5fSmrg#endif
38248bd17e5fSmrg_LT_EOF
38258bd17e5fSmrg	  # Now try linking the two files.
38268bd17e5fSmrg	  mv conftest.$ac_objext conftstm.$ac_objext
38278bd17e5fSmrg	  lt_globsym_save_LIBS=$LIBS
38288bd17e5fSmrg	  lt_globsym_save_CFLAGS=$CFLAGS
38298bd17e5fSmrg	  LIBS="conftstm.$ac_objext"
38308bd17e5fSmrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
38318bd17e5fSmrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
38328bd17e5fSmrg	    pipe_works=yes
38338bd17e5fSmrg	  fi
38348bd17e5fSmrg	  LIBS=$lt_globsym_save_LIBS
38358bd17e5fSmrg	  CFLAGS=$lt_globsym_save_CFLAGS
38360597fb56Smrg	else
38378bd17e5fSmrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
38380597fb56Smrg	fi
38390597fb56Smrg      else
38408bd17e5fSmrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
38418bd17e5fSmrg      fi
38428bd17e5fSmrg    else
38438bd17e5fSmrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
38448bd17e5fSmrg    fi
38458bd17e5fSmrg  else
38468bd17e5fSmrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
38478bd17e5fSmrg    cat conftest.$ac_ext >&5
38488bd17e5fSmrg  fi
38498bd17e5fSmrg  rm -rf conftest* conftst*
38508bd17e5fSmrg
38518bd17e5fSmrg  # Do not use the global_symbol_pipe unless it works.
38528bd17e5fSmrg  if test "$pipe_works" = yes; then
38538bd17e5fSmrg    break
38548bd17e5fSmrg  else
38558bd17e5fSmrg    lt_cv_sys_global_symbol_pipe=
38568bd17e5fSmrg  fi
38578bd17e5fSmrgdone
38588bd17e5fSmrg])
38598bd17e5fSmrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
38608bd17e5fSmrg  lt_cv_sys_global_symbol_to_cdecl=
38618bd17e5fSmrgfi
38628bd17e5fSmrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
38638bd17e5fSmrg  AC_MSG_RESULT(failed)
38648bd17e5fSmrgelse
38658bd17e5fSmrg  AC_MSG_RESULT(ok)
38668bd17e5fSmrgfi
38678bd17e5fSmrg
38688bd17e5fSmrg# Response file support.
38698bd17e5fSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
38708bd17e5fSmrg  nm_file_list_spec='@'
38718bd17e5fSmrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
38728bd17e5fSmrg  nm_file_list_spec='@'
38738bd17e5fSmrgfi
38748bd17e5fSmrg
38758bd17e5fSmrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
38768bd17e5fSmrg    [Take the output of nm and produce a listing of raw symbols and C names])
38778bd17e5fSmrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
38788bd17e5fSmrg    [Transform the output of nm in a proper C declaration])
38798bd17e5fSmrg_LT_DECL([global_symbol_to_c_name_address],
38808bd17e5fSmrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
38818bd17e5fSmrg    [Transform the output of nm in a C name address pair])
38828bd17e5fSmrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
38838bd17e5fSmrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
38848bd17e5fSmrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
38858bd17e5fSmrg_LT_DECL([], [nm_file_list_spec], [1],
38868bd17e5fSmrg    [Specify filename containing input files for $NM])
38878bd17e5fSmrg]) # _LT_CMD_GLOBAL_SYMBOLS
38888bd17e5fSmrg
38898bd17e5fSmrg
38908bd17e5fSmrg# _LT_COMPILER_PIC([TAGNAME])
38918bd17e5fSmrg# ---------------------------
38928bd17e5fSmrgm4_defun([_LT_COMPILER_PIC],
38938bd17e5fSmrg[m4_require([_LT_TAG_COMPILER])dnl
38948bd17e5fSmrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
38958bd17e5fSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
38968bd17e5fSmrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
38978bd17e5fSmrg
38988bd17e5fSmrgm4_if([$1], [CXX], [
38998bd17e5fSmrg  # C++ specific cases for pic, static, wl, etc.
39008bd17e5fSmrg  if test "$GXX" = yes; then
39018bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
39028bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
39038bd17e5fSmrg
39048bd17e5fSmrg    case $host_os in
39058bd17e5fSmrg    aix*)
39068bd17e5fSmrg      # All AIX code is PIC.
39078bd17e5fSmrg      if test "$host_cpu" = ia64; then
39088bd17e5fSmrg	# AIX 5 now supports IA64 processor
39098bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
39100597fb56Smrg      fi
39110597fb56Smrg      ;;
3912b042e37fSmrg
39138bd17e5fSmrg    amigaos*)
39148bd17e5fSmrg      case $host_cpu in
39158bd17e5fSmrg      powerpc)
39168bd17e5fSmrg            # see comment about AmigaOS4 .so support
39178bd17e5fSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
39188bd17e5fSmrg        ;;
39198bd17e5fSmrg      m68k)
39208bd17e5fSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
39218bd17e5fSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
39228bd17e5fSmrg            # like `-m68040'.
39238bd17e5fSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
39248bd17e5fSmrg        ;;
39258bd17e5fSmrg      esac
39260597fb56Smrg      ;;
3927b042e37fSmrg
39288bd17e5fSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
39298bd17e5fSmrg      # PIC is the default for these OSes.
39300597fb56Smrg      ;;
39318bd17e5fSmrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
39328bd17e5fSmrg      # This hack is so that the source file can tell whether it is being
39338bd17e5fSmrg      # built for inclusion in a dll (and should export symbols for example).
39348bd17e5fSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
39358bd17e5fSmrg      # (--disable-auto-import) libraries
39368bd17e5fSmrg      m4_if([$1], [GCJ], [],
39378bd17e5fSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
39388bd17e5fSmrg      ;;
39398bd17e5fSmrg    darwin* | rhapsody*)
39408bd17e5fSmrg      # PIC is the default on this platform
39418bd17e5fSmrg      # Common symbols not allowed in MH_DYLIB files
39428bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
39438bd17e5fSmrg      ;;
39448bd17e5fSmrg    *djgpp*)
39458bd17e5fSmrg      # DJGPP does not support shared libraries at all
39468bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
39478bd17e5fSmrg      ;;
39488bd17e5fSmrg    haiku*)
39498bd17e5fSmrg      # PIC is the default for Haiku.
39508bd17e5fSmrg      # The "-static" flag exists, but is broken.
39518bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
39528bd17e5fSmrg      ;;
39538bd17e5fSmrg    interix[[3-9]]*)
39548bd17e5fSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
39558bd17e5fSmrg      # Instead, we relocate shared libraries at runtime.
39568bd17e5fSmrg      ;;
39578bd17e5fSmrg    sysv4*MP*)
39588bd17e5fSmrg      if test -d /usr/nec; then
39598bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
39600597fb56Smrg      fi
39610597fb56Smrg      ;;
39628bd17e5fSmrg    hpux*)
39638bd17e5fSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
39648bd17e5fSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
39658bd17e5fSmrg      # sets the default TLS model and affects inlining.
39668bd17e5fSmrg      case $host_cpu in
39678bd17e5fSmrg      hppa*64*)
39688bd17e5fSmrg	;;
39698bd17e5fSmrg      *)
39708bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
39718bd17e5fSmrg	;;
39728bd17e5fSmrg      esac
39738bd17e5fSmrg      ;;
39748bd17e5fSmrg    *qnx* | *nto*)
39758bd17e5fSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
39768bd17e5fSmrg      # it will coredump.
39778bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
39788bd17e5fSmrg      ;;
39798bd17e5fSmrg    *)
39808bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
39818bd17e5fSmrg      ;;
39828bd17e5fSmrg    esac
39838bd17e5fSmrg  else
39848bd17e5fSmrg    case $host_os in
39858bd17e5fSmrg      aix[[4-9]]*)
39868bd17e5fSmrg	# All AIX code is PIC.
39878bd17e5fSmrg	if test "$host_cpu" = ia64; then
39888bd17e5fSmrg	  # AIX 5 now supports IA64 processor
39898bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
39908bd17e5fSmrg	else
39918bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
39928bd17e5fSmrg	fi
39938bd17e5fSmrg	;;
39948bd17e5fSmrg      chorus*)
39958bd17e5fSmrg	case $cc_basename in
39968bd17e5fSmrg	cxch68*)
39978bd17e5fSmrg	  # Green Hills C++ Compiler
39988bd17e5fSmrg	  # _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"
39990597fb56Smrg	  ;;
40000597fb56Smrg	esac
40010597fb56Smrg	;;
40028bd17e5fSmrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
40038bd17e5fSmrg	# This hack is so that the source file can tell whether it is being
40048bd17e5fSmrg	# built for inclusion in a dll (and should export symbols for example).
40058bd17e5fSmrg	m4_if([$1], [GCJ], [],
40068bd17e5fSmrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
40078bd17e5fSmrg	;;
40088bd17e5fSmrg      dgux*)
40098bd17e5fSmrg	case $cc_basename in
40108bd17e5fSmrg	  ec++*)
40118bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
40128bd17e5fSmrg	    ;;
40138bd17e5fSmrg	  ghcx*)
40148bd17e5fSmrg	    # Green Hills C++ Compiler
40158bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
40168bd17e5fSmrg	    ;;
40178bd17e5fSmrg	  *)
40188bd17e5fSmrg	    ;;
40198bd17e5fSmrg	esac
40208bd17e5fSmrg	;;
40218bd17e5fSmrg      freebsd* | dragonfly*)
40228bd17e5fSmrg	# FreeBSD uses GNU C++
40238bd17e5fSmrg	;;
40248bd17e5fSmrg      hpux9* | hpux10* | hpux11*)
40258bd17e5fSmrg	case $cc_basename in
40268bd17e5fSmrg	  CC*)
40278bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40288bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
40298bd17e5fSmrg	    if test "$host_cpu" != ia64; then
40308bd17e5fSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
40318bd17e5fSmrg	    fi
40328bd17e5fSmrg	    ;;
40338bd17e5fSmrg	  aCC*)
40348bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40358bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
40368bd17e5fSmrg	    case $host_cpu in
40378bd17e5fSmrg	    hppa*64*|ia64*)
40388bd17e5fSmrg	      # +Z the default
40398bd17e5fSmrg	      ;;
40408bd17e5fSmrg	    *)
40418bd17e5fSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
40428bd17e5fSmrg	      ;;
40438bd17e5fSmrg	    esac
40448bd17e5fSmrg	    ;;
40458bd17e5fSmrg	  *)
40468bd17e5fSmrg	    ;;
40478bd17e5fSmrg	esac
40488bd17e5fSmrg	;;
40498bd17e5fSmrg      interix*)
40508bd17e5fSmrg	# This is c89, which is MS Visual C++ (no shared libs)
40518bd17e5fSmrg	# Anyone wants to do a port?
40528bd17e5fSmrg	;;
40538bd17e5fSmrg      irix5* | irix6* | nonstopux*)
40548bd17e5fSmrg	case $cc_basename in
40558bd17e5fSmrg	  CC*)
40568bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40578bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
40588bd17e5fSmrg	    # CC pic flag -KPIC is the default.
40598bd17e5fSmrg	    ;;
40608bd17e5fSmrg	  *)
40618bd17e5fSmrg	    ;;
40628bd17e5fSmrg	esac
40638bd17e5fSmrg	;;
40648bd17e5fSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
40658bd17e5fSmrg	case $cc_basename in
40668bd17e5fSmrg	  KCC*)
40678bd17e5fSmrg	    # KAI C++ Compiler
40688bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
40698bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
40708bd17e5fSmrg	    ;;
40718bd17e5fSmrg	  ecpc* )
40728bd17e5fSmrg	    # old Intel C++ for x86_64 which still supported -KPIC.
40738bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40748bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
40758bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
40768bd17e5fSmrg	    ;;
40778bd17e5fSmrg	  icpc* )
40788bd17e5fSmrg	    # Intel C++, used to be incompatible with GCC.
40798bd17e5fSmrg	    # ICC 10 doesn't accept -KPIC any more.
40808bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40818bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
40828bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
40838bd17e5fSmrg	    ;;
40848bd17e5fSmrg	  pgCC* | pgcpp*)
40858bd17e5fSmrg	    # Portland Group C++ compiler
40868bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40878bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
40888bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
40898bd17e5fSmrg	    ;;
40908bd17e5fSmrg	  cxx*)
40918bd17e5fSmrg	    # Compaq C++
40928bd17e5fSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
40938bd17e5fSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
40948bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
40958bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
40968bd17e5fSmrg	    ;;
40978bd17e5fSmrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
40988bd17e5fSmrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
40998bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
41008bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
41018bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
41028bd17e5fSmrg	    ;;
41038bd17e5fSmrg	  *)
41048bd17e5fSmrg	    case `$CC -V 2>&1 | sed 5q` in
41058bd17e5fSmrg	    *Sun\ C*)
41068bd17e5fSmrg	      # Sun C++ 5.9
41078bd17e5fSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
41088bd17e5fSmrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41098bd17e5fSmrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
41108bd17e5fSmrg	      ;;
41118bd17e5fSmrg	    esac
41128bd17e5fSmrg	    ;;
41138bd17e5fSmrg	esac
41148bd17e5fSmrg	;;
41158bd17e5fSmrg      lynxos*)
41168bd17e5fSmrg	;;
41178bd17e5fSmrg      m88k*)
41188bd17e5fSmrg	;;
41198bd17e5fSmrg      mvs*)
41208bd17e5fSmrg	case $cc_basename in
41218bd17e5fSmrg	  cxx*)
41228bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
41238bd17e5fSmrg	    ;;
41248bd17e5fSmrg	  *)
41258bd17e5fSmrg	    ;;
41268bd17e5fSmrg	esac
41278bd17e5fSmrg	;;
41288bd17e5fSmrg      netbsd*)
41290597fb56Smrg	;;
41308bd17e5fSmrg      *qnx* | *nto*)
41318bd17e5fSmrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
41328bd17e5fSmrg        # it will coredump.
41338bd17e5fSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
41340597fb56Smrg        ;;
41358bd17e5fSmrg      osf3* | osf4* | osf5*)
41368bd17e5fSmrg	case $cc_basename in
41378bd17e5fSmrg	  KCC*)
41388bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
41398bd17e5fSmrg	    ;;
41408bd17e5fSmrg	  RCC*)
41418bd17e5fSmrg	    # Rational C++ 2.4.1
41428bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
41438bd17e5fSmrg	    ;;
41448bd17e5fSmrg	  cxx*)
41458bd17e5fSmrg	    # Digital/Compaq C++
41468bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
41478bd17e5fSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
41488bd17e5fSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
41498bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
41508bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
41518bd17e5fSmrg	    ;;
41528bd17e5fSmrg	  *)
41538bd17e5fSmrg	    ;;
41548bd17e5fSmrg	esac
41550597fb56Smrg	;;
41568bd17e5fSmrg      psos*)
41578bd17e5fSmrg	;;
41588bd17e5fSmrg      solaris*)
41598bd17e5fSmrg	case $cc_basename in
41608bd17e5fSmrg	  CC* | sunCC*)
41618bd17e5fSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
41628bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
41638bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41648bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
41658bd17e5fSmrg	    ;;
41668bd17e5fSmrg	  gcx*)
41678bd17e5fSmrg	    # Green Hills C++ Compiler
41688bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
41698bd17e5fSmrg	    ;;
41708bd17e5fSmrg	  *)
41718bd17e5fSmrg	    ;;
41728bd17e5fSmrg	esac
41738bd17e5fSmrg	;;
41748bd17e5fSmrg      sunos4*)
41758bd17e5fSmrg	case $cc_basename in
41768bd17e5fSmrg	  CC*)
41778bd17e5fSmrg	    # Sun C++ 4.x
41788bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
41798bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41808bd17e5fSmrg	    ;;
41818bd17e5fSmrg	  lcc*)
41828bd17e5fSmrg	    # Lucid
41838bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
41848bd17e5fSmrg	    ;;
41858bd17e5fSmrg	  *)
41868bd17e5fSmrg	    ;;
41878bd17e5fSmrg	esac
41888bd17e5fSmrg	;;
41898bd17e5fSmrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
41908bd17e5fSmrg	case $cc_basename in
41918bd17e5fSmrg	  CC*)
41928bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
41938bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
41948bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41958bd17e5fSmrg	    ;;
41968bd17e5fSmrg	esac
41978bd17e5fSmrg	;;
41988bd17e5fSmrg      tandem*)
41998bd17e5fSmrg	case $cc_basename in
42008bd17e5fSmrg	  NCC*)
42018bd17e5fSmrg	    # NonStop-UX NCC 3.20
42028bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
42038bd17e5fSmrg	    ;;
42048bd17e5fSmrg	  *)
42058bd17e5fSmrg	    ;;
42068bd17e5fSmrg	esac
42078bd17e5fSmrg	;;
42088bd17e5fSmrg      vxworks*)
42098bd17e5fSmrg	;;
42108bd17e5fSmrg      *)
42118bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
42120597fb56Smrg	;;
42138c4a8e55Smrg    esac
42148c4a8e55Smrg  fi
42158bd17e5fSmrg],
42168bd17e5fSmrg[
42178bd17e5fSmrg  if test "$GCC" = yes; then
42188bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
42198bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4220b042e37fSmrg
42218bd17e5fSmrg    case $host_os in
42228bd17e5fSmrg      aix*)
42238bd17e5fSmrg      # All AIX code is PIC.
42248bd17e5fSmrg      if test "$host_cpu" = ia64; then
42258bd17e5fSmrg	# AIX 5 now supports IA64 processor
42268bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
42278bd17e5fSmrg      fi
42288bd17e5fSmrg      ;;
42290597fb56Smrg
42308bd17e5fSmrg    amigaos*)
42318bd17e5fSmrg      case $host_cpu in
42328bd17e5fSmrg      powerpc)
42338bd17e5fSmrg            # see comment about AmigaOS4 .so support
42348bd17e5fSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42358bd17e5fSmrg        ;;
42368bd17e5fSmrg      m68k)
42378bd17e5fSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
42388bd17e5fSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
42398bd17e5fSmrg            # like `-m68040'.
42408bd17e5fSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
42418bd17e5fSmrg        ;;
42428bd17e5fSmrg      esac
42438bd17e5fSmrg      ;;
4244b042e37fSmrg
42458bd17e5fSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
42468bd17e5fSmrg      # PIC is the default for these OSes.
42478bd17e5fSmrg      ;;
4248b042e37fSmrg
42498bd17e5fSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
42508bd17e5fSmrg      # This hack is so that the source file can tell whether it is being
42518bd17e5fSmrg      # built for inclusion in a dll (and should export symbols for example).
42528bd17e5fSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
42538bd17e5fSmrg      # (--disable-auto-import) libraries
42548bd17e5fSmrg      m4_if([$1], [GCJ], [],
42558bd17e5fSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
42568bd17e5fSmrg      ;;
42578c4a8e55Smrg
42588bd17e5fSmrg    darwin* | rhapsody*)
42598bd17e5fSmrg      # PIC is the default on this platform
42608bd17e5fSmrg      # Common symbols not allowed in MH_DYLIB files
42618bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
42628bd17e5fSmrg      ;;
4263b042e37fSmrg
42648bd17e5fSmrg    haiku*)
42658bd17e5fSmrg      # PIC is the default for Haiku.
42668bd17e5fSmrg      # The "-static" flag exists, but is broken.
42678bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
42688bd17e5fSmrg      ;;
4269b042e37fSmrg
42708bd17e5fSmrg    hpux*)
42718bd17e5fSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
42728bd17e5fSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
42738bd17e5fSmrg      # sets the default TLS model and affects inlining.
42748bd17e5fSmrg      case $host_cpu in
42758bd17e5fSmrg      hppa*64*)
42768bd17e5fSmrg	# +Z the default
42778bd17e5fSmrg	;;
42788bd17e5fSmrg      *)
42798bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42808bd17e5fSmrg	;;
42818bd17e5fSmrg      esac
42828bd17e5fSmrg      ;;
42838c4a8e55Smrg
42848bd17e5fSmrg    interix[[3-9]]*)
42858bd17e5fSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
42868bd17e5fSmrg      # Instead, we relocate shared libraries at runtime.
42878bd17e5fSmrg      ;;
42888c4a8e55Smrg
42898bd17e5fSmrg    msdosdjgpp*)
42908bd17e5fSmrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
42918bd17e5fSmrg      # on systems that don't support them.
42928bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
42938bd17e5fSmrg      enable_shared=no
42948bd17e5fSmrg      ;;
42958c4a8e55Smrg
42968bd17e5fSmrg    *nto* | *qnx*)
42978bd17e5fSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
42988bd17e5fSmrg      # it will coredump.
42998bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
43008bd17e5fSmrg      ;;
43018c4a8e55Smrg
43028bd17e5fSmrg    sysv4*MP*)
43038bd17e5fSmrg      if test -d /usr/nec; then
43048bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
43058bd17e5fSmrg      fi
43068bd17e5fSmrg      ;;
43078c4a8e55Smrg
43088bd17e5fSmrg    *)
43098bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
43108bd17e5fSmrg      ;;
43118bd17e5fSmrg    esac
43128bd17e5fSmrg
43138bd17e5fSmrg    case $cc_basename in
43148bd17e5fSmrg    nvcc*) # Cuda Compiler Driver 2.2
43158bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
43168bd17e5fSmrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
43178bd17e5fSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
43188bd17e5fSmrg      fi
43198bd17e5fSmrg      ;;
43208bd17e5fSmrg    esac
43210597fb56Smrg  else
43228bd17e5fSmrg    # PORTME Check for flag to pass linker flags through the system compiler.
43238bd17e5fSmrg    case $host_os in
43248bd17e5fSmrg    aix*)
43258bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43268bd17e5fSmrg      if test "$host_cpu" = ia64; then
43278bd17e5fSmrg	# AIX 5 now supports IA64 processor
43288bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
43298bd17e5fSmrg      else
43308bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
43318bd17e5fSmrg      fi
43328bd17e5fSmrg      ;;
4333b042e37fSmrg
43348bd17e5fSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
43358bd17e5fSmrg      # This hack is so that the source file can tell whether it is being
43368bd17e5fSmrg      # built for inclusion in a dll (and should export symbols for example).
43378bd17e5fSmrg      m4_if([$1], [GCJ], [],
43388bd17e5fSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
43398bd17e5fSmrg      ;;
4340bd23fbfaSmrg
43418bd17e5fSmrg    hpux9* | hpux10* | hpux11*)
43428bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43438bd17e5fSmrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
43448bd17e5fSmrg      # not for PA HP-UX.
43458bd17e5fSmrg      case $host_cpu in
43468bd17e5fSmrg      hppa*64*|ia64*)
43478bd17e5fSmrg	# +Z the default
43488bd17e5fSmrg	;;
43498bd17e5fSmrg      *)
43508bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
43518bd17e5fSmrg	;;
43528bd17e5fSmrg      esac
43538bd17e5fSmrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
43548bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
43558bd17e5fSmrg      ;;
4356b042e37fSmrg
43578bd17e5fSmrg    irix5* | irix6* | nonstopux*)
43588bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43598bd17e5fSmrg      # PIC (with -KPIC) is the default.
43608bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
43618bd17e5fSmrg      ;;
4362b042e37fSmrg
43638bd17e5fSmrg    linux* | k*bsd*-gnu | kopensolaris*-gnu)
43648bd17e5fSmrg      case $cc_basename in
43658bd17e5fSmrg      # old Intel for x86_64 which still supported -KPIC.
43668bd17e5fSmrg      ecc*)
43678bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43688bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
43698bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
43708bd17e5fSmrg        ;;
43718bd17e5fSmrg      # icc used to be incompatible with GCC.
43728bd17e5fSmrg      # ICC 10 doesn't accept -KPIC any more.
43738bd17e5fSmrg      icc* | ifort*)
43748bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43758bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
43768bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
43778bd17e5fSmrg        ;;
43788bd17e5fSmrg      # Lahey Fortran 8.1.
43798bd17e5fSmrg      lf95*)
43808bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43818bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
43828bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
43838bd17e5fSmrg	;;
43848bd17e5fSmrg      nagfor*)
43858bd17e5fSmrg	# NAG Fortran compiler
43868bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
43878bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
43888bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
43898bd17e5fSmrg	;;
43908bd17e5fSmrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
43918bd17e5fSmrg        # Portland Group compilers (*not* the Pentium gcc compiler,
43928bd17e5fSmrg	# which looks to be a dead project)
43938bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43948bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
43958bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
43968bd17e5fSmrg        ;;
43978bd17e5fSmrg      ccc*)
43988bd17e5fSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43998bd17e5fSmrg        # All Alpha code is PIC.
44008bd17e5fSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
44018bd17e5fSmrg        ;;
44028bd17e5fSmrg      xl* | bgxl* | bgf* | mpixl*)
44038bd17e5fSmrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
44048bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44058bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
44068bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
44078bd17e5fSmrg	;;
44088bd17e5fSmrg      *)
44098bd17e5fSmrg	case `$CC -V 2>&1 | sed 5q` in
44108bd17e5fSmrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
44118bd17e5fSmrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
44128bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44138bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44148bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
44158bd17e5fSmrg	  ;;
44168bd17e5fSmrg	*Sun\ F* | *Sun*Fortran*)
44178bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44188bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44198bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
44208bd17e5fSmrg	  ;;
44218bd17e5fSmrg	*Sun\ C*)
44228bd17e5fSmrg	  # Sun C 5.9
44238bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44248bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44258bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44268bd17e5fSmrg	  ;;
44278bd17e5fSmrg        *Intel*\ [[CF]]*Compiler*)
44288bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44298bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
44308bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
44318bd17e5fSmrg	  ;;
44328bd17e5fSmrg	*Portland\ Group*)
44338bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44348bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
44358bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44368bd17e5fSmrg	  ;;
44378bd17e5fSmrg	esac
44388bd17e5fSmrg	;;
44398bd17e5fSmrg      esac
44408bd17e5fSmrg      ;;
4441b042e37fSmrg
44428bd17e5fSmrg    newsos6)
44438bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44448bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44458bd17e5fSmrg      ;;
4446b042e37fSmrg
44478bd17e5fSmrg    *nto* | *qnx*)
44488bd17e5fSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
44498bd17e5fSmrg      # it will coredump.
44508bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
44518bd17e5fSmrg      ;;
4452b042e37fSmrg
44538bd17e5fSmrg    osf3* | osf4* | osf5*)
44548bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44558bd17e5fSmrg      # All OSF/1 code is PIC.
44568bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
44578bd17e5fSmrg      ;;
44588bd17e5fSmrg
44598bd17e5fSmrg    rdos*)
44608bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
44618bd17e5fSmrg      ;;
44620597fb56Smrg
44638bd17e5fSmrg    solaris*)
44648bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44658bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44668bd17e5fSmrg      case $cc_basename in
44678bd17e5fSmrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
44688bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
44698bd17e5fSmrg      *)
44708bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
44718bd17e5fSmrg      esac
44728bd17e5fSmrg      ;;
44730597fb56Smrg
44748bd17e5fSmrg    sunos4*)
44758bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
44768bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
44778bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44788bd17e5fSmrg      ;;
44790597fb56Smrg
44808bd17e5fSmrg    sysv4 | sysv4.2uw2* | sysv4.3*)
44818bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44828bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44838bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44848bd17e5fSmrg      ;;
4485b042e37fSmrg
44868bd17e5fSmrg    sysv4*MP*)
44878bd17e5fSmrg      if test -d /usr/nec ;then
44888bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
44898bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44908bd17e5fSmrg      fi
44918bd17e5fSmrg      ;;
4492bd23fbfaSmrg
44938bd17e5fSmrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
44948bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44958bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44968bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44978bd17e5fSmrg      ;;
4498b042e37fSmrg
44998bd17e5fSmrg    unicos*)
45008bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
45018bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
45028bd17e5fSmrg      ;;
45038c4a8e55Smrg
45048bd17e5fSmrg    uts4*)
45058bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
45068bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
45078bd17e5fSmrg      ;;
45088c4a8e55Smrg
45098bd17e5fSmrg    *)
45108bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
45118bd17e5fSmrg      ;;
45128bd17e5fSmrg    esac
45138bd17e5fSmrg  fi
45148bd17e5fSmrg])
45158bd17e5fSmrgcase $host_os in
45168bd17e5fSmrg  # For platforms which do not support PIC, -DPIC is meaningless:
45178bd17e5fSmrg  *djgpp*)
45188bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
45198bd17e5fSmrg    ;;
45208bd17e5fSmrg  *)
45218bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
45228bd17e5fSmrg    ;;
45238bd17e5fSmrgesac
4524b042e37fSmrg
45258bd17e5fSmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
45268bd17e5fSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
45278bd17e5fSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
45288bd17e5fSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
45298c4a8e55Smrg
45308bd17e5fSmrg#
45318bd17e5fSmrg# Check to make sure the PIC flag actually works.
45328bd17e5fSmrg#
45338bd17e5fSmrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
45348bd17e5fSmrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
45358bd17e5fSmrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
45368bd17e5fSmrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
45378bd17e5fSmrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
45388bd17e5fSmrg     "" | " "*) ;;
45398bd17e5fSmrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
45408bd17e5fSmrg     esac],
45418bd17e5fSmrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
45428bd17e5fSmrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
45438bd17e5fSmrgfi
45448bd17e5fSmrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
45458bd17e5fSmrg	[Additional compiler flags for building library objects])
45460597fb56Smrg
45478bd17e5fSmrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
45488bd17e5fSmrg	[How to pass a linker flag through the compiler])
45498bd17e5fSmrg#
45508bd17e5fSmrg# Check to make sure the static flag actually works.
45518bd17e5fSmrg#
45528bd17e5fSmrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
45538bd17e5fSmrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
45548bd17e5fSmrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
45558bd17e5fSmrg  $lt_tmp_static_flag,
45568bd17e5fSmrg  [],
45578bd17e5fSmrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
45588bd17e5fSmrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
45598bd17e5fSmrg	[Compiler flag to prevent dynamic linking])
45608bd17e5fSmrg])# _LT_COMPILER_PIC
4561b042e37fSmrg
45620597fb56Smrg
45638bd17e5fSmrg# _LT_LINKER_SHLIBS([TAGNAME])
45648bd17e5fSmrg# ----------------------------
45658bd17e5fSmrg# See if the linker supports building shared libraries.
45668bd17e5fSmrgm4_defun([_LT_LINKER_SHLIBS],
45678bd17e5fSmrg[AC_REQUIRE([LT_PATH_LD])dnl
45688bd17e5fSmrgAC_REQUIRE([LT_PATH_NM])dnl
45698bd17e5fSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
45708bd17e5fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
45718bd17e5fSmrgm4_require([_LT_DECL_EGREP])dnl
45728bd17e5fSmrgm4_require([_LT_DECL_SED])dnl
45738bd17e5fSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
45748bd17e5fSmrgm4_require([_LT_TAG_COMPILER])dnl
45758bd17e5fSmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
45768bd17e5fSmrgm4_if([$1], [CXX], [
45778bd17e5fSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
45788bd17e5fSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
45798bd17e5fSmrg  case $host_os in
45808bd17e5fSmrg  aix[[4-9]]*)
45818bd17e5fSmrg    # If we're using GNU nm, then we don't want the "-C" option.
45828bd17e5fSmrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
45838bd17e5fSmrg    # Also, AIX nm treats weak defined symbols like other global defined
45848bd17e5fSmrg    # symbols, whereas GNU nm marks them as "W".
45858bd17e5fSmrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
45868bd17e5fSmrg      _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'
45878bd17e5fSmrg    else
45888bd17e5fSmrg      _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'
45898bd17e5fSmrg    fi
45908bd17e5fSmrg    ;;
45918bd17e5fSmrg  pw32*)
45928bd17e5fSmrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
45938bd17e5fSmrg    ;;
45948bd17e5fSmrg  cygwin* | mingw* | cegcc*)
45958bd17e5fSmrg    case $cc_basename in
45968bd17e5fSmrg    cl*)
45978bd17e5fSmrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
45988bd17e5fSmrg      ;;
45998bd17e5fSmrg    *)
46008bd17e5fSmrg      _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'
46018bd17e5fSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
46028bd17e5fSmrg      ;;
46038bd17e5fSmrg    esac
46048bd17e5fSmrg    ;;
46058bd17e5fSmrg  *)
46068bd17e5fSmrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
46078bd17e5fSmrg    ;;
46088bd17e5fSmrg  esac
46098bd17e5fSmrg], [
46108bd17e5fSmrg  runpath_var=
46118bd17e5fSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=
46128bd17e5fSmrg  _LT_TAGVAR(always_export_symbols, $1)=no
46138bd17e5fSmrg  _LT_TAGVAR(archive_cmds, $1)=
46148bd17e5fSmrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
46158bd17e5fSmrg  _LT_TAGVAR(compiler_needs_object, $1)=no
46168bd17e5fSmrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
46178bd17e5fSmrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
46188bd17e5fSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
46198bd17e5fSmrg  _LT_TAGVAR(hardcode_automatic, $1)=no
46208bd17e5fSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
46218bd17e5fSmrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
46228bd17e5fSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
46238bd17e5fSmrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
46248bd17e5fSmrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
46258bd17e5fSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
46268bd17e5fSmrg  _LT_TAGVAR(inherit_rpath, $1)=no
46278bd17e5fSmrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
46288bd17e5fSmrg  _LT_TAGVAR(module_cmds, $1)=
46298bd17e5fSmrg  _LT_TAGVAR(module_expsym_cmds, $1)=
46308bd17e5fSmrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
46318bd17e5fSmrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
46328bd17e5fSmrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
46338bd17e5fSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
46348bd17e5fSmrg  # include_expsyms should be a list of space-separated symbols to be *always*
46358bd17e5fSmrg  # included in the symbol list
46368bd17e5fSmrg  _LT_TAGVAR(include_expsyms, $1)=
46378bd17e5fSmrg  # exclude_expsyms can be an extended regexp of symbols to exclude
46388bd17e5fSmrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
46398bd17e5fSmrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
46408bd17e5fSmrg  # as well as any symbol that contains `d'.
46418bd17e5fSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
46428bd17e5fSmrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
46438bd17e5fSmrg  # platforms (ab)use it in PIC code, but their linkers get confused if
46448bd17e5fSmrg  # the symbol is explicitly referenced.  Since portable code cannot
46458bd17e5fSmrg  # rely on this symbol name, it's probably fine to never include it in
46468bd17e5fSmrg  # preloaded symbol tables.
46478bd17e5fSmrg  # Exclude shared library initialization/finalization symbols.
46488bd17e5fSmrgdnl Note also adjust exclude_expsyms for C++ above.
46498bd17e5fSmrg  extract_expsyms_cmds=
46508bd17e5fSmrg
46518bd17e5fSmrg  case $host_os in
46528bd17e5fSmrg  cygwin* | mingw* | pw32* | cegcc*)
46538bd17e5fSmrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
46548bd17e5fSmrg    # When not using gcc, we currently assume that we are using
46558bd17e5fSmrg    # Microsoft Visual C++.
46568bd17e5fSmrg    if test "$GCC" != yes; then
46578bd17e5fSmrg      with_gnu_ld=no
46588bd17e5fSmrg    fi
46598bd17e5fSmrg    ;;
46608bd17e5fSmrg  interix*)
46618bd17e5fSmrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
46628bd17e5fSmrg    with_gnu_ld=yes
46638bd17e5fSmrg    ;;
46648bd17e5fSmrg  openbsd*)
46658bd17e5fSmrg    with_gnu_ld=no
46668bd17e5fSmrg    ;;
46678bd17e5fSmrg  esac
46680597fb56Smrg
46698bd17e5fSmrg  _LT_TAGVAR(ld_shlibs, $1)=yes
46700597fb56Smrg
46718bd17e5fSmrg  # On some targets, GNU ld is compatible enough with the native linker
46728bd17e5fSmrg  # that we're better off using the native interface for both.
46738bd17e5fSmrg  lt_use_gnu_ld_interface=no
46748bd17e5fSmrg  if test "$with_gnu_ld" = yes; then
46758bd17e5fSmrg    case $host_os in
46768bd17e5fSmrg      aix*)
46778bd17e5fSmrg	# The AIX port of GNU ld has always aspired to compatibility
46788bd17e5fSmrg	# with the native linker.  However, as the warning in the GNU ld
46798bd17e5fSmrg	# block says, versions before 2.19.5* couldn't really create working
46808bd17e5fSmrg	# shared libraries, regardless of the interface used.
46818bd17e5fSmrg	case `$LD -v 2>&1` in
46828bd17e5fSmrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
46838bd17e5fSmrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
46848bd17e5fSmrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
46858bd17e5fSmrg	  *)
46868bd17e5fSmrg	    lt_use_gnu_ld_interface=yes
46878bd17e5fSmrg	    ;;
4688706b6b52Smrg	esac
46898c4a8e55Smrg	;;
46908bd17e5fSmrg      *)
46918bd17e5fSmrg	lt_use_gnu_ld_interface=yes
4692bd23fbfaSmrg	;;
46938bd17e5fSmrg    esac
46948bd17e5fSmrg  fi
46950597fb56Smrg
46968bd17e5fSmrg  if test "$lt_use_gnu_ld_interface" = yes; then
46978bd17e5fSmrg    # If archive_cmds runs LD, not CC, wlarc should be empty
46988bd17e5fSmrg    wlarc='${wl}'
46990597fb56Smrg
47008bd17e5fSmrg    # Set some defaults for GNU ld with shared library support. These
47018bd17e5fSmrg    # are reset later if shared libraries are not supported. Putting them
47028bd17e5fSmrg    # here allows them to be overridden if necessary.
47038bd17e5fSmrg    runpath_var=LD_RUN_PATH
47048bd17e5fSmrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
47058bd17e5fSmrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
47068bd17e5fSmrg    # ancient GNU ld didn't support --whole-archive et. al.
47078bd17e5fSmrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
47088bd17e5fSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
47098bd17e5fSmrg    else
47108bd17e5fSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
47118bd17e5fSmrg    fi
47128bd17e5fSmrg    supports_anon_versioning=no
47138bd17e5fSmrg    case `$LD -v 2>&1` in
47148bd17e5fSmrg      *GNU\ gold*) supports_anon_versioning=yes ;;
47158bd17e5fSmrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
47168bd17e5fSmrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
47178bd17e5fSmrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
47188bd17e5fSmrg      *\ 2.11.*) ;; # other 2.11 versions
47198bd17e5fSmrg      *) supports_anon_versioning=yes ;;
47208bd17e5fSmrg    esac
47210597fb56Smrg
47228bd17e5fSmrg    # See if GNU ld supports shared libraries.
47238bd17e5fSmrg    case $host_os in
47248bd17e5fSmrg    aix[[3-9]]*)
47258bd17e5fSmrg      # On AIX/PPC, the GNU linker is very broken
47268bd17e5fSmrg      if test "$host_cpu" != ia64; then
47278bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
47288bd17e5fSmrg	cat <<_LT_EOF 1>&2
47298bd17e5fSmrg
47308bd17e5fSmrg*** Warning: the GNU linker, at least up to release 2.19, is reported
47318bd17e5fSmrg*** to be unable to reliably create shared libraries on AIX.
47328bd17e5fSmrg*** Therefore, libtool is disabling shared libraries support.  If you
47338bd17e5fSmrg*** really care for shared libraries, you may want to install binutils
47348bd17e5fSmrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
47358bd17e5fSmrg*** You will then need to restart the configuration process.
47368bd17e5fSmrg
47378bd17e5fSmrg_LT_EOF
47388bd17e5fSmrg      fi
47398bd17e5fSmrg      ;;
47400597fb56Smrg
47418bd17e5fSmrg    amigaos*)
47428bd17e5fSmrg      case $host_cpu in
47438bd17e5fSmrg      powerpc)
47448bd17e5fSmrg            # see comment about AmigaOS4 .so support
47458bd17e5fSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
47468bd17e5fSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
47470597fb56Smrg        ;;
47488bd17e5fSmrg      m68k)
47498bd17e5fSmrg            _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)'
47508bd17e5fSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
47518bd17e5fSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
47520597fb56Smrg        ;;
47538bd17e5fSmrg      esac
47548bd17e5fSmrg      ;;
47550597fb56Smrg
47568bd17e5fSmrg    beos*)
47578bd17e5fSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
47588bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
47598bd17e5fSmrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
47608bd17e5fSmrg	# support --undefined.  This deserves some investigation.  FIXME
47618bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
47628bd17e5fSmrg      else
47638bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
47648bd17e5fSmrg      fi
47658bd17e5fSmrg      ;;
47660597fb56Smrg
47678bd17e5fSmrg    cygwin* | mingw* | pw32* | cegcc*)
47688bd17e5fSmrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
47698bd17e5fSmrg      # as there is no search path for DLLs.
47708bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
47718bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
47728bd17e5fSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
47738bd17e5fSmrg      _LT_TAGVAR(always_export_symbols, $1)=no
47748bd17e5fSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
47758bd17e5fSmrg      _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'
47768bd17e5fSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
47770597fb56Smrg
47788bd17e5fSmrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
47798bd17e5fSmrg        _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'
47808bd17e5fSmrg	# If the export-symbols file already is a .def file (1st line
47818bd17e5fSmrg	# is EXPORTS), use it as is; otherwise, prepend...
47828bd17e5fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
47838bd17e5fSmrg	  cp $export_symbols $output_objdir/$soname.def;
47848bd17e5fSmrg	else
47858bd17e5fSmrg	  echo EXPORTS > $output_objdir/$soname.def;
47868bd17e5fSmrg	  cat $export_symbols >> $output_objdir/$soname.def;
47878bd17e5fSmrg	fi~
47888bd17e5fSmrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
47898bd17e5fSmrg      else
47908bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
47918bd17e5fSmrg      fi
47928bd17e5fSmrg      ;;
47930597fb56Smrg
47948bd17e5fSmrg    haiku*)
47958bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
47968bd17e5fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
47978bd17e5fSmrg      ;;
47980597fb56Smrg
47998bd17e5fSmrg    interix[[3-9]]*)
48008bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=no
48018bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
48028bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
48038bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
48048bd17e5fSmrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
48058bd17e5fSmrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
48068bd17e5fSmrg      # default) and relocated if they conflict, which is a slow very memory
48078bd17e5fSmrg      # consuming and fragmenting process.  To avoid this, we pick a random,
48088bd17e5fSmrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
48098bd17e5fSmrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
48108bd17e5fSmrg      _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'
48118bd17e5fSmrg      _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'
48128bd17e5fSmrg      ;;
48130597fb56Smrg
48148bd17e5fSmrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
48158bd17e5fSmrg      tmp_diet=no
48168bd17e5fSmrg      if test "$host_os" = linux-dietlibc; then
48178bd17e5fSmrg	case $cc_basename in
48188bd17e5fSmrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
48198bd17e5fSmrg	esac
48208bd17e5fSmrg      fi
48218bd17e5fSmrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
48228bd17e5fSmrg	 && test "$tmp_diet" = no
48238bd17e5fSmrg      then
48248bd17e5fSmrg	tmp_addflag=' $pic_flag'
48258bd17e5fSmrg	tmp_sharedflag='-shared'
48268bd17e5fSmrg	case $cc_basename,$host_cpu in
48278bd17e5fSmrg        pgcc*)				# Portland Group C compiler
48288bd17e5fSmrg	  _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'
48298bd17e5fSmrg	  tmp_addflag=' $pic_flag'
48308bd17e5fSmrg	  ;;
48318bd17e5fSmrg	pgf77* | pgf90* | pgf95* | pgfortran*)
48328bd17e5fSmrg					# Portland Group f77 and f90 compilers
48338bd17e5fSmrg	  _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'
48348bd17e5fSmrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
48358bd17e5fSmrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
48368bd17e5fSmrg	  tmp_addflag=' -i_dynamic' ;;
48378bd17e5fSmrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
48388bd17e5fSmrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
48398bd17e5fSmrg	ifc* | ifort*)			# Intel Fortran compiler
48408bd17e5fSmrg	  tmp_addflag=' -nofor_main' ;;
48418bd17e5fSmrg	lf95*)				# Lahey Fortran 8.1
48428bd17e5fSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
48438bd17e5fSmrg	  tmp_sharedflag='--shared' ;;
48448bd17e5fSmrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
48458bd17e5fSmrg	  tmp_sharedflag='-qmkshrobj'
48468bd17e5fSmrg	  tmp_addflag= ;;
48478bd17e5fSmrg	nvcc*)	# Cuda Compiler Driver 2.2
48488bd17e5fSmrg	  _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'
48498bd17e5fSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
48508bd17e5fSmrg	  ;;
48518bd17e5fSmrg	esac
48528bd17e5fSmrg	case `$CC -V 2>&1 | sed 5q` in
48538bd17e5fSmrg	*Sun\ C*)			# Sun C 5.9
48548bd17e5fSmrg	  _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'
48558bd17e5fSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
48568bd17e5fSmrg	  tmp_sharedflag='-G' ;;
48578bd17e5fSmrg	*Sun\ F*)			# Sun Fortran 8.3
48588bd17e5fSmrg	  tmp_sharedflag='-G' ;;
48598bd17e5fSmrg	esac
48608bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
48610597fb56Smrg
48628bd17e5fSmrg        if test "x$supports_anon_versioning" = xyes; then
48638bd17e5fSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
48648bd17e5fSmrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
48658bd17e5fSmrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
48668bd17e5fSmrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
48678bd17e5fSmrg        fi
48680597fb56Smrg
48698bd17e5fSmrg	case $cc_basename in
48708bd17e5fSmrg	xlf* | bgf* | bgxlf* | mpixlf*)
48718bd17e5fSmrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
48728bd17e5fSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
48738bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
48748bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
48758bd17e5fSmrg	  if test "x$supports_anon_versioning" = xyes; then
48768bd17e5fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
48778bd17e5fSmrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
48788bd17e5fSmrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
48798bd17e5fSmrg	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
48808bd17e5fSmrg	  fi
48818bd17e5fSmrg	  ;;
48828bd17e5fSmrg	esac
48838bd17e5fSmrg      else
48848bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
48858bd17e5fSmrg      fi
48868bd17e5fSmrg      ;;
48870597fb56Smrg
48888bd17e5fSmrg    netbsd*)
48898bd17e5fSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
48908bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
48918bd17e5fSmrg	wlarc=
48928bd17e5fSmrg      else
48938bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
48948bd17e5fSmrg	_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'
48958bd17e5fSmrg      fi
48968bd17e5fSmrg      ;;
48970597fb56Smrg
48988bd17e5fSmrg    solaris*)
48998bd17e5fSmrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
49008bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
49018bd17e5fSmrg	cat <<_LT_EOF 1>&2
49020597fb56Smrg
49038bd17e5fSmrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
49048bd17e5fSmrg*** create shared libraries on Solaris systems.  Therefore, libtool
49058bd17e5fSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
49068bd17e5fSmrg*** binutils to release 2.9.1 or newer.  Another option is to modify
49078bd17e5fSmrg*** your PATH or compiler configuration so that the native linker is
49088bd17e5fSmrg*** used, and then restart.
49090597fb56Smrg
49108bd17e5fSmrg_LT_EOF
49118bd17e5fSmrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
49128bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
49138bd17e5fSmrg	_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'
49148bd17e5fSmrg      else
49158bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
49168bd17e5fSmrg      fi
49178bd17e5fSmrg      ;;
49180597fb56Smrg
49198bd17e5fSmrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
49208bd17e5fSmrg      case `$LD -v 2>&1` in
49218bd17e5fSmrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
49228bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
49238bd17e5fSmrg	cat <<_LT_EOF 1>&2
49240597fb56Smrg
49258bd17e5fSmrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
49268bd17e5fSmrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
49278bd17e5fSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
49288bd17e5fSmrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
49298bd17e5fSmrg*** your PATH or compiler configuration so that the native linker is
49308bd17e5fSmrg*** used, and then restart.
49310597fb56Smrg
49328bd17e5fSmrg_LT_EOF
49338bd17e5fSmrg	;;
49348bd17e5fSmrg	*)
49358bd17e5fSmrg	  # For security reasons, it is highly recommended that you always
49368bd17e5fSmrg	  # use absolute paths for naming shared libraries, and exclude the
49378bd17e5fSmrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
49388bd17e5fSmrg	  # requires that you compile everything twice, which is a pain.
49398bd17e5fSmrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
49400597fb56Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
49418bd17e5fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
49428bd17e5fSmrg	    _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'
49438bd17e5fSmrg	  else
49448bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
49458bd17e5fSmrg	  fi
49468bd17e5fSmrg	;;
49478bd17e5fSmrg      esac
49488bd17e5fSmrg      ;;
49490597fb56Smrg
49508bd17e5fSmrg    sunos4*)
49518bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
49528bd17e5fSmrg      wlarc=
49538bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
49548bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
49558bd17e5fSmrg      ;;
49568bd17e5fSmrg
49578bd17e5fSmrg    *)
49588bd17e5fSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
49598bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
49608bd17e5fSmrg	_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'
49618bd17e5fSmrg      else
49628bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
49638bd17e5fSmrg      fi
49648bd17e5fSmrg      ;;
49658bd17e5fSmrg    esac
49668bd17e5fSmrg
49678bd17e5fSmrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
49688bd17e5fSmrg      runpath_var=
49698bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
49708bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
49718bd17e5fSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
49728bd17e5fSmrg    fi
49738bd17e5fSmrg  else
49748bd17e5fSmrg    # PORTME fill in a description of your system's linker (not GNU ld)
49758bd17e5fSmrg    case $host_os in
49768bd17e5fSmrg    aix3*)
49778bd17e5fSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
49788bd17e5fSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
49798bd17e5fSmrg      _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'
49808bd17e5fSmrg      # Note: this linker hardcodes the directories in LIBPATH if there
49818bd17e5fSmrg      # are no directories specified by -L.
49828bd17e5fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
49838bd17e5fSmrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
49848bd17e5fSmrg	# Neither direct hardcoding nor static linking is supported with a
49858bd17e5fSmrg	# broken collect2.
49868bd17e5fSmrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
49878bd17e5fSmrg      fi
49888bd17e5fSmrg      ;;
49898bd17e5fSmrg
49908bd17e5fSmrg    aix[[4-9]]*)
49918bd17e5fSmrg      if test "$host_cpu" = ia64; then
49928bd17e5fSmrg	# On IA64, the linker does run time linking by default, so we don't
49938bd17e5fSmrg	# have to do anything special.
49948bd17e5fSmrg	aix_use_runtimelinking=no
49958bd17e5fSmrg	exp_sym_flag='-Bexport'
49968bd17e5fSmrg	no_entry_flag=""
49978bd17e5fSmrg      else
49988bd17e5fSmrg	# If we're using GNU nm, then we don't want the "-C" option.
49998bd17e5fSmrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
50008bd17e5fSmrg	# Also, AIX nm treats weak defined symbols like other global
50018bd17e5fSmrg	# defined symbols, whereas GNU nm marks them as "W".
50028bd17e5fSmrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
50038bd17e5fSmrg	  _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'
50048bd17e5fSmrg	else
50058bd17e5fSmrg	  _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'
50068bd17e5fSmrg	fi
50078bd17e5fSmrg	aix_use_runtimelinking=no
50080597fb56Smrg
50098bd17e5fSmrg	# Test if we are trying to use run time linking or normal
50108bd17e5fSmrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
50118bd17e5fSmrg	# need to do runtime linking.
50128bd17e5fSmrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
50138bd17e5fSmrg	  for ld_flag in $LDFLAGS; do
50148bd17e5fSmrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
50158bd17e5fSmrg	    aix_use_runtimelinking=yes
50168bd17e5fSmrg	    break
50178bd17e5fSmrg	  fi
50188bd17e5fSmrg	  done
50198bd17e5fSmrg	  ;;
50208c4a8e55Smrg	esac
50210597fb56Smrg
50228bd17e5fSmrg	exp_sym_flag='-bexport'
50238bd17e5fSmrg	no_entry_flag='-bnoentry'
50248bd17e5fSmrg      fi
50250597fb56Smrg
50268bd17e5fSmrg      # When large executables or shared objects are built, AIX ld can
50278bd17e5fSmrg      # have problems creating the table of contents.  If linking a library
50288bd17e5fSmrg      # or program results in "error TOC overflow" add -mminimal-toc to
50298bd17e5fSmrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
50308bd17e5fSmrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
50310597fb56Smrg
50328bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)=''
50338bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
50348bd17e5fSmrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
50358bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
50368bd17e5fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
50378bd17e5fSmrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
50388bd17e5fSmrg
50398bd17e5fSmrg      if test "$GCC" = yes; then
50408bd17e5fSmrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
50418bd17e5fSmrg	# We only want to do this on AIX 4.2 and lower, the check
50428bd17e5fSmrg	# below for broken collect2 doesn't work under 4.3+
50438bd17e5fSmrg	  collect2name=`${CC} -print-prog-name=collect2`
50448bd17e5fSmrg	  if test -f "$collect2name" &&
50458bd17e5fSmrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
50468bd17e5fSmrg	  then
50478bd17e5fSmrg	  # We have reworked collect2
50488bd17e5fSmrg	  :
50498bd17e5fSmrg	  else
50508bd17e5fSmrg	  # We have old collect2
50518bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
50528bd17e5fSmrg	  # It fails to find uninstalled libraries when the uninstalled
50538bd17e5fSmrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
50548bd17e5fSmrg	  # to unsupported forces relinking
50558bd17e5fSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
50568bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
50578bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
50588bd17e5fSmrg	  fi
50598bd17e5fSmrg	  ;;
50608c4a8e55Smrg	esac
50618bd17e5fSmrg	shared_flag='-shared'
50628bd17e5fSmrg	if test "$aix_use_runtimelinking" = yes; then
50638bd17e5fSmrg	  shared_flag="$shared_flag "'${wl}-G'
50648bd17e5fSmrg	fi
50658bd17e5fSmrg      else
50668bd17e5fSmrg	# not using gcc
50678bd17e5fSmrg	if test "$host_cpu" = ia64; then
50688bd17e5fSmrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
50698bd17e5fSmrg	# chokes on -Wl,-G. The following line is correct:
50708bd17e5fSmrg	  shared_flag='-G'
50718bd17e5fSmrg	else
50728bd17e5fSmrg	  if test "$aix_use_runtimelinking" = yes; then
50738bd17e5fSmrg	    shared_flag='${wl}-G'
50748bd17e5fSmrg	  else
50758bd17e5fSmrg	    shared_flag='${wl}-bM:SRE'
50768bd17e5fSmrg	  fi
50778bd17e5fSmrg	fi
50788bd17e5fSmrg      fi
50790597fb56Smrg
50808bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
50818bd17e5fSmrg      # It seems that -bexpall does not export symbols beginning with
50828bd17e5fSmrg      # underscore (_), so it is better to generate a list of symbols to export.
50838bd17e5fSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
50848bd17e5fSmrg      if test "$aix_use_runtimelinking" = yes; then
50858bd17e5fSmrg	# Warning - without using the other runtime loading flags (-brtl),
50868bd17e5fSmrg	# -berok will link without error, but may produce a broken library.
50878bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
50888bd17e5fSmrg        # Determine the default libpath from the value encoded in an
50898bd17e5fSmrg        # empty executable.
50908bd17e5fSmrg        _LT_SYS_MODULE_PATH_AIX([$1])
50918bd17e5fSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
50928bd17e5fSmrg        _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"
50938bd17e5fSmrg      else
50948bd17e5fSmrg	if test "$host_cpu" = ia64; then
50958bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
50968bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
50978bd17e5fSmrg	  _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"
50988bd17e5fSmrg	else
50998bd17e5fSmrg	 # Determine the default libpath from the value encoded in an
51008bd17e5fSmrg	 # empty executable.
51018bd17e5fSmrg	 _LT_SYS_MODULE_PATH_AIX([$1])
51028bd17e5fSmrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
51038bd17e5fSmrg	  # Warning - without using the other run time loading flags,
51048bd17e5fSmrg	  # -berok will link without error, but may produce a broken library.
51058bd17e5fSmrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
51068bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
51078bd17e5fSmrg	  if test "$with_gnu_ld" = yes; then
51088bd17e5fSmrg	    # We only use this code for GNU lds that support --whole-archive.
51098bd17e5fSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
51108bd17e5fSmrg	  else
51118bd17e5fSmrg	    # Exported symbols can be pulled into shared objects from archives
51128bd17e5fSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
51138bd17e5fSmrg	  fi
51148bd17e5fSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
51158bd17e5fSmrg	  # This is similar to how AIX traditionally builds its shared libraries.
51168bd17e5fSmrg	  _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'
51170597fb56Smrg	fi
51188bd17e5fSmrg      fi
51198bd17e5fSmrg      ;;
51200597fb56Smrg
51218bd17e5fSmrg    amigaos*)
51228bd17e5fSmrg      case $host_cpu in
51238bd17e5fSmrg      powerpc)
51248bd17e5fSmrg            # see comment about AmigaOS4 .so support
51258bd17e5fSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
51268bd17e5fSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
51278bd17e5fSmrg        ;;
51288bd17e5fSmrg      m68k)
51298bd17e5fSmrg            _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)'
51308bd17e5fSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
51318bd17e5fSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
51328bd17e5fSmrg        ;;
51338bd17e5fSmrg      esac
51348bd17e5fSmrg      ;;
51350597fb56Smrg
51368bd17e5fSmrg    bsdi[[45]]*)
51378bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
51388bd17e5fSmrg      ;;
51390597fb56Smrg
51408bd17e5fSmrg    cygwin* | mingw* | pw32* | cegcc*)
51418bd17e5fSmrg      # When not using gcc, we currently assume that we are using
51428bd17e5fSmrg      # Microsoft Visual C++.
51438bd17e5fSmrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
51448bd17e5fSmrg      # no search path for DLLs.
51458bd17e5fSmrg      case $cc_basename in
51468bd17e5fSmrg      cl*)
51478bd17e5fSmrg	# Native MSVC
51488bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
51498bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
51508bd17e5fSmrg	_LT_TAGVAR(always_export_symbols, $1)=yes
51518bd17e5fSmrg	_LT_TAGVAR(file_list_spec, $1)='@'
51528bd17e5fSmrg	# Tell ltmain to make .lib files, not .a files.
51538bd17e5fSmrg	libext=lib
51548bd17e5fSmrg	# Tell ltmain to make .dll files, not .so files.
51558bd17e5fSmrg	shrext_cmds=".dll"
51568bd17e5fSmrg	# FIXME: Setting linknames here is a bad hack.
51578bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
51588bd17e5fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
51598bd17e5fSmrg	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
51608bd17e5fSmrg	  else
51618bd17e5fSmrg	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
51628bd17e5fSmrg	  fi~
51638bd17e5fSmrg	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
51648bd17e5fSmrg	  linknames='
51658bd17e5fSmrg	# The linker will not automatically build a static lib if we build a DLL.
51668bd17e5fSmrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
51678bd17e5fSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
51688bd17e5fSmrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
51698bd17e5fSmrg	_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'
51708bd17e5fSmrg	# Don't use ranlib
51718bd17e5fSmrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
51728bd17e5fSmrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
51738bd17e5fSmrg	  lt_tool_outputfile="@TOOL_OUTPUT@"~
51748bd17e5fSmrg	  case $lt_outputfile in
51758bd17e5fSmrg	    *.exe|*.EXE) ;;
51768bd17e5fSmrg	    *)
51778bd17e5fSmrg	      lt_outputfile="$lt_outputfile.exe"
51788bd17e5fSmrg	      lt_tool_outputfile="$lt_tool_outputfile.exe"
51798bd17e5fSmrg	      ;;
51808bd17e5fSmrg	  esac~
51818bd17e5fSmrg	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
51828bd17e5fSmrg	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
51838bd17e5fSmrg	    $RM "$lt_outputfile.manifest";
51848bd17e5fSmrg	  fi'
51858bd17e5fSmrg	;;
51868bd17e5fSmrg      *)
51878bd17e5fSmrg	# Assume MSVC wrapper
51888bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
51898bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
51908bd17e5fSmrg	# Tell ltmain to make .lib files, not .a files.
51918bd17e5fSmrg	libext=lib
51928bd17e5fSmrg	# Tell ltmain to make .dll files, not .so files.
51938bd17e5fSmrg	shrext_cmds=".dll"
51948bd17e5fSmrg	# FIXME: Setting linknames here is a bad hack.
51958bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
51968bd17e5fSmrg	# The linker will automatically build a .lib file if we build a DLL.
51978bd17e5fSmrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
51988bd17e5fSmrg	# FIXME: Should let the user specify the lib program.
51998bd17e5fSmrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
52008bd17e5fSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5201706b6b52Smrg	;;
52028bd17e5fSmrg      esac
52038bd17e5fSmrg      ;;
5204706b6b52Smrg
52058bd17e5fSmrg    darwin* | rhapsody*)
52068bd17e5fSmrg      _LT_DARWIN_LINKER_FEATURES($1)
52078bd17e5fSmrg      ;;
5208706b6b52Smrg
52098bd17e5fSmrg    dgux*)
52108bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
52118bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
52128bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
52138bd17e5fSmrg      ;;
5214706b6b52Smrg
52158bd17e5fSmrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
52168bd17e5fSmrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
52178bd17e5fSmrg    # does not break anything, and helps significantly (at the cost of a little
52188bd17e5fSmrg    # extra space).
52198bd17e5fSmrg    freebsd2.2*)
52208bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
52218bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
52228bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
52238bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
52248bd17e5fSmrg      ;;
52250597fb56Smrg
52268bd17e5fSmrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
52278bd17e5fSmrg    freebsd2.*)
52288bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
52298bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
52308bd17e5fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
52318bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
52328bd17e5fSmrg      ;;
5233706b6b52Smrg
52348bd17e5fSmrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
52358bd17e5fSmrg    freebsd* | dragonfly*)
52368bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
52378bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
52388bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
52398bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
52408bd17e5fSmrg      ;;
5241706b6b52Smrg
52428bd17e5fSmrg    hpux9*)
52438bd17e5fSmrg      if test "$GCC" = yes; then
52448bd17e5fSmrg	_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'
52458bd17e5fSmrg      else
52468bd17e5fSmrg	_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'
52478bd17e5fSmrg      fi
52488bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
52498bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
52508bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5251706b6b52Smrg
52528bd17e5fSmrg      # hardcode_minus_L: Not really in the search PATH,
52538bd17e5fSmrg      # but as the default location of the library.
52548bd17e5fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
52558bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
52568bd17e5fSmrg      ;;
5257706b6b52Smrg
52588bd17e5fSmrg    hpux10*)
52598bd17e5fSmrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
52608bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
52618bd17e5fSmrg      else
52628bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
52638bd17e5fSmrg      fi
52648bd17e5fSmrg      if test "$with_gnu_ld" = no; then
52658bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
52668bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
52678bd17e5fSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
52688bd17e5fSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
52698bd17e5fSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
52708bd17e5fSmrg	# hardcode_minus_L: Not really in the search PATH,
52718bd17e5fSmrg	# but as the default location of the library.
52728bd17e5fSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
52738bd17e5fSmrg      fi
52748bd17e5fSmrg      ;;
5275b042e37fSmrg
52768bd17e5fSmrg    hpux11*)
52778bd17e5fSmrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
52788bd17e5fSmrg	case $host_cpu in
52798bd17e5fSmrg	hppa*64*)
52808bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
52818bd17e5fSmrg	  ;;
52828bd17e5fSmrg	ia64*)
52838bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
52848bd17e5fSmrg	  ;;
52858bd17e5fSmrg	*)
52868bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
52878bd17e5fSmrg	  ;;
52888bd17e5fSmrg	esac
52898bd17e5fSmrg      else
52908bd17e5fSmrg	case $host_cpu in
52918bd17e5fSmrg	hppa*64*)
52928bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
52938bd17e5fSmrg	  ;;
52948bd17e5fSmrg	ia64*)
52958bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
52968bd17e5fSmrg	  ;;
52978bd17e5fSmrg	*)
52988bd17e5fSmrg	m4_if($1, [], [
52998bd17e5fSmrg	  # Older versions of the 11.00 compiler do not understand -b yet
53008bd17e5fSmrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
53018bd17e5fSmrg	  _LT_LINKER_OPTION([if $CC understands -b],
53028bd17e5fSmrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
53038bd17e5fSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
53048bd17e5fSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
53058bd17e5fSmrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
53068bd17e5fSmrg	  ;;
53078bd17e5fSmrg	esac
53088bd17e5fSmrg      fi
53098bd17e5fSmrg      if test "$with_gnu_ld" = no; then
53108bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
53118bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
53128c4a8e55Smrg
53138bd17e5fSmrg	case $host_cpu in
53148bd17e5fSmrg	hppa*64*|ia64*)
53158bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
53168bd17e5fSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
53178bd17e5fSmrg	  ;;
53188bd17e5fSmrg	*)
53198bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
53208bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
53218bd17e5fSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5322b042e37fSmrg
53238bd17e5fSmrg	  # hardcode_minus_L: Not really in the search PATH,
53248bd17e5fSmrg	  # but as the default location of the library.
53258bd17e5fSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
53268bd17e5fSmrg	  ;;
53278bd17e5fSmrg	esac
53288bd17e5fSmrg      fi
53298bd17e5fSmrg      ;;
5330b042e37fSmrg
53318bd17e5fSmrg    irix5* | irix6* | nonstopux*)
53328bd17e5fSmrg      if test "$GCC" = yes; then
53338bd17e5fSmrg	_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'
53348bd17e5fSmrg	# Try to use the -exported_symbol ld option, if it does not
53358bd17e5fSmrg	# work, assume that -exports_file does not work either and
53368bd17e5fSmrg	# implicitly export all symbols.
53378bd17e5fSmrg	# This should be the same for all languages, so no per-tag cache variable.
53388bd17e5fSmrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
53398bd17e5fSmrg	  [lt_cv_irix_exported_symbol],
53408bd17e5fSmrg	  [save_LDFLAGS="$LDFLAGS"
53418bd17e5fSmrg	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
53428bd17e5fSmrg	   AC_LINK_IFELSE(
53438bd17e5fSmrg	     [AC_LANG_SOURCE(
53448bd17e5fSmrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
53458bd17e5fSmrg			      [C++], [[int foo (void) { return 0; }]],
53468bd17e5fSmrg			      [Fortran 77], [[
53478bd17e5fSmrg      subroutine foo
53488bd17e5fSmrg      end]],
53498bd17e5fSmrg			      [Fortran], [[
53508bd17e5fSmrg      subroutine foo
53518bd17e5fSmrg      end]])])],
53528bd17e5fSmrg	      [lt_cv_irix_exported_symbol=yes],
53538bd17e5fSmrg	      [lt_cv_irix_exported_symbol=no])
53548bd17e5fSmrg           LDFLAGS="$save_LDFLAGS"])
53558bd17e5fSmrg	if test "$lt_cv_irix_exported_symbol" = yes; then
53568bd17e5fSmrg          _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'
53578bd17e5fSmrg	fi
53588bd17e5fSmrg      else
53598bd17e5fSmrg	_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'
53608bd17e5fSmrg	_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'
53618bd17e5fSmrg      fi
53628bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
53638bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
53648bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
53658bd17e5fSmrg      _LT_TAGVAR(inherit_rpath, $1)=yes
53668bd17e5fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
53678bd17e5fSmrg      ;;
5368b042e37fSmrg
53698bd17e5fSmrg    netbsd*)
53708bd17e5fSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
53718bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
53728bd17e5fSmrg      else
53738bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
53748bd17e5fSmrg      fi
53758bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
53768bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
53778bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
53788bd17e5fSmrg      ;;
53798c4a8e55Smrg
53808bd17e5fSmrg    newsos6)
53818bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
53828bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
53838bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
53848bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
53858bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
53868bd17e5fSmrg      ;;
53878c4a8e55Smrg
53888bd17e5fSmrg    *nto* | *qnx*)
53898bd17e5fSmrg      ;;
53908c4a8e55Smrg
53918bd17e5fSmrg    openbsd*)
53928bd17e5fSmrg      if test -f /usr/libexec/ld.so; then
53938bd17e5fSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
53948bd17e5fSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
53958bd17e5fSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
53968bd17e5fSmrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
53978bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
53988bd17e5fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
53998bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
54008bd17e5fSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
54018bd17e5fSmrg	else
54028bd17e5fSmrg	  case $host_os in
54038bd17e5fSmrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
54048bd17e5fSmrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
54058bd17e5fSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
54068bd17e5fSmrg	     ;;
54078bd17e5fSmrg	   *)
54088bd17e5fSmrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
54098bd17e5fSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
54108bd17e5fSmrg	     ;;
54118bd17e5fSmrg	  esac
54128bd17e5fSmrg	fi
54138bd17e5fSmrg      else
54148bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
54158bd17e5fSmrg      fi
54168bd17e5fSmrg      ;;
5417b042e37fSmrg
54188bd17e5fSmrg    os2*)
54198bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
54208bd17e5fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
54218bd17e5fSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
54228bd17e5fSmrg      _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'
54238bd17e5fSmrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
54248bd17e5fSmrg      ;;
5425b042e37fSmrg
54268bd17e5fSmrg    osf3*)
54278bd17e5fSmrg      if test "$GCC" = yes; then
54288bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
54298bd17e5fSmrg	_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'
54308bd17e5fSmrg      else
54318bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
54328bd17e5fSmrg	_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'
54338bd17e5fSmrg      fi
54348bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
54358bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
54368bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
54378bd17e5fSmrg      ;;
54380597fb56Smrg
54398bd17e5fSmrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
54408bd17e5fSmrg      if test "$GCC" = yes; then
54418bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
54428bd17e5fSmrg	_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'
54438bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
54448bd17e5fSmrg      else
54458bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
54468bd17e5fSmrg	_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'
54478bd17e5fSmrg	_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~
54488bd17e5fSmrg	$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'
54490597fb56Smrg
54508bd17e5fSmrg	# Both c and cxx compiler support -rpath directly
54518bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
54528bd17e5fSmrg      fi
54538bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
54548bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
54558bd17e5fSmrg      ;;
54560597fb56Smrg
54578bd17e5fSmrg    solaris*)
54588bd17e5fSmrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
54598bd17e5fSmrg      if test "$GCC" = yes; then
54608bd17e5fSmrg	wlarc='${wl}'
54618bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
54628bd17e5fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
54638bd17e5fSmrg	  $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'
54648bd17e5fSmrg      else
54658bd17e5fSmrg	case `$CC -V 2>&1` in
54668bd17e5fSmrg	*"Compilers 5.0"*)
54678bd17e5fSmrg	  wlarc=''
54688bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
54698bd17e5fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
54708bd17e5fSmrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
54718c4a8e55Smrg	  ;;
54720597fb56Smrg	*)
54738bd17e5fSmrg	  wlarc='${wl}'
54748bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
54758bd17e5fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
54768bd17e5fSmrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
54778c4a8e55Smrg	  ;;
54788bd17e5fSmrg	esac
54798bd17e5fSmrg      fi
54808bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
54818bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
54828bd17e5fSmrg      case $host_os in
54838bd17e5fSmrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
54848bd17e5fSmrg      *)
54858bd17e5fSmrg	# The compiler driver will combine and reorder linker options,
54868bd17e5fSmrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
54878bd17e5fSmrg	# but is careful enough not to reorder.
54888bd17e5fSmrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
54898bd17e5fSmrg	if test "$GCC" = yes; then
54908bd17e5fSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
54918bd17e5fSmrg	else
54928bd17e5fSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
54938bd17e5fSmrg	fi
54948bd17e5fSmrg	;;
54958c4a8e55Smrg      esac
54968bd17e5fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
54978c4a8e55Smrg      ;;
5498b042e37fSmrg
54998bd17e5fSmrg    sunos4*)
55008bd17e5fSmrg      if test "x$host_vendor" = xsequent; then
55018bd17e5fSmrg	# Use $CC to link under sequent, because it throws in some extra .o
55028bd17e5fSmrg	# files that make .init and .fini sections work.
55038bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
55048bd17e5fSmrg      else
55058bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
55068bd17e5fSmrg      fi
55078bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
55088bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
55098bd17e5fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
55108bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55118bd17e5fSmrg      ;;
5512b042e37fSmrg
55138bd17e5fSmrg    sysv4)
55148bd17e5fSmrg      case $host_vendor in
55158bd17e5fSmrg	sni)
55168bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
55178bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
55188bd17e5fSmrg	;;
55198bd17e5fSmrg	siemens)
55208bd17e5fSmrg	  ## LD is ld it makes a PLAMLIB
55218bd17e5fSmrg	  ## CC just makes a GrossModule.
55228bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
55238bd17e5fSmrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
55248bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
55258bd17e5fSmrg        ;;
55268bd17e5fSmrg	motorola)
55278bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
55288bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
55298bd17e5fSmrg	;;
55308bd17e5fSmrg      esac
55318bd17e5fSmrg      runpath_var='LD_RUN_PATH'
55328bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5533706b6b52Smrg      ;;
5534b042e37fSmrg
55358bd17e5fSmrg    sysv4.3*)
55368bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
55378bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55388bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
55398bd17e5fSmrg      ;;
55408c4a8e55Smrg
55418bd17e5fSmrg    sysv4*MP*)
55428bd17e5fSmrg      if test -d /usr/nec; then
55438bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
55448bd17e5fSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55458bd17e5fSmrg	runpath_var=LD_RUN_PATH
55468bd17e5fSmrg	hardcode_runpath_var=yes
55478bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
55488bd17e5fSmrg      fi
55498bd17e5fSmrg      ;;
55508c4a8e55Smrg
55518bd17e5fSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
55528bd17e5fSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
55538bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
55548bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55558bd17e5fSmrg      runpath_var='LD_RUN_PATH'
55560597fb56Smrg
55578bd17e5fSmrg      if test "$GCC" = yes; then
55588bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55598bd17e5fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55608bd17e5fSmrg      else
55618bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55628bd17e5fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55638bd17e5fSmrg      fi
55648bd17e5fSmrg      ;;
55650597fb56Smrg
55668bd17e5fSmrg    sysv5* | sco3.2v5* | sco5v6*)
55678bd17e5fSmrg      # Note: We can NOT use -z defs as we might desire, because we do not
55688bd17e5fSmrg      # link with -lc, and that would cause any symbols used from libc to
55698bd17e5fSmrg      # always be unresolved, which means just about no library would
55708bd17e5fSmrg      # ever link correctly.  If we're not using GNU ld we use -z text
55718bd17e5fSmrg      # though, which does catch some bad symbols but isn't as heavy-handed
55728bd17e5fSmrg      # as -z defs.
55738bd17e5fSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
55748bd17e5fSmrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
55758bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
55768bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55778bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
55788bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
55798bd17e5fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
55808bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
55818bd17e5fSmrg      runpath_var='LD_RUN_PATH'
55820597fb56Smrg
55838bd17e5fSmrg      if test "$GCC" = yes; then
55848bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55858bd17e5fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55868bd17e5fSmrg      else
55878bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55888bd17e5fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55898bd17e5fSmrg      fi
55908bd17e5fSmrg      ;;
55910597fb56Smrg
55928bd17e5fSmrg    uts4*)
55938bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
55948bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
55958bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55968bd17e5fSmrg      ;;
55970597fb56Smrg
55988bd17e5fSmrg    *)
55998bd17e5fSmrg      _LT_TAGVAR(ld_shlibs, $1)=no
56008bd17e5fSmrg      ;;
56018bd17e5fSmrg    esac
56020597fb56Smrg
56038bd17e5fSmrg    if test x$host_vendor = xsni; then
56048bd17e5fSmrg      case $host in
56058bd17e5fSmrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
56068bd17e5fSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
56078bd17e5fSmrg	;;
56088bd17e5fSmrg      esac
56098bd17e5fSmrg    fi
56108bd17e5fSmrg  fi
56118bd17e5fSmrg])
56128bd17e5fSmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
56138bd17e5fSmrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
56140597fb56Smrg
56158bd17e5fSmrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
56160597fb56Smrg
56178bd17e5fSmrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
56188bd17e5fSmrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
56198bd17e5fSmrg_LT_DECL([], [extract_expsyms_cmds], [2],
56208bd17e5fSmrg    [The commands to extract the exported symbol list from a shared archive])
56210597fb56Smrg
56228bd17e5fSmrg#
56238bd17e5fSmrg# Do we need to explicitly link libc?
56248bd17e5fSmrg#
56258bd17e5fSmrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
56268bd17e5fSmrgx|xyes)
56278bd17e5fSmrg  # Assume -lc should be added
56288bd17e5fSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
56290597fb56Smrg
56308bd17e5fSmrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
56318bd17e5fSmrg    case $_LT_TAGVAR(archive_cmds, $1) in
56328bd17e5fSmrg    *'~'*)
56338bd17e5fSmrg      # FIXME: we may have to deal with multi-command sequences.
56348bd17e5fSmrg      ;;
56358bd17e5fSmrg    '$CC '*)
56368bd17e5fSmrg      # Test whether the compiler implicitly links with -lc since on some
56378bd17e5fSmrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
56388bd17e5fSmrg      # to ld, don't add -lc before -lgcc.
56398bd17e5fSmrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
56408bd17e5fSmrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
56418bd17e5fSmrg	[$RM conftest*
56428bd17e5fSmrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
56430597fb56Smrg
56448bd17e5fSmrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
56458bd17e5fSmrg	  soname=conftest
56468bd17e5fSmrg	  lib=conftest
56478bd17e5fSmrg	  libobjs=conftest.$ac_objext
56488bd17e5fSmrg	  deplibs=
56498bd17e5fSmrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
56508bd17e5fSmrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
56518bd17e5fSmrg	  compiler_flags=-v
56528bd17e5fSmrg	  linker_flags=-v
56538bd17e5fSmrg	  verstring=
56548bd17e5fSmrg	  output_objdir=.
56558bd17e5fSmrg	  libname=conftest
56568bd17e5fSmrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
56578bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
56588bd17e5fSmrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
56598bd17e5fSmrg	  then
56608bd17e5fSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
56618bd17e5fSmrg	  else
56628bd17e5fSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
56638bd17e5fSmrg	  fi
56648bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
56658bd17e5fSmrg	else
56668bd17e5fSmrg	  cat conftest.err 1>&5
56678bd17e5fSmrg	fi
56688bd17e5fSmrg	$RM conftest*
56698bd17e5fSmrg	])
56708bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
56718bd17e5fSmrg      ;;
56728bd17e5fSmrg    esac
56738bd17e5fSmrg  fi
56748bd17e5fSmrg  ;;
56750597fb56Smrgesac
56760597fb56Smrg
56778bd17e5fSmrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
56788bd17e5fSmrg    [Whether or not to add -lc for building shared libraries])
56798bd17e5fSmrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
56808bd17e5fSmrg    [enable_shared_with_static_runtimes], [0],
56818bd17e5fSmrg    [Whether or not to disallow shared libs when runtime libs are static])
56828bd17e5fSmrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
56838bd17e5fSmrg    [Compiler flag to allow reflexive dlopens])
56848bd17e5fSmrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
56858bd17e5fSmrg    [Compiler flag to generate shared objects directly from archives])
56868bd17e5fSmrg_LT_TAGDECL([], [compiler_needs_object], [1],
56878bd17e5fSmrg    [Whether the compiler copes with passing no objects directly])
56888bd17e5fSmrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
56898bd17e5fSmrg    [Create an old-style archive from a shared archive])
56908bd17e5fSmrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
56918bd17e5fSmrg    [Create a temporary old-style archive to link instead of a shared archive])
56928bd17e5fSmrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
56938bd17e5fSmrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
56948bd17e5fSmrg_LT_TAGDECL([], [module_cmds], [2],
56958bd17e5fSmrg    [Commands used to build a loadable module if different from building
56968bd17e5fSmrg    a shared archive.])
56978bd17e5fSmrg_LT_TAGDECL([], [module_expsym_cmds], [2])
56988bd17e5fSmrg_LT_TAGDECL([], [with_gnu_ld], [1],
56998bd17e5fSmrg    [Whether we are building with GNU ld or not])
57008bd17e5fSmrg_LT_TAGDECL([], [allow_undefined_flag], [1],
57018bd17e5fSmrg    [Flag that allows shared libraries with undefined symbols to be built])
57028bd17e5fSmrg_LT_TAGDECL([], [no_undefined_flag], [1],
57038bd17e5fSmrg    [Flag that enforces no undefined symbols])
57048bd17e5fSmrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
57058bd17e5fSmrg    [Flag to hardcode $libdir into a binary during linking.
57068bd17e5fSmrg    This must work even if $libdir does not exist])
57078bd17e5fSmrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
57088bd17e5fSmrg    [Whether we need a single "-rpath" flag with a separated argument])
57098bd17e5fSmrg_LT_TAGDECL([], [hardcode_direct], [0],
57108bd17e5fSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
57118bd17e5fSmrg    DIR into the resulting binary])
57128bd17e5fSmrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
57138bd17e5fSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
57148bd17e5fSmrg    DIR into the resulting binary and the resulting library dependency is
57158bd17e5fSmrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
57168bd17e5fSmrg    library is relocated])
57178bd17e5fSmrg_LT_TAGDECL([], [hardcode_minus_L], [0],
57188bd17e5fSmrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
57198bd17e5fSmrg    into the resulting binary])
57208bd17e5fSmrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
57218bd17e5fSmrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
57228bd17e5fSmrg    into the resulting binary])
57238bd17e5fSmrg_LT_TAGDECL([], [hardcode_automatic], [0],
57248bd17e5fSmrg    [Set to "yes" if building a shared library automatically hardcodes DIR
57258bd17e5fSmrg    into the library and all subsequent libraries and executables linked
57268bd17e5fSmrg    against it])
57278bd17e5fSmrg_LT_TAGDECL([], [inherit_rpath], [0],
57288bd17e5fSmrg    [Set to yes if linker adds runtime paths of dependent libraries
57298bd17e5fSmrg    to runtime path list])
57308bd17e5fSmrg_LT_TAGDECL([], [link_all_deplibs], [0],
57318bd17e5fSmrg    [Whether libtool must link a program against all its dependency libraries])
57328bd17e5fSmrg_LT_TAGDECL([], [always_export_symbols], [0],
57338bd17e5fSmrg    [Set to "yes" if exported symbols are required])
57348bd17e5fSmrg_LT_TAGDECL([], [export_symbols_cmds], [2],
57358bd17e5fSmrg    [The commands to list exported symbols])
57368bd17e5fSmrg_LT_TAGDECL([], [exclude_expsyms], [1],
57378bd17e5fSmrg    [Symbols that should not be listed in the preloaded symbols])
57388bd17e5fSmrg_LT_TAGDECL([], [include_expsyms], [1],
57398bd17e5fSmrg    [Symbols that must always be exported])
57408bd17e5fSmrg_LT_TAGDECL([], [prelink_cmds], [2],
57418bd17e5fSmrg    [Commands necessary for linking programs (against libraries) with templates])
57428bd17e5fSmrg_LT_TAGDECL([], [postlink_cmds], [2],
57438bd17e5fSmrg    [Commands necessary for finishing linking programs])
57448bd17e5fSmrg_LT_TAGDECL([], [file_list_spec], [1],
57458bd17e5fSmrg    [Specify filename containing input files])
57468bd17e5fSmrgdnl FIXME: Not yet implemented
57478bd17e5fSmrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
57488bd17e5fSmrgdnl    [Compiler flag to generate thread safe objects])
57498bd17e5fSmrg])# _LT_LINKER_SHLIBS
5750b042e37fSmrg
5751b042e37fSmrg
57528bd17e5fSmrg# _LT_LANG_C_CONFIG([TAG])
57538bd17e5fSmrg# ------------------------
57548bd17e5fSmrg# Ensure that the configuration variables for a C compiler are suitably
57558bd17e5fSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
57568bd17e5fSmrg# the compiler configuration to `libtool'.
57578bd17e5fSmrgm4_defun([_LT_LANG_C_CONFIG],
57588bd17e5fSmrg[m4_require([_LT_DECL_EGREP])dnl
57598bd17e5fSmrglt_save_CC="$CC"
57608bd17e5fSmrgAC_LANG_PUSH(C)
5761b042e37fSmrg
57628bd17e5fSmrg# Source file extension for C test sources.
57638bd17e5fSmrgac_ext=c
5764b042e37fSmrg
57658bd17e5fSmrg# Object file extension for compiled C test sources.
57668bd17e5fSmrgobjext=o
57678bd17e5fSmrg_LT_TAGVAR(objext, $1)=$objext
5768bd23fbfaSmrg
57698bd17e5fSmrg# Code to be used in simple compile tests
57708bd17e5fSmrglt_simple_compile_test_code="int some_variable = 0;"
5771b042e37fSmrg
57728bd17e5fSmrg# Code to be used in simple link tests
57738bd17e5fSmrglt_simple_link_test_code='int main(){return(0);}'
5774b042e37fSmrg
57758bd17e5fSmrg_LT_TAG_COMPILER
57768bd17e5fSmrg# Save the default compiler, since it gets overwritten when the other
57778bd17e5fSmrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
57788bd17e5fSmrgcompiler_DEFAULT=$CC
5779b042e37fSmrg
57808bd17e5fSmrg# save warnings/boilerplate of simple test code
57818bd17e5fSmrg_LT_COMPILER_BOILERPLATE
57828bd17e5fSmrg_LT_LINKER_BOILERPLATE
5783b042e37fSmrg
57848bd17e5fSmrgif test -n "$compiler"; then
57858bd17e5fSmrg  _LT_COMPILER_NO_RTTI($1)
57868bd17e5fSmrg  _LT_COMPILER_PIC($1)
57878bd17e5fSmrg  _LT_COMPILER_C_O($1)
57888bd17e5fSmrg  _LT_COMPILER_FILE_LOCKS($1)
57898bd17e5fSmrg  _LT_LINKER_SHLIBS($1)
57908bd17e5fSmrg  _LT_SYS_DYNAMIC_LINKER($1)
57918bd17e5fSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
57928bd17e5fSmrg  LT_SYS_DLOPEN_SELF
57938bd17e5fSmrg  _LT_CMD_STRIPLIB
5794b042e37fSmrg
57958bd17e5fSmrg  # Report which library types will actually be built
57968bd17e5fSmrg  AC_MSG_CHECKING([if libtool supports shared libraries])
57978bd17e5fSmrg  AC_MSG_RESULT([$can_build_shared])
57980597fb56Smrg
57998bd17e5fSmrg  AC_MSG_CHECKING([whether to build shared libraries])
58008bd17e5fSmrg  test "$can_build_shared" = "no" && enable_shared=no
58010597fb56Smrg
58028bd17e5fSmrg  # On AIX, shared libraries and static libraries use the same namespace, and
58038bd17e5fSmrg  # are all built from PIC.
58048bd17e5fSmrg  case $host_os in
58058bd17e5fSmrg  aix3*)
58068bd17e5fSmrg    test "$enable_shared" = yes && enable_static=no
58078bd17e5fSmrg    if test -n "$RANLIB"; then
58088bd17e5fSmrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
58098bd17e5fSmrg      postinstall_cmds='$RANLIB $lib'
58108bd17e5fSmrg    fi
58118bd17e5fSmrg    ;;
58120597fb56Smrg
58138bd17e5fSmrg  aix[[4-9]]*)
58148bd17e5fSmrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
58158bd17e5fSmrg      test "$enable_shared" = yes && enable_static=no
58160597fb56Smrg    fi
5817706b6b52Smrg    ;;
5818706b6b52Smrg  esac
58198bd17e5fSmrg  AC_MSG_RESULT([$enable_shared])
5820b042e37fSmrg
58218bd17e5fSmrg  AC_MSG_CHECKING([whether to build static libraries])
58228bd17e5fSmrg  # Make sure either enable_shared or enable_static is yes.
58238bd17e5fSmrg  test "$enable_shared" = yes || enable_static=yes
58248bd17e5fSmrg  AC_MSG_RESULT([$enable_static])
58258bd17e5fSmrg
58268bd17e5fSmrg  _LT_CONFIG($1)
58270597fb56Smrgfi
58288bd17e5fSmrgAC_LANG_POP
58298bd17e5fSmrgCC="$lt_save_CC"
58308bd17e5fSmrg])# _LT_LANG_C_CONFIG
5831b042e37fSmrg
58320597fb56Smrg
58338bd17e5fSmrg# _LT_LANG_CXX_CONFIG([TAG])
58340597fb56Smrg# --------------------------
58358bd17e5fSmrg# Ensure that the configuration variables for a C++ compiler are suitably
58368bd17e5fSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
58378bd17e5fSmrg# the compiler configuration to `libtool'.
58388bd17e5fSmrgm4_defun([_LT_LANG_CXX_CONFIG],
58398bd17e5fSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
58408bd17e5fSmrgm4_require([_LT_DECL_EGREP])dnl
58418bd17e5fSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
58428bd17e5fSmrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
58438bd17e5fSmrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
58448bd17e5fSmrg    (test "X$CXX" != "Xg++"))) ; then
58458bd17e5fSmrg  AC_PROG_CXXCPP
58468bd17e5fSmrgelse
58478bd17e5fSmrg  _lt_caught_CXX_error=yes
58480597fb56Smrgfi
58490597fb56Smrg
58508bd17e5fSmrgAC_LANG_PUSH(C++)
58510597fb56Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
58520597fb56Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
58530597fb56Smrg_LT_TAGVAR(always_export_symbols, $1)=no
58540597fb56Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
58558bd17e5fSmrg_LT_TAGVAR(compiler_needs_object, $1)=no
58560597fb56Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
58570597fb56Smrg_LT_TAGVAR(hardcode_direct, $1)=no
58580597fb56Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
58590597fb56Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
58600597fb56Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
58610597fb56Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
58628bd17e5fSmrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
58630597fb56Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
58640597fb56Smrg_LT_TAGVAR(inherit_rpath, $1)=no
58650597fb56Smrg_LT_TAGVAR(module_cmds, $1)=
58660597fb56Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
58670597fb56Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
58680597fb56Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
58690597fb56Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
58700597fb56Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
58710597fb56Smrg_LT_TAGVAR(no_undefined_flag, $1)=
58720597fb56Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
58730597fb56Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
58740597fb56Smrg
58758bd17e5fSmrg# Source file extension for C++ test sources.
58768bd17e5fSmrgac_ext=cpp
58770597fb56Smrg
58788bd17e5fSmrg# Object file extension for compiled C++ test sources.
58790597fb56Smrgobjext=o
58800597fb56Smrg_LT_TAGVAR(objext, $1)=$objext
58810597fb56Smrg
58820597fb56Smrg# No sense in running all these tests if we already determined that
58838bd17e5fSmrg# the CXX compiler isn't working.  Some variables (like enable_shared)
58840597fb56Smrg# are currently assumed to apply to all compilers on this platform,
58850597fb56Smrg# and will be corrupted by setting them based on a non-working compiler.
58868bd17e5fSmrgif test "$_lt_caught_CXX_error" != yes; then
58870597fb56Smrg  # Code to be used in simple compile tests
58888bd17e5fSmrg  lt_simple_compile_test_code="int some_variable = 0;"
58890597fb56Smrg
58900597fb56Smrg  # Code to be used in simple link tests
58918bd17e5fSmrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
58920597fb56Smrg
58930597fb56Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
58940597fb56Smrg  _LT_TAG_COMPILER
58950597fb56Smrg
58960597fb56Smrg  # save warnings/boilerplate of simple test code
58970597fb56Smrg  _LT_COMPILER_BOILERPLATE
58980597fb56Smrg  _LT_LINKER_BOILERPLATE
58990597fb56Smrg
59000597fb56Smrg  # Allow CC to be a program name with arguments.
59018bd17e5fSmrg  lt_save_CC=$CC
59020597fb56Smrg  lt_save_CFLAGS=$CFLAGS
59038bd17e5fSmrg  lt_save_LD=$LD
59048bd17e5fSmrg  lt_save_GCC=$GCC
59058bd17e5fSmrg  GCC=$GXX
59068bd17e5fSmrg  lt_save_with_gnu_ld=$with_gnu_ld
59078bd17e5fSmrg  lt_save_path_LD=$lt_cv_path_LD
59088bd17e5fSmrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
59098bd17e5fSmrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
59108bd17e5fSmrg  else
59118bd17e5fSmrg    $as_unset lt_cv_prog_gnu_ld
59128bd17e5fSmrg  fi
59138bd17e5fSmrg  if test -n "${lt_cv_path_LDCXX+set}"; then
59148bd17e5fSmrg    lt_cv_path_LD=$lt_cv_path_LDCXX
59158bd17e5fSmrg  else
59168bd17e5fSmrg    $as_unset lt_cv_path_LD
59178bd17e5fSmrg  fi
59188bd17e5fSmrg  test -z "${LDCXX+set}" || LD=$LDCXX
59198bd17e5fSmrg  CC=${CXX-"c++"}
59208bd17e5fSmrg  CFLAGS=$CXXFLAGS
59210597fb56Smrg  compiler=$CC
59220597fb56Smrg  _LT_TAGVAR(compiler, $1)=$CC
59230597fb56Smrg  _LT_CC_BASENAME([$compiler])
59248c4a8e55Smrg
59258bd17e5fSmrg  if test -n "$compiler"; then
59268bd17e5fSmrg    # We don't want -fno-exception when compiling C++ code, so set the
59278bd17e5fSmrg    # no_builtin_flag separately
59288bd17e5fSmrg    if test "$GXX" = yes; then
59298bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
59308bd17e5fSmrg    else
59318bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
59328bd17e5fSmrg    fi
59338c4a8e55Smrg
59348bd17e5fSmrg    if test "$GXX" = yes; then
59358bd17e5fSmrg      # Set up default GNU C++ configuration
5936b042e37fSmrg
59378bd17e5fSmrg      LT_PATH_LD
59388c4a8e55Smrg
59398bd17e5fSmrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
59408bd17e5fSmrg      # archiving commands below assume that GNU ld is being used.
59418bd17e5fSmrg      if test "$with_gnu_ld" = yes; then
59428bd17e5fSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
59438bd17e5fSmrg        _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'
59448c4a8e55Smrg
59458bd17e5fSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
59468bd17e5fSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5947b042e37fSmrg
59488bd17e5fSmrg        # If archive_cmds runs LD, not CC, wlarc should be empty
59498bd17e5fSmrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
59508bd17e5fSmrg        #     investigate it a little bit more. (MM)
59518bd17e5fSmrg        wlarc='${wl}'
5952b042e37fSmrg
59538bd17e5fSmrg        # ancient GNU ld didn't support --whole-archive et. al.
59548bd17e5fSmrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
59558bd17e5fSmrg	  $GREP 'no-whole-archive' > /dev/null; then
59568bd17e5fSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
59578bd17e5fSmrg        else
59588bd17e5fSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
59598bd17e5fSmrg        fi
59608bd17e5fSmrg      else
59618bd17e5fSmrg        with_gnu_ld=no
59628bd17e5fSmrg        wlarc=
5963b042e37fSmrg
59648bd17e5fSmrg        # A generic and very simple default shared library creation
59658bd17e5fSmrg        # command for GNU C++ for the case where it uses the native
59668bd17e5fSmrg        # linker, instead of GNU ld.  If possible, this setting should
59678bd17e5fSmrg        # overridden to take advantage of the native linker features on
59688bd17e5fSmrg        # the platform it is being used on.
59698bd17e5fSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
59708bd17e5fSmrg      fi
5971b042e37fSmrg
59728bd17e5fSmrg      # Commands to make compiler produce verbose output that lists
59738bd17e5fSmrg      # what "hidden" libraries, object files and flags are used when
59748bd17e5fSmrg      # linking a shared library.
59758bd17e5fSmrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
5976b042e37fSmrg
59778bd17e5fSmrg    else
59788bd17e5fSmrg      GXX=no
59798bd17e5fSmrg      with_gnu_ld=no
59808bd17e5fSmrg      wlarc=
59818bd17e5fSmrg    fi
5982b042e37fSmrg
59838bd17e5fSmrg    # PORTME: fill in a description of your system's C++ link characteristics
59848bd17e5fSmrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
59858bd17e5fSmrg    _LT_TAGVAR(ld_shlibs, $1)=yes
59860597fb56Smrg    case $host_os in
59870597fb56Smrg      aix3*)
59888bd17e5fSmrg        # FIXME: insert proper C++ library support
59898bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
59900597fb56Smrg        ;;
59910597fb56Smrg      aix[[4-9]]*)
59928bd17e5fSmrg        if test "$host_cpu" = ia64; then
59938bd17e5fSmrg          # On IA64, the linker does run time linking by default, so we don't
59948bd17e5fSmrg          # have to do anything special.
59958bd17e5fSmrg          aix_use_runtimelinking=no
59968bd17e5fSmrg          exp_sym_flag='-Bexport'
59978bd17e5fSmrg          no_entry_flag=""
59988bd17e5fSmrg        else
59998bd17e5fSmrg          aix_use_runtimelinking=no
6000b042e37fSmrg
60018bd17e5fSmrg          # Test if we are trying to use run time linking or normal
60028bd17e5fSmrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
60038bd17e5fSmrg          # need to do runtime linking.
60048bd17e5fSmrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
60058bd17e5fSmrg	    for ld_flag in $LDFLAGS; do
60068bd17e5fSmrg	      case $ld_flag in
60078bd17e5fSmrg	      *-brtl*)
60088bd17e5fSmrg	        aix_use_runtimelinking=yes
60098bd17e5fSmrg	        break
60108bd17e5fSmrg	        ;;
60118bd17e5fSmrg	      esac
60128bd17e5fSmrg	    done
60138bd17e5fSmrg	    ;;
60148bd17e5fSmrg          esac
6015b042e37fSmrg
60168bd17e5fSmrg          exp_sym_flag='-bexport'
60178bd17e5fSmrg          no_entry_flag='-bnoentry'
60188bd17e5fSmrg        fi
6019b042e37fSmrg
60208bd17e5fSmrg        # When large executables or shared objects are built, AIX ld can
60218bd17e5fSmrg        # have problems creating the table of contents.  If linking a library
60228bd17e5fSmrg        # or program results in "error TOC overflow" add -mminimal-toc to
60238bd17e5fSmrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
60248bd17e5fSmrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6025b042e37fSmrg
60268bd17e5fSmrg        _LT_TAGVAR(archive_cmds, $1)=''
60278bd17e5fSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
60288bd17e5fSmrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
60298bd17e5fSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
60308bd17e5fSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
60318bd17e5fSmrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6032b042e37fSmrg
60338bd17e5fSmrg        if test "$GXX" = yes; then
60348bd17e5fSmrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
60358bd17e5fSmrg          # We only want to do this on AIX 4.2 and lower, the check
60368bd17e5fSmrg          # below for broken collect2 doesn't work under 4.3+
60378bd17e5fSmrg	  collect2name=`${CC} -print-prog-name=collect2`
60388bd17e5fSmrg	  if test -f "$collect2name" &&
60398bd17e5fSmrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
60408bd17e5fSmrg	  then
60418bd17e5fSmrg	    # We have reworked collect2
60428bd17e5fSmrg	    :
60438bd17e5fSmrg	  else
60448bd17e5fSmrg	    # We have old collect2
60458bd17e5fSmrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
60468bd17e5fSmrg	    # It fails to find uninstalled libraries when the uninstalled
60478bd17e5fSmrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
60488bd17e5fSmrg	    # to unsupported forces relinking
60498bd17e5fSmrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
60508bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
60518bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
60528bd17e5fSmrg	  fi
60538bd17e5fSmrg          esac
60548bd17e5fSmrg          shared_flag='-shared'
60558bd17e5fSmrg	  if test "$aix_use_runtimelinking" = yes; then
60568bd17e5fSmrg	    shared_flag="$shared_flag "'${wl}-G'
60578bd17e5fSmrg	  fi
60588bd17e5fSmrg        else
60598bd17e5fSmrg          # not using gcc
60608bd17e5fSmrg          if test "$host_cpu" = ia64; then
60618bd17e5fSmrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
60628bd17e5fSmrg	  # chokes on -Wl,-G. The following line is correct:
60638bd17e5fSmrg	  shared_flag='-G'
60648bd17e5fSmrg          else
60658bd17e5fSmrg	    if test "$aix_use_runtimelinking" = yes; then
60668bd17e5fSmrg	      shared_flag='${wl}-G'
60678bd17e5fSmrg	    else
60688bd17e5fSmrg	      shared_flag='${wl}-bM:SRE'
60698bd17e5fSmrg	    fi
60708bd17e5fSmrg          fi
60718bd17e5fSmrg        fi
6072706b6b52Smrg
60738bd17e5fSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
60748bd17e5fSmrg        # It seems that -bexpall does not export symbols beginning with
60758bd17e5fSmrg        # underscore (_), so it is better to generate a list of symbols to
60768bd17e5fSmrg	# export.
60778bd17e5fSmrg        _LT_TAGVAR(always_export_symbols, $1)=yes
60788bd17e5fSmrg        if test "$aix_use_runtimelinking" = yes; then
60798bd17e5fSmrg          # Warning - without using the other runtime loading flags (-brtl),
60808bd17e5fSmrg          # -berok will link without error, but may produce a broken library.
60818bd17e5fSmrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
60828bd17e5fSmrg          # Determine the default libpath from the value encoded in an empty
60838bd17e5fSmrg          # executable.
60848bd17e5fSmrg          _LT_SYS_MODULE_PATH_AIX([$1])
60858bd17e5fSmrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
60868c4a8e55Smrg
60878bd17e5fSmrg          _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"
60888bd17e5fSmrg        else
60898bd17e5fSmrg          if test "$host_cpu" = ia64; then
60908bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
60918bd17e5fSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
60928bd17e5fSmrg	    _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"
60938bd17e5fSmrg          else
60948bd17e5fSmrg	    # Determine the default libpath from the value encoded in an
60958bd17e5fSmrg	    # empty executable.
60968bd17e5fSmrg	    _LT_SYS_MODULE_PATH_AIX([$1])
60978bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
60988bd17e5fSmrg	    # Warning - without using the other run time loading flags,
60998bd17e5fSmrg	    # -berok will link without error, but may produce a broken library.
61008bd17e5fSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
61018bd17e5fSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
61028bd17e5fSmrg	    if test "$with_gnu_ld" = yes; then
61038bd17e5fSmrg	      # We only use this code for GNU lds that support --whole-archive.
61048bd17e5fSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
61058bd17e5fSmrg	    else
61068bd17e5fSmrg	      # Exported symbols can be pulled into shared objects from archives
61078bd17e5fSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
61088bd17e5fSmrg	    fi
61098bd17e5fSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
61108bd17e5fSmrg	    # This is similar to how AIX traditionally builds its shared
61118bd17e5fSmrg	    # libraries.
61128bd17e5fSmrg	    _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'
61138bd17e5fSmrg          fi
61148bd17e5fSmrg        fi
61158bd17e5fSmrg        ;;
61168c4a8e55Smrg
61178bd17e5fSmrg      beos*)
61188bd17e5fSmrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
61198bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
61208bd17e5fSmrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
61218bd17e5fSmrg	  # support --undefined.  This deserves some investigation.  FIXME
61228bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
61238bd17e5fSmrg	else
61248bd17e5fSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
61258bd17e5fSmrg	fi
61268bd17e5fSmrg	;;
61278c4a8e55Smrg
61288bd17e5fSmrg      chorus*)
61298bd17e5fSmrg        case $cc_basename in
61308bd17e5fSmrg          *)
61318bd17e5fSmrg	  # FIXME: insert proper C++ library support
61328bd17e5fSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
61338bd17e5fSmrg	  ;;
61348bd17e5fSmrg        esac
61358bd17e5fSmrg        ;;
61368c4a8e55Smrg
61378bd17e5fSmrg      cygwin* | mingw* | pw32* | cegcc*)
61388bd17e5fSmrg	case $GXX,$cc_basename in
61398bd17e5fSmrg	,cl* | no,cl*)
61408bd17e5fSmrg	  # Native MSVC
61418bd17e5fSmrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
61428bd17e5fSmrg	  # no search path for DLLs.
61438bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
61448bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
61458bd17e5fSmrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
61468bd17e5fSmrg	  _LT_TAGVAR(file_list_spec, $1)='@'
61478bd17e5fSmrg	  # Tell ltmain to make .lib files, not .a files.
61488bd17e5fSmrg	  libext=lib
61498bd17e5fSmrg	  # Tell ltmain to make .dll files, not .so files.
61508bd17e5fSmrg	  shrext_cmds=".dll"
61518bd17e5fSmrg	  # FIXME: Setting linknames here is a bad hack.
61528bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
61538bd17e5fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
61548bd17e5fSmrg	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
61558bd17e5fSmrg	    else
61568bd17e5fSmrg	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
61578bd17e5fSmrg	    fi~
61588bd17e5fSmrg	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
61598bd17e5fSmrg	    linknames='
61608bd17e5fSmrg	  # The linker will not automatically build a static lib if we build a DLL.
61618bd17e5fSmrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
61628bd17e5fSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
61638bd17e5fSmrg	  # Don't use ranlib
61648bd17e5fSmrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
61658bd17e5fSmrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
61668bd17e5fSmrg	    lt_tool_outputfile="@TOOL_OUTPUT@"~
61678bd17e5fSmrg	    case $lt_outputfile in
61688bd17e5fSmrg	      *.exe|*.EXE) ;;
61698bd17e5fSmrg	      *)
61708bd17e5fSmrg		lt_outputfile="$lt_outputfile.exe"
61718bd17e5fSmrg		lt_tool_outputfile="$lt_tool_outputfile.exe"
61728bd17e5fSmrg		;;
61738bd17e5fSmrg	    esac~
61748bd17e5fSmrg	    func_to_tool_file "$lt_outputfile"~
61758bd17e5fSmrg	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
61768bd17e5fSmrg	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
61778bd17e5fSmrg	      $RM "$lt_outputfile.manifest";
61788bd17e5fSmrg	    fi'
61798bd17e5fSmrg	  ;;
61808bd17e5fSmrg	*)
61818bd17e5fSmrg	  # g++
61828bd17e5fSmrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
61838bd17e5fSmrg	  # as there is no search path for DLLs.
61848bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
61858bd17e5fSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
61868bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
61878bd17e5fSmrg	  _LT_TAGVAR(always_export_symbols, $1)=no
61888bd17e5fSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
61898c4a8e55Smrg
61908bd17e5fSmrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
61918bd17e5fSmrg	    _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'
61928bd17e5fSmrg	    # If the export-symbols file already is a .def file (1st line
61938bd17e5fSmrg	    # is EXPORTS), use it as is; otherwise, prepend...
61948bd17e5fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
61958bd17e5fSmrg	      cp $export_symbols $output_objdir/$soname.def;
61968bd17e5fSmrg	    else
61978bd17e5fSmrg	      echo EXPORTS > $output_objdir/$soname.def;
61988bd17e5fSmrg	      cat $export_symbols >> $output_objdir/$soname.def;
61998bd17e5fSmrg	    fi~
62008bd17e5fSmrg	    $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'
62018bd17e5fSmrg	  else
62028bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
62038bd17e5fSmrg	  fi
62048bd17e5fSmrg	  ;;
62058bd17e5fSmrg	esac
62068bd17e5fSmrg	;;
62078bd17e5fSmrg      darwin* | rhapsody*)
62088bd17e5fSmrg        _LT_DARWIN_LINKER_FEATURES($1)
62098bd17e5fSmrg	;;
6210b042e37fSmrg
62118bd17e5fSmrg      dgux*)
62128bd17e5fSmrg        case $cc_basename in
62138bd17e5fSmrg          ec++*)
62148bd17e5fSmrg	    # FIXME: insert proper C++ library support
62158bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
62168bd17e5fSmrg	    ;;
62178bd17e5fSmrg          ghcx*)
62188bd17e5fSmrg	    # Green Hills C++ Compiler
62198bd17e5fSmrg	    # FIXME: insert proper C++ library support
62208bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
62218bd17e5fSmrg	    ;;
62228bd17e5fSmrg          *)
62238bd17e5fSmrg	    # FIXME: insert proper C++ library support
62248bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
62258bd17e5fSmrg	    ;;
62268bd17e5fSmrg        esac
62278bd17e5fSmrg        ;;
62288c4a8e55Smrg
62298bd17e5fSmrg      freebsd2.*)
62308bd17e5fSmrg        # C++ shared libraries reported to be fairly broken before
62318bd17e5fSmrg	# switch to ELF
62328bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
62338bd17e5fSmrg        ;;
62348c4a8e55Smrg
62358bd17e5fSmrg      freebsd-elf*)
62368bd17e5fSmrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
62378bd17e5fSmrg        ;;
6238b042e37fSmrg
62398bd17e5fSmrg      freebsd* | dragonfly*)
62408bd17e5fSmrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
62418bd17e5fSmrg        # conventions
62428bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
62438bd17e5fSmrg        ;;
6244b042e37fSmrg
62458bd17e5fSmrg      gnu*)
62468bd17e5fSmrg        ;;
6247b042e37fSmrg
62488bd17e5fSmrg      haiku*)
62498bd17e5fSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
62508bd17e5fSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
62518bd17e5fSmrg        ;;
62528c4a8e55Smrg
62538bd17e5fSmrg      hpux9*)
62548bd17e5fSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
62558bd17e5fSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
62568bd17e5fSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
62578bd17e5fSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
62588bd17e5fSmrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
62598bd17e5fSmrg				             # but as the default
62608bd17e5fSmrg				             # location of the library.
62618c4a8e55Smrg
62628bd17e5fSmrg        case $cc_basename in
62638bd17e5fSmrg          CC*)
62648bd17e5fSmrg            # FIXME: insert proper C++ library support
62658bd17e5fSmrg            _LT_TAGVAR(ld_shlibs, $1)=no
62668bd17e5fSmrg            ;;
62678bd17e5fSmrg          aCC*)
62688bd17e5fSmrg            _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'
62698bd17e5fSmrg            # Commands to make compiler produce verbose output that lists
62708bd17e5fSmrg            # what "hidden" libraries, object files and flags are used when
62718bd17e5fSmrg            # linking a shared library.
62728bd17e5fSmrg            #
62738bd17e5fSmrg            # There doesn't appear to be a way to prevent this compiler from
62748bd17e5fSmrg            # explicitly linking system object files so we need to strip them
62758bd17e5fSmrg            # from the output so that they don't get included in the library
62768bd17e5fSmrg            # dependencies.
62778bd17e5fSmrg            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"'
62788bd17e5fSmrg            ;;
62798bd17e5fSmrg          *)
62808bd17e5fSmrg            if test "$GXX" = yes; then
62818bd17e5fSmrg              _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'
62828bd17e5fSmrg            else
62838bd17e5fSmrg              # FIXME: insert proper C++ library support
62848bd17e5fSmrg              _LT_TAGVAR(ld_shlibs, $1)=no
62858bd17e5fSmrg            fi
62868bd17e5fSmrg            ;;
62878bd17e5fSmrg        esac
62888bd17e5fSmrg        ;;
62898c4a8e55Smrg
62908bd17e5fSmrg      hpux10*|hpux11*)
62918bd17e5fSmrg        if test $with_gnu_ld = no; then
62928bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
62938bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
62948c4a8e55Smrg
62958bd17e5fSmrg          case $host_cpu in
62968bd17e5fSmrg            hppa*64*|ia64*)
62978bd17e5fSmrg              ;;
62988bd17e5fSmrg            *)
62998bd17e5fSmrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
63008bd17e5fSmrg              ;;
63018bd17e5fSmrg          esac
63028bd17e5fSmrg        fi
63038bd17e5fSmrg        case $host_cpu in
63048bd17e5fSmrg          hppa*64*|ia64*)
63058bd17e5fSmrg            _LT_TAGVAR(hardcode_direct, $1)=no
63068bd17e5fSmrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
63078bd17e5fSmrg            ;;
63088bd17e5fSmrg          *)
63098bd17e5fSmrg            _LT_TAGVAR(hardcode_direct, $1)=yes
63108bd17e5fSmrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
63118bd17e5fSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
63128bd17e5fSmrg					         # but as the default
63138bd17e5fSmrg					         # location of the library.
63148bd17e5fSmrg            ;;
63158bd17e5fSmrg        esac
6316706b6b52Smrg
63178bd17e5fSmrg        case $cc_basename in
63188bd17e5fSmrg          CC*)
63198bd17e5fSmrg	    # FIXME: insert proper C++ library support
63208bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
63218bd17e5fSmrg	    ;;
63228bd17e5fSmrg          aCC*)
63238bd17e5fSmrg	    case $host_cpu in
63248bd17e5fSmrg	      hppa*64*)
63258bd17e5fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
63268bd17e5fSmrg	        ;;
63278bd17e5fSmrg	      ia64*)
63288bd17e5fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
63298bd17e5fSmrg	        ;;
63308bd17e5fSmrg	      *)
63318bd17e5fSmrg	        _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'
63328bd17e5fSmrg	        ;;
63338bd17e5fSmrg	    esac
63348bd17e5fSmrg	    # Commands to make compiler produce verbose output that lists
63358bd17e5fSmrg	    # what "hidden" libraries, object files and flags are used when
63368bd17e5fSmrg	    # linking a shared library.
63378bd17e5fSmrg	    #
63388bd17e5fSmrg	    # There doesn't appear to be a way to prevent this compiler from
63398bd17e5fSmrg	    # explicitly linking system object files so we need to strip them
63408bd17e5fSmrg	    # from the output so that they don't get included in the library
63418bd17e5fSmrg	    # dependencies.
63428bd17e5fSmrg	    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"'
63438bd17e5fSmrg	    ;;
63448bd17e5fSmrg          *)
63458bd17e5fSmrg	    if test "$GXX" = yes; then
63468bd17e5fSmrg	      if test $with_gnu_ld = no; then
63478bd17e5fSmrg	        case $host_cpu in
63488bd17e5fSmrg	          hppa*64*)
63498bd17e5fSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
63508bd17e5fSmrg	            ;;
63518bd17e5fSmrg	          ia64*)
63528bd17e5fSmrg	            _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'
63538bd17e5fSmrg	            ;;
63548bd17e5fSmrg	          *)
63558bd17e5fSmrg	            _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'
63568bd17e5fSmrg	            ;;
63578bd17e5fSmrg	        esac
63588bd17e5fSmrg	      fi
63598bd17e5fSmrg	    else
63608bd17e5fSmrg	      # FIXME: insert proper C++ library support
63618bd17e5fSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
63628bd17e5fSmrg	    fi
63638bd17e5fSmrg	    ;;
63648bd17e5fSmrg        esac
63658bd17e5fSmrg        ;;
6366b042e37fSmrg
63678bd17e5fSmrg      interix[[3-9]]*)
63688bd17e5fSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
63698bd17e5fSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
63708bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
63718bd17e5fSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
63728bd17e5fSmrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
63738bd17e5fSmrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
63748bd17e5fSmrg	# default) and relocated if they conflict, which is a slow very memory
63758bd17e5fSmrg	# consuming and fragmenting process.  To avoid this, we pick a random,
63768bd17e5fSmrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
63778bd17e5fSmrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
63788bd17e5fSmrg	_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'
63798bd17e5fSmrg	_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'
63808bd17e5fSmrg	;;
63818bd17e5fSmrg      irix5* | irix6*)
63828bd17e5fSmrg        case $cc_basename in
63838bd17e5fSmrg          CC*)
63848bd17e5fSmrg	    # SGI C++
63858bd17e5fSmrg	    _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'
63868c4a8e55Smrg
63878bd17e5fSmrg	    # Archives containing C++ object files must be created using
63888bd17e5fSmrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
63898bd17e5fSmrg	    # necessary to make sure instantiated templates are included
63908bd17e5fSmrg	    # in the archive.
63918bd17e5fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
63928bd17e5fSmrg	    ;;
63938bd17e5fSmrg          *)
63948bd17e5fSmrg	    if test "$GXX" = yes; then
63958bd17e5fSmrg	      if test "$with_gnu_ld" = no; then
63968bd17e5fSmrg	        _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'
63978bd17e5fSmrg	      else
63988bd17e5fSmrg	        _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'
63998bd17e5fSmrg	      fi
64008bd17e5fSmrg	    fi
64018bd17e5fSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
64028bd17e5fSmrg	    ;;
64038bd17e5fSmrg        esac
64048bd17e5fSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
64058bd17e5fSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
64068bd17e5fSmrg        _LT_TAGVAR(inherit_rpath, $1)=yes
64078bd17e5fSmrg        ;;
64088c4a8e55Smrg
64098bd17e5fSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
64108bd17e5fSmrg        case $cc_basename in
64118bd17e5fSmrg          KCC*)
64128bd17e5fSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
64138c4a8e55Smrg
64148bd17e5fSmrg	    # KCC will only create a shared library if the output file
64158bd17e5fSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
64168bd17e5fSmrg	    # to its proper name (with version) after linking.
64178bd17e5fSmrg	    _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'
64188bd17e5fSmrg	    _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'
64198bd17e5fSmrg	    # Commands to make compiler produce verbose output that lists
64208bd17e5fSmrg	    # what "hidden" libraries, object files and flags are used when
64218bd17e5fSmrg	    # linking a shared library.
64228bd17e5fSmrg	    #
64238bd17e5fSmrg	    # There doesn't appear to be a way to prevent this compiler from
64248bd17e5fSmrg	    # explicitly linking system object files so we need to strip them
64258bd17e5fSmrg	    # from the output so that they don't get included in the library
64268bd17e5fSmrg	    # dependencies.
64278bd17e5fSmrg	    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"'
64288c4a8e55Smrg
64298bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
64308bd17e5fSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
64318c4a8e55Smrg
64328bd17e5fSmrg	    # Archives containing C++ object files must be created using
64338bd17e5fSmrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
64348bd17e5fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
64358bd17e5fSmrg	    ;;
64368bd17e5fSmrg	  icpc* | ecpc* )
64378bd17e5fSmrg	    # Intel C++
64388bd17e5fSmrg	    with_gnu_ld=yes
64398bd17e5fSmrg	    # version 8.0 and above of icpc choke on multiply defined symbols
64408bd17e5fSmrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
64418bd17e5fSmrg	    # earlier do not add the objects themselves.
64428bd17e5fSmrg	    case `$CC -V 2>&1` in
64438bd17e5fSmrg	      *"Version 7."*)
64448bd17e5fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
64458bd17e5fSmrg		_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'
64468bd17e5fSmrg		;;
64478bd17e5fSmrg	      *)  # Version 8.0 or newer
64488bd17e5fSmrg	        tmp_idyn=
64498bd17e5fSmrg	        case $host_cpu in
64508bd17e5fSmrg		  ia64*) tmp_idyn=' -i_dynamic';;
64518bd17e5fSmrg		esac
64528bd17e5fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
64538bd17e5fSmrg		_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'
64548bd17e5fSmrg		;;
64558bd17e5fSmrg	    esac
64568bd17e5fSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
64578bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
64588bd17e5fSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
64598bd17e5fSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
64608bd17e5fSmrg	    ;;
64618bd17e5fSmrg          pgCC* | pgcpp*)
64628bd17e5fSmrg            # Portland Group C++ compiler
64638bd17e5fSmrg	    case `$CC -V` in
64648bd17e5fSmrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
64658bd17e5fSmrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
64668bd17e5fSmrg		rm -rf $tpldir~
64678bd17e5fSmrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
64688bd17e5fSmrg		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
64698bd17e5fSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
64708bd17e5fSmrg		rm -rf $tpldir~
64718bd17e5fSmrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
64728bd17e5fSmrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
64738bd17e5fSmrg		$RANLIB $oldlib'
64748bd17e5fSmrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
64758bd17e5fSmrg		rm -rf $tpldir~
64768bd17e5fSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
64778bd17e5fSmrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
64788bd17e5fSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
64798bd17e5fSmrg		rm -rf $tpldir~
64808bd17e5fSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
64818bd17e5fSmrg		$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'
64828bd17e5fSmrg	      ;;
64838bd17e5fSmrg	    *) # Version 6 and above use weak symbols
64848bd17e5fSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
64858bd17e5fSmrg	      _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'
64868bd17e5fSmrg	      ;;
64878bd17e5fSmrg	    esac
64888c4a8e55Smrg
64898bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
64908bd17e5fSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
64918bd17e5fSmrg	    _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'
64928bd17e5fSmrg            ;;
64938bd17e5fSmrg	  cxx*)
64948bd17e5fSmrg	    # Compaq C++
64958bd17e5fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
64968bd17e5fSmrg	    _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'
64978c4a8e55Smrg
64988bd17e5fSmrg	    runpath_var=LD_RUN_PATH
64998bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
65008bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6501706b6b52Smrg
65028bd17e5fSmrg	    # Commands to make compiler produce verbose output that lists
65038bd17e5fSmrg	    # what "hidden" libraries, object files and flags are used when
65048bd17e5fSmrg	    # linking a shared library.
65058bd17e5fSmrg	    #
65068bd17e5fSmrg	    # There doesn't appear to be a way to prevent this compiler from
65078bd17e5fSmrg	    # explicitly linking system object files so we need to strip them
65088bd17e5fSmrg	    # from the output so that they don't get included in the library
65098bd17e5fSmrg	    # dependencies.
65108bd17e5fSmrg	    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'
65118bd17e5fSmrg	    ;;
65128bd17e5fSmrg	  xl* | mpixl* | bgxl*)
65138bd17e5fSmrg	    # IBM XL 8.0 on PPC, with GNU ld
65148bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
65158bd17e5fSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
65168bd17e5fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
65178bd17e5fSmrg	    if test "x$supports_anon_versioning" = xyes; then
65188bd17e5fSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
65198bd17e5fSmrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
65208bd17e5fSmrg		echo "local: *; };" >> $output_objdir/$libname.ver~
65218bd17e5fSmrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
65228bd17e5fSmrg	    fi
65238bd17e5fSmrg	    ;;
65248bd17e5fSmrg	  *)
65258bd17e5fSmrg	    case `$CC -V 2>&1 | sed 5q` in
65268bd17e5fSmrg	    *Sun\ C*)
65278bd17e5fSmrg	      # Sun C++ 5.9
65288bd17e5fSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
65298bd17e5fSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
65308bd17e5fSmrg	      _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'
65318bd17e5fSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
65328bd17e5fSmrg	      _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'
65338bd17e5fSmrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
6534706b6b52Smrg
65358bd17e5fSmrg	      # Not sure whether something based on
65368bd17e5fSmrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
65378bd17e5fSmrg	      # would be better.
65388bd17e5fSmrg	      output_verbose_link_cmd='func_echo_all'
65398c4a8e55Smrg
65408bd17e5fSmrg	      # Archives containing C++ object files must be created using
65418bd17e5fSmrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
65428bd17e5fSmrg	      # necessary to make sure instantiated templates are included
65438bd17e5fSmrg	      # in the archive.
65448bd17e5fSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
65458bd17e5fSmrg	      ;;
65468bd17e5fSmrg	    esac
65478bd17e5fSmrg	    ;;
65488bd17e5fSmrg	esac
65498bd17e5fSmrg	;;
65508c4a8e55Smrg
65518bd17e5fSmrg      lynxos*)
65528bd17e5fSmrg        # FIXME: insert proper C++ library support
65538bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
65548bd17e5fSmrg	;;
65558c4a8e55Smrg
65568bd17e5fSmrg      m88k*)
65578bd17e5fSmrg        # FIXME: insert proper C++ library support
65588bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
65598bd17e5fSmrg	;;
65608c4a8e55Smrg
65618bd17e5fSmrg      mvs*)
65628bd17e5fSmrg        case $cc_basename in
65638bd17e5fSmrg          cxx*)
65648bd17e5fSmrg	    # FIXME: insert proper C++ library support
65658bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
65668bd17e5fSmrg	    ;;
65678bd17e5fSmrg	  *)
65688bd17e5fSmrg	    # FIXME: insert proper C++ library support
65698bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
65708bd17e5fSmrg	    ;;
65718bd17e5fSmrg	esac
65728bd17e5fSmrg	;;
65738c4a8e55Smrg
65748bd17e5fSmrg      netbsd*)
65758bd17e5fSmrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
65768bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
65778bd17e5fSmrg	  wlarc=
65788bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
65798bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
65808bd17e5fSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65818bd17e5fSmrg	fi
65828bd17e5fSmrg	# Workaround some broken pre-1.5 toolchains
65838bd17e5fSmrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
65848bd17e5fSmrg	;;
6585b042e37fSmrg
65868bd17e5fSmrg      *nto* | *qnx*)
65878bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
65888bd17e5fSmrg	;;
6589b042e37fSmrg
65908bd17e5fSmrg      openbsd2*)
65918bd17e5fSmrg        # C++ shared libraries are fairly broken
65928bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
65938bd17e5fSmrg	;;
6594b042e37fSmrg
65958bd17e5fSmrg      openbsd*)
65968bd17e5fSmrg	if test -f /usr/libexec/ld.so; then
65978bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
65988bd17e5fSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65998bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
66008bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
66018bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
66028bd17e5fSmrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
66038bd17e5fSmrg	    _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'
66048bd17e5fSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
66058bd17e5fSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
66068bd17e5fSmrg	  fi
66078bd17e5fSmrg	  output_verbose_link_cmd=func_echo_all
66088bd17e5fSmrg	else
66098bd17e5fSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
66108bd17e5fSmrg	fi
66118bd17e5fSmrg	;;
6612b042e37fSmrg
66138bd17e5fSmrg      osf3* | osf4* | osf5*)
66148bd17e5fSmrg        case $cc_basename in
66158bd17e5fSmrg          KCC*)
66168bd17e5fSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
66170597fb56Smrg
66188bd17e5fSmrg	    # KCC will only create a shared library if the output file
66198bd17e5fSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
66208bd17e5fSmrg	    # to its proper name (with version) after linking.
66218bd17e5fSmrg	    _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'
66220597fb56Smrg
66238bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
66248bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
66250597fb56Smrg
66268bd17e5fSmrg	    # Archives containing C++ object files must be created using
66278bd17e5fSmrg	    # the KAI C++ compiler.
66288bd17e5fSmrg	    case $host in
66298bd17e5fSmrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
66308bd17e5fSmrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
66318bd17e5fSmrg	    esac
66328bd17e5fSmrg	    ;;
66338bd17e5fSmrg          RCC*)
66348bd17e5fSmrg	    # Rational C++ 2.4.1
66358bd17e5fSmrg	    # FIXME: insert proper C++ library support
66368bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
66378bd17e5fSmrg	    ;;
66388bd17e5fSmrg          cxx*)
66398bd17e5fSmrg	    case $host in
66408bd17e5fSmrg	      osf3*)
66418bd17e5fSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
66428bd17e5fSmrg	        _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'
66438bd17e5fSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
66448bd17e5fSmrg		;;
66458bd17e5fSmrg	      *)
66468bd17e5fSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
66478bd17e5fSmrg	        _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'
66488bd17e5fSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
66498bd17e5fSmrg	          echo "-hidden">> $lib.exp~
66508bd17e5fSmrg	          $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~
66518bd17e5fSmrg	          $RM $lib.exp'
66528bd17e5fSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
66538bd17e5fSmrg		;;
66548bd17e5fSmrg	    esac
66550597fb56Smrg
66568bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
66570597fb56Smrg
66588bd17e5fSmrg	    # Commands to make compiler produce verbose output that lists
66598bd17e5fSmrg	    # what "hidden" libraries, object files and flags are used when
66608bd17e5fSmrg	    # linking a shared library.
66618bd17e5fSmrg	    #
66628bd17e5fSmrg	    # There doesn't appear to be a way to prevent this compiler from
66638bd17e5fSmrg	    # explicitly linking system object files so we need to strip them
66648bd17e5fSmrg	    # from the output so that they don't get included in the library
66658bd17e5fSmrg	    # dependencies.
66668bd17e5fSmrg	    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"'
66678bd17e5fSmrg	    ;;
66688bd17e5fSmrg	  *)
66698bd17e5fSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
66708bd17e5fSmrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
66718bd17e5fSmrg	      case $host in
66728bd17e5fSmrg	        osf3*)
66738bd17e5fSmrg	          _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'
66748bd17e5fSmrg		  ;;
66758bd17e5fSmrg	        *)
66768bd17e5fSmrg	          _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'
66778bd17e5fSmrg		  ;;
66788bd17e5fSmrg	      esac
66790597fb56Smrg
66808bd17e5fSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
66818bd17e5fSmrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
66820597fb56Smrg
66838bd17e5fSmrg	      # Commands to make compiler produce verbose output that lists
66848bd17e5fSmrg	      # what "hidden" libraries, object files and flags are used when
66858bd17e5fSmrg	      # linking a shared library.
66868bd17e5fSmrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6687b042e37fSmrg
66888bd17e5fSmrg	    else
66898bd17e5fSmrg	      # FIXME: insert proper C++ library support
66908bd17e5fSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
66918bd17e5fSmrg	    fi
66928bd17e5fSmrg	    ;;
66938bd17e5fSmrg        esac
66948bd17e5fSmrg        ;;
6695b042e37fSmrg
66968bd17e5fSmrg      psos*)
66978bd17e5fSmrg        # FIXME: insert proper C++ library support
66988bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
66998bd17e5fSmrg        ;;
6700b042e37fSmrg
67018bd17e5fSmrg      sunos4*)
67028bd17e5fSmrg        case $cc_basename in
67038bd17e5fSmrg          CC*)
67048bd17e5fSmrg	    # Sun C++ 4.x
67058bd17e5fSmrg	    # FIXME: insert proper C++ library support
67068bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67078bd17e5fSmrg	    ;;
67088bd17e5fSmrg          lcc*)
67098bd17e5fSmrg	    # Lucid
67108bd17e5fSmrg	    # FIXME: insert proper C++ library support
67118bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67128bd17e5fSmrg	    ;;
67138bd17e5fSmrg          *)
67148bd17e5fSmrg	    # FIXME: insert proper C++ library support
67158bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67168bd17e5fSmrg	    ;;
67178bd17e5fSmrg        esac
67188bd17e5fSmrg        ;;
6719b042e37fSmrg
67208bd17e5fSmrg      solaris*)
67218bd17e5fSmrg        case $cc_basename in
67228bd17e5fSmrg          CC* | sunCC*)
67238bd17e5fSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
67248bd17e5fSmrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
67258bd17e5fSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
67268bd17e5fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
67278bd17e5fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
67288bd17e5fSmrg	      $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'
6729b042e37fSmrg
67308bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
67318bd17e5fSmrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
67328bd17e5fSmrg	    case $host_os in
67338bd17e5fSmrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
67348bd17e5fSmrg	      *)
67358bd17e5fSmrg		# The compiler driver will combine and reorder linker options,
67368bd17e5fSmrg		# but understands `-z linker_flag'.
67378bd17e5fSmrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
67388bd17e5fSmrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
67398bd17e5fSmrg	        ;;
67408bd17e5fSmrg	    esac
67418bd17e5fSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6742b042e37fSmrg
67438bd17e5fSmrg	    output_verbose_link_cmd='func_echo_all'
6744b042e37fSmrg
67458bd17e5fSmrg	    # Archives containing C++ object files must be created using
67468bd17e5fSmrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
67478bd17e5fSmrg	    # necessary to make sure instantiated templates are included
67488bd17e5fSmrg	    # in the archive.
67498bd17e5fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
67508bd17e5fSmrg	    ;;
67518bd17e5fSmrg          gcx*)
67528bd17e5fSmrg	    # Green Hills C++ Compiler
67538bd17e5fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6754b042e37fSmrg
67558bd17e5fSmrg	    # The C++ compiler must be used to create the archive.
67568bd17e5fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
67578bd17e5fSmrg	    ;;
67588bd17e5fSmrg          *)
67598bd17e5fSmrg	    # GNU C++ compiler with Solaris linker
67608bd17e5fSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
67618bd17e5fSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
67628bd17e5fSmrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
67638bd17e5fSmrg	        _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'
67648bd17e5fSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
67658bd17e5fSmrg		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6766b042e37fSmrg
67678bd17e5fSmrg	        # Commands to make compiler produce verbose output that lists
67688bd17e5fSmrg	        # what "hidden" libraries, object files and flags are used when
67698bd17e5fSmrg	        # linking a shared library.
67708bd17e5fSmrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
67718bd17e5fSmrg	      else
67728bd17e5fSmrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
67738bd17e5fSmrg	        # platform.
67748bd17e5fSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
67758bd17e5fSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
67768bd17e5fSmrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6777b042e37fSmrg
67788bd17e5fSmrg	        # Commands to make compiler produce verbose output that lists
67798bd17e5fSmrg	        # what "hidden" libraries, object files and flags are used when
67808bd17e5fSmrg	        # linking a shared library.
67818bd17e5fSmrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
67828bd17e5fSmrg	      fi
6783b042e37fSmrg
67848bd17e5fSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
67858bd17e5fSmrg	      case $host_os in
67868bd17e5fSmrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
67878bd17e5fSmrg		*)
67888bd17e5fSmrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
67898bd17e5fSmrg		  ;;
67908bd17e5fSmrg	      esac
67918bd17e5fSmrg	    fi
67928bd17e5fSmrg	    ;;
67938bd17e5fSmrg        esac
67948bd17e5fSmrg        ;;
6795706b6b52Smrg
67968bd17e5fSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
67978bd17e5fSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
67988bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
67998bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
68008bd17e5fSmrg      runpath_var='LD_RUN_PATH'
68010597fb56Smrg
68028bd17e5fSmrg      case $cc_basename in
68038bd17e5fSmrg        CC*)
68048bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68058bd17e5fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68068bd17e5fSmrg	  ;;
68078bd17e5fSmrg	*)
68088bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68098bd17e5fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68108bd17e5fSmrg	  ;;
68118bd17e5fSmrg      esac
68128bd17e5fSmrg      ;;
68130597fb56Smrg
68148bd17e5fSmrg      sysv5* | sco3.2v5* | sco5v6*)
68158bd17e5fSmrg	# Note: We can NOT use -z defs as we might desire, because we do not
68168bd17e5fSmrg	# link with -lc, and that would cause any symbols used from libc to
68178bd17e5fSmrg	# always be unresolved, which means just about no library would
68188bd17e5fSmrg	# ever link correctly.  If we're not using GNU ld we use -z text
68198bd17e5fSmrg	# though, which does catch some bad symbols but isn't as heavy-handed
68208bd17e5fSmrg	# as -z defs.
68218bd17e5fSmrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
68228bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
68238bd17e5fSmrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
68248bd17e5fSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
68258bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
68268bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
68278bd17e5fSmrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
68288bd17e5fSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
68298bd17e5fSmrg	runpath_var='LD_RUN_PATH'
68308bd17e5fSmrg
68318bd17e5fSmrg	case $cc_basename in
68328bd17e5fSmrg          CC*)
68338bd17e5fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68348bd17e5fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68358bd17e5fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
68368bd17e5fSmrg	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
68378bd17e5fSmrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
68388bd17e5fSmrg	      '"$_LT_TAGVAR(reload_cmds, $1)"
68398bd17e5fSmrg	    ;;
68408bd17e5fSmrg	  *)
68418bd17e5fSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68428bd17e5fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68438bd17e5fSmrg	    ;;
68448bd17e5fSmrg	esac
68458bd17e5fSmrg      ;;
68460597fb56Smrg
68478bd17e5fSmrg      tandem*)
68488bd17e5fSmrg        case $cc_basename in
68498bd17e5fSmrg          NCC*)
68508bd17e5fSmrg	    # NonStop-UX NCC 3.20
68518bd17e5fSmrg	    # FIXME: insert proper C++ library support
68528bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
68538bd17e5fSmrg	    ;;
68548bd17e5fSmrg          *)
68558bd17e5fSmrg	    # FIXME: insert proper C++ library support
68568bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
68578bd17e5fSmrg	    ;;
68588bd17e5fSmrg        esac
68598bd17e5fSmrg        ;;
68600597fb56Smrg
68618bd17e5fSmrg      vxworks*)
68628bd17e5fSmrg        # FIXME: insert proper C++ library support
68638bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
68648bd17e5fSmrg        ;;
68650597fb56Smrg
68668bd17e5fSmrg      *)
68678bd17e5fSmrg        # FIXME: insert proper C++ library support
68688bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
68698bd17e5fSmrg        ;;
68708bd17e5fSmrg    esac
68710597fb56Smrg
68728bd17e5fSmrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
68738bd17e5fSmrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
68740597fb56Smrg
68758bd17e5fSmrg    _LT_TAGVAR(GCC, $1)="$GXX"
68768bd17e5fSmrg    _LT_TAGVAR(LD, $1)="$LD"
6877b042e37fSmrg
68788bd17e5fSmrg    ## CAVEAT EMPTOR:
68798bd17e5fSmrg    ## There is no encapsulation within the following macros, do not change
68808bd17e5fSmrg    ## the running order or otherwise move them around unless you know exactly
68818bd17e5fSmrg    ## what you are doing...
68828bd17e5fSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
68838bd17e5fSmrg    _LT_COMPILER_PIC($1)
68848bd17e5fSmrg    _LT_COMPILER_C_O($1)
68858bd17e5fSmrg    _LT_COMPILER_FILE_LOCKS($1)
68868bd17e5fSmrg    _LT_LINKER_SHLIBS($1)
68878bd17e5fSmrg    _LT_SYS_DYNAMIC_LINKER($1)
68888bd17e5fSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
6889b042e37fSmrg
68908bd17e5fSmrg    _LT_CONFIG($1)
68918bd17e5fSmrg  fi # test -n "$compiler"
6892b042e37fSmrg
68938bd17e5fSmrg  CC=$lt_save_CC
68948bd17e5fSmrg  CFLAGS=$lt_save_CFLAGS
68958bd17e5fSmrg  LDCXX=$LD
68968bd17e5fSmrg  LD=$lt_save_LD
68978bd17e5fSmrg  GCC=$lt_save_GCC
68988bd17e5fSmrg  with_gnu_ld=$lt_save_with_gnu_ld
68998bd17e5fSmrg  lt_cv_path_LDCXX=$lt_cv_path_LD
69008bd17e5fSmrg  lt_cv_path_LD=$lt_save_path_LD
69018bd17e5fSmrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
69028bd17e5fSmrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
69038bd17e5fSmrgfi # test "$_lt_caught_CXX_error" != yes
6904b042e37fSmrg
69058bd17e5fSmrgAC_LANG_POP
69068bd17e5fSmrg])# _LT_LANG_CXX_CONFIG
6907b042e37fSmrg
6908b042e37fSmrg
69098bd17e5fSmrg# _LT_FUNC_STRIPNAME_CNF
69108bd17e5fSmrg# ----------------------
69118bd17e5fSmrg# func_stripname_cnf prefix suffix name
69128bd17e5fSmrg# strip PREFIX and SUFFIX off of NAME.
69138bd17e5fSmrg# PREFIX and SUFFIX must not contain globbing or regex special
69148bd17e5fSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
69158bd17e5fSmrg# dot (in which case that matches only a dot).
69168bd17e5fSmrg#
69178bd17e5fSmrg# This function is identical to the (non-XSI) version of func_stripname,
69188bd17e5fSmrg# except this one can be used by m4 code that may be executed by configure,
69198bd17e5fSmrg# rather than the libtool script.
69208bd17e5fSmrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
69218bd17e5fSmrgAC_REQUIRE([_LT_DECL_SED])
69228bd17e5fSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
69238bd17e5fSmrgfunc_stripname_cnf ()
69248bd17e5fSmrg{
69258bd17e5fSmrg  case ${2} in
69268bd17e5fSmrg  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
69278bd17e5fSmrg  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
69288bd17e5fSmrg  esac
69298bd17e5fSmrg} # func_stripname_cnf
69308bd17e5fSmrg])# _LT_FUNC_STRIPNAME_CNF
6931b042e37fSmrg
69328bd17e5fSmrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
69338bd17e5fSmrg# ---------------------------------
69348bd17e5fSmrg# Figure out "hidden" library dependencies from verbose
69358bd17e5fSmrg# compiler output when linking a shared library.
69368bd17e5fSmrg# Parse the compiler output and extract the necessary
69378bd17e5fSmrg# objects, libraries and library flags.
69388bd17e5fSmrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
69398bd17e5fSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
69408bd17e5fSmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
69418bd17e5fSmrg# Dependencies to place before and after the object being linked:
69428bd17e5fSmrg_LT_TAGVAR(predep_objects, $1)=
69438bd17e5fSmrg_LT_TAGVAR(postdep_objects, $1)=
69448bd17e5fSmrg_LT_TAGVAR(predeps, $1)=
69458bd17e5fSmrg_LT_TAGVAR(postdeps, $1)=
69468bd17e5fSmrg_LT_TAGVAR(compiler_lib_search_path, $1)=
6947b042e37fSmrg
69488bd17e5fSmrgdnl we can't use the lt_simple_compile_test_code here,
69498bd17e5fSmrgdnl because it contains code intended for an executable,
69508bd17e5fSmrgdnl not a library.  It's possible we should let each
69518bd17e5fSmrgdnl tag define a new lt_????_link_test_code variable,
69528bd17e5fSmrgdnl but it's only used here...
69538bd17e5fSmrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
69548bd17e5fSmrgint a;
69558bd17e5fSmrgvoid foo (void) { a = 0; }
69568bd17e5fSmrg_LT_EOF
69578bd17e5fSmrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
69588bd17e5fSmrgclass Foo
69598bd17e5fSmrg{
69608bd17e5fSmrgpublic:
69618bd17e5fSmrg  Foo (void) { a = 0; }
69628bd17e5fSmrgprivate:
69638bd17e5fSmrg  int a;
69648bd17e5fSmrg};
69658bd17e5fSmrg_LT_EOF
69668bd17e5fSmrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
69678bd17e5fSmrg      subroutine foo
69688bd17e5fSmrg      implicit none
69698bd17e5fSmrg      integer*4 a
69708bd17e5fSmrg      a=0
69718bd17e5fSmrg      return
69728bd17e5fSmrg      end
69738bd17e5fSmrg_LT_EOF
69748bd17e5fSmrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
69758bd17e5fSmrg      subroutine foo
69768bd17e5fSmrg      implicit none
69778bd17e5fSmrg      integer a
69788bd17e5fSmrg      a=0
69798bd17e5fSmrg      return
69808bd17e5fSmrg      end
69818bd17e5fSmrg_LT_EOF
69828bd17e5fSmrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
69838bd17e5fSmrgpublic class foo {
69848bd17e5fSmrg  private int a;
69858bd17e5fSmrg  public void bar (void) {
69868bd17e5fSmrg    a = 0;
69878bd17e5fSmrg  }
69888bd17e5fSmrg};
69898bd17e5fSmrg_LT_EOF
69908bd17e5fSmrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
69918bd17e5fSmrgpackage foo
69928bd17e5fSmrgfunc foo() {
69938bd17e5fSmrg}
69948bd17e5fSmrg_LT_EOF
69958bd17e5fSmrg])
6996b042e37fSmrg
69978bd17e5fSmrg_lt_libdeps_save_CFLAGS=$CFLAGS
69988bd17e5fSmrgcase "$CC $CFLAGS " in #(
69998bd17e5fSmrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
70008bd17e5fSmrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
70018bd17e5fSmrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
70028bd17e5fSmrgesac
7003b042e37fSmrg
70048bd17e5fSmrgdnl Parse the compiler output and extract the necessary
70058bd17e5fSmrgdnl objects, libraries and library flags.
70068bd17e5fSmrgif AC_TRY_EVAL(ac_compile); then
70078bd17e5fSmrg  # Parse the compiler output and extract the necessary
70088bd17e5fSmrg  # objects, libraries and library flags.
7009b042e37fSmrg
70108bd17e5fSmrg  # Sentinel used to keep track of whether or not we are before
70118bd17e5fSmrg  # the conftest object file.
70128bd17e5fSmrg  pre_test_object_deps_done=no
7013b042e37fSmrg
70148bd17e5fSmrg  for p in `eval "$output_verbose_link_cmd"`; do
70158bd17e5fSmrg    case ${prev}${p} in
7016b042e37fSmrg
70178bd17e5fSmrg    -L* | -R* | -l*)
70188bd17e5fSmrg       # Some compilers place space between "-{L,R}" and the path.
70198bd17e5fSmrg       # Remove the space.
70208bd17e5fSmrg       if test $p = "-L" ||
70218bd17e5fSmrg          test $p = "-R"; then
70228bd17e5fSmrg	 prev=$p
70238bd17e5fSmrg	 continue
70248bd17e5fSmrg       fi
70250597fb56Smrg
70268bd17e5fSmrg       # Expand the sysroot to ease extracting the directories later.
70278bd17e5fSmrg       if test -z "$prev"; then
70288bd17e5fSmrg         case $p in
70298bd17e5fSmrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
70308bd17e5fSmrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
70318bd17e5fSmrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
70328bd17e5fSmrg         esac
70338bd17e5fSmrg       fi
70348bd17e5fSmrg       case $p in
70358bd17e5fSmrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
70368bd17e5fSmrg       esac
70378bd17e5fSmrg       if test "$pre_test_object_deps_done" = no; then
70388bd17e5fSmrg	 case ${prev} in
70398bd17e5fSmrg	 -L | -R)
70408bd17e5fSmrg	   # Internal compiler library paths should come after those
70418bd17e5fSmrg	   # provided the user.  The postdeps already come after the
70428bd17e5fSmrg	   # user supplied libs so there is no need to process them.
70438bd17e5fSmrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
70448bd17e5fSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
70458bd17e5fSmrg	   else
70468bd17e5fSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
70478bd17e5fSmrg	   fi
70488bd17e5fSmrg	   ;;
70498bd17e5fSmrg	 # The "-l" case would never come before the object being
70508bd17e5fSmrg	 # linked, so don't bother handling this case.
70518bd17e5fSmrg	 esac
70528bd17e5fSmrg       else
70538bd17e5fSmrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
70548bd17e5fSmrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
70558bd17e5fSmrg	 else
70568bd17e5fSmrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
70578bd17e5fSmrg	 fi
70588bd17e5fSmrg       fi
70598bd17e5fSmrg       prev=
70608bd17e5fSmrg       ;;
70610597fb56Smrg
70628bd17e5fSmrg    *.lto.$objext) ;; # Ignore GCC LTO objects
70638bd17e5fSmrg    *.$objext)
70648bd17e5fSmrg       # This assumes that the test object file only shows up
70658bd17e5fSmrg       # once in the compiler output.
70668bd17e5fSmrg       if test "$p" = "conftest.$objext"; then
70678bd17e5fSmrg	 pre_test_object_deps_done=yes
70688bd17e5fSmrg	 continue
70698bd17e5fSmrg       fi
70700597fb56Smrg
70718bd17e5fSmrg       if test "$pre_test_object_deps_done" = no; then
70728bd17e5fSmrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
70738bd17e5fSmrg	   _LT_TAGVAR(predep_objects, $1)="$p"
70748bd17e5fSmrg	 else
70758bd17e5fSmrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
70768bd17e5fSmrg	 fi
70778bd17e5fSmrg       else
70788bd17e5fSmrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
70798bd17e5fSmrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
70808bd17e5fSmrg	 else
70818bd17e5fSmrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
70828bd17e5fSmrg	 fi
70838bd17e5fSmrg       fi
70848bd17e5fSmrg       ;;
70850597fb56Smrg
70868bd17e5fSmrg    *) ;; # Ignore the rest.
70870597fb56Smrg
70880597fb56Smrg    esac
70898bd17e5fSmrg  done
70908bd17e5fSmrg
70918bd17e5fSmrg  # Clean up.
70928bd17e5fSmrg  rm -f a.out a.exe
70938bd17e5fSmrgelse
70948bd17e5fSmrg  echo "libtool.m4: error: problem compiling $1 test program"
70958bd17e5fSmrgfi
70968bd17e5fSmrg
70978bd17e5fSmrg$RM -f confest.$objext
70988bd17e5fSmrgCFLAGS=$_lt_libdeps_save_CFLAGS
70998bd17e5fSmrg
71008bd17e5fSmrg# PORTME: override above test on systems where it is broken
71018bd17e5fSmrgm4_if([$1], [CXX],
71028bd17e5fSmrg[case $host_os in
71038bd17e5fSmrginterix[[3-9]]*)
71048bd17e5fSmrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
71058bd17e5fSmrg  # hack all around it, let's just trust "g++" to DTRT.
71068bd17e5fSmrg  _LT_TAGVAR(predep_objects,$1)=
71078bd17e5fSmrg  _LT_TAGVAR(postdep_objects,$1)=
71088bd17e5fSmrg  _LT_TAGVAR(postdeps,$1)=
71098bd17e5fSmrg  ;;
71108bd17e5fSmrg
71118bd17e5fSmrglinux*)
71128bd17e5fSmrg  case `$CC -V 2>&1 | sed 5q` in
71138bd17e5fSmrg  *Sun\ C*)
71148bd17e5fSmrg    # Sun C++ 5.9
71158bd17e5fSmrg
71168bd17e5fSmrg    # The more standards-conforming stlport4 library is
71178bd17e5fSmrg    # incompatible with the Cstd library. Avoid specifying
71188bd17e5fSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
71198bd17e5fSmrg    # -library=stlport4 depends on it.
71208bd17e5fSmrg    case " $CXX $CXXFLAGS " in
71218bd17e5fSmrg    *" -library=stlport4 "*)
71228bd17e5fSmrg      solaris_use_stlport4=yes
71238bd17e5fSmrg      ;;
71240597fb56Smrg    esac
71258bd17e5fSmrg
71268bd17e5fSmrg    if test "$solaris_use_stlport4" != yes; then
71278bd17e5fSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
71288bd17e5fSmrg    fi
7129706b6b52Smrg    ;;
71308bd17e5fSmrg  esac
71318bd17e5fSmrg  ;;
7132b042e37fSmrg
71338bd17e5fSmrgsolaris*)
71348bd17e5fSmrg  case $cc_basename in
71358bd17e5fSmrg  CC* | sunCC*)
71368bd17e5fSmrg    # The more standards-conforming stlport4 library is
71378bd17e5fSmrg    # incompatible with the Cstd library. Avoid specifying
71388bd17e5fSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
71398bd17e5fSmrg    # -library=stlport4 depends on it.
71408bd17e5fSmrg    case " $CXX $CXXFLAGS " in
71418bd17e5fSmrg    *" -library=stlport4 "*)
71428bd17e5fSmrg      solaris_use_stlport4=yes
71438bd17e5fSmrg      ;;
71440597fb56Smrg    esac
71458bd17e5fSmrg
71468bd17e5fSmrg    # Adding this requires a known-good setup of shared libraries for
71478bd17e5fSmrg    # Sun compiler versions before 5.6, else PIC objects from an old
71488bd17e5fSmrg    # archive will be linked into the output, leading to subtle bugs.
71498bd17e5fSmrg    if test "$solaris_use_stlport4" != yes; then
71508bd17e5fSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
71518bd17e5fSmrg    fi
71520597fb56Smrg    ;;
71538bd17e5fSmrg  esac
71548bd17e5fSmrg  ;;
71550597fb56Smrgesac
71560597fb56Smrg])
7157b042e37fSmrg
71588bd17e5fSmrgcase " $_LT_TAGVAR(postdeps, $1) " in
71598bd17e5fSmrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
71608bd17e5fSmrgesac
71618bd17e5fSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
71628bd17e5fSmrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
71638bd17e5fSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
71648bd17e5fSmrgfi
71658bd17e5fSmrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
71668bd17e5fSmrg    [The directories searched by this compiler when creating a shared library])
71678bd17e5fSmrg_LT_TAGDECL([], [predep_objects], [1],
71688bd17e5fSmrg    [Dependencies to place before and after the objects being linked to
71698bd17e5fSmrg    create a shared library])
71708bd17e5fSmrg_LT_TAGDECL([], [postdep_objects], [1])
71718bd17e5fSmrg_LT_TAGDECL([], [predeps], [1])
71728bd17e5fSmrg_LT_TAGDECL([], [postdeps], [1])
71738bd17e5fSmrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
71748bd17e5fSmrg    [The library search path used internally by the compiler when linking
71758bd17e5fSmrg    a shared library])
71768bd17e5fSmrg])# _LT_SYS_HIDDEN_LIBDEPS
71778c4a8e55Smrg
71788c4a8e55Smrg
71798bd17e5fSmrg# _LT_LANG_F77_CONFIG([TAG])
71808bd17e5fSmrg# --------------------------
71818bd17e5fSmrg# Ensure that the configuration variables for a Fortran 77 compiler are
71828bd17e5fSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
71838bd17e5fSmrg# to write the compiler configuration to `libtool'.
71848bd17e5fSmrgm4_defun([_LT_LANG_F77_CONFIG],
71858bd17e5fSmrg[AC_LANG_PUSH(Fortran 77)
71868bd17e5fSmrgif test -z "$F77" || test "X$F77" = "Xno"; then
71878bd17e5fSmrg  _lt_disable_F77=yes
71888bd17e5fSmrgfi
7189b042e37fSmrg
71908bd17e5fSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
71918bd17e5fSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
71928bd17e5fSmrg_LT_TAGVAR(always_export_symbols, $1)=no
71938bd17e5fSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
71948bd17e5fSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
71958bd17e5fSmrg_LT_TAGVAR(hardcode_direct, $1)=no
71968bd17e5fSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
71978bd17e5fSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
71988bd17e5fSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
71998bd17e5fSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
72008bd17e5fSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
72018bd17e5fSmrg_LT_TAGVAR(inherit_rpath, $1)=no
72028bd17e5fSmrg_LT_TAGVAR(module_cmds, $1)=
72038bd17e5fSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
72048bd17e5fSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
72058bd17e5fSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
72068bd17e5fSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
72078bd17e5fSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
72088bd17e5fSmrg_LT_TAGVAR(no_undefined_flag, $1)=
72098bd17e5fSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
72108bd17e5fSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7211b042e37fSmrg
72128bd17e5fSmrg# Source file extension for f77 test sources.
72138bd17e5fSmrgac_ext=f
7214b042e37fSmrg
72158bd17e5fSmrg# Object file extension for compiled f77 test sources.
72168bd17e5fSmrgobjext=o
72178bd17e5fSmrg_LT_TAGVAR(objext, $1)=$objext
72188c4a8e55Smrg
72198bd17e5fSmrg# No sense in running all these tests if we already determined that
72208bd17e5fSmrg# the F77 compiler isn't working.  Some variables (like enable_shared)
72218bd17e5fSmrg# are currently assumed to apply to all compilers on this platform,
72228bd17e5fSmrg# and will be corrupted by setting them based on a non-working compiler.
72238bd17e5fSmrgif test "$_lt_disable_F77" != yes; then
72248bd17e5fSmrg  # Code to be used in simple compile tests
72258bd17e5fSmrg  lt_simple_compile_test_code="\
72268bd17e5fSmrg      subroutine t
72278bd17e5fSmrg      return
72288bd17e5fSmrg      end
72298bd17e5fSmrg"
72308c4a8e55Smrg
72318bd17e5fSmrg  # Code to be used in simple link tests
72328bd17e5fSmrg  lt_simple_link_test_code="\
72338bd17e5fSmrg      program t
72348bd17e5fSmrg      end
72358bd17e5fSmrg"
72368c4a8e55Smrg
72378bd17e5fSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
72388bd17e5fSmrg  _LT_TAG_COMPILER
7239b042e37fSmrg
72408bd17e5fSmrg  # save warnings/boilerplate of simple test code
72418bd17e5fSmrg  _LT_COMPILER_BOILERPLATE
72428bd17e5fSmrg  _LT_LINKER_BOILERPLATE
7243b042e37fSmrg
72448bd17e5fSmrg  # Allow CC to be a program name with arguments.
72458bd17e5fSmrg  lt_save_CC="$CC"
72468bd17e5fSmrg  lt_save_GCC=$GCC
72478bd17e5fSmrg  lt_save_CFLAGS=$CFLAGS
72488bd17e5fSmrg  CC=${F77-"f77"}
72498bd17e5fSmrg  CFLAGS=$FFLAGS
72508bd17e5fSmrg  compiler=$CC
72518bd17e5fSmrg  _LT_TAGVAR(compiler, $1)=$CC
72528bd17e5fSmrg  _LT_CC_BASENAME([$compiler])
72538bd17e5fSmrg  GCC=$G77
72548bd17e5fSmrg  if test -n "$compiler"; then
72558bd17e5fSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
72568bd17e5fSmrg    AC_MSG_RESULT([$can_build_shared])
72578c4a8e55Smrg
72588bd17e5fSmrg    AC_MSG_CHECKING([whether to build shared libraries])
72598bd17e5fSmrg    test "$can_build_shared" = "no" && enable_shared=no
7260b042e37fSmrg
72618bd17e5fSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
72628bd17e5fSmrg    # are all built from PIC.
72638bd17e5fSmrg    case $host_os in
72648bd17e5fSmrg      aix3*)
72658bd17e5fSmrg        test "$enable_shared" = yes && enable_static=no
72668bd17e5fSmrg        if test -n "$RANLIB"; then
72678bd17e5fSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
72688bd17e5fSmrg          postinstall_cmds='$RANLIB $lib'
72698bd17e5fSmrg        fi
72708bd17e5fSmrg        ;;
72718bd17e5fSmrg      aix[[4-9]]*)
72728bd17e5fSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
72738bd17e5fSmrg	  test "$enable_shared" = yes && enable_static=no
72748bd17e5fSmrg	fi
72758bd17e5fSmrg        ;;
72768bd17e5fSmrg    esac
72778bd17e5fSmrg    AC_MSG_RESULT([$enable_shared])
7278b042e37fSmrg
72798bd17e5fSmrg    AC_MSG_CHECKING([whether to build static libraries])
72808bd17e5fSmrg    # Make sure either enable_shared or enable_static is yes.
72818bd17e5fSmrg    test "$enable_shared" = yes || enable_static=yes
72828bd17e5fSmrg    AC_MSG_RESULT([$enable_static])
7283b042e37fSmrg
72848bd17e5fSmrg    _LT_TAGVAR(GCC, $1)="$G77"
72858bd17e5fSmrg    _LT_TAGVAR(LD, $1)="$LD"
7286b042e37fSmrg
72878bd17e5fSmrg    ## CAVEAT EMPTOR:
72888bd17e5fSmrg    ## There is no encapsulation within the following macros, do not change
72898bd17e5fSmrg    ## the running order or otherwise move them around unless you know exactly
72908bd17e5fSmrg    ## what you are doing...
72918bd17e5fSmrg    _LT_COMPILER_PIC($1)
72928bd17e5fSmrg    _LT_COMPILER_C_O($1)
72938bd17e5fSmrg    _LT_COMPILER_FILE_LOCKS($1)
72948bd17e5fSmrg    _LT_LINKER_SHLIBS($1)
72958bd17e5fSmrg    _LT_SYS_DYNAMIC_LINKER($1)
72968bd17e5fSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7297b042e37fSmrg
72988bd17e5fSmrg    _LT_CONFIG($1)
72998bd17e5fSmrg  fi # test -n "$compiler"
7300b042e37fSmrg
73018bd17e5fSmrg  GCC=$lt_save_GCC
73028bd17e5fSmrg  CC="$lt_save_CC"
73038bd17e5fSmrg  CFLAGS="$lt_save_CFLAGS"
73048bd17e5fSmrgfi # test "$_lt_disable_F77" != yes
7305b042e37fSmrg
73068bd17e5fSmrgAC_LANG_POP
73078bd17e5fSmrg])# _LT_LANG_F77_CONFIG
7308706b6b52Smrg
7309706b6b52Smrg
73108bd17e5fSmrg# _LT_LANG_FC_CONFIG([TAG])
73118bd17e5fSmrg# -------------------------
73128bd17e5fSmrg# Ensure that the configuration variables for a Fortran compiler are
73138bd17e5fSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
73148bd17e5fSmrg# to write the compiler configuration to `libtool'.
73158bd17e5fSmrgm4_defun([_LT_LANG_FC_CONFIG],
73168bd17e5fSmrg[AC_LANG_PUSH(Fortran)
7317706b6b52Smrg
73188bd17e5fSmrgif test -z "$FC" || test "X$FC" = "Xno"; then
73198bd17e5fSmrg  _lt_disable_FC=yes
73208bd17e5fSmrgfi
7321706b6b52Smrg
73228bd17e5fSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
73238bd17e5fSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
73248bd17e5fSmrg_LT_TAGVAR(always_export_symbols, $1)=no
73258bd17e5fSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
73268bd17e5fSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
73278bd17e5fSmrg_LT_TAGVAR(hardcode_direct, $1)=no
73288bd17e5fSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
73298bd17e5fSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
73308bd17e5fSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
73318bd17e5fSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
73328bd17e5fSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
73338bd17e5fSmrg_LT_TAGVAR(inherit_rpath, $1)=no
73348bd17e5fSmrg_LT_TAGVAR(module_cmds, $1)=
73358bd17e5fSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
73368bd17e5fSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
73378bd17e5fSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
73388bd17e5fSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
73398bd17e5fSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
73408bd17e5fSmrg_LT_TAGVAR(no_undefined_flag, $1)=
73418bd17e5fSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
73428bd17e5fSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7343b042e37fSmrg
73448bd17e5fSmrg# Source file extension for fc test sources.
73458bd17e5fSmrgac_ext=${ac_fc_srcext-f}
73468c4a8e55Smrg
73478bd17e5fSmrg# Object file extension for compiled fc test sources.
73488bd17e5fSmrgobjext=o
73498bd17e5fSmrg_LT_TAGVAR(objext, $1)=$objext
73508c4a8e55Smrg
73518bd17e5fSmrg# No sense in running all these tests if we already determined that
73528bd17e5fSmrg# the FC compiler isn't working.  Some variables (like enable_shared)
73538bd17e5fSmrg# are currently assumed to apply to all compilers on this platform,
73548bd17e5fSmrg# and will be corrupted by setting them based on a non-working compiler.
73558bd17e5fSmrgif test "$_lt_disable_FC" != yes; then
73568bd17e5fSmrg  # Code to be used in simple compile tests
73578bd17e5fSmrg  lt_simple_compile_test_code="\
73588bd17e5fSmrg      subroutine t
73598bd17e5fSmrg      return
73608bd17e5fSmrg      end
73618bd17e5fSmrg"
7362b042e37fSmrg
73638bd17e5fSmrg  # Code to be used in simple link tests
73648bd17e5fSmrg  lt_simple_link_test_code="\
73658bd17e5fSmrg      program t
73668bd17e5fSmrg      end
73678bd17e5fSmrg"
7368b042e37fSmrg
73698bd17e5fSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
73708bd17e5fSmrg  _LT_TAG_COMPILER
73718c4a8e55Smrg
73728bd17e5fSmrg  # save warnings/boilerplate of simple test code
73738bd17e5fSmrg  _LT_COMPILER_BOILERPLATE
73748bd17e5fSmrg  _LT_LINKER_BOILERPLATE
7375b042e37fSmrg
73768bd17e5fSmrg  # Allow CC to be a program name with arguments.
73778bd17e5fSmrg  lt_save_CC="$CC"
73788bd17e5fSmrg  lt_save_GCC=$GCC
73798bd17e5fSmrg  lt_save_CFLAGS=$CFLAGS
73808bd17e5fSmrg  CC=${FC-"f95"}
73818bd17e5fSmrg  CFLAGS=$FCFLAGS
73828bd17e5fSmrg  compiler=$CC
73838bd17e5fSmrg  GCC=$ac_cv_fc_compiler_gnu
7384b042e37fSmrg
73858bd17e5fSmrg  _LT_TAGVAR(compiler, $1)=$CC
73868bd17e5fSmrg  _LT_CC_BASENAME([$compiler])
7387bd23fbfaSmrg
73888bd17e5fSmrg  if test -n "$compiler"; then
73898bd17e5fSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
73908bd17e5fSmrg    AC_MSG_RESULT([$can_build_shared])
73918bd17e5fSmrg
73928bd17e5fSmrg    AC_MSG_CHECKING([whether to build shared libraries])
73938bd17e5fSmrg    test "$can_build_shared" = "no" && enable_shared=no
73948bd17e5fSmrg
73958bd17e5fSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
73968bd17e5fSmrg    # are all built from PIC.
73978bd17e5fSmrg    case $host_os in
73988bd17e5fSmrg      aix3*)
73998bd17e5fSmrg        test "$enable_shared" = yes && enable_static=no
74008bd17e5fSmrg        if test -n "$RANLIB"; then
74018bd17e5fSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
74028bd17e5fSmrg          postinstall_cmds='$RANLIB $lib'
74038bd17e5fSmrg        fi
74048bd17e5fSmrg        ;;
74058bd17e5fSmrg      aix[[4-9]]*)
74068bd17e5fSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
74078bd17e5fSmrg	  test "$enable_shared" = yes && enable_static=no
74080597fb56Smrg	fi
74098bd17e5fSmrg        ;;
74108bd17e5fSmrg    esac
74118bd17e5fSmrg    AC_MSG_RESULT([$enable_shared])
74120597fb56Smrg
74138bd17e5fSmrg    AC_MSG_CHECKING([whether to build static libraries])
74148bd17e5fSmrg    # Make sure either enable_shared or enable_static is yes.
74158bd17e5fSmrg    test "$enable_shared" = yes || enable_static=yes
74168bd17e5fSmrg    AC_MSG_RESULT([$enable_static])
7417b042e37fSmrg
74188bd17e5fSmrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
74198bd17e5fSmrg    _LT_TAGVAR(LD, $1)="$LD"
7420b042e37fSmrg
74218bd17e5fSmrg    ## CAVEAT EMPTOR:
74228bd17e5fSmrg    ## There is no encapsulation within the following macros, do not change
74238bd17e5fSmrg    ## the running order or otherwise move them around unless you know exactly
74248bd17e5fSmrg    ## what you are doing...
74258bd17e5fSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
74268bd17e5fSmrg    _LT_COMPILER_PIC($1)
74278bd17e5fSmrg    _LT_COMPILER_C_O($1)
74288bd17e5fSmrg    _LT_COMPILER_FILE_LOCKS($1)
74298bd17e5fSmrg    _LT_LINKER_SHLIBS($1)
74308bd17e5fSmrg    _LT_SYS_DYNAMIC_LINKER($1)
74318bd17e5fSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7432b042e37fSmrg
74338bd17e5fSmrg    _LT_CONFIG($1)
74348bd17e5fSmrg  fi # test -n "$compiler"
7435b042e37fSmrg
74368bd17e5fSmrg  GCC=$lt_save_GCC
74378bd17e5fSmrg  CC=$lt_save_CC
74388bd17e5fSmrg  CFLAGS=$lt_save_CFLAGS
74398bd17e5fSmrgfi # test "$_lt_disable_FC" != yes
7440b042e37fSmrg
74418bd17e5fSmrgAC_LANG_POP
74428bd17e5fSmrg])# _LT_LANG_FC_CONFIG
74438bd17e5fSmrg
74448bd17e5fSmrg
74458bd17e5fSmrg# _LT_LANG_GCJ_CONFIG([TAG])
74468bd17e5fSmrg# --------------------------
74478bd17e5fSmrg# Ensure that the configuration variables for the GNU Java Compiler compiler
74488bd17e5fSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
74498bd17e5fSmrg# to write the compiler configuration to `libtool'.
74508bd17e5fSmrgm4_defun([_LT_LANG_GCJ_CONFIG],
74518bd17e5fSmrg[AC_REQUIRE([LT_PROG_GCJ])dnl
74528bd17e5fSmrgAC_LANG_SAVE
7453b042e37fSmrg
74548bd17e5fSmrg# Source file extension for Java test sources.
74558bd17e5fSmrgac_ext=java
7456706b6b52Smrg
74578bd17e5fSmrg# Object file extension for compiled Java test sources.
74588bd17e5fSmrgobjext=o
74598bd17e5fSmrg_LT_TAGVAR(objext, $1)=$objext
7460b042e37fSmrg
74618bd17e5fSmrg# Code to be used in simple compile tests
74628bd17e5fSmrglt_simple_compile_test_code="class foo {}"
7463b042e37fSmrg
74648bd17e5fSmrg# Code to be used in simple link tests
74658bd17e5fSmrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
7466b042e37fSmrg
74678bd17e5fSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
74688bd17e5fSmrg_LT_TAG_COMPILER
7469b042e37fSmrg
74708bd17e5fSmrg# save warnings/boilerplate of simple test code
74718bd17e5fSmrg_LT_COMPILER_BOILERPLATE
74728bd17e5fSmrg_LT_LINKER_BOILERPLATE
7473b042e37fSmrg
74748bd17e5fSmrg# Allow CC to be a program name with arguments.
74758bd17e5fSmrglt_save_CC=$CC
74768bd17e5fSmrglt_save_CFLAGS=$CFLAGS
74778bd17e5fSmrglt_save_GCC=$GCC
74788bd17e5fSmrgGCC=yes
74798bd17e5fSmrgCC=${GCJ-"gcj"}
74808bd17e5fSmrgCFLAGS=$GCJFLAGS
74818bd17e5fSmrgcompiler=$CC
74828bd17e5fSmrg_LT_TAGVAR(compiler, $1)=$CC
74838bd17e5fSmrg_LT_TAGVAR(LD, $1)="$LD"
74848bd17e5fSmrg_LT_CC_BASENAME([$compiler])
74850597fb56Smrg
74868bd17e5fSmrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
74878bd17e5fSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7488b042e37fSmrg
74898bd17e5fSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
74908bd17e5fSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
74918bd17e5fSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7492b042e37fSmrg
74938bd17e5fSmrgif test -n "$compiler"; then
74948bd17e5fSmrg  _LT_COMPILER_NO_RTTI($1)
74958bd17e5fSmrg  _LT_COMPILER_PIC($1)
74968bd17e5fSmrg  _LT_COMPILER_C_O($1)
74978bd17e5fSmrg  _LT_COMPILER_FILE_LOCKS($1)
74988bd17e5fSmrg  _LT_LINKER_SHLIBS($1)
74998bd17e5fSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
7500b042e37fSmrg
75018bd17e5fSmrg  _LT_CONFIG($1)
75028bd17e5fSmrgfi
7503b042e37fSmrg
75048bd17e5fSmrgAC_LANG_RESTORE
7505706b6b52Smrg
75068bd17e5fSmrgGCC=$lt_save_GCC
75078bd17e5fSmrgCC=$lt_save_CC
75088bd17e5fSmrgCFLAGS=$lt_save_CFLAGS
75098bd17e5fSmrg])# _LT_LANG_GCJ_CONFIG
7510b042e37fSmrg
7511b042e37fSmrg
75128bd17e5fSmrg# _LT_LANG_GO_CONFIG([TAG])
75138bd17e5fSmrg# --------------------------
75148bd17e5fSmrg# Ensure that the configuration variables for the GNU Go compiler
75158bd17e5fSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
75168bd17e5fSmrg# to write the compiler configuration to `libtool'.
75178bd17e5fSmrgm4_defun([_LT_LANG_GO_CONFIG],
75188bd17e5fSmrg[AC_REQUIRE([LT_PROG_GO])dnl
75198bd17e5fSmrgAC_LANG_SAVE
75208c4a8e55Smrg
75218bd17e5fSmrg# Source file extension for Go test sources.
75228bd17e5fSmrgac_ext=go
75238c4a8e55Smrg
75248bd17e5fSmrg# Object file extension for compiled Go test sources.
75258bd17e5fSmrgobjext=o
75268bd17e5fSmrg_LT_TAGVAR(objext, $1)=$objext
7527b042e37fSmrg
75288bd17e5fSmrg# Code to be used in simple compile tests
75298bd17e5fSmrglt_simple_compile_test_code="package main; func main() { }"
7530b042e37fSmrg
75318bd17e5fSmrg# Code to be used in simple link tests
75328bd17e5fSmrglt_simple_link_test_code='package main; func main() { }'
75338c4a8e55Smrg
75348bd17e5fSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
75358bd17e5fSmrg_LT_TAG_COMPILER
7536b042e37fSmrg
75378bd17e5fSmrg# save warnings/boilerplate of simple test code
75388bd17e5fSmrg_LT_COMPILER_BOILERPLATE
75398bd17e5fSmrg_LT_LINKER_BOILERPLATE
75400597fb56Smrg
75418bd17e5fSmrg# Allow CC to be a program name with arguments.
75428bd17e5fSmrglt_save_CC=$CC
75438bd17e5fSmrglt_save_CFLAGS=$CFLAGS
75448bd17e5fSmrglt_save_GCC=$GCC
75458bd17e5fSmrgGCC=yes
75468bd17e5fSmrgCC=${GOC-"gccgo"}
75478bd17e5fSmrgCFLAGS=$GOFLAGS
75488bd17e5fSmrgcompiler=$CC
75498bd17e5fSmrg_LT_TAGVAR(compiler, $1)=$CC
75508bd17e5fSmrg_LT_TAGVAR(LD, $1)="$LD"
75518bd17e5fSmrg_LT_CC_BASENAME([$compiler])
75520597fb56Smrg
75538bd17e5fSmrg# Go did not exist at the time GCC didn't implicitly link libc in.
75548bd17e5fSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7555b042e37fSmrg
75568bd17e5fSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
75578bd17e5fSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
75588bd17e5fSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7559b042e37fSmrg
75608bd17e5fSmrgif test -n "$compiler"; then
75618bd17e5fSmrg  _LT_COMPILER_NO_RTTI($1)
75628bd17e5fSmrg  _LT_COMPILER_PIC($1)
75638bd17e5fSmrg  _LT_COMPILER_C_O($1)
75648bd17e5fSmrg  _LT_COMPILER_FILE_LOCKS($1)
75658bd17e5fSmrg  _LT_LINKER_SHLIBS($1)
75668bd17e5fSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
7567b042e37fSmrg
75688bd17e5fSmrg  _LT_CONFIG($1)
75698bd17e5fSmrgfi
7570b042e37fSmrg
75718bd17e5fSmrgAC_LANG_RESTORE
7572b042e37fSmrg
75738bd17e5fSmrgGCC=$lt_save_GCC
75748bd17e5fSmrgCC=$lt_save_CC
75758bd17e5fSmrgCFLAGS=$lt_save_CFLAGS
75768bd17e5fSmrg])# _LT_LANG_GO_CONFIG
7577b042e37fSmrg
7578b042e37fSmrg
75798bd17e5fSmrg# _LT_LANG_RC_CONFIG([TAG])
75808bd17e5fSmrg# -------------------------
75818bd17e5fSmrg# Ensure that the configuration variables for the Windows resource compiler
75828bd17e5fSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
75838bd17e5fSmrg# to write the compiler configuration to `libtool'.
75848bd17e5fSmrgm4_defun([_LT_LANG_RC_CONFIG],
75858bd17e5fSmrg[AC_REQUIRE([LT_PROG_RC])dnl
75868bd17e5fSmrgAC_LANG_SAVE
7587b042e37fSmrg
75888bd17e5fSmrg# Source file extension for RC test sources.
75898bd17e5fSmrgac_ext=rc
7590b042e37fSmrg
75918bd17e5fSmrg# Object file extension for compiled RC test sources.
75928bd17e5fSmrgobjext=o
75938bd17e5fSmrg_LT_TAGVAR(objext, $1)=$objext
7594b042e37fSmrg
75958bd17e5fSmrg# Code to be used in simple compile tests
75968bd17e5fSmrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
7597b042e37fSmrg
75988bd17e5fSmrg# Code to be used in simple link tests
75998bd17e5fSmrglt_simple_link_test_code="$lt_simple_compile_test_code"
7600b042e37fSmrg
76018bd17e5fSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
76028bd17e5fSmrg_LT_TAG_COMPILER
7603b042e37fSmrg
76048bd17e5fSmrg# save warnings/boilerplate of simple test code
76058bd17e5fSmrg_LT_COMPILER_BOILERPLATE
76068bd17e5fSmrg_LT_LINKER_BOILERPLATE
7607b042e37fSmrg
76088bd17e5fSmrg# Allow CC to be a program name with arguments.
76098bd17e5fSmrglt_save_CC="$CC"
76108bd17e5fSmrglt_save_CFLAGS=$CFLAGS
76118bd17e5fSmrglt_save_GCC=$GCC
76128bd17e5fSmrgGCC=
76138bd17e5fSmrgCC=${RC-"windres"}
76148bd17e5fSmrgCFLAGS=
76158bd17e5fSmrgcompiler=$CC
76168bd17e5fSmrg_LT_TAGVAR(compiler, $1)=$CC
76178bd17e5fSmrg_LT_CC_BASENAME([$compiler])
76188bd17e5fSmrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
7619b042e37fSmrg
76208bd17e5fSmrgif test -n "$compiler"; then
76218bd17e5fSmrg  :
76228bd17e5fSmrg  _LT_CONFIG($1)
76238bd17e5fSmrgfi
7624b042e37fSmrg
76258bd17e5fSmrgGCC=$lt_save_GCC
76268bd17e5fSmrgAC_LANG_RESTORE
76278bd17e5fSmrgCC=$lt_save_CC
76288bd17e5fSmrgCFLAGS=$lt_save_CFLAGS
76298bd17e5fSmrg])# _LT_LANG_RC_CONFIG
7630b042e37fSmrg
7631b042e37fSmrg
76328bd17e5fSmrg# LT_PROG_GCJ
76338bd17e5fSmrg# -----------
76348bd17e5fSmrgAC_DEFUN([LT_PROG_GCJ],
76358bd17e5fSmrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
76368bd17e5fSmrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
76378bd17e5fSmrg    [AC_CHECK_TOOL(GCJ, gcj,)
76388bd17e5fSmrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
76398bd17e5fSmrg      AC_SUBST(GCJFLAGS)])])[]dnl
76408bd17e5fSmrg])
7641b042e37fSmrg
76428bd17e5fSmrg# Old name:
76438bd17e5fSmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
76448bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
76458bd17e5fSmrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
7646b042e37fSmrg
76470597fb56Smrg
76488bd17e5fSmrg# LT_PROG_GO
76498bd17e5fSmrg# ----------
76508bd17e5fSmrgAC_DEFUN([LT_PROG_GO],
76518bd17e5fSmrg[AC_CHECK_TOOL(GOC, gccgo,)
76528bd17e5fSmrg])
7653b042e37fSmrg
76548c4a8e55Smrg
76558bd17e5fSmrg# LT_PROG_RC
76568bd17e5fSmrg# ----------
76578bd17e5fSmrgAC_DEFUN([LT_PROG_RC],
76588bd17e5fSmrg[AC_CHECK_TOOL(RC, windres,)
76598bd17e5fSmrg])
7660b042e37fSmrg
76618bd17e5fSmrg# Old name:
76628bd17e5fSmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
76638bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
76648bd17e5fSmrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
7665b042e37fSmrg
7666b042e37fSmrg
76678bd17e5fSmrg# _LT_DECL_EGREP
76688bd17e5fSmrg# --------------
76698bd17e5fSmrg# If we don't have a new enough Autoconf to choose the best grep
76708bd17e5fSmrg# available, choose the one first in the user's PATH.
76718bd17e5fSmrgm4_defun([_LT_DECL_EGREP],
76728bd17e5fSmrg[AC_REQUIRE([AC_PROG_EGREP])dnl
76738bd17e5fSmrgAC_REQUIRE([AC_PROG_FGREP])dnl
76748bd17e5fSmrgtest -z "$GREP" && GREP=grep
76758bd17e5fSmrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
76768bd17e5fSmrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
76778bd17e5fSmrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
76788bd17e5fSmrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
76798bd17e5fSmrgAC_SUBST([GREP])
76808bd17e5fSmrg])
7681b042e37fSmrg
7682b042e37fSmrg
76838bd17e5fSmrg# _LT_DECL_OBJDUMP
76848bd17e5fSmrg# --------------
76858bd17e5fSmrg# If we don't have a new enough Autoconf to choose the best objdump
76868bd17e5fSmrg# available, choose the one first in the user's PATH.
76878bd17e5fSmrgm4_defun([_LT_DECL_OBJDUMP],
76888bd17e5fSmrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
76898bd17e5fSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
76908bd17e5fSmrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
76918bd17e5fSmrgAC_SUBST([OBJDUMP])
76920597fb56Smrg])
7693b042e37fSmrg
76948bd17e5fSmrg# _LT_DECL_DLLTOOL
76958bd17e5fSmrg# ----------------
76968bd17e5fSmrg# Ensure DLLTOOL variable is set.
76978bd17e5fSmrgm4_defun([_LT_DECL_DLLTOOL],
76988bd17e5fSmrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
76998bd17e5fSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
77008bd17e5fSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
77018bd17e5fSmrgAC_SUBST([DLLTOOL])
77028bd17e5fSmrg])
7703b042e37fSmrg
77048bd17e5fSmrg# _LT_DECL_SED
77058bd17e5fSmrg# ------------
77068bd17e5fSmrg# Check for a fully-functional sed program, that truncates
77078bd17e5fSmrg# as few characters as possible.  Prefer GNU sed if found.
77088bd17e5fSmrgm4_defun([_LT_DECL_SED],
77098bd17e5fSmrg[AC_PROG_SED
77108bd17e5fSmrgtest -z "$SED" && SED=sed
77118bd17e5fSmrgXsed="$SED -e 1s/^X//"
77128bd17e5fSmrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
77138bd17e5fSmrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
77148bd17e5fSmrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
77158bd17e5fSmrg])# _LT_DECL_SED
7716b042e37fSmrg
77178bd17e5fSmrgm4_ifndef([AC_PROG_SED], [
77188bd17e5fSmrg# NOTE: This macro has been submitted for inclusion into   #
77198bd17e5fSmrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
77208bd17e5fSmrg#  a released version of Autoconf we should remove this    #
77218bd17e5fSmrg#  macro and use it instead.                               #
7722b042e37fSmrg
77238bd17e5fSmrgm4_defun([AC_PROG_SED],
77248bd17e5fSmrg[AC_MSG_CHECKING([for a sed that does not truncate output])
77258bd17e5fSmrgAC_CACHE_VAL(lt_cv_path_SED,
77268bd17e5fSmrg[# Loop through the user's path and test for sed and gsed.
77278bd17e5fSmrg# Then use that list of sed's as ones to test for truncation.
77288bd17e5fSmrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
77298bd17e5fSmrgfor as_dir in $PATH
77308bd17e5fSmrgdo
77318bd17e5fSmrg  IFS=$as_save_IFS
77328bd17e5fSmrg  test -z "$as_dir" && as_dir=.
77338bd17e5fSmrg  for lt_ac_prog in sed gsed; do
77348bd17e5fSmrg    for ac_exec_ext in '' $ac_executable_extensions; do
77358bd17e5fSmrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
77368bd17e5fSmrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
77378bd17e5fSmrg      fi
77388bd17e5fSmrg    done
77398bd17e5fSmrg  done
77408bd17e5fSmrgdone
77418bd17e5fSmrgIFS=$as_save_IFS
77428bd17e5fSmrglt_ac_max=0
77438bd17e5fSmrglt_ac_count=0
77448bd17e5fSmrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
77458bd17e5fSmrg# along with /bin/sed that truncates output.
77468bd17e5fSmrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
77478bd17e5fSmrg  test ! -f $lt_ac_sed && continue
77488bd17e5fSmrg  cat /dev/null > conftest.in
77498bd17e5fSmrg  lt_ac_count=0
77508bd17e5fSmrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
77518bd17e5fSmrg  # Check for GNU sed and select it if it is found.
77528bd17e5fSmrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
77538bd17e5fSmrg    lt_cv_path_SED=$lt_ac_sed
77548bd17e5fSmrg    break
77558bd17e5fSmrg  fi
77568bd17e5fSmrg  while true; do
77578bd17e5fSmrg    cat conftest.in conftest.in >conftest.tmp
77588bd17e5fSmrg    mv conftest.tmp conftest.in
77598bd17e5fSmrg    cp conftest.in conftest.nl
77608bd17e5fSmrg    echo >>conftest.nl
77618bd17e5fSmrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
77628bd17e5fSmrg    cmp -s conftest.out conftest.nl || break
77638bd17e5fSmrg    # 10000 chars as input seems more than enough
77648bd17e5fSmrg    test $lt_ac_count -gt 10 && break
77658bd17e5fSmrg    lt_ac_count=`expr $lt_ac_count + 1`
77668bd17e5fSmrg    if test $lt_ac_count -gt $lt_ac_max; then
77678bd17e5fSmrg      lt_ac_max=$lt_ac_count
77688bd17e5fSmrg      lt_cv_path_SED=$lt_ac_sed
77698bd17e5fSmrg    fi
77708bd17e5fSmrg  done
77718bd17e5fSmrgdone
77720597fb56Smrg])
77738bd17e5fSmrgSED=$lt_cv_path_SED
77748bd17e5fSmrgAC_SUBST([SED])
77758bd17e5fSmrgAC_MSG_RESULT([$SED])
77768bd17e5fSmrg])#AC_PROG_SED
77778bd17e5fSmrg])#m4_ifndef
77788c4a8e55Smrg
77798bd17e5fSmrg# Old name:
77808bd17e5fSmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
77818bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
77828bd17e5fSmrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
77830597fb56Smrg
77840597fb56Smrg
77858bd17e5fSmrg# _LT_CHECK_SHELL_FEATURES
77868bd17e5fSmrg# ------------------------
77878bd17e5fSmrg# Find out whether the shell is Bourne or XSI compatible,
77888bd17e5fSmrg# or has some other useful features.
77898bd17e5fSmrgm4_defun([_LT_CHECK_SHELL_FEATURES],
77908bd17e5fSmrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
77918bd17e5fSmrg# Try some XSI features
77928bd17e5fSmrgxsi_shell=no
77938bd17e5fSmrg( _lt_dummy="a/b/c"
77948bd17e5fSmrg  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
77958bd17e5fSmrg      = c,a/b,b/c, \
77968bd17e5fSmrg    && eval 'test $(( 1 + 1 )) -eq 2 \
77978bd17e5fSmrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
77988bd17e5fSmrg  && xsi_shell=yes
77998bd17e5fSmrgAC_MSG_RESULT([$xsi_shell])
78008bd17e5fSmrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
78010597fb56Smrg
78028bd17e5fSmrgAC_MSG_CHECKING([whether the shell understands "+="])
78038bd17e5fSmrglt_shell_append=no
78048bd17e5fSmrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
78058bd17e5fSmrg    >/dev/null 2>&1 \
78068bd17e5fSmrg  && lt_shell_append=yes
78078bd17e5fSmrgAC_MSG_RESULT([$lt_shell_append])
78088bd17e5fSmrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
78098c4a8e55Smrg
78108bd17e5fSmrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
78118bd17e5fSmrg  lt_unset=unset
78128bd17e5fSmrgelse
78138bd17e5fSmrg  lt_unset=false
78148bd17e5fSmrgfi
78158bd17e5fSmrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
78168c4a8e55Smrg
78178bd17e5fSmrg# test EBCDIC or ASCII
78188bd17e5fSmrgcase `echo X|tr X '\101'` in
78198bd17e5fSmrg A) # ASCII based system
78208bd17e5fSmrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
78218bd17e5fSmrg  lt_SP2NL='tr \040 \012'
78228bd17e5fSmrg  lt_NL2SP='tr \015\012 \040\040'
78238bd17e5fSmrg  ;;
78248bd17e5fSmrg *) # EBCDIC based system
78258bd17e5fSmrg  lt_SP2NL='tr \100 \n'
78268bd17e5fSmrg  lt_NL2SP='tr \r\n \100\100'
78278bd17e5fSmrg  ;;
78288bd17e5fSmrgesac
78298bd17e5fSmrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
78308bd17e5fSmrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
78318bd17e5fSmrg])# _LT_CHECK_SHELL_FEATURES
78328c4a8e55Smrg
78338c4a8e55Smrg
78348bd17e5fSmrg# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
78358bd17e5fSmrg# ------------------------------------------------------
78368bd17e5fSmrg# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
78378bd17e5fSmrg# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
78388bd17e5fSmrgm4_defun([_LT_PROG_FUNCTION_REPLACE],
78398bd17e5fSmrg[dnl {
78408bd17e5fSmrgsed -e '/^$1 ()$/,/^} # $1 /c\
78418bd17e5fSmrg$1 ()\
78428bd17e5fSmrg{\
78438bd17e5fSmrgm4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
78448bd17e5fSmrg} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
78458bd17e5fSmrg  && mv -f "$cfgfile.tmp" "$cfgfile" \
78468bd17e5fSmrg    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
78478bd17e5fSmrgtest 0 -eq $? || _lt_function_replace_fail=:
78488bd17e5fSmrg])
7849bd23fbfaSmrg
78508c4a8e55Smrg
78518bd17e5fSmrg# _LT_PROG_REPLACE_SHELLFNS
78528bd17e5fSmrg# -------------------------
78538bd17e5fSmrg# Replace existing portable implementations of several shell functions with
78548bd17e5fSmrg# equivalent extended shell implementations where those features are available..
78558bd17e5fSmrgm4_defun([_LT_PROG_REPLACE_SHELLFNS],
78568bd17e5fSmrg[if test x"$xsi_shell" = xyes; then
78578bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
78588bd17e5fSmrg    case ${1} in
78598bd17e5fSmrg      */*) func_dirname_result="${1%/*}${2}" ;;
78608bd17e5fSmrg      *  ) func_dirname_result="${3}" ;;
78618bd17e5fSmrg    esac])
7862bd23fbfaSmrg
78638bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
78648bd17e5fSmrg    func_basename_result="${1##*/}"])
7865bd23fbfaSmrg
78668bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
78678bd17e5fSmrg    case ${1} in
78688bd17e5fSmrg      */*) func_dirname_result="${1%/*}${2}" ;;
78698bd17e5fSmrg      *  ) func_dirname_result="${3}" ;;
78708bd17e5fSmrg    esac
78718bd17e5fSmrg    func_basename_result="${1##*/}"])
78728c4a8e55Smrg
78738bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
78748bd17e5fSmrg    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
78758bd17e5fSmrg    # positional parameters, so assign one to ordinary parameter first.
78768bd17e5fSmrg    func_stripname_result=${3}
78778bd17e5fSmrg    func_stripname_result=${func_stripname_result#"${1}"}
78788bd17e5fSmrg    func_stripname_result=${func_stripname_result%"${2}"}])
7879b042e37fSmrg
78808bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
78818bd17e5fSmrg    func_split_long_opt_name=${1%%=*}
78828bd17e5fSmrg    func_split_long_opt_arg=${1#*=}])
7883b042e37fSmrg
78848bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
78858bd17e5fSmrg    func_split_short_opt_arg=${1#??}
78868bd17e5fSmrg    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
7887b042e37fSmrg
78888bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
78898bd17e5fSmrg    case ${1} in
78908bd17e5fSmrg      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
78918bd17e5fSmrg      *)    func_lo2o_result=${1} ;;
78928bd17e5fSmrg    esac])
7893b042e37fSmrg
78948bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
7895b042e37fSmrg
78968bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
7897b042e37fSmrg
78988bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
78998bd17e5fSmrgfi
7900b042e37fSmrg
79018bd17e5fSmrgif test x"$lt_shell_append" = xyes; then
79028bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
7903b042e37fSmrg
79048bd17e5fSmrg  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
79058bd17e5fSmrg    func_quote_for_eval "${2}"
79068bd17e5fSmrgdnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
79078bd17e5fSmrg    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
79080597fb56Smrg
79098bd17e5fSmrg  # Save a `func_append' function call where possible by direct use of '+='
79108bd17e5fSmrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
79118bd17e5fSmrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
79128bd17e5fSmrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
79138bd17e5fSmrg  test 0 -eq $? || _lt_function_replace_fail=:
7914706b6b52Smrgelse
79158bd17e5fSmrg  # Save a `func_append' function call even when '+=' is not available
79168bd17e5fSmrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
79178bd17e5fSmrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
79188bd17e5fSmrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
79198bd17e5fSmrg  test 0 -eq $? || _lt_function_replace_fail=:
79208bd17e5fSmrgfi
7921b042e37fSmrg
79228bd17e5fSmrgif test x"$_lt_function_replace_fail" = x":"; then
79238bd17e5fSmrg  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
79248bd17e5fSmrgfi
79258bd17e5fSmrg])
7926b042e37fSmrg
79278bd17e5fSmrg# _LT_PATH_CONVERSION_FUNCTIONS
79288bd17e5fSmrg# -----------------------------
79298bd17e5fSmrg# Determine which file name conversion functions should be used by
79308bd17e5fSmrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
79318bd17e5fSmrg# for certain cross-compile configurations and native mingw.
79328bd17e5fSmrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
79338bd17e5fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
79348bd17e5fSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
79358bd17e5fSmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
79368bd17e5fSmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
79378bd17e5fSmrg[case $host in
79388bd17e5fSmrg  *-*-mingw* )
79398bd17e5fSmrg    case $build in
79408bd17e5fSmrg      *-*-mingw* ) # actually msys
79418bd17e5fSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
79428bd17e5fSmrg        ;;
79438bd17e5fSmrg      *-*-cygwin* )
79448bd17e5fSmrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
79458bd17e5fSmrg        ;;
79468bd17e5fSmrg      * ) # otherwise, assume *nix
79478bd17e5fSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
79488bd17e5fSmrg        ;;
79498bd17e5fSmrg    esac
79508bd17e5fSmrg    ;;
79518bd17e5fSmrg  *-*-cygwin* )
79528bd17e5fSmrg    case $build in
79538bd17e5fSmrg      *-*-mingw* ) # actually msys
79548bd17e5fSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
79558bd17e5fSmrg        ;;
79568bd17e5fSmrg      *-*-cygwin* )
79578bd17e5fSmrg        lt_cv_to_host_file_cmd=func_convert_file_noop
79588bd17e5fSmrg        ;;
79598bd17e5fSmrg      * ) # otherwise, assume *nix
79608bd17e5fSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
79618bd17e5fSmrg        ;;
79628bd17e5fSmrg    esac
79638bd17e5fSmrg    ;;
79648bd17e5fSmrg  * ) # unhandled hosts (and "normal" native builds)
79658bd17e5fSmrg    lt_cv_to_host_file_cmd=func_convert_file_noop
79668bd17e5fSmrg    ;;
79678bd17e5fSmrgesac
79688bd17e5fSmrg])
79698bd17e5fSmrgto_host_file_cmd=$lt_cv_to_host_file_cmd
79708bd17e5fSmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
79718bd17e5fSmrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
79728bd17e5fSmrg         [0], [convert $build file names to $host format])dnl
79738bd17e5fSmrg
79748bd17e5fSmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
79758bd17e5fSmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
79768bd17e5fSmrg[#assume ordinary cross tools, or native build.
79778bd17e5fSmrglt_cv_to_tool_file_cmd=func_convert_file_noop
79788bd17e5fSmrgcase $host in
79798bd17e5fSmrg  *-*-mingw* )
79808bd17e5fSmrg    case $build in
79818bd17e5fSmrg      *-*-mingw* ) # actually msys
79828bd17e5fSmrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
79838bd17e5fSmrg        ;;
79848bd17e5fSmrg    esac
79858bd17e5fSmrg    ;;
79868bd17e5fSmrgesac
79878bd17e5fSmrg])
79888bd17e5fSmrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
79898bd17e5fSmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
79908bd17e5fSmrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
79918bd17e5fSmrg         [0], [convert $build files to toolchain format])dnl
79928bd17e5fSmrg])# _LT_PATH_CONVERSION_FUNCTIONS
79938bd17e5fSmrg
79948bd17e5fSmrg# Helper functions for option handling.                    -*- Autoconf -*-
79950597fb56Smrg#
79968bd17e5fSmrg#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
79978bd17e5fSmrg#   Inc.
79988bd17e5fSmrg#   Written by Gary V. Vaughan, 2004
79990597fb56Smrg#
80008bd17e5fSmrg# This file is free software; the Free Software Foundation gives
80018bd17e5fSmrg# unlimited permission to copy and/or distribute it, with or without
80028bd17e5fSmrg# modifications, as long as this notice is preserved.
8003b042e37fSmrg
80048bd17e5fSmrg# serial 7 ltoptions.m4
8005b042e37fSmrg
80068bd17e5fSmrg# This is to help aclocal find these macros, as it can't see m4_define.
80078bd17e5fSmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
80088bd17e5fSmrg
80098bd17e5fSmrg
80108bd17e5fSmrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
80118bd17e5fSmrg# ------------------------------------------
80128bd17e5fSmrgm4_define([_LT_MANGLE_OPTION],
80138bd17e5fSmrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
8014b042e37fSmrg
8015706b6b52Smrg
80168bd17e5fSmrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
80178bd17e5fSmrg# ---------------------------------------
80188bd17e5fSmrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
80198bd17e5fSmrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
80208bd17e5fSmrg# saved as a flag.
80218bd17e5fSmrgm4_define([_LT_SET_OPTION],
80228bd17e5fSmrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
80238bd17e5fSmrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
80248bd17e5fSmrg        _LT_MANGLE_DEFUN([$1], [$2]),
80258bd17e5fSmrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
80268bd17e5fSmrg])
8027b042e37fSmrg
8028b042e37fSmrg
80298bd17e5fSmrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
80308bd17e5fSmrg# ------------------------------------------------------------
80318bd17e5fSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
80328bd17e5fSmrgm4_define([_LT_IF_OPTION],
80338bd17e5fSmrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
8034b042e37fSmrg
80358c4a8e55Smrg
80368bd17e5fSmrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
80378bd17e5fSmrg# -------------------------------------------------------
80388bd17e5fSmrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
80398bd17e5fSmrg# are set.
80408bd17e5fSmrgm4_define([_LT_UNLESS_OPTIONS],
80418bd17e5fSmrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
80428bd17e5fSmrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
80438bd17e5fSmrg		      [m4_define([$0_found])])])[]dnl
80448bd17e5fSmrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
80458bd17e5fSmrg])[]dnl
80468bd17e5fSmrg])
80470597fb56Smrg
80488c4a8e55Smrg
80498bd17e5fSmrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
80508bd17e5fSmrg# ----------------------------------------
80518bd17e5fSmrg# OPTION-LIST is a space-separated list of Libtool options associated
80528bd17e5fSmrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
80538bd17e5fSmrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
80548bd17e5fSmrg# the unknown option and exit.
80558bd17e5fSmrgm4_defun([_LT_SET_OPTIONS],
80568bd17e5fSmrg[# Set options
80578bd17e5fSmrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
80588bd17e5fSmrg    [_LT_SET_OPTION([$1], _LT_Option)])
80598c4a8e55Smrg
80608bd17e5fSmrgm4_if([$1],[LT_INIT],[
80618bd17e5fSmrg  dnl
80628bd17e5fSmrg  dnl Simply set some default values (i.e off) if boolean options were not
80638bd17e5fSmrg  dnl specified:
80648bd17e5fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
80658bd17e5fSmrg  ])
80668bd17e5fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
80678bd17e5fSmrg  ])
80688bd17e5fSmrg  dnl
80698bd17e5fSmrg  dnl If no reference was made to various pairs of opposing options, then
80708bd17e5fSmrg  dnl we run the default mode handler for the pair.  For example, if neither
80718bd17e5fSmrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
80728bd17e5fSmrg  dnl archives by default:
80738bd17e5fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
80748bd17e5fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
80758bd17e5fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
80768bd17e5fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
80778bd17e5fSmrg  		   [_LT_ENABLE_FAST_INSTALL])
80788bd17e5fSmrg  ])
80798bd17e5fSmrg])# _LT_SET_OPTIONS
80808c4a8e55Smrg
80818c4a8e55Smrg
80828c4a8e55Smrg
80838bd17e5fSmrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
80848bd17e5fSmrg# -----------------------------------------
80858bd17e5fSmrgm4_define([_LT_MANGLE_DEFUN],
80868bd17e5fSmrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
80878c4a8e55Smrg
80888c4a8e55Smrg
80898bd17e5fSmrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
80908bd17e5fSmrg# -----------------------------------------------
80918bd17e5fSmrgm4_define([LT_OPTION_DEFINE],
80928bd17e5fSmrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
80938bd17e5fSmrg])# LT_OPTION_DEFINE
80948c4a8e55Smrg
80958c4a8e55Smrg
80968bd17e5fSmrg# dlopen
80978bd17e5fSmrg# ------
80988bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
80998bd17e5fSmrg])
81008c4a8e55Smrg
81018bd17e5fSmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
81028bd17e5fSmrg[_LT_SET_OPTION([LT_INIT], [dlopen])
81038bd17e5fSmrgAC_DIAGNOSE([obsolete],
81048bd17e5fSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
81058bd17e5fSmrgput the `dlopen' option into LT_INIT's first parameter.])
81068bd17e5fSmrg])
8107b042e37fSmrg
81088bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
81098bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
8110b042e37fSmrg
8111b042e37fSmrg
81128bd17e5fSmrg# win32-dll
81138bd17e5fSmrg# ---------
81148bd17e5fSmrg# Declare package support for building win32 dll's.
81158bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
81168bd17e5fSmrg[enable_win32_dll=yes
8117b042e37fSmrg
81188bd17e5fSmrgcase $host in
81198bd17e5fSmrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
81208bd17e5fSmrg  AC_CHECK_TOOL(AS, as, false)
81218bd17e5fSmrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
81228bd17e5fSmrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
81238bd17e5fSmrg  ;;
81248bd17e5fSmrgesac
81258bd17e5fSmrg
81268bd17e5fSmrgtest -z "$AS" && AS=as
81278bd17e5fSmrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
81288bd17e5fSmrg
81298bd17e5fSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
81308bd17e5fSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
81318bd17e5fSmrg
81328bd17e5fSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
81338bd17e5fSmrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
81348bd17e5fSmrg])# win32-dll
8135b042e37fSmrg
81368bd17e5fSmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
81378bd17e5fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
81388bd17e5fSmrg_LT_SET_OPTION([LT_INIT], [win32-dll])
81398bd17e5fSmrgAC_DIAGNOSE([obsolete],
81408bd17e5fSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
81418bd17e5fSmrgput the `win32-dll' option into LT_INIT's first parameter.])
81428bd17e5fSmrg])
8143b042e37fSmrg
81448bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
81458bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
8146b042e37fSmrg
8147b042e37fSmrg
81488bd17e5fSmrg# _LT_ENABLE_SHARED([DEFAULT])
81498bd17e5fSmrg# ----------------------------
81508bd17e5fSmrg# implement the --enable-shared flag, and supports the `shared' and
81518bd17e5fSmrg# `disable-shared' LT_INIT options.
81528bd17e5fSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
81538bd17e5fSmrgm4_define([_LT_ENABLE_SHARED],
81548bd17e5fSmrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
81558bd17e5fSmrgAC_ARG_ENABLE([shared],
81568bd17e5fSmrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
81578bd17e5fSmrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
81588bd17e5fSmrg    [p=${PACKAGE-default}
81598bd17e5fSmrg    case $enableval in
81608bd17e5fSmrg    yes) enable_shared=yes ;;
81618bd17e5fSmrg    no) enable_shared=no ;;
81628bd17e5fSmrg    *)
81638bd17e5fSmrg      enable_shared=no
81648bd17e5fSmrg      # Look at the argument we got.  We use all the common list separators.
81658bd17e5fSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
81668bd17e5fSmrg      for pkg in $enableval; do
81678bd17e5fSmrg	IFS="$lt_save_ifs"
81688bd17e5fSmrg	if test "X$pkg" = "X$p"; then
81698bd17e5fSmrg	  enable_shared=yes
81708bd17e5fSmrg	fi
81718bd17e5fSmrg      done
81728bd17e5fSmrg      IFS="$lt_save_ifs"
81738bd17e5fSmrg      ;;
81748bd17e5fSmrg    esac],
81758bd17e5fSmrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
8176b042e37fSmrg
81778bd17e5fSmrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
81788bd17e5fSmrg	[Whether or not to build shared libraries])
81798bd17e5fSmrg])# _LT_ENABLE_SHARED
8180b042e37fSmrg
81818bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
81828bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
81830597fb56Smrg
81848bd17e5fSmrg# Old names:
81858bd17e5fSmrgAC_DEFUN([AC_ENABLE_SHARED],
81868bd17e5fSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
81878bd17e5fSmrg])
8188b042e37fSmrg
81898bd17e5fSmrgAC_DEFUN([AC_DISABLE_SHARED],
81908bd17e5fSmrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
81918bd17e5fSmrg])
8192b042e37fSmrg
81938bd17e5fSmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
81948bd17e5fSmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
8195b042e37fSmrg
81968bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
81978bd17e5fSmrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
81988bd17e5fSmrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
8199b042e37fSmrg
8200b042e37fSmrg
8201b042e37fSmrg
82028bd17e5fSmrg# _LT_ENABLE_STATIC([DEFAULT])
82038bd17e5fSmrg# ----------------------------
82048bd17e5fSmrg# implement the --enable-static flag, and support the `static' and
82058bd17e5fSmrg# `disable-static' LT_INIT options.
82068bd17e5fSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
82078bd17e5fSmrgm4_define([_LT_ENABLE_STATIC],
82088bd17e5fSmrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
82098bd17e5fSmrgAC_ARG_ENABLE([static],
82108bd17e5fSmrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
82118bd17e5fSmrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
82128bd17e5fSmrg    [p=${PACKAGE-default}
82138bd17e5fSmrg    case $enableval in
82148bd17e5fSmrg    yes) enable_static=yes ;;
82158bd17e5fSmrg    no) enable_static=no ;;
82168bd17e5fSmrg    *)
82178bd17e5fSmrg     enable_static=no
82188bd17e5fSmrg      # Look at the argument we got.  We use all the common list separators.
82198bd17e5fSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
82208bd17e5fSmrg      for pkg in $enableval; do
82218bd17e5fSmrg	IFS="$lt_save_ifs"
82228bd17e5fSmrg	if test "X$pkg" = "X$p"; then
82238bd17e5fSmrg	  enable_static=yes
82248bd17e5fSmrg	fi
82258bd17e5fSmrg      done
82268bd17e5fSmrg      IFS="$lt_save_ifs"
82278bd17e5fSmrg      ;;
82288bd17e5fSmrg    esac],
82298bd17e5fSmrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
82308c4a8e55Smrg
82318bd17e5fSmrg    _LT_DECL([build_old_libs], [enable_static], [0],
82328bd17e5fSmrg	[Whether or not to build static libraries])
82338bd17e5fSmrg])# _LT_ENABLE_STATIC
82348c4a8e55Smrg
82358bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
82368bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
8237b042e37fSmrg
82388bd17e5fSmrg# Old names:
82398bd17e5fSmrgAC_DEFUN([AC_ENABLE_STATIC],
82408bd17e5fSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
82418bd17e5fSmrg])
82428c4a8e55Smrg
82438bd17e5fSmrgAC_DEFUN([AC_DISABLE_STATIC],
82448bd17e5fSmrg[_LT_SET_OPTION([LT_INIT], [disable-static])
82458bd17e5fSmrg])
8246706b6b52Smrg
82478bd17e5fSmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
82488bd17e5fSmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
82498c4a8e55Smrg
825067594505Smrgdnl aclocal-1.4 backwards compatibility:
825167594505Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
825267594505Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
825367594505Smrg
825467594505Smrg
825567594505Smrg
825667594505Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
825767594505Smrg# ----------------------------------
825867594505Smrg# implement the --enable-fast-install flag, and support the `fast-install'
825967594505Smrg# and `disable-fast-install' LT_INIT options.
826067594505Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
826167594505Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
826267594505Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
826367594505SmrgAC_ARG_ENABLE([fast-install],
826467594505Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
826567594505Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
826667594505Smrg    [p=${PACKAGE-default}
826767594505Smrg    case $enableval in
826867594505Smrg    yes) enable_fast_install=yes ;;
826967594505Smrg    no) enable_fast_install=no ;;
827067594505Smrg    *)
827167594505Smrg      enable_fast_install=no
827267594505Smrg      # Look at the argument we got.  We use all the common list separators.
827367594505Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
827467594505Smrg      for pkg in $enableval; do
827567594505Smrg	IFS="$lt_save_ifs"
827667594505Smrg	if test "X$pkg" = "X$p"; then
827767594505Smrg	  enable_fast_install=yes
827867594505Smrg	fi
827967594505Smrg      done
828067594505Smrg      IFS="$lt_save_ifs"
828167594505Smrg      ;;
828267594505Smrg    esac],
828367594505Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
828467594505Smrg
828567594505Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
828667594505Smrg	 [Whether or not to optimize for fast installation])dnl
828767594505Smrg])# _LT_ENABLE_FAST_INSTALL
828867594505Smrg
828967594505SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
829067594505SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
829167594505Smrg
829267594505Smrg# Old names:
829367594505SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
829467594505Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
829567594505SmrgAC_DIAGNOSE([obsolete],
829667594505Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
829767594505Smrgthe `fast-install' option into LT_INIT's first parameter.])
829867594505Smrg])
829967594505Smrg
830067594505SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
830167594505Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
830267594505SmrgAC_DIAGNOSE([obsolete],
830367594505Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
830467594505Smrgthe `disable-fast-install' option into LT_INIT's first parameter.])
830567594505Smrg])
830667594505Smrg
830767594505Smrgdnl aclocal-1.4 backwards compatibility:
830867594505Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
830967594505Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
831067594505Smrg
831167594505Smrg
831267594505Smrg# _LT_WITH_PIC([MODE])
831367594505Smrg# --------------------
831467594505Smrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
831567594505Smrg# LT_INIT options.
831667594505Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
831767594505Smrgm4_define([_LT_WITH_PIC],
831867594505Smrg[AC_ARG_WITH([pic],
831967594505Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
832067594505Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
832167594505Smrg    [lt_p=${PACKAGE-default}
832267594505Smrg    case $withval in
832367594505Smrg    yes|no) pic_mode=$withval ;;
832467594505Smrg    *)
832567594505Smrg      pic_mode=default
832667594505Smrg      # Look at the argument we got.  We use all the common list separators.
832767594505Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
832867594505Smrg      for lt_pkg in $withval; do
832967594505Smrg	IFS="$lt_save_ifs"
833067594505Smrg	if test "X$lt_pkg" = "X$lt_p"; then
833167594505Smrg	  pic_mode=yes
833267594505Smrg	fi
833367594505Smrg      done
833467594505Smrg      IFS="$lt_save_ifs"
833567594505Smrg      ;;
833667594505Smrg    esac],
833767594505Smrg    [pic_mode=default])
833867594505Smrg
833967594505Smrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
834067594505Smrg
834167594505Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
834267594505Smrg])# _LT_WITH_PIC
834367594505Smrg
834467594505SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
834567594505SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
834667594505Smrg
834767594505Smrg# Old name:
834867594505SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
834967594505Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
835067594505SmrgAC_DIAGNOSE([obsolete],
835167594505Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
835267594505Smrgput the `pic-only' option into LT_INIT's first parameter.])
835367594505Smrg])
835467594505Smrg
835567594505Smrgdnl aclocal-1.4 backwards compatibility:
835667594505Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
835767594505Smrg
835867594505Smrg
835967594505Smrgm4_define([_LTDL_MODE], [])
836067594505SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
836167594505Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
836267594505SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
836367594505Smrg		 [m4_define([_LTDL_MODE], [recursive])])
836467594505SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
836567594505Smrg		 [m4_define([_LTDL_MODE], [subproject])])
836667594505Smrg
836767594505Smrgm4_define([_LTDL_TYPE], [])
836867594505SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
836967594505Smrg		 [m4_define([_LTDL_TYPE], [installable])])
837067594505SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
837167594505Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
837267594505Smrg
837367594505Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
837467594505Smrg#
837567594505Smrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
837667594505Smrg# Written by Gary V. Vaughan, 2004
837767594505Smrg#
837867594505Smrg# This file is free software; the Free Software Foundation gives
837967594505Smrg# unlimited permission to copy and/or distribute it, with or without
838067594505Smrg# modifications, as long as this notice is preserved.
838167594505Smrg
838267594505Smrg# serial 6 ltsugar.m4
838367594505Smrg
838467594505Smrg# This is to help aclocal find these macros, as it can't see m4_define.
838567594505SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
838667594505Smrg
838767594505Smrg
838867594505Smrg# lt_join(SEP, ARG1, [ARG2...])
838967594505Smrg# -----------------------------
839067594505Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
839167594505Smrg# associated separator.
839267594505Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
839367594505Smrg# versions in m4sugar had bugs.
839467594505Smrgm4_define([lt_join],
839567594505Smrg[m4_if([$#], [1], [],
839667594505Smrg       [$#], [2], [[$2]],
839767594505Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
839867594505Smrgm4_define([_lt_join],
839967594505Smrg[m4_if([$#$2], [2], [],
840067594505Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
840167594505Smrg
840267594505Smrg
840367594505Smrg# lt_car(LIST)
840467594505Smrg# lt_cdr(LIST)
840567594505Smrg# ------------
840667594505Smrg# Manipulate m4 lists.
840767594505Smrg# These macros are necessary as long as will still need to support
840867594505Smrg# Autoconf-2.59 which quotes differently.
840967594505Smrgm4_define([lt_car], [[$1]])
841067594505Smrgm4_define([lt_cdr],
841167594505Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
841267594505Smrg       [$#], 1, [],
841367594505Smrg       [m4_dquote(m4_shift($@))])])
841467594505Smrgm4_define([lt_unquote], $1)
841567594505Smrg
841667594505Smrg
841767594505Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
841867594505Smrg# ------------------------------------------
841967594505Smrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
842067594505Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
842167594505Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
842267594505Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
842367594505Smrg# than defined and empty).
842467594505Smrg#
842567594505Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
842667594505Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
842767594505Smrgm4_define([lt_append],
842867594505Smrg[m4_define([$1],
842967594505Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
843067594505Smrg
843167594505Smrg
843267594505Smrg
843367594505Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
843467594505Smrg# ----------------------------------------------------------
843567594505Smrg# Produce a SEP delimited list of all paired combinations of elements of
843667594505Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
843767594505Smrg# has the form PREFIXmINFIXSUFFIXn.
843867594505Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
843967594505Smrgm4_define([lt_combine],
844067594505Smrg[m4_if(m4_eval([$# > 3]), [1],
844167594505Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
844267594505Smrg[[m4_foreach([_Lt_prefix], [$2],
844367594505Smrg	     [m4_foreach([_Lt_suffix],
844467594505Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
844567594505Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
844667594505Smrg
844767594505Smrg
844867594505Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
844967594505Smrg# -----------------------------------------------------------------------
845067594505Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
845167594505Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
845267594505Smrgm4_define([lt_if_append_uniq],
845367594505Smrg[m4_ifdef([$1],
845467594505Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
845567594505Smrg		 [lt_append([$1], [$2], [$3])$4],
845667594505Smrg		 [$5])],
845767594505Smrg	  [lt_append([$1], [$2], [$3])$4])])
845867594505Smrg
845967594505Smrg
846067594505Smrg# lt_dict_add(DICT, KEY, VALUE)
846167594505Smrg# -----------------------------
846267594505Smrgm4_define([lt_dict_add],
846367594505Smrg[m4_define([$1($2)], [$3])])
846467594505Smrg
846567594505Smrg
846667594505Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
846767594505Smrg# --------------------------------------------
846867594505Smrgm4_define([lt_dict_add_subkey],
846967594505Smrg[m4_define([$1($2:$3)], [$4])])
847067594505Smrg
847167594505Smrg
847267594505Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
847367594505Smrg# ----------------------------------
847467594505Smrgm4_define([lt_dict_fetch],
847567594505Smrg[m4_ifval([$3],
847667594505Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
847767594505Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
847867594505Smrg
847967594505Smrg
848067594505Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
848167594505Smrg# -----------------------------------------------------------------
848267594505Smrgm4_define([lt_if_dict_fetch],
848367594505Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
848467594505Smrg	[$5],
848567594505Smrg    [$6])])
848667594505Smrg
84870597fb56Smrg
848867594505Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
848967594505Smrg# --------------------------------------------------------------
849067594505Smrgm4_define([lt_dict_filter],
849167594505Smrg[m4_if([$5], [], [],
849267594505Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
849367594505Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
849467594505Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
849567594505Smrg])
84960597fb56Smrg
849767594505Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
849867594505Smrg#
849967594505Smrg#   Copyright (C) 2004 Free Software Foundation, Inc.
850067594505Smrg#   Written by Scott James Remnant, 2004
850167594505Smrg#
850267594505Smrg# This file is free software; the Free Software Foundation gives
850367594505Smrg# unlimited permission to copy and/or distribute it, with or without
850467594505Smrg# modifications, as long as this notice is preserved.
85050597fb56Smrg
850667594505Smrg# @configure_input@
85078c4a8e55Smrg
850867594505Smrg# serial 3337 ltversion.m4
850967594505Smrg# This file is part of GNU Libtool
85108c4a8e55Smrg
851167594505Smrgm4_define([LT_PACKAGE_VERSION], [2.4.2])
851267594505Smrgm4_define([LT_PACKAGE_REVISION], [1.3337])
85138c4a8e55Smrg
851467594505SmrgAC_DEFUN([LTVERSION_VERSION],
851567594505Smrg[macro_version='2.4.2'
851667594505Smrgmacro_revision='1.3337'
851767594505Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
851867594505Smrg_LT_DECL(, macro_revision, 0)
85198bd17e5fSmrg])
85208c4a8e55Smrg
852167594505Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
852267594505Smrg#
852367594505Smrg#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
852467594505Smrg#   Written by Scott James Remnant, 2004.
852567594505Smrg#
852667594505Smrg# This file is free software; the Free Software Foundation gives
852767594505Smrg# unlimited permission to copy and/or distribute it, with or without
852867594505Smrg# modifications, as long as this notice is preserved.
85298c4a8e55Smrg
853067594505Smrg# serial 5 lt~obsolete.m4
85318c4a8e55Smrg
853267594505Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
853367594505Smrg#
853467594505Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
853567594505Smrg# which have later been changed to m4_define as they aren't part of the
853667594505Smrg# exported API, or moved to Autoconf or Automake where they belong.
853767594505Smrg#
853867594505Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
853967594505Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
854067594505Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
854167594505Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
854267594505Smrg# and doesn't know about Autoconf macros at all.)
854367594505Smrg#
854467594505Smrg# So we provide this file, which has a silly filename so it's always
854567594505Smrg# included after everything else.  This provides aclocal with the
854667594505Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
854767594505Smrg# because those macros already exist, or will be overwritten later.
854867594505Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
854967594505Smrg#
855067594505Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
855167594505Smrg# Yes, that means every name once taken will need to remain here until
855267594505Smrg# we give up compatibility with versions before 1.7, at which point
855367594505Smrg# we need to keep only those names which we still refer to.
85548c4a8e55Smrg
855567594505Smrg# This is to help aclocal find these macros, as it can't see m4_define.
855667594505SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
85578bd17e5fSmrg
855867594505Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
855967594505Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
856067594505Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
856167594505Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
856267594505Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
856367594505Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
856467594505Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
856567594505Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
856667594505Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
856767594505Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
856867594505Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
856967594505Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
857067594505Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
857167594505Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
857267594505Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
857367594505Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
857467594505Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
857567594505Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
857667594505Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
857767594505Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
857867594505Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
857967594505Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
858067594505Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
858167594505Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
858267594505Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
858367594505Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
858467594505Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
858567594505Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
858667594505Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
858767594505Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
858867594505Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
858967594505Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
859067594505Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
859167594505Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
859267594505Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
859367594505Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
859467594505Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
859567594505Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
859667594505Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
859767594505Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
859867594505Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
859967594505Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
860067594505Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
860167594505Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
860267594505Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
860367594505Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
860467594505Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
860567594505Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
860667594505Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
860767594505Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
860867594505Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
860967594505Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
861067594505Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
861167594505Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
861267594505Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
861367594505Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
861467594505Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
861567594505Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
861667594505Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
861767594505Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
861867594505Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
86198bd17e5fSmrg
862067594505Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
862167594505Smrg# serial 1 (pkg-config-0.24)
862267594505Smrg# 
862367594505Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
862467594505Smrg#
862567594505Smrg# This program is free software; you can redistribute it and/or modify
862667594505Smrg# it under the terms of the GNU General Public License as published by
862767594505Smrg# the Free Software Foundation; either version 2 of the License, or
862867594505Smrg# (at your option) any later version.
862967594505Smrg#
863067594505Smrg# This program is distributed in the hope that it will be useful, but
863167594505Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
863267594505Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
863367594505Smrg# General Public License for more details.
863467594505Smrg#
863567594505Smrg# You should have received a copy of the GNU General Public License
863667594505Smrg# along with this program; if not, write to the Free Software
863767594505Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
863867594505Smrg#
863967594505Smrg# As a special exception to the GNU General Public License, if you
864067594505Smrg# distribute this file as part of a program that contains a
864167594505Smrg# configuration script generated by Autoconf, you may include it under
864267594505Smrg# the same distribution terms that you use for the rest of that program.
86438c4a8e55Smrg
864467594505Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
864567594505Smrg# ----------------------------------
864667594505SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
864767594505Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
864867594505Smrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
864967594505Smrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
865067594505SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
865167594505SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
865267594505SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
86538c4a8e55Smrg
865467594505Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
865567594505Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
865667594505Smrgfi
865767594505Smrgif test -n "$PKG_CONFIG"; then
865867594505Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
865967594505Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
866067594505Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
866167594505Smrg		AC_MSG_RESULT([yes])
866267594505Smrg	else
866367594505Smrg		AC_MSG_RESULT([no])
866467594505Smrg		PKG_CONFIG=""
866567594505Smrg	fi
866667594505Smrgfi[]dnl
866767594505Smrg])# PKG_PROG_PKG_CONFIG
86688bd17e5fSmrg
866967594505Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
867067594505Smrg#
867167594505Smrg# Check to see whether a particular set of modules exists.  Similar
867267594505Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
867367594505Smrg#
867467594505Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
867567594505Smrg# only at the first occurence in configure.ac, so if the first place
867667594505Smrg# it's called might be skipped (such as if it is within an "if", you
867767594505Smrg# have to call PKG_CHECK_EXISTS manually
867867594505Smrg# --------------------------------------------------------------
867967594505SmrgAC_DEFUN([PKG_CHECK_EXISTS],
868067594505Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
868167594505Smrgif test -n "$PKG_CONFIG" && \
868267594505Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
868367594505Smrg  m4_default([$2], [:])
868467594505Smrgm4_ifvaln([$3], [else
868567594505Smrg  $3])dnl
868667594505Smrgfi])
86878bd17e5fSmrg
868867594505Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
868967594505Smrg# ---------------------------------------------
869067594505Smrgm4_define([_PKG_CONFIG],
869167594505Smrg[if test -n "$$1"; then
869267594505Smrg    pkg_cv_[]$1="$$1"
869367594505Smrg elif test -n "$PKG_CONFIG"; then
869467594505Smrg    PKG_CHECK_EXISTS([$3],
869567594505Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
869667594505Smrg		      test "x$?" != "x0" && pkg_failed=yes ],
869767594505Smrg		     [pkg_failed=yes])
869867594505Smrg else
869967594505Smrg    pkg_failed=untried
870067594505Smrgfi[]dnl
870167594505Smrg])# _PKG_CONFIG
87028bd17e5fSmrg
870367594505Smrg# _PKG_SHORT_ERRORS_SUPPORTED
870467594505Smrg# -----------------------------
870567594505SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
870667594505Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
870767594505Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
870867594505Smrg        _pkg_short_errors_supported=yes
870967594505Smrgelse
871067594505Smrg        _pkg_short_errors_supported=no
871167594505Smrgfi[]dnl
871267594505Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
87138bd17e5fSmrg
87148bd17e5fSmrg
871567594505Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
871667594505Smrg# [ACTION-IF-NOT-FOUND])
87170597fb56Smrg#
87180597fb56Smrg#
871967594505Smrg# Note that if there is a possibility the first call to
872067594505Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
872167594505Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
872267594505Smrg#
872367594505Smrg#
872467594505Smrg# --------------------------------------------------------------
872567594505SmrgAC_DEFUN([PKG_CHECK_MODULES],
872667594505Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
872767594505SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
872867594505SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
87298bd17e5fSmrg
873067594505Smrgpkg_failed=no
873167594505SmrgAC_MSG_CHECKING([for $1])
87328bd17e5fSmrg
873367594505Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
873467594505Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
87358bd17e5fSmrg
873667594505Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
873767594505Smrgand $1[]_LIBS to avoid the need to call pkg-config.
873867594505SmrgSee the pkg-config man page for more details.])
87398bd17e5fSmrg
874067594505Smrgif test $pkg_failed = yes; then
874167594505Smrg   	AC_MSG_RESULT([no])
874267594505Smrg        _PKG_SHORT_ERRORS_SUPPORTED
874367594505Smrg        if test $_pkg_short_errors_supported = yes; then
874467594505Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
874567594505Smrg        else 
874667594505Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
874767594505Smrg        fi
874867594505Smrg	# Put the nasty error message in config.log where it belongs
874967594505Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
87508bd17e5fSmrg
875167594505Smrg	m4_default([$4], [AC_MSG_ERROR(
875267594505Smrg[Package requirements ($2) were not met:
87538bd17e5fSmrg
875467594505Smrg$$1_PKG_ERRORS
87558bd17e5fSmrg
875667594505SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
875767594505Smrginstalled software in a non-standard prefix.
87588bd17e5fSmrg
875967594505Smrg_PKG_TEXT])[]dnl
876067594505Smrg        ])
876167594505Smrgelif test $pkg_failed = untried; then
876267594505Smrg     	AC_MSG_RESULT([no])
876367594505Smrg	m4_default([$4], [AC_MSG_FAILURE(
876467594505Smrg[The pkg-config script could not be found or is too old.  Make sure it
876567594505Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
876667594505Smrgpath to pkg-config.
876767594505Smrg
876867594505Smrg_PKG_TEXT
87698c4a8e55Smrg
877067594505SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
877167594505Smrg        ])
877267594505Smrgelse
877367594505Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
877467594505Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
877567594505Smrg        AC_MSG_RESULT([yes])
877667594505Smrg	$3
877767594505Smrgfi[]dnl
877867594505Smrg])# PKG_CHECK_MODULES
87798c4a8e55Smrg
87808c4a8e55Smrg
878167594505Smrg# PKG_INSTALLDIR(DIRECTORY)
878267594505Smrg# -------------------------
878367594505Smrg# Substitutes the variable pkgconfigdir as the location where a module
878467594505Smrg# should install pkg-config .pc files. By default the directory is
878567594505Smrg# $libdir/pkgconfig, but the default can be changed by passing
878667594505Smrg# DIRECTORY. The user can override through the --with-pkgconfigdir
878767594505Smrg# parameter.
878867594505SmrgAC_DEFUN([PKG_INSTALLDIR],
878967594505Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
879067594505Smrgm4_pushdef([pkg_description],
879167594505Smrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
879267594505SmrgAC_ARG_WITH([pkgconfigdir],
879367594505Smrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
879467594505Smrg    [with_pkgconfigdir=]pkg_default)
879567594505SmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
879667594505Smrgm4_popdef([pkg_default])
879767594505Smrgm4_popdef([pkg_description])
879867594505Smrg]) dnl PKG_INSTALLDIR
879967594505Smrg
880067594505Smrg
880167594505Smrg# PKG_NOARCH_INSTALLDIR(DIRECTORY)
880267594505Smrg# -------------------------
880367594505Smrg# Substitutes the variable noarch_pkgconfigdir as the location where a
880467594505Smrg# module should install arch-independent pkg-config .pc files. By
880567594505Smrg# default the directory is $datadir/pkgconfig, but the default can be
880667594505Smrg# changed by passing DIRECTORY. The user can override through the
880767594505Smrg# --with-noarch-pkgconfigdir parameter.
880867594505SmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
880967594505Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
881067594505Smrgm4_pushdef([pkg_description],
881167594505Smrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
881267594505SmrgAC_ARG_WITH([noarch-pkgconfigdir],
881367594505Smrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
881467594505Smrg    [with_noarch_pkgconfigdir=]pkg_default)
881567594505SmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
881667594505Smrgm4_popdef([pkg_default])
881767594505Smrgm4_popdef([pkg_description])
881867594505Smrg]) dnl PKG_NOARCH_INSTALLDIR
881967594505Smrg
882067594505Smrg
882167594505Smrg# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
882267594505Smrg# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
882367594505Smrg# -------------------------------------------
882467594505Smrg# Retrieves the value of the pkg-config variable for the given module.
882567594505SmrgAC_DEFUN([PKG_CHECK_VAR],
882667594505Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
882767594505SmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
88288c4a8e55Smrg
882967594505Smrg_PKG_CONFIG([$1], [variable="][$3]["], [$2])
883067594505SmrgAS_VAR_COPY([$1], [pkg_cv_][$1])
88318c4a8e55Smrg
883267594505SmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl
883367594505Smrg])# PKG_CHECK_VAR
88348c4a8e55Smrg
883567594505Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
883667594505Smrgdnl
883767594505Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
883867594505Smrgdnl
883967594505Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
884067594505Smrgdnl copy of this software and associated documentation files (the "Software"),
884167594505Smrgdnl to deal in the Software without restriction, including without limitation
884267594505Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
884367594505Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
884467594505Smrgdnl Software is furnished to do so, subject to the following conditions:
884567594505Smrgdnl
884667594505Smrgdnl The above copyright notice and this permission notice (including the next
884767594505Smrgdnl paragraph) shall be included in all copies or substantial portions of the
884867594505Smrgdnl Software.
884967594505Smrgdnl
885067594505Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
885167594505Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
885267594505Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
885367594505Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
885467594505Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
885567594505Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
885667594505Smrgdnl DEALINGS IN THE SOFTWARE.
88578c4a8e55Smrg
885867594505Smrg# XORG_MACROS_VERSION(required-version)
885967594505Smrg# -------------------------------------
886067594505Smrg# Minimum version: 1.1.0
886167594505Smrg#
886267594505Smrg# If you're using a macro added in Version 1.1 or newer, include this in
886367594505Smrg# your configure.ac with the minimum required version, such as:
886467594505Smrg# XORG_MACROS_VERSION(1.1)
886567594505Smrg#
886667594505Smrg# To ensure that this macro is defined, also add:
886767594505Smrg# m4_ifndef([XORG_MACROS_VERSION],
886867594505Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
886967594505Smrg#
887067594505Smrg#
887167594505Smrg# See the "minimum version" comment for each macro you use to see what
887267594505Smrg# version you require.
887367594505Smrgm4_defun([XORG_MACROS_VERSION],[
887467594505Smrgm4_define([vers_have], [1.19.0])
887567594505Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
887667594505Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
887767594505Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
887867594505Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
887967594505Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
888067594505Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
888167594505Smrgm4_undefine([vers_have])
888267594505Smrgm4_undefine([maj_have])
888367594505Smrgm4_undefine([maj_needed])
888467594505Smrg]) # XORG_MACROS_VERSION
88858c4a8e55Smrg
888667594505Smrg# XORG_PROG_RAWCPP()
888767594505Smrg# ------------------
888867594505Smrg# Minimum version: 1.0.0
888967594505Smrg#
889067594505Smrg# Find cpp program and necessary flags for use in pre-processing text files
889167594505Smrg# such as man pages and config files
889267594505SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
889367594505SmrgAC_REQUIRE([AC_PROG_CPP])
889467594505SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
889567594505Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
88968c4a8e55Smrg
889767594505Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
889867594505Smrg# which is not the best choice for supporting other OS'es, but covers most
889967594505Smrg# of the ones we need for now.
890067594505SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
890167594505SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
890267594505Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
890367594505Smrg	AC_MSG_RESULT([no])
890467594505Smrgelse
890567594505Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
890667594505Smrg		RAWCPPFLAGS=-undef
890767594505Smrg		AC_MSG_RESULT([yes])
890867594505Smrg	# under Cygwin unix is still defined even with -undef
890967594505Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
891067594505Smrg		RAWCPPFLAGS="-undef -ansi"
891167594505Smrg		AC_MSG_RESULT([yes, with -ansi])
891267594505Smrg	else
891367594505Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
891467594505Smrg	fi
891567594505Smrgfi
891667594505Smrgrm -f conftest.$ac_ext
89170597fb56Smrg
891867594505SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
891967594505SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
892067594505Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
892167594505Smrg	AC_MSG_RESULT([no])
892267594505Smrgelse
892367594505Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
892467594505Smrg		TRADITIONALCPPFLAGS="-traditional"
892567594505Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
892667594505Smrg		AC_MSG_RESULT([yes])
892767594505Smrg	else
892867594505Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
892967594505Smrg	fi
893067594505Smrgfi
893167594505Smrgrm -f conftest.$ac_ext
893267594505SmrgAC_SUBST(RAWCPPFLAGS)
893367594505SmrgAC_SUBST(TRADITIONALCPPFLAGS)
893467594505Smrg]) # XORG_PROG_RAWCPP
89358c4a8e55Smrg
893667594505Smrg# XORG_MANPAGE_SECTIONS()
893767594505Smrg# -----------------------
893867594505Smrg# Minimum version: 1.0.0
893967594505Smrg#
894067594505Smrg# Determine which sections man pages go in for the different man page types
894167594505Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
894267594505Smrg# Not sure if there's any better way than just hardcoding by OS name.
894367594505Smrg# Override default settings by setting environment variables
894467594505Smrg# Added MAN_SUBSTS in version 1.8
894567594505Smrg# Added AC_PROG_SED in version 1.8
89468c4a8e55Smrg
894767594505SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
894867594505SmrgAC_REQUIRE([AC_CANONICAL_HOST])
894967594505SmrgAC_REQUIRE([AC_PROG_SED])
89508c4a8e55Smrg
895167594505Smrgif test x$APP_MAN_SUFFIX = x    ; then
895267594505Smrg    APP_MAN_SUFFIX=1
895367594505Smrgfi
895467594505Smrgif test x$APP_MAN_DIR = x    ; then
895567594505Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
895667594505Smrgfi
89578bd17e5fSmrg
895867594505Smrgif test x$LIB_MAN_SUFFIX = x    ; then
895967594505Smrg    LIB_MAN_SUFFIX=3
896067594505Smrgfi
896167594505Smrgif test x$LIB_MAN_DIR = x    ; then
896267594505Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
896367594505Smrgfi
89648c4a8e55Smrg
896567594505Smrgif test x$FILE_MAN_SUFFIX = x    ; then
896667594505Smrg    case $host_os in
896767594505Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
896867594505Smrg	*)		FILE_MAN_SUFFIX=5  ;;
896967594505Smrg    esac
897067594505Smrgfi
897167594505Smrgif test x$FILE_MAN_DIR = x    ; then
897267594505Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
897367594505Smrgfi
89748c4a8e55Smrg
897567594505Smrgif test x$MISC_MAN_SUFFIX = x    ; then
897667594505Smrg    case $host_os in
897767594505Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
897867594505Smrg	*)		MISC_MAN_SUFFIX=7  ;;
897967594505Smrg    esac
898067594505Smrgfi
898167594505Smrgif test x$MISC_MAN_DIR = x    ; then
898267594505Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
898367594505Smrgfi
89848c4a8e55Smrg
898567594505Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
898667594505Smrg    case $host_os in
898767594505Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
898867594505Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
898967594505Smrg    esac
899067594505Smrgfi
899167594505Smrgif test x$DRIVER_MAN_DIR = x    ; then
899267594505Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
899367594505Smrgfi
89948c4a8e55Smrg
899567594505Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
899667594505Smrg    case $host_os in
899767594505Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
899867594505Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
899967594505Smrg    esac
900067594505Smrgfi
900167594505Smrgif test x$ADMIN_MAN_DIR = x    ; then
900267594505Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
900367594505Smrgfi
90048c4a8e55Smrg
9005706b6b52Smrg
900667594505SmrgAC_SUBST([APP_MAN_SUFFIX])
900767594505SmrgAC_SUBST([LIB_MAN_SUFFIX])
900867594505SmrgAC_SUBST([FILE_MAN_SUFFIX])
900967594505SmrgAC_SUBST([MISC_MAN_SUFFIX])
901067594505SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
901167594505SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
901267594505SmrgAC_SUBST([APP_MAN_DIR])
901367594505SmrgAC_SUBST([LIB_MAN_DIR])
901467594505SmrgAC_SUBST([FILE_MAN_DIR])
901567594505SmrgAC_SUBST([MISC_MAN_DIR])
901667594505SmrgAC_SUBST([DRIVER_MAN_DIR])
901767594505SmrgAC_SUBST([ADMIN_MAN_DIR])
9018706b6b52Smrg
901967594505SmrgXORG_MAN_PAGE="X Version 11"
902067594505SmrgAC_SUBST([XORG_MAN_PAGE])
902167594505SmrgMAN_SUBSTS="\
902267594505Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
902367594505Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
902467594505Smrg	-e 's|__xservername__|Xorg|g' \
902567594505Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
902667594505Smrg	-e 's|__projectroot__|\$(prefix)|g' \
902767594505Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
902867594505Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
902967594505Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
903067594505Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
903167594505Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
903267594505Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
903367594505Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
903467594505SmrgAC_SUBST([MAN_SUBSTS])
90358bd17e5fSmrg
903667594505Smrg]) # XORG_MANPAGE_SECTIONS
90378bd17e5fSmrg
903867594505Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
903967594505Smrg# ------------------------
904067594505Smrg# Minimum version: 1.7.0
90418bd17e5fSmrg#
904267594505Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
904367594505Smrg# provided by xorg-sgml-doctools, if installed.
904467594505SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
904567594505SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
904667594505SmrgXORG_SGML_PATH=
904767594505SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
904867594505Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
904967594505Smrg    [m4_ifval([$1],[:],
905067594505Smrg        [if test x"$cross_compiling" != x"yes" ; then
905167594505Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
905267594505Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
905367594505Smrg         fi])
905467594505Smrg    ])
90558bd17e5fSmrg
905667594505Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
905767594505Smrg# the path and the name of the doc stylesheet
905867594505Smrgif test "x$XORG_SGML_PATH" != "x" ; then
905967594505Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
906067594505Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
906167594505Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
906267594505Smrgelse
906367594505Smrg   AC_MSG_RESULT([no])
906467594505Smrgfi
90658bd17e5fSmrg
906667594505SmrgAC_SUBST(XORG_SGML_PATH)
906767594505SmrgAC_SUBST(STYLESHEET_SRCDIR)
906867594505SmrgAC_SUBST(XSL_STYLESHEET)
906967594505SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
907067594505Smrg]) # XORG_CHECK_SGML_DOCTOOLS
90718c4a8e55Smrg
907267594505Smrg# XORG_CHECK_LINUXDOC
907367594505Smrg# -------------------
907467594505Smrg# Minimum version: 1.0.0
90750597fb56Smrg#
907667594505Smrg# Defines the variable MAKE_TEXT if the necessary tools and
907767594505Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
907867594505Smrg# Whether or not the necessary tools and files are found can be checked
907967594505Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
908067594505SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
908167594505SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
908267594505SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
90838bd17e5fSmrg
908467594505SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
908567594505Smrg
908667594505SmrgAC_MSG_CHECKING([whether to build documentation])
908767594505Smrg
908867594505Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
908967594505Smrg   BUILDDOC=yes
909067594505Smrgelse
909167594505Smrg   BUILDDOC=no
9092706b6b52Smrgfi
90938c4a8e55Smrg
909467594505SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
90958c4a8e55Smrg
909667594505SmrgAC_MSG_RESULT([$BUILDDOC])
90978c4a8e55Smrg
909867594505SmrgAC_MSG_CHECKING([whether to build pdf documentation])
90998c4a8e55Smrg
910067594505Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
910167594505Smrg   BUILDPDFDOC=yes
91020597fb56Smrgelse
910367594505Smrg   BUILDPDFDOC=no
910467594505Smrgfi
91058c4a8e55Smrg
910667594505SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
91078c4a8e55Smrg
910867594505SmrgAC_MSG_RESULT([$BUILDPDFDOC])
91098c4a8e55Smrg
911067594505SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
911167594505SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
911267594505SmrgMAKE_PDF="$PS2PDF"
911367594505SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
91148c4a8e55Smrg
911567594505SmrgAC_SUBST(MAKE_TEXT)
911667594505SmrgAC_SUBST(MAKE_PS)
911767594505SmrgAC_SUBST(MAKE_PDF)
911867594505SmrgAC_SUBST(MAKE_HTML)
911967594505Smrg]) # XORG_CHECK_LINUXDOC
91208c4a8e55Smrg
912167594505Smrg# XORG_CHECK_DOCBOOK
912267594505Smrg# -------------------
912367594505Smrg# Minimum version: 1.0.0
912467594505Smrg#
912567594505Smrg# Checks for the ability to build output formats from SGML DocBook source.
912667594505Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
912767594505Smrg# indicates whether the necessary tools and files are found and, if set,
912867594505Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
912967594505SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
913067594505SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
91318c4a8e55Smrg
913267594505SmrgBUILDTXTDOC=no
913367594505SmrgBUILDPDFDOC=no
913467594505SmrgBUILDPSDOC=no
913567594505SmrgBUILDHTMLDOC=no
91368c4a8e55Smrg
913767594505SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
913867594505SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
913967594505SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
914067594505SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
91418c4a8e55Smrg
914267594505SmrgAC_MSG_CHECKING([whether to build text documentation])
914367594505Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
914467594505Smrg   test x$BUILD_TXTDOC != xno; then
914567594505Smrg	BUILDTXTDOC=yes
914667594505Smrgfi
914767594505SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
914867594505SmrgAC_MSG_RESULT([$BUILDTXTDOC])
91498c4a8e55Smrg
915067594505SmrgAC_MSG_CHECKING([whether to build PDF documentation])
915167594505Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
915267594505Smrg   test x$BUILD_PDFDOC != xno; then
915367594505Smrg	BUILDPDFDOC=yes
915467594505Smrgfi
915567594505SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
915667594505SmrgAC_MSG_RESULT([$BUILDPDFDOC])
91578c4a8e55Smrg
915867594505SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
915967594505Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
916067594505Smrg   test x$BUILD_PSDOC != xno; then
916167594505Smrg	BUILDPSDOC=yes
916267594505Smrgfi
916367594505SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
916467594505SmrgAC_MSG_RESULT([$BUILDPSDOC])
9165bd23fbfaSmrg
916667594505SmrgAC_MSG_CHECKING([whether to build HTML documentation])
916767594505Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
916867594505Smrg   test x$BUILD_HTMLDOC != xno; then
916967594505Smrg	BUILDHTMLDOC=yes
917067594505Smrgfi
917167594505SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
917267594505SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
9173bd23fbfaSmrg
917467594505SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
917567594505SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
917667594505SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
917767594505SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
91788c4a8e55Smrg
917967594505SmrgAC_SUBST(MAKE_TEXT)
918067594505SmrgAC_SUBST(MAKE_PS)
918167594505SmrgAC_SUBST(MAKE_PDF)
918267594505SmrgAC_SUBST(MAKE_HTML)
918367594505Smrg]) # XORG_CHECK_DOCBOOK
91848c4a8e55Smrg
918567594505Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
918667594505Smrg# ----------------
918767594505Smrg# Minimum version: 1.5.0
918867594505Smrg# Minimum version for optional DEFAULT argument: 1.11.0
91890597fb56Smrg#
919067594505Smrg# Documentation tools are not always available on all platforms and sometimes
919167594505Smrg# not at the appropriate level. This macro enables a module to test for the
919267594505Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
919367594505Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
919467594505Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
919567594505Smrg# --with-xmlto assumes 'auto'.
91960597fb56Smrg#
919767594505Smrg# Interface to module:
919867594505Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
919967594505Smrg# XMLTO:	returns the path of the xmlto program found
920067594505Smrg#		returns the path set by the user in the environment
920167594505Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
920267594505Smrg#		'no' user instructs the module not to use xmlto
92030597fb56Smrg#
920467594505Smrg# Added in version 1.10.0
920567594505Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
920667594505Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
92070597fb56Smrg#
920867594505Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
92090597fb56Smrg#
921067594505SmrgAC_DEFUN([XORG_WITH_XMLTO],[
921167594505SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
921267594505Smrgm4_define([_defopt], m4_default([$2], [auto]))
921367594505SmrgAC_ARG_WITH(xmlto,
921467594505Smrg	AS_HELP_STRING([--with-xmlto],
921567594505Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
921667594505Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
921767594505Smrgm4_undefine([_defopt])
92180597fb56Smrg
921967594505Smrgif test "x$use_xmlto" = x"auto"; then
922067594505Smrg   AC_PATH_PROG([XMLTO], [xmlto])
922167594505Smrg   if test "x$XMLTO" = "x"; then
922267594505Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
922367594505Smrg	have_xmlto=no
922467594505Smrg   else
922567594505Smrg        have_xmlto=yes
922667594505Smrg   fi
922767594505Smrgelif test "x$use_xmlto" = x"yes" ; then
922867594505Smrg   AC_PATH_PROG([XMLTO], [xmlto])
922967594505Smrg   if test "x$XMLTO" = "x"; then
923067594505Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
923167594505Smrg   fi
923267594505Smrg   have_xmlto=yes
923367594505Smrgelif test "x$use_xmlto" = x"no" ; then
923467594505Smrg   if test "x$XMLTO" != "x"; then
923567594505Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
923667594505Smrg   fi
923767594505Smrg   have_xmlto=no
92388bd17e5fSmrgelse
923967594505Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
92408bd17e5fSmrgfi
92418c4a8e55Smrg
924267594505Smrg# Test for a minimum version of xmlto, if provided.
924367594505Smrgm4_ifval([$1],
924467594505Smrg[if test "$have_xmlto" = yes; then
924567594505Smrg    # scrape the xmlto version
924667594505Smrg    AC_MSG_CHECKING([the xmlto version])
924767594505Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
924867594505Smrg    AC_MSG_RESULT([$xmlto_version])
924967594505Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
925067594505Smrg        [if test "x$use_xmlto" = xauto; then
925167594505Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
925267594505Smrg            have_xmlto=no
925367594505Smrg        else
925467594505Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
925567594505Smrg        fi])
925667594505Smrgfi])
92570597fb56Smrg
925867594505Smrg# Test for the ability of xmlto to generate a text target
925967594505Smrghave_xmlto_text=no
926067594505Smrgcat > conftest.xml << "EOF"
926167594505SmrgEOF
926267594505SmrgAS_IF([test "$have_xmlto" = yes],
926367594505Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
926467594505Smrg             [have_xmlto_text=yes],
926567594505Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
926667594505Smrgrm -f conftest.xml
926767594505SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
926867594505SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
926967594505Smrg]) # XORG_WITH_XMLTO
92708c4a8e55Smrg
927167594505Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
927267594505Smrg# --------------------------------------------
927367594505Smrg# Minimum version: 1.12.0
927467594505Smrg# Minimum version for optional DEFAULT argument: 1.12.0
927567594505Smrg#
927667594505Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
927767594505Smrg# XML-based language used for the transformation of XML documents.
927867594505Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
927967594505Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
928067594505Smrg# The XSLT processor is often used as a standalone tool for transformations.
928167594505Smrg# It should not be assumed that this tool is used only to work with documnetation.
928267594505Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
928367594505Smrg#
928467594505Smrg# Interface to module:
928567594505Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
928667594505Smrg# XSLTPROC:	 returns the path of the xsltproc program found
928767594505Smrg#		 returns the path set by the user in the environment
928867594505Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
928967594505Smrg#		  'no' user instructs the module not to use xsltproc
929067594505Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
929167594505Smrg#
929267594505Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
929367594505Smrg#
929467594505SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
929567594505SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
929667594505Smrg# Preserves the interface, should it be implemented later
929767594505Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
929867594505Smrgm4_define([_defopt], m4_default([$2], [auto]))
929967594505SmrgAC_ARG_WITH(xsltproc,
930067594505Smrg	AS_HELP_STRING([--with-xsltproc],
930167594505Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
930267594505Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
930367594505Smrgm4_undefine([_defopt])
9304706b6b52Smrg
930567594505Smrgif test "x$use_xsltproc" = x"auto"; then
930667594505Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
930767594505Smrg   if test "x$XSLTPROC" = "x"; then
930867594505Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
930967594505Smrg	have_xsltproc=no
931067594505Smrg   else
931167594505Smrg        have_xsltproc=yes
931267594505Smrg   fi
931367594505Smrgelif test "x$use_xsltproc" = x"yes" ; then
931467594505Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
931567594505Smrg   if test "x$XSLTPROC" = "x"; then
931667594505Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
931767594505Smrg   fi
931867594505Smrg   have_xsltproc=yes
931967594505Smrgelif test "x$use_xsltproc" = x"no" ; then
932067594505Smrg   if test "x$XSLTPROC" != "x"; then
932167594505Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
932267594505Smrg   fi
932367594505Smrg   have_xsltproc=no
932467594505Smrgelse
932567594505Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
93268bd17e5fSmrgfi
93270597fb56Smrg
932867594505SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
932967594505Smrg]) # XORG_WITH_XSLTPROC
93300597fb56Smrg
933167594505Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
933267594505Smrg# ----------------------------------------
933367594505Smrg# Minimum version: 1.15.0
933467594505Smrg#
933567594505Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
933667594505Smrg# scanning arbitrary text files, extracting information from those text files,
933767594505Smrg# and printing reports based on that information.
933867594505Smrg#
933967594505Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
934067594505Smrg#
934167594505Smrg# Interface to module:
934267594505Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
934367594505Smrg# PERL:	     returns the path of the perl program found
934467594505Smrg#	     returns the path set by the user in the environment
934567594505Smrg# --with-perl: 'yes' user instructs the module to use perl
934667594505Smrg#	       'no' user instructs the module not to use perl
934767594505Smrg# have_perl: returns yes if perl found in PATH or no
934867594505Smrg#
934967594505Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
935067594505Smrg#
935167594505SmrgAC_DEFUN([XORG_WITH_PERL],[
935267594505SmrgAC_ARG_VAR([PERL], [Path to perl command])
935367594505Smrg# Preserves the interface, should it be implemented later
935467594505Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
935567594505Smrgm4_define([_defopt], m4_default([$2], [auto]))
935667594505SmrgAC_ARG_WITH(perl,
935767594505Smrg	AS_HELP_STRING([--with-perl],
935867594505Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
935967594505Smrg	   [use_perl=$withval], [use_perl=]_defopt)
936067594505Smrgm4_undefine([_defopt])
93610597fb56Smrg
936267594505Smrgif test "x$use_perl" = x"auto"; then
936367594505Smrg   AC_PATH_PROG([PERL], [perl])
936467594505Smrg   if test "x$PERL" = "x"; then
936567594505Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
936667594505Smrg	have_perl=no
936767594505Smrg   else
936867594505Smrg        have_perl=yes
936967594505Smrg   fi
937067594505Smrgelif test "x$use_perl" = x"yes" ; then
937167594505Smrg   AC_PATH_PROG([PERL], [perl])
937267594505Smrg   if test "x$PERL" = "x"; then
937367594505Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
937467594505Smrg   fi
937567594505Smrg   have_perl=yes
937667594505Smrgelif test "x$use_perl" = x"no" ; then
937767594505Smrg   if test "x$PERL" != "x"; then
937867594505Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
937967594505Smrg   fi
938067594505Smrg   have_perl=no
938167594505Smrgelse
938267594505Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
93838bd17e5fSmrgfi
93840597fb56Smrg
938567594505SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
938667594505Smrg]) # XORG_WITH_PERL
93870597fb56Smrg
938867594505Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
938967594505Smrg# ----------------
939067594505Smrg# Minimum version: 1.5.0
939167594505Smrg# Minimum version for optional DEFAULT argument: 1.11.0
939267594505Smrg#
939367594505Smrg# Documentation tools are not always available on all platforms and sometimes
939467594505Smrg# not at the appropriate level. This macro enables a module to test for the
939567594505Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
939667594505Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
939767594505Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
939867594505Smrg# --with-asciidoc assumes 'auto'.
939967594505Smrg#
940067594505Smrg# Interface to module:
940167594505Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
940267594505Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
940367594505Smrg#		 returns the path set by the user in the environment
940467594505Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
940567594505Smrg#		  'no' user instructs the module not to use asciidoc
940667594505Smrg#
940767594505Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
940867594505Smrg#
940967594505SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
941067594505SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
941167594505Smrgm4_define([_defopt], m4_default([$2], [auto]))
941267594505SmrgAC_ARG_WITH(asciidoc,
941367594505Smrg	AS_HELP_STRING([--with-asciidoc],
941467594505Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
941567594505Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
941667594505Smrgm4_undefine([_defopt])
94178c4a8e55Smrg
941867594505Smrgif test "x$use_asciidoc" = x"auto"; then
941967594505Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
942067594505Smrg   if test "x$ASCIIDOC" = "x"; then
942167594505Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
942267594505Smrg	have_asciidoc=no
942367594505Smrg   else
942467594505Smrg        have_asciidoc=yes
942567594505Smrg   fi
942667594505Smrgelif test "x$use_asciidoc" = x"yes" ; then
942767594505Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
942867594505Smrg   if test "x$ASCIIDOC" = "x"; then
942967594505Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
943067594505Smrg   fi
943167594505Smrg   have_asciidoc=yes
943267594505Smrgelif test "x$use_asciidoc" = x"no" ; then
943367594505Smrg   if test "x$ASCIIDOC" != "x"; then
943467594505Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
943567594505Smrg   fi
943667594505Smrg   have_asciidoc=no
943767594505Smrgelse
943867594505Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
943967594505Smrgfi
944067594505Smrgm4_ifval([$1],
944167594505Smrg[if test "$have_asciidoc" = yes; then
944267594505Smrg    # scrape the asciidoc version
944367594505Smrg    AC_MSG_CHECKING([the asciidoc version])
944467594505Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
944567594505Smrg    AC_MSG_RESULT([$asciidoc_version])
944667594505Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
944767594505Smrg        [if test "x$use_asciidoc" = xauto; then
944867594505Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
944967594505Smrg            have_asciidoc=no
945067594505Smrg        else
945167594505Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
945267594505Smrg        fi])
945367594505Smrgfi])
945467594505SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
945567594505Smrg]) # XORG_WITH_ASCIIDOC
94560597fb56Smrg
945767594505Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
945867594505Smrg# -------------------------------------------
945967594505Smrg# Minimum version: 1.5.0
946067594505Smrg# Minimum version for optional DEFAULT argument: 1.11.0
946167594505Smrg# Minimum version for optional DOT checking: 1.18.0
94628bd17e5fSmrg#
946367594505Smrg# Documentation tools are not always available on all platforms and sometimes
946467594505Smrg# not at the appropriate level. This macro enables a module to test for the
946567594505Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
946667594505Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
946767594505Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
946867594505Smrg# --with-doxygen assumes 'auto'.
946967594505Smrg#
947067594505Smrg# Interface to module:
947167594505Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
947267594505Smrg# DOXYGEN:	 returns the path of the doxygen program found
947367594505Smrg#		 returns the path set by the user in the environment
947467594505Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
947567594505Smrg#		  'no' user instructs the module not to use doxygen
947667594505Smrg#
947767594505Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
947867594505Smrg#
947967594505SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
948067594505SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
948167594505SmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
948267594505Smrgm4_define([_defopt], m4_default([$2], [auto]))
948367594505SmrgAC_ARG_WITH(doxygen,
948467594505Smrg	AS_HELP_STRING([--with-doxygen],
948567594505Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
948667594505Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
948767594505Smrgm4_undefine([_defopt])
94888bd17e5fSmrg
948967594505Smrgif test "x$use_doxygen" = x"auto"; then
949067594505Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
949167594505Smrg   if test "x$DOXYGEN" = "x"; then
949267594505Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
949367594505Smrg	have_doxygen=no
949467594505Smrg   else
949567594505Smrg        have_doxygen=yes
949667594505Smrg   fi
949767594505Smrgelif test "x$use_doxygen" = x"yes" ; then
949867594505Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
949967594505Smrg   if test "x$DOXYGEN" = "x"; then
950067594505Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
950167594505Smrg   fi
950267594505Smrg   have_doxygen=yes
950367594505Smrgelif test "x$use_doxygen" = x"no" ; then
950467594505Smrg   if test "x$DOXYGEN" != "x"; then
950567594505Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
950667594505Smrg   fi
950767594505Smrg   have_doxygen=no
95080597fb56Smrgelse
950967594505Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
95100597fb56Smrgfi
951167594505Smrgm4_ifval([$1],
951267594505Smrg[if test "$have_doxygen" = yes; then
951367594505Smrg    # scrape the doxygen version
951467594505Smrg    AC_MSG_CHECKING([the doxygen version])
951567594505Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
951667594505Smrg    AC_MSG_RESULT([$doxygen_version])
951767594505Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
951867594505Smrg        [if test "x$use_doxygen" = xauto; then
951967594505Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
952067594505Smrg            have_doxygen=no
952167594505Smrg        else
952267594505Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
952367594505Smrg        fi])
952467594505Smrgfi])
95258c4a8e55Smrg
952667594505Smrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
952767594505Smrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
952867594505Smrgdnl 	HAVE_DOT = @HAVE_DOT@
952967594505SmrgHAVE_DOT=no
953067594505Smrgif test "x$have_doxygen" = "xyes"; then
953167594505Smrg  AC_PATH_PROG([DOT], [dot])
953267594505Smrg    if test "x$DOT" != "x"; then
953367594505Smrg      HAVE_DOT=yes
953467594505Smrg    fi
953567594505Smrgfi
95360597fb56Smrg
953767594505SmrgAC_SUBST([HAVE_DOT])
953867594505SmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
953967594505SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
954067594505Smrg]) # XORG_WITH_DOXYGEN
954167594505Smrg
954267594505Smrg# XORG_WITH_GROFF([DEFAULT])
954367594505Smrg# ----------------
954467594505Smrg# Minimum version: 1.6.0
954567594505Smrg# Minimum version for optional DEFAULT argument: 1.11.0
954667594505Smrg#
954767594505Smrg# Documentation tools are not always available on all platforms and sometimes
954867594505Smrg# not at the appropriate level. This macro enables a module to test for the
954967594505Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
955067594505Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
955167594505Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
955267594505Smrg# --with-groff assumes 'auto'.
955367594505Smrg#
955467594505Smrg# Interface to module:
955567594505Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
955667594505Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
955767594505Smrg# HAVE_GROFF_MS: the -ms macros package
955867594505Smrg# GROFF:	 returns the path of the groff program found
955967594505Smrg#		 returns the path set by the user in the environment
956067594505Smrg# --with-groff:	 'yes' user instructs the module to use groff
956167594505Smrg#		 'no' user instructs the module not to use groff
956267594505Smrg#
956367594505Smrg# Added in version 1.9.0:
956467594505Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
956567594505Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
956667594505Smrg#		   psselect from the psutils package.
956767594505Smrg#		   the ghostcript package. Refer to the grohtml man pages
956867594505Smrg#
956967594505Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
957067594505Smrg#
957167594505Smrg# OS and distros often splits groff in a basic and full package, the former
957267594505Smrg# having the groff program and the later having devices, fonts and macros
957367594505Smrg# Checking for the groff executable is not enough.
95748bd17e5fSmrg#
957567594505Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
957667594505Smrg# unset HAVE_GROFF or GROFF env variables.
957767594505Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
957867594505Smrg#
957967594505SmrgAC_DEFUN([XORG_WITH_GROFF],[
958067594505SmrgAC_ARG_VAR([GROFF], [Path to groff command])
958167594505Smrgm4_define([_defopt], m4_default([$1], [auto]))
958267594505SmrgAC_ARG_WITH(groff,
958367594505Smrg	AS_HELP_STRING([--with-groff],
958467594505Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
958567594505Smrg	   [use_groff=$withval], [use_groff=]_defopt)
958667594505Smrgm4_undefine([_defopt])
95870597fb56Smrg
958867594505Smrgif test "x$use_groff" = x"auto"; then
958967594505Smrg   AC_PATH_PROG([GROFF], [groff])
959067594505Smrg   if test "x$GROFF" = "x"; then
959167594505Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
959267594505Smrg	have_groff=no
959367594505Smrg   else
959467594505Smrg        have_groff=yes
959567594505Smrg   fi
959667594505Smrgelif test "x$use_groff" = x"yes" ; then
959767594505Smrg   AC_PATH_PROG([GROFF], [groff])
959867594505Smrg   if test "x$GROFF" = "x"; then
959967594505Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
960067594505Smrg   fi
960167594505Smrg   have_groff=yes
960267594505Smrgelif test "x$use_groff" = x"no" ; then
960367594505Smrg   if test "x$GROFF" != "x"; then
960467594505Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
960567594505Smrg   fi
960667594505Smrg   have_groff=no
96078bd17e5fSmrgelse
960867594505Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
96098bd17e5fSmrgfi
96100597fb56Smrg
961167594505Smrg# We have groff, test for the presence of the macro packages
961267594505Smrgif test "x$have_groff" = x"yes"; then
961367594505Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
961467594505Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
961567594505Smrg        groff_ms_works=yes
961667594505Smrg    else
961767594505Smrg        groff_ms_works=no
961867594505Smrg    fi
961967594505Smrg    AC_MSG_RESULT([$groff_ms_works])
962067594505Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
962167594505Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
962267594505Smrg        groff_mm_works=yes
962367594505Smrg    else
962467594505Smrg        groff_mm_works=no
962567594505Smrg    fi
962667594505Smrg    AC_MSG_RESULT([$groff_mm_works])
9627bd23fbfaSmrgfi
96288c4a8e55Smrg
962967594505Smrg# We have groff, test for HTML dependencies, one command per package
963067594505Smrgif test "x$have_groff" = x"yes"; then
963167594505Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
963267594505Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
963367594505Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
963467594505Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
963567594505Smrg      have_groff_html=yes
963667594505Smrg   else
963767594505Smrg      have_groff_html=no
963867594505Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
963967594505Smrg   fi
964067594505Smrgfi
96418bd17e5fSmrg
964267594505Smrg# Set Automake conditionals for Makefiles
964367594505SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
964467594505SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
964567594505SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
964667594505SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
964767594505Smrg]) # XORG_WITH_GROFF
96488bd17e5fSmrg
964967594505Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
965067594505Smrg# ---------------------------------------
965167594505Smrg# Minimum version: 1.6.0
965267594505Smrg# Minimum version for optional DEFAULT argument: 1.11.0
965367594505Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
96540597fb56Smrg#
965567594505Smrg# Documentation tools are not always available on all platforms and sometimes
965667594505Smrg# not at the appropriate level. This macro enables a module to test for the
965767594505Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
965867594505Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
965967594505Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
966067594505Smrg# --with-fop assumes 'auto'.
966167594505Smrg#
966267594505Smrg# Interface to module:
966367594505Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
966467594505Smrg# FOP:	 	returns the path of the fop program found
966567594505Smrg#		returns the path set by the user in the environment
966667594505Smrg# --with-fop: 	'yes' user instructs the module to use fop
966767594505Smrg#		'no' user instructs the module not to use fop
966867594505Smrg#
966967594505Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
967067594505Smrg#
967167594505SmrgAC_DEFUN([XORG_WITH_FOP],[
967267594505SmrgAC_ARG_VAR([FOP], [Path to fop command])
967367594505Smrgm4_define([_defopt], m4_default([$2], [auto]))
967467594505SmrgAC_ARG_WITH(fop,
967567594505Smrg	AS_HELP_STRING([--with-fop],
967667594505Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
967767594505Smrg	   [use_fop=$withval], [use_fop=]_defopt)
967867594505Smrgm4_undefine([_defopt])
96790597fb56Smrg
968067594505Smrgif test "x$use_fop" = x"auto"; then
968167594505Smrg   AC_PATH_PROG([FOP], [fop])
968267594505Smrg   if test "x$FOP" = "x"; then
968367594505Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
968467594505Smrg	have_fop=no
968567594505Smrg   else
968667594505Smrg        have_fop=yes
968767594505Smrg   fi
968867594505Smrgelif test "x$use_fop" = x"yes" ; then
968967594505Smrg   AC_PATH_PROG([FOP], [fop])
969067594505Smrg   if test "x$FOP" = "x"; then
969167594505Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
969267594505Smrg   fi
969367594505Smrg   have_fop=yes
969467594505Smrgelif test "x$use_fop" = x"no" ; then
969567594505Smrg   if test "x$FOP" != "x"; then
969667594505Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
969767594505Smrg   fi
969867594505Smrg   have_fop=no
969967594505Smrgelse
970067594505Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
9701bd23fbfaSmrgfi
97028c4a8e55Smrg
970367594505Smrg# Test for a minimum version of fop, if provided.
970467594505Smrgm4_ifval([$1],
970567594505Smrg[if test "$have_fop" = yes; then
970667594505Smrg    # scrape the fop version
970767594505Smrg    AC_MSG_CHECKING([for fop minimum version])
970867594505Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
970967594505Smrg    AC_MSG_RESULT([$fop_version])
971067594505Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
971167594505Smrg        [if test "x$use_fop" = xauto; then
971267594505Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
971367594505Smrg            have_fop=no
971467594505Smrg        else
971567594505Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
971667594505Smrg        fi])
971767594505Smrgfi])
971867594505SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
971967594505Smrg]) # XORG_WITH_FOP
9720bd23fbfaSmrg
972167594505Smrg# XORG_WITH_M4([MIN-VERSION])
972267594505Smrg# ---------------------------
972367594505Smrg# Minimum version: 1.19.0
972467594505Smrg#
972567594505Smrg# This macro attempts to locate an m4 macro processor which supports
972667594505Smrg# -I option and is only useful for modules relying on M4 in order to
972767594505Smrg# expand macros in source code files.
972867594505Smrg#
972967594505Smrg# Interface to module:
973067594505Smrg# M4:	 	returns the path of the m4 program found
973167594505Smrg#		returns the path set by the user in the environment
973267594505Smrg#
973367594505SmrgAC_DEFUN([XORG_WITH_M4], [
973467594505SmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
973567594505Smrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
973667594505Smrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
973767594505Smrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
973867594505Smrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
973967594505Smrg   [$PATH:/usr/gnu/bin])])
97400597fb56Smrg
974167594505SmrgAC_SUBST([M4], [$ac_cv_path_M4])
974267594505Smrg]) # XORG_WITH_M4
97438c4a8e55Smrg
974467594505Smrg# XORG_WITH_PS2PDF([DEFAULT])
97450597fb56Smrg# ----------------
974667594505Smrg# Minimum version: 1.6.0
97478bd17e5fSmrg# Minimum version for optional DEFAULT argument: 1.11.0
97488c4a8e55Smrg#
97498bd17e5fSmrg# Documentation tools are not always available on all platforms and sometimes
97508bd17e5fSmrg# not at the appropriate level. This macro enables a module to test for the
97518bd17e5fSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
975267594505Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
975367594505Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
975467594505Smrg# --with-ps2pdf assumes 'auto'.
9755706b6b52Smrg#
97568bd17e5fSmrg# Interface to module:
975767594505Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
975867594505Smrg# PS2PDF:	returns the path of the ps2pdf program found
975967594505Smrg#		returns the path set by the user in the environment
976067594505Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
976167594505Smrg#		 'no' user instructs the module not to use ps2pdf
97620597fb56Smrg#
976367594505Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
97640597fb56Smrg#
976567594505SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
976667594505SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
976767594505Smrgm4_define([_defopt], m4_default([$1], [auto]))
976867594505SmrgAC_ARG_WITH(ps2pdf,
976967594505Smrg	AS_HELP_STRING([--with-ps2pdf],
977067594505Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
977167594505Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
97728bd17e5fSmrgm4_undefine([_defopt])
97738c4a8e55Smrg
977467594505Smrgif test "x$use_ps2pdf" = x"auto"; then
977567594505Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
977667594505Smrg   if test "x$PS2PDF" = "x"; then
977767594505Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
977867594505Smrg	have_ps2pdf=no
97798bd17e5fSmrg   else
978067594505Smrg        have_ps2pdf=yes
97818bd17e5fSmrg   fi
978267594505Smrgelif test "x$use_ps2pdf" = x"yes" ; then
978367594505Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
978467594505Smrg   if test "x$PS2PDF" = "x"; then
978567594505Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
97868bd17e5fSmrg   fi
978767594505Smrg   have_ps2pdf=yes
978867594505Smrgelif test "x$use_ps2pdf" = x"no" ; then
978967594505Smrg   if test "x$PS2PDF" != "x"; then
979067594505Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
97918bd17e5fSmrg   fi
979267594505Smrg   have_ps2pdf=no
97938bd17e5fSmrgelse
979467594505Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
97958bd17e5fSmrgfi
979667594505SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
979767594505Smrg]) # XORG_WITH_PS2PDF
97988c4a8e55Smrg
979967594505Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
980067594505Smrg# ----------------
980167594505Smrg# Minimum version: 1.6.0
980267594505Smrg#
980367594505Smrg# Documentation tools are not always available on all platforms and sometimes
980467594505Smrg# not at the appropriate level. This macro enables a builder to skip all
980567594505Smrg# documentation targets except traditional man pages.
980667594505Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
980767594505Smrg# maximum flexibilty in controlling documentation building.
980867594505Smrg# Refer to:
980967594505Smrg# XORG_WITH_XMLTO         --with-xmlto
981067594505Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
981167594505Smrg# XORG_WITH_DOXYGEN       --with-doxygen
981267594505Smrg# XORG_WITH_FOP           --with-fop
981367594505Smrg# XORG_WITH_GROFF         --with-groff
981467594505Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
981567594505Smrg#
981667594505Smrg# Interface to module:
981767594505Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
981867594505Smrg# --enable-docs: 'yes' user instructs the module to generate docs
981967594505Smrg#		 'no' user instructs the module not to generate docs
982067594505Smrg# parm1:	specify the default value, yes or no.
982167594505Smrg#
982267594505SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
982367594505Smrgm4_define([docs_default], m4_default([$1], [yes]))
982467594505SmrgAC_ARG_ENABLE(docs,
982567594505Smrg	AS_HELP_STRING([--enable-docs],
982667594505Smrg	   [Enable building the documentation (default: ]docs_default[)]),
982767594505Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
982867594505Smrgm4_undefine([docs_default])
982967594505SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
983067594505SmrgAC_MSG_CHECKING([whether to build documentation])
983167594505SmrgAC_MSG_RESULT([$build_docs])
983267594505Smrg]) # XORG_ENABLE_DOCS
98338c4a8e55Smrg
983467594505Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
983567594505Smrg# ----------------
983667594505Smrg# Minimum version: 1.6.0
983767594505Smrg#
983867594505Smrg# This macro enables a builder to skip all developer documentation.
983967594505Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
984067594505Smrg# maximum flexibilty in controlling documentation building.
984167594505Smrg# Refer to:
984267594505Smrg# XORG_WITH_XMLTO         --with-xmlto
984367594505Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
984467594505Smrg# XORG_WITH_DOXYGEN       --with-doxygen
984567594505Smrg# XORG_WITH_FOP           --with-fop
984667594505Smrg# XORG_WITH_GROFF         --with-groff
984767594505Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
984867594505Smrg#
984967594505Smrg# Interface to module:
985067594505Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
985167594505Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
985267594505Smrg#			'no' user instructs the module not to generate developer docs
985367594505Smrg# parm1:		specify the default value, yes or no.
985467594505Smrg#
985567594505SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
985667594505Smrgm4_define([devel_default], m4_default([$1], [yes]))
985767594505SmrgAC_ARG_ENABLE(devel-docs,
985867594505Smrg	AS_HELP_STRING([--enable-devel-docs],
985967594505Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
986067594505Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
986167594505Smrgm4_undefine([devel_default])
986267594505SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
986367594505SmrgAC_MSG_CHECKING([whether to build developer documentation])
986467594505SmrgAC_MSG_RESULT([$build_devel_docs])
986567594505Smrg]) # XORG_ENABLE_DEVEL_DOCS
98668c4a8e55Smrg
986767594505Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
986867594505Smrg# ----------------
986967594505Smrg# Minimum version: 1.6.0
98700597fb56Smrg#
987167594505Smrg# This macro enables a builder to skip all functional specification targets.
987267594505Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
987367594505Smrg# maximum flexibilty in controlling documentation building.
987467594505Smrg# Refer to:
987567594505Smrg# XORG_WITH_XMLTO         --with-xmlto
987667594505Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
987767594505Smrg# XORG_WITH_DOXYGEN       --with-doxygen
987867594505Smrg# XORG_WITH_FOP           --with-fop
987967594505Smrg# XORG_WITH_GROFF         --with-groff
988067594505Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
98818bd17e5fSmrg#
98828bd17e5fSmrg# Interface to module:
988367594505Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
988467594505Smrg# --enable-specs:	'yes' user instructs the module to generate specs
988567594505Smrg#			'no' user instructs the module not to generate specs
988667594505Smrg# parm1:		specify the default value, yes or no.
98878bd17e5fSmrg#
988867594505SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
988967594505Smrgm4_define([spec_default], m4_default([$1], [yes]))
989067594505SmrgAC_ARG_ENABLE(specs,
989167594505Smrg	AS_HELP_STRING([--enable-specs],
989267594505Smrg	   [Enable building the specs (default: ]spec_default[)]),
989367594505Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
989467594505Smrgm4_undefine([spec_default])
989567594505SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
989667594505SmrgAC_MSG_CHECKING([whether to build functional specifications])
989767594505SmrgAC_MSG_RESULT([$build_specs])
989867594505Smrg]) # XORG_ENABLE_SPECS
989967594505Smrg
990067594505Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
990167594505Smrg# ----------------------------------------------
990267594505Smrg# Minimum version: 1.13.0
99038bd17e5fSmrg#
990467594505Smrg# This macro enables a builder to enable/disable unit testing
990567594505Smrg# It makes no assumption about the test cases implementation
990667594505Smrg# Test cases may or may not use Automake "Support for test suites"
990767594505Smrg# They may or may not use the software utility library GLib
990867594505Smrg#
990967594505Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
991067594505Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
991167594505Smrg# The variable enable_unit_tests is used by other macros in this file.
991267594505Smrg#
991367594505Smrg# Interface to module:
991467594505Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
991567594505Smrg# enable_unit_tests:    used in configure.ac for additional configuration
991667594505Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
991767594505Smrg#			'no' user instructs the module not to build tests
991867594505Smrg# parm1:		specify the default value, yes or no.
991967594505Smrg#
992067594505SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
992167594505SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
992267594505SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
992367594505SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
992467594505Smrgm4_define([_defopt], m4_default([$1], [auto]))
992567594505SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
992667594505Smrg	[Enable building unit test cases (default: ]_defopt[)]),
992767594505Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
99288bd17e5fSmrgm4_undefine([_defopt])
992967594505SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
993067594505SmrgAC_MSG_CHECKING([whether to build unit test cases])
993167594505SmrgAC_MSG_RESULT([$enable_unit_tests])
993267594505Smrg]) # XORG_ENABLE_UNIT_TESTS
99338bd17e5fSmrg
993467594505Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
993567594505Smrg# ------------------------------------------------------
993667594505Smrg# Minimum version: 1.17.0
993767594505Smrg#
993867594505Smrg# This macro enables a builder to enable/disable integration testing
993967594505Smrg# It makes no assumption about the test cases' implementation
994067594505Smrg# Test cases may or may not use Automake "Support for test suites"
994167594505Smrg#
994267594505Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
994367594505Smrg# usually requires less dependencies and may be built and run under less
994467594505Smrg# stringent environments than integration tests.
994567594505Smrg#
994667594505Smrg# Interface to module:
994767594505Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
994867594505Smrg# enable_integration_tests:   used in configure.ac for additional configuration
994967594505Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
995067594505Smrg#                             'no' user instructs the module not to build tests
995167594505Smrg# parm1:                      specify the default value, yes or no.
995267594505Smrg#
995367594505SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
995467594505SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
995567594505Smrgm4_define([_defopt], m4_default([$1], [auto]))
995667594505SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
995767594505Smrg	[Enable building integration test cases (default: ]_defopt[)]),
995867594505Smrg	[enable_integration_tests=$enableval],
995967594505Smrg	[enable_integration_tests=]_defopt)
996067594505Smrgm4_undefine([_defopt])
996167594505SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
996267594505Smrg	[test "x$enable_integration_tests" != xno])
996367594505SmrgAC_MSG_CHECKING([whether to build unit test cases])
996467594505SmrgAC_MSG_RESULT([$enable_integration_tests])
996567594505Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
99668c4a8e55Smrg
996767594505Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
99688bd17e5fSmrg# ----------------------------------------
996967594505Smrg# Minimum version: 1.13.0
99700597fb56Smrg#
997167594505Smrg# GLib is a library which provides advanced data structures and functions.
997267594505Smrg# This macro enables a module to test for the presence of Glib.
99730597fb56Smrg#
997467594505Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
997567594505Smrg# Otherwise the value of $enable_unit_tests is blank.
99760597fb56Smrg#
997767594505Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
997867594505Smrg# test support usually requires less dependencies and may be built and run under
997967594505Smrg# less stringent environments than integration tests.
99800597fb56Smrg#
998167594505Smrg# Interface to module:
998267594505Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
998367594505Smrg# with_glib: used in configure.ac to know if GLib has been found
998467594505Smrg# --with-glib:	'yes' user instructs the module to use glib
998567594505Smrg#		'no' user instructs the module not to use glib
99860597fb56Smrg#
998767594505SmrgAC_DEFUN([XORG_WITH_GLIB],[
998867594505SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
99898bd17e5fSmrgm4_define([_defopt], m4_default([$2], [auto]))
999067594505SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
999167594505Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
999267594505Smrg	[with_glib=$withval], [with_glib=]_defopt)
99938bd17e5fSmrgm4_undefine([_defopt])
99948c4a8e55Smrg
999567594505Smrghave_glib=no
999667594505Smrg# Do not probe GLib if user explicitly disabled unit testing
999767594505Smrgif test "x$enable_unit_tests" != x"no"; then
999867594505Smrg  # Do not probe GLib if user explicitly disabled it
999967594505Smrg  if test "x$with_glib" != x"no"; then
1000067594505Smrg    m4_ifval(
1000167594505Smrg      [$1],
1000267594505Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
1000367594505Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
1000467594505Smrg    )
1000567594505Smrg  fi
100068bd17e5fSmrgfi
100078c4a8e55Smrg
1000867594505Smrg# Not having GLib when unit testing has been explicitly requested is an error
1000967594505Smrgif test "x$enable_unit_tests" = x"yes"; then
1001067594505Smrg  if test "x$have_glib" = x"no"; then
1001167594505Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1001267594505Smrg  fi
1001367594505Smrgfi
100148c4a8e55Smrg
1001567594505Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
1001667594505Smrgif test "x$enable_unit_tests" = x"no"; then
1001767594505Smrg  if test "x$with_glib" = x"yes"; then
1001867594505Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1001967594505Smrg  fi
1002067594505Smrgfi
1002167594505Smrg
1002267594505Smrg# Not having GLib when it has been explicitly requested is an error
1002367594505Smrgif test "x$with_glib" = x"yes"; then
1002467594505Smrg  if test "x$have_glib" = x"no"; then
1002567594505Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
1002667594505Smrg  fi
1002767594505Smrgfi
1002867594505Smrg
1002967594505SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
1003067594505Smrg]) # XORG_WITH_GLIB
1003167594505Smrg
1003267594505Smrg# XORG_LD_WRAP([required|optional])
1003367594505Smrg# ---------------------------------
1003467594505Smrg# Minimum version: 1.13.0
100358bd17e5fSmrg#
1003667594505Smrg# Check if linker supports -wrap, passed via compiler flags
100378bd17e5fSmrg#
1003867594505Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
1003967594505Smrg# Otherwise the value of $enable_unit_tests is blank.
100400597fb56Smrg#
1004167594505Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
1004267594505Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
1004367594505Smrg# available, an argument of "optional" allows use when some unit tests require
1004467594505Smrg# ld -wrap and others do not.
100458bd17e5fSmrg#
1004667594505SmrgAC_DEFUN([XORG_LD_WRAP],[
1004767594505SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
1004867594505Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
1004967594505Smrg                      void __wrap_exit(int status) { return; }],
1005067594505Smrg                     [exit(0);])])
1005167594505Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
1005267594505Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
1005367594505Smrg  if test "x$have_ld_wrap" = x"no"; then
1005467594505Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
1005567594505Smrg  fi
1005667594505Smrgfi
1005767594505SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
1005867594505Smrg#
1005967594505Smrg]) # XORG_LD_WRAP
100608c4a8e55Smrg
1006167594505Smrg# XORG_CHECK_LINKER_FLAGS
1006267594505Smrg# -----------------------
1006367594505Smrg# SYNOPSIS
1006467594505Smrg#
1006567594505Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
1006667594505Smrg#
1006767594505Smrg# DESCRIPTION
1006867594505Smrg#
1006967594505Smrg#   Check whether the given linker FLAGS work with the current language's
1007067594505Smrg#   linker, or whether they give an error.
1007167594505Smrg#
1007267594505Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
1007367594505Smrg#   success/failure.
1007467594505Smrg#
1007567594505Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
1007667594505Smrg#
1007767594505Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
1007867594505Smrg#
1007967594505Smrg# LICENSE
1008067594505Smrg#
1008167594505Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
1008267594505Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
1008367594505Smrg#   Copyright (c) 2009 Matteo Frigo
1008467594505Smrg#
1008567594505Smrg#   This program is free software: you can redistribute it and/or modify it
1008667594505Smrg#   under the terms of the GNU General Public License as published by the
1008767594505Smrg#   Free Software Foundation, either version 3 of the License, or (at your
1008867594505Smrg#   option) any later version.
1008967594505Smrg#
1009067594505Smrg#   This program is distributed in the hope that it will be useful, but
1009167594505Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
1009267594505Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
1009367594505Smrg#   Public License for more details.
1009467594505Smrg#
1009567594505Smrg#   You should have received a copy of the GNU General Public License along
1009667594505Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
1009767594505Smrg#
1009867594505Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
1009967594505Smrg#   gives unlimited permission to copy, distribute and modify the configure
1010067594505Smrg#   scripts that are the output of Autoconf when processing the Macro. You
1010167594505Smrg#   need not follow the terms of the GNU General Public License when using
1010267594505Smrg#   or distributing such scripts, even though portions of the text of the
1010367594505Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
1010467594505Smrg#   all other use of the material that constitutes the Autoconf Macro.
1010567594505Smrg#
1010667594505Smrg#   This special exception to the GPL applies to versions of the Autoconf
1010767594505Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
1010867594505Smrg#   modified version of the Autoconf Macro, you may extend this special
1010967594505Smrg#   exception to the GPL to apply to your modified version as well.#
1011067594505SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
1011167594505Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
1011267594505Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
1011367594505SmrgAS_LITERAL_IF([$1],
1011467594505Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
1011567594505Smrg      ax_save_FLAGS=$LDFLAGS
1011667594505Smrg      LDFLAGS="$1"
1011767594505Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
1011867594505Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1011967594505Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1012067594505Smrg      LDFLAGS=$ax_save_FLAGS])],
1012167594505Smrg  [ax_save_FLAGS=$LDFLAGS
1012267594505Smrg   LDFLAGS="$1"
1012367594505Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
1012467594505Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1012567594505Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1012667594505Smrg   LDFLAGS=$ax_save_FLAGS])
1012767594505Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
1012867594505SmrgAC_MSG_RESULT($xorg_check_linker_flags)
1012967594505Smrgif test "x$xorg_check_linker_flags" = xyes; then
1013067594505Smrg	m4_default([$2], :)
101310597fb56Smrgelse
1013267594505Smrg	m4_default([$3], :)
101330597fb56Smrgfi
1013467594505Smrg]) # XORG_CHECK_LINKER_FLAGS
101358c4a8e55Smrg
1013667594505Smrg# XORG_MEMORY_CHECK_FLAGS
1013767594505Smrg# -----------------------
1013867594505Smrg# Minimum version: 1.16.0
101390597fb56Smrg#
1014067594505Smrg# This macro attempts to find appropriate memory checking functionality
1014167594505Smrg# for various platforms which unit testing code may use to catch various
1014267594505Smrg# forms of memory allocation and access errors in testing.
101430597fb56Smrg#
101448bd17e5fSmrg# Interface to module:
1014567594505Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
1014667594505Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
101478bd17e5fSmrg#
1014867594505Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
101498bd17e5fSmrg#
1015067594505SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
101518c4a8e55Smrg
1015267594505SmrgAC_REQUIRE([AC_CANONICAL_HOST])
1015367594505SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
1015467594505Smrg           [Environment variables to enable memory checking in tests])
1015567594505Smrg
1015667594505Smrg# Check for different types of support on different platforms
1015767594505Smrgcase $host_os in
1015867594505Smrg    solaris*)
1015967594505Smrg        AC_CHECK_LIB([umem], [umem_alloc],
1016067594505Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
1016167594505Smrg        ;;
1016267594505Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
1016367594505Smrg        # both directly and inverted, so should not be 0 or 255.
1016467594505Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
1016567594505Smrg        ;;
1016667594505Smrg    darwin*)
1016767594505Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
1016867594505Smrg        ;;
1016967594505Smrg    *bsd*)
1017067594505Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
1017167594505Smrg        ;;
1017267594505Smrgesac
1017367594505Smrg
1017467594505Smrg# User supplied flags override default flags
1017567594505Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
1017667594505Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
1017767594505Smrgfi
1017867594505Smrg
1017967594505SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
1018067594505Smrg]) # XORG_WITH_LINT
1018167594505Smrg
1018267594505Smrg# XORG_CHECK_MALLOC_ZERO
1018367594505Smrg# ----------------------
1018467594505Smrg# Minimum version: 1.0.0
1018567594505Smrg#
1018667594505Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1018767594505Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1018867594505Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1018967594505SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1019067594505SmrgAC_ARG_ENABLE(malloc0returnsnull,
1019167594505Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1019267594505Smrg		       [malloc(0) returns NULL (default: auto)]),
1019367594505Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1019467594505Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1019567594505Smrg
1019667594505SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1019767594505Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1019867594505SmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
1019967594505Smrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
1020067594505Smrg#include <stdlib.h>
1020167594505Smrg],[
1020267594505Smrg    char *m0, *r0, *c0, *p;
1020367594505Smrg    m0 = malloc(0);
1020467594505Smrg    p = malloc(10);
1020567594505Smrg    r0 = realloc(p,0);
1020667594505Smrg    c0 = calloc(0,10);
1020767594505Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
1020867594505Smrg])],
1020967594505Smrg		[xorg_cv_malloc0_returns_null=yes],
1021067594505Smrg		[xorg_cv_malloc0_returns_null=no])])
1021167594505SmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
1021267594505Smrgfi
1021367594505SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1021467594505Smrg
1021567594505Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1021667594505Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1021767594505Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1021867594505Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
102198bd17e5fSmrgelse
1022067594505Smrg	MALLOC_ZERO_CFLAGS=""
1022167594505Smrg	XMALLOC_ZERO_CFLAGS=""
1022267594505Smrg	XTMALLOC_ZERO_CFLAGS=""
102238bd17e5fSmrgfi
102248c4a8e55Smrg
1022567594505SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1022667594505SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1022767594505SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1022867594505Smrg]) # XORG_CHECK_MALLOC_ZERO
1022967594505Smrg
1023067594505Smrg# XORG_WITH_LINT()
102318bd17e5fSmrg# ----------------
1023267594505Smrg# Minimum version: 1.1.0
102338bd17e5fSmrg#
1023467594505Smrg# This macro enables the use of a tool that flags some suspicious and
1023567594505Smrg# non-portable constructs (likely to be bugs) in C language source code.
1023667594505Smrg# It will attempt to locate the tool and use appropriate options.
1023767594505Smrg# There are various lint type tools on different platforms.
102388bd17e5fSmrg#
102398bd17e5fSmrg# Interface to module:
1024067594505Smrg# LINT:		returns the path to the tool found on the platform
1024167594505Smrg#		or the value set to LINT on the configure cmd line
1024267594505Smrg#		also an Automake conditional
1024367594505Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
102448bd17e5fSmrg#
1024567594505Smrg# --with-lint:	'yes' user instructs the module to use lint
1024667594505Smrg#		'no' user instructs the module not to use lint (default)
102478bd17e5fSmrg#
1024867594505Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1024967594505Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
102508bd17e5fSmrg#
1025167594505SmrgAC_DEFUN([XORG_WITH_LINT],[
102528bd17e5fSmrg
1025367594505SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
1025467594505SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1025567594505SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1025667594505Smrg		[Use a lint-style source code checker (default: disabled)])],
1025767594505Smrg		[use_lint=$withval], [use_lint=no])
1025867594505Smrg
1025967594505Smrg# Obtain platform specific info like program name and options
1026067594505Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
1026167594505Smrgcase $host_os in
1026267594505Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
1026367594505Smrg	lint_name=splint
1026467594505Smrg	lint_options="-badflag"
1026567594505Smrg	;;
1026667594505Smrg  *freebsd* | *netbsd*)
1026767594505Smrg	lint_name=lint
1026867594505Smrg	lint_options="-u -b"
1026967594505Smrg	;;
1027067594505Smrg  *solaris*)
1027167594505Smrg	lint_name=lint
1027267594505Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1027367594505Smrg	;;
1027467594505Smrgesac
1027567594505Smrg
1027667594505Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
1027767594505Smrgif test "x$use_lint" = x"yes" ; then
1027867594505Smrg   AC_PATH_PROG([LINT], [$lint_name])
1027967594505Smrg   if test "x$LINT" = "x"; then
1028067594505Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
102818bd17e5fSmrg   fi
1028267594505Smrgelif test "x$use_lint" = x"no" ; then
1028367594505Smrg   if test "x$LINT" != "x"; then
1028467594505Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
102858bd17e5fSmrg   fi
102860597fb56Smrgelse
1028767594505Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
102880597fb56Smrgfi
102898c4a8e55Smrg
1029067594505Smrg# User supplied flags override default flags
1029167594505Smrgif test "x$LINT_FLAGS" != "x"; then
1029267594505Smrg   lint_options=$LINT_FLAGS
102938bd17e5fSmrgfi
102948c4a8e55Smrg
1029567594505SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
1029667594505SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
1029767594505Smrg
1029867594505Smrg]) # XORG_WITH_LINT
1029967594505Smrg
1030067594505Smrg# XORG_LINT_LIBRARY(LIBNAME)
1030167594505Smrg# --------------------------
1030267594505Smrg# Minimum version: 1.1.0
1030367594505Smrg#
1030467594505Smrg# Sets up flags for building lint libraries for checking programs that call
1030567594505Smrg# functions in the library.
1030667594505Smrg#
1030767594505Smrg# Interface to module:
1030867594505Smrg# LINTLIB		- Automake variable with the name of lint library file to make
1030967594505Smrg# MAKE_LINT_LIB		- Automake conditional
1031067594505Smrg#
1031167594505Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
1031267594505Smrg#			  - 'no' user instructs the module not to create a lint library (default)
1031367594505Smrg
1031467594505SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
1031567594505SmrgAC_REQUIRE([XORG_WITH_LINT])
1031667594505SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1031767594505Smrg	[Create lint library (default: disabled)])],
1031867594505Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1031967594505Smrg
1032067594505Smrgif test "x$make_lint_lib" = x"yes" ; then
1032167594505Smrg   LINTLIB=llib-l$1.ln
1032267594505Smrg   if test "x$LINT" = "x"; then
1032367594505Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
103248bd17e5fSmrg   fi
1032567594505Smrgelif test "x$make_lint_lib" != x"no" ; then
1032667594505Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
103270597fb56Smrgfi
103288c4a8e55Smrg
1032967594505SmrgAC_SUBST(LINTLIB)
1033067594505SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
103318c4a8e55Smrg
1033267594505Smrg]) # XORG_LINT_LIBRARY
1033367594505Smrg
1033467594505Smrg# XORG_COMPILER_BRAND
1033567594505Smrg# -------------------
1033667594505Smrg# Minimum version: 1.14.0
103370597fb56Smrg#
1033867594505Smrg# Checks for various brands of compilers and sets flags as appropriate:
1033967594505Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
1034067594505Smrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
1034167594505Smrg#   clang compiler - sets CLANGCC to "yes"
1034267594505Smrg#   Intel compiler - sets INTELCC to "yes"
1034367594505Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
103448bd17e5fSmrg#
1034567594505SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
1034667594505SmrgAC_LANG_CASE(
1034767594505Smrg	[C], [
1034867594505Smrg		AC_REQUIRE([AC_PROG_CC_C99])
1034967594505Smrg	],
1035067594505Smrg	[C++], [
1035167594505Smrg		AC_REQUIRE([AC_PROG_CXX])
1035267594505Smrg	]
1035367594505Smrg)
1035467594505SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
1035567594505SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1035667594505SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1035767594505Smrg]) # XORG_COMPILER_BRAND
1035867594505Smrg
1035967594505Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
1036067594505Smrg# ---------------
1036167594505Smrg# Minimum version: 1.16.0
103628bd17e5fSmrg#
1036367594505Smrg# Test if the compiler works when passed the given flag as a command line argument.
1036467594505Smrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
1036567594505Smrg# next flag in the list until there are no more options.
103668bd17e5fSmrg#
1036767594505Smrg# Note that this does not guarantee that the compiler supports the flag as some
1036867594505Smrg# compilers will simply ignore arguments that they do not understand, but we do
1036967594505Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
1037067594505Smrg# -Werror=unused-command-line-argument
1037167594505Smrg#
1037267594505SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
1037367594505Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
1037467594505Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
10375b042e37fSmrg
1037667594505SmrgAC_LANG_COMPILER_REQUIRE
1037767594505Smrg
1037867594505SmrgAC_LANG_CASE(
1037967594505Smrg	[C], [
1038067594505Smrg		AC_REQUIRE([AC_PROG_CC_C99])
1038167594505Smrg		define([PREFIX], [C])
1038267594505Smrg		define([CACHE_PREFIX], [cc])
1038367594505Smrg		define([COMPILER], [$CC])
1038467594505Smrg	],
1038567594505Smrg	[C++], [
1038667594505Smrg		define([PREFIX], [CXX])
1038767594505Smrg		define([CACHE_PREFIX], [cxx])
1038867594505Smrg		define([COMPILER], [$CXX])
1038967594505Smrg	]
1039067594505Smrg)
1039167594505Smrg
1039267594505Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
1039367594505Smrg
1039467594505Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
1039567594505Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1039667594505Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
1039767594505Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
1039867594505Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1039967594505Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
1040067594505Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
1040167594505Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
1040267594505Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
104038bd17e5fSmrgfi
10404706b6b52Smrg
1040567594505Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
1040667594505Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
1040767594505Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1040867594505Smrg	fi
1040967594505Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1041067594505Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
1041167594505Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
1041267594505Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1041367594505Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
1041467594505Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
1041567594505Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
1041667594505Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1041767594505Smrgfi
1041867594505Smrg
1041967594505Smrgfound="no"
1042067594505Smrgm4_foreach([flag], m4_cdr($@), [
1042167594505Smrg	if test $found = "no" ; then
1042267594505Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
1042367594505Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1042467594505Smrg		fi
1042567594505Smrg
1042667594505Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
1042767594505Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1042867594505Smrg		fi
1042967594505Smrg
1043067594505Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
1043167594505Smrg
1043267594505Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
1043367594505Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
1043467594505Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
1043567594505Smrg		AC_CACHE_VAL($cacheid,
1043667594505Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
1043767594505Smrg					     [eval $cacheid=yes],
1043867594505Smrg					     [eval $cacheid=no])])
1043967594505Smrg
1044067594505Smrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1044167594505Smrg
1044267594505Smrg		eval supported=\$$cacheid
1044367594505Smrg		AC_MSG_RESULT([$supported])
1044467594505Smrg		if test "$supported" = "yes" ; then
1044567594505Smrg			$1="$$1 ]flag["
1044667594505Smrg			found="yes"
1044767594505Smrg		fi
1044867594505Smrg	fi
1044967594505Smrg])
1045067594505Smrg]) # XORG_TESTSET_CFLAG
104518bd17e5fSmrg
1045267594505Smrg# XORG_COMPILER_FLAGS
1045367594505Smrg# ---------------
1045467594505Smrg# Minimum version: 1.16.0
104558bd17e5fSmrg#
1045667594505Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
1045767594505Smrg# arguments supported by the selected compiler which do NOT alter the generated
1045867594505Smrg# code.  These arguments will cause the compiler to print various warnings
1045967594505Smrg# during compilation AND turn a conservative set of warnings into errors.
104608bd17e5fSmrg#
1046167594505Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
1046267594505Smrg# future versions of util-macros as options are added to new compilers.
104638bd17e5fSmrg#
1046467594505SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
1046567594505SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
104668c4a8e55Smrg
1046767594505SmrgAC_ARG_ENABLE(selective-werror,
1046867594505Smrg              AS_HELP_STRING([--disable-selective-werror],
1046967594505Smrg                             [Turn off selective compiler errors. (default: enabled)]),
1047067594505Smrg              [SELECTIVE_WERROR=$enableval],
1047167594505Smrg              [SELECTIVE_WERROR=yes])
1047267594505Smrg
1047367594505SmrgAC_LANG_CASE(
1047467594505Smrg        [C], [
1047567594505Smrg                define([PREFIX], [C])
1047667594505Smrg        ],
1047767594505Smrg        [C++], [
1047867594505Smrg                define([PREFIX], [CXX])
1047967594505Smrg        ]
1048067594505Smrg)
1048167594505Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
1048267594505Smrgif test "x$SUNCC" = "xyes"; then
1048367594505Smrg    [BASE_]PREFIX[FLAGS]="-v"
104848bd17e5fSmrgelse
1048567594505Smrg    [BASE_]PREFIX[FLAGS]=""
104868bd17e5fSmrgfi
104878c4a8e55Smrg
1048867594505Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
1048967594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
1049067594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
1049167594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
1049267594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
104938c4a8e55Smrg
1049467594505SmrgAC_LANG_CASE(
1049567594505Smrg	[C], [
1049667594505Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
1049767594505Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
1049867594505Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
1049967594505Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
1050067594505Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
1050167594505Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
1050267594505Smrg	]
1050367594505Smrg)
105048c4a8e55Smrg
1050567594505Smrg# This chunk adds additional warnings that could catch undesired effects.
1050667594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
1050767594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
1050867594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
1050967594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
1051067594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
1051167594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
1051267594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
105138c4a8e55Smrg
1051467594505Smrg# These are currently disabled because they are noisy.  They will be enabled
1051567594505Smrg# in the future once the codebase is sufficiently modernized to silence
1051667594505Smrg# them.  For now, I don't want them to drown out the other warnings.
1051767594505Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
1051867594505Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
1051967594505Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
1052067594505Smrg
1052167594505Smrg# Turn some warnings into errors, so we don't accidently get successful builds
1052267594505Smrg# when there are problems that should be fixed.
1052367594505Smrg
1052467594505Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
1052567594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
1052667594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
1052767594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
1052867594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
1052967594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
1053067594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
1053167594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
1053267594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
1053367594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
1053467594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
1053567594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
1053667594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
1053767594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
1053867594505Smrgelse
1053967594505SmrgAC_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])
1054067594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
1054167594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
1054267594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
1054367594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
1054467594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
1054567594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
1054667594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
1054767594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
1054867594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
1054967594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
1055067594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
1055167594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
1055267594505SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
1055367594505Smrgfi
105540597fb56Smrg
1055567594505SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
1055667594505Smrg]) # XORG_COMPILER_FLAGS
105570597fb56Smrg
1055867594505Smrg# XORG_CWARNFLAGS
1055967594505Smrg# ---------------
1056067594505Smrg# Minimum version: 1.2.0
1056167594505Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
105628bd17e5fSmrg#
1056367594505Smrg# Defines CWARNFLAGS to enable C compiler warnings.
105648bd17e5fSmrg#
1056567594505Smrg# This function is deprecated because it defines -fno-strict-aliasing
1056667594505Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
1056767594505Smrg# is needed, then it should be added explicitly in the module when
1056867594505Smrg# it is updated to use BASE_CFLAGS.
105698bd17e5fSmrg#
1057067594505SmrgAC_DEFUN([XORG_CWARNFLAGS], [
1057167594505SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
1057267594505SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
1057367594505SmrgAC_LANG_CASE(
1057467594505Smrg	[C], [
1057567594505Smrg		CWARNFLAGS="$BASE_CFLAGS"
1057667594505Smrg		if  test "x$GCC" = xyes ; then
1057767594505Smrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
1057867594505Smrg		fi
1057967594505Smrg		AC_SUBST(CWARNFLAGS)
1058067594505Smrg	]
1058167594505Smrg)
1058267594505Smrg]) # XORG_CWARNFLAGS
1058367594505Smrg
1058467594505Smrg# XORG_STRICT_OPTION
1058567594505Smrg# -----------------------
1058667594505Smrg# Minimum version: 1.3.0
105878bd17e5fSmrg#
1058867594505Smrg# Add configure option to enable strict compilation flags, such as treating
1058967594505Smrg# warnings as fatal errors.
1059067594505Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
1059167594505Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
105928bd17e5fSmrg#
1059367594505Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
1059467594505Smrg# when strict compilation is unconditionally desired.
1059567594505SmrgAC_DEFUN([XORG_STRICT_OPTION], [
1059667594505SmrgAC_REQUIRE([XORG_CWARNFLAGS])
1059767594505SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
105988bd17e5fSmrg
1059967594505SmrgAC_ARG_ENABLE(strict-compilation,
1060067594505Smrg			  AS_HELP_STRING([--enable-strict-compilation],
1060167594505Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
1060267594505Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
106038c4a8e55Smrg
1060467594505SmrgAC_LANG_CASE(
1060567594505Smrg        [C], [
1060667594505Smrg                define([PREFIX], [C])
1060767594505Smrg        ],
1060867594505Smrg        [C++], [
1060967594505Smrg                define([PREFIX], [CXX])
1061067594505Smrg        ]
1061167594505Smrg)
106128c4a8e55Smrg
1061367594505Smrg[STRICT_]PREFIX[FLAGS]=""
1061467594505SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
1061567594505SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
106168c4a8e55Smrg
1061767594505Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
1061867594505Smrg# activate it with -Werror, so we add it here explicitly.
1061967594505SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
106208c4a8e55Smrg
1062167594505Smrgif test "x$STRICT_COMPILE" = "xyes"; then
1062267594505Smrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
1062367594505Smrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
1062467594505Smrgfi
1062567594505SmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
1062667594505SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
1062767594505SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
1062867594505Smrg]) # XORG_STRICT_OPTION
106298c4a8e55Smrg
1063067594505Smrg# XORG_DEFAULT_OPTIONS
1063167594505Smrg# --------------------
1063267594505Smrg# Minimum version: 1.3.0
106338bd17e5fSmrg#
1063467594505Smrg# Defines default options for X.Org modules.
106358bd17e5fSmrg#
1063667594505SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
1063767594505SmrgAC_REQUIRE([AC_PROG_INSTALL])
1063867594505SmrgXORG_COMPILER_FLAGS
1063967594505SmrgXORG_CWARNFLAGS
1064067594505SmrgXORG_STRICT_OPTION
1064167594505SmrgXORG_RELEASE_VERSION
1064267594505SmrgXORG_CHANGELOG
1064367594505SmrgXORG_INSTALL
1064467594505SmrgXORG_MANPAGE_SECTIONS
1064567594505Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
1064667594505Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
1064767594505Smrg]) # XORG_DEFAULT_OPTIONS
1064867594505Smrg
1064967594505Smrg# XORG_INSTALL()
1065067594505Smrg# ----------------
1065167594505Smrg# Minimum version: 1.4.0
106528bd17e5fSmrg#
1065367594505Smrg# Defines the variable INSTALL_CMD as the command to copy
1065467594505Smrg# INSTALL from $prefix/share/util-macros.
106558bd17e5fSmrg#
1065667594505SmrgAC_DEFUN([XORG_INSTALL], [
1065767594505SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
1065867594505Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
1065967594505SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
1066067594505Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
1066167594505Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
1066267594505Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
1066367594505SmrgAC_SUBST([INSTALL_CMD])
1066467594505Smrg]) # XORG_INSTALL
1066567594505Smrgdnl Copyright 2005 Red Hat, Inc
1066667594505Smrgdnl
1066767594505Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1066867594505Smrgdnl documentation for any purpose is hereby granted without fee, provided that
1066967594505Smrgdnl the above copyright notice appear in all copies and that both that
1067067594505Smrgdnl copyright notice and this permission notice appear in supporting
1067167594505Smrgdnl documentation.
1067267594505Smrgdnl
1067367594505Smrgdnl The above copyright notice and this permission notice shall be included
1067467594505Smrgdnl in all copies or substantial portions of the Software.
1067567594505Smrgdnl
1067667594505Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1067767594505Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1067867594505Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1067967594505Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1068067594505Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1068167594505Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1068267594505Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
1068367594505Smrgdnl
1068467594505Smrgdnl Except as contained in this notice, the name of the copyright holders shall
1068567594505Smrgdnl not be used in advertising or otherwise to promote the sale, use or
1068667594505Smrgdnl other dealings in this Software without prior written authorization
1068767594505Smrgdnl from the copyright holders.
1068867594505Smrgdnl
1068967594505Smrg
1069067594505Smrg# XORG_RELEASE_VERSION
1069167594505Smrg# --------------------
1069267594505Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1069367594505Smrg
1069467594505SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1069567594505Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1069667594505Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1069767594505Smrg		[Major version of this package])
1069867594505Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1069967594505Smrg	if test "x$PVM" = "x"; then
1070067594505Smrg		PVM="0"
1070167594505Smrg	fi
1070267594505Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1070367594505Smrg		[$PVM],
1070467594505Smrg		[Minor version of this package])
1070567594505Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1070667594505Smrg	if test "x$PVP" = "x"; then
1070767594505Smrg		PVP="0"
1070867594505Smrg	fi
1070967594505Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1071067594505Smrg		[$PVP],
1071167594505Smrg		[Patch version of this package])
1071267594505Smrg])
107138c4a8e55Smrg
1071467594505Smrg# XORG_CHANGELOG()
1071567594505Smrg# ----------------
1071667594505Smrg# Minimum version: 1.2.0
107178bd17e5fSmrg#
1071867594505Smrg# Defines the variable CHANGELOG_CMD as the command to generate
1071967594505Smrg# ChangeLog from git.
107208bd17e5fSmrg#
107218bd17e5fSmrg#
1072267594505SmrgAC_DEFUN([XORG_CHANGELOG], [
1072367594505SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
1072467594505Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
1072567594505Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
1072667594505Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
1072767594505SmrgAC_SUBST([CHANGELOG_CMD])
1072867594505Smrg]) # XORG_CHANGELOG
1072967594505Smrg
1073067594505Smrg# Copyright (C) 2002-2013 Free Software Foundation, Inc.
107318bd17e5fSmrg#
1073267594505Smrg# This file is free software; the Free Software Foundation
1073367594505Smrg# gives unlimited permission to copy and/or distribute it,
1073467594505Smrg# with or without modifications, as long as this notice is preserved.
1073567594505Smrg
1073667594505Smrg# AM_AUTOMAKE_VERSION(VERSION)
1073767594505Smrg# ----------------------------
1073867594505Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
1073967594505Smrg# generated from the m4 files accompanying Automake X.Y.
1074067594505Smrg# (This private macro should not be called outside this file.)
1074167594505SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
1074267594505Smrg[am__api_version='1.13'
1074367594505Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
1074467594505Smrgdnl require some minimum version.  Point them to the right macro.
1074567594505Smrgm4_if([$1], [1.13.4], [],
1074667594505Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
1074767594505Smrg])
1074867594505Smrg
1074967594505Smrg# _AM_AUTOCONF_VERSION(VERSION)
1075067594505Smrg# -----------------------------
1075167594505Smrg# aclocal traces this macro to find the Autoconf version.
1075267594505Smrg# This is a private macro too.  Using m4_define simplifies
1075367594505Smrg# the logic in aclocal, which can simply ignore this definition.
1075467594505Smrgm4_define([_AM_AUTOCONF_VERSION], [])
1075567594505Smrg
1075667594505Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
1075767594505Smrg# -------------------------------
1075867594505Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
1075967594505Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
1076067594505SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1076167594505Smrg[AM_AUTOMAKE_VERSION([1.13.4])dnl
1076267594505Smrgm4_ifndef([AC_AUTOCONF_VERSION],
1076367594505Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1076467594505Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
1076567594505Smrg
1076667594505Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
1076767594505Smrg
1076867594505Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
107698bd17e5fSmrg#
1077067594505Smrg# This file is free software; the Free Software Foundation
1077167594505Smrg# gives unlimited permission to copy and/or distribute it,
1077267594505Smrg# with or without modifications, as long as this notice is preserved.
1077367594505Smrg
1077467594505Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
1077567594505Smrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
1077667594505Smrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
107778bd17e5fSmrg#
1077867594505Smrg# Of course, Automake must honor this variable whenever it calls a
1077967594505Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
1078067594505Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
1078167594505Smrg# depending on how configure is run.  This is pretty annoying, since
1078267594505Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
1078367594505Smrg# source directory, any form will work fine, but in subdirectories a
1078467594505Smrg# relative path needs to be adjusted first.
107858bd17e5fSmrg#
1078667594505Smrg# $ac_aux_dir/missing
1078767594505Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
1078867594505Smrg# $top_srcdir/$ac_aux_dir/missing
1078967594505Smrg#    fails if $ac_aux_dir is absolute,
1079067594505Smrg#    fails when called from a subdirectory in a VPATH build with
1079167594505Smrg#          a relative $ac_aux_dir
107928bd17e5fSmrg#
1079367594505Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
1079467594505Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
1079567594505Smrg# harmless because $srcdir is '.', but things will broke when you
1079667594505Smrg# start a VPATH build or use an absolute $srcdir.
107978bd17e5fSmrg#
1079867594505Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
1079967594505Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
1080067594505Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
1080167594505Smrg# and then we would define $MISSING as
1080267594505Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
1080367594505Smrg# This will work as long as MISSING is not called from configure, because
1080467594505Smrg# unfortunately $(top_srcdir) has no meaning in configure.
1080567594505Smrg# However there are other variables, like CC, which are often used in
1080667594505Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
108078bd17e5fSmrg#
1080867594505Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
1080967594505Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
1081067594505Smrg# configured tree to be moved without reconfiguration.
1081167594505Smrg
1081267594505SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
1081367594505Smrg[dnl Rely on autoconf to set up CDPATH properly.
1081467594505SmrgAC_PREREQ([2.50])dnl
1081567594505Smrg# expand $ac_aux_dir to an absolute path
1081667594505Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
1081767594505Smrg])
1081867594505Smrg
1081967594505Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1082067594505Smrg
1082167594505Smrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
108228bd17e5fSmrg#
1082367594505Smrg# This file is free software; the Free Software Foundation
1082467594505Smrg# gives unlimited permission to copy and/or distribute it,
1082567594505Smrg# with or without modifications, as long as this notice is preserved.
1082667594505Smrg
1082767594505Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
1082867594505Smrg# -------------------------------------
1082967594505Smrg# Define a conditional.
1083067594505SmrgAC_DEFUN([AM_CONDITIONAL],
1083167594505Smrg[AC_PREREQ([2.52])dnl
1083267594505Smrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1083367594505Smrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1083467594505SmrgAC_SUBST([$1_TRUE])dnl
1083567594505SmrgAC_SUBST([$1_FALSE])dnl
1083667594505Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
1083767594505Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
1083867594505Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
1083967594505Smrgif $2; then
1084067594505Smrg  $1_TRUE=
1084167594505Smrg  $1_FALSE='#'
108428bd17e5fSmrgelse
1084367594505Smrg  $1_TRUE='#'
1084467594505Smrg  $1_FALSE=
108458bd17e5fSmrgfi
1084667594505SmrgAC_CONFIG_COMMANDS_PRE(
1084767594505Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1084867594505Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
1084967594505SmrgUsually this means the macro was only invoked conditionally.]])
1085067594505Smrgfi])])
108518c4a8e55Smrg
1085267594505Smrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
108538bd17e5fSmrg#
1085467594505Smrg# This file is free software; the Free Software Foundation
1085567594505Smrg# gives unlimited permission to copy and/or distribute it,
1085667594505Smrg# with or without modifications, as long as this notice is preserved.
108578bd17e5fSmrg
108588c4a8e55Smrg
1085967594505Smrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
1086067594505Smrg# written in clear, in which case automake, when reading aclocal.m4,
1086167594505Smrg# will think it sees a *use*, and therefore will trigger all it's
1086267594505Smrg# C support machinery.  Also note that it means that autoscan, seeing
1086367594505Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1086467594505Smrg
1086567594505Smrg
1086667594505Smrg# _AM_DEPENDENCIES(NAME)
1086767594505Smrg# ----------------------
1086867594505Smrg# See how the compiler implements dependency checking.
1086967594505Smrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
1087067594505Smrg# We try a few techniques and use that to set a single cache variable.
1087167594505Smrg#
1087267594505Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1087367594505Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1087467594505Smrg# dependency, and given that the user is not expected to run this macro,
1087567594505Smrg# just rely on AC_PROG_CC.
1087667594505SmrgAC_DEFUN([_AM_DEPENDENCIES],
1087767594505Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
1087867594505SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1087967594505SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
1088067594505SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
108818c4a8e55Smrg
1088267594505Smrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
1088367594505Smrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
1088467594505Smrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1088567594505Smrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
1088667594505Smrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
1088767594505Smrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1088867594505Smrg                    [depcc="$$1"   am_compiler_list=])
108898c4a8e55Smrg
1089067594505SmrgAC_CACHE_CHECK([dependency style of $depcc],
1089167594505Smrg               [am_cv_$1_dependencies_compiler_type],
1089267594505Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1089367594505Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
1089467594505Smrg  # making bogus files that we don't know about and never remove.  For
1089567594505Smrg  # instance it was reported that on HP-UX the gcc test will end up
1089667594505Smrg  # making a dummy file named 'D' -- because '-MD' means "put the output
1089767594505Smrg  # in D".
1089867594505Smrg  rm -rf conftest.dir
1089967594505Smrg  mkdir conftest.dir
1090067594505Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
1090167594505Smrg  # using a relative directory.
1090267594505Smrg  cp "$am_depcomp" conftest.dir
1090367594505Smrg  cd conftest.dir
1090467594505Smrg  # We will build objects and dependencies in a subdirectory because
1090567594505Smrg  # it helps to detect inapplicable dependency modes.  For instance
1090667594505Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
1090767594505Smrg  # side effect of compilation, but ICC will put the dependencies in
1090867594505Smrg  # the current directory while Tru64 will put them in the object
1090967594505Smrg  # directory.
1091067594505Smrg  mkdir sub
109118bd17e5fSmrg
1091267594505Smrg  am_cv_$1_dependencies_compiler_type=none
1091367594505Smrg  if test "$am_compiler_list" = ""; then
1091467594505Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
1091567594505Smrg  fi
1091667594505Smrg  am__universal=false
1091767594505Smrg  m4_case([$1], [CC],
1091867594505Smrg    [case " $depcc " in #(
1091967594505Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
1092067594505Smrg     esac],
1092167594505Smrg    [CXX],
1092267594505Smrg    [case " $depcc " in #(
1092367594505Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
1092467594505Smrg     esac])
10925706b6b52Smrg
1092667594505Smrg  for depmode in $am_compiler_list; do
1092767594505Smrg    # Setup a source with many dependencies, because some compilers
1092867594505Smrg    # like to wrap large dependency lists on column 80 (with \), and
1092967594505Smrg    # we should not choose a depcomp mode which is confused by this.
1093067594505Smrg    #
1093167594505Smrg    # We need to recreate these files for each test, as the compiler may
1093267594505Smrg    # overwrite some of them when testing with obscure command lines.
1093367594505Smrg    # This happens at least with the AIX C compiler.
1093467594505Smrg    : > sub/conftest.c
1093567594505Smrg    for i in 1 2 3 4 5 6; do
1093667594505Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
1093767594505Smrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
1093867594505Smrg      # Solaris 10 /bin/sh.
1093967594505Smrg      echo '/* dummy */' > sub/conftst$i.h
1094067594505Smrg    done
1094167594505Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
109428c4a8e55Smrg
1094367594505Smrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
1094467594505Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
1094567594505Smrg    # handle '-M -o', and we need to detect this.  Also, some Intel
1094667594505Smrg    # versions had trouble with output in subdirs.
1094767594505Smrg    am__obj=sub/conftest.${OBJEXT-o}
1094867594505Smrg    am__minus_obj="-o $am__obj"
1094967594505Smrg    case $depmode in
1095067594505Smrg    gcc)
1095167594505Smrg      # This depmode causes a compiler race in universal mode.
1095267594505Smrg      test "$am__universal" = false || continue
1095367594505Smrg      ;;
1095467594505Smrg    nosideeffect)
1095567594505Smrg      # After this tag, mechanisms are not by side-effect, so they'll
1095667594505Smrg      # only be used when explicitly requested.
1095767594505Smrg      if test "x$enable_dependency_tracking" = xyes; then
1095867594505Smrg	continue
1095967594505Smrg      else
1096067594505Smrg	break
1096167594505Smrg      fi
1096267594505Smrg      ;;
1096367594505Smrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
1096467594505Smrg      # This compiler won't grok '-c -o', but also, the minuso test has
1096567594505Smrg      # not run yet.  These depmodes are late enough in the game, and
1096667594505Smrg      # so weak that their functioning should not be impacted.
1096767594505Smrg      am__obj=conftest.${OBJEXT-o}
1096867594505Smrg      am__minus_obj=
1096967594505Smrg      ;;
1097067594505Smrg    none) break ;;
1097167594505Smrg    esac
1097267594505Smrg    if depmode=$depmode \
1097367594505Smrg       source=sub/conftest.c object=$am__obj \
1097467594505Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
1097567594505Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
1097667594505Smrg         >/dev/null 2>conftest.err &&
1097767594505Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
1097867594505Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
1097967594505Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
1098067594505Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1098167594505Smrg      # icc doesn't choke on unknown options, it will just issue warnings
1098267594505Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
1098367594505Smrg      # that says an option was ignored or not supported.
1098467594505Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
1098567594505Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
1098667594505Smrg      # The diagnosis changed in icc 8.0:
1098767594505Smrg      #   icc: Command line remark: option '-MP' not supported
1098867594505Smrg      if (grep 'ignoring option' conftest.err ||
1098967594505Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
1099067594505Smrg        am_cv_$1_dependencies_compiler_type=$depmode
1099167594505Smrg        break
1099267594505Smrg      fi
1099367594505Smrg    fi
1099467594505Smrg  done
1099567594505Smrg
1099667594505Smrg  cd ..
1099767594505Smrg  rm -rf conftest.dir
109980597fb56Smrgelse
1099967594505Smrg  am_cv_$1_dependencies_compiler_type=none
110000597fb56Smrgfi
1100167594505Smrg])
1100267594505SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1100367594505SmrgAM_CONDITIONAL([am__fastdep$1], [
1100467594505Smrg  test "x$enable_dependency_tracking" != xno \
1100567594505Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1100667594505Smrg])
110078c4a8e55Smrg
110088c4a8e55Smrg
1100967594505Smrg# AM_SET_DEPDIR
1101067594505Smrg# -------------
1101167594505Smrg# Choose a directory name for dependency files.
1101267594505Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
1101367594505SmrgAC_DEFUN([AM_SET_DEPDIR],
1101467594505Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1101567594505SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1101667594505Smrg])
110178c4a8e55Smrg
110188bd17e5fSmrg
1101967594505Smrg# AM_DEP_TRACK
1102067594505Smrg# ------------
1102167594505SmrgAC_DEFUN([AM_DEP_TRACK],
1102267594505Smrg[AC_ARG_ENABLE([dependency-tracking], [dnl
1102367594505SmrgAS_HELP_STRING(
1102467594505Smrg  [--enable-dependency-tracking],
1102567594505Smrg  [do not reject slow dependency extractors])
1102667594505SmrgAS_HELP_STRING(
1102767594505Smrg  [--disable-dependency-tracking],
1102867594505Smrg  [speeds up one-time build])])
1102967594505Smrgif test "x$enable_dependency_tracking" != xno; then
1103067594505Smrg  am_depcomp="$ac_aux_dir/depcomp"
1103167594505Smrg  AMDEPBACKSLASH='\'
1103267594505Smrg  am__nodep='_no'
110330597fb56Smrgfi
1103467594505SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1103567594505SmrgAC_SUBST([AMDEPBACKSLASH])dnl
1103667594505Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
1103767594505SmrgAC_SUBST([am__nodep])dnl
1103867594505Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl
1103967594505Smrg])
1104067594505Smrg
1104167594505Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
1104267594505Smrg
1104367594505Smrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
1104467594505Smrg#
1104567594505Smrg# This file is free software; the Free Software Foundation
1104667594505Smrg# gives unlimited permission to copy and/or distribute it,
1104767594505Smrg# with or without modifications, as long as this notice is preserved.
110488c4a8e55Smrg
110498c4a8e55Smrg
1105067594505Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
1105167594505Smrg# ------------------------------
1105267594505SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1105367594505Smrg[{
1105467594505Smrg  # Older Autoconf quotes --file arguments for eval, but not when files
1105567594505Smrg  # are listed without --file.  Let's play safe and only enable the eval
1105667594505Smrg  # if we detect the quoting.
1105767594505Smrg  case $CONFIG_FILES in
1105867594505Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
1105967594505Smrg  *)   set x $CONFIG_FILES ;;
1106067594505Smrg  esac
1106167594505Smrg  shift
1106267594505Smrg  for mf
1106367594505Smrg  do
1106467594505Smrg    # Strip MF so we end up with the name of the file.
1106567594505Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
1106667594505Smrg    # Check whether this is an Automake generated Makefile or not.
1106767594505Smrg    # We used to match only the files named 'Makefile.in', but
1106867594505Smrg    # some people rename them; so instead we look at the file content.
1106967594505Smrg    # Grep'ing the first line is not enough: some people post-process
1107067594505Smrg    # each Makefile.in and add a new line on top of each file to say so.
1107167594505Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
1107267594505Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
1107367594505Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
1107467594505Smrg      dirpart=`AS_DIRNAME("$mf")`
1107567594505Smrg    else
1107667594505Smrg      continue
1107767594505Smrg    fi
1107867594505Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
1107967594505Smrg    # from the Makefile without running 'make'.
1108067594505Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
1108167594505Smrg    test -z "$DEPDIR" && continue
1108267594505Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
1108367594505Smrg    test -z "$am__include" && continue
1108467594505Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
1108567594505Smrg    # Find all dependency output files, they are included files with
1108667594505Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
1108767594505Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
1108867594505Smrg    # expansion.
1108967594505Smrg    for file in `sed -n "
1109067594505Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
1109167594505Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
1109267594505Smrg      # Make sure the directory exists.
1109367594505Smrg      test -f "$dirpart/$file" && continue
1109467594505Smrg      fdir=`AS_DIRNAME(["$file"])`
1109567594505Smrg      AS_MKDIR_P([$dirpart/$fdir])
1109667594505Smrg      # echo "creating $dirpart/$file"
1109767594505Smrg      echo '# dummy' > "$dirpart/$file"
1109867594505Smrg    done
1109967594505Smrg  done
1110067594505Smrg}
1110167594505Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
111028c4a8e55Smrg
111038c4a8e55Smrg
1110467594505Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
1110567594505Smrg# -----------------------------
1110667594505Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
111078bd17e5fSmrg#
1110867594505Smrg# This code is only required when automatic dependency tracking
1110967594505Smrg# is enabled.  FIXME.  This creates each '.P' file that we will
1111067594505Smrg# need in order to bootstrap the dependency handling code.
1111167594505SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1111267594505Smrg[AC_CONFIG_COMMANDS([depfiles],
1111367594505Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1111467594505Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1111567594505Smrg])
1111667594505Smrg
1111767594505Smrg# Do all the work for Automake.                             -*- Autoconf -*-
1111867594505Smrg
1111967594505Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
111208bd17e5fSmrg#
1112167594505Smrg# This file is free software; the Free Software Foundation
1112267594505Smrg# gives unlimited permission to copy and/or distribute it,
1112367594505Smrg# with or without modifications, as long as this notice is preserved.
11124b042e37fSmrg
1112567594505Smrg# This macro actually does too much.  Some checks are only needed if
1112667594505Smrg# your package does certain things.  But this isn't really a big deal.
11127b042e37fSmrg
1112867594505Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1112967594505Smrg# AM_INIT_AUTOMAKE([OPTIONS])
1113067594505Smrg# -----------------------------------------------
1113167594505Smrg# The call with PACKAGE and VERSION arguments is the old style
1113267594505Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
1113367594505Smrg# and VERSION should now be passed to AC_INIT and removed from
1113467594505Smrg# the call to AM_INIT_AUTOMAKE.
1113567594505Smrg# We support both call styles for the transition.  After
1113667594505Smrg# the next Automake release, Autoconf can make the AC_INIT
1113767594505Smrg# arguments mandatory, and then we can depend on a new Autoconf
1113867594505Smrg# release and drop the old call support.
1113967594505SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
1114067594505Smrg[AC_PREREQ([2.65])dnl
1114167594505Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
1114267594505Smrgdnl the ones we care about.
1114367594505Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1114467594505SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1114567594505SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
1114667594505Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
1114767594505Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
1114867594505Smrg  # is not polluted with repeated "-I."
1114967594505Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
1115067594505Smrg  # test to see if srcdir already configured
1115167594505Smrg  if test -f $srcdir/config.status; then
1115267594505Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1115367594505Smrg  fi
111540597fb56Smrgfi
111550597fb56Smrg
1115667594505Smrg# test whether we have cygpath
1115767594505Smrgif test -z "$CYGPATH_W"; then
1115867594505Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
1115967594505Smrg    CYGPATH_W='cygpath -w'
1116067594505Smrg  else
1116167594505Smrg    CYGPATH_W=echo
1116267594505Smrg  fi
1116367594505Smrgfi
1116467594505SmrgAC_SUBST([CYGPATH_W])
111658bd17e5fSmrg
1116667594505Smrg# Define the identity of the package.
1116767594505Smrgdnl Distinguish between old-style and new-style calls.
1116867594505Smrgm4_ifval([$2],
1116967594505Smrg[AC_DIAGNOSE([obsolete],
1117067594505Smrg             [$0: two- and three-arguments forms are deprecated.])
1117167594505Smrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1117267594505Smrg AC_SUBST([PACKAGE], [$1])dnl
1117367594505Smrg AC_SUBST([VERSION], [$2])],
1117467594505Smrg[_AM_SET_OPTIONS([$1])dnl
1117567594505Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
1117667594505Smrgm4_if(
1117767594505Smrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
1117867594505Smrg  [ok:ok],,
1117967594505Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
1118067594505Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1118167594505Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
111828bd17e5fSmrg
1118367594505Smrg_AM_IF_OPTION([no-define],,
1118467594505Smrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
1118567594505Smrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
111868bd17e5fSmrg
1118767594505Smrg# Some tools Automake needs.
1118867594505SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
1118967594505SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
1119067594505SmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
1119167594505SmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
1119267594505SmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
1119367594505SmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
1119467594505SmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
1119567594505SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1119667594505SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
1119767594505SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
1119867594505Smrg# For better backward compatibility.  To be removed once Automake 1.9.x
1119967594505Smrg# dies out for good.  For more background, see:
1120067594505Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
1120167594505Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
1120267594505SmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
1120367594505Smrg# We need awk for the "check" target.  The system "awk" is bad on
1120467594505Smrg# some platforms.
1120567594505SmrgAC_REQUIRE([AC_PROG_AWK])dnl
1120667594505SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
1120767594505SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
1120867594505Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1120967594505Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1121067594505Smrg			     [_AM_PROG_TAR([v7])])])
1121167594505Smrg_AM_IF_OPTION([no-dependencies],,
1121267594505Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
1121367594505Smrg		  [_AM_DEPENDENCIES([CC])],
1121467594505Smrg		  [m4_define([AC_PROG_CC],
1121567594505Smrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
1121667594505SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
1121767594505Smrg		  [_AM_DEPENDENCIES([CXX])],
1121867594505Smrg		  [m4_define([AC_PROG_CXX],
1121967594505Smrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
1122067594505SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
1122167594505Smrg		  [_AM_DEPENDENCIES([OBJC])],
1122267594505Smrg		  [m4_define([AC_PROG_OBJC],
1122367594505Smrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
1122467594505SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
1122567594505Smrg		  [_AM_DEPENDENCIES([OBJCXX])],
1122667594505Smrg		  [m4_define([AC_PROG_OBJCXX],
1122767594505Smrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
1122867594505Smrg])
1122967594505SmrgAC_REQUIRE([AM_SILENT_RULES])dnl
1123067594505Smrgdnl The testsuite driver may need to know about EXEEXT, so add the
1123167594505Smrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
1123267594505Smrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
1123367594505SmrgAC_CONFIG_COMMANDS_PRE(dnl
1123467594505Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
1123567594505Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
1123667594505Smrg])
1123767594505Smrg
1123867594505Smrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
1123967594505Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
1124067594505Smrgdnl mangled by Autoconf and run in a shell conditional statement.
1124167594505Smrgm4_define([_AC_COMPILER_EXEEXT],
1124267594505Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
112438c4a8e55Smrg
112448c4a8e55Smrg
1124567594505Smrg# When config.status generates a header, we must update the stamp-h file.
1124667594505Smrg# This file resides in the same directory as the config header
1124767594505Smrg# that is generated.  The stamp files are numbered to have different names.
112488c4a8e55Smrg
1124967594505Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1125067594505Smrg# loop where config.status creates the headers, so we can generate
1125167594505Smrg# our stamp files there.
1125267594505SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1125367594505Smrg[# Compute $1's index in $config_headers.
1125467594505Smrg_am_arg=$1
1125567594505Smrg_am_stamp_count=1
1125667594505Smrgfor _am_header in $config_headers :; do
1125767594505Smrg  case $_am_header in
1125867594505Smrg    $_am_arg | $_am_arg:* )
1125967594505Smrg      break ;;
1126067594505Smrg    * )
1126167594505Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1126267594505Smrg  esac
1126367594505Smrgdone
1126467594505Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
112658c4a8e55Smrg
1126667594505Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
1126767594505Smrg#
1126867594505Smrg# This file is free software; the Free Software Foundation
1126967594505Smrg# gives unlimited permission to copy and/or distribute it,
1127067594505Smrg# with or without modifications, as long as this notice is preserved.
112718c4a8e55Smrg
1127267594505Smrg# AM_PROG_INSTALL_SH
1127367594505Smrg# ------------------
1127467594505Smrg# Define $install_sh.
1127567594505SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
1127667594505Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1127767594505Smrgif test x"${install_sh}" != xset; then
1127867594505Smrg  case $am_aux_dir in
1127967594505Smrg  *\ * | *\	*)
1128067594505Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
1128167594505Smrg  *)
1128267594505Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
1128367594505Smrg  esac
112848bd17e5fSmrgfi
1128567594505SmrgAC_SUBST([install_sh])])
112868c4a8e55Smrg
1128767594505Smrg# Copyright (C) 2003-2013 Free Software Foundation, Inc.
1128867594505Smrg#
1128967594505Smrg# This file is free software; the Free Software Foundation
1129067594505Smrg# gives unlimited permission to copy and/or distribute it,
1129167594505Smrg# with or without modifications, as long as this notice is preserved.
11292706b6b52Smrg
1129367594505Smrg# Check whether the underlying file-system supports filenames
1129467594505Smrg# with a leading dot.  For instance MS-DOS doesn't.
1129567594505SmrgAC_DEFUN([AM_SET_LEADING_DOT],
1129667594505Smrg[rm -rf .tst 2>/dev/null
1129767594505Smrgmkdir .tst 2>/dev/null
1129867594505Smrgif test -d .tst; then
1129967594505Smrg  am__leading_dot=.
1130067594505Smrgelse
1130167594505Smrg  am__leading_dot=_
1130267594505Smrgfi
1130367594505Smrgrmdir .tst 2>/dev/null
1130467594505SmrgAC_SUBST([am__leading_dot])])
11305706b6b52Smrg
1130667594505Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
11307706b6b52Smrg
1130867594505Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
1130967594505Smrg#
1131067594505Smrg# This file is free software; the Free Software Foundation
1131167594505Smrg# gives unlimited permission to copy and/or distribute it,
1131267594505Smrg# with or without modifications, as long as this notice is preserved.
113138c4a8e55Smrg
1131467594505Smrg# AM_MAKE_INCLUDE()
1131567594505Smrg# -----------------
1131667594505Smrg# Check to see how make treats includes.
1131767594505SmrgAC_DEFUN([AM_MAKE_INCLUDE],
1131867594505Smrg[am_make=${MAKE-make}
1131967594505Smrgcat > confinc << 'END'
1132067594505Smrgam__doit:
1132167594505Smrg	@echo this is the am__doit target
1132267594505Smrg.PHONY: am__doit
1132367594505SmrgEND
1132467594505Smrg# If we don't find an include directive, just comment out the code.
1132567594505SmrgAC_MSG_CHECKING([for style of include used by $am_make])
1132667594505Smrgam__include="#"
1132767594505Smrgam__quote=
1132867594505Smrg_am_result=none
1132967594505Smrg# First try GNU make style include.
1133067594505Smrgecho "include confinc" > confmf
1133167594505Smrg# Ignore all kinds of additional output from 'make'.
1133267594505Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
1133367594505Smrg*the\ am__doit\ target*)
1133467594505Smrg  am__include=include
1133567594505Smrg  am__quote=
1133667594505Smrg  _am_result=GNU
1133767594505Smrg  ;;
1133867594505Smrgesac
1133967594505Smrg# Now try BSD make style include.
1134067594505Smrgif test "$am__include" = "#"; then
1134167594505Smrg   echo '.include "confinc"' > confmf
1134267594505Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
1134367594505Smrg   *the\ am__doit\ target*)
1134467594505Smrg     am__include=.include
1134567594505Smrg     am__quote="\""
1134667594505Smrg     _am_result=BSD
1134767594505Smrg     ;;
1134867594505Smrg   esac
1134967594505Smrgfi
1135067594505SmrgAC_SUBST([am__include])
1135167594505SmrgAC_SUBST([am__quote])
1135267594505SmrgAC_MSG_RESULT([$_am_result])
1135367594505Smrgrm -f confinc confmf
113548bd17e5fSmrg])
113558c4a8e55Smrg
1135667594505Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
1135767594505Smrg
1135867594505Smrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
113598bd17e5fSmrg#
1136067594505Smrg# This file is free software; the Free Software Foundation
1136167594505Smrg# gives unlimited permission to copy and/or distribute it,
1136267594505Smrg# with or without modifications, as long as this notice is preserved.
113638c4a8e55Smrg
1136467594505Smrg# AM_MISSING_PROG(NAME, PROGRAM)
1136567594505Smrg# ------------------------------
1136667594505SmrgAC_DEFUN([AM_MISSING_PROG],
1136767594505Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
1136867594505Smrg$1=${$1-"${am_missing_run}$2"}
1136967594505SmrgAC_SUBST($1)])
113708c4a8e55Smrg
1137167594505Smrg# AM_MISSING_HAS_RUN
1137267594505Smrg# ------------------
1137367594505Smrg# Define MISSING if not defined so far and test if it is modern enough.
1137467594505Smrg# If it is, set am_missing_run to use it, otherwise, to nothing.
1137567594505SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
1137667594505Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1137767594505SmrgAC_REQUIRE_AUX_FILE([missing])dnl
1137867594505Smrgif test x"${MISSING+set}" != xset; then
1137967594505Smrg  case $am_aux_dir in
1138067594505Smrg  *\ * | *\	*)
1138167594505Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
1138267594505Smrg  *)
1138367594505Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
1138467594505Smrg  esac
1138567594505Smrgfi
1138667594505Smrg# Use eval to expand $SHELL
1138767594505Smrgif eval "$MISSING --is-lightweight"; then
1138867594505Smrg  am_missing_run="$MISSING "
113890597fb56Smrgelse
1139067594505Smrg  am_missing_run=
1139167594505Smrg  AC_MSG_WARN(['missing' script is too old or missing])
113920597fb56Smrgfi
1139367594505Smrg])
11394706b6b52Smrg
1139567594505Smrg# Helper functions for option handling.                     -*- Autoconf -*-
1139667594505Smrg
1139767594505Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
1139867594505Smrg#
1139967594505Smrg# This file is free software; the Free Software Foundation
1140067594505Smrg# gives unlimited permission to copy and/or distribute it,
1140167594505Smrg# with or without modifications, as long as this notice is preserved.
1140267594505Smrg
1140367594505Smrg# _AM_MANGLE_OPTION(NAME)
1140467594505Smrg# -----------------------
1140567594505SmrgAC_DEFUN([_AM_MANGLE_OPTION],
1140667594505Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1140767594505Smrg
1140867594505Smrg# _AM_SET_OPTION(NAME)
1140967594505Smrg# --------------------
1141067594505Smrg# Set option NAME.  Presently that only means defining a flag for this option.
1141167594505SmrgAC_DEFUN([_AM_SET_OPTION],
1141267594505Smrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
1141367594505Smrg
1141467594505Smrg# _AM_SET_OPTIONS(OPTIONS)
1141567594505Smrg# ------------------------
1141667594505Smrg# OPTIONS is a space-separated list of Automake options.
1141767594505SmrgAC_DEFUN([_AM_SET_OPTIONS],
1141867594505Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
11419706b6b52Smrg
1142067594505Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
1142167594505Smrg# -------------------------------------------
1142267594505Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
1142367594505SmrgAC_DEFUN([_AM_IF_OPTION],
1142467594505Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
11425706b6b52Smrg
1142667594505Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
11427706b6b52Smrg
1142867594505Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
1142967594505Smrg#
1143067594505Smrg# This file is free software; the Free Software Foundation
1143167594505Smrg# gives unlimited permission to copy and/or distribute it,
1143267594505Smrg# with or without modifications, as long as this notice is preserved.
114330597fb56Smrg
1143467594505Smrg# AM_SANITY_CHECK
1143567594505Smrg# ---------------
1143667594505SmrgAC_DEFUN([AM_SANITY_CHECK],
1143767594505Smrg[AC_MSG_CHECKING([whether build environment is sane])
1143867594505Smrg# Reject unsafe characters in $srcdir or the absolute working directory
1143967594505Smrg# name.  Accept space and tab only in the latter.
1144067594505Smrgam_lf='
1144167594505Smrg'
1144267594505Smrgcase `pwd` in
1144367594505Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
1144467594505Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
1144567594505Smrgesac
1144667594505Smrgcase $srcdir in
1144767594505Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
1144867594505Smrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
1144967594505Smrgesac
114500597fb56Smrg
1145167594505Smrg# Do 'set' in a subshell so we don't clobber the current shell's
1145267594505Smrg# arguments.  Must try -L first in case configure is actually a
1145367594505Smrg# symlink; some systems play weird games with the mod time of symlinks
1145467594505Smrg# (eg FreeBSD returns the mod time of the symlink's containing
1145567594505Smrg# directory).
1145667594505Smrgif (
1145767594505Smrg   am_has_slept=no
1145867594505Smrg   for am_try in 1 2; do
1145967594505Smrg     echo "timestamp, slept: $am_has_slept" > conftest.file
1146067594505Smrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
1146167594505Smrg     if test "$[*]" = "X"; then
1146267594505Smrg	# -L didn't work.
1146367594505Smrg	set X `ls -t "$srcdir/configure" conftest.file`
1146467594505Smrg     fi
1146567594505Smrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
1146667594505Smrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
1146767594505Smrg
1146867594505Smrg	# If neither matched, then we have a broken ls.  This can happen
1146967594505Smrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
1147067594505Smrg	# broken ls alias from the environment.  This has actually
1147167594505Smrg	# happened.  Such a system could not be considered "sane".
1147267594505Smrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
1147367594505Smrg  alias in your environment])
1147467594505Smrg     fi
1147567594505Smrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
1147667594505Smrg       break
1147767594505Smrg     fi
1147867594505Smrg     # Just in case.
1147967594505Smrg     sleep 1
1148067594505Smrg     am_has_slept=yes
1148167594505Smrg   done
1148267594505Smrg   test "$[2]" = conftest.file
1148367594505Smrg   )
1148467594505Smrgthen
1148567594505Smrg   # Ok.
1148667594505Smrg   :
114878bd17e5fSmrgelse
1148867594505Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
1148967594505SmrgCheck your system clock])
114900597fb56Smrgfi
1149167594505SmrgAC_MSG_RESULT([yes])
1149267594505Smrg# If we didn't sleep, we still need to ensure time stamps of config.status and
1149367594505Smrg# generated files are strictly newer.
1149467594505Smrgam_sleep_pid=
1149567594505Smrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
1149667594505Smrg  ( sleep 1 ) &
1149767594505Smrg  am_sleep_pid=$!
1149867594505Smrgfi
1149967594505SmrgAC_CONFIG_COMMANDS_PRE(
1150067594505Smrg  [AC_MSG_CHECKING([that generated files are newer than configure])
1150167594505Smrg   if test -n "$am_sleep_pid"; then
1150267594505Smrg     # Hide warnings about reused PIDs.
1150367594505Smrg     wait $am_sleep_pid 2>/dev/null
1150467594505Smrg   fi
1150567594505Smrg   AC_MSG_RESULT([done])])
1150667594505Smrgrm -f conftest.file
1150767594505Smrg])
115080597fb56Smrg
1150967594505Smrg# Copyright (C) 2009-2013 Free Software Foundation, Inc.
115108bd17e5fSmrg#
1151167594505Smrg# This file is free software; the Free Software Foundation
1151267594505Smrg# gives unlimited permission to copy and/or distribute it,
1151367594505Smrg# with or without modifications, as long as this notice is preserved.
115148c4a8e55Smrg
1151567594505Smrg# AM_SILENT_RULES([DEFAULT])
1151667594505Smrg# --------------------------
1151767594505Smrg# Enable less verbose build rules; with the default set to DEFAULT
1151867594505Smrg# ("yes" being less verbose, "no" or empty being verbose).
1151967594505SmrgAC_DEFUN([AM_SILENT_RULES],
1152067594505Smrg[AC_ARG_ENABLE([silent-rules], [dnl
1152167594505SmrgAS_HELP_STRING(
1152267594505Smrg  [--enable-silent-rules],
1152367594505Smrg  [less verbose build output (undo: "make V=1")])
1152467594505SmrgAS_HELP_STRING(
1152567594505Smrg  [--disable-silent-rules],
1152667594505Smrg  [verbose build output (undo: "make V=0")])dnl
1152767594505Smrg])
1152867594505Smrgcase $enable_silent_rules in @%:@ (((
1152967594505Smrg  yes) AM_DEFAULT_VERBOSITY=0;;
1153067594505Smrg   no) AM_DEFAULT_VERBOSITY=1;;
1153167594505Smrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
1153267594505Smrgesac
1153367594505Smrgdnl
1153467594505Smrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
1153567594505Smrgdnl do not support nested variable expansions.
1153667594505Smrgdnl See automake bug#9928 and bug#10237.
1153767594505Smrgam_make=${MAKE-make}
1153867594505SmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
1153967594505Smrg   [am_cv_make_support_nested_variables],
1154067594505Smrg   [if AS_ECHO([['TRUE=$(BAR$(V))
1154167594505SmrgBAR0=false
1154267594505SmrgBAR1=true
1154367594505SmrgV=1
1154467594505Smrgam__doit:
1154567594505Smrg	@$(TRUE)
1154667594505Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
1154767594505Smrg  am_cv_make_support_nested_variables=yes
1154867594505Smrgelse
1154967594505Smrg  am_cv_make_support_nested_variables=no
1155067594505Smrgfi])
1155167594505Smrgif test $am_cv_make_support_nested_variables = yes; then
1155267594505Smrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
1155367594505Smrg  AM_V='$(V)'
1155467594505Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
1155567594505Smrgelse
1155667594505Smrg  AM_V=$AM_DEFAULT_VERBOSITY
1155767594505Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
1155867594505Smrgfi
1155967594505SmrgAC_SUBST([AM_V])dnl
1156067594505SmrgAM_SUBST_NOTMAKE([AM_V])dnl
1156167594505SmrgAC_SUBST([AM_DEFAULT_V])dnl
1156267594505SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
1156367594505SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
1156467594505SmrgAM_BACKSLASH='\'
1156567594505SmrgAC_SUBST([AM_BACKSLASH])dnl
1156667594505Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1156767594505Smrg])
1156867594505Smrg
1156967594505Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
115708bd17e5fSmrg#
1157167594505Smrg# This file is free software; the Free Software Foundation
1157267594505Smrg# gives unlimited permission to copy and/or distribute it,
1157367594505Smrg# with or without modifications, as long as this notice is preserved.
1157467594505Smrg
1157567594505Smrg# AM_PROG_INSTALL_STRIP
1157667594505Smrg# ---------------------
1157767594505Smrg# One issue with vendor 'install' (even GNU) is that you can't
1157867594505Smrg# specify the program used to strip binaries.  This is especially
1157967594505Smrg# annoying in cross-compiling environments, where the build's strip
1158067594505Smrg# is unlikely to handle the host's binaries.
1158167594505Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
1158267594505Smrg# always use install-sh in "make install-strip", and initialize
1158367594505Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
1158467594505SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
1158567594505Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1158667594505Smrg# Installed binaries are usually stripped using 'strip' when the user
1158767594505Smrg# run "make install-strip".  However 'strip' might not be the right
1158867594505Smrg# tool to use in cross-compilation environments, therefore Automake
1158967594505Smrg# will honor the 'STRIP' environment variable to overrule this program.
1159067594505Smrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
1159167594505Smrgif test "$cross_compiling" != no; then
1159267594505Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
1159367594505Smrgfi
1159467594505SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1159567594505SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
115968c4a8e55Smrg
1159767594505Smrg# Copyright (C) 2006-2013 Free Software Foundation, Inc.
1159867594505Smrg#
1159967594505Smrg# This file is free software; the Free Software Foundation
1160067594505Smrg# gives unlimited permission to copy and/or distribute it,
1160167594505Smrg# with or without modifications, as long as this notice is preserved.
116028c4a8e55Smrg
1160367594505Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
1160467594505Smrg# ---------------------------
1160567594505Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1160667594505Smrg# This macro is traced by Automake.
1160767594505SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
11608706b6b52Smrg
1160967594505Smrg# AM_SUBST_NOTMAKE(VARIABLE)
1161067594505Smrg# --------------------------
1161167594505Smrg# Public sister of _AM_SUBST_NOTMAKE.
1161267594505SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
11613706b6b52Smrg
1161467594505Smrg# Check how to create a tarball.                            -*- Autoconf -*-
116158c4a8e55Smrg
1161667594505Smrg# Copyright (C) 2004-2013 Free Software Foundation, Inc.
1161767594505Smrg#
1161867594505Smrg# This file is free software; the Free Software Foundation
1161967594505Smrg# gives unlimited permission to copy and/or distribute it,
1162067594505Smrg# with or without modifications, as long as this notice is preserved.
116218c4a8e55Smrg
1162267594505Smrg# _AM_PROG_TAR(FORMAT)
116230597fb56Smrg# --------------------
1162467594505Smrg# Check how to create a tarball in format FORMAT.
1162567594505Smrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
11626706b6b52Smrg#
1162767594505Smrg# Substitute a variable $(am__tar) that is a command
1162867594505Smrg# writing to stdout a FORMAT-tarball containing the directory
1162967594505Smrg# $tardir.
1163067594505Smrg#     tardir=directory && $(am__tar) > result.tar
116318bd17e5fSmrg#
1163267594505Smrg# Substitute a variable $(am__untar) that extract such
1163367594505Smrg# a tarball read from stdin.
1163467594505Smrg#     $(am__untar) < result.tar
116358bd17e5fSmrg#
1163667594505SmrgAC_DEFUN([_AM_PROG_TAR],
1163767594505Smrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
1163867594505Smrg# in the wild :-(  We should find a proper way to deprecate it ...
1163967594505SmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
11640706b6b52Smrg
1164167594505Smrg# We'll loop over all known methods to create a tar archive until one works.
1164267594505Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
11643fc98c8e2Smrg
1164467594505Smrgm4_if([$1], [v7],
1164567594505Smrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
116460597fb56Smrg
1164767594505Smrg  [m4_case([$1],
1164867594505Smrg    [ustar],
1164967594505Smrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
1165067594505Smrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
1165167594505Smrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
1165267594505Smrg      # and bug#13588).
1165367594505Smrg      am_max_uid=2097151 # 2^21 - 1
1165467594505Smrg      am_max_gid=$am_max_uid
1165567594505Smrg      # The $UID and $GID variables are not portable, so we need to resort
1165667594505Smrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
1165767594505Smrg      # below are definitely unexpected, so allow the users to see them
1165867594505Smrg      # (that is, avoid stderr redirection).
1165967594505Smrg      am_uid=`id -u || echo unknown`
1166067594505Smrg      am_gid=`id -g || echo unknown`
1166167594505Smrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
1166267594505Smrg      if test $am_uid -le $am_max_uid; then
1166367594505Smrg         AC_MSG_RESULT([yes])
1166467594505Smrg      else
1166567594505Smrg         AC_MSG_RESULT([no])
1166667594505Smrg         _am_tools=none
1166767594505Smrg      fi
1166867594505Smrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
1166967594505Smrg      if test $am_gid -le $am_max_gid; then
1167067594505Smrg         AC_MSG_RESULT([yes])
1167167594505Smrg      else
1167267594505Smrg        AC_MSG_RESULT([no])
1167367594505Smrg        _am_tools=none
1167467594505Smrg      fi],
1167567594505Smrg
1167667594505Smrg  [pax],
1167767594505Smrg    [],
1167867594505Smrg
1167967594505Smrg  [m4_fatal([Unknown tar format])])
1168067594505Smrg
1168167594505Smrg  AC_MSG_CHECKING([how to create a $1 tar archive])
1168267594505Smrg
1168367594505Smrg  # Go ahead even if we have the value already cached.  We do so because we
1168467594505Smrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
1168567594505Smrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1168667594505Smrg
1168767594505Smrg  for _am_tool in $_am_tools; do
1168867594505Smrg    case $_am_tool in
1168967594505Smrg    gnutar)
1169067594505Smrg      for _am_tar in tar gnutar gtar; do
1169167594505Smrg        AM_RUN_LOG([$_am_tar --version]) && break
1169267594505Smrg      done
1169367594505Smrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1169467594505Smrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1169567594505Smrg      am__untar="$_am_tar -xf -"
1169667594505Smrg      ;;
1169767594505Smrg    plaintar)
1169867594505Smrg      # Must skip GNU tar: if it does not support --format= it doesn't create
1169967594505Smrg      # ustar tarball either.
1170067594505Smrg      (tar --version) >/dev/null 2>&1 && continue
1170167594505Smrg      am__tar='tar chf - "$$tardir"'
1170267594505Smrg      am__tar_='tar chf - "$tardir"'
1170367594505Smrg      am__untar='tar xf -'
1170467594505Smrg      ;;
1170567594505Smrg    pax)
1170667594505Smrg      am__tar='pax -L -x $1 -w "$$tardir"'
1170767594505Smrg      am__tar_='pax -L -x $1 -w "$tardir"'
1170867594505Smrg      am__untar='pax -r'
1170967594505Smrg      ;;
1171067594505Smrg    cpio)
1171167594505Smrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1171267594505Smrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1171367594505Smrg      am__untar='cpio -i -H $1 -d'
1171467594505Smrg      ;;
1171567594505Smrg    none)
1171667594505Smrg      am__tar=false
1171767594505Smrg      am__tar_=false
1171867594505Smrg      am__untar=false
1171967594505Smrg      ;;
1172067594505Smrg    esac
1172167594505Smrg
1172267594505Smrg    # If the value was cached, stop now.  We just wanted to have am__tar
1172367594505Smrg    # and am__untar set.
1172467594505Smrg    test -n "${am_cv_prog_tar_$1}" && break
1172567594505Smrg
1172667594505Smrg    # tar/untar a dummy directory, and stop if the command works.
1172767594505Smrg    rm -rf conftest.dir
1172867594505Smrg    mkdir conftest.dir
1172967594505Smrg    echo GrepMe > conftest.dir/file
1173067594505Smrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1173167594505Smrg    rm -rf conftest.dir
1173267594505Smrg    if test -s conftest.tar; then
1173367594505Smrg      AM_RUN_LOG([$am__untar <conftest.tar])
1173467594505Smrg      AM_RUN_LOG([cat conftest.dir/file])
1173567594505Smrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1173667594505Smrg    fi
1173767594505Smrg  done
1173867594505Smrg  rm -rf conftest.dir
1173967594505Smrg
1174067594505Smrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1174167594505Smrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1174267594505Smrg
1174367594505SmrgAC_SUBST([am__tar])
1174467594505SmrgAC_SUBST([am__untar])
1174567594505Smrg]) # _AM_PROG_TAR
11746b042e37fSmrg
11747