aclocal.m4 revision 3169be4b
13169be4bSmrg# generated automatically by aclocal 1.15 -*- Autoconf -*-
28bd17e5fSmrg
33169be4bSmrg# Copyright (C) 1996-2014 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#
253169be4bSmrg#   Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
2667594505Smrg#   Written by Gordon Matzigkeit, 1996
27b042e37fSmrg#
2867594505Smrg# This file is free software; the Free Software Foundation gives
2967594505Smrg# unlimited permission to copy and/or distribute it, with or without
3067594505Smrg# modifications, as long as this notice is preserved.
318c4a8e55Smrg
3267594505Smrgm4_define([_LT_COPYING], [dnl
333169be4bSmrg# Copyright (C) 2014 Free Software Foundation, Inc.
343169be4bSmrg# This is free software; see the source for copying conditions.  There is NO
353169be4bSmrg# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
363169be4bSmrg
373169be4bSmrg# GNU Libtool is free software; you can redistribute it and/or modify
383169be4bSmrg# it under the terms of the GNU General Public License as published by
393169be4bSmrg# the Free Software Foundation; either version 2 of of the License, or
403169be4bSmrg# (at your option) any later version.
41b042e37fSmrg#
423169be4bSmrg# As a special exception to the GNU General Public License, if you
433169be4bSmrg# distribute this file as part of a program or library that is built
443169be4bSmrg# using GNU Libtool, you may include this file under the  same
453169be4bSmrg# distribution terms that you use for the rest of that program.
46b042e37fSmrg#
473169be4bSmrg# GNU Libtool is distributed in the hope that it will be useful, but
483169be4bSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
4967594505Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5067594505Smrg# GNU General Public License for more details.
51b042e37fSmrg#
5267594505Smrg# You should have received a copy of the GNU General Public License
533169be4bSmrg# along with this program.  If not, see <http://www.gnu.org/licenses/>.
540597fb56Smrg])
55b042e37fSmrg
563169be4bSmrg# serial 58 LT_INIT
57b042e37fSmrg
58b042e37fSmrg
5967594505Smrg# LT_PREREQ(VERSION)
6067594505Smrg# ------------------
6167594505Smrg# Complain and exit if this libtool version is less that VERSION.
6267594505Smrgm4_defun([LT_PREREQ],
6367594505Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
6467594505Smrg       [m4_default([$3],
6567594505Smrg		   [m4_fatal([Libtool version $1 or higher is required],
6667594505Smrg		             63)])],
6767594505Smrg       [$2])])
68b042e37fSmrg
69b042e37fSmrg
7067594505Smrg# _LT_CHECK_BUILDDIR
7167594505Smrg# ------------------
7267594505Smrg# Complain if the absolute build directory name contains unusual characters
7367594505Smrgm4_defun([_LT_CHECK_BUILDDIR],
7467594505Smrg[case `pwd` in
7567594505Smrg  *\ * | *\	*)
7667594505Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
7767594505Smrgesac
7867594505Smrg])
79b042e37fSmrg
80b042e37fSmrg
8167594505Smrg# LT_INIT([OPTIONS])
8267594505Smrg# ------------------
8367594505SmrgAC_DEFUN([LT_INIT],
843169be4bSmrg[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
8567594505SmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
8667594505SmrgAC_BEFORE([$0], [LT_LANG])dnl
8767594505SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
8867594505SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
8967594505Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
90b042e37fSmrg
9167594505Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
9267594505Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
9367594505Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
9467594505Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
9567594505Smrgdnl unless we require an AC_DEFUNed macro:
9667594505SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
9767594505SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
9867594505SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
9967594505SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
10067594505Smrgm4_require([_LT_PROG_LTMAIN])dnl
101b042e37fSmrg
10267594505Smrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
103b042e37fSmrg
10467594505Smrgdnl Parse OPTIONS
10567594505Smrg_LT_SET_OPTIONS([$0], [$1])
106b042e37fSmrg
10767594505Smrg# This can be used to rebuild libtool when needed
1083169be4bSmrgLIBTOOL_DEPS=$ltmain
109b042e37fSmrg
11067594505Smrg# Always use our own libtool.
11167594505SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
11267594505SmrgAC_SUBST(LIBTOOL)dnl
113b042e37fSmrg
11467594505Smrg_LT_SETUP
115b042e37fSmrg
11667594505Smrg# Only expand once:
11767594505Smrgm4_define([LT_INIT])
11867594505Smrg])# LT_INIT
119b042e37fSmrg
12067594505Smrg# Old names:
12167594505SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
12267594505SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
12367594505Smrgdnl aclocal-1.4 backwards compatibility:
12467594505Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
12567594505Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
126b042e37fSmrg
127b042e37fSmrg
1283169be4bSmrg# _LT_PREPARE_CC_BASENAME
1293169be4bSmrg# -----------------------
1303169be4bSmrgm4_defun([_LT_PREPARE_CC_BASENAME], [
1313169be4bSmrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
1323169be4bSmrgfunc_cc_basename ()
1333169be4bSmrg{
1343169be4bSmrg    for cc_temp in @S|@*""; do
1353169be4bSmrg      case $cc_temp in
1363169be4bSmrg        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
1373169be4bSmrg        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
1383169be4bSmrg        \-*) ;;
1393169be4bSmrg        *) break;;
1403169be4bSmrg      esac
1413169be4bSmrg    done
1423169be4bSmrg    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
1433169be4bSmrg}
1443169be4bSmrg])# _LT_PREPARE_CC_BASENAME
1453169be4bSmrg
1463169be4bSmrg
14767594505Smrg# _LT_CC_BASENAME(CC)
14867594505Smrg# -------------------
1493169be4bSmrg# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
1503169be4bSmrg# but that macro is also expanded into generated libtool script, which
1513169be4bSmrg# arranges for $SED and $ECHO to be set by different means.
15267594505Smrgm4_defun([_LT_CC_BASENAME],
1533169be4bSmrg[m4_require([_LT_PREPARE_CC_BASENAME])dnl
1543169be4bSmrgAC_REQUIRE([_LT_DECL_SED])dnl
1553169be4bSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1563169be4bSmrgfunc_cc_basename $1
1573169be4bSmrgcc_basename=$func_cc_basename_result
158706b6b52Smrg])
159b042e37fSmrg
160b042e37fSmrg
16167594505Smrg# _LT_FILEUTILS_DEFAULTS
16267594505Smrg# ----------------------
16367594505Smrg# It is okay to use these file commands and assume they have been set
1643169be4bSmrg# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
16567594505Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
16667594505Smrg[: ${CP="cp -f"}
16767594505Smrg: ${MV="mv -f"}
16867594505Smrg: ${RM="rm -f"}
16967594505Smrg])# _LT_FILEUTILS_DEFAULTS
170b042e37fSmrg
171b042e37fSmrg
17267594505Smrg# _LT_SETUP
17367594505Smrg# ---------
17467594505Smrgm4_defun([_LT_SETUP],
17567594505Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
17667594505SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
17767594505SmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
17867594505SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
179b042e37fSmrg
18067594505Smrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
18167594505Smrgdnl
18267594505Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
18367594505Smrg_LT_DECL([], [host], [0])dnl
18467594505Smrg_LT_DECL([], [host_os], [0])dnl
18567594505Smrgdnl
18667594505Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
18767594505Smrg_LT_DECL([], [build], [0])dnl
18867594505Smrg_LT_DECL([], [build_os], [0])dnl
18967594505Smrgdnl
19067594505SmrgAC_REQUIRE([AC_PROG_CC])dnl
19167594505SmrgAC_REQUIRE([LT_PATH_LD])dnl
19267594505SmrgAC_REQUIRE([LT_PATH_NM])dnl
19367594505Smrgdnl
19467594505SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
19567594505Smrgtest -z "$LN_S" && LN_S="ln -s"
19667594505Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
19767594505Smrgdnl
19867594505SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
19967594505Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
20067594505Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
20167594505Smrgdnl
20267594505Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
20367594505Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
20467594505Smrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
20567594505Smrgm4_require([_LT_CMD_RELOAD])dnl
20667594505Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
20767594505Smrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
20867594505Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
20967594505Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
21067594505Smrgm4_require([_LT_WITH_SYSROOT])dnl
2113169be4bSmrgm4_require([_LT_CMD_TRUNCATE])dnl
2128c4a8e55Smrg
21367594505Smrg_LT_CONFIG_LIBTOOL_INIT([
2143169be4bSmrg# See if we are running on zsh, and set the options that allow our
21567594505Smrg# commands through without removal of \ escapes INIT.
2163169be4bSmrgif test -n "\${ZSH_VERSION+set}"; then
21767594505Smrg   setopt NO_GLOB_SUBST
21867594505Smrgfi
2198bd17e5fSmrg])
2203169be4bSmrgif test -n "${ZSH_VERSION+set}"; then
22167594505Smrg   setopt NO_GLOB_SUBST
22267594505Smrgfi
2238c4a8e55Smrg
22467594505Smrg_LT_CHECK_OBJDIR
2258c4a8e55Smrg
22667594505Smrgm4_require([_LT_TAG_COMPILER])dnl
227fc98c8e2Smrg
22867594505Smrgcase $host_os in
22967594505Smrgaix3*)
23067594505Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
23167594505Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
23267594505Smrg  # vanish in a puff of smoke.
2333169be4bSmrg  if test set != "${COLLECT_NAMES+set}"; then
23467594505Smrg    COLLECT_NAMES=
23567594505Smrg    export COLLECT_NAMES
2368bd17e5fSmrg  fi
23767594505Smrg  ;;
23867594505Smrgesac
2398c4a8e55Smrg
24067594505Smrg# Global variables:
24167594505Smrgofile=libtool
24267594505Smrgcan_build_shared=yes
2438c4a8e55Smrg
2443169be4bSmrg# All known linkers require a '.a' archive for static linking (except MSVC,
24567594505Smrg# which needs '.lib').
24667594505Smrglibext=a
2478c4a8e55Smrg
2483169be4bSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
2498c4a8e55Smrg
2503169be4bSmrgold_CC=$CC
2513169be4bSmrgold_CFLAGS=$CFLAGS
252fc98c8e2Smrg
25367594505Smrg# Set sane defaults for various variables
25467594505Smrgtest -z "$CC" && CC=cc
25567594505Smrgtest -z "$LTCC" && LTCC=$CC
25667594505Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
25767594505Smrgtest -z "$LD" && LD=ld
25867594505Smrgtest -z "$ac_objext" && ac_objext=o
259fc98c8e2Smrg
26067594505Smrg_LT_CC_BASENAME([$compiler])
261fc98c8e2Smrg
26267594505Smrg# Only perform the check for file, if the check method requires it
26367594505Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
26467594505Smrgcase $deplibs_check_method in
26567594505Smrgfile_magic*)
26667594505Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
26767594505Smrg    _LT_PATH_MAGIC
26867594505Smrg  fi
26967594505Smrg  ;;
27067594505Smrgesac
271fc98c8e2Smrg
27267594505Smrg# Use C for the default configuration in the libtool script
27367594505SmrgLT_SUPPORTED_TAG([CC])
27467594505Smrg_LT_LANG_C_CONFIG
27567594505Smrg_LT_LANG_DEFAULT_CONFIG
27667594505Smrg_LT_CONFIG_COMMANDS
27767594505Smrg])# _LT_SETUP
278fc98c8e2Smrg
2798c4a8e55Smrg
28067594505Smrg# _LT_PREPARE_SED_QUOTE_VARS
28167594505Smrg# --------------------------
28267594505Smrg# Define a few sed substitution that help us do robust quoting.
28367594505Smrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
28467594505Smrg[# Backslashify metacharacters that are still active within
28567594505Smrg# double-quoted strings.
28667594505Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
287b042e37fSmrg
28867594505Smrg# Same as above, but do not quote variable references.
28967594505Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
290b042e37fSmrg
29167594505Smrg# Sed substitution to delay expansion of an escaped shell variable in a
29267594505Smrg# double_quote_subst'ed string.
29367594505Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
294b042e37fSmrg
29567594505Smrg# Sed substitution to delay expansion of an escaped single quote.
29667594505Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
297b042e37fSmrg
29867594505Smrg# Sed substitution to avoid accidental globbing in evaled expressions
29967594505Smrgno_glob_subst='s/\*/\\\*/g'
30067594505Smrg])
301706b6b52Smrg
30267594505Smrg# _LT_PROG_LTMAIN
30367594505Smrg# ---------------
3043169be4bSmrg# Note that this code is called both from 'configure', and 'config.status'
30567594505Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
3063169be4bSmrg# 'config.status' has no value for ac_aux_dir unless we are using Automake,
30767594505Smrg# so we pass a copy along to make sure it has a sensible value anyway.
30867594505Smrgm4_defun([_LT_PROG_LTMAIN],
30967594505Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
31067594505Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
3113169be4bSmrgltmain=$ac_aux_dir/ltmain.sh
31267594505Smrg])# _LT_PROG_LTMAIN
313b042e37fSmrg
314b042e37fSmrg
315b042e37fSmrg
31667594505Smrg# So that we can recreate a full libtool script including additional
31767594505Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
3183169be4bSmrg# in macros and then make a single call at the end using the 'libtool'
31967594505Smrg# label.
320b042e37fSmrg
321b042e37fSmrg
32267594505Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
32367594505Smrg# ----------------------------------------
32467594505Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
32567594505Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
32667594505Smrg[m4_ifval([$1],
32767594505Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
32867594505Smrg                     [$1
32967594505Smrg])])])
330b042e37fSmrg
33167594505Smrg# Initialize.
33267594505Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
333b042e37fSmrg
33467594505Smrg
33567594505Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
3368bd17e5fSmrg# ------------------------------
33767594505Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
33867594505Smrgm4_define([_LT_CONFIG_LIBTOOL],
33967594505Smrg[m4_ifval([$1],
34067594505Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
34167594505Smrg                     [$1
34267594505Smrg])])])
343b042e37fSmrg
34467594505Smrg# Initialize.
34567594505Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
34667594505Smrg
34767594505Smrg
34867594505Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
34967594505Smrg# -----------------------------------------------------
35067594505Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
35167594505Smrg[_LT_CONFIG_LIBTOOL([$1])
35267594505Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
3530597fb56Smrg])
354b042e37fSmrg
355b042e37fSmrg
35667594505Smrg# _LT_FORMAT_COMMENT([COMMENT])
35767594505Smrg# -----------------------------
35867594505Smrg# Add leading comment marks to the start of each line, and a trailing
35967594505Smrg# full-stop to the whole comment if one is not present already.
36067594505Smrgm4_define([_LT_FORMAT_COMMENT],
36167594505Smrg[m4_ifval([$1], [
36267594505Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
36367594505Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
36467594505Smrg)])
365b042e37fSmrg
366b042e37fSmrg
367b042e37fSmrg
3688c4a8e55Smrg
3698c4a8e55Smrg
37067594505Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
37167594505Smrg# -------------------------------------------------------------------
37267594505Smrg# CONFIGNAME is the name given to the value in the libtool script.
37367594505Smrg# VARNAME is the (base) name used in the configure script.
37467594505Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
37567594505Smrg# VARNAME.  Any other value will be used directly.
37667594505Smrgm4_define([_LT_DECL],
37767594505Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
37867594505Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
37967594505Smrg	[m4_ifval([$1], [$1], [$2])])
38067594505Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
38167594505Smrg    m4_ifval([$4],
38267594505Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
38367594505Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
38467594505Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
38567594505Smrg])
386fc98c8e2Smrg
387fc98c8e2Smrg
38867594505Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
38967594505Smrg# --------------------------------------------------------
39067594505Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
391fc98c8e2Smrg
392fc98c8e2Smrg
39367594505Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
39467594505Smrg# ------------------------------------------------
39567594505Smrgm4_define([lt_decl_tag_varnames],
39667594505Smrg[_lt_decl_filter([tagged?], [yes], $@)])
397fc98c8e2Smrg
398b042e37fSmrg
39967594505Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
40067594505Smrg# ---------------------------------------------------------
40167594505Smrgm4_define([_lt_decl_filter],
40267594505Smrg[m4_case([$#],
40367594505Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
40467594505Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
40567594505Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
40667594505Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
40767594505Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
40867594505Smrg])
409b042e37fSmrg
4108c4a8e55Smrg
41167594505Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
41267594505Smrg# --------------------------------------------------
41367594505Smrgm4_define([lt_decl_quote_varnames],
41467594505Smrg[_lt_decl_filter([value], [1], $@)])
4158bd17e5fSmrg
416b042e37fSmrg
41767594505Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
41867594505Smrg# ---------------------------------------------------
41967594505Smrgm4_define([lt_decl_dquote_varnames],
42067594505Smrg[_lt_decl_filter([value], [2], $@)])
421b042e37fSmrg
42267594505Smrg
42367594505Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
42467594505Smrg# ---------------------------------------------------
42567594505Smrgm4_define([lt_decl_varnames_tagged],
42667594505Smrg[m4_assert([$# <= 2])dnl
42767594505Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
42867594505Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
42967594505Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
43067594505Smrgm4_define([_lt_decl_varnames_tagged],
43167594505Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
43267594505Smrg
43367594505Smrg
43467594505Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
43567594505Smrg# ------------------------------------------------
43667594505Smrgm4_define([lt_decl_all_varnames],
43767594505Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
43867594505Smrg     m4_if([$2], [],
43967594505Smrg	   m4_quote(lt_decl_varnames),
44067594505Smrg	m4_quote(m4_shift($@))))[]dnl
4410597fb56Smrg])
44267594505Smrgm4_define([_lt_decl_all_varnames],
44367594505Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
44467594505Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
4458c4a8e55Smrg])
446b042e37fSmrg
447b042e37fSmrg
44867594505Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
44967594505Smrg# ------------------------------------
4503169be4bSmrg# Quote a variable value, and forward it to 'config.status' so that its
4513169be4bSmrg# declaration there will have the same value as in 'configure'.  VARNAME
45267594505Smrg# must have a single quote delimited value for this to work.
45367594505Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
45467594505Smrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
455b042e37fSmrg
456b042e37fSmrg
45767594505Smrg# _LT_CONFIG_STATUS_DECLARATIONS
45867594505Smrg# ------------------------------
45967594505Smrg# We delimit libtool config variables with single quotes, so when
46067594505Smrg# we write them to config.status, we have to be sure to quote all
46167594505Smrg# embedded single quotes properly.  In configure, this macro expands
46267594505Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
46367594505Smrg#
46467594505Smrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
46567594505Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
46667594505Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
46767594505Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
468b042e37fSmrg
469b042e37fSmrg
47067594505Smrg# _LT_LIBTOOL_TAGS
47167594505Smrg# ----------------
47267594505Smrg# Output comment and list of tags supported by the script
47367594505Smrgm4_defun([_LT_LIBTOOL_TAGS],
47467594505Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
4753169be4bSmrgavailable_tags='_LT_TAGS'dnl
47667594505Smrg])
477b042e37fSmrg
478b042e37fSmrg
47967594505Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
48067594505Smrg# -----------------------------------
48167594505Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
48267594505Smrg# expand to a commented shell variable setting:
4838bd17e5fSmrg#
48467594505Smrg#    # Some comment about what VAR is for.
48567594505Smrg#    visible_name=$lt_internal_name
48667594505Smrgm4_define([_LT_LIBTOOL_DECLARE],
48767594505Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
48867594505Smrg					   [description])))[]dnl
48967594505Smrgm4_pushdef([_libtool_name],
49067594505Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
49167594505Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
49267594505Smrg    [0], [_libtool_name=[$]$1],
49367594505Smrg    [1], [_libtool_name=$lt_[]$1],
49467594505Smrg    [2], [_libtool_name=$lt_[]$1],
49567594505Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
49667594505Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
49767594505Smrg])
498b042e37fSmrg
499b042e37fSmrg
50067594505Smrg# _LT_LIBTOOL_CONFIG_VARS
50167594505Smrg# -----------------------
50267594505Smrg# Produce commented declarations of non-tagged libtool config variables
5033169be4bSmrg# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
50467594505Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
50567594505Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
50667594505Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
50767594505Smrg[m4_foreach([_lt_var],
50867594505Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
50967594505Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
5108bd17e5fSmrg
511b042e37fSmrg
51267594505Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
51367594505Smrg# -------------------------
51467594505Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
51567594505Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
51667594505Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
517706b6b52Smrg
518706b6b52Smrg
51967594505Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
52067594505Smrg# ------------------------------
52167594505Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
522b042e37fSmrg
523b042e37fSmrg
52467594505Smrg# _LT_CONFIG_COMMANDS
52567594505Smrg# -------------------
52667594505Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
52767594505Smrg# variables for single and double quote escaping we saved from calls
52867594505Smrg# to _LT_DECL, we can put quote escaped variables declarations
5293169be4bSmrg# into 'config.status', and then the shell code to quote escape them in
5303169be4bSmrg# for loops in 'config.status'.  Finally, any additional code accumulated
53167594505Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
53267594505Smrgm4_defun([_LT_CONFIG_COMMANDS],
53367594505Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
53467594505Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
53567594505Smrg	dnl instead of duplicating it all over again into config.status,
53667594505Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
53767594505Smrg	dnl needs to know what name is stored there:
53867594505Smrg        [AC_CONFIG_COMMANDS([libtool],
53967594505Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
54067594505Smrg    dnl If the libtool generation code is destined for config.status,
54167594505Smrg    dnl expand the accumulated commands and init code now:
54267594505Smrg    [AC_CONFIG_COMMANDS([libtool],
54367594505Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
54467594505Smrg])#_LT_CONFIG_COMMANDS
54567594505Smrg
54667594505Smrg
54767594505Smrg# Initialize.
54867594505Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
54967594505Smrg[
55067594505Smrg
55167594505Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
55267594505Smrg# if CDPATH is set.
55367594505Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
55467594505Smrg
55567594505Smrgsed_quote_subst='$sed_quote_subst'
55667594505Smrgdouble_quote_subst='$double_quote_subst'
55767594505Smrgdelay_variable_subst='$delay_variable_subst'
55867594505Smrg_LT_CONFIG_STATUS_DECLARATIONS
55967594505SmrgLTCC='$LTCC'
56067594505SmrgLTCFLAGS='$LTCFLAGS'
56167594505Smrgcompiler='$compiler_DEFAULT'
56267594505Smrg
56367594505Smrg# A function that is used when there is no print builtin or printf.
56467594505Smrgfunc_fallback_echo ()
56567594505Smrg{
56667594505Smrg  eval 'cat <<_LTECHO_EOF
56767594505Smrg\$[]1
56867594505Smrg_LTECHO_EOF'
56967594505Smrg}
57067594505Smrg
57167594505Smrg# Quote evaled strings.
57267594505Smrgfor var in lt_decl_all_varnames([[ \
57367594505Smrg]], lt_decl_quote_varnames); do
57467594505Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
57567594505Smrg    *[[\\\\\\\`\\"\\\$]]*)
5763169be4bSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
5770597fb56Smrg      ;;
57867594505Smrg    *)
57967594505Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
5800597fb56Smrg      ;;
58167594505Smrg    esac
58267594505Smrgdone
58367594505Smrg
58467594505Smrg# Double-quote double-evaled strings.
58567594505Smrgfor var in lt_decl_all_varnames([[ \
58667594505Smrg]], lt_decl_dquote_varnames); do
58767594505Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
58867594505Smrg    *[[\\\\\\\`\\"\\\$]]*)
5893169be4bSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
5908bd17e5fSmrg      ;;
59167594505Smrg    *)
59267594505Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
5930597fb56Smrg      ;;
594706b6b52Smrg    esac
59567594505Smrgdone
596b042e37fSmrg
59767594505Smrg_LT_OUTPUT_LIBTOOL_INIT
59867594505Smrg])
5998bd17e5fSmrg
60067594505Smrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
60167594505Smrg# ------------------------------------
60267594505Smrg# Generate a child script FILE with all initialization necessary to
60367594505Smrg# reuse the environment learned by the parent script, and make the
60467594505Smrg# file executable.  If COMMENT is supplied, it is inserted after the
6053169be4bSmrg# '#!' sequence but before initialization text begins.  After this
60667594505Smrg# macro, additional text can be appended to FILE to form the body of
60767594505Smrg# the child script.  The macro ends with non-zero status if the
60867594505Smrg# file could not be fully written (such as if the disk is full).
60967594505Smrgm4_ifdef([AS_INIT_GENERATED],
61067594505Smrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
61167594505Smrg[m4_defun([_LT_GENERATED_FILE_INIT],
61267594505Smrg[m4_require([AS_PREPARE])]dnl
61367594505Smrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
61467594505Smrg[lt_write_fail=0
61567594505Smrgcat >$1 <<_ASEOF || lt_write_fail=1
61667594505Smrg#! $SHELL
61767594505Smrg# Generated by $as_me.
61867594505Smrg$2
61967594505SmrgSHELL=\${CONFIG_SHELL-$SHELL}
62067594505Smrgexport SHELL
62167594505Smrg_ASEOF
62267594505Smrgcat >>$1 <<\_ASEOF || lt_write_fail=1
62367594505SmrgAS_SHELL_SANITIZE
62467594505Smrg_AS_PREPARE
62567594505Smrgexec AS_MESSAGE_FD>&1
62667594505Smrg_ASEOF
6273169be4bSmrgtest 0 = "$lt_write_fail" && chmod +x $1[]dnl
62867594505Smrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
629b042e37fSmrg
63067594505Smrg# LT_OUTPUT
63167594505Smrg# ---------
63267594505Smrg# This macro allows early generation of the libtool script (before
63367594505Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
63467594505Smrg# tests.
63567594505SmrgAC_DEFUN([LT_OUTPUT],
63667594505Smrg[: ${CONFIG_LT=./config.lt}
63767594505SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
63867594505Smrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
63967594505Smrg[# Run this file to recreate a libtool stub with the current configuration.])
640b042e37fSmrg
64167594505Smrgcat >>"$CONFIG_LT" <<\_LTEOF
64267594505Smrglt_cl_silent=false
64367594505Smrgexec AS_MESSAGE_LOG_FD>>config.log
64467594505Smrg{
64567594505Smrg  echo
64667594505Smrg  AS_BOX([Running $as_me.])
64767594505Smrg} >&AS_MESSAGE_LOG_FD
648b042e37fSmrg
64967594505Smrglt_cl_help="\
6503169be4bSmrg'$as_me' creates a local libtool stub from the current configuration,
65167594505Smrgfor use in further configure time tests before the real libtool is
65267594505Smrggenerated.
653b042e37fSmrg
65467594505SmrgUsage: $[0] [[OPTIONS]]
655b042e37fSmrg
65667594505Smrg  -h, --help      print this help, then exit
65767594505Smrg  -V, --version   print version number, then exit
65867594505Smrg  -q, --quiet     do not print progress messages
65967594505Smrg  -d, --debug     don't remove temporary files
660b042e37fSmrg
66167594505SmrgReport bugs to <bug-libtool@gnu.org>."
662b042e37fSmrg
66367594505Smrglt_cl_version="\
66467594505Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
66567594505Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
66667594505Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
6678c4a8e55Smrg
66867594505SmrgCopyright (C) 2011 Free Software Foundation, Inc.
66967594505SmrgThis config.lt script is free software; the Free Software Foundation
67067594505Smrggives unlimited permision to copy, distribute and modify it."
6718c4a8e55Smrg
6723169be4bSmrgwhile test 0 != $[#]
67367594505Smrgdo
67467594505Smrg  case $[1] in
67567594505Smrg    --version | --v* | -V )
67667594505Smrg      echo "$lt_cl_version"; exit 0 ;;
67767594505Smrg    --help | --h* | -h )
67867594505Smrg      echo "$lt_cl_help"; exit 0 ;;
67967594505Smrg    --debug | --d* | -d )
68067594505Smrg      debug=: ;;
68167594505Smrg    --quiet | --q* | --silent | --s* | -q )
68267594505Smrg      lt_cl_silent=: ;;
683b042e37fSmrg
68467594505Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
6853169be4bSmrgTry '$[0] --help' for more information.]) ;;
686b042e37fSmrg
68767594505Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
6883169be4bSmrgTry '$[0] --help' for more information.]) ;;
68967594505Smrg  esac
69067594505Smrg  shift
69167594505Smrgdone
6928c4a8e55Smrg
69367594505Smrgif $lt_cl_silent; then
69467594505Smrg  exec AS_MESSAGE_FD>/dev/null
69567594505Smrgfi
69667594505Smrg_LTEOF
6978c4a8e55Smrg
69867594505Smrgcat >>"$CONFIG_LT" <<_LTEOF
69967594505Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
70067594505Smrg_LTEOF
7018c4a8e55Smrg
70267594505Smrgcat >>"$CONFIG_LT" <<\_LTEOF
70367594505SmrgAC_MSG_NOTICE([creating $ofile])
70467594505Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
70567594505SmrgAS_EXIT(0)
70667594505Smrg_LTEOF
70767594505Smrgchmod +x "$CONFIG_LT"
7088c4a8e55Smrg
70967594505Smrg# configure is writing to config.log, but config.lt does its own redirection,
71067594505Smrg# appending to config.log, which fails on DOS, as config.log is still kept
71167594505Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
71267594505Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
71367594505Smrglt_cl_success=:
7143169be4bSmrgtest yes = "$silent" &&
71567594505Smrg  lt_config_lt_args="$lt_config_lt_args --quiet"
71667594505Smrgexec AS_MESSAGE_LOG_FD>/dev/null
71767594505Smrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
71867594505Smrgexec AS_MESSAGE_LOG_FD>>config.log
71967594505Smrg$lt_cl_success || AS_EXIT(1)
72067594505Smrg])# LT_OUTPUT
7218c4a8e55Smrg
722b042e37fSmrg
72367594505Smrg# _LT_CONFIG(TAG)
72467594505Smrg# ---------------
72567594505Smrg# If TAG is the built-in tag, create an initial libtool script with a
72667594505Smrg# default configuration from the untagged config vars.  Otherwise add code
72767594505Smrg# to config.status for appending the configuration named by TAG from the
72867594505Smrg# matching tagged config vars.
72967594505Smrgm4_defun([_LT_CONFIG],
73067594505Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
73167594505Smrg_LT_CONFIG_SAVE_COMMANDS([
73267594505Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
73367594505Smrg  m4_if(_LT_TAG, [C], [
7343169be4bSmrg    # See if we are running on zsh, and set the options that allow our
73567594505Smrg    # commands through without removal of \ escapes.
7363169be4bSmrg    if test -n "${ZSH_VERSION+set}"; then
73767594505Smrg      setopt NO_GLOB_SUBST
73867594505Smrg    fi
739b042e37fSmrg
7403169be4bSmrg    cfgfile=${ofile}T
74167594505Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
74267594505Smrg    $RM "$cfgfile"
743b042e37fSmrg
74467594505Smrg    cat <<_LT_EOF >> "$cfgfile"
74567594505Smrg#! $SHELL
7463169be4bSmrg# Generated automatically by $as_me ($PACKAGE) $VERSION
74767594505Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
74867594505Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
7493169be4bSmrg
7503169be4bSmrg# Provide generalized library-building support services.
7513169be4bSmrg# Written by Gordon Matzigkeit, 1996
7523169be4bSmrg
75367594505Smrg_LT_COPYING
75467594505Smrg_LT_LIBTOOL_TAGS
755b042e37fSmrg
7563169be4bSmrg# Configured defaults for sys_lib_dlsearch_path munging.
7573169be4bSmrg: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
7583169be4bSmrg
75967594505Smrg# ### BEGIN LIBTOOL CONFIG
76067594505Smrg_LT_LIBTOOL_CONFIG_VARS
76167594505Smrg_LT_LIBTOOL_TAG_VARS
76267594505Smrg# ### END LIBTOOL CONFIG
76367594505Smrg
7643169be4bSmrg_LT_EOF
7653169be4bSmrg
7663169be4bSmrg    cat <<'_LT_EOF' >> "$cfgfile"
7673169be4bSmrg
7683169be4bSmrg# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
7693169be4bSmrg
7703169be4bSmrg_LT_PREPARE_MUNGE_PATH_LIST
7713169be4bSmrg_LT_PREPARE_CC_BASENAME
7723169be4bSmrg
7733169be4bSmrg# ### END FUNCTIONS SHARED WITH CONFIGURE
7743169be4bSmrg
77567594505Smrg_LT_EOF
77667594505Smrg
77767594505Smrg  case $host_os in
77867594505Smrg  aix3*)
77967594505Smrg    cat <<\_LT_EOF >> "$cfgfile"
78067594505Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
78167594505Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
78267594505Smrg# vanish in a puff of smoke.
7833169be4bSmrgif test set != "${COLLECT_NAMES+set}"; then
78467594505Smrg  COLLECT_NAMES=
78567594505Smrg  export COLLECT_NAMES
78667594505Smrgfi
78767594505Smrg_LT_EOF
78867594505Smrg    ;;
7890597fb56Smrg  esac
790b042e37fSmrg
79167594505Smrg  _LT_PROG_LTMAIN
792b042e37fSmrg
79367594505Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
79467594505Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
79567594505Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
79667594505Smrg  # is reportedly fixed, but why not run on old versions too?
79767594505Smrg  sed '$q' "$ltmain" >> "$cfgfile" \
79867594505Smrg     || (rm -f "$cfgfile"; exit 1)
799b042e37fSmrg
80067594505Smrg   mv -f "$cfgfile" "$ofile" ||
80167594505Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
80267594505Smrg  chmod +x "$ofile"
80367594505Smrg],
80467594505Smrg[cat <<_LT_EOF >> "$ofile"
805706b6b52Smrg
80667594505Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
80767594505Smrgdnl in a comment (ie after a #).
80867594505Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
80967594505Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
81067594505Smrg# ### END LIBTOOL TAG CONFIG: $1
81167594505Smrg_LT_EOF
81267594505Smrg])dnl /m4_if
81367594505Smrg],
81467594505Smrg[m4_if([$1], [], [
81567594505Smrg    PACKAGE='$PACKAGE'
81667594505Smrg    VERSION='$VERSION'
81767594505Smrg    RM='$RM'
81867594505Smrg    ofile='$ofile'], [])
81967594505Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
82067594505Smrg])# _LT_CONFIG
821706b6b52Smrg
822706b6b52Smrg
82367594505Smrg# LT_SUPPORTED_TAG(TAG)
82467594505Smrg# ---------------------
82567594505Smrg# Trace this macro to discover what tags are supported by the libtool
82667594505Smrg# --tag option, using:
82767594505Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
82867594505SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
829706b6b52Smrg
830706b6b52Smrg
83167594505Smrg# C support is built-in for now
83267594505Smrgm4_define([_LT_LANG_C_enabled], [])
83367594505Smrgm4_define([_LT_TAGS], [])
834bd23fbfaSmrg
835bd23fbfaSmrg
83667594505Smrg# LT_LANG(LANG)
83767594505Smrg# -------------
83867594505Smrg# Enable libtool support for the given language if not already enabled.
83967594505SmrgAC_DEFUN([LT_LANG],
84067594505Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
84167594505Smrgm4_case([$1],
84267594505Smrg  [C],			[_LT_LANG(C)],
84367594505Smrg  [C++],		[_LT_LANG(CXX)],
84467594505Smrg  [Go],			[_LT_LANG(GO)],
84567594505Smrg  [Java],		[_LT_LANG(GCJ)],
84667594505Smrg  [Fortran 77],		[_LT_LANG(F77)],
84767594505Smrg  [Fortran],		[_LT_LANG(FC)],
84867594505Smrg  [Windows Resource],	[_LT_LANG(RC)],
84967594505Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
85067594505Smrg    [_LT_LANG($1)],
85167594505Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
85267594505Smrg])# LT_LANG
853bd23fbfaSmrg
854bd23fbfaSmrg
85567594505Smrg# _LT_LANG(LANGNAME)
85667594505Smrg# ------------------
85767594505Smrgm4_defun([_LT_LANG],
85867594505Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
85967594505Smrg  [LT_SUPPORTED_TAG([$1])dnl
86067594505Smrg  m4_append([_LT_TAGS], [$1 ])dnl
86167594505Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
86267594505Smrg  _LT_LANG_$1_CONFIG($1)])dnl
86367594505Smrg])# _LT_LANG
8640597fb56Smrg
865bd23fbfaSmrg
86667594505Smrgm4_ifndef([AC_PROG_GO], [
86767594505Smrg# NOTE: This macro has been submitted for inclusion into   #
86867594505Smrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
86967594505Smrg#  a released version of Autoconf we should remove this    #
87067594505Smrg#  macro and use it instead.                               #
87167594505Smrgm4_defun([AC_PROG_GO],
87267594505Smrg[AC_LANG_PUSH(Go)dnl
87367594505SmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
87467594505SmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
87567594505Smrg_AC_ARG_VAR_LDFLAGS()dnl
87667594505SmrgAC_CHECK_TOOL(GOC, gccgo)
87767594505Smrgif test -z "$GOC"; then
87867594505Smrg  if test -n "$ac_tool_prefix"; then
87967594505Smrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
8808bd17e5fSmrg  fi
88167594505Smrgfi
88267594505Smrgif test -z "$GOC"; then
88367594505Smrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
88467594505Smrgfi
88567594505Smrg])#m4_defun
88667594505Smrg])#m4_ifndef
887706b6b52Smrg
888706b6b52Smrg
88967594505Smrg# _LT_LANG_DEFAULT_CONFIG
89067594505Smrg# -----------------------
89167594505Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
89267594505Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
89367594505Smrg  [LT_LANG(CXX)],
89467594505Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
895706b6b52Smrg
89667594505SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
89767594505Smrg  [LT_LANG(F77)],
89867594505Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
899b042e37fSmrg
90067594505SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
90167594505Smrg  [LT_LANG(FC)],
90267594505Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
903b042e37fSmrg
90467594505Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
90567594505Smrgdnl pulling things in needlessly.
90667594505SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
90767594505Smrg  [LT_LANG(GCJ)],
90867594505Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
90967594505Smrg    [LT_LANG(GCJ)],
91067594505Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
91167594505Smrg      [LT_LANG(GCJ)],
91267594505Smrg      [m4_ifdef([AC_PROG_GCJ],
91367594505Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
91467594505Smrg       m4_ifdef([A][M_PROG_GCJ],
91567594505Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
91667594505Smrg       m4_ifdef([LT_PROG_GCJ],
91767594505Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
918b042e37fSmrg
91967594505SmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
92067594505Smrg  [LT_LANG(GO)],
92167594505Smrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
922706b6b52Smrg
92367594505SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
92467594505Smrg  [LT_LANG(RC)],
92567594505Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
92667594505Smrg])# _LT_LANG_DEFAULT_CONFIG
927bd23fbfaSmrg
92867594505Smrg# Obsolete macros:
92967594505SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
93067594505SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
93167594505SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
93267594505SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
93367594505SmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
93467594505Smrgdnl aclocal-1.4 backwards compatibility:
93567594505Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
93667594505Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
93767594505Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
93867594505Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
93967594505Smrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
940b042e37fSmrg
941706b6b52Smrg
94267594505Smrg# _LT_TAG_COMPILER
94367594505Smrg# ----------------
94467594505Smrgm4_defun([_LT_TAG_COMPILER],
94567594505Smrg[AC_REQUIRE([AC_PROG_CC])dnl
946b042e37fSmrg
94767594505Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
94867594505Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
94967594505Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
95067594505Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
951706b6b52Smrg
95267594505Smrg# If no C compiler was specified, use CC.
95367594505SmrgLTCC=${LTCC-"$CC"}
954706b6b52Smrg
95567594505Smrg# If no C compiler flags were specified, use CFLAGS.
95667594505SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
957b042e37fSmrg
95867594505Smrg# Allow CC to be a program name with arguments.
95967594505Smrgcompiler=$CC
96067594505Smrg])# _LT_TAG_COMPILER
961bd23fbfaSmrg
962bd23fbfaSmrg
96367594505Smrg# _LT_COMPILER_BOILERPLATE
96467594505Smrg# ------------------------
96567594505Smrg# Check for compiler boilerplate output or warnings with
96667594505Smrg# the simple compiler test code.
96767594505Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
96867594505Smrg[m4_require([_LT_DECL_SED])dnl
96967594505Smrgac_outfile=conftest.$ac_objext
97067594505Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
97167594505Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
97267594505Smrg_lt_compiler_boilerplate=`cat conftest.err`
97367594505Smrg$RM conftest*
97467594505Smrg])# _LT_COMPILER_BOILERPLATE
975bd23fbfaSmrg
976bd23fbfaSmrg
97767594505Smrg# _LT_LINKER_BOILERPLATE
97867594505Smrg# ----------------------
97967594505Smrg# Check for linker boilerplate output or warnings with
98067594505Smrg# the simple link test code.
98167594505Smrgm4_defun([_LT_LINKER_BOILERPLATE],
98267594505Smrg[m4_require([_LT_DECL_SED])dnl
98367594505Smrgac_outfile=conftest.$ac_objext
98467594505Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
98567594505Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
98667594505Smrg_lt_linker_boilerplate=`cat conftest.err`
98767594505Smrg$RM -r conftest*
98867594505Smrg])# _LT_LINKER_BOILERPLATE
989bd23fbfaSmrg
99067594505Smrg# _LT_REQUIRED_DARWIN_CHECKS
99167594505Smrg# -------------------------
99267594505Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
99367594505Smrg  case $host_os in
99467594505Smrg    rhapsody* | darwin*)
99567594505Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
99667594505Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
99767594505Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
99867594505Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
99967594505Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
100067594505Smrg    _LT_DECL([], [DSYMUTIL], [1],
100167594505Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
100267594505Smrg    _LT_DECL([], [NMEDIT], [1],
100367594505Smrg      [Tool to change global to local symbols on Mac OS X])
100467594505Smrg    _LT_DECL([], [LIPO], [1],
100567594505Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
100667594505Smrg    _LT_DECL([], [OTOOL], [1],
100767594505Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
100867594505Smrg    _LT_DECL([], [OTOOL64], [1],
100967594505Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
1010bd23fbfaSmrg
101167594505Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
101267594505Smrg      [lt_cv_apple_cc_single_mod=no
10133169be4bSmrg      if test -z "$LT_MULTI_MODULE"; then
101467594505Smrg	# By default we will add the -single_module flag. You can override
101567594505Smrg	# by either setting the environment variable LT_MULTI_MODULE
101667594505Smrg	# non-empty at configure time, or by adding -multi_module to the
101767594505Smrg	# link flags.
101867594505Smrg	rm -rf libconftest.dylib*
101967594505Smrg	echo "int foo(void){return 1;}" > conftest.c
102067594505Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
102167594505Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
102267594505Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
102367594505Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
102467594505Smrg        _lt_result=$?
102567594505Smrg	# If there is a non-empty error log, and "single_module"
102667594505Smrg	# appears in it, assume the flag caused a linker warning
102767594505Smrg        if test -s conftest.err && $GREP single_module conftest.err; then
102867594505Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
102967594505Smrg	# Otherwise, if the output was created with a 0 exit code from
103067594505Smrg	# the compiler, it worked.
10313169be4bSmrg	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
103267594505Smrg	  lt_cv_apple_cc_single_mod=yes
103367594505Smrg	else
103467594505Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
103567594505Smrg	fi
103667594505Smrg	rm -rf libconftest.dylib*
103767594505Smrg	rm -f conftest.*
103867594505Smrg      fi])
1039bd23fbfaSmrg
104067594505Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
104167594505Smrg      [lt_cv_ld_exported_symbols_list],
104267594505Smrg      [lt_cv_ld_exported_symbols_list=no
104367594505Smrg      save_LDFLAGS=$LDFLAGS
104467594505Smrg      echo "_main" > conftest.sym
104567594505Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
104667594505Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
104767594505Smrg	[lt_cv_ld_exported_symbols_list=yes],
104867594505Smrg	[lt_cv_ld_exported_symbols_list=no])
10493169be4bSmrg	LDFLAGS=$save_LDFLAGS
105067594505Smrg    ])
10510597fb56Smrg
105267594505Smrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
105367594505Smrg      [lt_cv_ld_force_load=no
105467594505Smrg      cat > conftest.c << _LT_EOF
105567594505Smrgint forced_loaded() { return 2;}
105667594505Smrg_LT_EOF
105767594505Smrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
105867594505Smrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
105967594505Smrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
106067594505Smrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
106167594505Smrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
106267594505Smrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
106367594505Smrg      cat > conftest.c << _LT_EOF
106467594505Smrgint main() { return 0;}
106567594505Smrg_LT_EOF
106667594505Smrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
106767594505Smrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
106867594505Smrg      _lt_result=$?
106967594505Smrg      if test -s conftest.err && $GREP force_load conftest.err; then
107067594505Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
10713169be4bSmrg      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
107267594505Smrg	lt_cv_ld_force_load=yes
107367594505Smrg      else
107467594505Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
107567594505Smrg      fi
107667594505Smrg        rm -f conftest.err libconftest.a conftest conftest.c
107767594505Smrg        rm -rf conftest.dSYM
107867594505Smrg    ])
107967594505Smrg    case $host_os in
108067594505Smrg    rhapsody* | darwin1.[[012]])
10813169be4bSmrg      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
108267594505Smrg    darwin1.*)
10833169be4bSmrg      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
108467594505Smrg    darwin*) # darwin 5.x on
108567594505Smrg      # if running on 10.5 or later, the deployment target defaults
108667594505Smrg      # to the OS version, if on x86, and 10.4, the deployment
108767594505Smrg      # target defaults to 10.4. Don't you love it?
108867594505Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
108967594505Smrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
10903169be4bSmrg	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
10913169be4bSmrg	10.[[012]][[,.]]*)
10923169be4bSmrg	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
109367594505Smrg	10.*)
10943169be4bSmrg	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
109567594505Smrg      esac
109667594505Smrg    ;;
109767594505Smrg  esac
10983169be4bSmrg    if test yes = "$lt_cv_apple_cc_single_mod"; then
109967594505Smrg      _lt_dar_single_mod='$single_module'
110067594505Smrg    fi
11013169be4bSmrg    if test yes = "$lt_cv_ld_exported_symbols_list"; then
11023169be4bSmrg      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
110367594505Smrg    else
11043169be4bSmrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
110567594505Smrg    fi
11063169be4bSmrg    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
110767594505Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
110867594505Smrg    else
110967594505Smrg      _lt_dsymutil=
111067594505Smrg    fi
111167594505Smrg    ;;
111267594505Smrg  esac
11138bd17e5fSmrg])
11140597fb56Smrg
11150597fb56Smrg
111667594505Smrg# _LT_DARWIN_LINKER_FEATURES([TAG])
111767594505Smrg# ---------------------------------
111867594505Smrg# Checks for linker and compiler features on darwin
111967594505Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
112067594505Smrg[
112167594505Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
112267594505Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
112367594505Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
112467594505Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
112567594505Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
11263169be4bSmrg  if test yes = "$lt_cv_ld_force_load"; then
11273169be4bSmrg    _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\"`'
112867594505Smrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
112967594505Smrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
113067594505Smrg  else
113167594505Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
113267594505Smrg  fi
113367594505Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
11343169be4bSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
113567594505Smrg  case $cc_basename in
11363169be4bSmrg     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
113767594505Smrg     *) _lt_dar_can_shared=$GCC ;;
113867594505Smrg  esac
11393169be4bSmrg  if test yes = "$_lt_dar_can_shared"; then
114067594505Smrg    output_verbose_link_cmd=func_echo_all
11413169be4bSmrg    _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"
11423169be4bSmrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
11433169be4bSmrg    _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"
11443169be4bSmrg    _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"
114567594505Smrg    m4_if([$1], [CXX],
11463169be4bSmrg[   if test yes != "$lt_cv_apple_cc_single_mod"; then
11473169be4bSmrg      _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"
11483169be4bSmrg      _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"
114967594505Smrg    fi
115067594505Smrg],[])
115167594505Smrg  else
115267594505Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
115367594505Smrg  fi
115467594505Smrg])
11550597fb56Smrg
115667594505Smrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
115767594505Smrg# ----------------------------------
115867594505Smrg# Links a minimal program and checks the executable
115967594505Smrg# for the system default hardcoded library path. In most cases,
116067594505Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
116167594505Smrg# the location of the communication and MPI libs are included too.
116267594505Smrg# If we don't find anything, use the default library path according
116367594505Smrg# to the aix ld manual.
116467594505Smrg# Store the results from the different compilers for each TAGNAME.
116567594505Smrg# Allow to override them for all tags through lt_cv_aix_libpath.
116667594505Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
116767594505Smrg[m4_require([_LT_DECL_SED])dnl
11683169be4bSmrgif test set = "${lt_cv_aix_libpath+set}"; then
116967594505Smrg  aix_libpath=$lt_cv_aix_libpath
117067594505Smrgelse
117167594505Smrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
117267594505Smrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
117367594505Smrg  lt_aix_libpath_sed='[
117467594505Smrg      /Import File Strings/,/^$/ {
117567594505Smrg	  /^0/ {
117667594505Smrg	      s/^0  *\([^ ]*\) *$/\1/
117767594505Smrg	      p
117867594505Smrg	  }
117967594505Smrg      }]'
118067594505Smrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
118167594505Smrg  # Check for a 64-bit object if we didn't find anything.
118267594505Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
118367594505Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
118467594505Smrg  fi],[])
118567594505Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
11863169be4bSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
118767594505Smrg  fi
118867594505Smrg  ])
118967594505Smrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
119067594505Smrgfi
119167594505Smrg])# _LT_SYS_MODULE_PATH_AIX
11920597fb56Smrg
1193bd23fbfaSmrg
119467594505Smrg# _LT_SHELL_INIT(ARG)
119567594505Smrg# -------------------
119667594505Smrgm4_define([_LT_SHELL_INIT],
119767594505Smrg[m4_divert_text([M4SH-INIT], [$1
119867594505Smrg])])# _LT_SHELL_INIT
1199b042e37fSmrg
1200b042e37fSmrg
1201b042e37fSmrg
120267594505Smrg# _LT_PROG_ECHO_BACKSLASH
120367594505Smrg# -----------------------
120467594505Smrg# Find how we can fake an echo command that does not interpret backslash.
120567594505Smrg# In particular, with Autoconf 2.60 or later we add some code to the start
12063169be4bSmrg# of the generated configure script that will find a shell with a builtin
12073169be4bSmrg# printf (that we can use as an echo command).
120867594505Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
120967594505Smrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
121067594505SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
121167594505SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1212b042e37fSmrg
121367594505SmrgAC_MSG_CHECKING([how to print strings])
121467594505Smrg# Test print first, because it will be a builtin if present.
121567594505Smrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
121667594505Smrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
121767594505Smrg  ECHO='print -r --'
121867594505Smrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
121967594505Smrg  ECHO='printf %s\n'
122067594505Smrgelse
122167594505Smrg  # Use this function as a fallback that always works.
122267594505Smrg  func_fallback_echo ()
122367594505Smrg  {
122467594505Smrg    eval 'cat <<_LTECHO_EOF
122567594505Smrg$[]1
122667594505Smrg_LTECHO_EOF'
122767594505Smrg  }
122867594505Smrg  ECHO='func_fallback_echo'
122967594505Smrgfi
1230b042e37fSmrg
123167594505Smrg# func_echo_all arg...
123267594505Smrg# Invoke $ECHO with all args, space-separated.
123367594505Smrgfunc_echo_all ()
123467594505Smrg{
12353169be4bSmrg    $ECHO "$*"
123667594505Smrg}
1237b042e37fSmrg
12383169be4bSmrgcase $ECHO in
123967594505Smrg  printf*) AC_MSG_RESULT([printf]) ;;
124067594505Smrg  print*) AC_MSG_RESULT([print -r]) ;;
124167594505Smrg  *) AC_MSG_RESULT([cat]) ;;
124267594505Smrgesac
12430597fb56Smrg
124467594505Smrgm4_ifdef([_AS_DETECT_SUGGESTED],
124567594505Smrg[_AS_DETECT_SUGGESTED([
124667594505Smrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
124767594505Smrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
124867594505Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
124967594505Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
125067594505Smrg    PATH=/empty FPATH=/empty; export PATH FPATH
125167594505Smrg    test "X`printf %s $ECHO`" = "X$ECHO" \
125267594505Smrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
1253b042e37fSmrg
125467594505Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
125567594505Smrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
125667594505Smrg])# _LT_PROG_ECHO_BACKSLASH
1257b042e37fSmrg
1258b042e37fSmrg
12598bd17e5fSmrg# _LT_WITH_SYSROOT
12608bd17e5fSmrg# ----------------
12618bd17e5fSmrgAC_DEFUN([_LT_WITH_SYSROOT],
12628bd17e5fSmrg[AC_MSG_CHECKING([for sysroot])
12638bd17e5fSmrgAC_ARG_WITH([sysroot],
12643169be4bSmrg[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
12653169be4bSmrg  [Search for dependent libraries within DIR (or the compiler's sysroot
12663169be4bSmrg   if not specified).])],
12678bd17e5fSmrg[], [with_sysroot=no])
1268b042e37fSmrg
12698bd17e5fSmrgdnl lt_sysroot will always be passed unquoted.  We quote it here
12708bd17e5fSmrgdnl in case the user passed a directory name.
12718bd17e5fSmrglt_sysroot=
12723169be4bSmrgcase $with_sysroot in #(
12738bd17e5fSmrg yes)
12743169be4bSmrg   if test yes = "$GCC"; then
12758bd17e5fSmrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
12768bd17e5fSmrg   fi
12778bd17e5fSmrg   ;; #(
12788bd17e5fSmrg /*)
12798bd17e5fSmrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
12808bd17e5fSmrg   ;; #(
12818bd17e5fSmrg no|'')
12828bd17e5fSmrg   ;; #(
12838bd17e5fSmrg *)
12843169be4bSmrg   AC_MSG_RESULT([$with_sysroot])
12858bd17e5fSmrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
12868bd17e5fSmrg   ;;
12878bd17e5fSmrgesac
12888bd17e5fSmrg
12898bd17e5fSmrg AC_MSG_RESULT([${lt_sysroot:-no}])
12908bd17e5fSmrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
12913169be4bSmrg[dependent libraries, and where our libraries should be installed.])])
12928bd17e5fSmrg
12938bd17e5fSmrg# _LT_ENABLE_LOCK
12948bd17e5fSmrg# ---------------
12958bd17e5fSmrgm4_defun([_LT_ENABLE_LOCK],
12968bd17e5fSmrg[AC_ARG_ENABLE([libtool-lock],
12978bd17e5fSmrg  [AS_HELP_STRING([--disable-libtool-lock],
12988bd17e5fSmrg    [avoid locking (might break parallel builds)])])
12993169be4bSmrgtest no = "$enable_libtool_lock" || enable_libtool_lock=yes
13008bd17e5fSmrg
13018bd17e5fSmrg# Some flags need to be propagated to the compiler or linker for good
13028bd17e5fSmrg# libtool support.
13038bd17e5fSmrgcase $host in
13048bd17e5fSmrgia64-*-hpux*)
13053169be4bSmrg  # Find out what ABI is being produced by ac_compile, and set mode
13063169be4bSmrg  # options accordingly.
13078bd17e5fSmrg  echo 'int i;' > conftest.$ac_ext
13088bd17e5fSmrg  if AC_TRY_EVAL(ac_compile); then
13098bd17e5fSmrg    case `/usr/bin/file conftest.$ac_objext` in
13108bd17e5fSmrg      *ELF-32*)
13113169be4bSmrg	HPUX_IA64_MODE=32
13120597fb56Smrg	;;
13138bd17e5fSmrg      *ELF-64*)
13143169be4bSmrg	HPUX_IA64_MODE=64
13158bd17e5fSmrg	;;
13168bd17e5fSmrg    esac
13178bd17e5fSmrg  fi
13188bd17e5fSmrg  rm -rf conftest*
13198bd17e5fSmrg  ;;
13208bd17e5fSmrg*-*-irix6*)
13213169be4bSmrg  # Find out what ABI is being produced by ac_compile, and set linker
13223169be4bSmrg  # options accordingly.
13238bd17e5fSmrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
13248bd17e5fSmrg  if AC_TRY_EVAL(ac_compile); then
13253169be4bSmrg    if test yes = "$lt_cv_prog_gnu_ld"; then
13268bd17e5fSmrg      case `/usr/bin/file conftest.$ac_objext` in
13278bd17e5fSmrg	*32-bit*)
13288bd17e5fSmrg	  LD="${LD-ld} -melf32bsmip"
13298bd17e5fSmrg	  ;;
13308bd17e5fSmrg	*N32*)
13318bd17e5fSmrg	  LD="${LD-ld} -melf32bmipn32"
13328bd17e5fSmrg	  ;;
13338bd17e5fSmrg	*64-bit*)
13348bd17e5fSmrg	  LD="${LD-ld} -melf64bmip"
13350597fb56Smrg	;;
13360597fb56Smrg      esac
13378bd17e5fSmrg    else
13388bd17e5fSmrg      case `/usr/bin/file conftest.$ac_objext` in
13398bd17e5fSmrg	*32-bit*)
13408bd17e5fSmrg	  LD="${LD-ld} -32"
13418bd17e5fSmrg	  ;;
13428bd17e5fSmrg	*N32*)
13438bd17e5fSmrg	  LD="${LD-ld} -n32"
13448bd17e5fSmrg	  ;;
13458bd17e5fSmrg	*64-bit*)
13468bd17e5fSmrg	  LD="${LD-ld} -64"
13478bd17e5fSmrg	  ;;
13488bd17e5fSmrg      esac
13498bd17e5fSmrg    fi
13500597fb56Smrg  fi
13518bd17e5fSmrg  rm -rf conftest*
13520597fb56Smrg  ;;
1353b042e37fSmrg
13543169be4bSmrgmips64*-*linux*)
13553169be4bSmrg  # Find out what ABI is being produced by ac_compile, and set linker
13563169be4bSmrg  # options accordingly.
13573169be4bSmrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
13583169be4bSmrg  if AC_TRY_EVAL(ac_compile); then
13593169be4bSmrg    emul=elf
13603169be4bSmrg    case `/usr/bin/file conftest.$ac_objext` in
13613169be4bSmrg      *32-bit*)
13623169be4bSmrg	emul="${emul}32"
13633169be4bSmrg	;;
13643169be4bSmrg      *64-bit*)
13653169be4bSmrg	emul="${emul}64"
13663169be4bSmrg	;;
13673169be4bSmrg    esac
13683169be4bSmrg    case `/usr/bin/file conftest.$ac_objext` in
13693169be4bSmrg      *MSB*)
13703169be4bSmrg	emul="${emul}btsmip"
13713169be4bSmrg	;;
13723169be4bSmrg      *LSB*)
13733169be4bSmrg	emul="${emul}ltsmip"
13743169be4bSmrg	;;
13753169be4bSmrg    esac
13763169be4bSmrg    case `/usr/bin/file conftest.$ac_objext` in
13773169be4bSmrg      *N32*)
13783169be4bSmrg	emul="${emul}n32"
13793169be4bSmrg	;;
13803169be4bSmrg    esac
13813169be4bSmrg    LD="${LD-ld} -m $emul"
13823169be4bSmrg  fi
13833169be4bSmrg  rm -rf conftest*
13843169be4bSmrg  ;;
13853169be4bSmrg
138667594505Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
13878bd17e5fSmrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
13883169be4bSmrg  # Find out what ABI is being produced by ac_compile, and set linker
13893169be4bSmrg  # options accordingly.  Note that the listed cases only cover the
13903169be4bSmrg  # situations where additional linker options are needed (such as when
13913169be4bSmrg  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
13923169be4bSmrg  # vice versa); the common cases where no linker options are needed do
13933169be4bSmrg  # not appear in the list.
13948bd17e5fSmrg  echo 'int i;' > conftest.$ac_ext
13958bd17e5fSmrg  if AC_TRY_EVAL(ac_compile); then
13968bd17e5fSmrg    case `/usr/bin/file conftest.o` in
13978bd17e5fSmrg      *32-bit*)
13988bd17e5fSmrg	case $host in
13998bd17e5fSmrg	  x86_64-*kfreebsd*-gnu)
14008bd17e5fSmrg	    LD="${LD-ld} -m elf_i386_fbsd"
14018bd17e5fSmrg	    ;;
14028bd17e5fSmrg	  x86_64-*linux*)
1403b242714cSmrg	    case `/usr/bin/file conftest.o` in
1404b242714cSmrg	      *x86-64*)
1405b242714cSmrg		LD="${LD-ld} -m elf32_x86_64"
1406b242714cSmrg		;;
1407b242714cSmrg	      *)
1408b242714cSmrg		LD="${LD-ld} -m elf_i386"
1409b242714cSmrg		;;
1410b242714cSmrg	    esac
14118bd17e5fSmrg	    ;;
14123169be4bSmrg	  powerpc64le-*linux*)
141367594505Smrg	    LD="${LD-ld} -m elf32lppclinux"
141467594505Smrg	    ;;
14153169be4bSmrg	  powerpc64-*linux*)
14168bd17e5fSmrg	    LD="${LD-ld} -m elf32ppclinux"
14178bd17e5fSmrg	    ;;
14188bd17e5fSmrg	  s390x-*linux*)
14198bd17e5fSmrg	    LD="${LD-ld} -m elf_s390"
14208bd17e5fSmrg	    ;;
14218bd17e5fSmrg	  sparc64-*linux*)
14228bd17e5fSmrg	    LD="${LD-ld} -m elf32_sparc"
14238bd17e5fSmrg	    ;;
14248bd17e5fSmrg	esac
14258bd17e5fSmrg	;;
14268bd17e5fSmrg      *64-bit*)
14278bd17e5fSmrg	case $host in
14288bd17e5fSmrg	  x86_64-*kfreebsd*-gnu)
14298bd17e5fSmrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
14308bd17e5fSmrg	    ;;
14318bd17e5fSmrg	  x86_64-*linux*)
14328bd17e5fSmrg	    LD="${LD-ld} -m elf_x86_64"
14338bd17e5fSmrg	    ;;
14343169be4bSmrg	  powerpcle-*linux*)
143567594505Smrg	    LD="${LD-ld} -m elf64lppc"
143667594505Smrg	    ;;
14373169be4bSmrg	  powerpc-*linux*)
14388bd17e5fSmrg	    LD="${LD-ld} -m elf64ppc"
14398bd17e5fSmrg	    ;;
14408bd17e5fSmrg	  s390*-*linux*|s390*-*tpf*)
14418bd17e5fSmrg	    LD="${LD-ld} -m elf64_s390"
14428bd17e5fSmrg	    ;;
14438bd17e5fSmrg	  sparc*-*linux*)
14448bd17e5fSmrg	    LD="${LD-ld} -m elf64_sparc"
14458bd17e5fSmrg	    ;;
14468bd17e5fSmrg	esac
14478bd17e5fSmrg	;;
14488bd17e5fSmrg    esac
14498bd17e5fSmrg  fi
14508bd17e5fSmrg  rm -rf conftest*
14510597fb56Smrg  ;;
1452b042e37fSmrg
14538bd17e5fSmrg*-*-sco3.2v5*)
14548bd17e5fSmrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
14553169be4bSmrg  SAVE_CFLAGS=$CFLAGS
14568bd17e5fSmrg  CFLAGS="$CFLAGS -belf"
14578bd17e5fSmrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
14588bd17e5fSmrg    [AC_LANG_PUSH(C)
14598bd17e5fSmrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
14608bd17e5fSmrg     AC_LANG_POP])
14613169be4bSmrg  if test yes != "$lt_cv_cc_needs_belf"; then
14628bd17e5fSmrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
14633169be4bSmrg    CFLAGS=$SAVE_CFLAGS
14648bd17e5fSmrg  fi
14650597fb56Smrg  ;;
14668bd17e5fSmrg*-*solaris*)
14673169be4bSmrg  # Find out what ABI is being produced by ac_compile, and set linker
14683169be4bSmrg  # options accordingly.
14698bd17e5fSmrg  echo 'int i;' > conftest.$ac_ext
14708bd17e5fSmrg  if AC_TRY_EVAL(ac_compile); then
14718bd17e5fSmrg    case `/usr/bin/file conftest.o` in
14728bd17e5fSmrg    *64-bit*)
14738bd17e5fSmrg      case $lt_cv_prog_gnu_ld in
14748bd17e5fSmrg      yes*)
14758bd17e5fSmrg        case $host in
14763169be4bSmrg        i?86-*-solaris*|x86_64-*-solaris*)
14778bd17e5fSmrg          LD="${LD-ld} -m elf_x86_64"
14788bd17e5fSmrg          ;;
14798bd17e5fSmrg        sparc*-*-solaris*)
14808bd17e5fSmrg          LD="${LD-ld} -m elf64_sparc"
14818bd17e5fSmrg          ;;
14828bd17e5fSmrg        esac
14838bd17e5fSmrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
14848bd17e5fSmrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
14853169be4bSmrg          LD=${LD-ld}_sol2
14868bd17e5fSmrg        fi
14878bd17e5fSmrg        ;;
14888bd17e5fSmrg      *)
14898bd17e5fSmrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
14908bd17e5fSmrg	  LD="${LD-ld} -64"
14918bd17e5fSmrg	fi
14928bd17e5fSmrg	;;
14938bd17e5fSmrg      esac
14948bd17e5fSmrg      ;;
14958bd17e5fSmrg    esac
14968bd17e5fSmrg  fi
14978bd17e5fSmrg  rm -rf conftest*
14980597fb56Smrg  ;;
14998bd17e5fSmrgesac
15008c4a8e55Smrg
15013169be4bSmrgneed_locks=$enable_libtool_lock
15028bd17e5fSmrg])# _LT_ENABLE_LOCK
1503b042e37fSmrg
15048c4a8e55Smrg
15058bd17e5fSmrg# _LT_PROG_AR
15068bd17e5fSmrg# -----------
15078bd17e5fSmrgm4_defun([_LT_PROG_AR],
15088bd17e5fSmrg[AC_CHECK_TOOLS(AR, [ar], false)
15098bd17e5fSmrg: ${AR=ar}
15108bd17e5fSmrg: ${AR_FLAGS=cru}
15118bd17e5fSmrg_LT_DECL([], [AR], [1], [The archiver])
15128bd17e5fSmrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
15138c4a8e55Smrg
15148bd17e5fSmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
15158bd17e5fSmrg  [lt_cv_ar_at_file=no
15168bd17e5fSmrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
15178bd17e5fSmrg     [echo conftest.$ac_objext > conftest.lst
15188bd17e5fSmrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
15198bd17e5fSmrg      AC_TRY_EVAL([lt_ar_try])
15203169be4bSmrg      if test 0 -eq "$ac_status"; then
15218bd17e5fSmrg	# Ensure the archiver fails upon bogus file names.
15228bd17e5fSmrg	rm -f conftest.$ac_objext libconftest.a
15238bd17e5fSmrg	AC_TRY_EVAL([lt_ar_try])
15243169be4bSmrg	if test 0 -ne "$ac_status"; then
15258bd17e5fSmrg          lt_cv_ar_at_file=@
15268bd17e5fSmrg        fi
15278bd17e5fSmrg      fi
15288bd17e5fSmrg      rm -f conftest.* libconftest.a
15298bd17e5fSmrg     ])
15308bd17e5fSmrg  ])
1531b042e37fSmrg
15323169be4bSmrgif test no = "$lt_cv_ar_at_file"; then
15338bd17e5fSmrg  archiver_list_spec=
15348bd17e5fSmrgelse
15358bd17e5fSmrg  archiver_list_spec=$lt_cv_ar_at_file
15368bd17e5fSmrgfi
15378bd17e5fSmrg_LT_DECL([], [archiver_list_spec], [1],
15388bd17e5fSmrg  [How to feed a file listing to the archiver])
15398bd17e5fSmrg])# _LT_PROG_AR
1540b042e37fSmrg
1541b042e37fSmrg
15428bd17e5fSmrg# _LT_CMD_OLD_ARCHIVE
15438bd17e5fSmrg# -------------------
15448bd17e5fSmrgm4_defun([_LT_CMD_OLD_ARCHIVE],
15458bd17e5fSmrg[_LT_PROG_AR
1546b042e37fSmrg
15478bd17e5fSmrgAC_CHECK_TOOL(STRIP, strip, :)
15488bd17e5fSmrgtest -z "$STRIP" && STRIP=:
15498bd17e5fSmrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1550b042e37fSmrg
15518bd17e5fSmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
15528bd17e5fSmrgtest -z "$RANLIB" && RANLIB=:
15538bd17e5fSmrg_LT_DECL([], [RANLIB], [1],
15548bd17e5fSmrg    [Commands used to install an old-style archive])
1555b042e37fSmrg
15568bd17e5fSmrg# Determine commands to create old-style static archives.
15578bd17e5fSmrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
15588bd17e5fSmrgold_postinstall_cmds='chmod 644 $oldlib'
15598bd17e5fSmrgold_postuninstall_cmds=
15608c4a8e55Smrg
15618bd17e5fSmrgif test -n "$RANLIB"; then
15628bd17e5fSmrg  case $host_os in
15633169be4bSmrg  bitrig* | openbsd*)
15648bd17e5fSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
15658bd17e5fSmrg    ;;
15668bd17e5fSmrg  *)
15678bd17e5fSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
15688bd17e5fSmrg    ;;
15698bd17e5fSmrg  esac
15708bd17e5fSmrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
15718bd17e5fSmrgfi
1572b042e37fSmrg
15738bd17e5fSmrgcase $host_os in
15748bd17e5fSmrg  darwin*)
15758bd17e5fSmrg    lock_old_archive_extraction=yes ;;
15768bd17e5fSmrg  *)
15778bd17e5fSmrg    lock_old_archive_extraction=no ;;
15788bd17e5fSmrgesac
15798bd17e5fSmrg_LT_DECL([], [old_postinstall_cmds], [2])
15808bd17e5fSmrg_LT_DECL([], [old_postuninstall_cmds], [2])
15818bd17e5fSmrg_LT_TAGDECL([], [old_archive_cmds], [2],
15828bd17e5fSmrg    [Commands used to build an old-style archive])
15838bd17e5fSmrg_LT_DECL([], [lock_old_archive_extraction], [0],
15848bd17e5fSmrg    [Whether to use a lock for old archive extraction])
15858bd17e5fSmrg])# _LT_CMD_OLD_ARCHIVE
1586b042e37fSmrg
1587b042e37fSmrg
15888bd17e5fSmrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
15898bd17e5fSmrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
15908bd17e5fSmrg# ----------------------------------------------------------------
15918bd17e5fSmrg# Check whether the given compiler option works
15928bd17e5fSmrgAC_DEFUN([_LT_COMPILER_OPTION],
15938bd17e5fSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
15948bd17e5fSmrgm4_require([_LT_DECL_SED])dnl
15958bd17e5fSmrgAC_CACHE_CHECK([$1], [$2],
15968bd17e5fSmrg  [$2=no
15978bd17e5fSmrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
15988bd17e5fSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
15993169be4bSmrg   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
16008bd17e5fSmrg   # Insert the option either (1) after the last *FLAGS variable, or
16018bd17e5fSmrg   # (2) before a word containing "conftest.", or (3) at the end.
16028bd17e5fSmrg   # Note that $ac_compile itself does not contain backslashes and begins
16038bd17e5fSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
16048bd17e5fSmrg   # The option is referenced via a variable to avoid confusing sed.
16058bd17e5fSmrg   lt_compile=`echo "$ac_compile" | $SED \
16068bd17e5fSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
16078bd17e5fSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
16088bd17e5fSmrg   -e 's:$: $lt_compiler_flag:'`
16098bd17e5fSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
16108bd17e5fSmrg   (eval "$lt_compile" 2>conftest.err)
16118bd17e5fSmrg   ac_status=$?
16128bd17e5fSmrg   cat conftest.err >&AS_MESSAGE_LOG_FD
16138bd17e5fSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
16148bd17e5fSmrg   if (exit $ac_status) && test -s "$ac_outfile"; then
16158bd17e5fSmrg     # The compiler can only warn and ignore the option if not recognized
16168bd17e5fSmrg     # So say no if there are warnings other than the usual output.
16178bd17e5fSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
16188bd17e5fSmrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
16198bd17e5fSmrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
16208bd17e5fSmrg       $2=yes
16218bd17e5fSmrg     fi
16228bd17e5fSmrg   fi
16238bd17e5fSmrg   $RM conftest*
16248bd17e5fSmrg])
16258bd17e5fSmrg
16263169be4bSmrgif test yes = "[$]$2"; then
16278bd17e5fSmrg    m4_if([$5], , :, [$5])
16280597fb56Smrgelse
16298bd17e5fSmrg    m4_if([$6], , :, [$6])
16300597fb56Smrgfi
16318bd17e5fSmrg])# _LT_COMPILER_OPTION
1632b042e37fSmrg
16330597fb56Smrg# Old name:
16348bd17e5fSmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
16350597fb56Smrgdnl aclocal-1.4 backwards compatibility:
16368bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1637706b6b52Smrg
1638706b6b52Smrg
16398bd17e5fSmrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
16408bd17e5fSmrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
16418bd17e5fSmrg# ----------------------------------------------------
16428bd17e5fSmrg# Check whether the given linker option works
16438bd17e5fSmrgAC_DEFUN([_LT_LINKER_OPTION],
16448bd17e5fSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
16458bd17e5fSmrgm4_require([_LT_DECL_SED])dnl
16468bd17e5fSmrgAC_CACHE_CHECK([$1], [$2],
16478bd17e5fSmrg  [$2=no
16483169be4bSmrg   save_LDFLAGS=$LDFLAGS
16498bd17e5fSmrg   LDFLAGS="$LDFLAGS $3"
16508bd17e5fSmrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
16518bd17e5fSmrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
16528bd17e5fSmrg     # The linker can only warn and ignore the option if not recognized
16538bd17e5fSmrg     # So say no if there are warnings
16548bd17e5fSmrg     if test -s conftest.err; then
16558bd17e5fSmrg       # Append any errors to the config.log.
16568bd17e5fSmrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
16578bd17e5fSmrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
16588bd17e5fSmrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
16598bd17e5fSmrg       if diff conftest.exp conftest.er2 >/dev/null; then
16608bd17e5fSmrg         $2=yes
16618bd17e5fSmrg       fi
16628bd17e5fSmrg     else
16638bd17e5fSmrg       $2=yes
16648bd17e5fSmrg     fi
16658bd17e5fSmrg   fi
16668bd17e5fSmrg   $RM -r conftest*
16673169be4bSmrg   LDFLAGS=$save_LDFLAGS
16688bd17e5fSmrg])
16698bd17e5fSmrg
16703169be4bSmrgif test yes = "[$]$2"; then
16718bd17e5fSmrg    m4_if([$4], , :, [$4])
16728bd17e5fSmrgelse
16738bd17e5fSmrg    m4_if([$5], , :, [$5])
16740597fb56Smrgfi
16758bd17e5fSmrg])# _LT_LINKER_OPTION
1676706b6b52Smrg
16778bd17e5fSmrg# Old name:
16788bd17e5fSmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
16798bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
16808bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1681706b6b52Smrg
1682706b6b52Smrg
16838bd17e5fSmrg# LT_CMD_MAX_LEN
16848bd17e5fSmrg#---------------
16858bd17e5fSmrgAC_DEFUN([LT_CMD_MAX_LEN],
16868bd17e5fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
16878bd17e5fSmrg# find the maximum length of command line arguments
16888bd17e5fSmrgAC_MSG_CHECKING([the maximum length of command line arguments])
16898bd17e5fSmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
16908bd17e5fSmrg  i=0
16913169be4bSmrg  teststring=ABCD
1692b042e37fSmrg
16938bd17e5fSmrg  case $build_os in
16948bd17e5fSmrg  msdosdjgpp*)
16958bd17e5fSmrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
16968bd17e5fSmrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
16978bd17e5fSmrg    # during glob expansion).  Even if it were fixed, the result of this
16988bd17e5fSmrg    # check would be larger than it should be.
16998bd17e5fSmrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
17000597fb56Smrg    ;;
17018bd17e5fSmrg
17028bd17e5fSmrg  gnu*)
17038bd17e5fSmrg    # Under GNU Hurd, this test is not required because there is
17048bd17e5fSmrg    # no limit to the length of command line arguments.
17058bd17e5fSmrg    # Libtool will interpret -1 as no limit whatsoever
17068bd17e5fSmrg    lt_cv_sys_max_cmd_len=-1;
17070597fb56Smrg    ;;
1708b042e37fSmrg
17098bd17e5fSmrg  cygwin* | mingw* | cegcc*)
17108bd17e5fSmrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
17118bd17e5fSmrg    # about 5 minutes as the teststring grows exponentially.
17128bd17e5fSmrg    # Worse, since 9x/ME are not pre-emptively multitasking,
17138bd17e5fSmrg    # you end up with a "frozen" computer, even though with patience
17148bd17e5fSmrg    # the test eventually succeeds (with a max line length of 256k).
17158bd17e5fSmrg    # Instead, let's just punt: use the minimum linelength reported by
17168bd17e5fSmrg    # all of the supported platforms: 8192 (on NT/2K/XP).
17178bd17e5fSmrg    lt_cv_sys_max_cmd_len=8192;
17188bd17e5fSmrg    ;;
1719b042e37fSmrg
17208bd17e5fSmrg  mint*)
17218bd17e5fSmrg    # On MiNT this can take a long time and run out of memory.
17228bd17e5fSmrg    lt_cv_sys_max_cmd_len=8192;
17238bd17e5fSmrg    ;;
1724b042e37fSmrg
17258bd17e5fSmrg  amigaos*)
17268bd17e5fSmrg    # On AmigaOS with pdksh, this test takes hours, literally.
17278bd17e5fSmrg    # So we just punt and use a minimum line length of 8192.
17288bd17e5fSmrg    lt_cv_sys_max_cmd_len=8192;
17298bd17e5fSmrg    ;;
1730b042e37fSmrg
17313169be4bSmrg  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
17328bd17e5fSmrg    # This has been around since 386BSD, at least.  Likely further.
17338bd17e5fSmrg    if test -x /sbin/sysctl; then
17348bd17e5fSmrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
17358bd17e5fSmrg    elif test -x /usr/sbin/sysctl; then
17368bd17e5fSmrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
17378bd17e5fSmrg    else
17388bd17e5fSmrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
17398bd17e5fSmrg    fi
17408bd17e5fSmrg    # And add a safety zone
17418bd17e5fSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
17428bd17e5fSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
17438bd17e5fSmrg    ;;
1744b042e37fSmrg
17458bd17e5fSmrg  interix*)
17468bd17e5fSmrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
17478bd17e5fSmrg    lt_cv_sys_max_cmd_len=196608
17488bd17e5fSmrg    ;;
1749b042e37fSmrg
17508bd17e5fSmrg  os2*)
17518bd17e5fSmrg    # The test takes a long time on OS/2.
17528bd17e5fSmrg    lt_cv_sys_max_cmd_len=8192
17538bd17e5fSmrg    ;;
17548bd17e5fSmrg
17558bd17e5fSmrg  osf*)
17568bd17e5fSmrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
17578bd17e5fSmrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
17588bd17e5fSmrg    # nice to cause kernel panics so lets avoid the loop below.
17598bd17e5fSmrg    # First set a reasonable default.
17608bd17e5fSmrg    lt_cv_sys_max_cmd_len=16384
17618bd17e5fSmrg    #
17628bd17e5fSmrg    if test -x /sbin/sysconfig; then
17638bd17e5fSmrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
17648bd17e5fSmrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
17658bd17e5fSmrg      esac
17660597fb56Smrg    fi
17670597fb56Smrg    ;;
17688bd17e5fSmrg  sco3.2v5*)
17698bd17e5fSmrg    lt_cv_sys_max_cmd_len=102400
17708bd17e5fSmrg    ;;
17718bd17e5fSmrg  sysv5* | sco5v6* | sysv4.2uw2*)
17728bd17e5fSmrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
17738bd17e5fSmrg    if test -n "$kargmax"; then
17748bd17e5fSmrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
17750597fb56Smrg    else
17768bd17e5fSmrg      lt_cv_sys_max_cmd_len=32768
17770597fb56Smrg    fi
17780597fb56Smrg    ;;
17798bd17e5fSmrg  *)
17808bd17e5fSmrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1781b242714cSmrg    if test -n "$lt_cv_sys_max_cmd_len" && \
17823169be4bSmrg       test undefined != "$lt_cv_sys_max_cmd_len"; then
17838bd17e5fSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
17848bd17e5fSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
17858bd17e5fSmrg    else
17868bd17e5fSmrg      # Make teststring a little bigger before we do anything with it.
17878bd17e5fSmrg      # a 1K string should be a reasonable start.
17883169be4bSmrg      for i in 1 2 3 4 5 6 7 8; do
17898bd17e5fSmrg        teststring=$teststring$teststring
17908bd17e5fSmrg      done
17918bd17e5fSmrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
17928bd17e5fSmrg      # If test is not a shell built-in, we'll probably end up computing a
17938bd17e5fSmrg      # maximum length that is only half of the actual maximum length, but
17948bd17e5fSmrg      # we can't tell.
17953169be4bSmrg      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
17968bd17e5fSmrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
17973169be4bSmrg	      test 17 != "$i" # 1/2 MB should be enough
17988bd17e5fSmrg      do
17998bd17e5fSmrg        i=`expr $i + 1`
18008bd17e5fSmrg        teststring=$teststring$teststring
18018bd17e5fSmrg      done
18028bd17e5fSmrg      # Only check the string length outside the loop.
18038bd17e5fSmrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
18048bd17e5fSmrg      teststring=
18058bd17e5fSmrg      # Add a significant safety factor because C++ compilers can tack on
18068bd17e5fSmrg      # massive amounts of additional arguments before passing them to the
18078bd17e5fSmrg      # linker.  It appears as though 1/2 is a usable value.
18088bd17e5fSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
18098bd17e5fSmrg    fi
18108bd17e5fSmrg    ;;
18118bd17e5fSmrg  esac
18128bd17e5fSmrg])
18133169be4bSmrgif test -n "$lt_cv_sys_max_cmd_len"; then
18148bd17e5fSmrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
18158bd17e5fSmrgelse
18168bd17e5fSmrg  AC_MSG_RESULT(none)
18178bd17e5fSmrgfi
18188bd17e5fSmrgmax_cmd_len=$lt_cv_sys_max_cmd_len
18198bd17e5fSmrg_LT_DECL([], [max_cmd_len], [0],
18208bd17e5fSmrg    [What is the maximum length of a command?])
18218bd17e5fSmrg])# LT_CMD_MAX_LEN
1822b042e37fSmrg
18238bd17e5fSmrg# Old name:
18248bd17e5fSmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
18258bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
18268bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
18278c4a8e55Smrg
1828b042e37fSmrg
18298bd17e5fSmrg# _LT_HEADER_DLFCN
18308bd17e5fSmrg# ----------------
18318bd17e5fSmrgm4_defun([_LT_HEADER_DLFCN],
18328bd17e5fSmrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
18338bd17e5fSmrg])# _LT_HEADER_DLFCN
1834b042e37fSmrg
1835b042e37fSmrg
18368bd17e5fSmrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
18378bd17e5fSmrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
18388bd17e5fSmrg# ----------------------------------------------------------------
18398bd17e5fSmrgm4_defun([_LT_TRY_DLOPEN_SELF],
18408bd17e5fSmrg[m4_require([_LT_HEADER_DLFCN])dnl
18413169be4bSmrgif test yes = "$cross_compiling"; then :
18428bd17e5fSmrg  [$4]
18438bd17e5fSmrgelse
18448bd17e5fSmrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
18458bd17e5fSmrg  lt_status=$lt_dlunknown
18468bd17e5fSmrg  cat > conftest.$ac_ext <<_LT_EOF
18478bd17e5fSmrg[#line $LINENO "configure"
18488bd17e5fSmrg#include "confdefs.h"
18498c4a8e55Smrg
18508bd17e5fSmrg#if HAVE_DLFCN_H
18518bd17e5fSmrg#include <dlfcn.h>
18528bd17e5fSmrg#endif
18538c4a8e55Smrg
18548bd17e5fSmrg#include <stdio.h>
1855b042e37fSmrg
18568bd17e5fSmrg#ifdef RTLD_GLOBAL
18578bd17e5fSmrg#  define LT_DLGLOBAL		RTLD_GLOBAL
18588bd17e5fSmrg#else
18598bd17e5fSmrg#  ifdef DL_GLOBAL
18608bd17e5fSmrg#    define LT_DLGLOBAL		DL_GLOBAL
18618bd17e5fSmrg#  else
18628bd17e5fSmrg#    define LT_DLGLOBAL		0
18638bd17e5fSmrg#  endif
18648bd17e5fSmrg#endif
1865b042e37fSmrg
18668bd17e5fSmrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
18678bd17e5fSmrg   find out it does not work in some platform. */
18688bd17e5fSmrg#ifndef LT_DLLAZY_OR_NOW
18698bd17e5fSmrg#  ifdef RTLD_LAZY
18708bd17e5fSmrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
18718bd17e5fSmrg#  else
18728bd17e5fSmrg#    ifdef DL_LAZY
18738bd17e5fSmrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
18748bd17e5fSmrg#    else
18758bd17e5fSmrg#      ifdef RTLD_NOW
18768bd17e5fSmrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
18778bd17e5fSmrg#      else
18788bd17e5fSmrg#        ifdef DL_NOW
18798bd17e5fSmrg#          define LT_DLLAZY_OR_NOW	DL_NOW
18808bd17e5fSmrg#        else
18818bd17e5fSmrg#          define LT_DLLAZY_OR_NOW	0
18828bd17e5fSmrg#        endif
18838bd17e5fSmrg#      endif
18848bd17e5fSmrg#    endif
18858bd17e5fSmrg#  endif
18868bd17e5fSmrg#endif
18878c4a8e55Smrg
18883169be4bSmrg/* When -fvisibility=hidden is used, assume the code has been annotated
18898bd17e5fSmrg   correspondingly for the symbols needed.  */
18903169be4bSmrg#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
18918bd17e5fSmrgint fnord () __attribute__((visibility("default")));
18928bd17e5fSmrg#endif
1893b042e37fSmrg
18948bd17e5fSmrgint fnord () { return 42; }
18958bd17e5fSmrgint main ()
18968bd17e5fSmrg{
18978bd17e5fSmrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
18988bd17e5fSmrg  int status = $lt_dlunknown;
1899b042e37fSmrg
19008bd17e5fSmrg  if (self)
19018bd17e5fSmrg    {
19028bd17e5fSmrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
19038bd17e5fSmrg      else
19048bd17e5fSmrg        {
19058bd17e5fSmrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
19068bd17e5fSmrg          else puts (dlerror ());
19078bd17e5fSmrg	}
19088bd17e5fSmrg      /* dlclose (self); */
19098bd17e5fSmrg    }
19108bd17e5fSmrg  else
19118bd17e5fSmrg    puts (dlerror ());
19128bd17e5fSmrg
19138bd17e5fSmrg  return status;
19148bd17e5fSmrg}]
19158bd17e5fSmrg_LT_EOF
19163169be4bSmrg  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
19178bd17e5fSmrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
19188bd17e5fSmrg    lt_status=$?
19198bd17e5fSmrg    case x$lt_status in
19208bd17e5fSmrg      x$lt_dlno_uscore) $1 ;;
19218bd17e5fSmrg      x$lt_dlneed_uscore) $2 ;;
19228bd17e5fSmrg      x$lt_dlunknown|x*) $3 ;;
19238bd17e5fSmrg    esac
19248bd17e5fSmrg  else :
19258bd17e5fSmrg    # compilation failed
19268bd17e5fSmrg    $3
19278bd17e5fSmrg  fi
19288bd17e5fSmrgfi
19298bd17e5fSmrgrm -fr conftest*
19308bd17e5fSmrg])# _LT_TRY_DLOPEN_SELF
19318bd17e5fSmrg
19328bd17e5fSmrg
19338bd17e5fSmrg# LT_SYS_DLOPEN_SELF
19348bd17e5fSmrg# ------------------
19358bd17e5fSmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
19368bd17e5fSmrg[m4_require([_LT_HEADER_DLFCN])dnl
19373169be4bSmrgif test yes != "$enable_dlopen"; then
19388bd17e5fSmrg  enable_dlopen=unknown
19398bd17e5fSmrg  enable_dlopen_self=unknown
19408bd17e5fSmrg  enable_dlopen_self_static=unknown
19418bd17e5fSmrgelse
19428bd17e5fSmrg  lt_cv_dlopen=no
19438bd17e5fSmrg  lt_cv_dlopen_libs=
19448bd17e5fSmrg
19458bd17e5fSmrg  case $host_os in
19468bd17e5fSmrg  beos*)
19473169be4bSmrg    lt_cv_dlopen=load_add_on
19488bd17e5fSmrg    lt_cv_dlopen_libs=
19498bd17e5fSmrg    lt_cv_dlopen_self=yes
19500597fb56Smrg    ;;
19518bd17e5fSmrg
19528bd17e5fSmrg  mingw* | pw32* | cegcc*)
19533169be4bSmrg    lt_cv_dlopen=LoadLibrary
19548bd17e5fSmrg    lt_cv_dlopen_libs=
19550597fb56Smrg    ;;
19568bd17e5fSmrg
19578bd17e5fSmrg  cygwin*)
19583169be4bSmrg    lt_cv_dlopen=dlopen
19598bd17e5fSmrg    lt_cv_dlopen_libs=
19600597fb56Smrg    ;;
1961b042e37fSmrg
19628bd17e5fSmrg  darwin*)
19633169be4bSmrg    # if libdl is installed we need to link against it
19648bd17e5fSmrg    AC_CHECK_LIB([dl], [dlopen],
19653169be4bSmrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
19663169be4bSmrg    lt_cv_dlopen=dyld
19678bd17e5fSmrg    lt_cv_dlopen_libs=
19688bd17e5fSmrg    lt_cv_dlopen_self=yes
19698bd17e5fSmrg    ])
19708bd17e5fSmrg    ;;
1971b042e37fSmrg
19723169be4bSmrg  tpf*)
19733169be4bSmrg    # Don't try to run any link tests for TPF.  We know it's impossible
19743169be4bSmrg    # because TPF is a cross-compiler, and we know how we open DSOs.
19753169be4bSmrg    lt_cv_dlopen=dlopen
19763169be4bSmrg    lt_cv_dlopen_libs=
19773169be4bSmrg    lt_cv_dlopen_self=no
19783169be4bSmrg    ;;
19793169be4bSmrg
19808bd17e5fSmrg  *)
19818bd17e5fSmrg    AC_CHECK_FUNC([shl_load],
19823169be4bSmrg	  [lt_cv_dlopen=shl_load],
19838bd17e5fSmrg      [AC_CHECK_LIB([dld], [shl_load],
19843169be4bSmrg	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
19858bd17e5fSmrg	[AC_CHECK_FUNC([dlopen],
19863169be4bSmrg	      [lt_cv_dlopen=dlopen],
19878bd17e5fSmrg	  [AC_CHECK_LIB([dl], [dlopen],
19883169be4bSmrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
19898bd17e5fSmrg	    [AC_CHECK_LIB([svld], [dlopen],
19903169be4bSmrg		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
19918bd17e5fSmrg	      [AC_CHECK_LIB([dld], [dld_link],
19923169be4bSmrg		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
19938bd17e5fSmrg	      ])
19948bd17e5fSmrg	    ])
19958bd17e5fSmrg	  ])
19968bd17e5fSmrg	])
19978bd17e5fSmrg      ])
19988bd17e5fSmrg    ;;
19990597fb56Smrg  esac
2000b042e37fSmrg
20013169be4bSmrg  if test no = "$lt_cv_dlopen"; then
20028bd17e5fSmrg    enable_dlopen=no
20033169be4bSmrg  else
20043169be4bSmrg    enable_dlopen=yes
20050597fb56Smrg  fi
2006b042e37fSmrg
20078bd17e5fSmrg  case $lt_cv_dlopen in
20088bd17e5fSmrg  dlopen)
20093169be4bSmrg    save_CPPFLAGS=$CPPFLAGS
20103169be4bSmrg    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2011b042e37fSmrg
20123169be4bSmrg    save_LDFLAGS=$LDFLAGS
20138bd17e5fSmrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2014b042e37fSmrg
20153169be4bSmrg    save_LIBS=$LIBS
20168bd17e5fSmrg    LIBS="$lt_cv_dlopen_libs $LIBS"
2017b042e37fSmrg
20188bd17e5fSmrg    AC_CACHE_CHECK([whether a program can dlopen itself],
20198bd17e5fSmrg	  lt_cv_dlopen_self, [dnl
20208bd17e5fSmrg	  _LT_TRY_DLOPEN_SELF(
20218bd17e5fSmrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
20228bd17e5fSmrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
20238bd17e5fSmrg    ])
20240597fb56Smrg
20253169be4bSmrg    if test yes = "$lt_cv_dlopen_self"; then
20268bd17e5fSmrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
20278bd17e5fSmrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
20288bd17e5fSmrg	  lt_cv_dlopen_self_static, [dnl
20298bd17e5fSmrg	  _LT_TRY_DLOPEN_SELF(
20308bd17e5fSmrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
20318bd17e5fSmrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
20328bd17e5fSmrg      ])
20338bd17e5fSmrg    fi
20340597fb56Smrg
20353169be4bSmrg    CPPFLAGS=$save_CPPFLAGS
20363169be4bSmrg    LDFLAGS=$save_LDFLAGS
20373169be4bSmrg    LIBS=$save_LIBS
20380597fb56Smrg    ;;
20390597fb56Smrg  esac
20400597fb56Smrg
20418bd17e5fSmrg  case $lt_cv_dlopen_self in
20428bd17e5fSmrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
20438bd17e5fSmrg  *) enable_dlopen_self=unknown ;;
20448bd17e5fSmrg  esac
20450597fb56Smrg
20468bd17e5fSmrg  case $lt_cv_dlopen_self_static in
20478bd17e5fSmrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
20488bd17e5fSmrg  *) enable_dlopen_self_static=unknown ;;
20490597fb56Smrg  esac
20500597fb56Smrgfi
20518bd17e5fSmrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
20528bd17e5fSmrg	 [Whether dlopen is supported])
20538bd17e5fSmrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
20548bd17e5fSmrg	 [Whether dlopen of programs is supported])
20558bd17e5fSmrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
20568bd17e5fSmrg	 [Whether dlopen of statically linked programs is supported])
20578bd17e5fSmrg])# LT_SYS_DLOPEN_SELF
2058b042e37fSmrg
20598bd17e5fSmrg# Old name:
20608bd17e5fSmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
20618bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
20628bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
2063b042e37fSmrg
2064b042e37fSmrg
20658bd17e5fSmrg# _LT_COMPILER_C_O([TAGNAME])
20668bd17e5fSmrg# ---------------------------
20678bd17e5fSmrg# Check to see if options -c and -o are simultaneously supported by compiler.
20688bd17e5fSmrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
20698bd17e5fSmrgm4_defun([_LT_COMPILER_C_O],
20708bd17e5fSmrg[m4_require([_LT_DECL_SED])dnl
20718bd17e5fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
20728bd17e5fSmrgm4_require([_LT_TAG_COMPILER])dnl
20738bd17e5fSmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
20748bd17e5fSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
20758bd17e5fSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
20768bd17e5fSmrg   $RM -r conftest 2>/dev/null
20778bd17e5fSmrg   mkdir conftest
20788bd17e5fSmrg   cd conftest
20798bd17e5fSmrg   mkdir out
20808bd17e5fSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
20810597fb56Smrg
20828bd17e5fSmrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
20838bd17e5fSmrg   # Insert the option either (1) after the last *FLAGS variable, or
20848bd17e5fSmrg   # (2) before a word containing "conftest.", or (3) at the end.
20858bd17e5fSmrg   # Note that $ac_compile itself does not contain backslashes and begins
20868bd17e5fSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
20878bd17e5fSmrg   lt_compile=`echo "$ac_compile" | $SED \
20888bd17e5fSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
20898bd17e5fSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
20908bd17e5fSmrg   -e 's:$: $lt_compiler_flag:'`
20918bd17e5fSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
20928bd17e5fSmrg   (eval "$lt_compile" 2>out/conftest.err)
20938bd17e5fSmrg   ac_status=$?
20948bd17e5fSmrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
20958bd17e5fSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
20968bd17e5fSmrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
20978bd17e5fSmrg   then
20988bd17e5fSmrg     # The compiler can only warn and ignore the option if not recognized
20998bd17e5fSmrg     # So say no if there are warnings
21008bd17e5fSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
21018bd17e5fSmrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
21028bd17e5fSmrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
21038bd17e5fSmrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
21048bd17e5fSmrg     fi
21058bd17e5fSmrg   fi
21068bd17e5fSmrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
21078bd17e5fSmrg   $RM conftest*
21088bd17e5fSmrg   # SGI C++ compiler will create directory out/ii_files/ for
21098bd17e5fSmrg   # template instantiation
21108bd17e5fSmrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
21118bd17e5fSmrg   $RM out/* && rmdir out
21128bd17e5fSmrg   cd ..
21138bd17e5fSmrg   $RM -r conftest
21148bd17e5fSmrg   $RM conftest*
21158bd17e5fSmrg])
21168bd17e5fSmrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
21178bd17e5fSmrg	[Does compiler simultaneously support -c and -o options?])
21188bd17e5fSmrg])# _LT_COMPILER_C_O
21198bd17e5fSmrg
21208bd17e5fSmrg
21218bd17e5fSmrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
21228bd17e5fSmrg# ----------------------------------
21238bd17e5fSmrg# Check to see if we can do hard links to lock some files if needed
21248bd17e5fSmrgm4_defun([_LT_COMPILER_FILE_LOCKS],
21258bd17e5fSmrg[m4_require([_LT_ENABLE_LOCK])dnl
21268bd17e5fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
21278bd17e5fSmrg_LT_COMPILER_C_O([$1])
21288bd17e5fSmrg
21293169be4bSmrghard_links=nottested
21303169be4bSmrgif test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
21318bd17e5fSmrg  # do not overwrite the value of need_locks provided by the user
21328bd17e5fSmrg  AC_MSG_CHECKING([if we can lock with hard links])
21338bd17e5fSmrg  hard_links=yes
21348bd17e5fSmrg  $RM conftest*
21358bd17e5fSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
21368bd17e5fSmrg  touch conftest.a
21378bd17e5fSmrg  ln conftest.a conftest.b 2>&5 || hard_links=no
21388bd17e5fSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
21398bd17e5fSmrg  AC_MSG_RESULT([$hard_links])
21403169be4bSmrg  if test no = "$hard_links"; then
21413169be4bSmrg    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
21428bd17e5fSmrg    need_locks=warn
2143706b6b52Smrg  fi
21440597fb56Smrgelse
21458bd17e5fSmrg  need_locks=no
21468bd17e5fSmrgfi
21478bd17e5fSmrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
21488bd17e5fSmrg])# _LT_COMPILER_FILE_LOCKS
21498bd17e5fSmrg
21508bd17e5fSmrg
21518bd17e5fSmrg# _LT_CHECK_OBJDIR
21528bd17e5fSmrg# ----------------
21538bd17e5fSmrgm4_defun([_LT_CHECK_OBJDIR],
21548bd17e5fSmrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
21558bd17e5fSmrg[rm -f .libs 2>/dev/null
21568bd17e5fSmrgmkdir .libs 2>/dev/null
21578bd17e5fSmrgif test -d .libs; then
21588bd17e5fSmrg  lt_cv_objdir=.libs
21598bd17e5fSmrgelse
21608bd17e5fSmrg  # MS-DOS does not allow filenames that begin with a dot.
21618bd17e5fSmrg  lt_cv_objdir=_libs
21628bd17e5fSmrgfi
21638bd17e5fSmrgrmdir .libs 2>/dev/null])
21648bd17e5fSmrgobjdir=$lt_cv_objdir
21658bd17e5fSmrg_LT_DECL([], [objdir], [0],
21668bd17e5fSmrg         [The name of the directory that contains temporary libtool files])dnl
21678bd17e5fSmrgm4_pattern_allow([LT_OBJDIR])dnl
21683169be4bSmrgAC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
21693169be4bSmrg  [Define to the sub-directory where libtool stores uninstalled libraries.])
21708bd17e5fSmrg])# _LT_CHECK_OBJDIR
21718bd17e5fSmrg
21728bd17e5fSmrg
21738bd17e5fSmrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
21748bd17e5fSmrg# --------------------------------------
21758bd17e5fSmrg# Check hardcoding attributes.
21768bd17e5fSmrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
21778bd17e5fSmrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
21788bd17e5fSmrg_LT_TAGVAR(hardcode_action, $1)=
21798bd17e5fSmrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
21808bd17e5fSmrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
21813169be4bSmrg   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
21828bd17e5fSmrg
21838bd17e5fSmrg  # We can hardcode non-existent directories.
21843169be4bSmrg  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
21858bd17e5fSmrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
21868bd17e5fSmrg     # have to relink, otherwise we might link with an installed library
21878bd17e5fSmrg     # when we should be linking with a yet-to-be-installed one
21883169be4bSmrg     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
21893169be4bSmrg     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
21908bd17e5fSmrg    # Linking always hardcodes the temporary library directory.
21918bd17e5fSmrg    _LT_TAGVAR(hardcode_action, $1)=relink
2192706b6b52Smrg  else
21938bd17e5fSmrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
21948bd17e5fSmrg    _LT_TAGVAR(hardcode_action, $1)=immediate
2195bd23fbfaSmrg  fi
21968bd17e5fSmrgelse
21978bd17e5fSmrg  # We cannot hardcode anything, or else we can only hardcode existing
21988bd17e5fSmrg  # directories.
21998bd17e5fSmrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
2200bd23fbfaSmrgfi
22018bd17e5fSmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2202b042e37fSmrg
22033169be4bSmrgif test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
22043169be4bSmrg   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
22058bd17e5fSmrg  # Fast installation is not supported
22068bd17e5fSmrg  enable_fast_install=no
22073169be4bSmrgelif test yes = "$shlibpath_overrides_runpath" ||
22083169be4bSmrg     test no = "$enable_shared"; then
22098bd17e5fSmrg  # Fast installation is not necessary
22108bd17e5fSmrg  enable_fast_install=needless
22118bd17e5fSmrgfi
22128bd17e5fSmrg_LT_TAGDECL([], [hardcode_action], [0],
22138bd17e5fSmrg    [How to hardcode a shared library path into an executable])
22148bd17e5fSmrg])# _LT_LINKER_HARDCODE_LIBPATH
2215b042e37fSmrg
2216b042e37fSmrg
22178bd17e5fSmrg# _LT_CMD_STRIPLIB
22188bd17e5fSmrg# ----------------
22198bd17e5fSmrgm4_defun([_LT_CMD_STRIPLIB],
22200597fb56Smrg[m4_require([_LT_DECL_EGREP])
22218bd17e5fSmrgstriplib=
22228bd17e5fSmrgold_striplib=
22238bd17e5fSmrgAC_MSG_CHECKING([whether stripping libraries is possible])
22248bd17e5fSmrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
22258bd17e5fSmrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
22268bd17e5fSmrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
22278bd17e5fSmrg  AC_MSG_RESULT([yes])
22288bd17e5fSmrgelse
22298bd17e5fSmrg# FIXME - insert some real tests, host_os isn't really good enough
22308bd17e5fSmrg  case $host_os in
22318bd17e5fSmrg  darwin*)
22323169be4bSmrg    if test -n "$STRIP"; then
22338bd17e5fSmrg      striplib="$STRIP -x"
22348bd17e5fSmrg      old_striplib="$STRIP -S"
22358bd17e5fSmrg      AC_MSG_RESULT([yes])
22368bd17e5fSmrg    else
22378bd17e5fSmrg      AC_MSG_RESULT([no])
22388bd17e5fSmrg    fi
22390597fb56Smrg    ;;
22400597fb56Smrg  *)
22418bd17e5fSmrg    AC_MSG_RESULT([no])
22420597fb56Smrg    ;;
22430597fb56Smrg  esac
2244706b6b52Smrgfi
22458bd17e5fSmrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
22468bd17e5fSmrg_LT_DECL([], [striplib], [1])
22478bd17e5fSmrg])# _LT_CMD_STRIPLIB
2248b042e37fSmrg
2249b042e37fSmrg
22503169be4bSmrg# _LT_PREPARE_MUNGE_PATH_LIST
22513169be4bSmrg# ---------------------------
22523169be4bSmrg# Make sure func_munge_path_list() is defined correctly.
22533169be4bSmrgm4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
22543169be4bSmrg[[# func_munge_path_list VARIABLE PATH
22553169be4bSmrg# -----------------------------------
22563169be4bSmrg# VARIABLE is name of variable containing _space_ separated list of
22573169be4bSmrg# directories to be munged by the contents of PATH, which is string
22583169be4bSmrg# having a format:
22593169be4bSmrg# "DIR[:DIR]:"
22603169be4bSmrg#       string "DIR[ DIR]" will be prepended to VARIABLE
22613169be4bSmrg# ":DIR[:DIR]"
22623169be4bSmrg#       string "DIR[ DIR]" will be appended to VARIABLE
22633169be4bSmrg# "DIRP[:DIRP]::[DIRA:]DIRA"
22643169be4bSmrg#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
22653169be4bSmrg#       "DIRA[ DIRA]" will be appended to VARIABLE
22663169be4bSmrg# "DIR[:DIR]"
22673169be4bSmrg#       VARIABLE will be replaced by "DIR[ DIR]"
22683169be4bSmrgfunc_munge_path_list ()
22693169be4bSmrg{
22703169be4bSmrg    case x@S|@2 in
22713169be4bSmrg    x)
22723169be4bSmrg        ;;
22733169be4bSmrg    *:)
22743169be4bSmrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
22753169be4bSmrg        ;;
22763169be4bSmrg    x:*)
22773169be4bSmrg        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
22783169be4bSmrg        ;;
22793169be4bSmrg    *::*)
22803169be4bSmrg        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
22813169be4bSmrg        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
22823169be4bSmrg        ;;
22833169be4bSmrg    *)
22843169be4bSmrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
22853169be4bSmrg        ;;
22863169be4bSmrg    esac
22873169be4bSmrg}
22883169be4bSmrg]])# _LT_PREPARE_PATH_LIST
22893169be4bSmrg
22903169be4bSmrg
22918bd17e5fSmrg# _LT_SYS_DYNAMIC_LINKER([TAG])
22928bd17e5fSmrg# -----------------------------
22938bd17e5fSmrg# PORTME Fill in your ld.so characteristics
22948bd17e5fSmrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
22950597fb56Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
22968bd17e5fSmrgm4_require([_LT_DECL_EGREP])dnl
22978bd17e5fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
22988bd17e5fSmrgm4_require([_LT_DECL_OBJDUMP])dnl
22998bd17e5fSmrgm4_require([_LT_DECL_SED])dnl
23008bd17e5fSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
23013169be4bSmrgm4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
23028bd17e5fSmrgAC_MSG_CHECKING([dynamic linker characteristics])
23038bd17e5fSmrgm4_if([$1],
23048bd17e5fSmrg	[], [
23053169be4bSmrgif test yes = "$GCC"; then
23068bd17e5fSmrg  case $host_os in
23073169be4bSmrg    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
23083169be4bSmrg    *) lt_awk_arg='/^libraries:/' ;;
23098bd17e5fSmrg  esac
23108bd17e5fSmrg  case $host_os in
23113169be4bSmrg    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
23123169be4bSmrg    *) lt_sed_strip_eq='s|=/|/|g' ;;
23138bd17e5fSmrg  esac
23148bd17e5fSmrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
23158bd17e5fSmrg  case $lt_search_path_spec in
23168bd17e5fSmrg  *\;*)
23178bd17e5fSmrg    # if the path contains ";" then we assume it to be the separator
23188bd17e5fSmrg    # otherwise default to the standard path separator (i.e. ":") - it is
23198bd17e5fSmrg    # assumed that no part of a normal pathname contains ";" but that should
23208bd17e5fSmrg    # okay in the real world where ";" in dirpaths is itself problematic.
23218bd17e5fSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
23228bd17e5fSmrg    ;;
23230597fb56Smrg  *)
23248bd17e5fSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
23258bd17e5fSmrg    ;;
23260597fb56Smrg  esac
23278bd17e5fSmrg  # Ok, now we have the path, separated by spaces, we can step through it
23283169be4bSmrg  # and add multilib dir if necessary...
23298bd17e5fSmrg  lt_tmp_lt_search_path_spec=
23303169be4bSmrg  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
23313169be4bSmrg  # ...but if some path component already ends with the multilib dir we assume
23323169be4bSmrg  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
23333169be4bSmrg  case "$lt_multi_os_dir; $lt_search_path_spec " in
23343169be4bSmrg  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
23353169be4bSmrg    lt_multi_os_dir=
23363169be4bSmrg    ;;
23373169be4bSmrg  esac
23388bd17e5fSmrg  for lt_sys_path in $lt_search_path_spec; do
23393169be4bSmrg    if test -d "$lt_sys_path$lt_multi_os_dir"; then
23403169be4bSmrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
23413169be4bSmrg    elif test -n "$lt_multi_os_dir"; then
23428bd17e5fSmrg      test -d "$lt_sys_path" && \
23438bd17e5fSmrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
23448bd17e5fSmrg    fi
23458bd17e5fSmrg  done
23468bd17e5fSmrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
23473169be4bSmrgBEGIN {RS = " "; FS = "/|\n";} {
23483169be4bSmrg  lt_foo = "";
23493169be4bSmrg  lt_count = 0;
23508bd17e5fSmrg  for (lt_i = NF; lt_i > 0; lt_i--) {
23518bd17e5fSmrg    if ($lt_i != "" && $lt_i != ".") {
23528bd17e5fSmrg      if ($lt_i == "..") {
23538bd17e5fSmrg        lt_count++;
23548bd17e5fSmrg      } else {
23558bd17e5fSmrg        if (lt_count == 0) {
23563169be4bSmrg          lt_foo = "/" $lt_i lt_foo;
23578bd17e5fSmrg        } else {
23588bd17e5fSmrg          lt_count--;
23598bd17e5fSmrg        }
23608bd17e5fSmrg      }
23618bd17e5fSmrg    }
23628bd17e5fSmrg  }
23638bd17e5fSmrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
23648bd17e5fSmrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
23658bd17e5fSmrg}'`
23668bd17e5fSmrg  # AWK program above erroneously prepends '/' to C:/dos/paths
23678bd17e5fSmrg  # for these hosts.
23688bd17e5fSmrg  case $host_os in
23698bd17e5fSmrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
23703169be4bSmrg      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
23718bd17e5fSmrg  esac
23728bd17e5fSmrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
23738bd17e5fSmrgelse
23748bd17e5fSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
23758bd17e5fSmrgfi])
23768bd17e5fSmrglibrary_names_spec=
23778bd17e5fSmrglibname_spec='lib$name'
23788bd17e5fSmrgsoname_spec=
23793169be4bSmrgshrext_cmds=.so
23808bd17e5fSmrgpostinstall_cmds=
23818bd17e5fSmrgpostuninstall_cmds=
23828bd17e5fSmrgfinish_cmds=
23838bd17e5fSmrgfinish_eval=
23848bd17e5fSmrgshlibpath_var=
23858bd17e5fSmrgshlibpath_overrides_runpath=unknown
23868bd17e5fSmrgversion_type=none
23878bd17e5fSmrgdynamic_linker="$host_os ld.so"
23888bd17e5fSmrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
23898bd17e5fSmrgneed_lib_prefix=unknown
23908bd17e5fSmrghardcode_into_libs=no
2391bd23fbfaSmrg
23928bd17e5fSmrg# when you set need_version to no, make sure it does not cause -set_version
23938bd17e5fSmrg# flags to be left without arguments
23948bd17e5fSmrgneed_version=unknown
23950597fb56Smrg
23963169be4bSmrgAC_ARG_VAR([LT_SYS_LIBRARY_PATH],
23973169be4bSmrg[User-defined run-time library search path.])
23983169be4bSmrg
23990597fb56Smrgcase $host_os in
24008bd17e5fSmrgaix3*)
24018bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
24023169be4bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
24038bd17e5fSmrg  shlibpath_var=LIBPATH
24048bd17e5fSmrg
24058bd17e5fSmrg  # AIX 3 has no versioning support, so we append a major version to the name.
24063169be4bSmrg  soname_spec='$libname$release$shared_ext$major'
24070597fb56Smrg  ;;
24088bd17e5fSmrg
24098bd17e5fSmrgaix[[4-9]]*)
24108bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
24118bd17e5fSmrg  need_lib_prefix=no
24128bd17e5fSmrg  need_version=no
24138bd17e5fSmrg  hardcode_into_libs=yes
24143169be4bSmrg  if test ia64 = "$host_cpu"; then
24158bd17e5fSmrg    # AIX 5 supports IA64
24163169be4bSmrg    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
24178bd17e5fSmrg    shlibpath_var=LD_LIBRARY_PATH
24188bd17e5fSmrg  else
24198bd17e5fSmrg    # With GCC up to 2.95.x, collect2 would create an import file
24208bd17e5fSmrg    # for dependence libraries.  The import file would start with
24213169be4bSmrg    # the line '#! .'.  This would cause the generated library to
24223169be4bSmrg    # depend on '.', always an invalid library.  This was fixed in
24238bd17e5fSmrg    # development snapshots of GCC prior to 3.0.
24248bd17e5fSmrg    case $host_os in
24258bd17e5fSmrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
24268bd17e5fSmrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
24278bd17e5fSmrg	   echo ' yes '
24283169be4bSmrg	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
24298bd17e5fSmrg	:
24308bd17e5fSmrg      else
24318bd17e5fSmrg	can_build_shared=no
24328bd17e5fSmrg      fi
24338bd17e5fSmrg      ;;
24348bd17e5fSmrg    esac
24353169be4bSmrg    # Using Import Files as archive members, it is possible to support
24363169be4bSmrg    # filename-based versioning of shared library archives on AIX. While
24373169be4bSmrg    # this would work for both with and without runtime linking, it will
24383169be4bSmrg    # prevent static linking of such archives. So we do filename-based
24393169be4bSmrg    # shared library versioning with .so extension only, which is used
24403169be4bSmrg    # when both runtime linking and shared linking is enabled.
24413169be4bSmrg    # Unfortunately, runtime linking may impact performance, so we do
24423169be4bSmrg    # not want this to be the default eventually. Also, we use the
24433169be4bSmrg    # versioned .so libs for executables only if there is the -brtl
24443169be4bSmrg    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
24453169be4bSmrg    # To allow for filename-based versioning support, we need to create
24463169be4bSmrg    # libNAME.so.V as an archive file, containing:
24473169be4bSmrg    # *) an Import File, referring to the versioned filename of the
24483169be4bSmrg    #    archive as well as the shared archive member, telling the
24493169be4bSmrg    #    bitwidth (32 or 64) of that shared object, and providing the
24503169be4bSmrg    #    list of exported symbols of that shared object, eventually
24513169be4bSmrg    #    decorated with the 'weak' keyword
24523169be4bSmrg    # *) the shared object with the F_LOADONLY flag set, to really avoid
24533169be4bSmrg    #    it being seen by the linker.
24543169be4bSmrg    # At run time we better use the real file rather than another symlink,
24553169be4bSmrg    # but for link time we create the symlink libNAME.so -> libNAME.so.V
24563169be4bSmrg
24573169be4bSmrg    case $with_aix_soname,$aix_use_runtimelinking in
24583169be4bSmrg    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
24598bd17e5fSmrg    # soname into executable. Probably we can add versioning support to
24608bd17e5fSmrg    # collect2, so additional links can be useful in future.
24613169be4bSmrg    aix,yes) # traditional libtool
24623169be4bSmrg      dynamic_linker='AIX unversionable lib.so'
24638bd17e5fSmrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
24648bd17e5fSmrg      # instead of lib<name>.a to let people know that these are not
24658bd17e5fSmrg      # typical AIX shared libraries.
24663169be4bSmrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
24673169be4bSmrg      ;;
24683169be4bSmrg    aix,no) # traditional AIX only
24693169be4bSmrg      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
24708bd17e5fSmrg      # We preserve .a as extension for shared libraries through AIX4.2
24718bd17e5fSmrg      # and later when we are not doing run time linking.
24723169be4bSmrg      library_names_spec='$libname$release.a $libname.a'
24733169be4bSmrg      soname_spec='$libname$release$shared_ext$major'
24743169be4bSmrg      ;;
24753169be4bSmrg    svr4,*) # full svr4 only
24763169be4bSmrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
24773169be4bSmrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
24783169be4bSmrg      # We do not specify a path in Import Files, so LIBPATH fires.
24793169be4bSmrg      shlibpath_overrides_runpath=yes
24803169be4bSmrg      ;;
24813169be4bSmrg    *,yes) # both, prefer svr4
24823169be4bSmrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
24833169be4bSmrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
24843169be4bSmrg      # unpreferred sharedlib libNAME.a needs extra handling
24853169be4bSmrg      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
24863169be4bSmrg      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
24873169be4bSmrg      # We do not specify a path in Import Files, so LIBPATH fires.
24883169be4bSmrg      shlibpath_overrides_runpath=yes
24893169be4bSmrg      ;;
24903169be4bSmrg    *,no) # both, prefer aix
24913169be4bSmrg      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
24923169be4bSmrg      library_names_spec='$libname$release.a $libname.a'
24933169be4bSmrg      soname_spec='$libname$release$shared_ext$major'
24943169be4bSmrg      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
24953169be4bSmrg      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
24963169be4bSmrg      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
24973169be4bSmrg      ;;
24983169be4bSmrg    esac
24998bd17e5fSmrg    shlibpath_var=LIBPATH
25008bd17e5fSmrg  fi
2501706b6b52Smrg  ;;
25028c4a8e55Smrg
25038bd17e5fSmrgamigaos*)
25048bd17e5fSmrg  case $host_cpu in
25058bd17e5fSmrg  powerpc)
25068bd17e5fSmrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
25078bd17e5fSmrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
25083169be4bSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
25098bd17e5fSmrg    ;;
25108bd17e5fSmrg  m68k)
25118bd17e5fSmrg    library_names_spec='$libname.ixlibrary $libname.a'
25128bd17e5fSmrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
25133169be4bSmrg    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $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'
25148bd17e5fSmrg    ;;
25158bd17e5fSmrg  esac
25168bd17e5fSmrg  ;;
2517bd23fbfaSmrg
25188bd17e5fSmrgbeos*)
25193169be4bSmrg  library_names_spec='$libname$shared_ext'
25208bd17e5fSmrg  dynamic_linker="$host_os ld.so"
25218bd17e5fSmrg  shlibpath_var=LIBRARY_PATH
25220597fb56Smrg  ;;
2523bd23fbfaSmrg
25248bd17e5fSmrgbsdi[[45]]*)
25258bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
25268bd17e5fSmrg  need_version=no
25273169be4bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
25283169be4bSmrg  soname_spec='$libname$release$shared_ext$major'
25298bd17e5fSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
25308bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
25318bd17e5fSmrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
25328bd17e5fSmrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
25338bd17e5fSmrg  # the default ld.so.conf also contains /usr/contrib/lib and
25348bd17e5fSmrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
25358bd17e5fSmrg  # libtool to hard-code these into programs
25368bd17e5fSmrg  ;;
2537bd23fbfaSmrg
25388bd17e5fSmrgcygwin* | mingw* | pw32* | cegcc*)
25398bd17e5fSmrg  version_type=windows
25403169be4bSmrg  shrext_cmds=.dll
25418bd17e5fSmrg  need_version=no
25428bd17e5fSmrg  need_lib_prefix=no
2543bd23fbfaSmrg
25448bd17e5fSmrg  case $GCC,$cc_basename in
25458bd17e5fSmrg  yes,*)
25468bd17e5fSmrg    # gcc
25478bd17e5fSmrg    library_names_spec='$libname.dll.a'
25488bd17e5fSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
25493169be4bSmrg    postinstall_cmds='base_file=`basename \$file`~
25503169be4bSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
25518bd17e5fSmrg      dldir=$destdir/`dirname \$dlpath`~
25528bd17e5fSmrg      test -d \$dldir || mkdir -p \$dldir~
25538bd17e5fSmrg      $install_prog $dir/$dlname \$dldir/$dlname~
25548bd17e5fSmrg      chmod a+x \$dldir/$dlname~
25558bd17e5fSmrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
25568bd17e5fSmrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
25578bd17e5fSmrg      fi'
25588bd17e5fSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
25598bd17e5fSmrg      dlpath=$dir/\$dldll~
25608bd17e5fSmrg       $RM \$dlpath'
25618bd17e5fSmrg    shlibpath_overrides_runpath=yes
25628c4a8e55Smrg
25638bd17e5fSmrg    case $host_os in
25648bd17e5fSmrg    cygwin*)
25658bd17e5fSmrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
25663169be4bSmrg      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
25678bd17e5fSmrgm4_if([$1], [],[
25688bd17e5fSmrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
25698bd17e5fSmrg      ;;
25708bd17e5fSmrg    mingw* | cegcc*)
25718bd17e5fSmrg      # MinGW DLLs use traditional 'lib' prefix
25723169be4bSmrg      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
25738bd17e5fSmrg      ;;
25748bd17e5fSmrg    pw32*)
25758bd17e5fSmrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
25763169be4bSmrg      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
25778bd17e5fSmrg      ;;
25788bd17e5fSmrg    esac
25798bd17e5fSmrg    dynamic_linker='Win32 ld.exe'
25808bd17e5fSmrg    ;;
2581706b6b52Smrg
25828bd17e5fSmrg  *,cl*)
25838bd17e5fSmrg    # Native MSVC
25848bd17e5fSmrg    libname_spec='$name'
25853169be4bSmrg    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
25863169be4bSmrg    library_names_spec='$libname.dll.lib'
2587706b6b52Smrg
25888bd17e5fSmrg    case $build_os in
25898bd17e5fSmrg    mingw*)
25908bd17e5fSmrg      sys_lib_search_path_spec=
25918bd17e5fSmrg      lt_save_ifs=$IFS
25928bd17e5fSmrg      IFS=';'
25938bd17e5fSmrg      for lt_path in $LIB
25948bd17e5fSmrg      do
25958bd17e5fSmrg        IFS=$lt_save_ifs
25968bd17e5fSmrg        # Let DOS variable expansion print the short 8.3 style file name.
25978bd17e5fSmrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
25988bd17e5fSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
25998bd17e5fSmrg      done
26008bd17e5fSmrg      IFS=$lt_save_ifs
26018bd17e5fSmrg      # Convert to MSYS style.
26028bd17e5fSmrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
26038bd17e5fSmrg      ;;
26048bd17e5fSmrg    cygwin*)
26058bd17e5fSmrg      # Convert to unix form, then to dos form, then back to unix form
26068bd17e5fSmrg      # but this time dos style (no spaces!) so that the unix form looks
26078bd17e5fSmrg      # like /cygdrive/c/PROGRA~1:/cygdr...
26088bd17e5fSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
26098bd17e5fSmrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
26108bd17e5fSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
26118bd17e5fSmrg      ;;
26128bd17e5fSmrg    *)
26133169be4bSmrg      sys_lib_search_path_spec=$LIB
26148bd17e5fSmrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
26158bd17e5fSmrg        # It is most probably a Windows format PATH.
26168bd17e5fSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
26170597fb56Smrg      else
26188bd17e5fSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
26190597fb56Smrg      fi
26208bd17e5fSmrg      # FIXME: find the short name or the path components, as spaces are
26218bd17e5fSmrg      # common. (e.g. "Program Files" -> "PROGRA~1")
26228bd17e5fSmrg      ;;
26238bd17e5fSmrg    esac
2624706b6b52Smrg
26258bd17e5fSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
26263169be4bSmrg    postinstall_cmds='base_file=`basename \$file`~
26273169be4bSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
26288bd17e5fSmrg      dldir=$destdir/`dirname \$dlpath`~
26298bd17e5fSmrg      test -d \$dldir || mkdir -p \$dldir~
26308bd17e5fSmrg      $install_prog $dir/$dlname \$dldir/$dlname'
26318bd17e5fSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
26328bd17e5fSmrg      dlpath=$dir/\$dldll~
26338bd17e5fSmrg       $RM \$dlpath'
26348bd17e5fSmrg    shlibpath_overrides_runpath=yes
26358bd17e5fSmrg    dynamic_linker='Win32 link.exe'
26368bd17e5fSmrg    ;;
2637706b6b52Smrg
26388bd17e5fSmrg  *)
26398bd17e5fSmrg    # Assume MSVC wrapper
26403169be4bSmrg    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
26418bd17e5fSmrg    dynamic_linker='Win32 ld.exe'
26428bd17e5fSmrg    ;;
26438bd17e5fSmrg  esac
26448bd17e5fSmrg  # FIXME: first we should search . and the directory the executable is in
26458bd17e5fSmrg  shlibpath_var=PATH
26468bd17e5fSmrg  ;;
2647706b6b52Smrg
26488bd17e5fSmrgdarwin* | rhapsody*)
26498bd17e5fSmrg  dynamic_linker="$host_os dyld"
26508bd17e5fSmrg  version_type=darwin
26518bd17e5fSmrg  need_lib_prefix=no
26528bd17e5fSmrg  need_version=no
26533169be4bSmrg  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
26543169be4bSmrg  soname_spec='$libname$release$major$shared_ext'
26558bd17e5fSmrg  shlibpath_overrides_runpath=yes
26568bd17e5fSmrg  shlibpath_var=DYLD_LIBRARY_PATH
26578bd17e5fSmrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
26588bd17e5fSmrgm4_if([$1], [],[
26598bd17e5fSmrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
26608bd17e5fSmrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
26618bd17e5fSmrg  ;;
2662706b6b52Smrg
26638bd17e5fSmrgdgux*)
26648bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
26658bd17e5fSmrg  need_lib_prefix=no
26668bd17e5fSmrg  need_version=no
26673169be4bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
26683169be4bSmrg  soname_spec='$libname$release$shared_ext$major'
26698bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
26708bd17e5fSmrg  ;;
2671706b6b52Smrg
26728bd17e5fSmrgfreebsd* | dragonfly*)
26738bd17e5fSmrg  # DragonFly does not have aout.  When/if they implement a new
26748bd17e5fSmrg  # versioning mechanism, adjust this.
26758bd17e5fSmrg  if test -x /usr/bin/objformat; then
26768bd17e5fSmrg    objformat=`/usr/bin/objformat`
26770597fb56Smrg  else
26788bd17e5fSmrg    case $host_os in
26798bd17e5fSmrg    freebsd[[23]].*) objformat=aout ;;
26808bd17e5fSmrg    *) objformat=elf ;;
26818bd17e5fSmrg    esac
26820597fb56Smrg  fi
26838bd17e5fSmrg  version_type=freebsd-$objformat
26848bd17e5fSmrg  case $version_type in
26858bd17e5fSmrg    freebsd-elf*)
26863169be4bSmrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
26873169be4bSmrg      soname_spec='$libname$release$shared_ext$major'
26888bd17e5fSmrg      need_version=no
26898bd17e5fSmrg      need_lib_prefix=no
26908bd17e5fSmrg      ;;
26918bd17e5fSmrg    freebsd-*)
26923169be4bSmrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
26938bd17e5fSmrg      need_version=yes
26948bd17e5fSmrg      ;;
26958bd17e5fSmrg  esac
26968bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
26978bd17e5fSmrg  case $host_os in
26988bd17e5fSmrg  freebsd2.*)
26998bd17e5fSmrg    shlibpath_overrides_runpath=yes
27008bd17e5fSmrg    ;;
27018bd17e5fSmrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
27028bd17e5fSmrg    shlibpath_overrides_runpath=yes
27038bd17e5fSmrg    hardcode_into_libs=yes
27048bd17e5fSmrg    ;;
27058bd17e5fSmrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
27068bd17e5fSmrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
27078bd17e5fSmrg    shlibpath_overrides_runpath=no
27088bd17e5fSmrg    hardcode_into_libs=yes
27098bd17e5fSmrg    ;;
27108bd17e5fSmrg  *) # from 4.6 on, and DragonFly
27118bd17e5fSmrg    shlibpath_overrides_runpath=yes
27128bd17e5fSmrg    hardcode_into_libs=yes
27138bd17e5fSmrg    ;;
27148bd17e5fSmrg  esac
27158bd17e5fSmrg  ;;
2716706b6b52Smrg
27178bd17e5fSmrghaiku*)
27188bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
27198bd17e5fSmrg  need_lib_prefix=no
27208bd17e5fSmrg  need_version=no
27218bd17e5fSmrg  dynamic_linker="$host_os runtime_loader"
27223169be4bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
27233169be4bSmrg  soname_spec='$libname$release$shared_ext$major'
27248bd17e5fSmrg  shlibpath_var=LIBRARY_PATH
27253169be4bSmrg  shlibpath_overrides_runpath=no
27268bd17e5fSmrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
27278bd17e5fSmrg  hardcode_into_libs=yes
27288bd17e5fSmrg  ;;
2729706b6b52Smrg
27308bd17e5fSmrghpux9* | hpux10* | hpux11*)
27318bd17e5fSmrg  # Give a soname corresponding to the major version so that dld.sl refuses to
27328bd17e5fSmrg  # link against other versions.
27338bd17e5fSmrg  version_type=sunos
27348bd17e5fSmrg  need_lib_prefix=no
27358bd17e5fSmrg  need_version=no
27368bd17e5fSmrg  case $host_cpu in
27378bd17e5fSmrg  ia64*)
27388bd17e5fSmrg    shrext_cmds='.so'
27398bd17e5fSmrg    hardcode_into_libs=yes
27408bd17e5fSmrg    dynamic_linker="$host_os dld.so"
27418bd17e5fSmrg    shlibpath_var=LD_LIBRARY_PATH
27428bd17e5fSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
27433169be4bSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
27443169be4bSmrg    soname_spec='$libname$release$shared_ext$major'
27453169be4bSmrg    if test 32 = "$HPUX_IA64_MODE"; then
27468bd17e5fSmrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
27473169be4bSmrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
27488bd17e5fSmrg    else
27498bd17e5fSmrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
27503169be4bSmrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
27518bd17e5fSmrg    fi
27528bd17e5fSmrg    ;;
27538bd17e5fSmrg  hppa*64*)
27548bd17e5fSmrg    shrext_cmds='.sl'
27558bd17e5fSmrg    hardcode_into_libs=yes
27568bd17e5fSmrg    dynamic_linker="$host_os dld.sl"
27578bd17e5fSmrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
27588bd17e5fSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
27593169be4bSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
27603169be4bSmrg    soname_spec='$libname$release$shared_ext$major'
27618bd17e5fSmrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
27628bd17e5fSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
27638bd17e5fSmrg    ;;
27648bd17e5fSmrg  *)
27658bd17e5fSmrg    shrext_cmds='.sl'
27668bd17e5fSmrg    dynamic_linker="$host_os dld.sl"
27678bd17e5fSmrg    shlibpath_var=SHLIB_PATH
27688bd17e5fSmrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
27693169be4bSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
27703169be4bSmrg    soname_spec='$libname$release$shared_ext$major'
27718bd17e5fSmrg    ;;
27728bd17e5fSmrg  esac
27738bd17e5fSmrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
27748bd17e5fSmrg  postinstall_cmds='chmod 555 $lib'
27758bd17e5fSmrg  # or fails outright, so override atomically:
27768bd17e5fSmrg  install_override_mode=555
27778bd17e5fSmrg  ;;
2778706b6b52Smrg
27798bd17e5fSmrginterix[[3-9]]*)
27808bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
27818bd17e5fSmrg  need_lib_prefix=no
27828bd17e5fSmrg  need_version=no
27833169be4bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
27843169be4bSmrg  soname_spec='$libname$release$shared_ext$major'
27858bd17e5fSmrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
27868bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
27878bd17e5fSmrg  shlibpath_overrides_runpath=no
27888bd17e5fSmrg  hardcode_into_libs=yes
27898bd17e5fSmrg  ;;
2790706b6b52Smrg
27918bd17e5fSmrgirix5* | irix6* | nonstopux*)
27928bd17e5fSmrg  case $host_os in
27938bd17e5fSmrg    nonstopux*) version_type=nonstopux ;;
27948bd17e5fSmrg    *)
27953169be4bSmrg	if test yes = "$lt_cv_prog_gnu_ld"; then
27968bd17e5fSmrg		version_type=linux # correct to gnu/linux during the next big refactor
27978bd17e5fSmrg	else
27988bd17e5fSmrg		version_type=irix
27998bd17e5fSmrg	fi ;;
28008bd17e5fSmrg  esac
28018bd17e5fSmrg  need_lib_prefix=no
28028bd17e5fSmrg  need_version=no
28033169be4bSmrg  soname_spec='$libname$release$shared_ext$major'
28043169be4bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
28058bd17e5fSmrg  case $host_os in
28068bd17e5fSmrg  irix5* | nonstopux*)
28078bd17e5fSmrg    libsuff= shlibsuff=
28088bd17e5fSmrg    ;;
28098bd17e5fSmrg  *)
28108bd17e5fSmrg    case $LD in # libtool.m4 will add one of these switches to LD
28118bd17e5fSmrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
28128bd17e5fSmrg      libsuff= shlibsuff= libmagic=32-bit;;
28138bd17e5fSmrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
28148bd17e5fSmrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
28158bd17e5fSmrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
28168bd17e5fSmrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
28178bd17e5fSmrg    *) libsuff= shlibsuff= libmagic=never-match;;
28188bd17e5fSmrg    esac
28198bd17e5fSmrg    ;;
28208bd17e5fSmrg  esac
28218bd17e5fSmrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
28228bd17e5fSmrg  shlibpath_overrides_runpath=no
28233169be4bSmrg  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
28243169be4bSmrg  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
28258bd17e5fSmrg  hardcode_into_libs=yes
28268bd17e5fSmrg  ;;
2827706b6b52Smrg
28288bd17e5fSmrg# No shared lib support for Linux oldld, aout, or coff.
28298bd17e5fSmrglinux*oldld* | linux*aout* | linux*coff*)
28308bd17e5fSmrg  dynamic_linker=no
28318bd17e5fSmrg  ;;
2832706b6b52Smrg
28333169be4bSmrglinux*android*)
28343169be4bSmrg  version_type=none # Android doesn't support versioned libraries.
28353169be4bSmrg  need_lib_prefix=no
28363169be4bSmrg  need_version=no
28373169be4bSmrg  library_names_spec='$libname$release$shared_ext'
28383169be4bSmrg  soname_spec='$libname$release$shared_ext'
28393169be4bSmrg  finish_cmds=
28403169be4bSmrg  shlibpath_var=LD_LIBRARY_PATH
28413169be4bSmrg  shlibpath_overrides_runpath=yes
28423169be4bSmrg
28433169be4bSmrg  # This implies no fast_install, which is unacceptable.
28443169be4bSmrg  # Some rework will be needed to allow for fast_install
28453169be4bSmrg  # before this can be enabled.
28463169be4bSmrg  hardcode_into_libs=yes
28473169be4bSmrg
28483169be4bSmrg  dynamic_linker='Android linker'
28493169be4bSmrg  # Don't embed -rpath directories since the linker doesn't support them.
28503169be4bSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
28513169be4bSmrg  ;;
28523169be4bSmrg
28538bd17e5fSmrg# This must be glibc/ELF.
2854b242714cSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
28558bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
28568bd17e5fSmrg  need_lib_prefix=no
28578bd17e5fSmrg  need_version=no
28583169be4bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
28593169be4bSmrg  soname_spec='$libname$release$shared_ext$major'
28608bd17e5fSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
28618bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
28628bd17e5fSmrg  shlibpath_overrides_runpath=no
28638bd17e5fSmrg
28648bd17e5fSmrg  # Some binutils ld are patched to set DT_RUNPATH
28658bd17e5fSmrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
28668bd17e5fSmrg    [lt_cv_shlibpath_overrides_runpath=no
28678bd17e5fSmrg    save_LDFLAGS=$LDFLAGS
28688bd17e5fSmrg    save_libdir=$libdir
28698bd17e5fSmrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
28708bd17e5fSmrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
28718bd17e5fSmrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
28728bd17e5fSmrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
28738bd17e5fSmrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
28748bd17e5fSmrg    LDFLAGS=$save_LDFLAGS
28758bd17e5fSmrg    libdir=$save_libdir
28768bd17e5fSmrg    ])
28778bd17e5fSmrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
28788bd17e5fSmrg
28798bd17e5fSmrg  # This implies no fast_install, which is unacceptable.
28808bd17e5fSmrg  # Some rework will be needed to allow for fast_install
28818bd17e5fSmrg  # before this can be enabled.
28828bd17e5fSmrg  hardcode_into_libs=yes
28838bd17e5fSmrg
28843169be4bSmrg  # Ideally, we could use ldconfig to report *all* directores which are
28853169be4bSmrg  # searched for libraries, however this is still not possible.  Aside from not
28863169be4bSmrg  # being certain /sbin/ldconfig is available, command
28873169be4bSmrg  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
28883169be4bSmrg  # even though it is searched at run-time.  Try to do the best guess by
28893169be4bSmrg  # appending ld.so.conf contents (and includes) to the search path.
28908bd17e5fSmrg  if test -f /etc/ld.so.conf; then
28918bd17e5fSmrg    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' ' '`
2892b242714cSmrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
28938bd17e5fSmrg  fi
28948bd17e5fSmrg
28958bd17e5fSmrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
28968bd17e5fSmrg  # powerpc, because MkLinux only supported shared libraries with the
28978bd17e5fSmrg  # GNU dynamic linker.  Since this was broken with cross compilers,
28988bd17e5fSmrg  # most powerpc-linux boxes support dynamic linking these days and
28998bd17e5fSmrg  # people can always --disable-shared, the test was removed, and we
29008bd17e5fSmrg  # assume the GNU/Linux dynamic linker is in use.
29018bd17e5fSmrg  dynamic_linker='GNU/Linux ld.so'
29028bd17e5fSmrg  ;;
29038bd17e5fSmrg
29048bd17e5fSmrgnetbsd*)
29058bd17e5fSmrg  version_type=sunos
29068bd17e5fSmrg  need_lib_prefix=no
29078bd17e5fSmrg  need_version=no
29088bd17e5fSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
29093169be4bSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
29108bd17e5fSmrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
29118bd17e5fSmrg    dynamic_linker='NetBSD (a.out) ld.so'
29128bd17e5fSmrg  else
29133169be4bSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
29143169be4bSmrg    soname_spec='$libname$release$shared_ext$major'
29158bd17e5fSmrg    dynamic_linker='NetBSD ld.elf_so'
29168bd17e5fSmrg  fi
29178bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
29188bd17e5fSmrg  shlibpath_overrides_runpath=yes
29198bd17e5fSmrg  hardcode_into_libs=yes
29208bd17e5fSmrg  ;;
29218bd17e5fSmrg
29228bd17e5fSmrgnewsos6)
29238bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
29243169be4bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
29258bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
29268bd17e5fSmrg  shlibpath_overrides_runpath=yes
29278bd17e5fSmrg  ;;
29288bd17e5fSmrg
29298bd17e5fSmrg*nto* | *qnx*)
29308bd17e5fSmrg  version_type=qnx
29318bd17e5fSmrg  need_lib_prefix=no
29328bd17e5fSmrg  need_version=no
29333169be4bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
29343169be4bSmrg  soname_spec='$libname$release$shared_ext$major'
29358bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
29368bd17e5fSmrg  shlibpath_overrides_runpath=no
29378bd17e5fSmrg  hardcode_into_libs=yes
29388bd17e5fSmrg  dynamic_linker='ldqnx.so'
29398bd17e5fSmrg  ;;
29408bd17e5fSmrg
29413169be4bSmrgopenbsd* | bitrig*)
29428bd17e5fSmrg  version_type=sunos
29433169be4bSmrg  sys_lib_dlsearch_path_spec=/usr/lib
29448bd17e5fSmrg  need_lib_prefix=no
29453169be4bSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
29463169be4bSmrg    need_version=no
2947706b6b52Smrg  else
29483169be4bSmrg    need_version=yes
2949706b6b52Smrg  fi
29503169be4bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
29513169be4bSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
29523169be4bSmrg  shlibpath_var=LD_LIBRARY_PATH
29533169be4bSmrg  shlibpath_overrides_runpath=yes
29548bd17e5fSmrg  ;;
2955706b6b52Smrg
29568bd17e5fSmrgos2*)
29578bd17e5fSmrg  libname_spec='$name'
29583169be4bSmrg  version_type=windows
29593169be4bSmrg  shrext_cmds=.dll
29603169be4bSmrg  need_version=no
29618bd17e5fSmrg  need_lib_prefix=no
29623169be4bSmrg  # OS/2 can only load a DLL with a base name of 8 characters or less.
29633169be4bSmrg  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
29643169be4bSmrg    v=$($ECHO $release$versuffix | tr -d .-);
29653169be4bSmrg    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
29663169be4bSmrg    $ECHO $n$v`$shared_ext'
29673169be4bSmrg  library_names_spec='${libname}_dll.$libext'
29688bd17e5fSmrg  dynamic_linker='OS/2 ld.exe'
29693169be4bSmrg  shlibpath_var=BEGINLIBPATH
29703169be4bSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
29713169be4bSmrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
29723169be4bSmrg  postinstall_cmds='base_file=`basename \$file`~
29733169be4bSmrg    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
29743169be4bSmrg    dldir=$destdir/`dirname \$dlpath`~
29753169be4bSmrg    test -d \$dldir || mkdir -p \$dldir~
29763169be4bSmrg    $install_prog $dir/$dlname \$dldir/$dlname~
29773169be4bSmrg    chmod a+x \$dldir/$dlname~
29783169be4bSmrg    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
29793169be4bSmrg      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
29803169be4bSmrg    fi'
29813169be4bSmrg  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
29823169be4bSmrg    dlpath=$dir/\$dldll~
29833169be4bSmrg    $RM \$dlpath'
29848bd17e5fSmrg  ;;
2985706b6b52Smrg
29868bd17e5fSmrgosf3* | osf4* | osf5*)
29878bd17e5fSmrg  version_type=osf
29888bd17e5fSmrg  need_lib_prefix=no
29898bd17e5fSmrg  need_version=no
29903169be4bSmrg  soname_spec='$libname$release$shared_ext$major'
29913169be4bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
29928bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
29938bd17e5fSmrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
29943169be4bSmrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
29958bd17e5fSmrg  ;;
29968c4a8e55Smrg
29978bd17e5fSmrgrdos*)
29988bd17e5fSmrg  dynamic_linker=no
29998bd17e5fSmrg  ;;
30008bd17e5fSmrg
30018bd17e5fSmrgsolaris*)
30028bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
30038bd17e5fSmrg  need_lib_prefix=no
30048bd17e5fSmrg  need_version=no
30053169be4bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
30063169be4bSmrg  soname_spec='$libname$release$shared_ext$major'
30078bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
30088bd17e5fSmrg  shlibpath_overrides_runpath=yes
30098bd17e5fSmrg  hardcode_into_libs=yes
30108bd17e5fSmrg  # ldd complains unless libraries are executable
30118bd17e5fSmrg  postinstall_cmds='chmod +x $lib'
30128bd17e5fSmrg  ;;
30138bd17e5fSmrg
30148bd17e5fSmrgsunos4*)
30158bd17e5fSmrg  version_type=sunos
30163169be4bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
30178bd17e5fSmrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
30188bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
30198bd17e5fSmrg  shlibpath_overrides_runpath=yes
30203169be4bSmrg  if test yes = "$with_gnu_ld"; then
30218bd17e5fSmrg    need_lib_prefix=no
30228bd17e5fSmrg  fi
30238bd17e5fSmrg  need_version=yes
30248bd17e5fSmrg  ;;
30258c4a8e55Smrg
30268bd17e5fSmrgsysv4 | sysv4.3*)
30278bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
30283169be4bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
30293169be4bSmrg  soname_spec='$libname$release$shared_ext$major'
30308bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
30318bd17e5fSmrg  case $host_vendor in
30328bd17e5fSmrg    sni)
30338bd17e5fSmrg      shlibpath_overrides_runpath=no
30348bd17e5fSmrg      need_lib_prefix=no
30358bd17e5fSmrg      runpath_var=LD_RUN_PATH
30360597fb56Smrg      ;;
30378bd17e5fSmrg    siemens)
30388bd17e5fSmrg      need_lib_prefix=no
30390597fb56Smrg      ;;
30408bd17e5fSmrg    motorola)
30418bd17e5fSmrg      need_lib_prefix=no
30428bd17e5fSmrg      need_version=no
30438bd17e5fSmrg      shlibpath_overrides_runpath=no
30448bd17e5fSmrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
30450597fb56Smrg      ;;
30468bd17e5fSmrg  esac
30478bd17e5fSmrg  ;;
30488c4a8e55Smrg
30498bd17e5fSmrgsysv4*MP*)
30503169be4bSmrg  if test -d /usr/nec; then
30518bd17e5fSmrg    version_type=linux # correct to gnu/linux during the next big refactor
30523169be4bSmrg    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
30533169be4bSmrg    soname_spec='$libname$shared_ext.$major'
30548bd17e5fSmrg    shlibpath_var=LD_LIBRARY_PATH
30558bd17e5fSmrg  fi
30568bd17e5fSmrg  ;;
30578bd17e5fSmrg
30588bd17e5fSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
30593169be4bSmrg  version_type=sco
30608bd17e5fSmrg  need_lib_prefix=no
30618bd17e5fSmrg  need_version=no
30623169be4bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
30633169be4bSmrg  soname_spec='$libname$release$shared_ext$major'
30648bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
30658bd17e5fSmrg  shlibpath_overrides_runpath=yes
30668bd17e5fSmrg  hardcode_into_libs=yes
30673169be4bSmrg  if test yes = "$with_gnu_ld"; then
30688bd17e5fSmrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
30698bd17e5fSmrg  else
30708bd17e5fSmrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
30718bd17e5fSmrg    case $host_os in
30728bd17e5fSmrg      sco3.2v5*)
30738bd17e5fSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
30740597fb56Smrg	;;
30758bd17e5fSmrg    esac
30768bd17e5fSmrg  fi
30778bd17e5fSmrg  sys_lib_dlsearch_path_spec='/usr/lib'
30788bd17e5fSmrg  ;;
3079b042e37fSmrg
30808bd17e5fSmrgtpf*)
30818bd17e5fSmrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
30828bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
30838bd17e5fSmrg  need_lib_prefix=no
30848bd17e5fSmrg  need_version=no
30853169be4bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
30868bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
30878bd17e5fSmrg  shlibpath_overrides_runpath=no
30888bd17e5fSmrg  hardcode_into_libs=yes
30898bd17e5fSmrg  ;;
3090b042e37fSmrg
30918bd17e5fSmrguts4*)
30928bd17e5fSmrg  version_type=linux # correct to gnu/linux during the next big refactor
30933169be4bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
30943169be4bSmrg  soname_spec='$libname$release$shared_ext$major'
30958bd17e5fSmrg  shlibpath_var=LD_LIBRARY_PATH
30968bd17e5fSmrg  ;;
3097b042e37fSmrg
30988bd17e5fSmrg*)
30998bd17e5fSmrg  dynamic_linker=no
31008bd17e5fSmrg  ;;
31018bd17e5fSmrgesac
31028bd17e5fSmrgAC_MSG_RESULT([$dynamic_linker])
31033169be4bSmrgtest no = "$dynamic_linker" && can_build_shared=no
3104706b6b52Smrg
31058bd17e5fSmrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
31063169be4bSmrgif test yes = "$GCC"; then
31078bd17e5fSmrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
31088bd17e5fSmrgfi
3109b042e37fSmrg
31103169be4bSmrgif test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
31113169be4bSmrg  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
31128bd17e5fSmrgfi
31133169be4bSmrg
31143169be4bSmrgif test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
31153169be4bSmrg  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
31168bd17e5fSmrgfi
31170597fb56Smrg
31183169be4bSmrg# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
31193169be4bSmrgconfigure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
31203169be4bSmrg
31213169be4bSmrg# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
31223169be4bSmrgfunc_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
31233169be4bSmrg
31243169be4bSmrg# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
31253169be4bSmrgconfigure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
31263169be4bSmrg
31278bd17e5fSmrg_LT_DECL([], [variables_saved_for_relink], [1],
31288bd17e5fSmrg    [Variables whose values should be saved in libtool wrapper scripts and
31298bd17e5fSmrg    restored at link time])
31308bd17e5fSmrg_LT_DECL([], [need_lib_prefix], [0],
31318bd17e5fSmrg    [Do we need the "lib" prefix for modules?])
31328bd17e5fSmrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
31338bd17e5fSmrg_LT_DECL([], [version_type], [0], [Library versioning type])
31348bd17e5fSmrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
31358bd17e5fSmrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
31368bd17e5fSmrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
31378bd17e5fSmrg    [Is shlibpath searched before the hard-coded library search path?])
31388bd17e5fSmrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
31398bd17e5fSmrg_LT_DECL([], [library_names_spec], [1],
31408bd17e5fSmrg    [[List of archive names.  First name is the real one, the rest are links.
31418bd17e5fSmrg    The last name is the one that the linker finds with -lNAME]])
31428bd17e5fSmrg_LT_DECL([], [soname_spec], [1],
31438bd17e5fSmrg    [[The coded name of the library, if different from the real name]])
31448bd17e5fSmrg_LT_DECL([], [install_override_mode], [1],
31458bd17e5fSmrg    [Permission mode override for installation of shared libraries])
31468bd17e5fSmrg_LT_DECL([], [postinstall_cmds], [2],
31478bd17e5fSmrg    [Command to use after installation of a shared archive])
31488bd17e5fSmrg_LT_DECL([], [postuninstall_cmds], [2],
31498bd17e5fSmrg    [Command to use after uninstallation of a shared archive])
31508bd17e5fSmrg_LT_DECL([], [finish_cmds], [2],
31518bd17e5fSmrg    [Commands used to finish a libtool library installation in a directory])
31528bd17e5fSmrg_LT_DECL([], [finish_eval], [1],
31538bd17e5fSmrg    [[As "finish_cmds", except a single script fragment to be evaled but
31548bd17e5fSmrg    not shown]])
31558bd17e5fSmrg_LT_DECL([], [hardcode_into_libs], [0],
31568bd17e5fSmrg    [Whether we should hardcode library paths into libraries])
31578bd17e5fSmrg_LT_DECL([], [sys_lib_search_path_spec], [2],
31588bd17e5fSmrg    [Compile-time system search path for libraries])
31593169be4bSmrg_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
31603169be4bSmrg    [Detected run-time system search path for libraries])
31613169be4bSmrg_LT_DECL([], [configure_time_lt_sys_library_path], [2],
31623169be4bSmrg    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
31638bd17e5fSmrg])# _LT_SYS_DYNAMIC_LINKER
3164b042e37fSmrg
3165b042e37fSmrg
31668bd17e5fSmrg# _LT_PATH_TOOL_PREFIX(TOOL)
31678bd17e5fSmrg# --------------------------
31683169be4bSmrg# find a file program that can recognize shared library
31698bd17e5fSmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
31708bd17e5fSmrg[m4_require([_LT_DECL_EGREP])dnl
31718bd17e5fSmrgAC_MSG_CHECKING([for $1])
31728bd17e5fSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
31738bd17e5fSmrg[case $MAGIC_CMD in
31748bd17e5fSmrg[[\\/*] |  ?:[\\/]*])
31753169be4bSmrg  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
31768bd17e5fSmrg  ;;
31778bd17e5fSmrg*)
31783169be4bSmrg  lt_save_MAGIC_CMD=$MAGIC_CMD
31793169be4bSmrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
31808bd17e5fSmrgdnl $ac_dummy forces splitting on constant user-supplied paths.
31818bd17e5fSmrgdnl POSIX.2 word splitting is done only on the output of word expansions,
31828bd17e5fSmrgdnl not every word.  This closes a longstanding sh security hole.
31838bd17e5fSmrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
31848bd17e5fSmrg  for ac_dir in $ac_dummy; do
31853169be4bSmrg    IFS=$lt_save_ifs
31868bd17e5fSmrg    test -z "$ac_dir" && ac_dir=.
31873169be4bSmrg    if test -f "$ac_dir/$1"; then
31883169be4bSmrg      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
31898bd17e5fSmrg      if test -n "$file_magic_test_file"; then
31908bd17e5fSmrg	case $deplibs_check_method in
31918bd17e5fSmrg	"file_magic "*)
31928bd17e5fSmrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
31933169be4bSmrg	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
31948bd17e5fSmrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
31958bd17e5fSmrg	    $EGREP "$file_magic_regex" > /dev/null; then
31968bd17e5fSmrg	    :
31978bd17e5fSmrg	  else
31988bd17e5fSmrg	    cat <<_LT_EOF 1>&2
3199b042e37fSmrg
32008bd17e5fSmrg*** Warning: the command libtool uses to detect shared libraries,
32018bd17e5fSmrg*** $file_magic_cmd, produces output that libtool cannot recognize.
32028bd17e5fSmrg*** The result is that libtool may fail to recognize shared libraries
32038bd17e5fSmrg*** as such.  This will affect the creation of libtool libraries that
32048bd17e5fSmrg*** depend on shared libraries, but programs linked with such libtool
32058bd17e5fSmrg*** libraries will work regardless of this problem.  Nevertheless, you
32068bd17e5fSmrg*** may want to report the problem to your system manager and/or to
32078bd17e5fSmrg*** bug-libtool@gnu.org
3208b042e37fSmrg
32098bd17e5fSmrg_LT_EOF
32108bd17e5fSmrg	  fi ;;
32110597fb56Smrg	esac
32128bd17e5fSmrg      fi
32138bd17e5fSmrg      break
32148bd17e5fSmrg    fi
32158bd17e5fSmrg  done
32163169be4bSmrg  IFS=$lt_save_ifs
32173169be4bSmrg  MAGIC_CMD=$lt_save_MAGIC_CMD
32188bd17e5fSmrg  ;;
32198bd17e5fSmrgesac])
32203169be4bSmrgMAGIC_CMD=$lt_cv_path_MAGIC_CMD
32218bd17e5fSmrgif test -n "$MAGIC_CMD"; then
32228bd17e5fSmrg  AC_MSG_RESULT($MAGIC_CMD)
32238bd17e5fSmrgelse
32248bd17e5fSmrg  AC_MSG_RESULT(no)
32258bd17e5fSmrgfi
32268bd17e5fSmrg_LT_DECL([], [MAGIC_CMD], [0],
32278bd17e5fSmrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
32288bd17e5fSmrg])# _LT_PATH_TOOL_PREFIX
32290597fb56Smrg
32308bd17e5fSmrg# Old name:
32318bd17e5fSmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
32328bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
32338bd17e5fSmrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3234bd23fbfaSmrg
3235bd23fbfaSmrg
32368bd17e5fSmrg# _LT_PATH_MAGIC
32378bd17e5fSmrg# --------------
32383169be4bSmrg# find a file program that can recognize a shared library
32398bd17e5fSmrgm4_defun([_LT_PATH_MAGIC],
32408bd17e5fSmrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
32418bd17e5fSmrgif test -z "$lt_cv_path_MAGIC_CMD"; then
32428bd17e5fSmrg  if test -n "$ac_tool_prefix"; then
32438bd17e5fSmrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
32448bd17e5fSmrg  else
32458bd17e5fSmrg    MAGIC_CMD=:
32468bd17e5fSmrg  fi
32478bd17e5fSmrgfi
32488bd17e5fSmrg])# _LT_PATH_MAGIC
32490597fb56Smrg
32500597fb56Smrg
32518bd17e5fSmrg# LT_PATH_LD
32528bd17e5fSmrg# ----------
32538bd17e5fSmrg# find the pathname to the GNU or non-GNU linker
32548bd17e5fSmrgAC_DEFUN([LT_PATH_LD],
32558bd17e5fSmrg[AC_REQUIRE([AC_PROG_CC])dnl
32568bd17e5fSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
32578bd17e5fSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
32588bd17e5fSmrgm4_require([_LT_DECL_SED])dnl
32598bd17e5fSmrgm4_require([_LT_DECL_EGREP])dnl
32608bd17e5fSmrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3261bd23fbfaSmrg
32628bd17e5fSmrgAC_ARG_WITH([gnu-ld],
32638bd17e5fSmrg    [AS_HELP_STRING([--with-gnu-ld],
32648bd17e5fSmrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
32653169be4bSmrg    [test no = "$withval" || with_gnu_ld=yes],
32668bd17e5fSmrg    [with_gnu_ld=no])dnl
3267706b6b52Smrg
32688bd17e5fSmrgac_prog=ld
32693169be4bSmrgif test yes = "$GCC"; then
32708bd17e5fSmrg  # Check if gcc -print-prog-name=ld gives a path.
32718bd17e5fSmrg  AC_MSG_CHECKING([for ld used by $CC])
32728bd17e5fSmrg  case $host in
32738bd17e5fSmrg  *-*-mingw*)
32743169be4bSmrg    # gcc leaves a trailing carriage return, which upsets mingw
32758bd17e5fSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
32768bd17e5fSmrg  *)
32778bd17e5fSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
32788bd17e5fSmrg  esac
32798bd17e5fSmrg  case $ac_prog in
32808bd17e5fSmrg    # Accept absolute paths.
32818bd17e5fSmrg    [[\\/]]* | ?:[[\\/]]*)
32828bd17e5fSmrg      re_direlt='/[[^/]][[^/]]*/\.\./'
32838bd17e5fSmrg      # Canonicalize the pathname of ld
32848bd17e5fSmrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
32858bd17e5fSmrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
32868bd17e5fSmrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
32878bd17e5fSmrg      done
32883169be4bSmrg      test -z "$LD" && LD=$ac_prog
32890597fb56Smrg      ;;
32908bd17e5fSmrg  "")
32918bd17e5fSmrg    # If it fails, then pretend we aren't using GCC.
32928bd17e5fSmrg    ac_prog=ld
32938bd17e5fSmrg    ;;
32948bd17e5fSmrg  *)
32958bd17e5fSmrg    # If it is relative, then search for the first ld in PATH.
32968bd17e5fSmrg    with_gnu_ld=unknown
32978bd17e5fSmrg    ;;
32988bd17e5fSmrg  esac
32993169be4bSmrgelif test yes = "$with_gnu_ld"; then
33008bd17e5fSmrg  AC_MSG_CHECKING([for GNU ld])
33018bd17e5fSmrgelse
33028bd17e5fSmrg  AC_MSG_CHECKING([for non-GNU ld])
33038bd17e5fSmrgfi
33048bd17e5fSmrgAC_CACHE_VAL(lt_cv_path_LD,
33058bd17e5fSmrg[if test -z "$LD"; then
33063169be4bSmrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
33078bd17e5fSmrg  for ac_dir in $PATH; do
33083169be4bSmrg    IFS=$lt_save_ifs
33098bd17e5fSmrg    test -z "$ac_dir" && ac_dir=.
33108bd17e5fSmrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
33113169be4bSmrg      lt_cv_path_LD=$ac_dir/$ac_prog
33128bd17e5fSmrg      # Check to see if the program is GNU ld.  I'd rather use --version,
33138bd17e5fSmrg      # but apparently some variants of GNU ld only accept -v.
33148bd17e5fSmrg      # Break only if it was the GNU/non-GNU ld that we prefer.
33158bd17e5fSmrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
33168bd17e5fSmrg      *GNU* | *'with BFD'*)
33173169be4bSmrg	test no != "$with_gnu_ld" && break
33188bd17e5fSmrg	;;
33198bd17e5fSmrg      *)
33203169be4bSmrg	test yes != "$with_gnu_ld" && break
33218bd17e5fSmrg	;;
33228bd17e5fSmrg      esac
33238bd17e5fSmrg    fi
33248bd17e5fSmrg  done
33253169be4bSmrg  IFS=$lt_save_ifs
33268bd17e5fSmrgelse
33273169be4bSmrg  lt_cv_path_LD=$LD # Let the user override the test with a path.
33288bd17e5fSmrgfi])
33293169be4bSmrgLD=$lt_cv_path_LD
33308bd17e5fSmrgif test -n "$LD"; then
33318bd17e5fSmrg  AC_MSG_RESULT($LD)
33328bd17e5fSmrgelse
33338bd17e5fSmrg  AC_MSG_RESULT(no)
33348bd17e5fSmrgfi
33358bd17e5fSmrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
33368bd17e5fSmrg_LT_PATH_LD_GNU
33378bd17e5fSmrgAC_SUBST([LD])
3338b042e37fSmrg
33398bd17e5fSmrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
33408bd17e5fSmrg])# LT_PATH_LD
3341b042e37fSmrg
33428bd17e5fSmrg# Old names:
33438bd17e5fSmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
33448bd17e5fSmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
33458bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
33468bd17e5fSmrgdnl AC_DEFUN([AM_PROG_LD], [])
33478bd17e5fSmrgdnl AC_DEFUN([AC_PROG_LD], [])
3348b042e37fSmrg
3349b042e37fSmrg
33508bd17e5fSmrg# _LT_PATH_LD_GNU
33518bd17e5fSmrg#- --------------
33528bd17e5fSmrgm4_defun([_LT_PATH_LD_GNU],
33538bd17e5fSmrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
33548bd17e5fSmrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
33558bd17e5fSmrgcase `$LD -v 2>&1 </dev/null` in
33568bd17e5fSmrg*GNU* | *'with BFD'*)
33578bd17e5fSmrg  lt_cv_prog_gnu_ld=yes
33588bd17e5fSmrg  ;;
33598bd17e5fSmrg*)
33608bd17e5fSmrg  lt_cv_prog_gnu_ld=no
33618bd17e5fSmrg  ;;
33628bd17e5fSmrgesac])
33638bd17e5fSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
33648bd17e5fSmrg])# _LT_PATH_LD_GNU
33658bd17e5fSmrg
33668bd17e5fSmrg
33678bd17e5fSmrg# _LT_CMD_RELOAD
33688bd17e5fSmrg# --------------
33698bd17e5fSmrg# find reload flag for linker
33708bd17e5fSmrg#   -- PORTME Some linkers may need a different reload flag.
33718bd17e5fSmrgm4_defun([_LT_CMD_RELOAD],
33728bd17e5fSmrg[AC_CACHE_CHECK([for $LD option to reload object files],
33738bd17e5fSmrg  lt_cv_ld_reload_flag,
33748bd17e5fSmrg  [lt_cv_ld_reload_flag='-r'])
33758bd17e5fSmrgreload_flag=$lt_cv_ld_reload_flag
33768bd17e5fSmrgcase $reload_flag in
33778bd17e5fSmrg"" | " "*) ;;
33788bd17e5fSmrg*) reload_flag=" $reload_flag" ;;
33798bd17e5fSmrgesac
33808bd17e5fSmrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
33810597fb56Smrgcase $host_os in
33828bd17e5fSmrg  cygwin* | mingw* | pw32* | cegcc*)
33833169be4bSmrg    if test yes != "$GCC"; then
33848bd17e5fSmrg      reload_cmds=false
33858bd17e5fSmrg    fi
3386706b6b52Smrg    ;;
33878bd17e5fSmrg  darwin*)
33883169be4bSmrg    if test yes = "$GCC"; then
33893169be4bSmrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
33908bd17e5fSmrg    else
33918bd17e5fSmrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
33928bd17e5fSmrg    fi
3393706b6b52Smrg    ;;
33940597fb56Smrgesac
33958bd17e5fSmrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
33968bd17e5fSmrg_LT_TAGDECL([], [reload_cmds], [2])dnl
33978bd17e5fSmrg])# _LT_CMD_RELOAD
3398706b6b52Smrg
3399706b6b52Smrg
34003169be4bSmrg# _LT_PATH_DD
34013169be4bSmrg# -----------
34023169be4bSmrg# find a working dd
34033169be4bSmrgm4_defun([_LT_PATH_DD],
34043169be4bSmrg[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
34053169be4bSmrg[printf 0123456789abcdef0123456789abcdef >conftest.i
34063169be4bSmrgcat conftest.i conftest.i >conftest2.i
34073169be4bSmrg: ${lt_DD:=$DD}
34083169be4bSmrgAC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
34093169be4bSmrg[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
34103169be4bSmrg  cmp -s conftest.i conftest.out \
34113169be4bSmrg  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
34123169be4bSmrgfi])
34133169be4bSmrgrm -f conftest.i conftest2.i conftest.out])
34143169be4bSmrg])# _LT_PATH_DD
34153169be4bSmrg
34163169be4bSmrg
34173169be4bSmrg# _LT_CMD_TRUNCATE
34183169be4bSmrg# ----------------
34193169be4bSmrg# find command to truncate a binary pipe
34203169be4bSmrgm4_defun([_LT_CMD_TRUNCATE],
34213169be4bSmrg[m4_require([_LT_PATH_DD])
34223169be4bSmrgAC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
34233169be4bSmrg[printf 0123456789abcdef0123456789abcdef >conftest.i
34243169be4bSmrgcat conftest.i conftest.i >conftest2.i
34253169be4bSmrglt_cv_truncate_bin=
34263169be4bSmrgif "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
34273169be4bSmrg  cmp -s conftest.i conftest.out \
34283169be4bSmrg  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
34293169be4bSmrgfi
34303169be4bSmrgrm -f conftest.i conftest2.i conftest.out
34313169be4bSmrgtest -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
34323169be4bSmrg_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
34333169be4bSmrg  [Command to truncate a binary pipe])
34343169be4bSmrg])# _LT_CMD_TRUNCATE
34353169be4bSmrg
34363169be4bSmrg
34378bd17e5fSmrg# _LT_CHECK_MAGIC_METHOD
34388bd17e5fSmrg# ----------------------
34398bd17e5fSmrg# how to check for library dependencies
34408bd17e5fSmrg#  -- PORTME fill in with the dynamic library characteristics
34418bd17e5fSmrgm4_defun([_LT_CHECK_MAGIC_METHOD],
34428bd17e5fSmrg[m4_require([_LT_DECL_EGREP])
34438bd17e5fSmrgm4_require([_LT_DECL_OBJDUMP])
34448bd17e5fSmrgAC_CACHE_CHECK([how to recognize dependent libraries],
34458bd17e5fSmrglt_cv_deplibs_check_method,
34468bd17e5fSmrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
34478bd17e5fSmrglt_cv_file_magic_test_file=
34488bd17e5fSmrglt_cv_deplibs_check_method='unknown'
34498bd17e5fSmrg# Need to set the preceding variable on all platforms that support
34508bd17e5fSmrg# interlibrary dependencies.
34518bd17e5fSmrg# 'none' -- dependencies not supported.
34523169be4bSmrg# 'unknown' -- same as none, but documents that we really don't know.
34538bd17e5fSmrg# 'pass_all' -- all dependencies passed with no checks.
34548bd17e5fSmrg# 'test_compile' -- check by making test program.
34558bd17e5fSmrg# 'file_magic [[regex]]' -- check by looking for files in library path
34563169be4bSmrg# that responds to the $file_magic_cmd with a given extended regex.
34573169be4bSmrg# If you have 'file' or equivalent on your system and you're not sure
34583169be4bSmrg# whether 'pass_all' will *always* work, you probably want this one.
3459b042e37fSmrg
34608bd17e5fSmrgcase $host_os in
34618bd17e5fSmrgaix[[4-9]]*)
34628bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
34638bd17e5fSmrg  ;;
34640597fb56Smrg
34658bd17e5fSmrgbeos*)
34668bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
34678bd17e5fSmrg  ;;
34680597fb56Smrg
34698bd17e5fSmrgbsdi[[45]]*)
34708bd17e5fSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
34718bd17e5fSmrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
34728bd17e5fSmrg  lt_cv_file_magic_test_file=/shlib/libc.so
34738bd17e5fSmrg  ;;
34748bd17e5fSmrg
34758bd17e5fSmrgcygwin*)
34768bd17e5fSmrg  # func_win32_libid is a shell function defined in ltmain.sh
34778bd17e5fSmrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
34788bd17e5fSmrg  lt_cv_file_magic_cmd='func_win32_libid'
34798bd17e5fSmrg  ;;
34808bd17e5fSmrg
34818bd17e5fSmrgmingw* | pw32*)
34828bd17e5fSmrg  # Base MSYS/MinGW do not provide the 'file' command needed by
34838bd17e5fSmrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
34848bd17e5fSmrg  # unless we find 'file', for example because we are cross-compiling.
34853169be4bSmrg  if ( file / ) >/dev/null 2>&1; then
34868bd17e5fSmrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
34878bd17e5fSmrg    lt_cv_file_magic_cmd='func_win32_libid'
34888bd17e5fSmrg  else
34898bd17e5fSmrg    # Keep this pattern in sync with the one in func_win32_libid.
34908bd17e5fSmrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
34918bd17e5fSmrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
34928bd17e5fSmrg  fi
34938bd17e5fSmrg  ;;
34948bd17e5fSmrg
34958bd17e5fSmrgcegcc*)
34968bd17e5fSmrg  # use the weaker test based on 'objdump'. See mingw*.
34978bd17e5fSmrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
34988bd17e5fSmrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
34998bd17e5fSmrg  ;;
35008bd17e5fSmrg
35018bd17e5fSmrgdarwin* | rhapsody*)
35028bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
35038bd17e5fSmrg  ;;
35048bd17e5fSmrg
35058bd17e5fSmrgfreebsd* | dragonfly*)
35068bd17e5fSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
35078bd17e5fSmrg    case $host_cpu in
35088bd17e5fSmrg    i*86 )
35098bd17e5fSmrg      # Not sure whether the presence of OpenBSD here was a mistake.
35108bd17e5fSmrg      # Let's accept both of them until this is cleared up.
35118bd17e5fSmrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
35128bd17e5fSmrg      lt_cv_file_magic_cmd=/usr/bin/file
35138bd17e5fSmrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
35140597fb56Smrg      ;;
35150597fb56Smrg    esac
35168bd17e5fSmrg  else
35178bd17e5fSmrg    lt_cv_deplibs_check_method=pass_all
35188bd17e5fSmrg  fi
35198bd17e5fSmrg  ;;
3520b042e37fSmrg
35218bd17e5fSmrghaiku*)
35228bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
35238bd17e5fSmrg  ;;
35248bd17e5fSmrg
35258bd17e5fSmrghpux10.20* | hpux11*)
35268bd17e5fSmrg  lt_cv_file_magic_cmd=/usr/bin/file
35278bd17e5fSmrg  case $host_cpu in
35288bd17e5fSmrg  ia64*)
35298bd17e5fSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
35308bd17e5fSmrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3531706b6b52Smrg    ;;
35328bd17e5fSmrg  hppa*64*)
35338bd17e5fSmrg    [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]']
35348bd17e5fSmrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
35350597fb56Smrg    ;;
35368bd17e5fSmrg  *)
35378bd17e5fSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
35388bd17e5fSmrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3539706b6b52Smrg    ;;
3540706b6b52Smrg  esac
35418bd17e5fSmrg  ;;
3542b042e37fSmrg
35438bd17e5fSmrginterix[[3-9]]*)
35448bd17e5fSmrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
35458bd17e5fSmrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
35468bd17e5fSmrg  ;;
3547b042e37fSmrg
35488bd17e5fSmrgirix5* | irix6* | nonstopux*)
35498bd17e5fSmrg  case $LD in
35508bd17e5fSmrg  *-32|*"-32 ") libmagic=32-bit;;
35518bd17e5fSmrg  *-n32|*"-n32 ") libmagic=N32;;
35528bd17e5fSmrg  *-64|*"-64 ") libmagic=64-bit;;
35538bd17e5fSmrg  *) libmagic=never-match;;
35548bd17e5fSmrg  esac
35558bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
35568bd17e5fSmrg  ;;
3557b042e37fSmrg
35588bd17e5fSmrg# This must be glibc/ELF.
3559b242714cSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
35608bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
35618bd17e5fSmrg  ;;
3562b042e37fSmrg
35633169be4bSmrgnetbsd*)
35648bd17e5fSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
35658bd17e5fSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
35668bd17e5fSmrg  else
35678bd17e5fSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
35688bd17e5fSmrg  fi
35698bd17e5fSmrg  ;;
3570b042e37fSmrg
35718bd17e5fSmrgnewos6*)
35728bd17e5fSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
35738bd17e5fSmrg  lt_cv_file_magic_cmd=/usr/bin/file
35748bd17e5fSmrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
35758bd17e5fSmrg  ;;
3576706b6b52Smrg
35778bd17e5fSmrg*nto* | *qnx*)
35788bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
35798bd17e5fSmrg  ;;
3580b042e37fSmrg
35813169be4bSmrgopenbsd* | bitrig*)
35823169be4bSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
35838bd17e5fSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
35848bd17e5fSmrg  else
35858bd17e5fSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
35868bd17e5fSmrg  fi
35878bd17e5fSmrg  ;;
3588b042e37fSmrg
35898bd17e5fSmrgosf3* | osf4* | osf5*)
35908bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
35918bd17e5fSmrg  ;;
35920597fb56Smrg
35938bd17e5fSmrgrdos*)
35948bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
35958bd17e5fSmrg  ;;
35960597fb56Smrg
35978bd17e5fSmrgsolaris*)
35988bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
35998bd17e5fSmrg  ;;
36000597fb56Smrg
36018bd17e5fSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
36028bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
36038bd17e5fSmrg  ;;
36040597fb56Smrg
36058bd17e5fSmrgsysv4 | sysv4.3*)
36068bd17e5fSmrg  case $host_vendor in
36078bd17e5fSmrg  motorola)
36088bd17e5fSmrg    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]]'
36098bd17e5fSmrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
36108bd17e5fSmrg    ;;
36118bd17e5fSmrg  ncr)
36128bd17e5fSmrg    lt_cv_deplibs_check_method=pass_all
36138bd17e5fSmrg    ;;
36148bd17e5fSmrg  sequent)
36158bd17e5fSmrg    lt_cv_file_magic_cmd='/bin/file'
36168bd17e5fSmrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
36178bd17e5fSmrg    ;;
36188bd17e5fSmrg  sni)
36198bd17e5fSmrg    lt_cv_file_magic_cmd='/bin/file'
36208bd17e5fSmrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
36218bd17e5fSmrg    lt_cv_file_magic_test_file=/lib/libc.so
36228bd17e5fSmrg    ;;
36238bd17e5fSmrg  siemens)
36248bd17e5fSmrg    lt_cv_deplibs_check_method=pass_all
36258bd17e5fSmrg    ;;
36268bd17e5fSmrg  pc)
36278bd17e5fSmrg    lt_cv_deplibs_check_method=pass_all
36288bd17e5fSmrg    ;;
36298bd17e5fSmrg  esac
36308bd17e5fSmrg  ;;
36310597fb56Smrg
36328bd17e5fSmrgtpf*)
36338bd17e5fSmrg  lt_cv_deplibs_check_method=pass_all
36348bd17e5fSmrg  ;;
36353169be4bSmrgos2*)
36363169be4bSmrg  lt_cv_deplibs_check_method=pass_all
36373169be4bSmrg  ;;
36388bd17e5fSmrgesac
36398bd17e5fSmrg])
36408bd17e5fSmrg
36418bd17e5fSmrgfile_magic_glob=
36428bd17e5fSmrgwant_nocaseglob=no
36438bd17e5fSmrgif test "$build" = "$host"; then
36448bd17e5fSmrg  case $host_os in
36458bd17e5fSmrg  mingw* | pw32*)
36468bd17e5fSmrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
36478bd17e5fSmrg      want_nocaseglob=yes
36488bd17e5fSmrg    else
36498bd17e5fSmrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
36508bd17e5fSmrg    fi
36518bd17e5fSmrg    ;;
36528bd17e5fSmrg  esac
36538bd17e5fSmrgfi
36540597fb56Smrg
36558bd17e5fSmrgfile_magic_cmd=$lt_cv_file_magic_cmd
36568bd17e5fSmrgdeplibs_check_method=$lt_cv_deplibs_check_method
36578bd17e5fSmrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
36580597fb56Smrg
36598bd17e5fSmrg_LT_DECL([], [deplibs_check_method], [1],
36608bd17e5fSmrg    [Method to check whether dependent libraries are shared objects])
36618bd17e5fSmrg_LT_DECL([], [file_magic_cmd], [1],
36628bd17e5fSmrg    [Command to use when deplibs_check_method = "file_magic"])
36638bd17e5fSmrg_LT_DECL([], [file_magic_glob], [1],
36648bd17e5fSmrg    [How to find potential files when deplibs_check_method = "file_magic"])
36658bd17e5fSmrg_LT_DECL([], [want_nocaseglob], [1],
36668bd17e5fSmrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
36678bd17e5fSmrg])# _LT_CHECK_MAGIC_METHOD
36680597fb56Smrg
36698bd17e5fSmrg
36708bd17e5fSmrg# LT_PATH_NM
36718bd17e5fSmrg# ----------
36728bd17e5fSmrg# find the pathname to a BSD- or MS-compatible name lister
36738bd17e5fSmrgAC_DEFUN([LT_PATH_NM],
36748bd17e5fSmrg[AC_REQUIRE([AC_PROG_CC])dnl
36758bd17e5fSmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
36768bd17e5fSmrg[if test -n "$NM"; then
36778bd17e5fSmrg  # Let the user override the test.
36783169be4bSmrg  lt_cv_path_NM=$NM
36798bd17e5fSmrgelse
36803169be4bSmrg  lt_nm_to_check=${ac_tool_prefix}nm
36818bd17e5fSmrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
36828bd17e5fSmrg    lt_nm_to_check="$lt_nm_to_check nm"
36838bd17e5fSmrg  fi
36848bd17e5fSmrg  for lt_tmp_nm in $lt_nm_to_check; do
36853169be4bSmrg    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
36868bd17e5fSmrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
36873169be4bSmrg      IFS=$lt_save_ifs
36888bd17e5fSmrg      test -z "$ac_dir" && ac_dir=.
36893169be4bSmrg      tmp_nm=$ac_dir/$lt_tmp_nm
36903169be4bSmrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
36918bd17e5fSmrg	# Check to see if the nm accepts a BSD-compat flag.
36923169be4bSmrg	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
36938bd17e5fSmrg	#   nm: unknown option "B" ignored
36948bd17e5fSmrg	# Tru64's nm complains that /dev/null is an invalid object file
36953169be4bSmrg	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
36963169be4bSmrg	case $build_os in
36973169be4bSmrg	mingw*) lt_bad_file=conftest.nm/nofile ;;
36983169be4bSmrg	*) lt_bad_file=/dev/null ;;
36993169be4bSmrg	esac
37003169be4bSmrg	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
37013169be4bSmrg	*$lt_bad_file* | *'Invalid file or object type'*)
37028bd17e5fSmrg	  lt_cv_path_NM="$tmp_nm -B"
37033169be4bSmrg	  break 2
37048bd17e5fSmrg	  ;;
37058bd17e5fSmrg	*)
37068bd17e5fSmrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
37078bd17e5fSmrg	  */dev/null*)
37088bd17e5fSmrg	    lt_cv_path_NM="$tmp_nm -p"
37093169be4bSmrg	    break 2
37108bd17e5fSmrg	    ;;
37118bd17e5fSmrg	  *)
37128bd17e5fSmrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
37138bd17e5fSmrg	    continue # so that we can try to find one that supports BSD flags
37148bd17e5fSmrg	    ;;
37158bd17e5fSmrg	  esac
37160597fb56Smrg	  ;;
37170597fb56Smrg	esac
37180597fb56Smrg      fi
37198bd17e5fSmrg    done
37203169be4bSmrg    IFS=$lt_save_ifs
37218bd17e5fSmrg  done
37228bd17e5fSmrg  : ${lt_cv_path_NM=no}
37238bd17e5fSmrgfi])
37243169be4bSmrgif test no != "$lt_cv_path_NM"; then
37253169be4bSmrg  NM=$lt_cv_path_NM
37268bd17e5fSmrgelse
37278bd17e5fSmrg  # Didn't find any BSD compatible name lister, look for dumpbin.
37288bd17e5fSmrg  if test -n "$DUMPBIN"; then :
37298bd17e5fSmrg    # Let the user override the test.
37308bd17e5fSmrg  else
37318bd17e5fSmrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
37323169be4bSmrg    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
37338bd17e5fSmrg    *COFF*)
37343169be4bSmrg      DUMPBIN="$DUMPBIN -symbols -headers"
3735706b6b52Smrg      ;;
37368bd17e5fSmrg    *)
37378bd17e5fSmrg      DUMPBIN=:
37380597fb56Smrg      ;;
37398bd17e5fSmrg    esac
37408bd17e5fSmrg  fi
37418bd17e5fSmrg  AC_SUBST([DUMPBIN])
37423169be4bSmrg  if test : != "$DUMPBIN"; then
37433169be4bSmrg    NM=$DUMPBIN
37448bd17e5fSmrg  fi
37458bd17e5fSmrgfi
37468bd17e5fSmrgtest -z "$NM" && NM=nm
37478bd17e5fSmrgAC_SUBST([NM])
37488bd17e5fSmrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3749706b6b52Smrg
37508bd17e5fSmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
37518bd17e5fSmrg  [lt_cv_nm_interface="BSD nm"
37528bd17e5fSmrg  echo "int some_variable = 0;" > conftest.$ac_ext
37538bd17e5fSmrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
37548bd17e5fSmrg  (eval "$ac_compile" 2>conftest.err)
37558bd17e5fSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
37568bd17e5fSmrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
37578bd17e5fSmrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
37588bd17e5fSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
37598bd17e5fSmrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
37608bd17e5fSmrg  cat conftest.out >&AS_MESSAGE_LOG_FD
37618bd17e5fSmrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
37628bd17e5fSmrg    lt_cv_nm_interface="MS dumpbin"
37638bd17e5fSmrg  fi
37648bd17e5fSmrg  rm -f conftest*])
37658bd17e5fSmrg])# LT_PATH_NM
3766b042e37fSmrg
37678bd17e5fSmrg# Old names:
37688bd17e5fSmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
37698bd17e5fSmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
37708bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
37718bd17e5fSmrgdnl AC_DEFUN([AM_PROG_NM], [])
37728bd17e5fSmrgdnl AC_DEFUN([AC_PROG_NM], [])
3773b042e37fSmrg
37748bd17e5fSmrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
37758bd17e5fSmrg# --------------------------------
37768bd17e5fSmrg# how to determine the name of the shared library
37778bd17e5fSmrg# associated with a specific link library.
37788bd17e5fSmrg#  -- PORTME fill in with the dynamic library characteristics
37798bd17e5fSmrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
37808bd17e5fSmrg[m4_require([_LT_DECL_EGREP])
37818bd17e5fSmrgm4_require([_LT_DECL_OBJDUMP])
37828bd17e5fSmrgm4_require([_LT_DECL_DLLTOOL])
37838bd17e5fSmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
37848bd17e5fSmrglt_cv_sharedlib_from_linklib_cmd,
37858bd17e5fSmrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
3786b042e37fSmrg
37878bd17e5fSmrgcase $host_os in
37888bd17e5fSmrgcygwin* | mingw* | pw32* | cegcc*)
37893169be4bSmrg  # two different shell functions defined in ltmain.sh;
37903169be4bSmrg  # decide which one to use based on capabilities of $DLLTOOL
37918bd17e5fSmrg  case `$DLLTOOL --help 2>&1` in
37928bd17e5fSmrg  *--identify-strict*)
37938bd17e5fSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
37948bd17e5fSmrg    ;;
37958bd17e5fSmrg  *)
37968bd17e5fSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
37978bd17e5fSmrg    ;;
37988bd17e5fSmrg  esac
37998bd17e5fSmrg  ;;
38008bd17e5fSmrg*)
38018bd17e5fSmrg  # fallback: assume linklib IS sharedlib
38023169be4bSmrg  lt_cv_sharedlib_from_linklib_cmd=$ECHO
38038bd17e5fSmrg  ;;
38048bd17e5fSmrgesac
38058bd17e5fSmrg])
38068bd17e5fSmrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
38078bd17e5fSmrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3808b042e37fSmrg
38098bd17e5fSmrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
38108bd17e5fSmrg    [Command to associate shared and link libraries])
38118bd17e5fSmrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3812706b6b52Smrg
3813706b6b52Smrg
38148bd17e5fSmrg# _LT_PATH_MANIFEST_TOOL
38158bd17e5fSmrg# ----------------------
38168bd17e5fSmrg# locate the manifest tool
38178bd17e5fSmrgm4_defun([_LT_PATH_MANIFEST_TOOL],
38188bd17e5fSmrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
38198bd17e5fSmrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
38208bd17e5fSmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
38218bd17e5fSmrg  [lt_cv_path_mainfest_tool=no
38228bd17e5fSmrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
38238bd17e5fSmrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
38248bd17e5fSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
38258bd17e5fSmrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
38268bd17e5fSmrg    lt_cv_path_mainfest_tool=yes
38278bd17e5fSmrg  fi
38288bd17e5fSmrg  rm -f conftest*])
38293169be4bSmrgif test yes != "$lt_cv_path_mainfest_tool"; then
38308bd17e5fSmrg  MANIFEST_TOOL=:
38318bd17e5fSmrgfi
38328bd17e5fSmrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
38338bd17e5fSmrg])# _LT_PATH_MANIFEST_TOOL
3834706b6b52Smrg
3835706b6b52Smrg
38363169be4bSmrg# _LT_DLL_DEF_P([FILE])
38373169be4bSmrg# ---------------------
38383169be4bSmrg# True iff FILE is a Windows DLL '.def' file.
38393169be4bSmrg# Keep in sync with func_dll_def_p in the libtool script
38403169be4bSmrgAC_DEFUN([_LT_DLL_DEF_P],
38413169be4bSmrg[dnl
38423169be4bSmrg  test DEF = "`$SED -n dnl
38433169be4bSmrg    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
38443169be4bSmrg    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
38453169be4bSmrg    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
38463169be4bSmrg    -e q dnl                          Only consider the first "real" line
38473169be4bSmrg    $1`" dnl
38483169be4bSmrg])# _LT_DLL_DEF_P
38493169be4bSmrg
38503169be4bSmrg
38518bd17e5fSmrg# LT_LIB_M
38528bd17e5fSmrg# --------
38538bd17e5fSmrg# check for math library
38548bd17e5fSmrgAC_DEFUN([LT_LIB_M],
38558bd17e5fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
38568bd17e5fSmrgLIBM=
38578bd17e5fSmrgcase $host in
38588bd17e5fSmrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
38598bd17e5fSmrg  # These system don't have libm, or don't need it
38608bd17e5fSmrg  ;;
38618bd17e5fSmrg*-ncr-sysv4.3*)
38623169be4bSmrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
38638bd17e5fSmrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
38648bd17e5fSmrg  ;;
38658bd17e5fSmrg*)
38663169be4bSmrg  AC_CHECK_LIB(m, cos, LIBM=-lm)
38678bd17e5fSmrg  ;;
38688bd17e5fSmrgesac
38698bd17e5fSmrgAC_SUBST([LIBM])
38708bd17e5fSmrg])# LT_LIB_M
3871b042e37fSmrg
38728bd17e5fSmrg# Old name:
38738bd17e5fSmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
38748bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
38758bd17e5fSmrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3876b042e37fSmrg
3877b042e37fSmrg
38788bd17e5fSmrg# _LT_COMPILER_NO_RTTI([TAGNAME])
38798bd17e5fSmrg# -------------------------------
38808bd17e5fSmrgm4_defun([_LT_COMPILER_NO_RTTI],
38818bd17e5fSmrg[m4_require([_LT_TAG_COMPILER])dnl
3882b042e37fSmrg
38838bd17e5fSmrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3884b042e37fSmrg
38853169be4bSmrgif test yes = "$GCC"; then
38868bd17e5fSmrg  case $cc_basename in
38878bd17e5fSmrg  nvcc*)
38888bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
38898bd17e5fSmrg  *)
38908bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
38918bd17e5fSmrg  esac
38928bd17e5fSmrg
38938bd17e5fSmrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
38948bd17e5fSmrg    lt_cv_prog_compiler_rtti_exceptions,
38958bd17e5fSmrg    [-fno-rtti -fno-exceptions], [],
38968bd17e5fSmrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
38978bd17e5fSmrgfi
38988bd17e5fSmrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
38998bd17e5fSmrg	[Compiler flag to turn off builtin functions])
39008bd17e5fSmrg])# _LT_COMPILER_NO_RTTI
3901b042e37fSmrg
3902b042e37fSmrg
39038bd17e5fSmrg# _LT_CMD_GLOBAL_SYMBOLS
39048bd17e5fSmrg# ----------------------
39058bd17e5fSmrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
39068bd17e5fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
39078bd17e5fSmrgAC_REQUIRE([AC_PROG_CC])dnl
39088bd17e5fSmrgAC_REQUIRE([AC_PROG_AWK])dnl
39098bd17e5fSmrgAC_REQUIRE([LT_PATH_NM])dnl
39108bd17e5fSmrgAC_REQUIRE([LT_PATH_LD])dnl
39118bd17e5fSmrgm4_require([_LT_DECL_SED])dnl
39128bd17e5fSmrgm4_require([_LT_DECL_EGREP])dnl
39138bd17e5fSmrgm4_require([_LT_TAG_COMPILER])dnl
39140597fb56Smrg
39158bd17e5fSmrg# Check for command to grab the raw symbol name followed by C symbol from nm.
39168bd17e5fSmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
39178bd17e5fSmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
39188bd17e5fSmrg[
39198bd17e5fSmrg# These are sane defaults that work on at least a few old systems.
39208bd17e5fSmrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3921b042e37fSmrg
39228bd17e5fSmrg# Character class describing NM global symbol codes.
39238bd17e5fSmrgsymcode='[[BCDEGRST]]'
3924b042e37fSmrg
39258bd17e5fSmrg# Regexp to match symbols that can be accessed directly from C.
39268bd17e5fSmrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3927b042e37fSmrg
39288bd17e5fSmrg# Define system-specific variables.
39298bd17e5fSmrgcase $host_os in
39308bd17e5fSmrgaix*)
39318bd17e5fSmrg  symcode='[[BCDT]]'
39328bd17e5fSmrg  ;;
39338bd17e5fSmrgcygwin* | mingw* | pw32* | cegcc*)
39348bd17e5fSmrg  symcode='[[ABCDGISTW]]'
39358bd17e5fSmrg  ;;
39368bd17e5fSmrghpux*)
39373169be4bSmrg  if test ia64 = "$host_cpu"; then
39388bd17e5fSmrg    symcode='[[ABCDEGRST]]'
39398bd17e5fSmrg  fi
39408bd17e5fSmrg  ;;
39418bd17e5fSmrgirix* | nonstopux*)
39428bd17e5fSmrg  symcode='[[BCDEGRST]]'
39438bd17e5fSmrg  ;;
39448bd17e5fSmrgosf*)
39458bd17e5fSmrg  symcode='[[BCDEGQRST]]'
39468bd17e5fSmrg  ;;
39478bd17e5fSmrgsolaris*)
39488bd17e5fSmrg  symcode='[[BDRT]]'
39498bd17e5fSmrg  ;;
39508bd17e5fSmrgsco3.2v5*)
39518bd17e5fSmrg  symcode='[[DT]]'
39528bd17e5fSmrg  ;;
39538bd17e5fSmrgsysv4.2uw2*)
39548bd17e5fSmrg  symcode='[[DT]]'
39558bd17e5fSmrg  ;;
39568bd17e5fSmrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
39578bd17e5fSmrg  symcode='[[ABDT]]'
39588bd17e5fSmrg  ;;
39598bd17e5fSmrgsysv4)
39608bd17e5fSmrg  symcode='[[DFNSTU]]'
39618bd17e5fSmrg  ;;
39628bd17e5fSmrgesac
3963b042e37fSmrg
39648bd17e5fSmrg# If we're using GNU nm, then use its standard symbol codes.
39658bd17e5fSmrgcase `$NM -V 2>&1` in
39668bd17e5fSmrg*GNU* | *'with BFD'*)
39678bd17e5fSmrg  symcode='[[ABCDGIRSTW]]' ;;
39688bd17e5fSmrgesac
3969b042e37fSmrg
39703169be4bSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
39713169be4bSmrg  # Gets list of data symbols to import.
39723169be4bSmrg  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
39733169be4bSmrg  # Adjust the below global symbol transforms to fixup imported variables.
39743169be4bSmrg  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
39753169be4bSmrg  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
39763169be4bSmrg  lt_c_name_lib_hook="\
39773169be4bSmrg  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
39783169be4bSmrg  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
39793169be4bSmrgelse
39803169be4bSmrg  # Disable hooks by default.
39813169be4bSmrg  lt_cv_sys_global_symbol_to_import=
39823169be4bSmrg  lt_cdecl_hook=
39833169be4bSmrg  lt_c_name_hook=
39843169be4bSmrg  lt_c_name_lib_hook=
39853169be4bSmrgfi
39863169be4bSmrg
39878bd17e5fSmrg# Transform an extracted symbol line into a proper C declaration.
39888bd17e5fSmrg# Some systems (esp. on ia64) link data and code symbols differently,
39898bd17e5fSmrg# so use this general approach.
39903169be4bSmrglt_cv_sys_global_symbol_to_cdecl="sed -n"\
39913169be4bSmrg$lt_cdecl_hook\
39923169be4bSmrg" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
39933169be4bSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
3994b042e37fSmrg
39958bd17e5fSmrg# Transform an extracted symbol line into symbol name and symbol address
39963169be4bSmrglt_cv_sys_global_symbol_to_c_name_address="sed -n"\
39973169be4bSmrg$lt_c_name_hook\
39983169be4bSmrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
39993169be4bSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
40003169be4bSmrg
40013169be4bSmrg# Transform an extracted symbol line into symbol name with lib prefix and
40023169be4bSmrg# symbol address.
40033169be4bSmrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
40043169be4bSmrg$lt_c_name_lib_hook\
40053169be4bSmrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
40063169be4bSmrg" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
40073169be4bSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
4008b042e37fSmrg
40098bd17e5fSmrg# Handle CRLF in mingw tool chain
40108bd17e5fSmrgopt_cr=
40118bd17e5fSmrgcase $build_os in
40128bd17e5fSmrgmingw*)
40138bd17e5fSmrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
40148bd17e5fSmrg  ;;
40158bd17e5fSmrgesac
4016b042e37fSmrg
40178bd17e5fSmrg# Try without a prefix underscore, then with it.
40188bd17e5fSmrgfor ac_symprfx in "" "_"; do
4019b042e37fSmrg
40208bd17e5fSmrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
40218bd17e5fSmrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
40228bd17e5fSmrg
40238bd17e5fSmrg  # Write the raw and C identifiers.
40248bd17e5fSmrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
40253169be4bSmrg    # Fake it for dumpbin and say T for any non-static function,
40263169be4bSmrg    # D for any global variable and I for any imported variable.
40278bd17e5fSmrg    # Also find C++ and __fastcall symbols from MSVC++,
40288bd17e5fSmrg    # which start with @ or ?.
40298bd17e5fSmrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
40308bd17e5fSmrg"     {last_section=section; section=\$ 3};"\
40318bd17e5fSmrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
40328bd17e5fSmrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
40333169be4bSmrg"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
40343169be4bSmrg"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
40353169be4bSmrg"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
40368bd17e5fSmrg"     \$ 0!~/External *\|/{next};"\
40378bd17e5fSmrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
40388bd17e5fSmrg"     {if(hide[section]) next};"\
40393169be4bSmrg"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
40403169be4bSmrg"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
40413169be4bSmrg"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
40423169be4bSmrg"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
40438bd17e5fSmrg"     ' prfx=^$ac_symprfx]"
40448bd17e5fSmrg  else
40458bd17e5fSmrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
40468bd17e5fSmrg  fi
40478bd17e5fSmrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4048b042e37fSmrg
40498bd17e5fSmrg  # Check to see that the pipe works correctly.
40508bd17e5fSmrg  pipe_works=no
4051b042e37fSmrg
40528bd17e5fSmrg  rm -f conftest*
40538bd17e5fSmrg  cat > conftest.$ac_ext <<_LT_EOF
40548bd17e5fSmrg#ifdef __cplusplus
40558bd17e5fSmrgextern "C" {
40568bd17e5fSmrg#endif
40578bd17e5fSmrgchar nm_test_var;
40588bd17e5fSmrgvoid nm_test_func(void);
40598bd17e5fSmrgvoid nm_test_func(void){}
40608bd17e5fSmrg#ifdef __cplusplus
40618bd17e5fSmrg}
40628bd17e5fSmrg#endif
40638bd17e5fSmrgint main(){nm_test_var='a';nm_test_func();return(0);}
40648bd17e5fSmrg_LT_EOF
4065b042e37fSmrg
40668bd17e5fSmrg  if AC_TRY_EVAL(ac_compile); then
40678bd17e5fSmrg    # Now try to grab the symbols.
40688bd17e5fSmrg    nlist=conftest.nm
40698bd17e5fSmrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
40708bd17e5fSmrg      # Try sorting and uniquifying the output.
40718bd17e5fSmrg      if sort "$nlist" | uniq > "$nlist"T; then
40728bd17e5fSmrg	mv -f "$nlist"T "$nlist"
40730597fb56Smrg      else
40748bd17e5fSmrg	rm -f "$nlist"T
40750597fb56Smrg      fi
4076b042e37fSmrg
40778bd17e5fSmrg      # Make sure that we snagged all the symbols we need.
40788bd17e5fSmrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
40798bd17e5fSmrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
40808bd17e5fSmrg	  cat <<_LT_EOF > conftest.$ac_ext
40818bd17e5fSmrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
40823169be4bSmrg#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
40833169be4bSmrg/* DATA imports from DLLs on WIN32 can't be const, because runtime
40848bd17e5fSmrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
40858bd17e5fSmrg# define LT@&t@_DLSYM_CONST
40863169be4bSmrg#elif defined __osf__
40878bd17e5fSmrg/* This system does not cope well with relocations in const data.  */
40888bd17e5fSmrg# define LT@&t@_DLSYM_CONST
40898bd17e5fSmrg#else
40908bd17e5fSmrg# define LT@&t@_DLSYM_CONST const
40918bd17e5fSmrg#endif
4092b042e37fSmrg
40938bd17e5fSmrg#ifdef __cplusplus
40948bd17e5fSmrgextern "C" {
40958bd17e5fSmrg#endif
4096b042e37fSmrg
40978bd17e5fSmrg_LT_EOF
40988bd17e5fSmrg	  # Now generate the symbol file.
40998bd17e5fSmrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4100b042e37fSmrg
41018bd17e5fSmrg	  cat <<_LT_EOF >> conftest.$ac_ext
41028bd17e5fSmrg
41038bd17e5fSmrg/* The mapping between symbol names and symbols.  */
41048bd17e5fSmrgLT@&t@_DLSYM_CONST struct {
41058bd17e5fSmrg  const char *name;
41068bd17e5fSmrg  void       *address;
41078bd17e5fSmrg}
41088bd17e5fSmrglt__PROGRAM__LTX_preloaded_symbols[[]] =
41098bd17e5fSmrg{
41108bd17e5fSmrg  { "@PROGRAM@", (void *) 0 },
41118bd17e5fSmrg_LT_EOF
41123169be4bSmrg	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
41138bd17e5fSmrg	  cat <<\_LT_EOF >> conftest.$ac_ext
41148bd17e5fSmrg  {0, (void *) 0}
41158bd17e5fSmrg};
41168bd17e5fSmrg
41178bd17e5fSmrg/* This works around a problem in FreeBSD linker */
41188bd17e5fSmrg#ifdef FREEBSD_WORKAROUND
41198bd17e5fSmrgstatic const void *lt_preloaded_setup() {
41208bd17e5fSmrg  return lt__PROGRAM__LTX_preloaded_symbols;
41218bd17e5fSmrg}
41228bd17e5fSmrg#endif
41238bd17e5fSmrg
41248bd17e5fSmrg#ifdef __cplusplus
41258bd17e5fSmrg}
41268bd17e5fSmrg#endif
41278bd17e5fSmrg_LT_EOF
41288bd17e5fSmrg	  # Now try linking the two files.
41298bd17e5fSmrg	  mv conftest.$ac_objext conftstm.$ac_objext
41308bd17e5fSmrg	  lt_globsym_save_LIBS=$LIBS
41318bd17e5fSmrg	  lt_globsym_save_CFLAGS=$CFLAGS
41323169be4bSmrg	  LIBS=conftstm.$ac_objext
41338bd17e5fSmrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
41343169be4bSmrg	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
41358bd17e5fSmrg	    pipe_works=yes
41368bd17e5fSmrg	  fi
41378bd17e5fSmrg	  LIBS=$lt_globsym_save_LIBS
41388bd17e5fSmrg	  CFLAGS=$lt_globsym_save_CFLAGS
41390597fb56Smrg	else
41408bd17e5fSmrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
41410597fb56Smrg	fi
41420597fb56Smrg      else
41438bd17e5fSmrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
41448bd17e5fSmrg      fi
41458bd17e5fSmrg    else
41468bd17e5fSmrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
41478bd17e5fSmrg    fi
41488bd17e5fSmrg  else
41498bd17e5fSmrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
41508bd17e5fSmrg    cat conftest.$ac_ext >&5
41518bd17e5fSmrg  fi
41528bd17e5fSmrg  rm -rf conftest* conftst*
41538bd17e5fSmrg
41548bd17e5fSmrg  # Do not use the global_symbol_pipe unless it works.
41553169be4bSmrg  if test yes = "$pipe_works"; then
41568bd17e5fSmrg    break
41578bd17e5fSmrg  else
41588bd17e5fSmrg    lt_cv_sys_global_symbol_pipe=
41598bd17e5fSmrg  fi
41608bd17e5fSmrgdone
41618bd17e5fSmrg])
41628bd17e5fSmrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
41638bd17e5fSmrg  lt_cv_sys_global_symbol_to_cdecl=
41648bd17e5fSmrgfi
41658bd17e5fSmrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
41668bd17e5fSmrg  AC_MSG_RESULT(failed)
41678bd17e5fSmrgelse
41688bd17e5fSmrg  AC_MSG_RESULT(ok)
41698bd17e5fSmrgfi
41708bd17e5fSmrg
41718bd17e5fSmrg# Response file support.
41728bd17e5fSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
41738bd17e5fSmrg  nm_file_list_spec='@'
41748bd17e5fSmrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
41758bd17e5fSmrg  nm_file_list_spec='@'
41768bd17e5fSmrgfi
41778bd17e5fSmrg
41788bd17e5fSmrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
41798bd17e5fSmrg    [Take the output of nm and produce a listing of raw symbols and C names])
41808bd17e5fSmrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
41818bd17e5fSmrg    [Transform the output of nm in a proper C declaration])
41823169be4bSmrg_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
41833169be4bSmrg    [Transform the output of nm into a list of symbols to manually relocate])
41848bd17e5fSmrg_LT_DECL([global_symbol_to_c_name_address],
41858bd17e5fSmrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
41868bd17e5fSmrg    [Transform the output of nm in a C name address pair])
41878bd17e5fSmrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
41888bd17e5fSmrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
41898bd17e5fSmrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
41903169be4bSmrg_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
41913169be4bSmrg    [The name lister interface])
41928bd17e5fSmrg_LT_DECL([], [nm_file_list_spec], [1],
41938bd17e5fSmrg    [Specify filename containing input files for $NM])
41948bd17e5fSmrg]) # _LT_CMD_GLOBAL_SYMBOLS
41958bd17e5fSmrg
41968bd17e5fSmrg
41978bd17e5fSmrg# _LT_COMPILER_PIC([TAGNAME])
41988bd17e5fSmrg# ---------------------------
41998bd17e5fSmrgm4_defun([_LT_COMPILER_PIC],
42008bd17e5fSmrg[m4_require([_LT_TAG_COMPILER])dnl
42018bd17e5fSmrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
42028bd17e5fSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
42038bd17e5fSmrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
42048bd17e5fSmrg
42058bd17e5fSmrgm4_if([$1], [CXX], [
42068bd17e5fSmrg  # C++ specific cases for pic, static, wl, etc.
42073169be4bSmrg  if test yes = "$GXX"; then
42088bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
42098bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
42108bd17e5fSmrg
42118bd17e5fSmrg    case $host_os in
42128bd17e5fSmrg    aix*)
42138bd17e5fSmrg      # All AIX code is PIC.
42143169be4bSmrg      if test ia64 = "$host_cpu"; then
42158bd17e5fSmrg	# AIX 5 now supports IA64 processor
42168bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
42170597fb56Smrg      fi
42183169be4bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42190597fb56Smrg      ;;
4220b042e37fSmrg
42218bd17e5fSmrg    amigaos*)
42228bd17e5fSmrg      case $host_cpu in
42238bd17e5fSmrg      powerpc)
42248bd17e5fSmrg            # see comment about AmigaOS4 .so support
42258bd17e5fSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42268bd17e5fSmrg        ;;
42278bd17e5fSmrg      m68k)
42288bd17e5fSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
42293169be4bSmrg            # adding the '-m68020' flag to GCC prevents building anything better,
42303169be4bSmrg            # like '-m68040'.
42318bd17e5fSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
42328bd17e5fSmrg        ;;
42338bd17e5fSmrg      esac
42340597fb56Smrg      ;;
4235b042e37fSmrg
42368bd17e5fSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
42378bd17e5fSmrg      # PIC is the default for these OSes.
42380597fb56Smrg      ;;
42398bd17e5fSmrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
42408bd17e5fSmrg      # This hack is so that the source file can tell whether it is being
42418bd17e5fSmrg      # built for inclusion in a dll (and should export symbols for example).
42428bd17e5fSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
42438bd17e5fSmrg      # (--disable-auto-import) libraries
42448bd17e5fSmrg      m4_if([$1], [GCJ], [],
42458bd17e5fSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
42463169be4bSmrg      case $host_os in
42473169be4bSmrg      os2*)
42483169be4bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
42493169be4bSmrg	;;
42503169be4bSmrg      esac
42518bd17e5fSmrg      ;;
42528bd17e5fSmrg    darwin* | rhapsody*)
42538bd17e5fSmrg      # PIC is the default on this platform
42548bd17e5fSmrg      # Common symbols not allowed in MH_DYLIB files
42558bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
42568bd17e5fSmrg      ;;
42578bd17e5fSmrg    *djgpp*)
42588bd17e5fSmrg      # DJGPP does not support shared libraries at all
42598bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
42608bd17e5fSmrg      ;;
42618bd17e5fSmrg    haiku*)
42628bd17e5fSmrg      # PIC is the default for Haiku.
42638bd17e5fSmrg      # The "-static" flag exists, but is broken.
42648bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
42658bd17e5fSmrg      ;;
42668bd17e5fSmrg    interix[[3-9]]*)
42678bd17e5fSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
42688bd17e5fSmrg      # Instead, we relocate shared libraries at runtime.
42698bd17e5fSmrg      ;;
42708bd17e5fSmrg    sysv4*MP*)
42718bd17e5fSmrg      if test -d /usr/nec; then
42728bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
42730597fb56Smrg      fi
42740597fb56Smrg      ;;
42758bd17e5fSmrg    hpux*)
42768bd17e5fSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
42778bd17e5fSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
42788bd17e5fSmrg      # sets the default TLS model and affects inlining.
42798bd17e5fSmrg      case $host_cpu in
42808bd17e5fSmrg      hppa*64*)
42818bd17e5fSmrg	;;
42828bd17e5fSmrg      *)
42838bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42848bd17e5fSmrg	;;
42858bd17e5fSmrg      esac
42868bd17e5fSmrg      ;;
42878bd17e5fSmrg    *qnx* | *nto*)
42888bd17e5fSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
42898bd17e5fSmrg      # it will coredump.
42908bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
42918bd17e5fSmrg      ;;
42928bd17e5fSmrg    *)
42938bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42948bd17e5fSmrg      ;;
42958bd17e5fSmrg    esac
42968bd17e5fSmrg  else
42978bd17e5fSmrg    case $host_os in
42988bd17e5fSmrg      aix[[4-9]]*)
42998bd17e5fSmrg	# All AIX code is PIC.
43003169be4bSmrg	if test ia64 = "$host_cpu"; then
43018bd17e5fSmrg	  # AIX 5 now supports IA64 processor
43028bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
43038bd17e5fSmrg	else
43048bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
43058bd17e5fSmrg	fi
43068bd17e5fSmrg	;;
43078bd17e5fSmrg      chorus*)
43088bd17e5fSmrg	case $cc_basename in
43098bd17e5fSmrg	cxch68*)
43108bd17e5fSmrg	  # Green Hills C++ Compiler
43118bd17e5fSmrg	  # _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"
43120597fb56Smrg	  ;;
43130597fb56Smrg	esac
43140597fb56Smrg	;;
43158bd17e5fSmrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
43168bd17e5fSmrg	# This hack is so that the source file can tell whether it is being
43178bd17e5fSmrg	# built for inclusion in a dll (and should export symbols for example).
43188bd17e5fSmrg	m4_if([$1], [GCJ], [],
43198bd17e5fSmrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
43208bd17e5fSmrg	;;
43218bd17e5fSmrg      dgux*)
43228bd17e5fSmrg	case $cc_basename in
43238bd17e5fSmrg	  ec++*)
43248bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
43258bd17e5fSmrg	    ;;
43268bd17e5fSmrg	  ghcx*)
43278bd17e5fSmrg	    # Green Hills C++ Compiler
43288bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
43298bd17e5fSmrg	    ;;
43308bd17e5fSmrg	  *)
43318bd17e5fSmrg	    ;;
43328bd17e5fSmrg	esac
43338bd17e5fSmrg	;;
43348bd17e5fSmrg      freebsd* | dragonfly*)
43358bd17e5fSmrg	# FreeBSD uses GNU C++
43368bd17e5fSmrg	;;
43378bd17e5fSmrg      hpux9* | hpux10* | hpux11*)
43388bd17e5fSmrg	case $cc_basename in
43398bd17e5fSmrg	  CC*)
43408bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43413169be4bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
43423169be4bSmrg	    if test ia64 != "$host_cpu"; then
43438bd17e5fSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
43448bd17e5fSmrg	    fi
43458bd17e5fSmrg	    ;;
43468bd17e5fSmrg	  aCC*)
43478bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43483169be4bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
43498bd17e5fSmrg	    case $host_cpu in
43508bd17e5fSmrg	    hppa*64*|ia64*)
43518bd17e5fSmrg	      # +Z the default
43528bd17e5fSmrg	      ;;
43538bd17e5fSmrg	    *)
43548bd17e5fSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
43558bd17e5fSmrg	      ;;
43568bd17e5fSmrg	    esac
43578bd17e5fSmrg	    ;;
43588bd17e5fSmrg	  *)
43598bd17e5fSmrg	    ;;
43608bd17e5fSmrg	esac
43618bd17e5fSmrg	;;
43628bd17e5fSmrg      interix*)
43638bd17e5fSmrg	# This is c89, which is MS Visual C++ (no shared libs)
43648bd17e5fSmrg	# Anyone wants to do a port?
43658bd17e5fSmrg	;;
43668bd17e5fSmrg      irix5* | irix6* | nonstopux*)
43678bd17e5fSmrg	case $cc_basename in
43688bd17e5fSmrg	  CC*)
43698bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43708bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
43718bd17e5fSmrg	    # CC pic flag -KPIC is the default.
43728bd17e5fSmrg	    ;;
43738bd17e5fSmrg	  *)
43748bd17e5fSmrg	    ;;
43758bd17e5fSmrg	esac
43768bd17e5fSmrg	;;
4377b242714cSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
43788bd17e5fSmrg	case $cc_basename in
43798bd17e5fSmrg	  KCC*)
43808bd17e5fSmrg	    # KAI C++ Compiler
43818bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
43828bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
43838bd17e5fSmrg	    ;;
43848bd17e5fSmrg	  ecpc* )
43853169be4bSmrg	    # old Intel C++ for x86_64, which still supported -KPIC.
43868bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43878bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
43888bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
43898bd17e5fSmrg	    ;;
43908bd17e5fSmrg	  icpc* )
43918bd17e5fSmrg	    # Intel C++, used to be incompatible with GCC.
43928bd17e5fSmrg	    # ICC 10 doesn't accept -KPIC any more.
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)='-static'
43968bd17e5fSmrg	    ;;
43978bd17e5fSmrg	  pgCC* | pgcpp*)
43988bd17e5fSmrg	    # Portland Group C++ compiler
43998bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44008bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
44018bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44028bd17e5fSmrg	    ;;
44038bd17e5fSmrg	  cxx*)
44048bd17e5fSmrg	    # Compaq C++
44058bd17e5fSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
44068bd17e5fSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
44078bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
44088bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
44098bd17e5fSmrg	    ;;
44108bd17e5fSmrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
44118bd17e5fSmrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
44128bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44138bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
44148bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
44158bd17e5fSmrg	    ;;
44168bd17e5fSmrg	  *)
44178bd17e5fSmrg	    case `$CC -V 2>&1 | sed 5q` in
44188bd17e5fSmrg	    *Sun\ C*)
44198bd17e5fSmrg	      # Sun C++ 5.9
44208bd17e5fSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44218bd17e5fSmrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44228bd17e5fSmrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
44238bd17e5fSmrg	      ;;
44248bd17e5fSmrg	    esac
44258bd17e5fSmrg	    ;;
44268bd17e5fSmrg	esac
44278bd17e5fSmrg	;;
44288bd17e5fSmrg      lynxos*)
44298bd17e5fSmrg	;;
44308bd17e5fSmrg      m88k*)
44318bd17e5fSmrg	;;
44328bd17e5fSmrg      mvs*)
44338bd17e5fSmrg	case $cc_basename in
44348bd17e5fSmrg	  cxx*)
44358bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
44368bd17e5fSmrg	    ;;
44378bd17e5fSmrg	  *)
44388bd17e5fSmrg	    ;;
44398bd17e5fSmrg	esac
44408bd17e5fSmrg	;;
44413169be4bSmrg      netbsd*)
44420597fb56Smrg	;;
44438bd17e5fSmrg      *qnx* | *nto*)
44448bd17e5fSmrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
44458bd17e5fSmrg        # it will coredump.
44468bd17e5fSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
44470597fb56Smrg        ;;
44488bd17e5fSmrg      osf3* | osf4* | osf5*)
44498bd17e5fSmrg	case $cc_basename in
44508bd17e5fSmrg	  KCC*)
44518bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
44528bd17e5fSmrg	    ;;
44538bd17e5fSmrg	  RCC*)
44548bd17e5fSmrg	    # Rational C++ 2.4.1
44558bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
44568bd17e5fSmrg	    ;;
44578bd17e5fSmrg	  cxx*)
44588bd17e5fSmrg	    # Digital/Compaq C++
44598bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44608bd17e5fSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
44618bd17e5fSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
44628bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
44638bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
44648bd17e5fSmrg	    ;;
44658bd17e5fSmrg	  *)
44668bd17e5fSmrg	    ;;
44678bd17e5fSmrg	esac
44680597fb56Smrg	;;
44698bd17e5fSmrg      psos*)
44708bd17e5fSmrg	;;
44718bd17e5fSmrg      solaris*)
44728bd17e5fSmrg	case $cc_basename in
44738bd17e5fSmrg	  CC* | sunCC*)
44748bd17e5fSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
44758bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44768bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44778bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
44788bd17e5fSmrg	    ;;
44798bd17e5fSmrg	  gcx*)
44808bd17e5fSmrg	    # Green Hills C++ Compiler
44818bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
44828bd17e5fSmrg	    ;;
44838bd17e5fSmrg	  *)
44848bd17e5fSmrg	    ;;
44858bd17e5fSmrg	esac
44868bd17e5fSmrg	;;
44878bd17e5fSmrg      sunos4*)
44888bd17e5fSmrg	case $cc_basename in
44898bd17e5fSmrg	  CC*)
44908bd17e5fSmrg	    # Sun C++ 4.x
44918bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
44928bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44938bd17e5fSmrg	    ;;
44948bd17e5fSmrg	  lcc*)
44958bd17e5fSmrg	    # Lucid
44968bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
44978bd17e5fSmrg	    ;;
44988bd17e5fSmrg	  *)
44998bd17e5fSmrg	    ;;
45008bd17e5fSmrg	esac
45018bd17e5fSmrg	;;
45028bd17e5fSmrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
45038bd17e5fSmrg	case $cc_basename in
45048bd17e5fSmrg	  CC*)
45058bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
45068bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
45078bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
45088bd17e5fSmrg	    ;;
45098bd17e5fSmrg	esac
45108bd17e5fSmrg	;;
45118bd17e5fSmrg      tandem*)
45128bd17e5fSmrg	case $cc_basename in
45138bd17e5fSmrg	  NCC*)
45148bd17e5fSmrg	    # NonStop-UX NCC 3.20
45158bd17e5fSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
45168bd17e5fSmrg	    ;;
45178bd17e5fSmrg	  *)
45188bd17e5fSmrg	    ;;
45198bd17e5fSmrg	esac
45208bd17e5fSmrg	;;
45218bd17e5fSmrg      vxworks*)
45228bd17e5fSmrg	;;
45238bd17e5fSmrg      *)
45248bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
45250597fb56Smrg	;;
45268c4a8e55Smrg    esac
45278c4a8e55Smrg  fi
45288bd17e5fSmrg],
45298bd17e5fSmrg[
45303169be4bSmrg  if test yes = "$GCC"; then
45318bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
45328bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4533b042e37fSmrg
45348bd17e5fSmrg    case $host_os in
45358bd17e5fSmrg      aix*)
45368bd17e5fSmrg      # All AIX code is PIC.
45373169be4bSmrg      if test ia64 = "$host_cpu"; then
45388bd17e5fSmrg	# AIX 5 now supports IA64 processor
45398bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
45408bd17e5fSmrg      fi
45413169be4bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
45428bd17e5fSmrg      ;;
45430597fb56Smrg
45448bd17e5fSmrg    amigaos*)
45458bd17e5fSmrg      case $host_cpu in
45468bd17e5fSmrg      powerpc)
45478bd17e5fSmrg            # see comment about AmigaOS4 .so support
45488bd17e5fSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
45498bd17e5fSmrg        ;;
45508bd17e5fSmrg      m68k)
45518bd17e5fSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
45523169be4bSmrg            # adding the '-m68020' flag to GCC prevents building anything better,
45533169be4bSmrg            # like '-m68040'.
45548bd17e5fSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
45558bd17e5fSmrg        ;;
45568bd17e5fSmrg      esac
45578bd17e5fSmrg      ;;
4558b042e37fSmrg
45598bd17e5fSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
45608bd17e5fSmrg      # PIC is the default for these OSes.
45618bd17e5fSmrg      ;;
4562b042e37fSmrg
45638bd17e5fSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
45648bd17e5fSmrg      # This hack is so that the source file can tell whether it is being
45658bd17e5fSmrg      # built for inclusion in a dll (and should export symbols for example).
45668bd17e5fSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
45678bd17e5fSmrg      # (--disable-auto-import) libraries
45688bd17e5fSmrg      m4_if([$1], [GCJ], [],
45698bd17e5fSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
45703169be4bSmrg      case $host_os in
45713169be4bSmrg      os2*)
45723169be4bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
45733169be4bSmrg	;;
45743169be4bSmrg      esac
45758bd17e5fSmrg      ;;
45768c4a8e55Smrg
45778bd17e5fSmrg    darwin* | rhapsody*)
45788bd17e5fSmrg      # PIC is the default on this platform
45798bd17e5fSmrg      # Common symbols not allowed in MH_DYLIB files
45808bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
45818bd17e5fSmrg      ;;
4582b042e37fSmrg
45838bd17e5fSmrg    haiku*)
45848bd17e5fSmrg      # PIC is the default for Haiku.
45858bd17e5fSmrg      # The "-static" flag exists, but is broken.
45868bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
45878bd17e5fSmrg      ;;
4588b042e37fSmrg
45898bd17e5fSmrg    hpux*)
45908bd17e5fSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
45918bd17e5fSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
45928bd17e5fSmrg      # sets the default TLS model and affects inlining.
45938bd17e5fSmrg      case $host_cpu in
45948bd17e5fSmrg      hppa*64*)
45958bd17e5fSmrg	# +Z the default
45968bd17e5fSmrg	;;
45978bd17e5fSmrg      *)
45988bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
45998bd17e5fSmrg	;;
46008bd17e5fSmrg      esac
46018bd17e5fSmrg      ;;
46028c4a8e55Smrg
46038bd17e5fSmrg    interix[[3-9]]*)
46048bd17e5fSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
46058bd17e5fSmrg      # Instead, we relocate shared libraries at runtime.
46068bd17e5fSmrg      ;;
46078c4a8e55Smrg
46088bd17e5fSmrg    msdosdjgpp*)
46098bd17e5fSmrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
46108bd17e5fSmrg      # on systems that don't support them.
46118bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
46128bd17e5fSmrg      enable_shared=no
46138bd17e5fSmrg      ;;
46148c4a8e55Smrg
46158bd17e5fSmrg    *nto* | *qnx*)
46168bd17e5fSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
46178bd17e5fSmrg      # it will coredump.
46188bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
46198bd17e5fSmrg      ;;
46208c4a8e55Smrg
46218bd17e5fSmrg    sysv4*MP*)
46228bd17e5fSmrg      if test -d /usr/nec; then
46238bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
46248bd17e5fSmrg      fi
46258bd17e5fSmrg      ;;
46268c4a8e55Smrg
46278bd17e5fSmrg    *)
46288bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
46298bd17e5fSmrg      ;;
46308bd17e5fSmrg    esac
46318bd17e5fSmrg
46328bd17e5fSmrg    case $cc_basename in
46338bd17e5fSmrg    nvcc*) # Cuda Compiler Driver 2.2
46348bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
46358bd17e5fSmrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
46368bd17e5fSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
46378bd17e5fSmrg      fi
46388bd17e5fSmrg      ;;
46398bd17e5fSmrg    esac
46400597fb56Smrg  else
46418bd17e5fSmrg    # PORTME Check for flag to pass linker flags through the system compiler.
46428bd17e5fSmrg    case $host_os in
46438bd17e5fSmrg    aix*)
46448bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
46453169be4bSmrg      if test ia64 = "$host_cpu"; then
46468bd17e5fSmrg	# AIX 5 now supports IA64 processor
46478bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
46488bd17e5fSmrg      else
46498bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
46508bd17e5fSmrg      fi
46518bd17e5fSmrg      ;;
4652b042e37fSmrg
46533169be4bSmrg    darwin* | rhapsody*)
46543169be4bSmrg      # PIC is the default on this platform
46553169be4bSmrg      # Common symbols not allowed in MH_DYLIB files
46563169be4bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
46573169be4bSmrg      case $cc_basename in
46583169be4bSmrg      nagfor*)
46593169be4bSmrg        # NAG Fortran compiler
46603169be4bSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
46613169be4bSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
46623169be4bSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
46633169be4bSmrg        ;;
46643169be4bSmrg      esac
46653169be4bSmrg      ;;
46663169be4bSmrg
46678bd17e5fSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
46688bd17e5fSmrg      # This hack is so that the source file can tell whether it is being
46698bd17e5fSmrg      # built for inclusion in a dll (and should export symbols for example).
46708bd17e5fSmrg      m4_if([$1], [GCJ], [],
46718bd17e5fSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
46723169be4bSmrg      case $host_os in
46733169be4bSmrg      os2*)
46743169be4bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
46753169be4bSmrg	;;
46763169be4bSmrg      esac
46778bd17e5fSmrg      ;;
4678bd23fbfaSmrg
46798bd17e5fSmrg    hpux9* | hpux10* | hpux11*)
46808bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
46818bd17e5fSmrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
46828bd17e5fSmrg      # not for PA HP-UX.
46838bd17e5fSmrg      case $host_cpu in
46848bd17e5fSmrg      hppa*64*|ia64*)
46858bd17e5fSmrg	# +Z the default
46868bd17e5fSmrg	;;
46878bd17e5fSmrg      *)
46888bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
46898bd17e5fSmrg	;;
46908bd17e5fSmrg      esac
46918bd17e5fSmrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
46923169be4bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
46938bd17e5fSmrg      ;;
4694b042e37fSmrg
46958bd17e5fSmrg    irix5* | irix6* | nonstopux*)
46968bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
46978bd17e5fSmrg      # PIC (with -KPIC) is the default.
46988bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
46998bd17e5fSmrg      ;;
4700b042e37fSmrg
4701b242714cSmrg    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
47028bd17e5fSmrg      case $cc_basename in
47033169be4bSmrg      # old Intel for x86_64, which still supported -KPIC.
47048bd17e5fSmrg      ecc*)
47058bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47068bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
47078bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
47088bd17e5fSmrg        ;;
47098bd17e5fSmrg      # icc used to be incompatible with GCC.
47108bd17e5fSmrg      # ICC 10 doesn't accept -KPIC any more.
47118bd17e5fSmrg      icc* | ifort*)
47128bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47138bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
47148bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
47158bd17e5fSmrg        ;;
47168bd17e5fSmrg      # Lahey Fortran 8.1.
47178bd17e5fSmrg      lf95*)
47188bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47198bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
47208bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
47218bd17e5fSmrg	;;
47228bd17e5fSmrg      nagfor*)
47238bd17e5fSmrg	# NAG Fortran compiler
47248bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
47258bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
47268bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47278bd17e5fSmrg	;;
47283169be4bSmrg      tcc*)
47293169be4bSmrg	# Fabrice Bellard et al's Tiny C Compiler
47303169be4bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47313169be4bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
47323169be4bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
47333169be4bSmrg	;;
47348bd17e5fSmrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
47358bd17e5fSmrg        # Portland Group compilers (*not* the Pentium gcc compiler,
47368bd17e5fSmrg	# which looks to be a dead project)
47378bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47388bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
47398bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47408bd17e5fSmrg        ;;
47418bd17e5fSmrg      ccc*)
47428bd17e5fSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47438bd17e5fSmrg        # All Alpha code is PIC.
47448bd17e5fSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
47458bd17e5fSmrg        ;;
47468bd17e5fSmrg      xl* | bgxl* | bgf* | mpixl*)
47478bd17e5fSmrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
47488bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47498bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
47508bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
47518bd17e5fSmrg	;;
47528bd17e5fSmrg      *)
47538bd17e5fSmrg	case `$CC -V 2>&1 | sed 5q` in
47548bd17e5fSmrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
47558bd17e5fSmrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
47568bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
47578bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47588bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
47598bd17e5fSmrg	  ;;
47608bd17e5fSmrg	*Sun\ F* | *Sun*Fortran*)
47618bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
47628bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47638bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
47648bd17e5fSmrg	  ;;
47658bd17e5fSmrg	*Sun\ C*)
47668bd17e5fSmrg	  # Sun C 5.9
47678bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
47688bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47698bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47708bd17e5fSmrg	  ;;
47718bd17e5fSmrg        *Intel*\ [[CF]]*Compiler*)
47728bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47738bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
47748bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
47758bd17e5fSmrg	  ;;
47768bd17e5fSmrg	*Portland\ Group*)
47778bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47788bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
47798bd17e5fSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47808bd17e5fSmrg	  ;;
47818bd17e5fSmrg	esac
47828bd17e5fSmrg	;;
47838bd17e5fSmrg      esac
47848bd17e5fSmrg      ;;
4785b042e37fSmrg
47868bd17e5fSmrg    newsos6)
47878bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
47888bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47898bd17e5fSmrg      ;;
4790b042e37fSmrg
47918bd17e5fSmrg    *nto* | *qnx*)
47928bd17e5fSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
47938bd17e5fSmrg      # it will coredump.
47948bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
47958bd17e5fSmrg      ;;
4796b042e37fSmrg
47978bd17e5fSmrg    osf3* | osf4* | osf5*)
47988bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47998bd17e5fSmrg      # All OSF/1 code is PIC.
48008bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
48018bd17e5fSmrg      ;;
48028bd17e5fSmrg
48038bd17e5fSmrg    rdos*)
48048bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
48058bd17e5fSmrg      ;;
48060597fb56Smrg
48078bd17e5fSmrg    solaris*)
48088bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
48098bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48108bd17e5fSmrg      case $cc_basename in
48118bd17e5fSmrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
48128bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
48138bd17e5fSmrg      *)
48148bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
48158bd17e5fSmrg      esac
48168bd17e5fSmrg      ;;
48170597fb56Smrg
48188bd17e5fSmrg    sunos4*)
48198bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
48208bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
48218bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48228bd17e5fSmrg      ;;
48230597fb56Smrg
48248bd17e5fSmrg    sysv4 | sysv4.2uw2* | sysv4.3*)
48258bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
48268bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
48278bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48288bd17e5fSmrg      ;;
4829b042e37fSmrg
48308bd17e5fSmrg    sysv4*MP*)
48313169be4bSmrg      if test -d /usr/nec; then
48328bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
48338bd17e5fSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48348bd17e5fSmrg      fi
48358bd17e5fSmrg      ;;
4836bd23fbfaSmrg
48378bd17e5fSmrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
48388bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
48398bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
48408bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48418bd17e5fSmrg      ;;
4842b042e37fSmrg
48438bd17e5fSmrg    unicos*)
48448bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
48458bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
48468bd17e5fSmrg      ;;
48478c4a8e55Smrg
48488bd17e5fSmrg    uts4*)
48498bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
48508bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48518bd17e5fSmrg      ;;
48528c4a8e55Smrg
48538bd17e5fSmrg    *)
48548bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
48558bd17e5fSmrg      ;;
48568bd17e5fSmrg    esac
48578bd17e5fSmrg  fi
48588bd17e5fSmrg])
48598bd17e5fSmrgcase $host_os in
48603169be4bSmrg  # For platforms that do not support PIC, -DPIC is meaningless:
48618bd17e5fSmrg  *djgpp*)
48628bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
48638bd17e5fSmrg    ;;
48648bd17e5fSmrg  *)
48658bd17e5fSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
48668bd17e5fSmrg    ;;
48678bd17e5fSmrgesac
4868b042e37fSmrg
48698bd17e5fSmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
48708bd17e5fSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
48718bd17e5fSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
48728bd17e5fSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
48738c4a8e55Smrg
48748bd17e5fSmrg#
48758bd17e5fSmrg# Check to make sure the PIC flag actually works.
48768bd17e5fSmrg#
48778bd17e5fSmrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
48788bd17e5fSmrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
48798bd17e5fSmrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
48808bd17e5fSmrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
48818bd17e5fSmrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
48828bd17e5fSmrg     "" | " "*) ;;
48838bd17e5fSmrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
48848bd17e5fSmrg     esac],
48858bd17e5fSmrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
48868bd17e5fSmrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
48878bd17e5fSmrgfi
48888bd17e5fSmrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
48898bd17e5fSmrg	[Additional compiler flags for building library objects])
48900597fb56Smrg
48918bd17e5fSmrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
48928bd17e5fSmrg	[How to pass a linker flag through the compiler])
48938bd17e5fSmrg#
48948bd17e5fSmrg# Check to make sure the static flag actually works.
48958bd17e5fSmrg#
48968bd17e5fSmrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
48978bd17e5fSmrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
48988bd17e5fSmrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
48998bd17e5fSmrg  $lt_tmp_static_flag,
49008bd17e5fSmrg  [],
49018bd17e5fSmrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
49028bd17e5fSmrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
49038bd17e5fSmrg	[Compiler flag to prevent dynamic linking])
49048bd17e5fSmrg])# _LT_COMPILER_PIC
4905b042e37fSmrg
49060597fb56Smrg
49078bd17e5fSmrg# _LT_LINKER_SHLIBS([TAGNAME])
49088bd17e5fSmrg# ----------------------------
49098bd17e5fSmrg# See if the linker supports building shared libraries.
49108bd17e5fSmrgm4_defun([_LT_LINKER_SHLIBS],
49118bd17e5fSmrg[AC_REQUIRE([LT_PATH_LD])dnl
49128bd17e5fSmrgAC_REQUIRE([LT_PATH_NM])dnl
49138bd17e5fSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
49148bd17e5fSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
49158bd17e5fSmrgm4_require([_LT_DECL_EGREP])dnl
49168bd17e5fSmrgm4_require([_LT_DECL_SED])dnl
49178bd17e5fSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
49188bd17e5fSmrgm4_require([_LT_TAG_COMPILER])dnl
49198bd17e5fSmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
49208bd17e5fSmrgm4_if([$1], [CXX], [
49218bd17e5fSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
49228bd17e5fSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
49238bd17e5fSmrg  case $host_os in
49248bd17e5fSmrg  aix[[4-9]]*)
49258bd17e5fSmrg    # If we're using GNU nm, then we don't want the "-C" option.
49263169be4bSmrg    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
49273169be4bSmrg    # Without the "-l" option, or with the "-B" option, AIX nm treats
49283169be4bSmrg    # weak defined symbols like other global defined symbols, whereas
49293169be4bSmrg    # GNU nm marks them as "W".
49303169be4bSmrg    # While the 'weak' keyword is ignored in the Export File, we need
49313169be4bSmrg    # it in the Import File for the 'aix-soname' feature, so we have
49323169be4bSmrg    # to replace the "-B" option with "-P" for AIX nm.
49338bd17e5fSmrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
49343169be4bSmrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
49358bd17e5fSmrg    else
49363169be4bSmrg      _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
49378bd17e5fSmrg    fi
49388bd17e5fSmrg    ;;
49398bd17e5fSmrg  pw32*)
49403169be4bSmrg    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
49418bd17e5fSmrg    ;;
49428bd17e5fSmrg  cygwin* | mingw* | cegcc*)
49438bd17e5fSmrg    case $cc_basename in
49448bd17e5fSmrg    cl*)
49458bd17e5fSmrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
49468bd17e5fSmrg      ;;
49478bd17e5fSmrg    *)
49488bd17e5fSmrg      _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'
49498bd17e5fSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
49508bd17e5fSmrg      ;;
49518bd17e5fSmrg    esac
49528bd17e5fSmrg    ;;
49538bd17e5fSmrg  *)
49548bd17e5fSmrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
49558bd17e5fSmrg    ;;
49568bd17e5fSmrg  esac
49578bd17e5fSmrg], [
49588bd17e5fSmrg  runpath_var=
49598bd17e5fSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=
49608bd17e5fSmrg  _LT_TAGVAR(always_export_symbols, $1)=no
49618bd17e5fSmrg  _LT_TAGVAR(archive_cmds, $1)=
49628bd17e5fSmrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
49638bd17e5fSmrg  _LT_TAGVAR(compiler_needs_object, $1)=no
49648bd17e5fSmrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
49658bd17e5fSmrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
49668bd17e5fSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
49678bd17e5fSmrg  _LT_TAGVAR(hardcode_automatic, $1)=no
49688bd17e5fSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
49698bd17e5fSmrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
49708bd17e5fSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
49718bd17e5fSmrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
49728bd17e5fSmrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
49738bd17e5fSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
49748bd17e5fSmrg  _LT_TAGVAR(inherit_rpath, $1)=no
49758bd17e5fSmrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
49768bd17e5fSmrg  _LT_TAGVAR(module_cmds, $1)=
49778bd17e5fSmrg  _LT_TAGVAR(module_expsym_cmds, $1)=
49788bd17e5fSmrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
49798bd17e5fSmrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
49808bd17e5fSmrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
49818bd17e5fSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
49828bd17e5fSmrg  # include_expsyms should be a list of space-separated symbols to be *always*
49838bd17e5fSmrg  # included in the symbol list
49848bd17e5fSmrg  _LT_TAGVAR(include_expsyms, $1)=
49858bd17e5fSmrg  # exclude_expsyms can be an extended regexp of symbols to exclude
49863169be4bSmrg  # it will be wrapped by ' (' and ')$', so one must not match beginning or
49873169be4bSmrg  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
49883169be4bSmrg  # as well as any symbol that contains 'd'.
49898bd17e5fSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
49908bd17e5fSmrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
49918bd17e5fSmrg  # platforms (ab)use it in PIC code, but their linkers get confused if
49928bd17e5fSmrg  # the symbol is explicitly referenced.  Since portable code cannot
49938bd17e5fSmrg  # rely on this symbol name, it's probably fine to never include it in
49948bd17e5fSmrg  # preloaded symbol tables.
49958bd17e5fSmrg  # Exclude shared library initialization/finalization symbols.
49968bd17e5fSmrgdnl Note also adjust exclude_expsyms for C++ above.
49978bd17e5fSmrg  extract_expsyms_cmds=
49988bd17e5fSmrg
49998bd17e5fSmrg  case $host_os in
50008bd17e5fSmrg  cygwin* | mingw* | pw32* | cegcc*)
50018bd17e5fSmrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
50028bd17e5fSmrg    # When not using gcc, we currently assume that we are using
50038bd17e5fSmrg    # Microsoft Visual C++.
50043169be4bSmrg    if test yes != "$GCC"; then
50058bd17e5fSmrg      with_gnu_ld=no
50068bd17e5fSmrg    fi
50078bd17e5fSmrg    ;;
50088bd17e5fSmrg  interix*)
50098bd17e5fSmrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
50108bd17e5fSmrg    with_gnu_ld=yes
50118bd17e5fSmrg    ;;
50123169be4bSmrg  openbsd* | bitrig*)
50138bd17e5fSmrg    with_gnu_ld=no
50148bd17e5fSmrg    ;;
50158bd17e5fSmrg  esac
50160597fb56Smrg
50178bd17e5fSmrg  _LT_TAGVAR(ld_shlibs, $1)=yes
50180597fb56Smrg
50198bd17e5fSmrg  # On some targets, GNU ld is compatible enough with the native linker
50208bd17e5fSmrg  # that we're better off using the native interface for both.
50218bd17e5fSmrg  lt_use_gnu_ld_interface=no
50223169be4bSmrg  if test yes = "$with_gnu_ld"; then
50238bd17e5fSmrg    case $host_os in
50248bd17e5fSmrg      aix*)
50258bd17e5fSmrg	# The AIX port of GNU ld has always aspired to compatibility
50268bd17e5fSmrg	# with the native linker.  However, as the warning in the GNU ld
50278bd17e5fSmrg	# block says, versions before 2.19.5* couldn't really create working
50288bd17e5fSmrg	# shared libraries, regardless of the interface used.
50298bd17e5fSmrg	case `$LD -v 2>&1` in
50308bd17e5fSmrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
50318bd17e5fSmrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
50328bd17e5fSmrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
50338bd17e5fSmrg	  *)
50348bd17e5fSmrg	    lt_use_gnu_ld_interface=yes
50358bd17e5fSmrg	    ;;
5036706b6b52Smrg	esac
50378c4a8e55Smrg	;;
50388bd17e5fSmrg      *)
50398bd17e5fSmrg	lt_use_gnu_ld_interface=yes
5040bd23fbfaSmrg	;;
50418bd17e5fSmrg    esac
50428bd17e5fSmrg  fi
50430597fb56Smrg
50443169be4bSmrg  if test yes = "$lt_use_gnu_ld_interface"; then
50458bd17e5fSmrg    # If archive_cmds runs LD, not CC, wlarc should be empty
50463169be4bSmrg    wlarc='$wl'
50470597fb56Smrg
50488bd17e5fSmrg    # Set some defaults for GNU ld with shared library support. These
50498bd17e5fSmrg    # are reset later if shared libraries are not supported. Putting them
50508bd17e5fSmrg    # here allows them to be overridden if necessary.
50518bd17e5fSmrg    runpath_var=LD_RUN_PATH
50523169be4bSmrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
50533169be4bSmrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
50548bd17e5fSmrg    # ancient GNU ld didn't support --whole-archive et. al.
50558bd17e5fSmrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
50563169be4bSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
50578bd17e5fSmrg    else
50588bd17e5fSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
50598bd17e5fSmrg    fi
50608bd17e5fSmrg    supports_anon_versioning=no
50613169be4bSmrg    case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
50628bd17e5fSmrg      *GNU\ gold*) supports_anon_versioning=yes ;;
50638bd17e5fSmrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
50648bd17e5fSmrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
50658bd17e5fSmrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
50668bd17e5fSmrg      *\ 2.11.*) ;; # other 2.11 versions
50678bd17e5fSmrg      *) supports_anon_versioning=yes ;;
50688bd17e5fSmrg    esac
50690597fb56Smrg
50708bd17e5fSmrg    # See if GNU ld supports shared libraries.
50718bd17e5fSmrg    case $host_os in
50728bd17e5fSmrg    aix[[3-9]]*)
50738bd17e5fSmrg      # On AIX/PPC, the GNU linker is very broken
50743169be4bSmrg      if test ia64 != "$host_cpu"; then
50758bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
50768bd17e5fSmrg	cat <<_LT_EOF 1>&2
50778bd17e5fSmrg
50788bd17e5fSmrg*** Warning: the GNU linker, at least up to release 2.19, is reported
50798bd17e5fSmrg*** to be unable to reliably create shared libraries on AIX.
50808bd17e5fSmrg*** Therefore, libtool is disabling shared libraries support.  If you
50818bd17e5fSmrg*** really care for shared libraries, you may want to install binutils
50828bd17e5fSmrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
50838bd17e5fSmrg*** You will then need to restart the configuration process.
50848bd17e5fSmrg
50858bd17e5fSmrg_LT_EOF
50868bd17e5fSmrg      fi
50878bd17e5fSmrg      ;;
50880597fb56Smrg
50898bd17e5fSmrg    amigaos*)
50908bd17e5fSmrg      case $host_cpu in
50918bd17e5fSmrg      powerpc)
50928bd17e5fSmrg            # see comment about AmigaOS4 .so support
50933169be4bSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
50948bd17e5fSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
50950597fb56Smrg        ;;
50968bd17e5fSmrg      m68k)
50978bd17e5fSmrg            _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)'
50988bd17e5fSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
50998bd17e5fSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
51000597fb56Smrg        ;;
51018bd17e5fSmrg      esac
51028bd17e5fSmrg      ;;
51030597fb56Smrg
51048bd17e5fSmrg    beos*)
51058bd17e5fSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
51068bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
51078bd17e5fSmrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
51088bd17e5fSmrg	# support --undefined.  This deserves some investigation.  FIXME
51093169be4bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
51108bd17e5fSmrg      else
51118bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
51128bd17e5fSmrg      fi
51138bd17e5fSmrg      ;;
51140597fb56Smrg
51158bd17e5fSmrg    cygwin* | mingw* | pw32* | cegcc*)
51168bd17e5fSmrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
51178bd17e5fSmrg      # as there is no search path for DLLs.
51188bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
51193169be4bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
51208bd17e5fSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
51218bd17e5fSmrg      _LT_TAGVAR(always_export_symbols, $1)=no
51228bd17e5fSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
51238bd17e5fSmrg      _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'
51248bd17e5fSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
51250597fb56Smrg
51268bd17e5fSmrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
51273169be4bSmrg        _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'
51283169be4bSmrg	# If the export-symbols file already is a .def file, use it as
51293169be4bSmrg	# is; otherwise, prepend EXPORTS...
51303169be4bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
51313169be4bSmrg          cp $export_symbols $output_objdir/$soname.def;
51323169be4bSmrg        else
51333169be4bSmrg          echo EXPORTS > $output_objdir/$soname.def;
51343169be4bSmrg          cat $export_symbols >> $output_objdir/$soname.def;
51353169be4bSmrg        fi~
51363169be4bSmrg        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
51378bd17e5fSmrg      else
51388bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
51398bd17e5fSmrg      fi
51408bd17e5fSmrg      ;;
51410597fb56Smrg
51428bd17e5fSmrg    haiku*)
51433169be4bSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
51448bd17e5fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
51458bd17e5fSmrg      ;;
51460597fb56Smrg
51473169be4bSmrg    os2*)
51483169be4bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
51493169be4bSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
51503169be4bSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
51513169be4bSmrg      shrext_cmds=.dll
51523169be4bSmrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
51533169be4bSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
51543169be4bSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
51553169be4bSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
51563169be4bSmrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
51573169be4bSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
51583169be4bSmrg	emximp -o $lib $output_objdir/$libname.def'
51593169be4bSmrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
51603169be4bSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
51613169be4bSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
51623169be4bSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
51633169be4bSmrg	prefix_cmds="$SED"~
51643169be4bSmrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
51653169be4bSmrg	  prefix_cmds="$prefix_cmds -e 1d";
51663169be4bSmrg	fi~
51673169be4bSmrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
51683169be4bSmrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
51693169be4bSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
51703169be4bSmrg	emximp -o $lib $output_objdir/$libname.def'
51713169be4bSmrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
51723169be4bSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
51733169be4bSmrg      ;;
51743169be4bSmrg
51758bd17e5fSmrg    interix[[3-9]]*)
51768bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=no
51778bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
51783169be4bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
51793169be4bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
51808bd17e5fSmrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
51818bd17e5fSmrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
51828bd17e5fSmrg      # default) and relocated if they conflict, which is a slow very memory
51838bd17e5fSmrg      # consuming and fragmenting process.  To avoid this, we pick a random,
51848bd17e5fSmrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
51858bd17e5fSmrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
51863169be4bSmrg      _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'
51873169be4bSmrg      _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'
51888bd17e5fSmrg      ;;
51890597fb56Smrg
51908bd17e5fSmrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
51918bd17e5fSmrg      tmp_diet=no
51923169be4bSmrg      if test linux-dietlibc = "$host_os"; then
51938bd17e5fSmrg	case $cc_basename in
51948bd17e5fSmrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
51958bd17e5fSmrg	esac
51968bd17e5fSmrg      fi
51978bd17e5fSmrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
51983169be4bSmrg	 && test no = "$tmp_diet"
51998bd17e5fSmrg      then
52008bd17e5fSmrg	tmp_addflag=' $pic_flag'
52018bd17e5fSmrg	tmp_sharedflag='-shared'
52028bd17e5fSmrg	case $cc_basename,$host_cpu in
52038bd17e5fSmrg        pgcc*)				# Portland Group C compiler
52043169be4bSmrg	  _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'
52058bd17e5fSmrg	  tmp_addflag=' $pic_flag'
52068bd17e5fSmrg	  ;;
52078bd17e5fSmrg	pgf77* | pgf90* | pgf95* | pgfortran*)
52088bd17e5fSmrg					# Portland Group f77 and f90 compilers
52093169be4bSmrg	  _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'
52108bd17e5fSmrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
52118bd17e5fSmrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
52128bd17e5fSmrg	  tmp_addflag=' -i_dynamic' ;;
52138bd17e5fSmrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
52148bd17e5fSmrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
52158bd17e5fSmrg	ifc* | ifort*)			# Intel Fortran compiler
52168bd17e5fSmrg	  tmp_addflag=' -nofor_main' ;;
52178bd17e5fSmrg	lf95*)				# Lahey Fortran 8.1
52188bd17e5fSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
52198bd17e5fSmrg	  tmp_sharedflag='--shared' ;;
52203169be4bSmrg        nagfor*)                        # NAGFOR 5.3
52213169be4bSmrg          tmp_sharedflag='-Wl,-shared' ;;
52228bd17e5fSmrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
52238bd17e5fSmrg	  tmp_sharedflag='-qmkshrobj'
52248bd17e5fSmrg	  tmp_addflag= ;;
52258bd17e5fSmrg	nvcc*)	# Cuda Compiler Driver 2.2
52263169be4bSmrg	  _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'
52278bd17e5fSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
52288bd17e5fSmrg	  ;;
52298bd17e5fSmrg	esac
52308bd17e5fSmrg	case `$CC -V 2>&1 | sed 5q` in
52318bd17e5fSmrg	*Sun\ C*)			# Sun C 5.9
52323169be4bSmrg	  _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'
52338bd17e5fSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
52348bd17e5fSmrg	  tmp_sharedflag='-G' ;;
52358bd17e5fSmrg	*Sun\ F*)			# Sun Fortran 8.3
52368bd17e5fSmrg	  tmp_sharedflag='-G' ;;
52378bd17e5fSmrg	esac
52383169be4bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
52390597fb56Smrg
52403169be4bSmrg        if test yes = "$supports_anon_versioning"; then
52418bd17e5fSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
52423169be4bSmrg            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
52433169be4bSmrg            echo "local: *; };" >> $output_objdir/$libname.ver~
52443169be4bSmrg            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
52458bd17e5fSmrg        fi
52460597fb56Smrg
52478bd17e5fSmrg	case $cc_basename in
52483169be4bSmrg	tcc*)
52493169be4bSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
52503169be4bSmrg	  ;;
52518bd17e5fSmrg	xlf* | bgf* | bgxlf* | mpixlf*)
52528bd17e5fSmrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
52538bd17e5fSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
52543169be4bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
52558bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
52563169be4bSmrg	  if test yes = "$supports_anon_versioning"; then
52578bd17e5fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
52583169be4bSmrg              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
52593169be4bSmrg              echo "local: *; };" >> $output_objdir/$libname.ver~
52603169be4bSmrg              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
52618bd17e5fSmrg	  fi
52628bd17e5fSmrg	  ;;
52638bd17e5fSmrg	esac
52648bd17e5fSmrg      else
52658bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
52668bd17e5fSmrg      fi
52678bd17e5fSmrg      ;;
52680597fb56Smrg
52693169be4bSmrg    netbsd*)
52708bd17e5fSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
52718bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
52728bd17e5fSmrg	wlarc=
52738bd17e5fSmrg      else
52743169be4bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
52753169be4bSmrg	_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'
52768bd17e5fSmrg      fi
52778bd17e5fSmrg      ;;
52780597fb56Smrg
52798bd17e5fSmrg    solaris*)
52808bd17e5fSmrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
52818bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
52828bd17e5fSmrg	cat <<_LT_EOF 1>&2
52830597fb56Smrg
52848bd17e5fSmrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
52858bd17e5fSmrg*** create shared libraries on Solaris systems.  Therefore, libtool
52868bd17e5fSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
52878bd17e5fSmrg*** binutils to release 2.9.1 or newer.  Another option is to modify
52888bd17e5fSmrg*** your PATH or compiler configuration so that the native linker is
52898bd17e5fSmrg*** used, and then restart.
52900597fb56Smrg
52918bd17e5fSmrg_LT_EOF
52928bd17e5fSmrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
52933169be4bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
52943169be4bSmrg	_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'
52958bd17e5fSmrg      else
52968bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
52978bd17e5fSmrg      fi
52988bd17e5fSmrg      ;;
52990597fb56Smrg
53008bd17e5fSmrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
53018bd17e5fSmrg      case `$LD -v 2>&1` in
53028bd17e5fSmrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
53038bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
53048bd17e5fSmrg	cat <<_LT_EOF 1>&2
53050597fb56Smrg
53063169be4bSmrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
53078bd17e5fSmrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
53088bd17e5fSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
53098bd17e5fSmrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
53108bd17e5fSmrg*** your PATH or compiler configuration so that the native linker is
53118bd17e5fSmrg*** used, and then restart.
53120597fb56Smrg
53138bd17e5fSmrg_LT_EOF
53148bd17e5fSmrg	;;
53158bd17e5fSmrg	*)
53168bd17e5fSmrg	  # For security reasons, it is highly recommended that you always
53178bd17e5fSmrg	  # use absolute paths for naming shared libraries, and exclude the
53188bd17e5fSmrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
53198bd17e5fSmrg	  # requires that you compile everything twice, which is a pain.
53208bd17e5fSmrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
53213169be4bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
53223169be4bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
53233169be4bSmrg	    _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'
53248bd17e5fSmrg	  else
53258bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
53268bd17e5fSmrg	  fi
53278bd17e5fSmrg	;;
53288bd17e5fSmrg      esac
53298bd17e5fSmrg      ;;
53300597fb56Smrg
53318bd17e5fSmrg    sunos4*)
53328bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
53338bd17e5fSmrg      wlarc=
53348bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
53358bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
53368bd17e5fSmrg      ;;
53378bd17e5fSmrg
53388bd17e5fSmrg    *)
53398bd17e5fSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
53403169be4bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
53413169be4bSmrg	_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'
53428bd17e5fSmrg      else
53438bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
53448bd17e5fSmrg      fi
53458bd17e5fSmrg      ;;
53468bd17e5fSmrg    esac
53478bd17e5fSmrg
53483169be4bSmrg    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
53498bd17e5fSmrg      runpath_var=
53508bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
53518bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
53528bd17e5fSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
53538bd17e5fSmrg    fi
53548bd17e5fSmrg  else
53558bd17e5fSmrg    # PORTME fill in a description of your system's linker (not GNU ld)
53568bd17e5fSmrg    case $host_os in
53578bd17e5fSmrg    aix3*)
53588bd17e5fSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
53598bd17e5fSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
53608bd17e5fSmrg      _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'
53618bd17e5fSmrg      # Note: this linker hardcodes the directories in LIBPATH if there
53628bd17e5fSmrg      # are no directories specified by -L.
53638bd17e5fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
53643169be4bSmrg      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
53658bd17e5fSmrg	# Neither direct hardcoding nor static linking is supported with a
53668bd17e5fSmrg	# broken collect2.
53678bd17e5fSmrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
53688bd17e5fSmrg      fi
53698bd17e5fSmrg      ;;
53708bd17e5fSmrg
53718bd17e5fSmrg    aix[[4-9]]*)
53723169be4bSmrg      if test ia64 = "$host_cpu"; then
53738bd17e5fSmrg	# On IA64, the linker does run time linking by default, so we don't
53748bd17e5fSmrg	# have to do anything special.
53758bd17e5fSmrg	aix_use_runtimelinking=no
53768bd17e5fSmrg	exp_sym_flag='-Bexport'
53773169be4bSmrg	no_entry_flag=
53788bd17e5fSmrg      else
53798bd17e5fSmrg	# If we're using GNU nm, then we don't want the "-C" option.
53803169be4bSmrg	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
53813169be4bSmrg	# Without the "-l" option, or with the "-B" option, AIX nm treats
53823169be4bSmrg	# weak defined symbols like other global defined symbols, whereas
53833169be4bSmrg	# GNU nm marks them as "W".
53843169be4bSmrg	# While the 'weak' keyword is ignored in the Export File, we need
53853169be4bSmrg	# it in the Import File for the 'aix-soname' feature, so we have
53863169be4bSmrg	# to replace the "-B" option with "-P" for AIX nm.
53878bd17e5fSmrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
53883169be4bSmrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
53898bd17e5fSmrg	else
53903169be4bSmrg	  _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
53918bd17e5fSmrg	fi
53928bd17e5fSmrg	aix_use_runtimelinking=no
53930597fb56Smrg
53948bd17e5fSmrg	# Test if we are trying to use run time linking or normal
53958bd17e5fSmrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
53963169be4bSmrg	# have runtime linking enabled, and use it for executables.
53973169be4bSmrg	# For shared libraries, we enable/disable runtime linking
53983169be4bSmrg	# depending on the kind of the shared library created -
53993169be4bSmrg	# when "with_aix_soname,aix_use_runtimelinking" is:
54003169be4bSmrg	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
54013169be4bSmrg	# "aix,yes"  lib.so          shared, rtl:yes, for executables
54023169be4bSmrg	#            lib.a           static archive
54033169be4bSmrg	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
54043169be4bSmrg	#            lib.a(lib.so.V) shared, rtl:no,  for executables
54053169be4bSmrg	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
54063169be4bSmrg	#            lib.a(lib.so.V) shared, rtl:no
54073169be4bSmrg	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
54083169be4bSmrg	#            lib.a           static archive
54098bd17e5fSmrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
54108bd17e5fSmrg	  for ld_flag in $LDFLAGS; do
54113169be4bSmrg	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
54128bd17e5fSmrg	    aix_use_runtimelinking=yes
54138bd17e5fSmrg	    break
54148bd17e5fSmrg	  fi
54158bd17e5fSmrg	  done
54163169be4bSmrg	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
54173169be4bSmrg	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
54183169be4bSmrg	    # so we don't have lib.a shared libs to link our executables.
54193169be4bSmrg	    # We have to force runtime linking in this case.
54203169be4bSmrg	    aix_use_runtimelinking=yes
54213169be4bSmrg	    LDFLAGS="$LDFLAGS -Wl,-brtl"
54223169be4bSmrg	  fi
54238bd17e5fSmrg	  ;;
54248c4a8e55Smrg	esac
54250597fb56Smrg
54268bd17e5fSmrg	exp_sym_flag='-bexport'
54278bd17e5fSmrg	no_entry_flag='-bnoentry'
54288bd17e5fSmrg      fi
54290597fb56Smrg
54308bd17e5fSmrg      # When large executables or shared objects are built, AIX ld can
54318bd17e5fSmrg      # have problems creating the table of contents.  If linking a library
54328bd17e5fSmrg      # or program results in "error TOC overflow" add -mminimal-toc to
54338bd17e5fSmrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
54348bd17e5fSmrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
54350597fb56Smrg
54368bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)=''
54378bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
54388bd17e5fSmrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
54398bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
54408bd17e5fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
54413169be4bSmrg      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
54423169be4bSmrg      case $with_aix_soname,$aix_use_runtimelinking in
54433169be4bSmrg      aix,*) ;; # traditional, no import file
54443169be4bSmrg      svr4,* | *,yes) # use import file
54453169be4bSmrg	# The Import File defines what to hardcode.
54463169be4bSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
54473169be4bSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
54483169be4bSmrg	;;
54493169be4bSmrg      esac
54508bd17e5fSmrg
54513169be4bSmrg      if test yes = "$GCC"; then
54528bd17e5fSmrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
54538bd17e5fSmrg	# We only want to do this on AIX 4.2 and lower, the check
54548bd17e5fSmrg	# below for broken collect2 doesn't work under 4.3+
54553169be4bSmrg	  collect2name=`$CC -print-prog-name=collect2`
54568bd17e5fSmrg	  if test -f "$collect2name" &&
54578bd17e5fSmrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
54588bd17e5fSmrg	  then
54598bd17e5fSmrg	  # We have reworked collect2
54608bd17e5fSmrg	  :
54618bd17e5fSmrg	  else
54628bd17e5fSmrg	  # We have old collect2
54638bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
54648bd17e5fSmrg	  # It fails to find uninstalled libraries when the uninstalled
54658bd17e5fSmrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
54668bd17e5fSmrg	  # to unsupported forces relinking
54678bd17e5fSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
54688bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
54698bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
54708bd17e5fSmrg	  fi
54718bd17e5fSmrg	  ;;
54728c4a8e55Smrg	esac
54738bd17e5fSmrg	shared_flag='-shared'
54743169be4bSmrg	if test yes = "$aix_use_runtimelinking"; then
54753169be4bSmrg	  shared_flag="$shared_flag "'$wl-G'
54768bd17e5fSmrg	fi
54773169be4bSmrg	# Need to ensure runtime linking is disabled for the traditional
54783169be4bSmrg	# shared library, or the linker may eventually find shared libraries
54793169be4bSmrg	# /with/ Import File - we do not want to mix them.
54803169be4bSmrg	shared_flag_aix='-shared'
54813169be4bSmrg	shared_flag_svr4='-shared $wl-G'
54828bd17e5fSmrg      else
54838bd17e5fSmrg	# not using gcc
54843169be4bSmrg	if test ia64 = "$host_cpu"; then
54858bd17e5fSmrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
54868bd17e5fSmrg	# chokes on -Wl,-G. The following line is correct:
54878bd17e5fSmrg	  shared_flag='-G'
54888bd17e5fSmrg	else
54893169be4bSmrg	  if test yes = "$aix_use_runtimelinking"; then
54903169be4bSmrg	    shared_flag='$wl-G'
54918bd17e5fSmrg	  else
54923169be4bSmrg	    shared_flag='$wl-bM:SRE'
54938bd17e5fSmrg	  fi
54943169be4bSmrg	  shared_flag_aix='$wl-bM:SRE'
54953169be4bSmrg	  shared_flag_svr4='$wl-G'
54968bd17e5fSmrg	fi
54978bd17e5fSmrg      fi
54980597fb56Smrg
54993169be4bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
55008bd17e5fSmrg      # It seems that -bexpall does not export symbols beginning with
55018bd17e5fSmrg      # underscore (_), so it is better to generate a list of symbols to export.
55028bd17e5fSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
55033169be4bSmrg      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
55048bd17e5fSmrg	# Warning - without using the other runtime loading flags (-brtl),
55058bd17e5fSmrg	# -berok will link without error, but may produce a broken library.
55068bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
55078bd17e5fSmrg        # Determine the default libpath from the value encoded in an
55088bd17e5fSmrg        # empty executable.
55098bd17e5fSmrg        _LT_SYS_MODULE_PATH_AIX([$1])
55103169be4bSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
55113169be4bSmrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
55128bd17e5fSmrg      else
55133169be4bSmrg	if test ia64 = "$host_cpu"; then
55143169be4bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
55158bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
55163169be4bSmrg	  _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"
55178bd17e5fSmrg	else
55188bd17e5fSmrg	 # Determine the default libpath from the value encoded in an
55198bd17e5fSmrg	 # empty executable.
55208bd17e5fSmrg	 _LT_SYS_MODULE_PATH_AIX([$1])
55213169be4bSmrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
55228bd17e5fSmrg	  # Warning - without using the other run time loading flags,
55238bd17e5fSmrg	  # -berok will link without error, but may produce a broken library.
55243169be4bSmrg	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
55253169be4bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
55263169be4bSmrg	  if test yes = "$with_gnu_ld"; then
55278bd17e5fSmrg	    # We only use this code for GNU lds that support --whole-archive.
55283169be4bSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
55298bd17e5fSmrg	  else
55308bd17e5fSmrg	    # Exported symbols can be pulled into shared objects from archives
55318bd17e5fSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
55328bd17e5fSmrg	  fi
55338bd17e5fSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
55343169be4bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
55353169be4bSmrg	  # -brtl affects multiple linker settings, -berok does not and is overridden later
55363169be4bSmrg	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
55373169be4bSmrg	  if test svr4 != "$with_aix_soname"; then
55383169be4bSmrg	    # This is similar to how AIX traditionally builds its shared libraries.
55393169be4bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
55403169be4bSmrg	  fi
55413169be4bSmrg	  if test aix != "$with_aix_soname"; then
55423169be4bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
55433169be4bSmrg	  else
55443169be4bSmrg	    # used by -dlpreopen to get the symbols
55453169be4bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
55463169be4bSmrg	  fi
55473169be4bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
55480597fb56Smrg	fi
55498bd17e5fSmrg      fi
55508bd17e5fSmrg      ;;
55510597fb56Smrg
55528bd17e5fSmrg    amigaos*)
55538bd17e5fSmrg      case $host_cpu in
55548bd17e5fSmrg      powerpc)
55558bd17e5fSmrg            # see comment about AmigaOS4 .so support
55563169be4bSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
55578bd17e5fSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
55588bd17e5fSmrg        ;;
55598bd17e5fSmrg      m68k)
55608bd17e5fSmrg            _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)'
55618bd17e5fSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
55628bd17e5fSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
55638bd17e5fSmrg        ;;
55648bd17e5fSmrg      esac
55658bd17e5fSmrg      ;;
55660597fb56Smrg
55678bd17e5fSmrg    bsdi[[45]]*)
55688bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
55698bd17e5fSmrg      ;;
55700597fb56Smrg
55718bd17e5fSmrg    cygwin* | mingw* | pw32* | cegcc*)
55728bd17e5fSmrg      # When not using gcc, we currently assume that we are using
55738bd17e5fSmrg      # Microsoft Visual C++.
55748bd17e5fSmrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
55758bd17e5fSmrg      # no search path for DLLs.
55768bd17e5fSmrg      case $cc_basename in
55778bd17e5fSmrg      cl*)
55788bd17e5fSmrg	# Native MSVC
55798bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
55808bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
55818bd17e5fSmrg	_LT_TAGVAR(always_export_symbols, $1)=yes
55828bd17e5fSmrg	_LT_TAGVAR(file_list_spec, $1)='@'
55838bd17e5fSmrg	# Tell ltmain to make .lib files, not .a files.
55848bd17e5fSmrg	libext=lib
55858bd17e5fSmrg	# Tell ltmain to make .dll files, not .so files.
55863169be4bSmrg	shrext_cmds=.dll
55878bd17e5fSmrg	# FIXME: Setting linknames here is a bad hack.
55883169be4bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
55893169be4bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
55903169be4bSmrg            cp "$export_symbols" "$output_objdir/$soname.def";
55913169be4bSmrg            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
55923169be4bSmrg          else
55933169be4bSmrg            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
55943169be4bSmrg          fi~
55953169be4bSmrg          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
55963169be4bSmrg          linknames='
55978bd17e5fSmrg	# The linker will not automatically build a static lib if we build a DLL.
55988bd17e5fSmrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
55998bd17e5fSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
56008bd17e5fSmrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
56018bd17e5fSmrg	_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'
56028bd17e5fSmrg	# Don't use ranlib
56038bd17e5fSmrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
56048bd17e5fSmrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
56053169be4bSmrg          lt_tool_outputfile="@TOOL_OUTPUT@"~
56063169be4bSmrg          case $lt_outputfile in
56073169be4bSmrg            *.exe|*.EXE) ;;
56083169be4bSmrg            *)
56093169be4bSmrg              lt_outputfile=$lt_outputfile.exe
56103169be4bSmrg              lt_tool_outputfile=$lt_tool_outputfile.exe
56113169be4bSmrg              ;;
56123169be4bSmrg          esac~
56133169be4bSmrg          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
56143169be4bSmrg            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
56153169be4bSmrg            $RM "$lt_outputfile.manifest";
56163169be4bSmrg          fi'
56178bd17e5fSmrg	;;
56188bd17e5fSmrg      *)
56198bd17e5fSmrg	# Assume MSVC wrapper
56208bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
56218bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
56228bd17e5fSmrg	# Tell ltmain to make .lib files, not .a files.
56238bd17e5fSmrg	libext=lib
56248bd17e5fSmrg	# Tell ltmain to make .dll files, not .so files.
56253169be4bSmrg	shrext_cmds=.dll
56268bd17e5fSmrg	# FIXME: Setting linknames here is a bad hack.
56278bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
56288bd17e5fSmrg	# The linker will automatically build a .lib file if we build a DLL.
56298bd17e5fSmrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
56308bd17e5fSmrg	# FIXME: Should let the user specify the lib program.
56318bd17e5fSmrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
56328bd17e5fSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5633706b6b52Smrg	;;
56348bd17e5fSmrg      esac
56358bd17e5fSmrg      ;;
5636706b6b52Smrg
56378bd17e5fSmrg    darwin* | rhapsody*)
56388bd17e5fSmrg      _LT_DARWIN_LINKER_FEATURES($1)
56398bd17e5fSmrg      ;;
5640706b6b52Smrg
56418bd17e5fSmrg    dgux*)
56428bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
56438bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
56448bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
56458bd17e5fSmrg      ;;
5646706b6b52Smrg
56478bd17e5fSmrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
56488bd17e5fSmrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
56498bd17e5fSmrg    # does not break anything, and helps significantly (at the cost of a little
56508bd17e5fSmrg    # extra space).
56518bd17e5fSmrg    freebsd2.2*)
56528bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
56538bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
56548bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
56558bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
56568bd17e5fSmrg      ;;
56570597fb56Smrg
56588bd17e5fSmrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
56598bd17e5fSmrg    freebsd2.*)
56608bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
56618bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
56628bd17e5fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
56638bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
56648bd17e5fSmrg      ;;
5665706b6b52Smrg
56668bd17e5fSmrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
56678bd17e5fSmrg    freebsd* | dragonfly*)
56688bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
56698bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
56708bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
56718bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
56728bd17e5fSmrg      ;;
5673706b6b52Smrg
56748bd17e5fSmrg    hpux9*)
56753169be4bSmrg      if test yes = "$GCC"; then
56763169be4bSmrg	_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 "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
56778bd17e5fSmrg      else
56783169be4bSmrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
56798bd17e5fSmrg      fi
56803169be4bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
56818bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
56828bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5683706b6b52Smrg
56848bd17e5fSmrg      # hardcode_minus_L: Not really in the search PATH,
56858bd17e5fSmrg      # but as the default location of the library.
56868bd17e5fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
56873169be4bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
56888bd17e5fSmrg      ;;
5689706b6b52Smrg
56908bd17e5fSmrg    hpux10*)
56913169be4bSmrg      if test yes,no = "$GCC,$with_gnu_ld"; then
56923169be4bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
56938bd17e5fSmrg      else
56948bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
56958bd17e5fSmrg      fi
56963169be4bSmrg      if test no = "$with_gnu_ld"; then
56973169be4bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
56988bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
56998bd17e5fSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
57008bd17e5fSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
57013169be4bSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
57028bd17e5fSmrg	# hardcode_minus_L: Not really in the search PATH,
57038bd17e5fSmrg	# but as the default location of the library.
57048bd17e5fSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
57058bd17e5fSmrg      fi
57068bd17e5fSmrg      ;;
5707b042e37fSmrg
57088bd17e5fSmrg    hpux11*)
57093169be4bSmrg      if test yes,no = "$GCC,$with_gnu_ld"; then
57108bd17e5fSmrg	case $host_cpu in
57118bd17e5fSmrg	hppa*64*)
57123169be4bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
57138bd17e5fSmrg	  ;;
57148bd17e5fSmrg	ia64*)
57153169be4bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
57168bd17e5fSmrg	  ;;
57178bd17e5fSmrg	*)
57183169be4bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
57198bd17e5fSmrg	  ;;
57208bd17e5fSmrg	esac
57218bd17e5fSmrg      else
57228bd17e5fSmrg	case $host_cpu in
57238bd17e5fSmrg	hppa*64*)
57243169be4bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
57258bd17e5fSmrg	  ;;
57268bd17e5fSmrg	ia64*)
57273169be4bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
57288bd17e5fSmrg	  ;;
57298bd17e5fSmrg	*)
57308bd17e5fSmrg	m4_if($1, [], [
57318bd17e5fSmrg	  # Older versions of the 11.00 compiler do not understand -b yet
57328bd17e5fSmrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
57338bd17e5fSmrg	  _LT_LINKER_OPTION([if $CC understands -b],
57348bd17e5fSmrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
57353169be4bSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
57368bd17e5fSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
57373169be4bSmrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
57388bd17e5fSmrg	  ;;
57398bd17e5fSmrg	esac
57408bd17e5fSmrg      fi
57413169be4bSmrg      if test no = "$with_gnu_ld"; then
57423169be4bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
57438bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
57448c4a8e55Smrg
57458bd17e5fSmrg	case $host_cpu in
57468bd17e5fSmrg	hppa*64*|ia64*)
57478bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
57488bd17e5fSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
57498bd17e5fSmrg	  ;;
57508bd17e5fSmrg	*)
57518bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
57528bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
57533169be4bSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5754b042e37fSmrg
57558bd17e5fSmrg	  # hardcode_minus_L: Not really in the search PATH,
57568bd17e5fSmrg	  # but as the default location of the library.
57578bd17e5fSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
57588bd17e5fSmrg	  ;;
57598bd17e5fSmrg	esac
57608bd17e5fSmrg      fi
57618bd17e5fSmrg      ;;
5762b042e37fSmrg
57638bd17e5fSmrg    irix5* | irix6* | nonstopux*)
57643169be4bSmrg      if test yes = "$GCC"; then
57653169be4bSmrg	_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'
57668bd17e5fSmrg	# Try to use the -exported_symbol ld option, if it does not
57678bd17e5fSmrg	# work, assume that -exports_file does not work either and
57688bd17e5fSmrg	# implicitly export all symbols.
57698bd17e5fSmrg	# This should be the same for all languages, so no per-tag cache variable.
57708bd17e5fSmrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
57718bd17e5fSmrg	  [lt_cv_irix_exported_symbol],
57723169be4bSmrg	  [save_LDFLAGS=$LDFLAGS
57733169be4bSmrg	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
57748bd17e5fSmrg	   AC_LINK_IFELSE(
57758bd17e5fSmrg	     [AC_LANG_SOURCE(
57768bd17e5fSmrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
57778bd17e5fSmrg			      [C++], [[int foo (void) { return 0; }]],
57788bd17e5fSmrg			      [Fortran 77], [[
57798bd17e5fSmrg      subroutine foo
57808bd17e5fSmrg      end]],
57818bd17e5fSmrg			      [Fortran], [[
57828bd17e5fSmrg      subroutine foo
57838bd17e5fSmrg      end]])])],
57848bd17e5fSmrg	      [lt_cv_irix_exported_symbol=yes],
57858bd17e5fSmrg	      [lt_cv_irix_exported_symbol=no])
57863169be4bSmrg           LDFLAGS=$save_LDFLAGS])
57873169be4bSmrg	if test yes = "$lt_cv_irix_exported_symbol"; then
57883169be4bSmrg          _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'
57898bd17e5fSmrg	fi
57908bd17e5fSmrg      else
57913169be4bSmrg	_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'
57923169be4bSmrg	_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'
57938bd17e5fSmrg      fi
57948bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
57953169be4bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
57968bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
57978bd17e5fSmrg      _LT_TAGVAR(inherit_rpath, $1)=yes
57988bd17e5fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
57998bd17e5fSmrg      ;;
5800b042e37fSmrg
58013169be4bSmrg    linux*)
58023169be4bSmrg      case $cc_basename in
58033169be4bSmrg      tcc*)
58043169be4bSmrg	# Fabrice Bellard et al's Tiny C Compiler
58053169be4bSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
58063169be4bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
58073169be4bSmrg	;;
58083169be4bSmrg      esac
58093169be4bSmrg      ;;
58103169be4bSmrg
58113169be4bSmrg    netbsd*)
58128bd17e5fSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
58138bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
58148bd17e5fSmrg      else
58158bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
58168bd17e5fSmrg      fi
58178bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
58188bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
58198bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
58208bd17e5fSmrg      ;;
58218c4a8e55Smrg
58228bd17e5fSmrg    newsos6)
58238bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
58248bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
58253169be4bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
58268bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
58278bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
58288bd17e5fSmrg      ;;
58298c4a8e55Smrg
58308bd17e5fSmrg    *nto* | *qnx*)
58318bd17e5fSmrg      ;;
58328c4a8e55Smrg
58333169be4bSmrg    openbsd* | bitrig*)
58348bd17e5fSmrg      if test -f /usr/libexec/ld.so; then
58358bd17e5fSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
58368bd17e5fSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
58378bd17e5fSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
58383169be4bSmrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
58398bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
58403169be4bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
58413169be4bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
58423169be4bSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
58438bd17e5fSmrg	else
58443169be4bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
58453169be4bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
58468bd17e5fSmrg	fi
58478bd17e5fSmrg      else
58488bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
58498bd17e5fSmrg      fi
58508bd17e5fSmrg      ;;
5851b042e37fSmrg
58528bd17e5fSmrg    os2*)
58538bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
58548bd17e5fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
58558bd17e5fSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
58563169be4bSmrg      shrext_cmds=.dll
58573169be4bSmrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
58583169be4bSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
58593169be4bSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
58603169be4bSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
58613169be4bSmrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
58623169be4bSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
58633169be4bSmrg	emximp -o $lib $output_objdir/$libname.def'
58643169be4bSmrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
58653169be4bSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
58663169be4bSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
58673169be4bSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
58683169be4bSmrg	prefix_cmds="$SED"~
58693169be4bSmrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
58703169be4bSmrg	  prefix_cmds="$prefix_cmds -e 1d";
58713169be4bSmrg	fi~
58723169be4bSmrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
58733169be4bSmrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
58743169be4bSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
58753169be4bSmrg	emximp -o $lib $output_objdir/$libname.def'
58763169be4bSmrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
58773169be4bSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
58788bd17e5fSmrg      ;;
5879b042e37fSmrg
58808bd17e5fSmrg    osf3*)
58813169be4bSmrg      if test yes = "$GCC"; then
58823169be4bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
58833169be4bSmrg	_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'
58848bd17e5fSmrg      else
58858bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
58863169be4bSmrg	_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'
58878bd17e5fSmrg      fi
58888bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
58893169be4bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
58908bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
58918bd17e5fSmrg      ;;
58920597fb56Smrg
58938bd17e5fSmrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
58943169be4bSmrg      if test yes = "$GCC"; then
58953169be4bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
58963169be4bSmrg	_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'
58973169be4bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
58988bd17e5fSmrg      else
58998bd17e5fSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
59003169be4bSmrg	_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'
59018bd17e5fSmrg	_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~
59023169be4bSmrg          $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'
59030597fb56Smrg
59048bd17e5fSmrg	# Both c and cxx compiler support -rpath directly
59058bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
59068bd17e5fSmrg      fi
59078bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
59088bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
59098bd17e5fSmrg      ;;
59100597fb56Smrg
59118bd17e5fSmrg    solaris*)
59128bd17e5fSmrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
59133169be4bSmrg      if test yes = "$GCC"; then
59143169be4bSmrg	wlarc='$wl'
59153169be4bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
59168bd17e5fSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
59173169be4bSmrg          $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'
59188bd17e5fSmrg      else
59198bd17e5fSmrg	case `$CC -V 2>&1` in
59208bd17e5fSmrg	*"Compilers 5.0"*)
59218bd17e5fSmrg	  wlarc=''
59223169be4bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
59238bd17e5fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
59243169be4bSmrg            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
59258c4a8e55Smrg	  ;;
59260597fb56Smrg	*)
59273169be4bSmrg	  wlarc='$wl'
59283169be4bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
59298bd17e5fSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
59303169be4bSmrg            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
59318c4a8e55Smrg	  ;;
59328bd17e5fSmrg	esac
59338bd17e5fSmrg      fi
59348bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
59358bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
59368bd17e5fSmrg      case $host_os in
59378bd17e5fSmrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
59388bd17e5fSmrg      *)
59398bd17e5fSmrg	# The compiler driver will combine and reorder linker options,
59403169be4bSmrg	# but understands '-z linker_flag'.  GCC discards it without '$wl',
59418bd17e5fSmrg	# but is careful enough not to reorder.
59428bd17e5fSmrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
59433169be4bSmrg	if test yes = "$GCC"; then
59443169be4bSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
59458bd17e5fSmrg	else
59468bd17e5fSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
59478bd17e5fSmrg	fi
59488bd17e5fSmrg	;;
59498c4a8e55Smrg      esac
59508bd17e5fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
59518c4a8e55Smrg      ;;
5952b042e37fSmrg
59538bd17e5fSmrg    sunos4*)
59543169be4bSmrg      if test sequent = "$host_vendor"; then
59558bd17e5fSmrg	# Use $CC to link under sequent, because it throws in some extra .o
59568bd17e5fSmrg	# files that make .init and .fini sections work.
59573169be4bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
59588bd17e5fSmrg      else
59598bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
59608bd17e5fSmrg      fi
59618bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
59628bd17e5fSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
59638bd17e5fSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
59648bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
59658bd17e5fSmrg      ;;
5966b042e37fSmrg
59678bd17e5fSmrg    sysv4)
59688bd17e5fSmrg      case $host_vendor in
59698bd17e5fSmrg	sni)
59708bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
59718bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
59728bd17e5fSmrg	;;
59738bd17e5fSmrg	siemens)
59748bd17e5fSmrg	  ## LD is ld it makes a PLAMLIB
59758bd17e5fSmrg	  ## CC just makes a GrossModule.
59768bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
59778bd17e5fSmrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
59788bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
59798bd17e5fSmrg        ;;
59808bd17e5fSmrg	motorola)
59818bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
59828bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
59838bd17e5fSmrg	;;
59848bd17e5fSmrg      esac
59858bd17e5fSmrg      runpath_var='LD_RUN_PATH'
59868bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5987706b6b52Smrg      ;;
5988b042e37fSmrg
59898bd17e5fSmrg    sysv4.3*)
59908bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
59918bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
59928bd17e5fSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
59938bd17e5fSmrg      ;;
59948c4a8e55Smrg
59958bd17e5fSmrg    sysv4*MP*)
59968bd17e5fSmrg      if test -d /usr/nec; then
59978bd17e5fSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
59988bd17e5fSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
59998bd17e5fSmrg	runpath_var=LD_RUN_PATH
60008bd17e5fSmrg	hardcode_runpath_var=yes
60018bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
60028bd17e5fSmrg      fi
60038bd17e5fSmrg      ;;
60048c4a8e55Smrg
60058bd17e5fSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
60063169be4bSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
60078bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
60088bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60098bd17e5fSmrg      runpath_var='LD_RUN_PATH'
60100597fb56Smrg
60113169be4bSmrg      if test yes = "$GCC"; then
60123169be4bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60133169be4bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60148bd17e5fSmrg      else
60153169be4bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60163169be4bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60178bd17e5fSmrg      fi
60188bd17e5fSmrg      ;;
60190597fb56Smrg
60208bd17e5fSmrg    sysv5* | sco3.2v5* | sco5v6*)
60213169be4bSmrg      # Note: We CANNOT use -z defs as we might desire, because we do not
60228bd17e5fSmrg      # link with -lc, and that would cause any symbols used from libc to
60238bd17e5fSmrg      # always be unresolved, which means just about no library would
60248bd17e5fSmrg      # ever link correctly.  If we're not using GNU ld we use -z text
60258bd17e5fSmrg      # though, which does catch some bad symbols but isn't as heavy-handed
60268bd17e5fSmrg      # as -z defs.
60273169be4bSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
60283169be4bSmrg      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
60298bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
60308bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60313169be4bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
60328bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
60338bd17e5fSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
60343169be4bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
60358bd17e5fSmrg      runpath_var='LD_RUN_PATH'
60360597fb56Smrg
60373169be4bSmrg      if test yes = "$GCC"; then
60383169be4bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60393169be4bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60408bd17e5fSmrg      else
60413169be4bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60423169be4bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60438bd17e5fSmrg      fi
60448bd17e5fSmrg      ;;
60450597fb56Smrg
60468bd17e5fSmrg    uts4*)
60478bd17e5fSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
60488bd17e5fSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
60498bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60508bd17e5fSmrg      ;;
60510597fb56Smrg
60528bd17e5fSmrg    *)
60538bd17e5fSmrg      _LT_TAGVAR(ld_shlibs, $1)=no
60548bd17e5fSmrg      ;;
60558bd17e5fSmrg    esac
60560597fb56Smrg
60573169be4bSmrg    if test sni = "$host_vendor"; then
60588bd17e5fSmrg      case $host in
60598bd17e5fSmrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
60603169be4bSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
60618bd17e5fSmrg	;;
60628bd17e5fSmrg      esac
60638bd17e5fSmrg    fi
60648bd17e5fSmrg  fi
60658bd17e5fSmrg])
60668bd17e5fSmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
60673169be4bSmrgtest no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
60680597fb56Smrg
60698bd17e5fSmrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
60700597fb56Smrg
60718bd17e5fSmrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
60728bd17e5fSmrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
60738bd17e5fSmrg_LT_DECL([], [extract_expsyms_cmds], [2],
60748bd17e5fSmrg    [The commands to extract the exported symbol list from a shared archive])
60750597fb56Smrg
60768bd17e5fSmrg#
60778bd17e5fSmrg# Do we need to explicitly link libc?
60788bd17e5fSmrg#
60798bd17e5fSmrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
60808bd17e5fSmrgx|xyes)
60818bd17e5fSmrg  # Assume -lc should be added
60828bd17e5fSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
60830597fb56Smrg
60843169be4bSmrg  if test yes,yes = "$GCC,$enable_shared"; then
60858bd17e5fSmrg    case $_LT_TAGVAR(archive_cmds, $1) in
60868bd17e5fSmrg    *'~'*)
60878bd17e5fSmrg      # FIXME: we may have to deal with multi-command sequences.
60888bd17e5fSmrg      ;;
60898bd17e5fSmrg    '$CC '*)
60908bd17e5fSmrg      # Test whether the compiler implicitly links with -lc since on some
60918bd17e5fSmrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
60928bd17e5fSmrg      # to ld, don't add -lc before -lgcc.
60938bd17e5fSmrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
60948bd17e5fSmrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
60958bd17e5fSmrg	[$RM conftest*
60968bd17e5fSmrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
60970597fb56Smrg
60988bd17e5fSmrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
60998bd17e5fSmrg	  soname=conftest
61008bd17e5fSmrg	  lib=conftest
61018bd17e5fSmrg	  libobjs=conftest.$ac_objext
61028bd17e5fSmrg	  deplibs=
61038bd17e5fSmrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
61048bd17e5fSmrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
61058bd17e5fSmrg	  compiler_flags=-v
61068bd17e5fSmrg	  linker_flags=-v
61078bd17e5fSmrg	  verstring=
61088bd17e5fSmrg	  output_objdir=.
61098bd17e5fSmrg	  libname=conftest
61108bd17e5fSmrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
61118bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
61128bd17e5fSmrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
61138bd17e5fSmrg	  then
61148bd17e5fSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
61158bd17e5fSmrg	  else
61168bd17e5fSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
61178bd17e5fSmrg	  fi
61188bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
61198bd17e5fSmrg	else
61208bd17e5fSmrg	  cat conftest.err 1>&5
61218bd17e5fSmrg	fi
61228bd17e5fSmrg	$RM conftest*
61238bd17e5fSmrg	])
61248bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
61258bd17e5fSmrg      ;;
61268bd17e5fSmrg    esac
61278bd17e5fSmrg  fi
61288bd17e5fSmrg  ;;
61290597fb56Smrgesac
61300597fb56Smrg
61318bd17e5fSmrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
61328bd17e5fSmrg    [Whether or not to add -lc for building shared libraries])
61338bd17e5fSmrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
61348bd17e5fSmrg    [enable_shared_with_static_runtimes], [0],
61358bd17e5fSmrg    [Whether or not to disallow shared libs when runtime libs are static])
61368bd17e5fSmrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
61378bd17e5fSmrg    [Compiler flag to allow reflexive dlopens])
61388bd17e5fSmrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
61398bd17e5fSmrg    [Compiler flag to generate shared objects directly from archives])
61408bd17e5fSmrg_LT_TAGDECL([], [compiler_needs_object], [1],
61418bd17e5fSmrg    [Whether the compiler copes with passing no objects directly])
61428bd17e5fSmrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
61438bd17e5fSmrg    [Create an old-style archive from a shared archive])
61448bd17e5fSmrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
61458bd17e5fSmrg    [Create a temporary old-style archive to link instead of a shared archive])
61468bd17e5fSmrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
61478bd17e5fSmrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
61488bd17e5fSmrg_LT_TAGDECL([], [module_cmds], [2],
61498bd17e5fSmrg    [Commands used to build a loadable module if different from building
61508bd17e5fSmrg    a shared archive.])
61518bd17e5fSmrg_LT_TAGDECL([], [module_expsym_cmds], [2])
61528bd17e5fSmrg_LT_TAGDECL([], [with_gnu_ld], [1],
61538bd17e5fSmrg    [Whether we are building with GNU ld or not])
61548bd17e5fSmrg_LT_TAGDECL([], [allow_undefined_flag], [1],
61558bd17e5fSmrg    [Flag that allows shared libraries with undefined symbols to be built])
61568bd17e5fSmrg_LT_TAGDECL([], [no_undefined_flag], [1],
61578bd17e5fSmrg    [Flag that enforces no undefined symbols])
61588bd17e5fSmrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
61598bd17e5fSmrg    [Flag to hardcode $libdir into a binary during linking.
61608bd17e5fSmrg    This must work even if $libdir does not exist])
61618bd17e5fSmrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
61628bd17e5fSmrg    [Whether we need a single "-rpath" flag with a separated argument])
61638bd17e5fSmrg_LT_TAGDECL([], [hardcode_direct], [0],
61643169be4bSmrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
61658bd17e5fSmrg    DIR into the resulting binary])
61668bd17e5fSmrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
61673169be4bSmrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
61688bd17e5fSmrg    DIR into the resulting binary and the resulting library dependency is
61693169be4bSmrg    "absolute", i.e impossible to change by setting $shlibpath_var if the
61708bd17e5fSmrg    library is relocated])
61718bd17e5fSmrg_LT_TAGDECL([], [hardcode_minus_L], [0],
61728bd17e5fSmrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
61738bd17e5fSmrg    into the resulting binary])
61748bd17e5fSmrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
61758bd17e5fSmrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
61768bd17e5fSmrg    into the resulting binary])
61778bd17e5fSmrg_LT_TAGDECL([], [hardcode_automatic], [0],
61788bd17e5fSmrg    [Set to "yes" if building a shared library automatically hardcodes DIR
61798bd17e5fSmrg    into the library and all subsequent libraries and executables linked
61808bd17e5fSmrg    against it])
61818bd17e5fSmrg_LT_TAGDECL([], [inherit_rpath], [0],
61828bd17e5fSmrg    [Set to yes if linker adds runtime paths of dependent libraries
61838bd17e5fSmrg    to runtime path list])
61848bd17e5fSmrg_LT_TAGDECL([], [link_all_deplibs], [0],
61858bd17e5fSmrg    [Whether libtool must link a program against all its dependency libraries])
61868bd17e5fSmrg_LT_TAGDECL([], [always_export_symbols], [0],
61878bd17e5fSmrg    [Set to "yes" if exported symbols are required])
61888bd17e5fSmrg_LT_TAGDECL([], [export_symbols_cmds], [2],
61898bd17e5fSmrg    [The commands to list exported symbols])
61908bd17e5fSmrg_LT_TAGDECL([], [exclude_expsyms], [1],
61918bd17e5fSmrg    [Symbols that should not be listed in the preloaded symbols])
61928bd17e5fSmrg_LT_TAGDECL([], [include_expsyms], [1],
61938bd17e5fSmrg    [Symbols that must always be exported])
61948bd17e5fSmrg_LT_TAGDECL([], [prelink_cmds], [2],
61958bd17e5fSmrg    [Commands necessary for linking programs (against libraries) with templates])
61968bd17e5fSmrg_LT_TAGDECL([], [postlink_cmds], [2],
61978bd17e5fSmrg    [Commands necessary for finishing linking programs])
61988bd17e5fSmrg_LT_TAGDECL([], [file_list_spec], [1],
61998bd17e5fSmrg    [Specify filename containing input files])
62008bd17e5fSmrgdnl FIXME: Not yet implemented
62018bd17e5fSmrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
62028bd17e5fSmrgdnl    [Compiler flag to generate thread safe objects])
62038bd17e5fSmrg])# _LT_LINKER_SHLIBS
6204b042e37fSmrg
6205b042e37fSmrg
62068bd17e5fSmrg# _LT_LANG_C_CONFIG([TAG])
62078bd17e5fSmrg# ------------------------
62088bd17e5fSmrg# Ensure that the configuration variables for a C compiler are suitably
62098bd17e5fSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
62103169be4bSmrg# the compiler configuration to 'libtool'.
62118bd17e5fSmrgm4_defun([_LT_LANG_C_CONFIG],
62128bd17e5fSmrg[m4_require([_LT_DECL_EGREP])dnl
62133169be4bSmrglt_save_CC=$CC
62148bd17e5fSmrgAC_LANG_PUSH(C)
6215b042e37fSmrg
62168bd17e5fSmrg# Source file extension for C test sources.
62178bd17e5fSmrgac_ext=c
6218b042e37fSmrg
62198bd17e5fSmrg# Object file extension for compiled C test sources.
62208bd17e5fSmrgobjext=o
62218bd17e5fSmrg_LT_TAGVAR(objext, $1)=$objext
6222bd23fbfaSmrg
62238bd17e5fSmrg# Code to be used in simple compile tests
62248bd17e5fSmrglt_simple_compile_test_code="int some_variable = 0;"
6225b042e37fSmrg
62268bd17e5fSmrg# Code to be used in simple link tests
62278bd17e5fSmrglt_simple_link_test_code='int main(){return(0);}'
6228b042e37fSmrg
62298bd17e5fSmrg_LT_TAG_COMPILER
62308bd17e5fSmrg# Save the default compiler, since it gets overwritten when the other
62318bd17e5fSmrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
62328bd17e5fSmrgcompiler_DEFAULT=$CC
6233b042e37fSmrg
62348bd17e5fSmrg# save warnings/boilerplate of simple test code
62358bd17e5fSmrg_LT_COMPILER_BOILERPLATE
62368bd17e5fSmrg_LT_LINKER_BOILERPLATE
6237b042e37fSmrg
62388bd17e5fSmrgif test -n "$compiler"; then
62398bd17e5fSmrg  _LT_COMPILER_NO_RTTI($1)
62408bd17e5fSmrg  _LT_COMPILER_PIC($1)
62418bd17e5fSmrg  _LT_COMPILER_C_O($1)
62428bd17e5fSmrg  _LT_COMPILER_FILE_LOCKS($1)
62438bd17e5fSmrg  _LT_LINKER_SHLIBS($1)
62448bd17e5fSmrg  _LT_SYS_DYNAMIC_LINKER($1)
62458bd17e5fSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
62468bd17e5fSmrg  LT_SYS_DLOPEN_SELF
62478bd17e5fSmrg  _LT_CMD_STRIPLIB
6248b042e37fSmrg
62493169be4bSmrg  # Report what library types will actually be built
62508bd17e5fSmrg  AC_MSG_CHECKING([if libtool supports shared libraries])
62518bd17e5fSmrg  AC_MSG_RESULT([$can_build_shared])
62520597fb56Smrg
62538bd17e5fSmrg  AC_MSG_CHECKING([whether to build shared libraries])
62543169be4bSmrg  test no = "$can_build_shared" && enable_shared=no
62550597fb56Smrg
62568bd17e5fSmrg  # On AIX, shared libraries and static libraries use the same namespace, and
62578bd17e5fSmrg  # are all built from PIC.
62588bd17e5fSmrg  case $host_os in
62598bd17e5fSmrg  aix3*)
62603169be4bSmrg    test yes = "$enable_shared" && enable_static=no
62618bd17e5fSmrg    if test -n "$RANLIB"; then
62628bd17e5fSmrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
62638bd17e5fSmrg      postinstall_cmds='$RANLIB $lib'
62648bd17e5fSmrg    fi
62658bd17e5fSmrg    ;;
62660597fb56Smrg
62678bd17e5fSmrg  aix[[4-9]]*)
62683169be4bSmrg    if test ia64 != "$host_cpu"; then
62693169be4bSmrg      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
62703169be4bSmrg      yes,aix,yes) ;;			# shared object as lib.so file only
62713169be4bSmrg      yes,svr4,*) ;;			# shared object as lib.so archive member only
62723169be4bSmrg      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
62733169be4bSmrg      esac
62740597fb56Smrg    fi
6275706b6b52Smrg    ;;
6276706b6b52Smrg  esac
62778bd17e5fSmrg  AC_MSG_RESULT([$enable_shared])
6278b042e37fSmrg
62798bd17e5fSmrg  AC_MSG_CHECKING([whether to build static libraries])
62808bd17e5fSmrg  # Make sure either enable_shared or enable_static is yes.
62813169be4bSmrg  test yes = "$enable_shared" || enable_static=yes
62828bd17e5fSmrg  AC_MSG_RESULT([$enable_static])
62838bd17e5fSmrg
62848bd17e5fSmrg  _LT_CONFIG($1)
62850597fb56Smrgfi
62868bd17e5fSmrgAC_LANG_POP
62873169be4bSmrgCC=$lt_save_CC
62888bd17e5fSmrg])# _LT_LANG_C_CONFIG
6289b042e37fSmrg
62900597fb56Smrg
62918bd17e5fSmrg# _LT_LANG_CXX_CONFIG([TAG])
62920597fb56Smrg# --------------------------
62938bd17e5fSmrg# Ensure that the configuration variables for a C++ compiler are suitably
62948bd17e5fSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
62953169be4bSmrg# the compiler configuration to 'libtool'.
62968bd17e5fSmrgm4_defun([_LT_LANG_CXX_CONFIG],
62978bd17e5fSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
62988bd17e5fSmrgm4_require([_LT_DECL_EGREP])dnl
62998bd17e5fSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
63003169be4bSmrgif test -n "$CXX" && ( test no != "$CXX" &&
63013169be4bSmrg    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
63023169be4bSmrg    (test g++ != "$CXX"))); then
63038bd17e5fSmrg  AC_PROG_CXXCPP
63048bd17e5fSmrgelse
63058bd17e5fSmrg  _lt_caught_CXX_error=yes
63060597fb56Smrgfi
63070597fb56Smrg
63088bd17e5fSmrgAC_LANG_PUSH(C++)
63090597fb56Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
63100597fb56Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
63110597fb56Smrg_LT_TAGVAR(always_export_symbols, $1)=no
63120597fb56Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
63138bd17e5fSmrg_LT_TAGVAR(compiler_needs_object, $1)=no
63140597fb56Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
63150597fb56Smrg_LT_TAGVAR(hardcode_direct, $1)=no
63160597fb56Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
63170597fb56Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
63180597fb56Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
63190597fb56Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
63208bd17e5fSmrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
63210597fb56Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
63220597fb56Smrg_LT_TAGVAR(inherit_rpath, $1)=no
63230597fb56Smrg_LT_TAGVAR(module_cmds, $1)=
63240597fb56Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
63250597fb56Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
63260597fb56Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
63270597fb56Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
63280597fb56Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
63290597fb56Smrg_LT_TAGVAR(no_undefined_flag, $1)=
63300597fb56Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
63310597fb56Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
63320597fb56Smrg
63338bd17e5fSmrg# Source file extension for C++ test sources.
63348bd17e5fSmrgac_ext=cpp
63350597fb56Smrg
63368bd17e5fSmrg# Object file extension for compiled C++ test sources.
63370597fb56Smrgobjext=o
63380597fb56Smrg_LT_TAGVAR(objext, $1)=$objext
63390597fb56Smrg
63400597fb56Smrg# No sense in running all these tests if we already determined that
63418bd17e5fSmrg# the CXX compiler isn't working.  Some variables (like enable_shared)
63420597fb56Smrg# are currently assumed to apply to all compilers on this platform,
63430597fb56Smrg# and will be corrupted by setting them based on a non-working compiler.
63443169be4bSmrgif test yes != "$_lt_caught_CXX_error"; then
63450597fb56Smrg  # Code to be used in simple compile tests
63468bd17e5fSmrg  lt_simple_compile_test_code="int some_variable = 0;"
63470597fb56Smrg
63480597fb56Smrg  # Code to be used in simple link tests
63498bd17e5fSmrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
63500597fb56Smrg
63510597fb56Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
63520597fb56Smrg  _LT_TAG_COMPILER
63530597fb56Smrg
63540597fb56Smrg  # save warnings/boilerplate of simple test code
63550597fb56Smrg  _LT_COMPILER_BOILERPLATE
63560597fb56Smrg  _LT_LINKER_BOILERPLATE
63570597fb56Smrg
63580597fb56Smrg  # Allow CC to be a program name with arguments.
63598bd17e5fSmrg  lt_save_CC=$CC
63600597fb56Smrg  lt_save_CFLAGS=$CFLAGS
63618bd17e5fSmrg  lt_save_LD=$LD
63628bd17e5fSmrg  lt_save_GCC=$GCC
63638bd17e5fSmrg  GCC=$GXX
63648bd17e5fSmrg  lt_save_with_gnu_ld=$with_gnu_ld
63658bd17e5fSmrg  lt_save_path_LD=$lt_cv_path_LD
63668bd17e5fSmrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
63678bd17e5fSmrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
63688bd17e5fSmrg  else
63698bd17e5fSmrg    $as_unset lt_cv_prog_gnu_ld
63708bd17e5fSmrg  fi
63718bd17e5fSmrg  if test -n "${lt_cv_path_LDCXX+set}"; then
63728bd17e5fSmrg    lt_cv_path_LD=$lt_cv_path_LDCXX
63738bd17e5fSmrg  else
63748bd17e5fSmrg    $as_unset lt_cv_path_LD
63758bd17e5fSmrg  fi
63768bd17e5fSmrg  test -z "${LDCXX+set}" || LD=$LDCXX
63778bd17e5fSmrg  CC=${CXX-"c++"}
63788bd17e5fSmrg  CFLAGS=$CXXFLAGS
63790597fb56Smrg  compiler=$CC
63800597fb56Smrg  _LT_TAGVAR(compiler, $1)=$CC
63810597fb56Smrg  _LT_CC_BASENAME([$compiler])
63828c4a8e55Smrg
63838bd17e5fSmrg  if test -n "$compiler"; then
63848bd17e5fSmrg    # We don't want -fno-exception when compiling C++ code, so set the
63858bd17e5fSmrg    # no_builtin_flag separately
63863169be4bSmrg    if test yes = "$GXX"; then
63878bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
63888bd17e5fSmrg    else
63898bd17e5fSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
63908bd17e5fSmrg    fi
63918c4a8e55Smrg
63923169be4bSmrg    if test yes = "$GXX"; then
63938bd17e5fSmrg      # Set up default GNU C++ configuration
6394b042e37fSmrg
63958bd17e5fSmrg      LT_PATH_LD
63968c4a8e55Smrg
63978bd17e5fSmrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
63988bd17e5fSmrg      # archiving commands below assume that GNU ld is being used.
63993169be4bSmrg      if test yes = "$with_gnu_ld"; then
64003169be4bSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
64013169be4bSmrg        _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'
64028c4a8e55Smrg
64033169be4bSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
64043169be4bSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6405b042e37fSmrg
64068bd17e5fSmrg        # If archive_cmds runs LD, not CC, wlarc should be empty
64078bd17e5fSmrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
64088bd17e5fSmrg        #     investigate it a little bit more. (MM)
64093169be4bSmrg        wlarc='$wl'
6410b042e37fSmrg
64118bd17e5fSmrg        # ancient GNU ld didn't support --whole-archive et. al.
64128bd17e5fSmrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
64138bd17e5fSmrg	  $GREP 'no-whole-archive' > /dev/null; then
64143169be4bSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
64158bd17e5fSmrg        else
64168bd17e5fSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
64178bd17e5fSmrg        fi
64188bd17e5fSmrg      else
64198bd17e5fSmrg        with_gnu_ld=no
64208bd17e5fSmrg        wlarc=
6421b042e37fSmrg
64228bd17e5fSmrg        # A generic and very simple default shared library creation
64238bd17e5fSmrg        # command for GNU C++ for the case where it uses the native
64248bd17e5fSmrg        # linker, instead of GNU ld.  If possible, this setting should
64258bd17e5fSmrg        # overridden to take advantage of the native linker features on
64268bd17e5fSmrg        # the platform it is being used on.
64278bd17e5fSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
64288bd17e5fSmrg      fi
6429b042e37fSmrg
64308bd17e5fSmrg      # Commands to make compiler produce verbose output that lists
64318bd17e5fSmrg      # what "hidden" libraries, object files and flags are used when
64328bd17e5fSmrg      # linking a shared library.
64338bd17e5fSmrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6434b042e37fSmrg
64358bd17e5fSmrg    else
64368bd17e5fSmrg      GXX=no
64378bd17e5fSmrg      with_gnu_ld=no
64388bd17e5fSmrg      wlarc=
64398bd17e5fSmrg    fi
6440b042e37fSmrg
64418bd17e5fSmrg    # PORTME: fill in a description of your system's C++ link characteristics
64428bd17e5fSmrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
64438bd17e5fSmrg    _LT_TAGVAR(ld_shlibs, $1)=yes
64440597fb56Smrg    case $host_os in
64450597fb56Smrg      aix3*)
64468bd17e5fSmrg        # FIXME: insert proper C++ library support
64478bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
64480597fb56Smrg        ;;
64490597fb56Smrg      aix[[4-9]]*)
64503169be4bSmrg        if test ia64 = "$host_cpu"; then
64518bd17e5fSmrg          # On IA64, the linker does run time linking by default, so we don't
64528bd17e5fSmrg          # have to do anything special.
64538bd17e5fSmrg          aix_use_runtimelinking=no
64548bd17e5fSmrg          exp_sym_flag='-Bexport'
64553169be4bSmrg          no_entry_flag=
64568bd17e5fSmrg        else
64578bd17e5fSmrg          aix_use_runtimelinking=no
6458b042e37fSmrg
64598bd17e5fSmrg          # Test if we are trying to use run time linking or normal
64608bd17e5fSmrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
64613169be4bSmrg          # have runtime linking enabled, and use it for executables.
64623169be4bSmrg          # For shared libraries, we enable/disable runtime linking
64633169be4bSmrg          # depending on the kind of the shared library created -
64643169be4bSmrg          # when "with_aix_soname,aix_use_runtimelinking" is:
64653169be4bSmrg          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
64663169be4bSmrg          # "aix,yes"  lib.so          shared, rtl:yes, for executables
64673169be4bSmrg          #            lib.a           static archive
64683169be4bSmrg          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
64693169be4bSmrg          #            lib.a(lib.so.V) shared, rtl:no,  for executables
64703169be4bSmrg          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
64713169be4bSmrg          #            lib.a(lib.so.V) shared, rtl:no
64723169be4bSmrg          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
64733169be4bSmrg          #            lib.a           static archive
64748bd17e5fSmrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
64758bd17e5fSmrg	    for ld_flag in $LDFLAGS; do
64768bd17e5fSmrg	      case $ld_flag in
64778bd17e5fSmrg	      *-brtl*)
64788bd17e5fSmrg	        aix_use_runtimelinking=yes
64798bd17e5fSmrg	        break
64808bd17e5fSmrg	        ;;
64818bd17e5fSmrg	      esac
64828bd17e5fSmrg	    done
64833169be4bSmrg	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
64843169be4bSmrg	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
64853169be4bSmrg	      # so we don't have lib.a shared libs to link our executables.
64863169be4bSmrg	      # We have to force runtime linking in this case.
64873169be4bSmrg	      aix_use_runtimelinking=yes
64883169be4bSmrg	      LDFLAGS="$LDFLAGS -Wl,-brtl"
64893169be4bSmrg	    fi
64908bd17e5fSmrg	    ;;
64918bd17e5fSmrg          esac
6492b042e37fSmrg
64938bd17e5fSmrg          exp_sym_flag='-bexport'
64948bd17e5fSmrg          no_entry_flag='-bnoentry'
64958bd17e5fSmrg        fi
6496b042e37fSmrg
64978bd17e5fSmrg        # When large executables or shared objects are built, AIX ld can
64988bd17e5fSmrg        # have problems creating the table of contents.  If linking a library
64998bd17e5fSmrg        # or program results in "error TOC overflow" add -mminimal-toc to
65008bd17e5fSmrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
65018bd17e5fSmrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6502b042e37fSmrg
65038bd17e5fSmrg        _LT_TAGVAR(archive_cmds, $1)=''
65048bd17e5fSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
65058bd17e5fSmrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
65068bd17e5fSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
65078bd17e5fSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
65083169be4bSmrg        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
65093169be4bSmrg        case $with_aix_soname,$aix_use_runtimelinking in
65103169be4bSmrg        aix,*) ;;	# no import file
65113169be4bSmrg        svr4,* | *,yes) # use import file
65123169be4bSmrg          # The Import File defines what to hardcode.
65133169be4bSmrg          _LT_TAGVAR(hardcode_direct, $1)=no
65143169be4bSmrg          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
65153169be4bSmrg          ;;
65163169be4bSmrg        esac
6517b042e37fSmrg
65183169be4bSmrg        if test yes = "$GXX"; then
65198bd17e5fSmrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
65208bd17e5fSmrg          # We only want to do this on AIX 4.2 and lower, the check
65218bd17e5fSmrg          # below for broken collect2 doesn't work under 4.3+
65223169be4bSmrg	  collect2name=`$CC -print-prog-name=collect2`
65238bd17e5fSmrg	  if test -f "$collect2name" &&
65248bd17e5fSmrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
65258bd17e5fSmrg	  then
65268bd17e5fSmrg	    # We have reworked collect2
65278bd17e5fSmrg	    :
65288bd17e5fSmrg	  else
65298bd17e5fSmrg	    # We have old collect2
65308bd17e5fSmrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
65318bd17e5fSmrg	    # It fails to find uninstalled libraries when the uninstalled
65328bd17e5fSmrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
65338bd17e5fSmrg	    # to unsupported forces relinking
65348bd17e5fSmrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
65358bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
65368bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
65378bd17e5fSmrg	  fi
65388bd17e5fSmrg          esac
65398bd17e5fSmrg          shared_flag='-shared'
65403169be4bSmrg	  if test yes = "$aix_use_runtimelinking"; then
65413169be4bSmrg	    shared_flag=$shared_flag' $wl-G'
65428bd17e5fSmrg	  fi
65433169be4bSmrg	  # Need to ensure runtime linking is disabled for the traditional
65443169be4bSmrg	  # shared library, or the linker may eventually find shared libraries
65453169be4bSmrg	  # /with/ Import File - we do not want to mix them.
65463169be4bSmrg	  shared_flag_aix='-shared'
65473169be4bSmrg	  shared_flag_svr4='-shared $wl-G'
65488bd17e5fSmrg        else
65498bd17e5fSmrg          # not using gcc
65503169be4bSmrg          if test ia64 = "$host_cpu"; then
65518bd17e5fSmrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
65528bd17e5fSmrg	  # chokes on -Wl,-G. The following line is correct:
65538bd17e5fSmrg	  shared_flag='-G'
65548bd17e5fSmrg          else
65553169be4bSmrg	    if test yes = "$aix_use_runtimelinking"; then
65563169be4bSmrg	      shared_flag='$wl-G'
65578bd17e5fSmrg	    else
65583169be4bSmrg	      shared_flag='$wl-bM:SRE'
65598bd17e5fSmrg	    fi
65603169be4bSmrg	    shared_flag_aix='$wl-bM:SRE'
65613169be4bSmrg	    shared_flag_svr4='$wl-G'
65628bd17e5fSmrg          fi
65638bd17e5fSmrg        fi
6564706b6b52Smrg
65653169be4bSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
65668bd17e5fSmrg        # It seems that -bexpall does not export symbols beginning with
65678bd17e5fSmrg        # underscore (_), so it is better to generate a list of symbols to
65688bd17e5fSmrg	# export.
65698bd17e5fSmrg        _LT_TAGVAR(always_export_symbols, $1)=yes
65703169be4bSmrg	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
65718bd17e5fSmrg          # Warning - without using the other runtime loading flags (-brtl),
65728bd17e5fSmrg          # -berok will link without error, but may produce a broken library.
65733169be4bSmrg          # The "-G" linker flag allows undefined symbols.
65743169be4bSmrg          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
65758bd17e5fSmrg          # Determine the default libpath from the value encoded in an empty
65768bd17e5fSmrg          # executable.
65778bd17e5fSmrg          _LT_SYS_MODULE_PATH_AIX([$1])
65783169be4bSmrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
65798c4a8e55Smrg
65803169be4bSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
65818bd17e5fSmrg        else
65823169be4bSmrg          if test ia64 = "$host_cpu"; then
65833169be4bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
65848bd17e5fSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
65853169be4bSmrg	    _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"
65868bd17e5fSmrg          else
65878bd17e5fSmrg	    # Determine the default libpath from the value encoded in an
65888bd17e5fSmrg	    # empty executable.
65898bd17e5fSmrg	    _LT_SYS_MODULE_PATH_AIX([$1])
65903169be4bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
65918bd17e5fSmrg	    # Warning - without using the other run time loading flags,
65928bd17e5fSmrg	    # -berok will link without error, but may produce a broken library.
65933169be4bSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
65943169be4bSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
65953169be4bSmrg	    if test yes = "$with_gnu_ld"; then
65968bd17e5fSmrg	      # We only use this code for GNU lds that support --whole-archive.
65973169be4bSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
65988bd17e5fSmrg	    else
65998bd17e5fSmrg	      # Exported symbols can be pulled into shared objects from archives
66008bd17e5fSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
66018bd17e5fSmrg	    fi
66028bd17e5fSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
66033169be4bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
66043169be4bSmrg	    # -brtl affects multiple linker settings, -berok does not and is overridden later
66053169be4bSmrg	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
66063169be4bSmrg	    if test svr4 != "$with_aix_soname"; then
66073169be4bSmrg	      # This is similar to how AIX traditionally builds its shared
66083169be4bSmrg	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
66093169be4bSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
66103169be4bSmrg	    fi
66113169be4bSmrg	    if test aix != "$with_aix_soname"; then
66123169be4bSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
66133169be4bSmrg	    else
66143169be4bSmrg	      # used by -dlpreopen to get the symbols
66153169be4bSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
66163169be4bSmrg	    fi
66173169be4bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
66188bd17e5fSmrg          fi
66198bd17e5fSmrg        fi
66208bd17e5fSmrg        ;;
66218c4a8e55Smrg
66228bd17e5fSmrg      beos*)
66238bd17e5fSmrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
66248bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
66258bd17e5fSmrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
66268bd17e5fSmrg	  # support --undefined.  This deserves some investigation.  FIXME
66273169be4bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
66288bd17e5fSmrg	else
66298bd17e5fSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
66308bd17e5fSmrg	fi
66318bd17e5fSmrg	;;
66328c4a8e55Smrg
66338bd17e5fSmrg      chorus*)
66348bd17e5fSmrg        case $cc_basename in
66358bd17e5fSmrg          *)
66368bd17e5fSmrg	  # FIXME: insert proper C++ library support
66378bd17e5fSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
66388bd17e5fSmrg	  ;;
66398bd17e5fSmrg        esac
66408bd17e5fSmrg        ;;
66418c4a8e55Smrg
66428bd17e5fSmrg      cygwin* | mingw* | pw32* | cegcc*)
66438bd17e5fSmrg	case $GXX,$cc_basename in
66448bd17e5fSmrg	,cl* | no,cl*)
66458bd17e5fSmrg	  # Native MSVC
66468bd17e5fSmrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
66478bd17e5fSmrg	  # no search path for DLLs.
66488bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
66498bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
66508bd17e5fSmrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
66518bd17e5fSmrg	  _LT_TAGVAR(file_list_spec, $1)='@'
66528bd17e5fSmrg	  # Tell ltmain to make .lib files, not .a files.
66538bd17e5fSmrg	  libext=lib
66548bd17e5fSmrg	  # Tell ltmain to make .dll files, not .so files.
66553169be4bSmrg	  shrext_cmds=.dll
66568bd17e5fSmrg	  # FIXME: Setting linknames here is a bad hack.
66573169be4bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
66583169be4bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
66593169be4bSmrg              cp "$export_symbols" "$output_objdir/$soname.def";
66603169be4bSmrg              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
66613169be4bSmrg            else
66623169be4bSmrg              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
66633169be4bSmrg            fi~
66643169be4bSmrg            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
66653169be4bSmrg            linknames='
66668bd17e5fSmrg	  # The linker will not automatically build a static lib if we build a DLL.
66678bd17e5fSmrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
66688bd17e5fSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
66698bd17e5fSmrg	  # Don't use ranlib
66708bd17e5fSmrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
66718bd17e5fSmrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
66723169be4bSmrg            lt_tool_outputfile="@TOOL_OUTPUT@"~
66733169be4bSmrg            case $lt_outputfile in
66743169be4bSmrg              *.exe|*.EXE) ;;
66753169be4bSmrg              *)
66763169be4bSmrg                lt_outputfile=$lt_outputfile.exe
66773169be4bSmrg                lt_tool_outputfile=$lt_tool_outputfile.exe
66783169be4bSmrg                ;;
66793169be4bSmrg            esac~
66803169be4bSmrg            func_to_tool_file "$lt_outputfile"~
66813169be4bSmrg            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
66823169be4bSmrg              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
66833169be4bSmrg              $RM "$lt_outputfile.manifest";
66843169be4bSmrg            fi'
66858bd17e5fSmrg	  ;;
66868bd17e5fSmrg	*)
66878bd17e5fSmrg	  # g++
66888bd17e5fSmrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
66898bd17e5fSmrg	  # as there is no search path for DLLs.
66908bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
66913169be4bSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
66928bd17e5fSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
66938bd17e5fSmrg	  _LT_TAGVAR(always_export_symbols, $1)=no
66948bd17e5fSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
66958c4a8e55Smrg
66968bd17e5fSmrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
66973169be4bSmrg	    _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'
66983169be4bSmrg	    # If the export-symbols file already is a .def file, use it as
66993169be4bSmrg	    # is; otherwise, prepend EXPORTS...
67003169be4bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
67013169be4bSmrg              cp $export_symbols $output_objdir/$soname.def;
67023169be4bSmrg            else
67033169be4bSmrg              echo EXPORTS > $output_objdir/$soname.def;
67043169be4bSmrg              cat $export_symbols >> $output_objdir/$soname.def;
67053169be4bSmrg            fi~
67063169be4bSmrg            $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'
67078bd17e5fSmrg	  else
67088bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67098bd17e5fSmrg	  fi
67108bd17e5fSmrg	  ;;
67118bd17e5fSmrg	esac
67128bd17e5fSmrg	;;
67138bd17e5fSmrg      darwin* | rhapsody*)
67148bd17e5fSmrg        _LT_DARWIN_LINKER_FEATURES($1)
67158bd17e5fSmrg	;;
6716b042e37fSmrg
67173169be4bSmrg      os2*)
67183169be4bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
67193169be4bSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
67203169be4bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
67213169be4bSmrg	shrext_cmds=.dll
67223169be4bSmrg	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
67233169be4bSmrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
67243169be4bSmrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
67253169be4bSmrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
67263169be4bSmrg	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
67273169be4bSmrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
67283169be4bSmrg	  emximp -o $lib $output_objdir/$libname.def'
67293169be4bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
67303169be4bSmrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
67313169be4bSmrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
67323169be4bSmrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
67333169be4bSmrg	  prefix_cmds="$SED"~
67343169be4bSmrg	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
67353169be4bSmrg	    prefix_cmds="$prefix_cmds -e 1d";
67363169be4bSmrg	  fi~
67373169be4bSmrg	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
67383169be4bSmrg	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
67393169be4bSmrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
67403169be4bSmrg	  emximp -o $lib $output_objdir/$libname.def'
67413169be4bSmrg	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
67423169be4bSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
67433169be4bSmrg	;;
67443169be4bSmrg
67458bd17e5fSmrg      dgux*)
67468bd17e5fSmrg        case $cc_basename in
67478bd17e5fSmrg          ec++*)
67488bd17e5fSmrg	    # FIXME: insert proper C++ library support
67498bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67508bd17e5fSmrg	    ;;
67518bd17e5fSmrg          ghcx*)
67528bd17e5fSmrg	    # Green Hills C++ Compiler
67538bd17e5fSmrg	    # FIXME: insert proper C++ library support
67548bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67558bd17e5fSmrg	    ;;
67568bd17e5fSmrg          *)
67578bd17e5fSmrg	    # FIXME: insert proper C++ library support
67588bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67598bd17e5fSmrg	    ;;
67608bd17e5fSmrg        esac
67618bd17e5fSmrg        ;;
67628c4a8e55Smrg
67638bd17e5fSmrg      freebsd2.*)
67648bd17e5fSmrg        # C++ shared libraries reported to be fairly broken before
67658bd17e5fSmrg	# switch to ELF
67668bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
67678bd17e5fSmrg        ;;
67688c4a8e55Smrg
67698bd17e5fSmrg      freebsd-elf*)
67708bd17e5fSmrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
67718bd17e5fSmrg        ;;
6772b042e37fSmrg
67738bd17e5fSmrg      freebsd* | dragonfly*)
67748bd17e5fSmrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
67758bd17e5fSmrg        # conventions
67768bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
67778bd17e5fSmrg        ;;
6778b042e37fSmrg
67798bd17e5fSmrg      haiku*)
67803169be4bSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
67818bd17e5fSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
67828bd17e5fSmrg        ;;
67838c4a8e55Smrg
67848bd17e5fSmrg      hpux9*)
67853169be4bSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
67868bd17e5fSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
67873169be4bSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
67888bd17e5fSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
67898bd17e5fSmrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
67908bd17e5fSmrg				             # but as the default
67918bd17e5fSmrg				             # location of the library.
67928c4a8e55Smrg
67938bd17e5fSmrg        case $cc_basename in
67948bd17e5fSmrg          CC*)
67958bd17e5fSmrg            # FIXME: insert proper C++ library support
67968bd17e5fSmrg            _LT_TAGVAR(ld_shlibs, $1)=no
67978bd17e5fSmrg            ;;
67988bd17e5fSmrg          aCC*)
67993169be4bSmrg            _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 "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
68008bd17e5fSmrg            # Commands to make compiler produce verbose output that lists
68018bd17e5fSmrg            # what "hidden" libraries, object files and flags are used when
68028bd17e5fSmrg            # linking a shared library.
68038bd17e5fSmrg            #
68048bd17e5fSmrg            # There doesn't appear to be a way to prevent this compiler from
68058bd17e5fSmrg            # explicitly linking system object files so we need to strip them
68068bd17e5fSmrg            # from the output so that they don't get included in the library
68078bd17e5fSmrg            # dependencies.
68083169be4bSmrg            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"'
68098bd17e5fSmrg            ;;
68108bd17e5fSmrg          *)
68113169be4bSmrg            if test yes = "$GXX"; then
68123169be4bSmrg              _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 "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
68138bd17e5fSmrg            else
68148bd17e5fSmrg              # FIXME: insert proper C++ library support
68158bd17e5fSmrg              _LT_TAGVAR(ld_shlibs, $1)=no
68168bd17e5fSmrg            fi
68178bd17e5fSmrg            ;;
68188bd17e5fSmrg        esac
68198bd17e5fSmrg        ;;
68208c4a8e55Smrg
68218bd17e5fSmrg      hpux10*|hpux11*)
68223169be4bSmrg        if test no = "$with_gnu_ld"; then
68233169be4bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
68248bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
68258c4a8e55Smrg
68268bd17e5fSmrg          case $host_cpu in
68278bd17e5fSmrg            hppa*64*|ia64*)
68288bd17e5fSmrg              ;;
68298bd17e5fSmrg            *)
68303169be4bSmrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
68318bd17e5fSmrg              ;;
68328bd17e5fSmrg          esac
68338bd17e5fSmrg        fi
68348bd17e5fSmrg        case $host_cpu in
68358bd17e5fSmrg          hppa*64*|ia64*)
68368bd17e5fSmrg            _LT_TAGVAR(hardcode_direct, $1)=no
68378bd17e5fSmrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
68388bd17e5fSmrg            ;;
68398bd17e5fSmrg          *)
68408bd17e5fSmrg            _LT_TAGVAR(hardcode_direct, $1)=yes
68418bd17e5fSmrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
68428bd17e5fSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
68438bd17e5fSmrg					         # but as the default
68448bd17e5fSmrg					         # location of the library.
68458bd17e5fSmrg            ;;
68468bd17e5fSmrg        esac
6847706b6b52Smrg
68488bd17e5fSmrg        case $cc_basename in
68498bd17e5fSmrg          CC*)
68508bd17e5fSmrg	    # FIXME: insert proper C++ library support
68518bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
68528bd17e5fSmrg	    ;;
68538bd17e5fSmrg          aCC*)
68548bd17e5fSmrg	    case $host_cpu in
68558bd17e5fSmrg	      hppa*64*)
68563169be4bSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
68578bd17e5fSmrg	        ;;
68588bd17e5fSmrg	      ia64*)
68593169be4bSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
68608bd17e5fSmrg	        ;;
68618bd17e5fSmrg	      *)
68623169be4bSmrg	        _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'
68638bd17e5fSmrg	        ;;
68648bd17e5fSmrg	    esac
68658bd17e5fSmrg	    # Commands to make compiler produce verbose output that lists
68668bd17e5fSmrg	    # what "hidden" libraries, object files and flags are used when
68678bd17e5fSmrg	    # linking a shared library.
68688bd17e5fSmrg	    #
68698bd17e5fSmrg	    # There doesn't appear to be a way to prevent this compiler from
68708bd17e5fSmrg	    # explicitly linking system object files so we need to strip them
68718bd17e5fSmrg	    # from the output so that they don't get included in the library
68728bd17e5fSmrg	    # dependencies.
68733169be4bSmrg	    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"'
68748bd17e5fSmrg	    ;;
68758bd17e5fSmrg          *)
68763169be4bSmrg	    if test yes = "$GXX"; then
68773169be4bSmrg	      if test no = "$with_gnu_ld"; then
68788bd17e5fSmrg	        case $host_cpu in
68798bd17e5fSmrg	          hppa*64*)
68803169be4bSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
68818bd17e5fSmrg	            ;;
68828bd17e5fSmrg	          ia64*)
68833169be4bSmrg	            _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'
68848bd17e5fSmrg	            ;;
68858bd17e5fSmrg	          *)
68863169be4bSmrg	            _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'
68878bd17e5fSmrg	            ;;
68888bd17e5fSmrg	        esac
68898bd17e5fSmrg	      fi
68908bd17e5fSmrg	    else
68918bd17e5fSmrg	      # FIXME: insert proper C++ library support
68928bd17e5fSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
68938bd17e5fSmrg	    fi
68948bd17e5fSmrg	    ;;
68958bd17e5fSmrg        esac
68968bd17e5fSmrg        ;;
6897b042e37fSmrg
68988bd17e5fSmrg      interix[[3-9]]*)
68998bd17e5fSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
69008bd17e5fSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
69013169be4bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
69023169be4bSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
69038bd17e5fSmrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
69048bd17e5fSmrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
69058bd17e5fSmrg	# default) and relocated if they conflict, which is a slow very memory
69068bd17e5fSmrg	# consuming and fragmenting process.  To avoid this, we pick a random,
69078bd17e5fSmrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
69088bd17e5fSmrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
69093169be4bSmrg	_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'
69103169be4bSmrg	_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'
69118bd17e5fSmrg	;;
69128bd17e5fSmrg      irix5* | irix6*)
69138bd17e5fSmrg        case $cc_basename in
69148bd17e5fSmrg          CC*)
69158bd17e5fSmrg	    # SGI C++
69163169be4bSmrg	    _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'
69178c4a8e55Smrg
69188bd17e5fSmrg	    # Archives containing C++ object files must be created using
69198bd17e5fSmrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
69208bd17e5fSmrg	    # necessary to make sure instantiated templates are included
69218bd17e5fSmrg	    # in the archive.
69228bd17e5fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
69238bd17e5fSmrg	    ;;
69248bd17e5fSmrg          *)
69253169be4bSmrg	    if test yes = "$GXX"; then
69263169be4bSmrg	      if test no = "$with_gnu_ld"; then
69273169be4bSmrg	        _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'
69288bd17e5fSmrg	      else
69293169be4bSmrg	        _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'
69308bd17e5fSmrg	      fi
69318bd17e5fSmrg	    fi
69328bd17e5fSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
69338bd17e5fSmrg	    ;;
69348bd17e5fSmrg        esac
69353169be4bSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
69368bd17e5fSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
69378bd17e5fSmrg        _LT_TAGVAR(inherit_rpath, $1)=yes
69388bd17e5fSmrg        ;;
69398c4a8e55Smrg
6940b242714cSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
69418bd17e5fSmrg        case $cc_basename in
69428bd17e5fSmrg          KCC*)
69438bd17e5fSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
69448c4a8e55Smrg
69458bd17e5fSmrg	    # KCC will only create a shared library if the output file
69468bd17e5fSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
69478bd17e5fSmrg	    # to its proper name (with version) after linking.
69483169be4bSmrg	    _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'
69493169be4bSmrg	    _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'
69508bd17e5fSmrg	    # Commands to make compiler produce verbose output that lists
69518bd17e5fSmrg	    # what "hidden" libraries, object files and flags are used when
69528bd17e5fSmrg	    # linking a shared library.
69538bd17e5fSmrg	    #
69548bd17e5fSmrg	    # There doesn't appear to be a way to prevent this compiler from
69558bd17e5fSmrg	    # explicitly linking system object files so we need to strip them
69568bd17e5fSmrg	    # from the output so that they don't get included in the library
69578bd17e5fSmrg	    # dependencies.
69583169be4bSmrg	    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"'
69598c4a8e55Smrg
69603169be4bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
69613169be4bSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
69628c4a8e55Smrg
69638bd17e5fSmrg	    # Archives containing C++ object files must be created using
69648bd17e5fSmrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
69658bd17e5fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
69668bd17e5fSmrg	    ;;
69678bd17e5fSmrg	  icpc* | ecpc* )
69688bd17e5fSmrg	    # Intel C++
69698bd17e5fSmrg	    with_gnu_ld=yes
69708bd17e5fSmrg	    # version 8.0 and above of icpc choke on multiply defined symbols
69718bd17e5fSmrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
69728bd17e5fSmrg	    # earlier do not add the objects themselves.
69738bd17e5fSmrg	    case `$CC -V 2>&1` in
69748bd17e5fSmrg	      *"Version 7."*)
69753169be4bSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
69763169be4bSmrg		_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'
69778bd17e5fSmrg		;;
69788bd17e5fSmrg	      *)  # Version 8.0 or newer
69798bd17e5fSmrg	        tmp_idyn=
69808bd17e5fSmrg	        case $host_cpu in
69818bd17e5fSmrg		  ia64*) tmp_idyn=' -i_dynamic';;
69828bd17e5fSmrg		esac
69833169be4bSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
69843169be4bSmrg		_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'
69858bd17e5fSmrg		;;
69868bd17e5fSmrg	    esac
69878bd17e5fSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
69883169be4bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
69893169be4bSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
69903169be4bSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
69918bd17e5fSmrg	    ;;
69928bd17e5fSmrg          pgCC* | pgcpp*)
69938bd17e5fSmrg            # Portland Group C++ compiler
69948bd17e5fSmrg	    case `$CC -V` in
69958bd17e5fSmrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
69968bd17e5fSmrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
69973169be4bSmrg               rm -rf $tpldir~
69983169be4bSmrg               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
69993169be4bSmrg               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
70008bd17e5fSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
70013169be4bSmrg                rm -rf $tpldir~
70023169be4bSmrg                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
70033169be4bSmrg                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
70043169be4bSmrg                $RANLIB $oldlib'
70058bd17e5fSmrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
70063169be4bSmrg                rm -rf $tpldir~
70073169be4bSmrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
70083169be4bSmrg                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
70098bd17e5fSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
70103169be4bSmrg                rm -rf $tpldir~
70113169be4bSmrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
70123169be4bSmrg                $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'
70138bd17e5fSmrg	      ;;
70148bd17e5fSmrg	    *) # Version 6 and above use weak symbols
70153169be4bSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
70163169be4bSmrg	      _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'
70178bd17e5fSmrg	      ;;
70188bd17e5fSmrg	    esac
70198c4a8e55Smrg
70203169be4bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
70213169be4bSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
70223169be4bSmrg	    _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'
70238bd17e5fSmrg            ;;
70248bd17e5fSmrg	  cxx*)
70258bd17e5fSmrg	    # Compaq C++
70263169be4bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
70273169be4bSmrg	    _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'
70288c4a8e55Smrg
70298bd17e5fSmrg	    runpath_var=LD_RUN_PATH
70308bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
70318bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7032706b6b52Smrg
70338bd17e5fSmrg	    # Commands to make compiler produce verbose output that lists
70348bd17e5fSmrg	    # what "hidden" libraries, object files and flags are used when
70358bd17e5fSmrg	    # linking a shared library.
70368bd17e5fSmrg	    #
70378bd17e5fSmrg	    # There doesn't appear to be a way to prevent this compiler from
70388bd17e5fSmrg	    # explicitly linking system object files so we need to strip them
70398bd17e5fSmrg	    # from the output so that they don't get included in the library
70408bd17e5fSmrg	    # dependencies.
70413169be4bSmrg	    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'
70428bd17e5fSmrg	    ;;
70438bd17e5fSmrg	  xl* | mpixl* | bgxl*)
70448bd17e5fSmrg	    # IBM XL 8.0 on PPC, with GNU ld
70453169be4bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
70463169be4bSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
70473169be4bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
70483169be4bSmrg	    if test yes = "$supports_anon_versioning"; then
70498bd17e5fSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
70503169be4bSmrg                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
70513169be4bSmrg                echo "local: *; };" >> $output_objdir/$libname.ver~
70523169be4bSmrg                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
70538bd17e5fSmrg	    fi
70548bd17e5fSmrg	    ;;
70558bd17e5fSmrg	  *)
70568bd17e5fSmrg	    case `$CC -V 2>&1 | sed 5q` in
70578bd17e5fSmrg	    *Sun\ C*)
70588bd17e5fSmrg	      # Sun C++ 5.9
70598bd17e5fSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
70603169be4bSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
70613169be4bSmrg	      _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'
70628bd17e5fSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
70633169be4bSmrg	      _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'
70648bd17e5fSmrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
7065706b6b52Smrg
70668bd17e5fSmrg	      # Not sure whether something based on
70678bd17e5fSmrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
70688bd17e5fSmrg	      # would be better.
70698bd17e5fSmrg	      output_verbose_link_cmd='func_echo_all'
70708c4a8e55Smrg
70718bd17e5fSmrg	      # Archives containing C++ object files must be created using
70728bd17e5fSmrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
70738bd17e5fSmrg	      # necessary to make sure instantiated templates are included
70748bd17e5fSmrg	      # in the archive.
70758bd17e5fSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
70768bd17e5fSmrg	      ;;
70778bd17e5fSmrg	    esac
70788bd17e5fSmrg	    ;;
70798bd17e5fSmrg	esac
70808bd17e5fSmrg	;;
70818c4a8e55Smrg
70828bd17e5fSmrg      lynxos*)
70838bd17e5fSmrg        # FIXME: insert proper C++ library support
70848bd17e5fSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
70858bd17e5fSmrg	;;
70868c4a8e55Smrg
70878bd17e5fSmrg      m88k*)
70888bd17e5fSmrg        # FIXME: insert proper C++ library support
70898bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
70908bd17e5fSmrg	;;
70918c4a8e55Smrg
70928bd17e5fSmrg      mvs*)
70938bd17e5fSmrg        case $cc_basename in
70948bd17e5fSmrg          cxx*)
70958bd17e5fSmrg	    # FIXME: insert proper C++ library support
70968bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
70978bd17e5fSmrg	    ;;
70988bd17e5fSmrg	  *)
70998bd17e5fSmrg	    # FIXME: insert proper C++ library support
71008bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
71018bd17e5fSmrg	    ;;
71028bd17e5fSmrg	esac
71038bd17e5fSmrg	;;
71048c4a8e55Smrg
71058bd17e5fSmrg      netbsd*)
71068bd17e5fSmrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
71078bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
71088bd17e5fSmrg	  wlarc=
71098bd17e5fSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
71108bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
71118bd17e5fSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
71128bd17e5fSmrg	fi
71138bd17e5fSmrg	# Workaround some broken pre-1.5 toolchains
71148bd17e5fSmrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
71158bd17e5fSmrg	;;
7116b042e37fSmrg
71178bd17e5fSmrg      *nto* | *qnx*)
71188bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
71198bd17e5fSmrg	;;
7120b042e37fSmrg
71213169be4bSmrg      openbsd* | bitrig*)
71228bd17e5fSmrg	if test -f /usr/libexec/ld.so; then
71238bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
71248bd17e5fSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
71258bd17e5fSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
71268bd17e5fSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
71273169be4bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
71283169be4bSmrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
71293169be4bSmrg	    _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'
71303169be4bSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
71313169be4bSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
71328bd17e5fSmrg	  fi
71338bd17e5fSmrg	  output_verbose_link_cmd=func_echo_all
71348bd17e5fSmrg	else
71358bd17e5fSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
71368bd17e5fSmrg	fi
71378bd17e5fSmrg	;;
7138b042e37fSmrg
71398bd17e5fSmrg      osf3* | osf4* | osf5*)
71408bd17e5fSmrg        case $cc_basename in
71418bd17e5fSmrg          KCC*)
71428bd17e5fSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
71430597fb56Smrg
71448bd17e5fSmrg	    # KCC will only create a shared library if the output file
71458bd17e5fSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
71468bd17e5fSmrg	    # to its proper name (with version) after linking.
71473169be4bSmrg	    _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'
71480597fb56Smrg
71493169be4bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
71508bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
71510597fb56Smrg
71528bd17e5fSmrg	    # Archives containing C++ object files must be created using
71538bd17e5fSmrg	    # the KAI C++ compiler.
71548bd17e5fSmrg	    case $host in
71558bd17e5fSmrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
71568bd17e5fSmrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
71578bd17e5fSmrg	    esac
71588bd17e5fSmrg	    ;;
71598bd17e5fSmrg          RCC*)
71608bd17e5fSmrg	    # Rational C++ 2.4.1
71618bd17e5fSmrg	    # FIXME: insert proper C++ library support
71628bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
71638bd17e5fSmrg	    ;;
71648bd17e5fSmrg          cxx*)
71658bd17e5fSmrg	    case $host in
71668bd17e5fSmrg	      osf3*)
71673169be4bSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
71683169be4bSmrg	        _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'
71693169be4bSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
71708bd17e5fSmrg		;;
71718bd17e5fSmrg	      *)
71728bd17e5fSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
71733169be4bSmrg	        _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'
71748bd17e5fSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
71753169be4bSmrg                  echo "-hidden">> $lib.exp~
71763169be4bSmrg                  $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~
71773169be4bSmrg                  $RM $lib.exp'
71788bd17e5fSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
71798bd17e5fSmrg		;;
71808bd17e5fSmrg	    esac
71810597fb56Smrg
71828bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
71830597fb56Smrg
71848bd17e5fSmrg	    # Commands to make compiler produce verbose output that lists
71858bd17e5fSmrg	    # what "hidden" libraries, object files and flags are used when
71868bd17e5fSmrg	    # linking a shared library.
71878bd17e5fSmrg	    #
71888bd17e5fSmrg	    # There doesn't appear to be a way to prevent this compiler from
71898bd17e5fSmrg	    # explicitly linking system object files so we need to strip them
71908bd17e5fSmrg	    # from the output so that they don't get included in the library
71918bd17e5fSmrg	    # dependencies.
71923169be4bSmrg	    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"'
71938bd17e5fSmrg	    ;;
71948bd17e5fSmrg	  *)
71953169be4bSmrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
71963169be4bSmrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
71978bd17e5fSmrg	      case $host in
71988bd17e5fSmrg	        osf3*)
71993169be4bSmrg	          _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'
72008bd17e5fSmrg		  ;;
72018bd17e5fSmrg	        *)
72023169be4bSmrg	          _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'
72038bd17e5fSmrg		  ;;
72048bd17e5fSmrg	      esac
72050597fb56Smrg
72063169be4bSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
72078bd17e5fSmrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
72080597fb56Smrg
72098bd17e5fSmrg	      # Commands to make compiler produce verbose output that lists
72108bd17e5fSmrg	      # what "hidden" libraries, object files and flags are used when
72118bd17e5fSmrg	      # linking a shared library.
72128bd17e5fSmrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7213b042e37fSmrg
72148bd17e5fSmrg	    else
72158bd17e5fSmrg	      # FIXME: insert proper C++ library support
72168bd17e5fSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
72178bd17e5fSmrg	    fi
72188bd17e5fSmrg	    ;;
72198bd17e5fSmrg        esac
72208bd17e5fSmrg        ;;
7221b042e37fSmrg
72228bd17e5fSmrg      psos*)
72238bd17e5fSmrg        # FIXME: insert proper C++ library support
72248bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
72258bd17e5fSmrg        ;;
7226b042e37fSmrg
72278bd17e5fSmrg      sunos4*)
72288bd17e5fSmrg        case $cc_basename in
72298bd17e5fSmrg          CC*)
72308bd17e5fSmrg	    # Sun C++ 4.x
72318bd17e5fSmrg	    # FIXME: insert proper C++ library support
72328bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72338bd17e5fSmrg	    ;;
72348bd17e5fSmrg          lcc*)
72358bd17e5fSmrg	    # Lucid
72368bd17e5fSmrg	    # FIXME: insert proper C++ library support
72378bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72388bd17e5fSmrg	    ;;
72398bd17e5fSmrg          *)
72408bd17e5fSmrg	    # FIXME: insert proper C++ library support
72418bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72428bd17e5fSmrg	    ;;
72438bd17e5fSmrg        esac
72448bd17e5fSmrg        ;;
7245b042e37fSmrg
72468bd17e5fSmrg      solaris*)
72478bd17e5fSmrg        case $cc_basename in
72488bd17e5fSmrg          CC* | sunCC*)
72498bd17e5fSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
72508bd17e5fSmrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
72518bd17e5fSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
72523169be4bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
72538bd17e5fSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
72543169be4bSmrg              $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'
7255b042e37fSmrg
72568bd17e5fSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
72578bd17e5fSmrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
72588bd17e5fSmrg	    case $host_os in
72598bd17e5fSmrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
72608bd17e5fSmrg	      *)
72618bd17e5fSmrg		# The compiler driver will combine and reorder linker options,
72623169be4bSmrg		# but understands '-z linker_flag'.
72638bd17e5fSmrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
72648bd17e5fSmrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
72658bd17e5fSmrg	        ;;
72668bd17e5fSmrg	    esac
72678bd17e5fSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7268b042e37fSmrg
72698bd17e5fSmrg	    output_verbose_link_cmd='func_echo_all'
7270b042e37fSmrg
72718bd17e5fSmrg	    # Archives containing C++ object files must be created using
72728bd17e5fSmrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
72738bd17e5fSmrg	    # necessary to make sure instantiated templates are included
72748bd17e5fSmrg	    # in the archive.
72758bd17e5fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
72768bd17e5fSmrg	    ;;
72778bd17e5fSmrg          gcx*)
72788bd17e5fSmrg	    # Green Hills C++ Compiler
72793169be4bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7280b042e37fSmrg
72818bd17e5fSmrg	    # The C++ compiler must be used to create the archive.
72828bd17e5fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
72838bd17e5fSmrg	    ;;
72848bd17e5fSmrg          *)
72858bd17e5fSmrg	    # GNU C++ compiler with Solaris linker
72863169be4bSmrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
72873169be4bSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
72888bd17e5fSmrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
72893169be4bSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
72908bd17e5fSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
72913169be4bSmrg                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7292b042e37fSmrg
72938bd17e5fSmrg	        # Commands to make compiler produce verbose output that lists
72948bd17e5fSmrg	        # what "hidden" libraries, object files and flags are used when
72958bd17e5fSmrg	        # linking a shared library.
72968bd17e5fSmrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
72978bd17e5fSmrg	      else
72983169be4bSmrg	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
72998bd17e5fSmrg	        # platform.
73003169be4bSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
73018bd17e5fSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
73023169be4bSmrg                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7303b042e37fSmrg
73048bd17e5fSmrg	        # Commands to make compiler produce verbose output that lists
73058bd17e5fSmrg	        # what "hidden" libraries, object files and flags are used when
73068bd17e5fSmrg	        # linking a shared library.
73078bd17e5fSmrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
73088bd17e5fSmrg	      fi
7309b042e37fSmrg
73103169be4bSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
73118bd17e5fSmrg	      case $host_os in
73128bd17e5fSmrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
73138bd17e5fSmrg		*)
73143169be4bSmrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
73158bd17e5fSmrg		  ;;
73168bd17e5fSmrg	      esac
73178bd17e5fSmrg	    fi
73188bd17e5fSmrg	    ;;
73198bd17e5fSmrg        esac
73208bd17e5fSmrg        ;;
7321706b6b52Smrg
73228bd17e5fSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
73233169be4bSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
73248bd17e5fSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
73258bd17e5fSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
73268bd17e5fSmrg      runpath_var='LD_RUN_PATH'
73270597fb56Smrg
73288bd17e5fSmrg      case $cc_basename in
73298bd17e5fSmrg        CC*)
73303169be4bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73313169be4bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73328bd17e5fSmrg	  ;;
73338bd17e5fSmrg	*)
73343169be4bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73353169be4bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73368bd17e5fSmrg	  ;;
73378bd17e5fSmrg      esac
73388bd17e5fSmrg      ;;
73390597fb56Smrg
73408bd17e5fSmrg      sysv5* | sco3.2v5* | sco5v6*)
73413169be4bSmrg	# Note: We CANNOT use -z defs as we might desire, because we do not
73428bd17e5fSmrg	# link with -lc, and that would cause any symbols used from libc to
73438bd17e5fSmrg	# always be unresolved, which means just about no library would
73448bd17e5fSmrg	# ever link correctly.  If we're not using GNU ld we use -z text
73458bd17e5fSmrg	# though, which does catch some bad symbols but isn't as heavy-handed
73468bd17e5fSmrg	# as -z defs.
73473169be4bSmrg	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
73483169be4bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
73498bd17e5fSmrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
73508bd17e5fSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
73513169be4bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
73528bd17e5fSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
73538bd17e5fSmrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
73543169be4bSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
73558bd17e5fSmrg	runpath_var='LD_RUN_PATH'
73568bd17e5fSmrg
73578bd17e5fSmrg	case $cc_basename in
73588bd17e5fSmrg          CC*)
73593169be4bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73603169be4bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73618bd17e5fSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
73623169be4bSmrg              '"$_LT_TAGVAR(old_archive_cmds, $1)"
73638bd17e5fSmrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
73643169be4bSmrg              '"$_LT_TAGVAR(reload_cmds, $1)"
73658bd17e5fSmrg	    ;;
73668bd17e5fSmrg	  *)
73673169be4bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73683169be4bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73698bd17e5fSmrg	    ;;
73708bd17e5fSmrg	esac
73718bd17e5fSmrg      ;;
73720597fb56Smrg
73738bd17e5fSmrg      tandem*)
73748bd17e5fSmrg        case $cc_basename in
73758bd17e5fSmrg          NCC*)
73768bd17e5fSmrg	    # NonStop-UX NCC 3.20
73778bd17e5fSmrg	    # FIXME: insert proper C++ library support
73788bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
73798bd17e5fSmrg	    ;;
73808bd17e5fSmrg          *)
73818bd17e5fSmrg	    # FIXME: insert proper C++ library support
73828bd17e5fSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
73838bd17e5fSmrg	    ;;
73848bd17e5fSmrg        esac
73858bd17e5fSmrg        ;;
73860597fb56Smrg
73878bd17e5fSmrg      vxworks*)
73888bd17e5fSmrg        # FIXME: insert proper C++ library support
73898bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
73908bd17e5fSmrg        ;;
73910597fb56Smrg
73928bd17e5fSmrg      *)
73938bd17e5fSmrg        # FIXME: insert proper C++ library support
73948bd17e5fSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
73958bd17e5fSmrg        ;;
73968bd17e5fSmrg    esac
73970597fb56Smrg
73988bd17e5fSmrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
73993169be4bSmrg    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
74000597fb56Smrg
74013169be4bSmrg    _LT_TAGVAR(GCC, $1)=$GXX
74023169be4bSmrg    _LT_TAGVAR(LD, $1)=$LD
7403b042e37fSmrg
74048bd17e5fSmrg    ## CAVEAT EMPTOR:
74058bd17e5fSmrg    ## There is no encapsulation within the following macros, do not change
74068bd17e5fSmrg    ## the running order or otherwise move them around unless you know exactly
74078bd17e5fSmrg    ## what you are doing...
74088bd17e5fSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
74098bd17e5fSmrg    _LT_COMPILER_PIC($1)
74108bd17e5fSmrg    _LT_COMPILER_C_O($1)
74118bd17e5fSmrg    _LT_COMPILER_FILE_LOCKS($1)
74128bd17e5fSmrg    _LT_LINKER_SHLIBS($1)
74138bd17e5fSmrg    _LT_SYS_DYNAMIC_LINKER($1)
74148bd17e5fSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7415b042e37fSmrg
74168bd17e5fSmrg    _LT_CONFIG($1)
74178bd17e5fSmrg  fi # test -n "$compiler"
7418b042e37fSmrg
74198bd17e5fSmrg  CC=$lt_save_CC
74208bd17e5fSmrg  CFLAGS=$lt_save_CFLAGS
74218bd17e5fSmrg  LDCXX=$LD
74228bd17e5fSmrg  LD=$lt_save_LD
74238bd17e5fSmrg  GCC=$lt_save_GCC
74248bd17e5fSmrg  with_gnu_ld=$lt_save_with_gnu_ld
74258bd17e5fSmrg  lt_cv_path_LDCXX=$lt_cv_path_LD
74268bd17e5fSmrg  lt_cv_path_LD=$lt_save_path_LD
74278bd17e5fSmrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
74288bd17e5fSmrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
74293169be4bSmrgfi # test yes != "$_lt_caught_CXX_error"
7430b042e37fSmrg
74318bd17e5fSmrgAC_LANG_POP
74328bd17e5fSmrg])# _LT_LANG_CXX_CONFIG
7433b042e37fSmrg
7434b042e37fSmrg
74358bd17e5fSmrg# _LT_FUNC_STRIPNAME_CNF
74368bd17e5fSmrg# ----------------------
74378bd17e5fSmrg# func_stripname_cnf prefix suffix name
74388bd17e5fSmrg# strip PREFIX and SUFFIX off of NAME.
74398bd17e5fSmrg# PREFIX and SUFFIX must not contain globbing or regex special
74408bd17e5fSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
74418bd17e5fSmrg# dot (in which case that matches only a dot).
74428bd17e5fSmrg#
74438bd17e5fSmrg# This function is identical to the (non-XSI) version of func_stripname,
74448bd17e5fSmrg# except this one can be used by m4 code that may be executed by configure,
74458bd17e5fSmrg# rather than the libtool script.
74468bd17e5fSmrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
74478bd17e5fSmrgAC_REQUIRE([_LT_DECL_SED])
74488bd17e5fSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
74498bd17e5fSmrgfunc_stripname_cnf ()
74508bd17e5fSmrg{
74513169be4bSmrg  case @S|@2 in
74523169be4bSmrg  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
74533169be4bSmrg  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
74548bd17e5fSmrg  esac
74558bd17e5fSmrg} # func_stripname_cnf
74568bd17e5fSmrg])# _LT_FUNC_STRIPNAME_CNF
7457b042e37fSmrg
74583169be4bSmrg
74598bd17e5fSmrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
74608bd17e5fSmrg# ---------------------------------
74618bd17e5fSmrg# Figure out "hidden" library dependencies from verbose
74628bd17e5fSmrg# compiler output when linking a shared library.
74638bd17e5fSmrg# Parse the compiler output and extract the necessary
74648bd17e5fSmrg# objects, libraries and library flags.
74658bd17e5fSmrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
74668bd17e5fSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
74678bd17e5fSmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
74688bd17e5fSmrg# Dependencies to place before and after the object being linked:
74698bd17e5fSmrg_LT_TAGVAR(predep_objects, $1)=
74708bd17e5fSmrg_LT_TAGVAR(postdep_objects, $1)=
74718bd17e5fSmrg_LT_TAGVAR(predeps, $1)=
74728bd17e5fSmrg_LT_TAGVAR(postdeps, $1)=
74738bd17e5fSmrg_LT_TAGVAR(compiler_lib_search_path, $1)=
7474b042e37fSmrg
74758bd17e5fSmrgdnl we can't use the lt_simple_compile_test_code here,
74768bd17e5fSmrgdnl because it contains code intended for an executable,
74778bd17e5fSmrgdnl not a library.  It's possible we should let each
74788bd17e5fSmrgdnl tag define a new lt_????_link_test_code variable,
74798bd17e5fSmrgdnl but it's only used here...
74808bd17e5fSmrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
74818bd17e5fSmrgint a;
74828bd17e5fSmrgvoid foo (void) { a = 0; }
74838bd17e5fSmrg_LT_EOF
74848bd17e5fSmrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
74858bd17e5fSmrgclass Foo
74868bd17e5fSmrg{
74878bd17e5fSmrgpublic:
74888bd17e5fSmrg  Foo (void) { a = 0; }
74898bd17e5fSmrgprivate:
74908bd17e5fSmrg  int a;
74918bd17e5fSmrg};
74928bd17e5fSmrg_LT_EOF
74938bd17e5fSmrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
74948bd17e5fSmrg      subroutine foo
74958bd17e5fSmrg      implicit none
74968bd17e5fSmrg      integer*4 a
74978bd17e5fSmrg      a=0
74988bd17e5fSmrg      return
74998bd17e5fSmrg      end
75008bd17e5fSmrg_LT_EOF
75018bd17e5fSmrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
75028bd17e5fSmrg      subroutine foo
75038bd17e5fSmrg      implicit none
75048bd17e5fSmrg      integer a
75058bd17e5fSmrg      a=0
75068bd17e5fSmrg      return
75078bd17e5fSmrg      end
75088bd17e5fSmrg_LT_EOF
75098bd17e5fSmrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
75108bd17e5fSmrgpublic class foo {
75118bd17e5fSmrg  private int a;
75128bd17e5fSmrg  public void bar (void) {
75138bd17e5fSmrg    a = 0;
75148bd17e5fSmrg  }
75158bd17e5fSmrg};
75168bd17e5fSmrg_LT_EOF
75178bd17e5fSmrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
75188bd17e5fSmrgpackage foo
75198bd17e5fSmrgfunc foo() {
75208bd17e5fSmrg}
75218bd17e5fSmrg_LT_EOF
75228bd17e5fSmrg])
7523b042e37fSmrg
75248bd17e5fSmrg_lt_libdeps_save_CFLAGS=$CFLAGS
75258bd17e5fSmrgcase "$CC $CFLAGS " in #(
75268bd17e5fSmrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
75278bd17e5fSmrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
75288bd17e5fSmrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
75298bd17e5fSmrgesac
7530b042e37fSmrg
75318bd17e5fSmrgdnl Parse the compiler output and extract the necessary
75328bd17e5fSmrgdnl objects, libraries and library flags.
75338bd17e5fSmrgif AC_TRY_EVAL(ac_compile); then
75348bd17e5fSmrg  # Parse the compiler output and extract the necessary
75358bd17e5fSmrg  # objects, libraries and library flags.
7536b042e37fSmrg
75378bd17e5fSmrg  # Sentinel used to keep track of whether or not we are before
75388bd17e5fSmrg  # the conftest object file.
75398bd17e5fSmrg  pre_test_object_deps_done=no
7540b042e37fSmrg
75418bd17e5fSmrg  for p in `eval "$output_verbose_link_cmd"`; do
75423169be4bSmrg    case $prev$p in
7543b042e37fSmrg
75448bd17e5fSmrg    -L* | -R* | -l*)
75458bd17e5fSmrg       # Some compilers place space between "-{L,R}" and the path.
75468bd17e5fSmrg       # Remove the space.
75473169be4bSmrg       if test x-L = "$p" ||
75483169be4bSmrg          test x-R = "$p"; then
75498bd17e5fSmrg	 prev=$p
75508bd17e5fSmrg	 continue
75518bd17e5fSmrg       fi
75520597fb56Smrg
75538bd17e5fSmrg       # Expand the sysroot to ease extracting the directories later.
75548bd17e5fSmrg       if test -z "$prev"; then
75558bd17e5fSmrg         case $p in
75568bd17e5fSmrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
75578bd17e5fSmrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
75588bd17e5fSmrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
75598bd17e5fSmrg         esac
75608bd17e5fSmrg       fi
75618bd17e5fSmrg       case $p in
75628bd17e5fSmrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
75638bd17e5fSmrg       esac
75643169be4bSmrg       if test no = "$pre_test_object_deps_done"; then
75653169be4bSmrg	 case $prev in
75668bd17e5fSmrg	 -L | -R)
75678bd17e5fSmrg	   # Internal compiler library paths should come after those
75688bd17e5fSmrg	   # provided the user.  The postdeps already come after the
75698bd17e5fSmrg	   # user supplied libs so there is no need to process them.
75708bd17e5fSmrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
75713169be4bSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
75728bd17e5fSmrg	   else
75733169be4bSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
75748bd17e5fSmrg	   fi
75758bd17e5fSmrg	   ;;
75768bd17e5fSmrg	 # The "-l" case would never come before the object being
75778bd17e5fSmrg	 # linked, so don't bother handling this case.
75788bd17e5fSmrg	 esac
75798bd17e5fSmrg       else
75808bd17e5fSmrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
75813169be4bSmrg	   _LT_TAGVAR(postdeps, $1)=$prev$p
75828bd17e5fSmrg	 else
75833169be4bSmrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
75848bd17e5fSmrg	 fi
75858bd17e5fSmrg       fi
75868bd17e5fSmrg       prev=
75878bd17e5fSmrg       ;;
75880597fb56Smrg
75898bd17e5fSmrg    *.lto.$objext) ;; # Ignore GCC LTO objects
75908bd17e5fSmrg    *.$objext)
75918bd17e5fSmrg       # This assumes that the test object file only shows up
75928bd17e5fSmrg       # once in the compiler output.
75938bd17e5fSmrg       if test "$p" = "conftest.$objext"; then
75948bd17e5fSmrg	 pre_test_object_deps_done=yes
75958bd17e5fSmrg	 continue
75968bd17e5fSmrg       fi
75970597fb56Smrg
75983169be4bSmrg       if test no = "$pre_test_object_deps_done"; then
75998bd17e5fSmrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
76003169be4bSmrg	   _LT_TAGVAR(predep_objects, $1)=$p
76018bd17e5fSmrg	 else
76028bd17e5fSmrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
76038bd17e5fSmrg	 fi
76048bd17e5fSmrg       else
76058bd17e5fSmrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
76063169be4bSmrg	   _LT_TAGVAR(postdep_objects, $1)=$p
76078bd17e5fSmrg	 else
76088bd17e5fSmrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
76098bd17e5fSmrg	 fi
76108bd17e5fSmrg       fi
76118bd17e5fSmrg       ;;
76120597fb56Smrg
76138bd17e5fSmrg    *) ;; # Ignore the rest.
76140597fb56Smrg
76150597fb56Smrg    esac
76168bd17e5fSmrg  done
76178bd17e5fSmrg
76188bd17e5fSmrg  # Clean up.
76198bd17e5fSmrg  rm -f a.out a.exe
76208bd17e5fSmrgelse
76218bd17e5fSmrg  echo "libtool.m4: error: problem compiling $1 test program"
76228bd17e5fSmrgfi
76238bd17e5fSmrg
76248bd17e5fSmrg$RM -f confest.$objext
76258bd17e5fSmrgCFLAGS=$_lt_libdeps_save_CFLAGS
76268bd17e5fSmrg
76278bd17e5fSmrg# PORTME: override above test on systems where it is broken
76288bd17e5fSmrgm4_if([$1], [CXX],
76298bd17e5fSmrg[case $host_os in
76308bd17e5fSmrginterix[[3-9]]*)
76318bd17e5fSmrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
76328bd17e5fSmrg  # hack all around it, let's just trust "g++" to DTRT.
76338bd17e5fSmrg  _LT_TAGVAR(predep_objects,$1)=
76348bd17e5fSmrg  _LT_TAGVAR(postdep_objects,$1)=
76358bd17e5fSmrg  _LT_TAGVAR(postdeps,$1)=
76368bd17e5fSmrg  ;;
76373169be4bSmrgesac
76383169be4bSmrg])
7639b042e37fSmrg
76408bd17e5fSmrgcase " $_LT_TAGVAR(postdeps, $1) " in
76418bd17e5fSmrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
76428bd17e5fSmrgesac
76438bd17e5fSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
76448bd17e5fSmrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
76453169be4bSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
76468bd17e5fSmrgfi
76478bd17e5fSmrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
76488bd17e5fSmrg    [The directories searched by this compiler when creating a shared library])
76498bd17e5fSmrg_LT_TAGDECL([], [predep_objects], [1],
76508bd17e5fSmrg    [Dependencies to place before and after the objects being linked to
76518bd17e5fSmrg    create a shared library])
76528bd17e5fSmrg_LT_TAGDECL([], [postdep_objects], [1])
76538bd17e5fSmrg_LT_TAGDECL([], [predeps], [1])
76548bd17e5fSmrg_LT_TAGDECL([], [postdeps], [1])
76558bd17e5fSmrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
76568bd17e5fSmrg    [The library search path used internally by the compiler when linking
76578bd17e5fSmrg    a shared library])
76588bd17e5fSmrg])# _LT_SYS_HIDDEN_LIBDEPS
76598c4a8e55Smrg
76608c4a8e55Smrg
76618bd17e5fSmrg# _LT_LANG_F77_CONFIG([TAG])
76628bd17e5fSmrg# --------------------------
76638bd17e5fSmrg# Ensure that the configuration variables for a Fortran 77 compiler are
76648bd17e5fSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
76653169be4bSmrg# to write the compiler configuration to 'libtool'.
76668bd17e5fSmrgm4_defun([_LT_LANG_F77_CONFIG],
76678bd17e5fSmrg[AC_LANG_PUSH(Fortran 77)
76683169be4bSmrgif test -z "$F77" || test no = "$F77"; then
76698bd17e5fSmrg  _lt_disable_F77=yes
76708bd17e5fSmrgfi
7671b042e37fSmrg
76728bd17e5fSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
76738bd17e5fSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
76748bd17e5fSmrg_LT_TAGVAR(always_export_symbols, $1)=no
76758bd17e5fSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
76768bd17e5fSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
76778bd17e5fSmrg_LT_TAGVAR(hardcode_direct, $1)=no
76788bd17e5fSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
76798bd17e5fSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
76808bd17e5fSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
76818bd17e5fSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
76828bd17e5fSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
76838bd17e5fSmrg_LT_TAGVAR(inherit_rpath, $1)=no
76848bd17e5fSmrg_LT_TAGVAR(module_cmds, $1)=
76858bd17e5fSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
76868bd17e5fSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
76878bd17e5fSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
76888bd17e5fSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
76898bd17e5fSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
76908bd17e5fSmrg_LT_TAGVAR(no_undefined_flag, $1)=
76918bd17e5fSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
76928bd17e5fSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7693b042e37fSmrg
76948bd17e5fSmrg# Source file extension for f77 test sources.
76958bd17e5fSmrgac_ext=f
7696b042e37fSmrg
76978bd17e5fSmrg# Object file extension for compiled f77 test sources.
76988bd17e5fSmrgobjext=o
76998bd17e5fSmrg_LT_TAGVAR(objext, $1)=$objext
77008c4a8e55Smrg
77018bd17e5fSmrg# No sense in running all these tests if we already determined that
77028bd17e5fSmrg# the F77 compiler isn't working.  Some variables (like enable_shared)
77038bd17e5fSmrg# are currently assumed to apply to all compilers on this platform,
77048bd17e5fSmrg# and will be corrupted by setting them based on a non-working compiler.
77053169be4bSmrgif test yes != "$_lt_disable_F77"; then
77068bd17e5fSmrg  # Code to be used in simple compile tests
77078bd17e5fSmrg  lt_simple_compile_test_code="\
77088bd17e5fSmrg      subroutine t
77098bd17e5fSmrg      return
77108bd17e5fSmrg      end
77118bd17e5fSmrg"
77128c4a8e55Smrg
77138bd17e5fSmrg  # Code to be used in simple link tests
77148bd17e5fSmrg  lt_simple_link_test_code="\
77158bd17e5fSmrg      program t
77168bd17e5fSmrg      end
77178bd17e5fSmrg"
77188c4a8e55Smrg
77198bd17e5fSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
77208bd17e5fSmrg  _LT_TAG_COMPILER
7721b042e37fSmrg
77228bd17e5fSmrg  # save warnings/boilerplate of simple test code
77238bd17e5fSmrg  _LT_COMPILER_BOILERPLATE
77248bd17e5fSmrg  _LT_LINKER_BOILERPLATE
7725b042e37fSmrg
77268bd17e5fSmrg  # Allow CC to be a program name with arguments.
77273169be4bSmrg  lt_save_CC=$CC
77288bd17e5fSmrg  lt_save_GCC=$GCC
77298bd17e5fSmrg  lt_save_CFLAGS=$CFLAGS
77308bd17e5fSmrg  CC=${F77-"f77"}
77318bd17e5fSmrg  CFLAGS=$FFLAGS
77328bd17e5fSmrg  compiler=$CC
77338bd17e5fSmrg  _LT_TAGVAR(compiler, $1)=$CC
77348bd17e5fSmrg  _LT_CC_BASENAME([$compiler])
77358bd17e5fSmrg  GCC=$G77
77368bd17e5fSmrg  if test -n "$compiler"; then
77378bd17e5fSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
77388bd17e5fSmrg    AC_MSG_RESULT([$can_build_shared])
77398c4a8e55Smrg
77408bd17e5fSmrg    AC_MSG_CHECKING([whether to build shared libraries])
77413169be4bSmrg    test no = "$can_build_shared" && enable_shared=no
7742b042e37fSmrg
77438bd17e5fSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
77448bd17e5fSmrg    # are all built from PIC.
77458bd17e5fSmrg    case $host_os in
77468bd17e5fSmrg      aix3*)
77473169be4bSmrg        test yes = "$enable_shared" && enable_static=no
77488bd17e5fSmrg        if test -n "$RANLIB"; then
77498bd17e5fSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
77508bd17e5fSmrg          postinstall_cmds='$RANLIB $lib'
77518bd17e5fSmrg        fi
77528bd17e5fSmrg        ;;
77538bd17e5fSmrg      aix[[4-9]]*)
77543169be4bSmrg	if test ia64 != "$host_cpu"; then
77553169be4bSmrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
77563169be4bSmrg	  yes,aix,yes) ;;		# shared object as lib.so file only
77573169be4bSmrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
77583169be4bSmrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
77593169be4bSmrg	  esac
77608bd17e5fSmrg	fi
77618bd17e5fSmrg        ;;
77628bd17e5fSmrg    esac
77638bd17e5fSmrg    AC_MSG_RESULT([$enable_shared])
7764b042e37fSmrg
77658bd17e5fSmrg    AC_MSG_CHECKING([whether to build static libraries])
77668bd17e5fSmrg    # Make sure either enable_shared or enable_static is yes.
77673169be4bSmrg    test yes = "$enable_shared" || enable_static=yes
77688bd17e5fSmrg    AC_MSG_RESULT([$enable_static])
7769b042e37fSmrg
77703169be4bSmrg    _LT_TAGVAR(GCC, $1)=$G77
77713169be4bSmrg    _LT_TAGVAR(LD, $1)=$LD
7772b042e37fSmrg
77738bd17e5fSmrg    ## CAVEAT EMPTOR:
77748bd17e5fSmrg    ## There is no encapsulation within the following macros, do not change
77758bd17e5fSmrg    ## the running order or otherwise move them around unless you know exactly
77768bd17e5fSmrg    ## what you are doing...
77778bd17e5fSmrg    _LT_COMPILER_PIC($1)
77788bd17e5fSmrg    _LT_COMPILER_C_O($1)
77798bd17e5fSmrg    _LT_COMPILER_FILE_LOCKS($1)
77808bd17e5fSmrg    _LT_LINKER_SHLIBS($1)
77818bd17e5fSmrg    _LT_SYS_DYNAMIC_LINKER($1)
77828bd17e5fSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7783b042e37fSmrg
77848bd17e5fSmrg    _LT_CONFIG($1)
77858bd17e5fSmrg  fi # test -n "$compiler"
7786b042e37fSmrg
77878bd17e5fSmrg  GCC=$lt_save_GCC
77883169be4bSmrg  CC=$lt_save_CC
77893169be4bSmrg  CFLAGS=$lt_save_CFLAGS
77903169be4bSmrgfi # test yes != "$_lt_disable_F77"
7791b042e37fSmrg
77928bd17e5fSmrgAC_LANG_POP
77938bd17e5fSmrg])# _LT_LANG_F77_CONFIG
7794706b6b52Smrg
7795706b6b52Smrg
77968bd17e5fSmrg# _LT_LANG_FC_CONFIG([TAG])
77978bd17e5fSmrg# -------------------------
77988bd17e5fSmrg# Ensure that the configuration variables for a Fortran compiler are
77998bd17e5fSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
78003169be4bSmrg# to write the compiler configuration to 'libtool'.
78018bd17e5fSmrgm4_defun([_LT_LANG_FC_CONFIG],
78028bd17e5fSmrg[AC_LANG_PUSH(Fortran)
7803706b6b52Smrg
78043169be4bSmrgif test -z "$FC" || test no = "$FC"; then
78058bd17e5fSmrg  _lt_disable_FC=yes
78068bd17e5fSmrgfi
7807706b6b52Smrg
78088bd17e5fSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
78098bd17e5fSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
78108bd17e5fSmrg_LT_TAGVAR(always_export_symbols, $1)=no
78118bd17e5fSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
78128bd17e5fSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
78138bd17e5fSmrg_LT_TAGVAR(hardcode_direct, $1)=no
78148bd17e5fSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
78158bd17e5fSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
78168bd17e5fSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
78178bd17e5fSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
78188bd17e5fSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
78198bd17e5fSmrg_LT_TAGVAR(inherit_rpath, $1)=no
78208bd17e5fSmrg_LT_TAGVAR(module_cmds, $1)=
78218bd17e5fSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
78228bd17e5fSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
78238bd17e5fSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
78248bd17e5fSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
78258bd17e5fSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
78268bd17e5fSmrg_LT_TAGVAR(no_undefined_flag, $1)=
78278bd17e5fSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
78288bd17e5fSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7829b042e37fSmrg
78308bd17e5fSmrg# Source file extension for fc test sources.
78318bd17e5fSmrgac_ext=${ac_fc_srcext-f}
78328c4a8e55Smrg
78338bd17e5fSmrg# Object file extension for compiled fc test sources.
78348bd17e5fSmrgobjext=o
78358bd17e5fSmrg_LT_TAGVAR(objext, $1)=$objext
78368c4a8e55Smrg
78378bd17e5fSmrg# No sense in running all these tests if we already determined that
78388bd17e5fSmrg# the FC compiler isn't working.  Some variables (like enable_shared)
78398bd17e5fSmrg# are currently assumed to apply to all compilers on this platform,
78408bd17e5fSmrg# and will be corrupted by setting them based on a non-working compiler.
78413169be4bSmrgif test yes != "$_lt_disable_FC"; then
78428bd17e5fSmrg  # Code to be used in simple compile tests
78438bd17e5fSmrg  lt_simple_compile_test_code="\
78448bd17e5fSmrg      subroutine t
78458bd17e5fSmrg      return
78468bd17e5fSmrg      end
78478bd17e5fSmrg"
7848b042e37fSmrg
78498bd17e5fSmrg  # Code to be used in simple link tests
78508bd17e5fSmrg  lt_simple_link_test_code="\
78518bd17e5fSmrg      program t
78528bd17e5fSmrg      end
78538bd17e5fSmrg"
7854b042e37fSmrg
78558bd17e5fSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
78568bd17e5fSmrg  _LT_TAG_COMPILER
78578c4a8e55Smrg
78588bd17e5fSmrg  # save warnings/boilerplate of simple test code
78598bd17e5fSmrg  _LT_COMPILER_BOILERPLATE
78608bd17e5fSmrg  _LT_LINKER_BOILERPLATE
7861b042e37fSmrg
78628bd17e5fSmrg  # Allow CC to be a program name with arguments.
78633169be4bSmrg  lt_save_CC=$CC
78648bd17e5fSmrg  lt_save_GCC=$GCC
78658bd17e5fSmrg  lt_save_CFLAGS=$CFLAGS
78668bd17e5fSmrg  CC=${FC-"f95"}
78678bd17e5fSmrg  CFLAGS=$FCFLAGS
78688bd17e5fSmrg  compiler=$CC
78698bd17e5fSmrg  GCC=$ac_cv_fc_compiler_gnu
7870b042e37fSmrg
78718bd17e5fSmrg  _LT_TAGVAR(compiler, $1)=$CC
78728bd17e5fSmrg  _LT_CC_BASENAME([$compiler])
7873bd23fbfaSmrg
78748bd17e5fSmrg  if test -n "$compiler"; then
78758bd17e5fSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
78768bd17e5fSmrg    AC_MSG_RESULT([$can_build_shared])
78778bd17e5fSmrg
78788bd17e5fSmrg    AC_MSG_CHECKING([whether to build shared libraries])
78793169be4bSmrg    test no = "$can_build_shared" && enable_shared=no
78808bd17e5fSmrg
78818bd17e5fSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
78828bd17e5fSmrg    # are all built from PIC.
78838bd17e5fSmrg    case $host_os in
78848bd17e5fSmrg      aix3*)
78853169be4bSmrg        test yes = "$enable_shared" && enable_static=no
78868bd17e5fSmrg        if test -n "$RANLIB"; then
78878bd17e5fSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
78888bd17e5fSmrg          postinstall_cmds='$RANLIB $lib'
78898bd17e5fSmrg        fi
78908bd17e5fSmrg        ;;
78918bd17e5fSmrg      aix[[4-9]]*)
78923169be4bSmrg	if test ia64 != "$host_cpu"; then
78933169be4bSmrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
78943169be4bSmrg	  yes,aix,yes) ;;		# shared object as lib.so file only
78953169be4bSmrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
78963169be4bSmrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
78973169be4bSmrg	  esac
78980597fb56Smrg	fi
78998bd17e5fSmrg        ;;
79008bd17e5fSmrg    esac
79018bd17e5fSmrg    AC_MSG_RESULT([$enable_shared])
79020597fb56Smrg
79038bd17e5fSmrg    AC_MSG_CHECKING([whether to build static libraries])
79048bd17e5fSmrg    # Make sure either enable_shared or enable_static is yes.
79053169be4bSmrg    test yes = "$enable_shared" || enable_static=yes
79068bd17e5fSmrg    AC_MSG_RESULT([$enable_static])
7907b042e37fSmrg
79083169be4bSmrg    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
79093169be4bSmrg    _LT_TAGVAR(LD, $1)=$LD
7910b042e37fSmrg
79118bd17e5fSmrg    ## CAVEAT EMPTOR:
79128bd17e5fSmrg    ## There is no encapsulation within the following macros, do not change
79138bd17e5fSmrg    ## the running order or otherwise move them around unless you know exactly
79148bd17e5fSmrg    ## what you are doing...
79158bd17e5fSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
79168bd17e5fSmrg    _LT_COMPILER_PIC($1)
79178bd17e5fSmrg    _LT_COMPILER_C_O($1)
79188bd17e5fSmrg    _LT_COMPILER_FILE_LOCKS($1)
79198bd17e5fSmrg    _LT_LINKER_SHLIBS($1)
79208bd17e5fSmrg    _LT_SYS_DYNAMIC_LINKER($1)
79218bd17e5fSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7922b042e37fSmrg
79238bd17e5fSmrg    _LT_CONFIG($1)
79248bd17e5fSmrg  fi # test -n "$compiler"
7925b042e37fSmrg
79268bd17e5fSmrg  GCC=$lt_save_GCC
79278bd17e5fSmrg  CC=$lt_save_CC
79288bd17e5fSmrg  CFLAGS=$lt_save_CFLAGS
79293169be4bSmrgfi # test yes != "$_lt_disable_FC"
7930b042e37fSmrg
79318bd17e5fSmrgAC_LANG_POP
79328bd17e5fSmrg])# _LT_LANG_FC_CONFIG
79338bd17e5fSmrg
79348bd17e5fSmrg
79358bd17e5fSmrg# _LT_LANG_GCJ_CONFIG([TAG])
79368bd17e5fSmrg# --------------------------
79378bd17e5fSmrg# Ensure that the configuration variables for the GNU Java Compiler compiler
79388bd17e5fSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
79393169be4bSmrg# to write the compiler configuration to 'libtool'.
79408bd17e5fSmrgm4_defun([_LT_LANG_GCJ_CONFIG],
79418bd17e5fSmrg[AC_REQUIRE([LT_PROG_GCJ])dnl
79428bd17e5fSmrgAC_LANG_SAVE
7943b042e37fSmrg
79448bd17e5fSmrg# Source file extension for Java test sources.
79458bd17e5fSmrgac_ext=java
7946706b6b52Smrg
79478bd17e5fSmrg# Object file extension for compiled Java test sources.
79488bd17e5fSmrgobjext=o
79498bd17e5fSmrg_LT_TAGVAR(objext, $1)=$objext
7950b042e37fSmrg
79518bd17e5fSmrg# Code to be used in simple compile tests
79528bd17e5fSmrglt_simple_compile_test_code="class foo {}"
7953b042e37fSmrg
79548bd17e5fSmrg# Code to be used in simple link tests
79558bd17e5fSmrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
7956b042e37fSmrg
79578bd17e5fSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
79588bd17e5fSmrg_LT_TAG_COMPILER
7959b042e37fSmrg
79608bd17e5fSmrg# save warnings/boilerplate of simple test code
79618bd17e5fSmrg_LT_COMPILER_BOILERPLATE
79628bd17e5fSmrg_LT_LINKER_BOILERPLATE
7963b042e37fSmrg
79648bd17e5fSmrg# Allow CC to be a program name with arguments.
79658bd17e5fSmrglt_save_CC=$CC
79668bd17e5fSmrglt_save_CFLAGS=$CFLAGS
79678bd17e5fSmrglt_save_GCC=$GCC
79688bd17e5fSmrgGCC=yes
79698bd17e5fSmrgCC=${GCJ-"gcj"}
79708bd17e5fSmrgCFLAGS=$GCJFLAGS
79718bd17e5fSmrgcompiler=$CC
79728bd17e5fSmrg_LT_TAGVAR(compiler, $1)=$CC
79733169be4bSmrg_LT_TAGVAR(LD, $1)=$LD
79748bd17e5fSmrg_LT_CC_BASENAME([$compiler])
79750597fb56Smrg
79768bd17e5fSmrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
79778bd17e5fSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7978b042e37fSmrg
79798bd17e5fSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
79808bd17e5fSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
79818bd17e5fSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7982b042e37fSmrg
79838bd17e5fSmrgif test -n "$compiler"; then
79848bd17e5fSmrg  _LT_COMPILER_NO_RTTI($1)
79858bd17e5fSmrg  _LT_COMPILER_PIC($1)
79868bd17e5fSmrg  _LT_COMPILER_C_O($1)
79878bd17e5fSmrg  _LT_COMPILER_FILE_LOCKS($1)
79888bd17e5fSmrg  _LT_LINKER_SHLIBS($1)
79898bd17e5fSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
7990b042e37fSmrg
79918bd17e5fSmrg  _LT_CONFIG($1)
79928bd17e5fSmrgfi
7993b042e37fSmrg
79948bd17e5fSmrgAC_LANG_RESTORE
7995706b6b52Smrg
79968bd17e5fSmrgGCC=$lt_save_GCC
79978bd17e5fSmrgCC=$lt_save_CC
79988bd17e5fSmrgCFLAGS=$lt_save_CFLAGS
79998bd17e5fSmrg])# _LT_LANG_GCJ_CONFIG
8000b042e37fSmrg
8001b042e37fSmrg
80028bd17e5fSmrg# _LT_LANG_GO_CONFIG([TAG])
80038bd17e5fSmrg# --------------------------
80048bd17e5fSmrg# Ensure that the configuration variables for the GNU Go compiler
80058bd17e5fSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
80063169be4bSmrg# to write the compiler configuration to 'libtool'.
80078bd17e5fSmrgm4_defun([_LT_LANG_GO_CONFIG],
80088bd17e5fSmrg[AC_REQUIRE([LT_PROG_GO])dnl
80098bd17e5fSmrgAC_LANG_SAVE
80108c4a8e55Smrg
80118bd17e5fSmrg# Source file extension for Go test sources.
80128bd17e5fSmrgac_ext=go
80138c4a8e55Smrg
80148bd17e5fSmrg# Object file extension for compiled Go test sources.
80158bd17e5fSmrgobjext=o
80168bd17e5fSmrg_LT_TAGVAR(objext, $1)=$objext
8017b042e37fSmrg
80188bd17e5fSmrg# Code to be used in simple compile tests
80198bd17e5fSmrglt_simple_compile_test_code="package main; func main() { }"
8020b042e37fSmrg
80218bd17e5fSmrg# Code to be used in simple link tests
80228bd17e5fSmrglt_simple_link_test_code='package main; func main() { }'
80238c4a8e55Smrg
80248bd17e5fSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
80258bd17e5fSmrg_LT_TAG_COMPILER
8026b042e37fSmrg
80278bd17e5fSmrg# save warnings/boilerplate of simple test code
80288bd17e5fSmrg_LT_COMPILER_BOILERPLATE
80298bd17e5fSmrg_LT_LINKER_BOILERPLATE
80300597fb56Smrg
80318bd17e5fSmrg# Allow CC to be a program name with arguments.
80328bd17e5fSmrglt_save_CC=$CC
80338bd17e5fSmrglt_save_CFLAGS=$CFLAGS
80348bd17e5fSmrglt_save_GCC=$GCC
80358bd17e5fSmrgGCC=yes
80368bd17e5fSmrgCC=${GOC-"gccgo"}
80378bd17e5fSmrgCFLAGS=$GOFLAGS
80388bd17e5fSmrgcompiler=$CC
80398bd17e5fSmrg_LT_TAGVAR(compiler, $1)=$CC
80403169be4bSmrg_LT_TAGVAR(LD, $1)=$LD
80418bd17e5fSmrg_LT_CC_BASENAME([$compiler])
80420597fb56Smrg
80438bd17e5fSmrg# Go did not exist at the time GCC didn't implicitly link libc in.
80448bd17e5fSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8045b042e37fSmrg
80468bd17e5fSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
80478bd17e5fSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
80488bd17e5fSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8049b042e37fSmrg
80508bd17e5fSmrgif test -n "$compiler"; then
80518bd17e5fSmrg  _LT_COMPILER_NO_RTTI($1)
80528bd17e5fSmrg  _LT_COMPILER_PIC($1)
80538bd17e5fSmrg  _LT_COMPILER_C_O($1)
80548bd17e5fSmrg  _LT_COMPILER_FILE_LOCKS($1)
80558bd17e5fSmrg  _LT_LINKER_SHLIBS($1)
80568bd17e5fSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8057b042e37fSmrg
80588bd17e5fSmrg  _LT_CONFIG($1)
80598bd17e5fSmrgfi
8060b042e37fSmrg
80618bd17e5fSmrgAC_LANG_RESTORE
8062b042e37fSmrg
80638bd17e5fSmrgGCC=$lt_save_GCC
80648bd17e5fSmrgCC=$lt_save_CC
80658bd17e5fSmrgCFLAGS=$lt_save_CFLAGS
80668bd17e5fSmrg])# _LT_LANG_GO_CONFIG
8067b042e37fSmrg
8068b042e37fSmrg
80698bd17e5fSmrg# _LT_LANG_RC_CONFIG([TAG])
80708bd17e5fSmrg# -------------------------
80718bd17e5fSmrg# Ensure that the configuration variables for the Windows resource compiler
80728bd17e5fSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
80733169be4bSmrg# to write the compiler configuration to 'libtool'.
80748bd17e5fSmrgm4_defun([_LT_LANG_RC_CONFIG],
80758bd17e5fSmrg[AC_REQUIRE([LT_PROG_RC])dnl
80768bd17e5fSmrgAC_LANG_SAVE
8077b042e37fSmrg
80788bd17e5fSmrg# Source file extension for RC test sources.
80798bd17e5fSmrgac_ext=rc
8080b042e37fSmrg
80818bd17e5fSmrg# Object file extension for compiled RC test sources.
80828bd17e5fSmrgobjext=o
80838bd17e5fSmrg_LT_TAGVAR(objext, $1)=$objext
8084b042e37fSmrg
80858bd17e5fSmrg# Code to be used in simple compile tests
80868bd17e5fSmrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8087b042e37fSmrg
80888bd17e5fSmrg# Code to be used in simple link tests
80893169be4bSmrglt_simple_link_test_code=$lt_simple_compile_test_code
8090b042e37fSmrg
80918bd17e5fSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
80928bd17e5fSmrg_LT_TAG_COMPILER
8093b042e37fSmrg
80948bd17e5fSmrg# save warnings/boilerplate of simple test code
80958bd17e5fSmrg_LT_COMPILER_BOILERPLATE
80968bd17e5fSmrg_LT_LINKER_BOILERPLATE
8097b042e37fSmrg
80988bd17e5fSmrg# Allow CC to be a program name with arguments.
80993169be4bSmrglt_save_CC=$CC
81008bd17e5fSmrglt_save_CFLAGS=$CFLAGS
81018bd17e5fSmrglt_save_GCC=$GCC
81028bd17e5fSmrgGCC=
81038bd17e5fSmrgCC=${RC-"windres"}
81048bd17e5fSmrgCFLAGS=
81058bd17e5fSmrgcompiler=$CC
81068bd17e5fSmrg_LT_TAGVAR(compiler, $1)=$CC
81078bd17e5fSmrg_LT_CC_BASENAME([$compiler])
81088bd17e5fSmrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8109b042e37fSmrg
81108bd17e5fSmrgif test -n "$compiler"; then
81118bd17e5fSmrg  :
81128bd17e5fSmrg  _LT_CONFIG($1)
81138bd17e5fSmrgfi
8114b042e37fSmrg
81158bd17e5fSmrgGCC=$lt_save_GCC
81168bd17e5fSmrgAC_LANG_RESTORE
81178bd17e5fSmrgCC=$lt_save_CC
81188bd17e5fSmrgCFLAGS=$lt_save_CFLAGS
81198bd17e5fSmrg])# _LT_LANG_RC_CONFIG
8120b042e37fSmrg
8121b042e37fSmrg
81228bd17e5fSmrg# LT_PROG_GCJ
81238bd17e5fSmrg# -----------
81248bd17e5fSmrgAC_DEFUN([LT_PROG_GCJ],
81258bd17e5fSmrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
81268bd17e5fSmrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
81278bd17e5fSmrg    [AC_CHECK_TOOL(GCJ, gcj,)
81283169be4bSmrg      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
81298bd17e5fSmrg      AC_SUBST(GCJFLAGS)])])[]dnl
81308bd17e5fSmrg])
8131b042e37fSmrg
81328bd17e5fSmrg# Old name:
81338bd17e5fSmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
81348bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
81358bd17e5fSmrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8136b042e37fSmrg
81370597fb56Smrg
81388bd17e5fSmrg# LT_PROG_GO
81398bd17e5fSmrg# ----------
81408bd17e5fSmrgAC_DEFUN([LT_PROG_GO],
81418bd17e5fSmrg[AC_CHECK_TOOL(GOC, gccgo,)
81428bd17e5fSmrg])
8143b042e37fSmrg
81448c4a8e55Smrg
81458bd17e5fSmrg# LT_PROG_RC
81468bd17e5fSmrg# ----------
81478bd17e5fSmrgAC_DEFUN([LT_PROG_RC],
81488bd17e5fSmrg[AC_CHECK_TOOL(RC, windres,)
81498bd17e5fSmrg])
8150b042e37fSmrg
81518bd17e5fSmrg# Old name:
81528bd17e5fSmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
81538bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
81548bd17e5fSmrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
8155b042e37fSmrg
8156b042e37fSmrg
81578bd17e5fSmrg# _LT_DECL_EGREP
81588bd17e5fSmrg# --------------
81598bd17e5fSmrg# If we don't have a new enough Autoconf to choose the best grep
81608bd17e5fSmrg# available, choose the one first in the user's PATH.
81618bd17e5fSmrgm4_defun([_LT_DECL_EGREP],
81628bd17e5fSmrg[AC_REQUIRE([AC_PROG_EGREP])dnl
81638bd17e5fSmrgAC_REQUIRE([AC_PROG_FGREP])dnl
81648bd17e5fSmrgtest -z "$GREP" && GREP=grep
81658bd17e5fSmrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
81668bd17e5fSmrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
81678bd17e5fSmrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
81688bd17e5fSmrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
81698bd17e5fSmrgAC_SUBST([GREP])
81708bd17e5fSmrg])
8171b042e37fSmrg
8172b042e37fSmrg
81738bd17e5fSmrg# _LT_DECL_OBJDUMP
81748bd17e5fSmrg# --------------
81758bd17e5fSmrg# If we don't have a new enough Autoconf to choose the best objdump
81768bd17e5fSmrg# available, choose the one first in the user's PATH.
81778bd17e5fSmrgm4_defun([_LT_DECL_OBJDUMP],
81788bd17e5fSmrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
81798bd17e5fSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
81808bd17e5fSmrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
81818bd17e5fSmrgAC_SUBST([OBJDUMP])
81820597fb56Smrg])
8183b042e37fSmrg
81848bd17e5fSmrg# _LT_DECL_DLLTOOL
81858bd17e5fSmrg# ----------------
81868bd17e5fSmrg# Ensure DLLTOOL variable is set.
81878bd17e5fSmrgm4_defun([_LT_DECL_DLLTOOL],
81888bd17e5fSmrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
81898bd17e5fSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
81908bd17e5fSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
81918bd17e5fSmrgAC_SUBST([DLLTOOL])
81928bd17e5fSmrg])
8193b042e37fSmrg
81948bd17e5fSmrg# _LT_DECL_SED
81958bd17e5fSmrg# ------------
81968bd17e5fSmrg# Check for a fully-functional sed program, that truncates
81978bd17e5fSmrg# as few characters as possible.  Prefer GNU sed if found.
81988bd17e5fSmrgm4_defun([_LT_DECL_SED],
81998bd17e5fSmrg[AC_PROG_SED
82008bd17e5fSmrgtest -z "$SED" && SED=sed
82018bd17e5fSmrgXsed="$SED -e 1s/^X//"
82028bd17e5fSmrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
82038bd17e5fSmrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
82048bd17e5fSmrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
82058bd17e5fSmrg])# _LT_DECL_SED
8206b042e37fSmrg
82078bd17e5fSmrgm4_ifndef([AC_PROG_SED], [
82088bd17e5fSmrg# NOTE: This macro has been submitted for inclusion into   #
82098bd17e5fSmrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
82108bd17e5fSmrg#  a released version of Autoconf we should remove this    #
82118bd17e5fSmrg#  macro and use it instead.                               #
8212b042e37fSmrg
82138bd17e5fSmrgm4_defun([AC_PROG_SED],
82148bd17e5fSmrg[AC_MSG_CHECKING([for a sed that does not truncate output])
82158bd17e5fSmrgAC_CACHE_VAL(lt_cv_path_SED,
82168bd17e5fSmrg[# Loop through the user's path and test for sed and gsed.
82178bd17e5fSmrg# Then use that list of sed's as ones to test for truncation.
82188bd17e5fSmrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
82198bd17e5fSmrgfor as_dir in $PATH
82208bd17e5fSmrgdo
82218bd17e5fSmrg  IFS=$as_save_IFS
82228bd17e5fSmrg  test -z "$as_dir" && as_dir=.
82238bd17e5fSmrg  for lt_ac_prog in sed gsed; do
82248bd17e5fSmrg    for ac_exec_ext in '' $ac_executable_extensions; do
82258bd17e5fSmrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
82268bd17e5fSmrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
82278bd17e5fSmrg      fi
82288bd17e5fSmrg    done
82298bd17e5fSmrg  done
82308bd17e5fSmrgdone
82318bd17e5fSmrgIFS=$as_save_IFS
82328bd17e5fSmrglt_ac_max=0
82338bd17e5fSmrglt_ac_count=0
82348bd17e5fSmrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
82358bd17e5fSmrg# along with /bin/sed that truncates output.
82368bd17e5fSmrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
82373169be4bSmrg  test ! -f "$lt_ac_sed" && continue
82388bd17e5fSmrg  cat /dev/null > conftest.in
82398bd17e5fSmrg  lt_ac_count=0
82408bd17e5fSmrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
82418bd17e5fSmrg  # Check for GNU sed and select it if it is found.
82428bd17e5fSmrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
82438bd17e5fSmrg    lt_cv_path_SED=$lt_ac_sed
82448bd17e5fSmrg    break
82458bd17e5fSmrg  fi
82468bd17e5fSmrg  while true; do
82478bd17e5fSmrg    cat conftest.in conftest.in >conftest.tmp
82488bd17e5fSmrg    mv conftest.tmp conftest.in
82498bd17e5fSmrg    cp conftest.in conftest.nl
82508bd17e5fSmrg    echo >>conftest.nl
82518bd17e5fSmrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
82528bd17e5fSmrg    cmp -s conftest.out conftest.nl || break
82538bd17e5fSmrg    # 10000 chars as input seems more than enough
82543169be4bSmrg    test 10 -lt "$lt_ac_count" && break
82558bd17e5fSmrg    lt_ac_count=`expr $lt_ac_count + 1`
82563169be4bSmrg    if test "$lt_ac_count" -gt "$lt_ac_max"; then
82578bd17e5fSmrg      lt_ac_max=$lt_ac_count
82588bd17e5fSmrg      lt_cv_path_SED=$lt_ac_sed
82598bd17e5fSmrg    fi
82608bd17e5fSmrg  done
82618bd17e5fSmrgdone
82620597fb56Smrg])
82638bd17e5fSmrgSED=$lt_cv_path_SED
82648bd17e5fSmrgAC_SUBST([SED])
82658bd17e5fSmrgAC_MSG_RESULT([$SED])
82668bd17e5fSmrg])#AC_PROG_SED
82678bd17e5fSmrg])#m4_ifndef
82688c4a8e55Smrg
82698bd17e5fSmrg# Old name:
82708bd17e5fSmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
82718bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
82728bd17e5fSmrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
82730597fb56Smrg
82740597fb56Smrg
82758bd17e5fSmrg# _LT_CHECK_SHELL_FEATURES
82768bd17e5fSmrg# ------------------------
82778bd17e5fSmrg# Find out whether the shell is Bourne or XSI compatible,
82788bd17e5fSmrg# or has some other useful features.
82798bd17e5fSmrgm4_defun([_LT_CHECK_SHELL_FEATURES],
82803169be4bSmrg[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
82818bd17e5fSmrg  lt_unset=unset
82828bd17e5fSmrgelse
82838bd17e5fSmrg  lt_unset=false
82848bd17e5fSmrgfi
82858bd17e5fSmrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
82868c4a8e55Smrg
82878bd17e5fSmrg# test EBCDIC or ASCII
82888bd17e5fSmrgcase `echo X|tr X '\101'` in
82898bd17e5fSmrg A) # ASCII based system
82908bd17e5fSmrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
82918bd17e5fSmrg  lt_SP2NL='tr \040 \012'
82928bd17e5fSmrg  lt_NL2SP='tr \015\012 \040\040'
82938bd17e5fSmrg  ;;
82948bd17e5fSmrg *) # EBCDIC based system
82958bd17e5fSmrg  lt_SP2NL='tr \100 \n'
82968bd17e5fSmrg  lt_NL2SP='tr \r\n \100\100'
82978bd17e5fSmrg  ;;
82988bd17e5fSmrgesac
82998bd17e5fSmrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
83008bd17e5fSmrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
83018bd17e5fSmrg])# _LT_CHECK_SHELL_FEATURES
83028c4a8e55Smrg
83038c4a8e55Smrg
83048bd17e5fSmrg# _LT_PATH_CONVERSION_FUNCTIONS
83058bd17e5fSmrg# -----------------------------
83063169be4bSmrg# Determine what file name conversion functions should be used by
83078bd17e5fSmrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
83088bd17e5fSmrg# for certain cross-compile configurations and native mingw.
83098bd17e5fSmrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
83108bd17e5fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
83118bd17e5fSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
83128bd17e5fSmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
83138bd17e5fSmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
83148bd17e5fSmrg[case $host in
83158bd17e5fSmrg  *-*-mingw* )
83168bd17e5fSmrg    case $build in
83178bd17e5fSmrg      *-*-mingw* ) # actually msys
83188bd17e5fSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
83198bd17e5fSmrg        ;;
83208bd17e5fSmrg      *-*-cygwin* )
83218bd17e5fSmrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
83228bd17e5fSmrg        ;;
83238bd17e5fSmrg      * ) # otherwise, assume *nix
83248bd17e5fSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
83258bd17e5fSmrg        ;;
83268bd17e5fSmrg    esac
83278bd17e5fSmrg    ;;
83288bd17e5fSmrg  *-*-cygwin* )
83298bd17e5fSmrg    case $build in
83308bd17e5fSmrg      *-*-mingw* ) # actually msys
83318bd17e5fSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
83328bd17e5fSmrg        ;;
83338bd17e5fSmrg      *-*-cygwin* )
83348bd17e5fSmrg        lt_cv_to_host_file_cmd=func_convert_file_noop
83358bd17e5fSmrg        ;;
83368bd17e5fSmrg      * ) # otherwise, assume *nix
83378bd17e5fSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
83388bd17e5fSmrg        ;;
83398bd17e5fSmrg    esac
83408bd17e5fSmrg    ;;
83418bd17e5fSmrg  * ) # unhandled hosts (and "normal" native builds)
83428bd17e5fSmrg    lt_cv_to_host_file_cmd=func_convert_file_noop
83438bd17e5fSmrg    ;;
83448bd17e5fSmrgesac
83458bd17e5fSmrg])
83468bd17e5fSmrgto_host_file_cmd=$lt_cv_to_host_file_cmd
83478bd17e5fSmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
83488bd17e5fSmrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
83498bd17e5fSmrg         [0], [convert $build file names to $host format])dnl
83508bd17e5fSmrg
83518bd17e5fSmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
83528bd17e5fSmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
83538bd17e5fSmrg[#assume ordinary cross tools, or native build.
83548bd17e5fSmrglt_cv_to_tool_file_cmd=func_convert_file_noop
83558bd17e5fSmrgcase $host in
83568bd17e5fSmrg  *-*-mingw* )
83578bd17e5fSmrg    case $build in
83588bd17e5fSmrg      *-*-mingw* ) # actually msys
83598bd17e5fSmrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
83608bd17e5fSmrg        ;;
83618bd17e5fSmrg    esac
83628bd17e5fSmrg    ;;
83638bd17e5fSmrgesac
83648bd17e5fSmrg])
83658bd17e5fSmrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
83668bd17e5fSmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
83678bd17e5fSmrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
83688bd17e5fSmrg         [0], [convert $build files to toolchain format])dnl
83698bd17e5fSmrg])# _LT_PATH_CONVERSION_FUNCTIONS
83708bd17e5fSmrg
83718bd17e5fSmrg# Helper functions for option handling.                    -*- Autoconf -*-
83720597fb56Smrg#
83733169be4bSmrg#   Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
83743169be4bSmrg#   Foundation, Inc.
83758bd17e5fSmrg#   Written by Gary V. Vaughan, 2004
83760597fb56Smrg#
83778bd17e5fSmrg# This file is free software; the Free Software Foundation gives
83788bd17e5fSmrg# unlimited permission to copy and/or distribute it, with or without
83798bd17e5fSmrg# modifications, as long as this notice is preserved.
8380b042e37fSmrg
83813169be4bSmrg# serial 8 ltoptions.m4
8382b042e37fSmrg
83838bd17e5fSmrg# This is to help aclocal find these macros, as it can't see m4_define.
83848bd17e5fSmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
83858bd17e5fSmrg
83868bd17e5fSmrg
83878bd17e5fSmrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
83888bd17e5fSmrg# ------------------------------------------
83898bd17e5fSmrgm4_define([_LT_MANGLE_OPTION],
83908bd17e5fSmrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
8391b042e37fSmrg
8392706b6b52Smrg
83938bd17e5fSmrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
83948bd17e5fSmrg# ---------------------------------------
83958bd17e5fSmrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
83968bd17e5fSmrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
83978bd17e5fSmrg# saved as a flag.
83988bd17e5fSmrgm4_define([_LT_SET_OPTION],
83998bd17e5fSmrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
84008bd17e5fSmrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
84018bd17e5fSmrg        _LT_MANGLE_DEFUN([$1], [$2]),
84023169be4bSmrg    [m4_warning([Unknown $1 option '$2'])])[]dnl
84038bd17e5fSmrg])
8404b042e37fSmrg
8405b042e37fSmrg
84068bd17e5fSmrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
84078bd17e5fSmrg# ------------------------------------------------------------
84088bd17e5fSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
84098bd17e5fSmrgm4_define([_LT_IF_OPTION],
84108bd17e5fSmrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
8411b042e37fSmrg
84128c4a8e55Smrg
84138bd17e5fSmrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
84148bd17e5fSmrg# -------------------------------------------------------
84158bd17e5fSmrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
84168bd17e5fSmrg# are set.
84178bd17e5fSmrgm4_define([_LT_UNLESS_OPTIONS],
84188bd17e5fSmrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
84198bd17e5fSmrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
84208bd17e5fSmrg		      [m4_define([$0_found])])])[]dnl
84218bd17e5fSmrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
84228bd17e5fSmrg])[]dnl
84238bd17e5fSmrg])
84240597fb56Smrg
84258c4a8e55Smrg
84268bd17e5fSmrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
84278bd17e5fSmrg# ----------------------------------------
84288bd17e5fSmrg# OPTION-LIST is a space-separated list of Libtool options associated
84298bd17e5fSmrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
84308bd17e5fSmrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
84318bd17e5fSmrg# the unknown option and exit.
84328bd17e5fSmrgm4_defun([_LT_SET_OPTIONS],
84338bd17e5fSmrg[# Set options
84348bd17e5fSmrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
84358bd17e5fSmrg    [_LT_SET_OPTION([$1], _LT_Option)])
84368c4a8e55Smrg
84378bd17e5fSmrgm4_if([$1],[LT_INIT],[
84388bd17e5fSmrg  dnl
84398bd17e5fSmrg  dnl Simply set some default values (i.e off) if boolean options were not
84408bd17e5fSmrg  dnl specified:
84418bd17e5fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
84428bd17e5fSmrg  ])
84438bd17e5fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
84448bd17e5fSmrg  ])
84458bd17e5fSmrg  dnl
84468bd17e5fSmrg  dnl If no reference was made to various pairs of opposing options, then
84478bd17e5fSmrg  dnl we run the default mode handler for the pair.  For example, if neither
84483169be4bSmrg  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
84498bd17e5fSmrg  dnl archives by default:
84508bd17e5fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
84518bd17e5fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
84528bd17e5fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
84538bd17e5fSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
84543169be4bSmrg		   [_LT_ENABLE_FAST_INSTALL])
84553169be4bSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
84563169be4bSmrg		   [_LT_WITH_AIX_SONAME([aix])])
84578bd17e5fSmrg  ])
84588bd17e5fSmrg])# _LT_SET_OPTIONS
84598c4a8e55Smrg
84608c4a8e55Smrg
84618c4a8e55Smrg
84628bd17e5fSmrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
84638bd17e5fSmrg# -----------------------------------------
84648bd17e5fSmrgm4_define([_LT_MANGLE_DEFUN],
84658bd17e5fSmrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
84668c4a8e55Smrg
84678c4a8e55Smrg
84688bd17e5fSmrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
84698bd17e5fSmrg# -----------------------------------------------
84708bd17e5fSmrgm4_define([LT_OPTION_DEFINE],
84718bd17e5fSmrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
84728bd17e5fSmrg])# LT_OPTION_DEFINE
84738c4a8e55Smrg
84748c4a8e55Smrg
84758bd17e5fSmrg# dlopen
84768bd17e5fSmrg# ------
84778bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
84788bd17e5fSmrg])
84798c4a8e55Smrg
84808bd17e5fSmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
84818bd17e5fSmrg[_LT_SET_OPTION([LT_INIT], [dlopen])
84828bd17e5fSmrgAC_DIAGNOSE([obsolete],
84838bd17e5fSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
84843169be4bSmrgput the 'dlopen' option into LT_INIT's first parameter.])
84858bd17e5fSmrg])
8486b042e37fSmrg
84878bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
84888bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
8489b042e37fSmrg
8490b042e37fSmrg
84918bd17e5fSmrg# win32-dll
84928bd17e5fSmrg# ---------
84938bd17e5fSmrg# Declare package support for building win32 dll's.
84948bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
84958bd17e5fSmrg[enable_win32_dll=yes
8496b042e37fSmrg
84978bd17e5fSmrgcase $host in
84988bd17e5fSmrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
84998bd17e5fSmrg  AC_CHECK_TOOL(AS, as, false)
85008bd17e5fSmrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
85018bd17e5fSmrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
85028bd17e5fSmrg  ;;
85038bd17e5fSmrgesac
85048bd17e5fSmrg
85058bd17e5fSmrgtest -z "$AS" && AS=as
85068bd17e5fSmrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
85078bd17e5fSmrg
85088bd17e5fSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
85098bd17e5fSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
85108bd17e5fSmrg
85118bd17e5fSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
85128bd17e5fSmrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
85138bd17e5fSmrg])# win32-dll
8514b042e37fSmrg
85158bd17e5fSmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
85168bd17e5fSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
85178bd17e5fSmrg_LT_SET_OPTION([LT_INIT], [win32-dll])
85188bd17e5fSmrgAC_DIAGNOSE([obsolete],
85198bd17e5fSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
85203169be4bSmrgput the 'win32-dll' option into LT_INIT's first parameter.])
85218bd17e5fSmrg])
8522b042e37fSmrg
85238bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
85248bd17e5fSmrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
8525b042e37fSmrg
8526b042e37fSmrg
85278bd17e5fSmrg# _LT_ENABLE_SHARED([DEFAULT])
85288bd17e5fSmrg# ----------------------------
85293169be4bSmrg# implement the --enable-shared flag, and supports the 'shared' and
85303169be4bSmrg# 'disable-shared' LT_INIT options.
85313169be4bSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
85328bd17e5fSmrgm4_define([_LT_ENABLE_SHARED],
85338bd17e5fSmrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
85348bd17e5fSmrgAC_ARG_ENABLE([shared],
85358bd17e5fSmrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
85368bd17e5fSmrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
85378bd17e5fSmrg    [p=${PACKAGE-default}
85388bd17e5fSmrg    case $enableval in
85398bd17e5fSmrg    yes) enable_shared=yes ;;
85408bd17e5fSmrg    no) enable_shared=no ;;
85418bd17e5fSmrg    *)
85428bd17e5fSmrg      enable_shared=no
85438bd17e5fSmrg      # Look at the argument we got.  We use all the common list separators.
85443169be4bSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
85458bd17e5fSmrg      for pkg in $enableval; do
85463169be4bSmrg	IFS=$lt_save_ifs
85478bd17e5fSmrg	if test "X$pkg" = "X$p"; then
85488bd17e5fSmrg	  enable_shared=yes
85498bd17e5fSmrg	fi
85508bd17e5fSmrg      done
85513169be4bSmrg      IFS=$lt_save_ifs
85528bd17e5fSmrg      ;;
85538bd17e5fSmrg    esac],
85548bd17e5fSmrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
8555b042e37fSmrg
85568bd17e5fSmrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
85578bd17e5fSmrg	[Whether or not to build shared libraries])
85588bd17e5fSmrg])# _LT_ENABLE_SHARED
8559b042e37fSmrg
85608bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
85618bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
85620597fb56Smrg
85638bd17e5fSmrg# Old names:
85648bd17e5fSmrgAC_DEFUN([AC_ENABLE_SHARED],
85658bd17e5fSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
85668bd17e5fSmrg])
8567b042e37fSmrg
85688bd17e5fSmrgAC_DEFUN([AC_DISABLE_SHARED],
85698bd17e5fSmrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
85708bd17e5fSmrg])
8571b042e37fSmrg
85728bd17e5fSmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
85738bd17e5fSmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
8574b042e37fSmrg
85758bd17e5fSmrgdnl aclocal-1.4 backwards compatibility:
85768bd17e5fSmrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
85778bd17e5fSmrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
8578b042e37fSmrg
8579b042e37fSmrg
8580b042e37fSmrg
85818bd17e5fSmrg# _LT_ENABLE_STATIC([DEFAULT])
85828bd17e5fSmrg# ----------------------------
85833169be4bSmrg# implement the --enable-static flag, and support the 'static' and
85843169be4bSmrg# 'disable-static' LT_INIT options.
85853169be4bSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
85868bd17e5fSmrgm4_define([_LT_ENABLE_STATIC],
85878bd17e5fSmrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
85888bd17e5fSmrgAC_ARG_ENABLE([static],
85898bd17e5fSmrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
85908bd17e5fSmrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
85918bd17e5fSmrg    [p=${PACKAGE-default}
85928bd17e5fSmrg    case $enableval in
85938bd17e5fSmrg    yes) enable_static=yes ;;
85948bd17e5fSmrg    no) enable_static=no ;;
85958bd17e5fSmrg    *)
85968bd17e5fSmrg     enable_static=no
85978bd17e5fSmrg      # Look at the argument we got.  We use all the common list separators.
85983169be4bSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
85998bd17e5fSmrg      for pkg in $enableval; do
86003169be4bSmrg	IFS=$lt_save_ifs
86018bd17e5fSmrg	if test "X$pkg" = "X$p"; then
86028bd17e5fSmrg	  enable_static=yes
86038bd17e5fSmrg	fi
86048bd17e5fSmrg      done
86053169be4bSmrg      IFS=$lt_save_ifs
86068bd17e5fSmrg      ;;
86078bd17e5fSmrg    esac],
86088bd17e5fSmrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
86098c4a8e55Smrg
86108bd17e5fSmrg    _LT_DECL([build_old_libs], [enable_static], [0],
86118bd17e5fSmrg	[Whether or not to build static libraries])
86128bd17e5fSmrg])# _LT_ENABLE_STATIC
86138c4a8e55Smrg
86148bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
86158bd17e5fSmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
8616b042e37fSmrg
86178bd17e5fSmrg# Old names:
86188bd17e5fSmrgAC_DEFUN([AC_ENABLE_STATIC],
86198bd17e5fSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
86208bd17e5fSmrg])
86218c4a8e55Smrg
86228bd17e5fSmrgAC_DEFUN([AC_DISABLE_STATIC],
86238bd17e5fSmrg[_LT_SET_OPTION([LT_INIT], [disable-static])
86248bd17e5fSmrg])
8625706b6b52Smrg
86268bd17e5fSmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
86278bd17e5fSmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
86288c4a8e55Smrg
862967594505Smrgdnl aclocal-1.4 backwards compatibility:
863067594505Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
863167594505Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
863267594505Smrg
863367594505Smrg
863467594505Smrg
863567594505Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
863667594505Smrg# ----------------------------------
86373169be4bSmrg# implement the --enable-fast-install flag, and support the 'fast-install'
86383169be4bSmrg# and 'disable-fast-install' LT_INIT options.
86393169be4bSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
864067594505Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
864167594505Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
864267594505SmrgAC_ARG_ENABLE([fast-install],
864367594505Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
864467594505Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
864567594505Smrg    [p=${PACKAGE-default}
864667594505Smrg    case $enableval in
864767594505Smrg    yes) enable_fast_install=yes ;;
864867594505Smrg    no) enable_fast_install=no ;;
864967594505Smrg    *)
865067594505Smrg      enable_fast_install=no
865167594505Smrg      # Look at the argument we got.  We use all the common list separators.
86523169be4bSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
865367594505Smrg      for pkg in $enableval; do
86543169be4bSmrg	IFS=$lt_save_ifs
865567594505Smrg	if test "X$pkg" = "X$p"; then
865667594505Smrg	  enable_fast_install=yes
865767594505Smrg	fi
865867594505Smrg      done
86593169be4bSmrg      IFS=$lt_save_ifs
866067594505Smrg      ;;
866167594505Smrg    esac],
866267594505Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
866367594505Smrg
866467594505Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
866567594505Smrg	 [Whether or not to optimize for fast installation])dnl
866667594505Smrg])# _LT_ENABLE_FAST_INSTALL
866767594505Smrg
866867594505SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
866967594505SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
867067594505Smrg
867167594505Smrg# Old names:
867267594505SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
867367594505Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
867467594505SmrgAC_DIAGNOSE([obsolete],
867567594505Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
86763169be4bSmrgthe 'fast-install' option into LT_INIT's first parameter.])
867767594505Smrg])
867867594505Smrg
867967594505SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
868067594505Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
868167594505SmrgAC_DIAGNOSE([obsolete],
868267594505Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
86833169be4bSmrgthe 'disable-fast-install' option into LT_INIT's first parameter.])
868467594505Smrg])
868567594505Smrg
868667594505Smrgdnl aclocal-1.4 backwards compatibility:
868767594505Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
868867594505Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
868967594505Smrg
869067594505Smrg
86913169be4bSmrg# _LT_WITH_AIX_SONAME([DEFAULT])
86923169be4bSmrg# ----------------------------------
86933169be4bSmrg# implement the --with-aix-soname flag, and support the `aix-soname=aix'
86943169be4bSmrg# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
86953169be4bSmrg# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
86963169be4bSmrgm4_define([_LT_WITH_AIX_SONAME],
86973169be4bSmrg[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
86983169be4bSmrgshared_archive_member_spec=
86993169be4bSmrgcase $host,$enable_shared in
87003169be4bSmrgpower*-*-aix[[5-9]]*,yes)
87013169be4bSmrg  AC_MSG_CHECKING([which variant of shared library versioning to provide])
87023169be4bSmrg  AC_ARG_WITH([aix-soname],
87033169be4bSmrg    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
87043169be4bSmrg      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
87053169be4bSmrg    [case $withval in
87063169be4bSmrg    aix|svr4|both)
87073169be4bSmrg      ;;
87083169be4bSmrg    *)
87093169be4bSmrg      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
87103169be4bSmrg      ;;
87113169be4bSmrg    esac
87123169be4bSmrg    lt_cv_with_aix_soname=$with_aix_soname],
87133169be4bSmrg    [AC_CACHE_VAL([lt_cv_with_aix_soname],
87143169be4bSmrg      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
87153169be4bSmrg    with_aix_soname=$lt_cv_with_aix_soname])
87163169be4bSmrg  AC_MSG_RESULT([$with_aix_soname])
87173169be4bSmrg  if test aix != "$with_aix_soname"; then
87183169be4bSmrg    # For the AIX way of multilib, we name the shared archive member
87193169be4bSmrg    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
87203169be4bSmrg    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
87213169be4bSmrg    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
87223169be4bSmrg    # the AIX toolchain works better with OBJECT_MODE set (default 32).
87233169be4bSmrg    if test 64 = "${OBJECT_MODE-32}"; then
87243169be4bSmrg      shared_archive_member_spec=shr_64
87253169be4bSmrg    else
87263169be4bSmrg      shared_archive_member_spec=shr
87273169be4bSmrg    fi
87283169be4bSmrg  fi
87293169be4bSmrg  ;;
87303169be4bSmrg*)
87313169be4bSmrg  with_aix_soname=aix
87323169be4bSmrg  ;;
87333169be4bSmrgesac
87343169be4bSmrg
87353169be4bSmrg_LT_DECL([], [shared_archive_member_spec], [0],
87363169be4bSmrg    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
87373169be4bSmrg])# _LT_WITH_AIX_SONAME
87383169be4bSmrg
87393169be4bSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
87403169be4bSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
87413169be4bSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
87423169be4bSmrg
87433169be4bSmrg
874467594505Smrg# _LT_WITH_PIC([MODE])
874567594505Smrg# --------------------
87463169be4bSmrg# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
874767594505Smrg# LT_INIT options.
87483169be4bSmrg# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
874967594505Smrgm4_define([_LT_WITH_PIC],
875067594505Smrg[AC_ARG_WITH([pic],
875167594505Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
875267594505Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
875367594505Smrg    [lt_p=${PACKAGE-default}
875467594505Smrg    case $withval in
875567594505Smrg    yes|no) pic_mode=$withval ;;
875667594505Smrg    *)
875767594505Smrg      pic_mode=default
875867594505Smrg      # Look at the argument we got.  We use all the common list separators.
87593169be4bSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
876067594505Smrg      for lt_pkg in $withval; do
87613169be4bSmrg	IFS=$lt_save_ifs
876267594505Smrg	if test "X$lt_pkg" = "X$lt_p"; then
876367594505Smrg	  pic_mode=yes
876467594505Smrg	fi
876567594505Smrg      done
87663169be4bSmrg      IFS=$lt_save_ifs
876767594505Smrg      ;;
876867594505Smrg    esac],
87693169be4bSmrg    [pic_mode=m4_default([$1], [default])])
877067594505Smrg
877167594505Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
877267594505Smrg])# _LT_WITH_PIC
877367594505Smrg
877467594505SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
877567594505SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
877667594505Smrg
877767594505Smrg# Old name:
877867594505SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
877967594505Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
878067594505SmrgAC_DIAGNOSE([obsolete],
878167594505Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
87823169be4bSmrgput the 'pic-only' option into LT_INIT's first parameter.])
878367594505Smrg])
878467594505Smrg
878567594505Smrgdnl aclocal-1.4 backwards compatibility:
878667594505Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
878767594505Smrg
878867594505Smrg
878967594505Smrgm4_define([_LTDL_MODE], [])
879067594505SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
879167594505Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
879267594505SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
879367594505Smrg		 [m4_define([_LTDL_MODE], [recursive])])
879467594505SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
879567594505Smrg		 [m4_define([_LTDL_MODE], [subproject])])
879667594505Smrg
879767594505Smrgm4_define([_LTDL_TYPE], [])
879867594505SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
879967594505Smrg		 [m4_define([_LTDL_TYPE], [installable])])
880067594505SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
880167594505Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
880267594505Smrg
880367594505Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
880467594505Smrg#
88053169be4bSmrg# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
88063169be4bSmrg# Foundation, Inc.
880767594505Smrg# Written by Gary V. Vaughan, 2004
880867594505Smrg#
880967594505Smrg# This file is free software; the Free Software Foundation gives
881067594505Smrg# unlimited permission to copy and/or distribute it, with or without
881167594505Smrg# modifications, as long as this notice is preserved.
881267594505Smrg
881367594505Smrg# serial 6 ltsugar.m4
881467594505Smrg
881567594505Smrg# This is to help aclocal find these macros, as it can't see m4_define.
881667594505SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
881767594505Smrg
881867594505Smrg
881967594505Smrg# lt_join(SEP, ARG1, [ARG2...])
882067594505Smrg# -----------------------------
882167594505Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
882267594505Smrg# associated separator.
882367594505Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
882467594505Smrg# versions in m4sugar had bugs.
882567594505Smrgm4_define([lt_join],
882667594505Smrg[m4_if([$#], [1], [],
882767594505Smrg       [$#], [2], [[$2]],
882867594505Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
882967594505Smrgm4_define([_lt_join],
883067594505Smrg[m4_if([$#$2], [2], [],
883167594505Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
883267594505Smrg
883367594505Smrg
883467594505Smrg# lt_car(LIST)
883567594505Smrg# lt_cdr(LIST)
883667594505Smrg# ------------
883767594505Smrg# Manipulate m4 lists.
883867594505Smrg# These macros are necessary as long as will still need to support
88393169be4bSmrg# Autoconf-2.59, which quotes differently.
884067594505Smrgm4_define([lt_car], [[$1]])
884167594505Smrgm4_define([lt_cdr],
884267594505Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
884367594505Smrg       [$#], 1, [],
884467594505Smrg       [m4_dquote(m4_shift($@))])])
884567594505Smrgm4_define([lt_unquote], $1)
884667594505Smrg
884767594505Smrg
884867594505Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
884967594505Smrg# ------------------------------------------
88503169be4bSmrg# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
885167594505Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
885267594505Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
885367594505Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
885467594505Smrg# than defined and empty).
885567594505Smrg#
885667594505Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
885767594505Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
885867594505Smrgm4_define([lt_append],
885967594505Smrg[m4_define([$1],
886067594505Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
886167594505Smrg
886267594505Smrg
886367594505Smrg
886467594505Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
886567594505Smrg# ----------------------------------------------------------
886667594505Smrg# Produce a SEP delimited list of all paired combinations of elements of
886767594505Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
886867594505Smrg# has the form PREFIXmINFIXSUFFIXn.
886967594505Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
887067594505Smrgm4_define([lt_combine],
887167594505Smrg[m4_if(m4_eval([$# > 3]), [1],
887267594505Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
887367594505Smrg[[m4_foreach([_Lt_prefix], [$2],
887467594505Smrg	     [m4_foreach([_Lt_suffix],
887567594505Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
887667594505Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
887767594505Smrg
887867594505Smrg
887967594505Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
888067594505Smrg# -----------------------------------------------------------------------
888167594505Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
888267594505Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
888367594505Smrgm4_define([lt_if_append_uniq],
888467594505Smrg[m4_ifdef([$1],
888567594505Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
888667594505Smrg		 [lt_append([$1], [$2], [$3])$4],
888767594505Smrg		 [$5])],
888867594505Smrg	  [lt_append([$1], [$2], [$3])$4])])
888967594505Smrg
889067594505Smrg
889167594505Smrg# lt_dict_add(DICT, KEY, VALUE)
889267594505Smrg# -----------------------------
889367594505Smrgm4_define([lt_dict_add],
889467594505Smrg[m4_define([$1($2)], [$3])])
889567594505Smrg
889667594505Smrg
889767594505Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
889867594505Smrg# --------------------------------------------
889967594505Smrgm4_define([lt_dict_add_subkey],
890067594505Smrg[m4_define([$1($2:$3)], [$4])])
890167594505Smrg
890267594505Smrg
890367594505Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
890467594505Smrg# ----------------------------------
890567594505Smrgm4_define([lt_dict_fetch],
890667594505Smrg[m4_ifval([$3],
890767594505Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
890867594505Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
890967594505Smrg
891067594505Smrg
891167594505Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
891267594505Smrg# -----------------------------------------------------------------
891367594505Smrgm4_define([lt_if_dict_fetch],
891467594505Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
891567594505Smrg	[$5],
891667594505Smrg    [$6])])
891767594505Smrg
89180597fb56Smrg
891967594505Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
892067594505Smrg# --------------------------------------------------------------
892167594505Smrgm4_define([lt_dict_filter],
892267594505Smrg[m4_if([$5], [], [],
892367594505Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
892467594505Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
892567594505Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
892667594505Smrg])
89270597fb56Smrg
892867594505Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
892967594505Smrg#
89303169be4bSmrg#   Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
893167594505Smrg#   Written by Scott James Remnant, 2004
893267594505Smrg#
893367594505Smrg# This file is free software; the Free Software Foundation gives
893467594505Smrg# unlimited permission to copy and/or distribute it, with or without
893567594505Smrg# modifications, as long as this notice is preserved.
89360597fb56Smrg
893767594505Smrg# @configure_input@
89388c4a8e55Smrg
89393169be4bSmrg# serial 4179 ltversion.m4
894067594505Smrg# This file is part of GNU Libtool
89418c4a8e55Smrg
89423169be4bSmrgm4_define([LT_PACKAGE_VERSION], [2.4.6])
89433169be4bSmrgm4_define([LT_PACKAGE_REVISION], [2.4.6])
89448c4a8e55Smrg
894567594505SmrgAC_DEFUN([LTVERSION_VERSION],
89463169be4bSmrg[macro_version='2.4.6'
89473169be4bSmrgmacro_revision='2.4.6'
894867594505Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
894967594505Smrg_LT_DECL(, macro_revision, 0)
89508bd17e5fSmrg])
89518c4a8e55Smrg
895267594505Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
895367594505Smrg#
89543169be4bSmrg#   Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
89553169be4bSmrg#   Foundation, Inc.
895667594505Smrg#   Written by Scott James Remnant, 2004.
895767594505Smrg#
895867594505Smrg# This file is free software; the Free Software Foundation gives
895967594505Smrg# unlimited permission to copy and/or distribute it, with or without
896067594505Smrg# modifications, as long as this notice is preserved.
89618c4a8e55Smrg
896267594505Smrg# serial 5 lt~obsolete.m4
89638c4a8e55Smrg
896467594505Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
896567594505Smrg#
89663169be4bSmrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
896767594505Smrg# which have later been changed to m4_define as they aren't part of the
896867594505Smrg# exported API, or moved to Autoconf or Automake where they belong.
896967594505Smrg#
897067594505Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
897167594505Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
897267594505Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
897367594505Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
897467594505Smrg# and doesn't know about Autoconf macros at all.)
897567594505Smrg#
897667594505Smrg# So we provide this file, which has a silly filename so it's always
897767594505Smrg# included after everything else.  This provides aclocal with the
897867594505Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
897967594505Smrg# because those macros already exist, or will be overwritten later.
89803169be4bSmrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
898167594505Smrg#
898267594505Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
898367594505Smrg# Yes, that means every name once taken will need to remain here until
898467594505Smrg# we give up compatibility with versions before 1.7, at which point
898567594505Smrg# we need to keep only those names which we still refer to.
89868c4a8e55Smrg
898767594505Smrg# This is to help aclocal find these macros, as it can't see m4_define.
898867594505SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
89898bd17e5fSmrg
899067594505Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
899167594505Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
899267594505Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
899367594505Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
899467594505Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
899567594505Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
899667594505Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
899767594505Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
899867594505Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
899967594505Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
900067594505Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
900167594505Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
900267594505Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
900367594505Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
900467594505Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
900567594505Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
900667594505Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
900767594505Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
900867594505Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
900967594505Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
901067594505Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
901167594505Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
901267594505Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
901367594505Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
901467594505Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
901567594505Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
901667594505Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
901767594505Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
901867594505Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
901967594505Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
902067594505Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
902167594505Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
902267594505Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
902367594505Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
902467594505Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
902567594505Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
902667594505Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
902767594505Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
902867594505Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
902967594505Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
903067594505Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
903167594505Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
903267594505Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
903367594505Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
903467594505Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
903567594505Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
903667594505Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
903767594505Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
903867594505Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
903967594505Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
904067594505Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
904167594505Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
904267594505Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
904367594505Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
904467594505Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
904567594505Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
904667594505Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
904767594505Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
904867594505Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
904967594505Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
905067594505Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
90518bd17e5fSmrg
90523169be4bSmrgdnl pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
90533169be4bSmrgdnl serial 11 (pkg-config-0.29)
90543169be4bSmrgdnl
90553169be4bSmrgdnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
90563169be4bSmrgdnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
90573169be4bSmrgdnl
90583169be4bSmrgdnl This program is free software; you can redistribute it and/or modify
90593169be4bSmrgdnl it under the terms of the GNU General Public License as published by
90603169be4bSmrgdnl the Free Software Foundation; either version 2 of the License, or
90613169be4bSmrgdnl (at your option) any later version.
90623169be4bSmrgdnl
90633169be4bSmrgdnl This program is distributed in the hope that it will be useful, but
90643169be4bSmrgdnl WITHOUT ANY WARRANTY; without even the implied warranty of
90653169be4bSmrgdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
90663169be4bSmrgdnl General Public License for more details.
90673169be4bSmrgdnl
90683169be4bSmrgdnl You should have received a copy of the GNU General Public License
90693169be4bSmrgdnl along with this program; if not, write to the Free Software
90703169be4bSmrgdnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
90713169be4bSmrgdnl 02111-1307, USA.
90723169be4bSmrgdnl
90733169be4bSmrgdnl As a special exception to the GNU General Public License, if you
90743169be4bSmrgdnl distribute this file as part of a program that contains a
90753169be4bSmrgdnl configuration script generated by Autoconf, you may include it under
90763169be4bSmrgdnl the same distribution terms that you use for the rest of that
90773169be4bSmrgdnl program.
90783169be4bSmrg
90793169be4bSmrgdnl PKG_PREREQ(MIN-VERSION)
90803169be4bSmrgdnl -----------------------
90813169be4bSmrgdnl Since: 0.29
90823169be4bSmrgdnl
90833169be4bSmrgdnl Verify that the version of the pkg-config macros are at least
90843169be4bSmrgdnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
90853169be4bSmrgdnl installed version of pkg-config, this checks the developer's version
90863169be4bSmrgdnl of pkg.m4 when generating configure.
90873169be4bSmrgdnl
90883169be4bSmrgdnl To ensure that this macro is defined, also add:
90893169be4bSmrgdnl m4_ifndef([PKG_PREREQ],
90903169be4bSmrgdnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
90913169be4bSmrgdnl
90923169be4bSmrgdnl See the "Since" comment for each macro you use to see what version
90933169be4bSmrgdnl of the macros you require.
90943169be4bSmrgm4_defun([PKG_PREREQ],
90953169be4bSmrg[m4_define([PKG_MACROS_VERSION], [0.29])
90963169be4bSmrgm4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
90973169be4bSmrg    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
90983169be4bSmrg])dnl PKG_PREREQ
90993169be4bSmrg
91003169be4bSmrgdnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
91013169be4bSmrgdnl ----------------------------------
91023169be4bSmrgdnl Since: 0.16
91033169be4bSmrgdnl
91043169be4bSmrgdnl Search for the pkg-config tool and set the PKG_CONFIG variable to
91053169be4bSmrgdnl first found in the path. Checks that the version of pkg-config found
91063169be4bSmrgdnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
91073169be4bSmrgdnl used since that's the first version where most current features of
91083169be4bSmrgdnl pkg-config existed.
910967594505SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
911067594505Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
911167594505Smrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
911267594505Smrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
911367594505SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
911467594505SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
911567594505SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
91168c4a8e55Smrg
911767594505Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
911867594505Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
911967594505Smrgfi
912067594505Smrgif test -n "$PKG_CONFIG"; then
912167594505Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
912267594505Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
912367594505Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
912467594505Smrg		AC_MSG_RESULT([yes])
912567594505Smrg	else
912667594505Smrg		AC_MSG_RESULT([no])
912767594505Smrg		PKG_CONFIG=""
912867594505Smrg	fi
912967594505Smrgfi[]dnl
91303169be4bSmrg])dnl PKG_PROG_PKG_CONFIG
91318bd17e5fSmrg
91323169be4bSmrgdnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
91333169be4bSmrgdnl -------------------------------------------------------------------
91343169be4bSmrgdnl Since: 0.18
91353169be4bSmrgdnl
91363169be4bSmrgdnl Check to see whether a particular set of modules exists. Similar to
91373169be4bSmrgdnl PKG_CHECK_MODULES(), but does not set variables or print errors.
91383169be4bSmrgdnl
91393169be4bSmrgdnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
91403169be4bSmrgdnl only at the first occurence in configure.ac, so if the first place
91413169be4bSmrgdnl it's called might be skipped (such as if it is within an "if", you
91423169be4bSmrgdnl have to call PKG_CHECK_EXISTS manually
914367594505SmrgAC_DEFUN([PKG_CHECK_EXISTS],
914467594505Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
914567594505Smrgif test -n "$PKG_CONFIG" && \
914667594505Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
914767594505Smrg  m4_default([$2], [:])
914867594505Smrgm4_ifvaln([$3], [else
914967594505Smrg  $3])dnl
915067594505Smrgfi])
91518bd17e5fSmrg
91523169be4bSmrgdnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
91533169be4bSmrgdnl ---------------------------------------------
91543169be4bSmrgdnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
91553169be4bSmrgdnl pkg_failed based on the result.
915667594505Smrgm4_define([_PKG_CONFIG],
915767594505Smrg[if test -n "$$1"; then
915867594505Smrg    pkg_cv_[]$1="$$1"
915967594505Smrg elif test -n "$PKG_CONFIG"; then
916067594505Smrg    PKG_CHECK_EXISTS([$3],
916167594505Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
916267594505Smrg		      test "x$?" != "x0" && pkg_failed=yes ],
916367594505Smrg		     [pkg_failed=yes])
916467594505Smrg else
916567594505Smrg    pkg_failed=untried
916667594505Smrgfi[]dnl
91673169be4bSmrg])dnl _PKG_CONFIG
91688bd17e5fSmrg
91693169be4bSmrgdnl _PKG_SHORT_ERRORS_SUPPORTED
91703169be4bSmrgdnl ---------------------------
91713169be4bSmrgdnl Internal check to see if pkg-config supports short errors.
917267594505SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
917367594505Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
917467594505Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
917567594505Smrg        _pkg_short_errors_supported=yes
917667594505Smrgelse
917767594505Smrg        _pkg_short_errors_supported=no
917867594505Smrgfi[]dnl
91793169be4bSmrg])dnl _PKG_SHORT_ERRORS_SUPPORTED
91808bd17e5fSmrg
91818bd17e5fSmrg
91823169be4bSmrgdnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
91833169be4bSmrgdnl   [ACTION-IF-NOT-FOUND])
91843169be4bSmrgdnl --------------------------------------------------------------
91853169be4bSmrgdnl Since: 0.4.0
91863169be4bSmrgdnl
91873169be4bSmrgdnl Note that if there is a possibility the first call to
91883169be4bSmrgdnl PKG_CHECK_MODULES might not happen, you should be sure to include an
91893169be4bSmrgdnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
919067594505SmrgAC_DEFUN([PKG_CHECK_MODULES],
919167594505Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
919267594505SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
919367594505SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
91948bd17e5fSmrg
919567594505Smrgpkg_failed=no
919667594505SmrgAC_MSG_CHECKING([for $1])
91978bd17e5fSmrg
919867594505Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
919967594505Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
92008bd17e5fSmrg
920167594505Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
920267594505Smrgand $1[]_LIBS to avoid the need to call pkg-config.
920367594505SmrgSee the pkg-config man page for more details.])
92048bd17e5fSmrg
920567594505Smrgif test $pkg_failed = yes; then
920667594505Smrg   	AC_MSG_RESULT([no])
920767594505Smrg        _PKG_SHORT_ERRORS_SUPPORTED
920867594505Smrg        if test $_pkg_short_errors_supported = yes; then
920967594505Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
921067594505Smrg        else 
921167594505Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
921267594505Smrg        fi
921367594505Smrg	# Put the nasty error message in config.log where it belongs
921467594505Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
92158bd17e5fSmrg
921667594505Smrg	m4_default([$4], [AC_MSG_ERROR(
921767594505Smrg[Package requirements ($2) were not met:
92188bd17e5fSmrg
921967594505Smrg$$1_PKG_ERRORS
92208bd17e5fSmrg
922167594505SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
922267594505Smrginstalled software in a non-standard prefix.
92238bd17e5fSmrg
922467594505Smrg_PKG_TEXT])[]dnl
922567594505Smrg        ])
922667594505Smrgelif test $pkg_failed = untried; then
922767594505Smrg     	AC_MSG_RESULT([no])
922867594505Smrg	m4_default([$4], [AC_MSG_FAILURE(
922967594505Smrg[The pkg-config script could not be found or is too old.  Make sure it
923067594505Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
923167594505Smrgpath to pkg-config.
923267594505Smrg
923367594505Smrg_PKG_TEXT
92348c4a8e55Smrg
923567594505SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
923667594505Smrg        ])
923767594505Smrgelse
923867594505Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
923967594505Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
924067594505Smrg        AC_MSG_RESULT([yes])
924167594505Smrg	$3
924267594505Smrgfi[]dnl
92433169be4bSmrg])dnl PKG_CHECK_MODULES
92448c4a8e55Smrg
92458c4a8e55Smrg
92463169be4bSmrgdnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
92473169be4bSmrgdnl   [ACTION-IF-NOT-FOUND])
92483169be4bSmrgdnl ---------------------------------------------------------------------
92493169be4bSmrgdnl Since: 0.29
92503169be4bSmrgdnl
92513169be4bSmrgdnl Checks for existence of MODULES and gathers its build flags with
92523169be4bSmrgdnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
92533169be4bSmrgdnl and VARIABLE-PREFIX_LIBS from --libs.
92543169be4bSmrgdnl
92553169be4bSmrgdnl Note that if there is a possibility the first call to
92563169be4bSmrgdnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
92573169be4bSmrgdnl include an explicit call to PKG_PROG_PKG_CONFIG in your
92583169be4bSmrgdnl configure.ac.
92593169be4bSmrgAC_DEFUN([PKG_CHECK_MODULES_STATIC],
92603169be4bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
92613169be4bSmrg_save_PKG_CONFIG=$PKG_CONFIG
92623169be4bSmrgPKG_CONFIG="$PKG_CONFIG --static"
92633169be4bSmrgPKG_CHECK_MODULES($@)
92643169be4bSmrgPKG_CONFIG=$_save_PKG_CONFIG[]dnl
92653169be4bSmrg])dnl PKG_CHECK_MODULES_STATIC
92668c4a8e55Smrg
92678c4a8e55Smrg
92683169be4bSmrgdnl PKG_INSTALLDIR([DIRECTORY])
92693169be4bSmrgdnl -------------------------
92703169be4bSmrgdnl Since: 0.27
92713169be4bSmrgdnl
92723169be4bSmrgdnl Substitutes the variable pkgconfigdir as the location where a module
92733169be4bSmrgdnl should install pkg-config .pc files. By default the directory is
92743169be4bSmrgdnl $libdir/pkgconfig, but the default can be changed by passing
92753169be4bSmrgdnl DIRECTORY. The user can override through the --with-pkgconfigdir
92763169be4bSmrgdnl parameter.
92773169be4bSmrgAC_DEFUN([PKG_INSTALLDIR],
92783169be4bSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
92793169be4bSmrgm4_pushdef([pkg_description],
92803169be4bSmrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
92813169be4bSmrgAC_ARG_WITH([pkgconfigdir],
92823169be4bSmrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
92833169be4bSmrg    [with_pkgconfigdir=]pkg_default)
92843169be4bSmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
92853169be4bSmrgm4_popdef([pkg_default])
92863169be4bSmrgm4_popdef([pkg_description])
92873169be4bSmrg])dnl PKG_INSTALLDIR
92883169be4bSmrg
92893169be4bSmrg
92903169be4bSmrgdnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
92913169be4bSmrgdnl --------------------------------
92923169be4bSmrgdnl Since: 0.27
92933169be4bSmrgdnl
92943169be4bSmrgdnl Substitutes the variable noarch_pkgconfigdir as the location where a
92953169be4bSmrgdnl module should install arch-independent pkg-config .pc files. By
92963169be4bSmrgdnl default the directory is $datadir/pkgconfig, but the default can be
92973169be4bSmrgdnl changed by passing DIRECTORY. The user can override through the
92983169be4bSmrgdnl --with-noarch-pkgconfigdir parameter.
92993169be4bSmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
93003169be4bSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
93013169be4bSmrgm4_pushdef([pkg_description],
93023169be4bSmrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
93033169be4bSmrgAC_ARG_WITH([noarch-pkgconfigdir],
93043169be4bSmrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
93053169be4bSmrg    [with_noarch_pkgconfigdir=]pkg_default)
93063169be4bSmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
93073169be4bSmrgm4_popdef([pkg_default])
93083169be4bSmrgm4_popdef([pkg_description])
93093169be4bSmrg])dnl PKG_NOARCH_INSTALLDIR
93103169be4bSmrg
93113169be4bSmrg
93123169be4bSmrgdnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
93133169be4bSmrgdnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
93143169be4bSmrgdnl -------------------------------------------
93153169be4bSmrgdnl Since: 0.28
93163169be4bSmrgdnl
93173169be4bSmrgdnl Retrieves the value of the pkg-config variable for the given module.
93183169be4bSmrgAC_DEFUN([PKG_CHECK_VAR],
93193169be4bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
93203169be4bSmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
93218c4a8e55Smrg
93223169be4bSmrg_PKG_CONFIG([$1], [variable="][$3]["], [$2])
93233169be4bSmrgAS_VAR_COPY([$1], [pkg_cv_][$1])
93248c4a8e55Smrg
93253169be4bSmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl
93263169be4bSmrg])dnl PKG_CHECK_VAR
9327b242714cSmrg
93283169be4bSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
93293169be4bSmrgdnl
93303169be4bSmrgdnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
93313169be4bSmrgdnl
93323169be4bSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
93333169be4bSmrgdnl copy of this software and associated documentation files (the "Software"),
93343169be4bSmrgdnl to deal in the Software without restriction, including without limitation
93353169be4bSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
93363169be4bSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
93373169be4bSmrgdnl Software is furnished to do so, subject to the following conditions:
93383169be4bSmrgdnl
93393169be4bSmrgdnl The above copyright notice and this permission notice (including the next
93403169be4bSmrgdnl paragraph) shall be included in all copies or substantial portions of the
93413169be4bSmrgdnl Software.
93423169be4bSmrgdnl
93433169be4bSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
93443169be4bSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
93453169be4bSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
93463169be4bSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
93473169be4bSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
93483169be4bSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
93493169be4bSmrgdnl DEALINGS IN THE SOFTWARE.
93503169be4bSmrg
93513169be4bSmrg# XORG_MACROS_VERSION(required-version)
93523169be4bSmrg# -------------------------------------
93533169be4bSmrg# Minimum version: 1.1.0
935467594505Smrg#
93553169be4bSmrg# If you're using a macro added in Version 1.1 or newer, include this in
93563169be4bSmrg# your configure.ac with the minimum required version, such as:
93573169be4bSmrg# XORG_MACROS_VERSION(1.1)
935867594505Smrg#
93593169be4bSmrg# To ensure that this macro is defined, also add:
93603169be4bSmrg# m4_ifndef([XORG_MACROS_VERSION],
93613169be4bSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
936267594505Smrg#
9363b242714cSmrg#
93643169be4bSmrg# See the "minimum version" comment for each macro you use to see what
93653169be4bSmrg# version you require.
93663169be4bSmrgm4_defun([XORG_MACROS_VERSION],[
93673169be4bSmrgm4_define([vers_have], [1.19.0])
93683169be4bSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
93693169be4bSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
93703169be4bSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
93713169be4bSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
93723169be4bSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
93733169be4bSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
93743169be4bSmrgm4_undefine([vers_have])
93753169be4bSmrgm4_undefine([maj_have])
93763169be4bSmrgm4_undefine([maj_needed])
93773169be4bSmrg]) # XORG_MACROS_VERSION
9378b242714cSmrg
93793169be4bSmrg# XORG_PROG_RAWCPP()
93803169be4bSmrg# ------------------
93813169be4bSmrg# Minimum version: 1.0.0
9382b242714cSmrg#
93833169be4bSmrg# Find cpp program and necessary flags for use in pre-processing text files
93843169be4bSmrg# such as man pages and config files
93853169be4bSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
93863169be4bSmrgAC_REQUIRE([AC_PROG_CPP])
93873169be4bSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
93883169be4bSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9389b242714cSmrg
93903169be4bSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
93913169be4bSmrg# which is not the best choice for supporting other OS'es, but covers most
93923169be4bSmrg# of the ones we need for now.
93933169be4bSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
93943169be4bSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
93953169be4bSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
93963169be4bSmrg	AC_MSG_RESULT([no])
939767594505Smrgelse
93983169be4bSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
93993169be4bSmrg		RAWCPPFLAGS=-undef
94003169be4bSmrg		AC_MSG_RESULT([yes])
94013169be4bSmrg	# under Cygwin unix is still defined even with -undef
94023169be4bSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
94033169be4bSmrg		RAWCPPFLAGS="-undef -ansi"
94043169be4bSmrg		AC_MSG_RESULT([yes, with -ansi])
94053169be4bSmrg	else
94063169be4bSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
94073169be4bSmrg	fi
94083169be4bSmrgfi
94093169be4bSmrgrm -f conftest.$ac_ext
94108c4a8e55Smrg
94113169be4bSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
94123169be4bSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
94133169be4bSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
94143169be4bSmrg	AC_MSG_RESULT([no])
94153169be4bSmrgelse
94163169be4bSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
94173169be4bSmrg		TRADITIONALCPPFLAGS="-traditional"
94183169be4bSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
94193169be4bSmrg		AC_MSG_RESULT([yes])
94203169be4bSmrg	else
94213169be4bSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
94223169be4bSmrg	fi
94233169be4bSmrgfi
94243169be4bSmrgrm -f conftest.$ac_ext
94253169be4bSmrgAC_SUBST(RAWCPPFLAGS)
94263169be4bSmrgAC_SUBST(TRADITIONALCPPFLAGS)
94273169be4bSmrg]) # XORG_PROG_RAWCPP
94288c4a8e55Smrg
94293169be4bSmrg# XORG_MANPAGE_SECTIONS()
94303169be4bSmrg# -----------------------
94313169be4bSmrg# Minimum version: 1.0.0
9432b242714cSmrg#
94333169be4bSmrg# Determine which sections man pages go in for the different man page types
94343169be4bSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
94353169be4bSmrg# Not sure if there's any better way than just hardcoding by OS name.
94363169be4bSmrg# Override default settings by setting environment variables
94373169be4bSmrg# Added MAN_SUBSTS in version 1.8
94383169be4bSmrg# Added AC_PROG_SED in version 1.8
9439706b6b52Smrg
94403169be4bSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
94413169be4bSmrgAC_REQUIRE([AC_CANONICAL_HOST])
94423169be4bSmrgAC_REQUIRE([AC_PROG_SED])
9443706b6b52Smrg
94443169be4bSmrgif test x$APP_MAN_SUFFIX = x    ; then
94453169be4bSmrg    APP_MAN_SUFFIX=1
94463169be4bSmrgfi
94473169be4bSmrgif test x$APP_MAN_DIR = x    ; then
94483169be4bSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
94493169be4bSmrgfi
94508bd17e5fSmrg
94513169be4bSmrgif test x$LIB_MAN_SUFFIX = x    ; then
94523169be4bSmrg    LIB_MAN_SUFFIX=3
94533169be4bSmrgfi
94543169be4bSmrgif test x$LIB_MAN_DIR = x    ; then
94553169be4bSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
94563169be4bSmrgfi
94578bd17e5fSmrg
94583169be4bSmrgif test x$FILE_MAN_SUFFIX = x    ; then
94593169be4bSmrg    case $host_os in
94603169be4bSmrg	# Solaris 2.0 - 11 use SysV man page sections
94613169be4bSmrg	solaris2.?|solaris2.1[[01]])	FILE_MAN_SUFFIX=4  ;;
94623169be4bSmrg	*)				FILE_MAN_SUFFIX=5  ;;
9463b242714cSmrg    esac
94643169be4bSmrgfi
94653169be4bSmrgif test x$FILE_MAN_DIR = x    ; then
94663169be4bSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
94673169be4bSmrgfi
94688bd17e5fSmrg
94693169be4bSmrgif test x$MISC_MAN_SUFFIX = x    ; then
94703169be4bSmrg    case $host_os in
94713169be4bSmrg	# Solaris 2.0 - 11 use SysV man page sections
94723169be4bSmrg	solaris2.?|solaris2.1[[01]])	MISC_MAN_SUFFIX=5  ;;
94733169be4bSmrg	*)				MISC_MAN_SUFFIX=7  ;;
94743169be4bSmrg    esac
94753169be4bSmrgfi
94763169be4bSmrgif test x$MISC_MAN_DIR = x    ; then
94773169be4bSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
947867594505Smrgfi
94798bd17e5fSmrg
94803169be4bSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
94813169be4bSmrg    case $host_os in
94823169be4bSmrg	# Solaris 2.0 - 11 use SysV man page sections
94833169be4bSmrg	solaris2.?|solaris2.1[[01]])	DRIVER_MAN_SUFFIX=7  ;;
94843169be4bSmrg	*)				DRIVER_MAN_SUFFIX=4  ;;
94853169be4bSmrg    esac
94863169be4bSmrgfi
94873169be4bSmrgif test x$DRIVER_MAN_DIR = x    ; then
94883169be4bSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
94893169be4bSmrgfi
94908bd17e5fSmrg
94913169be4bSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
94923169be4bSmrg    case $host_os in
94933169be4bSmrg	# Solaris 2.0 - 11 use SysV man page sections
94943169be4bSmrg	solaris2.?|solaris2.1[[01]])	ADMIN_MAN_SUFFIX=1m ;;
94953169be4bSmrg	*)				ADMIN_MAN_SUFFIX=8  ;;
94963169be4bSmrg    esac
94973169be4bSmrgfi
94983169be4bSmrgif test x$ADMIN_MAN_DIR = x    ; then
94993169be4bSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
95003169be4bSmrgfi
950167594505Smrg
950267594505Smrg
95033169be4bSmrgAC_SUBST([APP_MAN_SUFFIX])
95043169be4bSmrgAC_SUBST([LIB_MAN_SUFFIX])
95053169be4bSmrgAC_SUBST([FILE_MAN_SUFFIX])
95063169be4bSmrgAC_SUBST([MISC_MAN_SUFFIX])
95073169be4bSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
95083169be4bSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
95093169be4bSmrgAC_SUBST([APP_MAN_DIR])
95103169be4bSmrgAC_SUBST([LIB_MAN_DIR])
95113169be4bSmrgAC_SUBST([FILE_MAN_DIR])
95123169be4bSmrgAC_SUBST([MISC_MAN_DIR])
95133169be4bSmrgAC_SUBST([DRIVER_MAN_DIR])
95143169be4bSmrgAC_SUBST([ADMIN_MAN_DIR])
95158c4a8e55Smrg
95163169be4bSmrgXORG_MAN_PAGE="X Version 11"
95173169be4bSmrgAC_SUBST([XORG_MAN_PAGE])
95183169be4bSmrgMAN_SUBSTS="\
95193169be4bSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
95203169be4bSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
95213169be4bSmrg	-e 's|__xservername__|Xorg|g' \
95223169be4bSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
95233169be4bSmrg	-e 's|__projectroot__|\$(prefix)|g' \
95243169be4bSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
95253169be4bSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
95263169be4bSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
95273169be4bSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
95283169be4bSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
95293169be4bSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
95303169be4bSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
95313169be4bSmrgAC_SUBST([MAN_SUBSTS])
95328c4a8e55Smrg
95333169be4bSmrg]) # XORG_MANPAGE_SECTIONS
95348c4a8e55Smrg
95353169be4bSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
95363169be4bSmrg# ------------------------
95373169be4bSmrg# Minimum version: 1.7.0
95383169be4bSmrg#
95393169be4bSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
95403169be4bSmrg# provided by xorg-sgml-doctools, if installed.
95413169be4bSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
95423169be4bSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
95433169be4bSmrgXORG_SGML_PATH=
95443169be4bSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
95453169be4bSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
95463169be4bSmrg    [m4_ifval([$1],[:],
95473169be4bSmrg        [if test x"$cross_compiling" != x"yes" ; then
95483169be4bSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
95493169be4bSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
95503169be4bSmrg         fi])
95513169be4bSmrg    ])
95528c4a8e55Smrg
95533169be4bSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
95543169be4bSmrg# the path and the name of the doc stylesheet
95553169be4bSmrgif test "x$XORG_SGML_PATH" != "x" ; then
95563169be4bSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
95573169be4bSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
95583169be4bSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
95593169be4bSmrgelse
95603169be4bSmrg   AC_MSG_RESULT([no])
95613169be4bSmrgfi
95628c4a8e55Smrg
95633169be4bSmrgAC_SUBST(XORG_SGML_PATH)
95643169be4bSmrgAC_SUBST(STYLESHEET_SRCDIR)
95653169be4bSmrgAC_SUBST(XSL_STYLESHEET)
95663169be4bSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
95673169be4bSmrg]) # XORG_CHECK_SGML_DOCTOOLS
95688c4a8e55Smrg
95693169be4bSmrg# XORG_CHECK_LINUXDOC
95703169be4bSmrg# -------------------
95713169be4bSmrg# Minimum version: 1.0.0
957267594505Smrg#
95733169be4bSmrg# Defines the variable MAKE_TEXT if the necessary tools and
95743169be4bSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
95753169be4bSmrg# Whether or not the necessary tools and files are found can be checked
95763169be4bSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
95773169be4bSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
95783169be4bSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
95793169be4bSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
95808c4a8e55Smrg
95813169be4bSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
95828c4a8e55Smrg
95833169be4bSmrgAC_MSG_CHECKING([whether to build documentation])
95848c4a8e55Smrg
95853169be4bSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
95863169be4bSmrg   BUILDDOC=yes
95873169be4bSmrgelse
95883169be4bSmrg   BUILDDOC=no
95893169be4bSmrgfi
95908c4a8e55Smrg
95913169be4bSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
95928c4a8e55Smrg
95933169be4bSmrgAC_MSG_RESULT([$BUILDDOC])
9594bd23fbfaSmrg
95953169be4bSmrgAC_MSG_CHECKING([whether to build pdf documentation])
95963169be4bSmrg
95973169be4bSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
95983169be4bSmrg   BUILDPDFDOC=yes
95993169be4bSmrgelse
96003169be4bSmrg   BUILDPDFDOC=no
960167594505Smrgfi
9602bd23fbfaSmrg
96033169be4bSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
96048c4a8e55Smrg
96053169be4bSmrgAC_MSG_RESULT([$BUILDPDFDOC])
96068c4a8e55Smrg
96073169be4bSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
96083169be4bSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
96093169be4bSmrgMAKE_PDF="$PS2PDF"
96103169be4bSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
96110597fb56Smrg
96123169be4bSmrgAC_SUBST(MAKE_TEXT)
96133169be4bSmrgAC_SUBST(MAKE_PS)
96143169be4bSmrgAC_SUBST(MAKE_PDF)
96153169be4bSmrgAC_SUBST(MAKE_HTML)
96163169be4bSmrg]) # XORG_CHECK_LINUXDOC
9617b242714cSmrg
96183169be4bSmrg# XORG_CHECK_DOCBOOK
96193169be4bSmrg# -------------------
96203169be4bSmrg# Minimum version: 1.0.0
96213169be4bSmrg#
96223169be4bSmrg# Checks for the ability to build output formats from SGML DocBook source.
96233169be4bSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
96243169be4bSmrg# indicates whether the necessary tools and files are found and, if set,
96253169be4bSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
96263169be4bSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
96273169be4bSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9628b242714cSmrg
96293169be4bSmrgBUILDTXTDOC=no
96303169be4bSmrgBUILDPDFDOC=no
96313169be4bSmrgBUILDPSDOC=no
96323169be4bSmrgBUILDHTMLDOC=no
96338c4a8e55Smrg
96343169be4bSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
96353169be4bSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
96363169be4bSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
96373169be4bSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
9638b242714cSmrg
96393169be4bSmrgAC_MSG_CHECKING([whether to build text documentation])
96403169be4bSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
96413169be4bSmrg   test x$BUILD_TXTDOC != xno; then
96423169be4bSmrg	BUILDTXTDOC=yes
96433169be4bSmrgfi
96443169be4bSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
96453169be4bSmrgAC_MSG_RESULT([$BUILDTXTDOC])
9646b242714cSmrg
96473169be4bSmrgAC_MSG_CHECKING([whether to build PDF documentation])
96483169be4bSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
96493169be4bSmrg   test x$BUILD_PDFDOC != xno; then
96503169be4bSmrg	BUILDPDFDOC=yes
96513169be4bSmrgfi
96523169be4bSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
96533169be4bSmrgAC_MSG_RESULT([$BUILDPDFDOC])
9654b242714cSmrg
96553169be4bSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
96563169be4bSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
96573169be4bSmrg   test x$BUILD_PSDOC != xno; then
96583169be4bSmrg	BUILDPSDOC=yes
96593169be4bSmrgfi
96603169be4bSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
96613169be4bSmrgAC_MSG_RESULT([$BUILDPSDOC])
96620597fb56Smrg
96633169be4bSmrgAC_MSG_CHECKING([whether to build HTML documentation])
96643169be4bSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
96653169be4bSmrg   test x$BUILD_HTMLDOC != xno; then
96663169be4bSmrg	BUILDHTMLDOC=yes
96673169be4bSmrgfi
96683169be4bSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
96693169be4bSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
96708c4a8e55Smrg
96713169be4bSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
96723169be4bSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
96733169be4bSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
96743169be4bSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
9675b242714cSmrg
96763169be4bSmrgAC_SUBST(MAKE_TEXT)
96773169be4bSmrgAC_SUBST(MAKE_PS)
96783169be4bSmrgAC_SUBST(MAKE_PDF)
96793169be4bSmrgAC_SUBST(MAKE_HTML)
96803169be4bSmrg]) # XORG_CHECK_DOCBOOK
9681b242714cSmrg
96823169be4bSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
96833169be4bSmrg# ----------------
96843169be4bSmrg# Minimum version: 1.5.0
96853169be4bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
968667594505Smrg#
96873169be4bSmrg# Documentation tools are not always available on all platforms and sometimes
96883169be4bSmrg# not at the appropriate level. This macro enables a module to test for the
96893169be4bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
96903169be4bSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
96913169be4bSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
96923169be4bSmrg# --with-xmlto assumes 'auto'.
969367594505Smrg#
96943169be4bSmrg# Interface to module:
96953169be4bSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
96963169be4bSmrg# XMLTO:	returns the path of the xmlto program found
96973169be4bSmrg#		returns the path set by the user in the environment
96983169be4bSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
96993169be4bSmrg#		'no' user instructs the module not to use xmlto
97003169be4bSmrg#
97013169be4bSmrg# Added in version 1.10.0
97023169be4bSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
97033169be4bSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
97043169be4bSmrg#
97053169be4bSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
97063169be4bSmrg#
97073169be4bSmrgAC_DEFUN([XORG_WITH_XMLTO],[
97083169be4bSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
97093169be4bSmrgm4_define([_defopt], m4_default([$2], [auto]))
97103169be4bSmrgAC_ARG_WITH(xmlto,
97113169be4bSmrg	AS_HELP_STRING([--with-xmlto],
97123169be4bSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
97133169be4bSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
97143169be4bSmrgm4_undefine([_defopt])
9715706b6b52Smrg
97163169be4bSmrgif test "x$use_xmlto" = x"auto"; then
97173169be4bSmrg   AC_PATH_PROG([XMLTO], [xmlto])
97183169be4bSmrg   if test "x$XMLTO" = "x"; then
97193169be4bSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
97203169be4bSmrg	have_xmlto=no
97213169be4bSmrg   else
97223169be4bSmrg        have_xmlto=yes
97233169be4bSmrg   fi
97243169be4bSmrgelif test "x$use_xmlto" = x"yes" ; then
97253169be4bSmrg   AC_PATH_PROG([XMLTO], [xmlto])
97263169be4bSmrg   if test "x$XMLTO" = "x"; then
97273169be4bSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
97283169be4bSmrg   fi
97293169be4bSmrg   have_xmlto=yes
97303169be4bSmrgelif test "x$use_xmlto" = x"no" ; then
97313169be4bSmrg   if test "x$XMLTO" != "x"; then
97323169be4bSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
97333169be4bSmrg   fi
97343169be4bSmrg   have_xmlto=no
973567594505Smrgelse
97363169be4bSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
97378bd17e5fSmrgfi
97380597fb56Smrg
97393169be4bSmrg# Test for a minimum version of xmlto, if provided.
97403169be4bSmrgm4_ifval([$1],
97413169be4bSmrg[if test "$have_xmlto" = yes; then
97423169be4bSmrg    # scrape the xmlto version
97433169be4bSmrg    AC_MSG_CHECKING([the xmlto version])
97443169be4bSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
97453169be4bSmrg    AC_MSG_RESULT([$xmlto_version])
97463169be4bSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
97473169be4bSmrg        [if test "x$use_xmlto" = xauto; then
97483169be4bSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
97493169be4bSmrg            have_xmlto=no
97503169be4bSmrg        else
97513169be4bSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
97523169be4bSmrg        fi])
97533169be4bSmrgfi])
97540597fb56Smrg
97553169be4bSmrg# Test for the ability of xmlto to generate a text target
975667594505Smrg#
97573169be4bSmrg# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the
97583169be4bSmrg# following test for empty XML docbook files.
97593169be4bSmrg# For compatibility reasons use the following empty XML docbook file and if
97603169be4bSmrg# it fails try it again with a non-empty XML file.
97613169be4bSmrghave_xmlto_text=no
97623169be4bSmrgcat > conftest.xml << "EOF"
97633169be4bSmrgEOF
97643169be4bSmrgAS_IF([test "$have_xmlto" = yes],
97653169be4bSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
97663169be4bSmrg             [have_xmlto_text=yes],
97673169be4bSmrg             [# Try it again with a non-empty XML file.
97683169be4bSmrg              cat > conftest.xml << "EOF"
97693169be4bSmrg<x></x>
97703169be4bSmrgEOF
97713169be4bSmrg              AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
97723169be4bSmrg                    [have_xmlto_text=yes],
97733169be4bSmrg                    [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])])
97743169be4bSmrgrm -f conftest.xml
97753169be4bSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
97763169be4bSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
97773169be4bSmrg]) # XORG_WITH_XMLTO
97780597fb56Smrg
97793169be4bSmrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
97803169be4bSmrg# --------------------------------------------
97813169be4bSmrg# Minimum version: 1.12.0
97823169be4bSmrg# Minimum version for optional DEFAULT argument: 1.12.0
978367594505Smrg#
97843169be4bSmrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
97853169be4bSmrg# XML-based language used for the transformation of XML documents.
97863169be4bSmrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
97873169be4bSmrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
97883169be4bSmrg# The XSLT processor is often used as a standalone tool for transformations.
97893169be4bSmrg# It should not be assumed that this tool is used only to work with documnetation.
97903169be4bSmrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
97913169be4bSmrg#
97923169be4bSmrg# Interface to module:
97933169be4bSmrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
97943169be4bSmrg# XSLTPROC:	 returns the path of the xsltproc program found
97953169be4bSmrg#		 returns the path set by the user in the environment
97963169be4bSmrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
97973169be4bSmrg#		  'no' user instructs the module not to use xsltproc
97983169be4bSmrg# have_xsltproc: returns yes if xsltproc found in PATH or no
97993169be4bSmrg#
98003169be4bSmrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
98013169be4bSmrg#
98023169be4bSmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
98033169be4bSmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
98043169be4bSmrg# Preserves the interface, should it be implemented later
98053169be4bSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
98063169be4bSmrgm4_define([_defopt], m4_default([$2], [auto]))
98073169be4bSmrgAC_ARG_WITH(xsltproc,
98083169be4bSmrg	AS_HELP_STRING([--with-xsltproc],
98093169be4bSmrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
98103169be4bSmrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
98113169be4bSmrgm4_undefine([_defopt])
9812b242714cSmrg
98133169be4bSmrgif test "x$use_xsltproc" = x"auto"; then
98143169be4bSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
98153169be4bSmrg   if test "x$XSLTPROC" = "x"; then
98163169be4bSmrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
98173169be4bSmrg	have_xsltproc=no
98183169be4bSmrg   else
98193169be4bSmrg        have_xsltproc=yes
98203169be4bSmrg   fi
98213169be4bSmrgelif test "x$use_xsltproc" = x"yes" ; then
98223169be4bSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
98233169be4bSmrg   if test "x$XSLTPROC" = "x"; then
98243169be4bSmrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
98253169be4bSmrg   fi
98263169be4bSmrg   have_xsltproc=yes
98273169be4bSmrgelif test "x$use_xsltproc" = x"no" ; then
98283169be4bSmrg   if test "x$XSLTPROC" != "x"; then
98293169be4bSmrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
98303169be4bSmrg   fi
98313169be4bSmrg   have_xsltproc=no
983267594505Smrgelse
98333169be4bSmrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
983467594505Smrgfi
98350597fb56Smrg
98363169be4bSmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
98373169be4bSmrg]) # XORG_WITH_XSLTPROC
9838b242714cSmrg
98393169be4bSmrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
98403169be4bSmrg# ----------------------------------------
98413169be4bSmrg# Minimum version: 1.15.0
984267594505Smrg#
98433169be4bSmrg# PERL (Practical Extraction and Report Language) is a language optimized for
98443169be4bSmrg# scanning arbitrary text files, extracting information from those text files,
98453169be4bSmrg# and printing reports based on that information.
98463169be4bSmrg#
98473169be4bSmrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
98483169be4bSmrg#
98493169be4bSmrg# Interface to module:
98503169be4bSmrg# HAVE_PERL: used in makefiles to conditionally scan text files
98513169be4bSmrg# PERL:	     returns the path of the perl program found
98523169be4bSmrg#	     returns the path set by the user in the environment
98533169be4bSmrg# --with-perl: 'yes' user instructs the module to use perl
98543169be4bSmrg#	       'no' user instructs the module not to use perl
98553169be4bSmrg# have_perl: returns yes if perl found in PATH or no
98563169be4bSmrg#
98573169be4bSmrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
98583169be4bSmrg#
98593169be4bSmrgAC_DEFUN([XORG_WITH_PERL],[
98603169be4bSmrgAC_ARG_VAR([PERL], [Path to perl command])
98613169be4bSmrg# Preserves the interface, should it be implemented later
98623169be4bSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
98633169be4bSmrgm4_define([_defopt], m4_default([$2], [auto]))
98643169be4bSmrgAC_ARG_WITH(perl,
98653169be4bSmrg	AS_HELP_STRING([--with-perl],
98663169be4bSmrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
98673169be4bSmrg	   [use_perl=$withval], [use_perl=]_defopt)
98683169be4bSmrgm4_undefine([_defopt])
98690597fb56Smrg
98703169be4bSmrgif test "x$use_perl" = x"auto"; then
98713169be4bSmrg   AC_PATH_PROG([PERL], [perl])
98723169be4bSmrg   if test "x$PERL" = "x"; then
98733169be4bSmrg        AC_MSG_WARN([perl not found - cannot extract information and report])
98743169be4bSmrg	have_perl=no
98753169be4bSmrg   else
98763169be4bSmrg        have_perl=yes
98773169be4bSmrg   fi
98783169be4bSmrgelif test "x$use_perl" = x"yes" ; then
98793169be4bSmrg   AC_PATH_PROG([PERL], [perl])
98803169be4bSmrg   if test "x$PERL" = "x"; then
98813169be4bSmrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
98823169be4bSmrg   fi
98833169be4bSmrg   have_perl=yes
98843169be4bSmrgelif test "x$use_perl" = x"no" ; then
98853169be4bSmrg   if test "x$PERL" != "x"; then
98863169be4bSmrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
98873169be4bSmrg   fi
98883169be4bSmrg   have_perl=no
98893169be4bSmrgelse
98903169be4bSmrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
98913169be4bSmrgfi
989267594505Smrg
98933169be4bSmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
98943169be4bSmrg]) # XORG_WITH_PERL
98950597fb56Smrg
98963169be4bSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
98973169be4bSmrg# ----------------
98983169be4bSmrg# Minimum version: 1.5.0
98993169be4bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
9900b242714cSmrg#
99013169be4bSmrg# Documentation tools are not always available on all platforms and sometimes
99023169be4bSmrg# not at the appropriate level. This macro enables a module to test for the
99033169be4bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
99043169be4bSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
99053169be4bSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
99063169be4bSmrg# --with-asciidoc assumes 'auto'.
99073169be4bSmrg#
99083169be4bSmrg# Interface to module:
99093169be4bSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
99103169be4bSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
99113169be4bSmrg#		 returns the path set by the user in the environment
99123169be4bSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
99133169be4bSmrg#		  'no' user instructs the module not to use asciidoc
99143169be4bSmrg#
99153169be4bSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
99163169be4bSmrg#
99173169be4bSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
99183169be4bSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
99193169be4bSmrgm4_define([_defopt], m4_default([$2], [auto]))
99203169be4bSmrgAC_ARG_WITH(asciidoc,
99213169be4bSmrg	AS_HELP_STRING([--with-asciidoc],
99223169be4bSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
99233169be4bSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
99243169be4bSmrgm4_undefine([_defopt])
99250597fb56Smrg
99263169be4bSmrgif test "x$use_asciidoc" = x"auto"; then
99273169be4bSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
99283169be4bSmrg   if test "x$ASCIIDOC" = "x"; then
99293169be4bSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
99303169be4bSmrg	have_asciidoc=no
99313169be4bSmrg   else
99323169be4bSmrg        have_asciidoc=yes
99333169be4bSmrg   fi
99343169be4bSmrgelif test "x$use_asciidoc" = x"yes" ; then
99353169be4bSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
99363169be4bSmrg   if test "x$ASCIIDOC" = "x"; then
99373169be4bSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
99383169be4bSmrg   fi
99393169be4bSmrg   have_asciidoc=yes
99403169be4bSmrgelif test "x$use_asciidoc" = x"no" ; then
99413169be4bSmrg   if test "x$ASCIIDOC" != "x"; then
99423169be4bSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
99433169be4bSmrg   fi
99443169be4bSmrg   have_asciidoc=no
99453169be4bSmrgelse
99463169be4bSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
994767594505Smrgfi
99483169be4bSmrgm4_ifval([$1],
99493169be4bSmrg[if test "$have_asciidoc" = yes; then
99503169be4bSmrg    # scrape the asciidoc version
99513169be4bSmrg    AC_MSG_CHECKING([the asciidoc version])
99523169be4bSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
99533169be4bSmrg    AC_MSG_RESULT([$asciidoc_version])
99543169be4bSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
99553169be4bSmrg        [if test "x$use_asciidoc" = xauto; then
99563169be4bSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
99573169be4bSmrg            have_asciidoc=no
99583169be4bSmrg        else
99593169be4bSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
99603169be4bSmrg        fi])
99613169be4bSmrgfi])
99623169be4bSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
99633169be4bSmrg]) # XORG_WITH_ASCIIDOC
99648bd17e5fSmrg
99653169be4bSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
99663169be4bSmrg# -------------------------------------------
99673169be4bSmrg# Minimum version: 1.5.0
99683169be4bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
99693169be4bSmrg# Minimum version for optional DOT checking: 1.18.0
997067594505Smrg#
99713169be4bSmrg# Documentation tools are not always available on all platforms and sometimes
99723169be4bSmrg# not at the appropriate level. This macro enables a module to test for the
99733169be4bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
99743169be4bSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
99753169be4bSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
99763169be4bSmrg# --with-doxygen assumes 'auto'.
997767594505Smrg#
99783169be4bSmrg# Interface to module:
99793169be4bSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
99803169be4bSmrg# DOXYGEN:	 returns the path of the doxygen program found
99813169be4bSmrg#		 returns the path set by the user in the environment
99823169be4bSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
99833169be4bSmrg#		  'no' user instructs the module not to use doxygen
99843169be4bSmrg#
99853169be4bSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
99863169be4bSmrg#
99873169be4bSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
99883169be4bSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
99893169be4bSmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
99903169be4bSmrgm4_define([_defopt], m4_default([$2], [auto]))
99913169be4bSmrgAC_ARG_WITH(doxygen,
99923169be4bSmrg	AS_HELP_STRING([--with-doxygen],
99933169be4bSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
99943169be4bSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
99953169be4bSmrgm4_undefine([_defopt])
99968c4a8e55Smrg
99973169be4bSmrgif test "x$use_doxygen" = x"auto"; then
99983169be4bSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
99993169be4bSmrg   if test "x$DOXYGEN" = "x"; then
100003169be4bSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
100013169be4bSmrg	have_doxygen=no
100023169be4bSmrg   else
100033169be4bSmrg        have_doxygen=yes
100043169be4bSmrg   fi
100053169be4bSmrgelif test "x$use_doxygen" = x"yes" ; then
100063169be4bSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
100073169be4bSmrg   if test "x$DOXYGEN" = "x"; then
100083169be4bSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
100093169be4bSmrg   fi
100103169be4bSmrg   have_doxygen=yes
100113169be4bSmrgelif test "x$use_doxygen" = x"no" ; then
100123169be4bSmrg   if test "x$DOXYGEN" != "x"; then
100133169be4bSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
100143169be4bSmrg   fi
100153169be4bSmrg   have_doxygen=no
10016b242714cSmrgelse
100173169be4bSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
10018b242714cSmrgfi
100193169be4bSmrgm4_ifval([$1],
100203169be4bSmrg[if test "$have_doxygen" = yes; then
100213169be4bSmrg    # scrape the doxygen version
100223169be4bSmrg    AC_MSG_CHECKING([the doxygen version])
100233169be4bSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
100243169be4bSmrg    AC_MSG_RESULT([$doxygen_version])
100253169be4bSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
100263169be4bSmrg        [if test "x$use_doxygen" = xauto; then
100273169be4bSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
100283169be4bSmrg            have_doxygen=no
100293169be4bSmrg        else
100303169be4bSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
100313169be4bSmrg        fi])
100323169be4bSmrgfi])
100333169be4bSmrg
100343169be4bSmrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
100353169be4bSmrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
100363169be4bSmrgdnl 	HAVE_DOT = @HAVE_DOT@
100373169be4bSmrgHAVE_DOT=no
100383169be4bSmrgif test "x$have_doxygen" = "xyes"; then
100393169be4bSmrg  AC_PATH_PROG([DOT], [dot])
100403169be4bSmrg    if test "x$DOT" != "x"; then
100413169be4bSmrg      HAVE_DOT=yes
100423169be4bSmrg    fi
10043b242714cSmrgfi
10044b242714cSmrg
100453169be4bSmrgAC_SUBST([HAVE_DOT])
100463169be4bSmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
100473169be4bSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
100483169be4bSmrg]) # XORG_WITH_DOXYGEN
10049b242714cSmrg
100503169be4bSmrg# XORG_WITH_GROFF([DEFAULT])
100513169be4bSmrg# ----------------
100523169be4bSmrg# Minimum version: 1.6.0
100533169be4bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1005467594505Smrg#
100553169be4bSmrg# Documentation tools are not always available on all platforms and sometimes
100563169be4bSmrg# not at the appropriate level. This macro enables a module to test for the
100573169be4bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
100583169be4bSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
100593169be4bSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
100603169be4bSmrg# --with-groff assumes 'auto'.
100613169be4bSmrg#
100623169be4bSmrg# Interface to module:
100633169be4bSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
100643169be4bSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
100653169be4bSmrg# HAVE_GROFF_MS: the -ms macros package
100663169be4bSmrg# GROFF:	 returns the path of the groff program found
100673169be4bSmrg#		 returns the path set by the user in the environment
100683169be4bSmrg# --with-groff:	 'yes' user instructs the module to use groff
100693169be4bSmrg#		 'no' user instructs the module not to use groff
100703169be4bSmrg#
100713169be4bSmrg# Added in version 1.9.0:
100723169be4bSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
100733169be4bSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
100743169be4bSmrg#		   psselect from the psutils package.
100753169be4bSmrg#		   the ghostcript package. Refer to the grohtml man pages
100763169be4bSmrg#
100773169be4bSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
100783169be4bSmrg#
100793169be4bSmrg# OS and distros often splits groff in a basic and full package, the former
100803169be4bSmrg# having the groff program and the later having devices, fonts and macros
100813169be4bSmrg# Checking for the groff executable is not enough.
100823169be4bSmrg#
100833169be4bSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
100843169be4bSmrg# unset HAVE_GROFF or GROFF env variables.
100853169be4bSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
100863169be4bSmrg#
100873169be4bSmrgAC_DEFUN([XORG_WITH_GROFF],[
100883169be4bSmrgAC_ARG_VAR([GROFF], [Path to groff command])
100893169be4bSmrgm4_define([_defopt], m4_default([$1], [auto]))
100903169be4bSmrgAC_ARG_WITH(groff,
100913169be4bSmrg	AS_HELP_STRING([--with-groff],
100923169be4bSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
100933169be4bSmrg	   [use_groff=$withval], [use_groff=]_defopt)
100943169be4bSmrgm4_undefine([_defopt])
10095b242714cSmrg
100963169be4bSmrgif test "x$use_groff" = x"auto"; then
100973169be4bSmrg   AC_PATH_PROG([GROFF], [groff])
100983169be4bSmrg   if test "x$GROFF" = "x"; then
100993169be4bSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
101003169be4bSmrg	have_groff=no
101013169be4bSmrg   else
101023169be4bSmrg        have_groff=yes
101033169be4bSmrg   fi
101043169be4bSmrgelif test "x$use_groff" = x"yes" ; then
101053169be4bSmrg   AC_PATH_PROG([GROFF], [groff])
101063169be4bSmrg   if test "x$GROFF" = "x"; then
101073169be4bSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
101083169be4bSmrg   fi
101093169be4bSmrg   have_groff=yes
101103169be4bSmrgelif test "x$use_groff" = x"no" ; then
101113169be4bSmrg   if test "x$GROFF" != "x"; then
101123169be4bSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
101133169be4bSmrg   fi
101143169be4bSmrg   have_groff=no
101153169be4bSmrgelse
101163169be4bSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
10117b242714cSmrgfi
10118b242714cSmrg
101193169be4bSmrg# We have groff, test for the presence of the macro packages
101203169be4bSmrgif test "x$have_groff" = x"yes"; then
101213169be4bSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
101223169be4bSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
101233169be4bSmrg        groff_ms_works=yes
101243169be4bSmrg    else
101253169be4bSmrg        groff_ms_works=no
101263169be4bSmrg    fi
101273169be4bSmrg    AC_MSG_RESULT([$groff_ms_works])
101283169be4bSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
101293169be4bSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
101303169be4bSmrg        groff_mm_works=yes
101313169be4bSmrg    else
101323169be4bSmrg        groff_mm_works=no
101333169be4bSmrg    fi
101343169be4bSmrg    AC_MSG_RESULT([$groff_mm_works])
101353169be4bSmrgfi
10136b242714cSmrg
101373169be4bSmrg# We have groff, test for HTML dependencies, one command per package
101383169be4bSmrgif test "x$have_groff" = x"yes"; then
101393169be4bSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
101403169be4bSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
101413169be4bSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
101423169be4bSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
101433169be4bSmrg      have_groff_html=yes
101443169be4bSmrg   else
101453169be4bSmrg      have_groff_html=no
101463169be4bSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
101473169be4bSmrg   fi
101483169be4bSmrgfi
10149b242714cSmrg
101503169be4bSmrg# Set Automake conditionals for Makefiles
101513169be4bSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
101523169be4bSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
101533169be4bSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
101543169be4bSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
101553169be4bSmrg]) # XORG_WITH_GROFF
10156b242714cSmrg
101573169be4bSmrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
101583169be4bSmrg# ---------------------------------------
101593169be4bSmrg# Minimum version: 1.6.0
101603169be4bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
101613169be4bSmrg# Minimum version for optional MIN-VERSION argument: 1.15.0
1016267594505Smrg#
101633169be4bSmrg# Documentation tools are not always available on all platforms and sometimes
101643169be4bSmrg# not at the appropriate level. This macro enables a module to test for the
101653169be4bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
101663169be4bSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
101673169be4bSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
101683169be4bSmrg# --with-fop assumes 'auto'.
1016967594505Smrg#
101703169be4bSmrg# Interface to module:
101713169be4bSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
101723169be4bSmrg# FOP:	 	returns the path of the fop program found
101733169be4bSmrg#		returns the path set by the user in the environment
101743169be4bSmrg# --with-fop: 	'yes' user instructs the module to use fop
101753169be4bSmrg#		'no' user instructs the module not to use fop
1017667594505Smrg#
101773169be4bSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
1017867594505Smrg#
101793169be4bSmrgAC_DEFUN([XORG_WITH_FOP],[
101803169be4bSmrgAC_ARG_VAR([FOP], [Path to fop command])
101813169be4bSmrgm4_define([_defopt], m4_default([$2], [auto]))
101823169be4bSmrgAC_ARG_WITH(fop,
101833169be4bSmrg	AS_HELP_STRING([--with-fop],
101843169be4bSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
101853169be4bSmrg	   [use_fop=$withval], [use_fop=]_defopt)
101863169be4bSmrgm4_undefine([_defopt])
1018767594505Smrg
101883169be4bSmrgif test "x$use_fop" = x"auto"; then
101893169be4bSmrg   AC_PATH_PROG([FOP], [fop])
101903169be4bSmrg   if test "x$FOP" = "x"; then
101913169be4bSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
101923169be4bSmrg	have_fop=no
101933169be4bSmrg   else
101943169be4bSmrg        have_fop=yes
101953169be4bSmrg   fi
101963169be4bSmrgelif test "x$use_fop" = x"yes" ; then
101973169be4bSmrg   AC_PATH_PROG([FOP], [fop])
101983169be4bSmrg   if test "x$FOP" = "x"; then
101993169be4bSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
102003169be4bSmrg   fi
102013169be4bSmrg   have_fop=yes
102023169be4bSmrgelif test "x$use_fop" = x"no" ; then
102033169be4bSmrg   if test "x$FOP" != "x"; then
102043169be4bSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
102053169be4bSmrg   fi
102063169be4bSmrg   have_fop=no
102073169be4bSmrgelse
102083169be4bSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
102093169be4bSmrgfi
102108bd17e5fSmrg
102113169be4bSmrg# Test for a minimum version of fop, if provided.
102123169be4bSmrgm4_ifval([$1],
102133169be4bSmrg[if test "$have_fop" = yes; then
102143169be4bSmrg    # scrape the fop version
102153169be4bSmrg    AC_MSG_CHECKING([for fop minimum version])
102163169be4bSmrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
102173169be4bSmrg    AC_MSG_RESULT([$fop_version])
102183169be4bSmrg    AS_VERSION_COMPARE([$fop_version], [$1],
102193169be4bSmrg        [if test "x$use_fop" = xauto; then
102203169be4bSmrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
102213169be4bSmrg            have_fop=no
102223169be4bSmrg        else
102233169be4bSmrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
102243169be4bSmrg        fi])
102253169be4bSmrgfi])
102263169be4bSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
102273169be4bSmrg]) # XORG_WITH_FOP
10228b242714cSmrg
102293169be4bSmrg# XORG_WITH_M4([MIN-VERSION])
102303169be4bSmrg# ---------------------------
102313169be4bSmrg# Minimum version: 1.19.0
102323169be4bSmrg#
102333169be4bSmrg# This macro attempts to locate an m4 macro processor which supports
102343169be4bSmrg# -I option and is only useful for modules relying on M4 in order to
102353169be4bSmrg# expand macros in source code files.
102363169be4bSmrg#
102373169be4bSmrg# Interface to module:
102383169be4bSmrg# M4:	 	returns the path of the m4 program found
102393169be4bSmrg#		returns the path set by the user in the environment
102403169be4bSmrg#
102413169be4bSmrgAC_DEFUN([XORG_WITH_M4], [
102423169be4bSmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
102433169be4bSmrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
102443169be4bSmrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
102453169be4bSmrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
102463169be4bSmrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
102473169be4bSmrg   [$PATH:/usr/gnu/bin])])
10248b242714cSmrg
102493169be4bSmrgAC_SUBST([M4], [$ac_cv_path_M4])
102503169be4bSmrg]) # XORG_WITH_M4
10251b242714cSmrg
102523169be4bSmrg# XORG_WITH_PS2PDF([DEFAULT])
102533169be4bSmrg# ----------------
102543169be4bSmrg# Minimum version: 1.6.0
102553169be4bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1025667594505Smrg#
102573169be4bSmrg# Documentation tools are not always available on all platforms and sometimes
102583169be4bSmrg# not at the appropriate level. This macro enables a module to test for the
102593169be4bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
102603169be4bSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
102613169be4bSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
102623169be4bSmrg# --with-ps2pdf assumes 'auto'.
1026367594505Smrg#
102643169be4bSmrg# Interface to module:
102653169be4bSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
102663169be4bSmrg# PS2PDF:	returns the path of the ps2pdf program found
102673169be4bSmrg#		returns the path set by the user in the environment
102683169be4bSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
102693169be4bSmrg#		 'no' user instructs the module not to use ps2pdf
1027067594505Smrg#
102713169be4bSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
1027267594505Smrg#
102733169be4bSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
102743169be4bSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
102753169be4bSmrgm4_define([_defopt], m4_default([$1], [auto]))
102763169be4bSmrgAC_ARG_WITH(ps2pdf,
102773169be4bSmrg	AS_HELP_STRING([--with-ps2pdf],
102783169be4bSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
102793169be4bSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
102803169be4bSmrgm4_undefine([_defopt])
10281b242714cSmrg
102823169be4bSmrgif test "x$use_ps2pdf" = x"auto"; then
102833169be4bSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
102843169be4bSmrg   if test "x$PS2PDF" = "x"; then
102853169be4bSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
102863169be4bSmrg	have_ps2pdf=no
102873169be4bSmrg   else
102883169be4bSmrg        have_ps2pdf=yes
102893169be4bSmrg   fi
102903169be4bSmrgelif test "x$use_ps2pdf" = x"yes" ; then
102913169be4bSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
102923169be4bSmrg   if test "x$PS2PDF" = "x"; then
102933169be4bSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
102943169be4bSmrg   fi
102953169be4bSmrg   have_ps2pdf=yes
102963169be4bSmrgelif test "x$use_ps2pdf" = x"no" ; then
102973169be4bSmrg   if test "x$PS2PDF" != "x"; then
102983169be4bSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
102993169be4bSmrg   fi
103003169be4bSmrg   have_ps2pdf=no
103010597fb56Smrgelse
103023169be4bSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
103030597fb56Smrgfi
103043169be4bSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
103053169be4bSmrg]) # XORG_WITH_PS2PDF
103068c4a8e55Smrg
103073169be4bSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
103083169be4bSmrg# ----------------
103093169be4bSmrg# Minimum version: 1.6.0
103103169be4bSmrg#
103113169be4bSmrg# Documentation tools are not always available on all platforms and sometimes
103123169be4bSmrg# not at the appropriate level. This macro enables a builder to skip all
103133169be4bSmrg# documentation targets except traditional man pages.
103143169be4bSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
103153169be4bSmrg# maximum flexibilty in controlling documentation building.
103163169be4bSmrg# Refer to:
103173169be4bSmrg# XORG_WITH_XMLTO         --with-xmlto
103183169be4bSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
103193169be4bSmrg# XORG_WITH_DOXYGEN       --with-doxygen
103203169be4bSmrg# XORG_WITH_FOP           --with-fop
103213169be4bSmrg# XORG_WITH_GROFF         --with-groff
103223169be4bSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
103233169be4bSmrg#
103243169be4bSmrg# Interface to module:
103253169be4bSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
103263169be4bSmrg# --enable-docs: 'yes' user instructs the module to generate docs
103273169be4bSmrg#		 'no' user instructs the module not to generate docs
103283169be4bSmrg# parm1:	specify the default value, yes or no.
103293169be4bSmrg#
103303169be4bSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
103313169be4bSmrgm4_define([docs_default], m4_default([$1], [yes]))
103323169be4bSmrgAC_ARG_ENABLE(docs,
103333169be4bSmrg	AS_HELP_STRING([--enable-docs],
103343169be4bSmrg	   [Enable building the documentation (default: ]docs_default[)]),
103353169be4bSmrg	   [build_docs=$enableval], [build_docs=]docs_default)
103363169be4bSmrgm4_undefine([docs_default])
103373169be4bSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
103383169be4bSmrgAC_MSG_CHECKING([whether to build documentation])
103393169be4bSmrgAC_MSG_RESULT([$build_docs])
103403169be4bSmrg]) # XORG_ENABLE_DOCS
10341b242714cSmrg
103423169be4bSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
103433169be4bSmrg# ----------------
103443169be4bSmrg# Minimum version: 1.6.0
103458bd17e5fSmrg#
103463169be4bSmrg# This macro enables a builder to skip all developer documentation.
103473169be4bSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
103483169be4bSmrg# maximum flexibilty in controlling documentation building.
103493169be4bSmrg# Refer to:
103503169be4bSmrg# XORG_WITH_XMLTO         --with-xmlto
103513169be4bSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
103523169be4bSmrg# XORG_WITH_DOXYGEN       --with-doxygen
103533169be4bSmrg# XORG_WITH_FOP           --with-fop
103543169be4bSmrg# XORG_WITH_GROFF         --with-groff
103553169be4bSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
103563169be4bSmrg#
103573169be4bSmrg# Interface to module:
103583169be4bSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
103593169be4bSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
103603169be4bSmrg#			'no' user instructs the module not to generate developer docs
103613169be4bSmrg# parm1:		specify the default value, yes or no.
103623169be4bSmrg#
103633169be4bSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
103643169be4bSmrgm4_define([devel_default], m4_default([$1], [yes]))
103653169be4bSmrgAC_ARG_ENABLE(devel-docs,
103663169be4bSmrg	AS_HELP_STRING([--enable-devel-docs],
103673169be4bSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
103683169be4bSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
103693169be4bSmrgm4_undefine([devel_default])
103703169be4bSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
103713169be4bSmrgAC_MSG_CHECKING([whether to build developer documentation])
103723169be4bSmrgAC_MSG_RESULT([$build_devel_docs])
103733169be4bSmrg]) # XORG_ENABLE_DEVEL_DOCS
103748c4a8e55Smrg
103753169be4bSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
103763169be4bSmrg# ----------------
103773169be4bSmrg# Minimum version: 1.6.0
103783169be4bSmrg#
103793169be4bSmrg# This macro enables a builder to skip all functional specification targets.
103803169be4bSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
103813169be4bSmrg# maximum flexibilty in controlling documentation building.
103823169be4bSmrg# Refer to:
103833169be4bSmrg# XORG_WITH_XMLTO         --with-xmlto
103843169be4bSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
103853169be4bSmrg# XORG_WITH_DOXYGEN       --with-doxygen
103863169be4bSmrg# XORG_WITH_FOP           --with-fop
103873169be4bSmrg# XORG_WITH_GROFF         --with-groff
103883169be4bSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
103893169be4bSmrg#
103903169be4bSmrg# Interface to module:
103913169be4bSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
103923169be4bSmrg# --enable-specs:	'yes' user instructs the module to generate specs
103933169be4bSmrg#			'no' user instructs the module not to generate specs
103943169be4bSmrg# parm1:		specify the default value, yes or no.
103953169be4bSmrg#
103963169be4bSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
103973169be4bSmrgm4_define([spec_default], m4_default([$1], [yes]))
103983169be4bSmrgAC_ARG_ENABLE(specs,
103993169be4bSmrg	AS_HELP_STRING([--enable-specs],
104003169be4bSmrg	   [Enable building the specs (default: ]spec_default[)]),
104013169be4bSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
104023169be4bSmrgm4_undefine([spec_default])
104033169be4bSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
104043169be4bSmrgAC_MSG_CHECKING([whether to build functional specifications])
104053169be4bSmrgAC_MSG_RESULT([$build_specs])
104063169be4bSmrg]) # XORG_ENABLE_SPECS
1040767594505Smrg
104083169be4bSmrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
104093169be4bSmrg# ----------------------------------------------
104103169be4bSmrg# Minimum version: 1.13.0
104113169be4bSmrg#
104123169be4bSmrg# This macro enables a builder to enable/disable unit testing
104133169be4bSmrg# It makes no assumption about the test cases implementation
104143169be4bSmrg# Test cases may or may not use Automake "Support for test suites"
104153169be4bSmrg# They may or may not use the software utility library GLib
104163169be4bSmrg#
104173169be4bSmrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
104183169be4bSmrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
104193169be4bSmrg# The variable enable_unit_tests is used by other macros in this file.
104203169be4bSmrg#
104213169be4bSmrg# Interface to module:
104223169be4bSmrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
104233169be4bSmrg# enable_unit_tests:    used in configure.ac for additional configuration
104243169be4bSmrg# --enable-unit-tests:	'yes' user instructs the module to build tests
104253169be4bSmrg#			'no' user instructs the module not to build tests
104263169be4bSmrg# parm1:		specify the default value, yes or no.
104273169be4bSmrg#
104283169be4bSmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
104293169be4bSmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
104303169be4bSmrgAC_BEFORE([$0], [XORG_LD_WRAP])
104313169be4bSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
104323169be4bSmrgm4_define([_defopt], m4_default([$1], [auto]))
104333169be4bSmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
104343169be4bSmrg	[Enable building unit test cases (default: ]_defopt[)]),
104353169be4bSmrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
104363169be4bSmrgm4_undefine([_defopt])
104373169be4bSmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
104383169be4bSmrgAC_MSG_CHECKING([whether to build unit test cases])
104393169be4bSmrgAC_MSG_RESULT([$enable_unit_tests])
104403169be4bSmrg]) # XORG_ENABLE_UNIT_TESTS
104413169be4bSmrg
104423169be4bSmrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
104433169be4bSmrg# ------------------------------------------------------
104443169be4bSmrg# Minimum version: 1.17.0
104453169be4bSmrg#
104463169be4bSmrg# This macro enables a builder to enable/disable integration testing
104473169be4bSmrg# It makes no assumption about the test cases' implementation
104483169be4bSmrg# Test cases may or may not use Automake "Support for test suites"
104493169be4bSmrg#
104503169be4bSmrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
104513169be4bSmrg# usually requires less dependencies and may be built and run under less
104523169be4bSmrg# stringent environments than integration tests.
104533169be4bSmrg#
104543169be4bSmrg# Interface to module:
104553169be4bSmrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
104563169be4bSmrg# enable_integration_tests:   used in configure.ac for additional configuration
104573169be4bSmrg# --enable-integration-tests: 'yes' user instructs the module to build tests
104583169be4bSmrg#                             'no' user instructs the module not to build tests
104593169be4bSmrg# parm1:                      specify the default value, yes or no.
104603169be4bSmrg#
104613169be4bSmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
104623169be4bSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
104633169be4bSmrgm4_define([_defopt], m4_default([$1], [auto]))
104643169be4bSmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
104653169be4bSmrg	[Enable building integration test cases (default: ]_defopt[)]),
104663169be4bSmrg	[enable_integration_tests=$enableval],
104673169be4bSmrg	[enable_integration_tests=]_defopt)
104683169be4bSmrgm4_undefine([_defopt])
104693169be4bSmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
104703169be4bSmrg	[test "x$enable_integration_tests" != xno])
104713169be4bSmrgAC_MSG_CHECKING([whether to build unit test cases])
104723169be4bSmrgAC_MSG_RESULT([$enable_integration_tests])
104733169be4bSmrg]) # XORG_ENABLE_INTEGRATION_TESTS
104743169be4bSmrg
104753169be4bSmrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
104763169be4bSmrg# ----------------------------------------
104773169be4bSmrg# Minimum version: 1.13.0
104783169be4bSmrg#
104793169be4bSmrg# GLib is a library which provides advanced data structures and functions.
104803169be4bSmrg# This macro enables a module to test for the presence of Glib.
104813169be4bSmrg#
104823169be4bSmrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
104833169be4bSmrg# Otherwise the value of $enable_unit_tests is blank.
104843169be4bSmrg#
104853169be4bSmrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
104863169be4bSmrg# test support usually requires less dependencies and may be built and run under
104873169be4bSmrg# less stringent environments than integration tests.
104883169be4bSmrg#
104893169be4bSmrg# Interface to module:
104903169be4bSmrg# HAVE_GLIB: used in makefiles to conditionally build targets
104913169be4bSmrg# with_glib: used in configure.ac to know if GLib has been found
104923169be4bSmrg# --with-glib:	'yes' user instructs the module to use glib
104933169be4bSmrg#		'no' user instructs the module not to use glib
104943169be4bSmrg#
104953169be4bSmrgAC_DEFUN([XORG_WITH_GLIB],[
104963169be4bSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
104973169be4bSmrgm4_define([_defopt], m4_default([$2], [auto]))
104983169be4bSmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
104993169be4bSmrg	[Use GLib library for unit testing (default: ]_defopt[)]),
105003169be4bSmrg	[with_glib=$withval], [with_glib=]_defopt)
105013169be4bSmrgm4_undefine([_defopt])
105023169be4bSmrg
105033169be4bSmrghave_glib=no
105043169be4bSmrg# Do not probe GLib if user explicitly disabled unit testing
105053169be4bSmrgif test "x$enable_unit_tests" != x"no"; then
105063169be4bSmrg  # Do not probe GLib if user explicitly disabled it
105073169be4bSmrg  if test "x$with_glib" != x"no"; then
105083169be4bSmrg    m4_ifval(
105093169be4bSmrg      [$1],
105103169be4bSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
105113169be4bSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
105123169be4bSmrg    )
105133169be4bSmrg  fi
10514b242714cSmrgfi
105153169be4bSmrg
105163169be4bSmrg# Not having GLib when unit testing has been explicitly requested is an error
105173169be4bSmrgif test "x$enable_unit_tests" = x"yes"; then
105183169be4bSmrg  if test "x$have_glib" = x"no"; then
105193169be4bSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
105203169be4bSmrg  fi
10521b242714cSmrgfi
1052267594505Smrg
105233169be4bSmrg# Having unit testing disabled when GLib has been explicitly requested is an error
105243169be4bSmrgif test "x$enable_unit_tests" = x"no"; then
105253169be4bSmrg  if test "x$with_glib" = x"yes"; then
105263169be4bSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
105273169be4bSmrg  fi
10528b242714cSmrgfi
105293169be4bSmrg
105303169be4bSmrg# Not having GLib when it has been explicitly requested is an error
105313169be4bSmrgif test "x$with_glib" = x"yes"; then
105323169be4bSmrg  if test "x$have_glib" = x"no"; then
105333169be4bSmrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
105343169be4bSmrg  fi
1053567594505Smrgfi
1053667594505Smrg
105373169be4bSmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
105383169be4bSmrg]) # XORG_WITH_GLIB
1053967594505Smrg
105403169be4bSmrg# XORG_LD_WRAP([required|optional])
105413169be4bSmrg# ---------------------------------
105423169be4bSmrg# Minimum version: 1.13.0
105433169be4bSmrg#
105443169be4bSmrg# Check if linker supports -wrap, passed via compiler flags
105453169be4bSmrg#
105463169be4bSmrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
105473169be4bSmrg# Otherwise the value of $enable_unit_tests is blank.
105483169be4bSmrg#
105493169be4bSmrg# Argument added in 1.16.0 - default is "required", to match existing behavior
105503169be4bSmrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
105513169be4bSmrg# available, an argument of "optional" allows use when some unit tests require
105523169be4bSmrg# ld -wrap and others do not.
105533169be4bSmrg#
105543169be4bSmrgAC_DEFUN([XORG_LD_WRAP],[
105553169be4bSmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
105563169be4bSmrg    [AC_LANG_PROGRAM([#include <stdlib.h>
105573169be4bSmrg                      void __wrap_exit(int status) { return; }],
105583169be4bSmrg                     [exit(0);])])
105593169be4bSmrg# Not having ld wrap when unit testing has been explicitly requested is an error
105603169be4bSmrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
105613169be4bSmrg  if test "x$have_ld_wrap" = x"no"; then
105623169be4bSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
105633169be4bSmrg  fi
105648bd17e5fSmrgfi
105653169be4bSmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
105668bd17e5fSmrg#
105673169be4bSmrg]) # XORG_LD_WRAP
10568b242714cSmrg
105693169be4bSmrg# XORG_CHECK_LINKER_FLAGS
105703169be4bSmrg# -----------------------
105713169be4bSmrg# SYNOPSIS
105723169be4bSmrg#
105733169be4bSmrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
105743169be4bSmrg#
105753169be4bSmrg# DESCRIPTION
105763169be4bSmrg#
105773169be4bSmrg#   Check whether the given linker FLAGS work with the current language's
105783169be4bSmrg#   linker, or whether they give an error.
105793169be4bSmrg#
105803169be4bSmrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
105813169be4bSmrg#   success/failure.
105823169be4bSmrg#
105833169be4bSmrg#   PROGRAM-SOURCE is the program source to link with, if needed
105843169be4bSmrg#
105853169be4bSmrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
105863169be4bSmrg#
105873169be4bSmrg# LICENSE
105883169be4bSmrg#
105893169be4bSmrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
105903169be4bSmrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
105913169be4bSmrg#   Copyright (c) 2009 Matteo Frigo
105923169be4bSmrg#
105933169be4bSmrg#   This program is free software: you can redistribute it and/or modify it
105943169be4bSmrg#   under the terms of the GNU General Public License as published by the
105953169be4bSmrg#   Free Software Foundation, either version 3 of the License, or (at your
105963169be4bSmrg#   option) any later version.
105973169be4bSmrg#
105983169be4bSmrg#   This program is distributed in the hope that it will be useful, but
105993169be4bSmrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
106003169be4bSmrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
106013169be4bSmrg#   Public License for more details.
106023169be4bSmrg#
106033169be4bSmrg#   You should have received a copy of the GNU General Public License along
106043169be4bSmrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
106053169be4bSmrg#
106063169be4bSmrg#   As a special exception, the respective Autoconf Macro's copyright owner
106073169be4bSmrg#   gives unlimited permission to copy, distribute and modify the configure
106083169be4bSmrg#   scripts that are the output of Autoconf when processing the Macro. You
106093169be4bSmrg#   need not follow the terms of the GNU General Public License when using
106103169be4bSmrg#   or distributing such scripts, even though portions of the text of the
106113169be4bSmrg#   Macro appear in them. The GNU General Public License (GPL) does govern
106123169be4bSmrg#   all other use of the material that constitutes the Autoconf Macro.
106133169be4bSmrg#
106143169be4bSmrg#   This special exception to the GPL applies to versions of the Autoconf
106153169be4bSmrg#   Macro released by the Autoconf Archive. When you make and distribute a
106163169be4bSmrg#   modified version of the Autoconf Macro, you may extend this special
106173169be4bSmrg#   exception to the GPL to apply to your modified version as well.#
106183169be4bSmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
106193169be4bSmrg[AC_MSG_CHECKING([whether the linker accepts $1])
106203169be4bSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
106213169be4bSmrgAS_LITERAL_IF([$1],
106223169be4bSmrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
106233169be4bSmrg      ax_save_FLAGS=$LDFLAGS
106243169be4bSmrg      LDFLAGS="$1"
106253169be4bSmrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
106263169be4bSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
106273169be4bSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
106283169be4bSmrg      LDFLAGS=$ax_save_FLAGS])],
106293169be4bSmrg  [ax_save_FLAGS=$LDFLAGS
106303169be4bSmrg   LDFLAGS="$1"
106313169be4bSmrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
106323169be4bSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
106333169be4bSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
106343169be4bSmrg   LDFLAGS=$ax_save_FLAGS])
106353169be4bSmrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
106363169be4bSmrgAC_MSG_RESULT($xorg_check_linker_flags)
106373169be4bSmrgif test "x$xorg_check_linker_flags" = xyes; then
106383169be4bSmrg	m4_default([$2], :)
10639b242714cSmrgelse
106403169be4bSmrg	m4_default([$3], :)
10641b242714cSmrgfi
106423169be4bSmrg]) # XORG_CHECK_LINKER_FLAGS
10643b242714cSmrg
106443169be4bSmrg# XORG_MEMORY_CHECK_FLAGS
106453169be4bSmrg# -----------------------
106463169be4bSmrg# Minimum version: 1.16.0
106478bd17e5fSmrg#
106483169be4bSmrg# This macro attempts to find appropriate memory checking functionality
106493169be4bSmrg# for various platforms which unit testing code may use to catch various
106503169be4bSmrg# forms of memory allocation and access errors in testing.
106513169be4bSmrg#
106523169be4bSmrg# Interface to module:
106533169be4bSmrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
106543169be4bSmrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
106553169be4bSmrg#
106563169be4bSmrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
106573169be4bSmrg#
106583169be4bSmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
106598bd17e5fSmrg
106603169be4bSmrgAC_REQUIRE([AC_CANONICAL_HOST])
106613169be4bSmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
106623169be4bSmrg           [Environment variables to enable memory checking in tests])
1066367594505Smrg
106643169be4bSmrg# Check for different types of support on different platforms
106653169be4bSmrgcase $host_os in
106663169be4bSmrg    solaris*)
106673169be4bSmrg        AC_CHECK_LIB([umem], [umem_alloc],
106683169be4bSmrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
106693169be4bSmrg        ;;
106703169be4bSmrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
106713169be4bSmrg        # both directly and inverted, so should not be 0 or 255.
106723169be4bSmrg        malloc_debug_env='MALLOC_PERTURB_=15'
106733169be4bSmrg        ;;
106743169be4bSmrg    darwin*)
106753169be4bSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
106763169be4bSmrg        ;;
106773169be4bSmrg    *bsd*)
106783169be4bSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
106793169be4bSmrg        ;;
106803169be4bSmrgesac
1068167594505Smrg
106823169be4bSmrg# User supplied flags override default flags
106833169be4bSmrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
106843169be4bSmrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
106850597fb56Smrgfi
106868c4a8e55Smrg
106873169be4bSmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
106883169be4bSmrg]) # XORG_WITH_LINT
1068967594505Smrg
106903169be4bSmrg# XORG_CHECK_MALLOC_ZERO
106913169be4bSmrg# ----------------------
10692b242714cSmrg# Minimum version: 1.0.0
106938bd17e5fSmrg#
106943169be4bSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
106953169be4bSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
106963169be4bSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
106973169be4bSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
106983169be4bSmrgAC_ARG_ENABLE(malloc0returnsnull,
106993169be4bSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
107003169be4bSmrg		       [malloc(0) returns NULL (default: auto)]),
107013169be4bSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
107023169be4bSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1070367594505Smrg
107043169be4bSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
107053169be4bSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
107063169be4bSmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
107073169be4bSmrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
107083169be4bSmrg#include <stdlib.h>
107093169be4bSmrg],[
107103169be4bSmrg    char *m0, *r0, *c0, *p;
107113169be4bSmrg    m0 = malloc(0);
107123169be4bSmrg    p = malloc(10);
107133169be4bSmrg    r0 = realloc(p,0);
107143169be4bSmrg    c0 = calloc(0,10);
107153169be4bSmrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
107163169be4bSmrg])],
107173169be4bSmrg		[xorg_cv_malloc0_returns_null=yes],
107183169be4bSmrg		[xorg_cv_malloc0_returns_null=no])])
107193169be4bSmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
10720b242714cSmrgfi
107213169be4bSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1072267594505Smrg
107233169be4bSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
107243169be4bSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
107253169be4bSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
107263169be4bSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
107273169be4bSmrgelse
107283169be4bSmrg	MALLOC_ZERO_CFLAGS=""
107293169be4bSmrg	XMALLOC_ZERO_CFLAGS=""
107303169be4bSmrg	XTMALLOC_ZERO_CFLAGS=""
10731b242714cSmrgfi
1073267594505Smrg
107333169be4bSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
107343169be4bSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
107353169be4bSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
107363169be4bSmrg]) # XORG_CHECK_MALLOC_ZERO
107378bd17e5fSmrg
107383169be4bSmrg# XORG_WITH_LINT()
10739b242714cSmrg# ----------------
107403169be4bSmrg# Minimum version: 1.1.0
107418bd17e5fSmrg#
107423169be4bSmrg# This macro enables the use of a tool that flags some suspicious and
107433169be4bSmrg# non-portable constructs (likely to be bugs) in C language source code.
107443169be4bSmrg# It will attempt to locate the tool and use appropriate options.
107453169be4bSmrg# There are various lint type tools on different platforms.
107468bd17e5fSmrg#
10747b242714cSmrg# Interface to module:
107483169be4bSmrg# LINT:		returns the path to the tool found on the platform
107493169be4bSmrg#		or the value set to LINT on the configure cmd line
107503169be4bSmrg#		also an Automake conditional
107513169be4bSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
107528bd17e5fSmrg#
107533169be4bSmrg# --with-lint:	'yes' user instructs the module to use lint
107543169be4bSmrg#		'no' user instructs the module not to use lint (default)
10755b242714cSmrg#
107563169be4bSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
107573169be4bSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
10758b242714cSmrg#
107593169be4bSmrgAC_DEFUN([XORG_WITH_LINT],[
1076067594505Smrg
107613169be4bSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
107623169be4bSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
107633169be4bSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
107643169be4bSmrg		[Use a lint-style source code checker (default: disabled)])],
107653169be4bSmrg		[use_lint=$withval], [use_lint=no])
107663169be4bSmrg
107673169be4bSmrg# Obtain platform specific info like program name and options
107683169be4bSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
107693169be4bSmrgcase $host_os in
107703169be4bSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
107713169be4bSmrg	lint_name=splint
107723169be4bSmrg	lint_options="-badflag"
107733169be4bSmrg	;;
107743169be4bSmrg  *freebsd* | *netbsd*)
107753169be4bSmrg	lint_name=lint
107763169be4bSmrg	lint_options="-u -b"
107773169be4bSmrg	;;
107783169be4bSmrg  *solaris*)
107793169be4bSmrg	lint_name=lint
107803169be4bSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
107813169be4bSmrg	;;
107823169be4bSmrgesac
107833169be4bSmrg
107843169be4bSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
107853169be4bSmrgif test "x$use_lint" = x"yes" ; then
107863169be4bSmrg   AC_PATH_PROG([LINT], [$lint_name])
107873169be4bSmrg   if test "x$LINT" = "x"; then
107883169be4bSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
10789b242714cSmrg   fi
107903169be4bSmrgelif test "x$use_lint" = x"no" ; then
107913169be4bSmrg   if test "x$LINT" != "x"; then
107923169be4bSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
10793b242714cSmrg   fi
107948bd17e5fSmrgelse
107953169be4bSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
107968bd17e5fSmrgfi
107978c4a8e55Smrg
107983169be4bSmrg# User supplied flags override default flags
107993169be4bSmrgif test "x$LINT_FLAGS" != "x"; then
108003169be4bSmrg   lint_options=$LINT_FLAGS
108013169be4bSmrgfi
108028c4a8e55Smrg
108033169be4bSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
108043169be4bSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
108053169be4bSmrg
108063169be4bSmrg]) # XORG_WITH_LINT
108073169be4bSmrg
108083169be4bSmrg# XORG_LINT_LIBRARY(LIBNAME)
108093169be4bSmrg# --------------------------
108103169be4bSmrg# Minimum version: 1.1.0
10811b242714cSmrg#
108123169be4bSmrg# Sets up flags for building lint libraries for checking programs that call
108133169be4bSmrg# functions in the library.
10814b242714cSmrg#
10815b242714cSmrg# Interface to module:
108163169be4bSmrg# LINTLIB		- Automake variable with the name of lint library file to make
108173169be4bSmrg# MAKE_LINT_LIB		- Automake conditional
10818b242714cSmrg#
108193169be4bSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
108203169be4bSmrg#			  - 'no' user instructs the module not to create a lint library (default)
1082167594505Smrg
108223169be4bSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
108233169be4bSmrgAC_REQUIRE([XORG_WITH_LINT])
108243169be4bSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
108253169be4bSmrg	[Create lint library (default: disabled)])],
108263169be4bSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
108273169be4bSmrg
108283169be4bSmrgif test "x$make_lint_lib" = x"yes" ; then
108293169be4bSmrg   LINTLIB=llib-l$1.ln
108303169be4bSmrg   if test "x$LINT" = "x"; then
108313169be4bSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
10832b242714cSmrg   fi
108333169be4bSmrgelif test "x$make_lint_lib" != x"no" ; then
108343169be4bSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
1083567594505Smrgfi
108360597fb56Smrg
108373169be4bSmrgAC_SUBST(LINTLIB)
108383169be4bSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
108390597fb56Smrg
108403169be4bSmrg]) # XORG_LINT_LIBRARY
108413169be4bSmrg
108423169be4bSmrg# XORG_COMPILER_BRAND
108433169be4bSmrg# -------------------
108443169be4bSmrg# Minimum version: 1.14.0
108458bd17e5fSmrg#
108463169be4bSmrg# Checks for various brands of compilers and sets flags as appropriate:
108473169be4bSmrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
108483169be4bSmrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
108493169be4bSmrg#   clang compiler - sets CLANGCC to "yes"
108503169be4bSmrg#   Intel compiler - sets INTELCC to "yes"
108513169be4bSmrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
108528bd17e5fSmrg#
108533169be4bSmrgAC_DEFUN([XORG_COMPILER_BRAND], [
108543169be4bSmrgAC_LANG_CASE(
108553169be4bSmrg	[C], [
108563169be4bSmrg		AC_REQUIRE([AC_PROG_CC_C99])
108573169be4bSmrg	],
108583169be4bSmrg	[C++], [
108593169be4bSmrg		AC_REQUIRE([AC_PROG_CXX])
108603169be4bSmrg	]
108613169be4bSmrg)
108623169be4bSmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
108633169be4bSmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
108643169be4bSmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
108653169be4bSmrg]) # XORG_COMPILER_BRAND
108663169be4bSmrg
108673169be4bSmrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
108683169be4bSmrg# ---------------
108693169be4bSmrg# Minimum version: 1.16.0
108708bd17e5fSmrg#
108713169be4bSmrg# Test if the compiler works when passed the given flag as a command line argument.
108723169be4bSmrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
108733169be4bSmrg# next flag in the list until there are no more options.
108748bd17e5fSmrg#
108753169be4bSmrg# Note that this does not guarantee that the compiler supports the flag as some
108763169be4bSmrg# compilers will simply ignore arguments that they do not understand, but we do
108773169be4bSmrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
108783169be4bSmrg# -Werror=unused-command-line-argument
108798bd17e5fSmrg#
108803169be4bSmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
108813169be4bSmrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
108823169be4bSmrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
108838c4a8e55Smrg
108843169be4bSmrgAC_LANG_COMPILER_REQUIRE
108858c4a8e55Smrg
108863169be4bSmrgAC_LANG_CASE(
108873169be4bSmrg	[C], [
108883169be4bSmrg		AC_REQUIRE([AC_PROG_CC_C99])
108893169be4bSmrg		define([PREFIX], [C])
108903169be4bSmrg		define([CACHE_PREFIX], [cc])
108913169be4bSmrg		define([COMPILER], [$CC])
108923169be4bSmrg	],
108933169be4bSmrg	[C++], [
108943169be4bSmrg		define([PREFIX], [CXX])
108953169be4bSmrg		define([CACHE_PREFIX], [cxx])
108963169be4bSmrg		define([COMPILER], [$CXX])
108973169be4bSmrg	]
108983169be4bSmrg)
1089967594505Smrg
109003169be4bSmrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
1090167594505Smrg
109023169be4bSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
109033169be4bSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
109043169be4bSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
109053169be4bSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
109063169be4bSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
109073169be4bSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
109083169be4bSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
109093169be4bSmrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
109103169be4bSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10911b242714cSmrgfi
109128c4a8e55Smrg
109133169be4bSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
109143169be4bSmrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
109153169be4bSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
109163169be4bSmrg	fi
109173169be4bSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
109183169be4bSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
109193169be4bSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
109203169be4bSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
109213169be4bSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
109223169be4bSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
109233169be4bSmrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
109243169be4bSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
109253169be4bSmrgfi
109263169be4bSmrg
109273169be4bSmrgfound="no"
109283169be4bSmrgm4_foreach([flag], m4_cdr($@), [
109293169be4bSmrg	if test $found = "no" ; then
109303169be4bSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
109313169be4bSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
109323169be4bSmrg		fi
109333169be4bSmrg
109343169be4bSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
109353169be4bSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
109363169be4bSmrg		fi
109373169be4bSmrg
109383169be4bSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
109393169be4bSmrg
109403169be4bSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
109413169be4bSmrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
109423169be4bSmrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
109433169be4bSmrg		AC_CACHE_VAL($cacheid,
109443169be4bSmrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
109453169be4bSmrg					     [eval $cacheid=yes],
109463169be4bSmrg					     [eval $cacheid=no])])
109473169be4bSmrg
109483169be4bSmrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
109493169be4bSmrg
109503169be4bSmrg		eval supported=\$$cacheid
109513169be4bSmrg		AC_MSG_RESULT([$supported])
109523169be4bSmrg		if test "$supported" = "yes" ; then
109533169be4bSmrg			$1="$$1 ]flag["
109543169be4bSmrg			found="yes"
109553169be4bSmrg		fi
109563169be4bSmrg	fi
109573169be4bSmrg])
109583169be4bSmrg]) # XORG_TESTSET_CFLAG
109593169be4bSmrg
109603169be4bSmrg# XORG_COMPILER_FLAGS
109613169be4bSmrg# ---------------
109623169be4bSmrg# Minimum version: 1.16.0
109638bd17e5fSmrg#
109643169be4bSmrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
109653169be4bSmrg# arguments supported by the selected compiler which do NOT alter the generated
109663169be4bSmrg# code.  These arguments will cause the compiler to print various warnings
109673169be4bSmrg# during compilation AND turn a conservative set of warnings into errors.
109688bd17e5fSmrg#
109693169be4bSmrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
109703169be4bSmrg# future versions of util-macros as options are added to new compilers.
109718bd17e5fSmrg#
109723169be4bSmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
109733169be4bSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
1097467594505Smrg
109753169be4bSmrgAC_ARG_ENABLE(selective-werror,
109763169be4bSmrg              AS_HELP_STRING([--disable-selective-werror],
109773169be4bSmrg                             [Turn off selective compiler errors. (default: enabled)]),
109783169be4bSmrg              [SELECTIVE_WERROR=$enableval],
109793169be4bSmrg              [SELECTIVE_WERROR=yes])
109803169be4bSmrg
109813169be4bSmrgAC_LANG_CASE(
109823169be4bSmrg        [C], [
109833169be4bSmrg                define([PREFIX], [C])
109843169be4bSmrg        ],
109853169be4bSmrg        [C++], [
109863169be4bSmrg                define([PREFIX], [CXX])
109873169be4bSmrg        ]
109883169be4bSmrg)
109893169be4bSmrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
109903169be4bSmrgif test "x$SUNCC" = "xyes"; then
109913169be4bSmrg    [BASE_]PREFIX[FLAGS]="-v"
10992b242714cSmrgelse
109933169be4bSmrg    [BASE_]PREFIX[FLAGS]=""
10994b242714cSmrgfi
1099567594505Smrg
109963169be4bSmrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
109973169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
109983169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
109993169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
110003169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
110013169be4bSmrg
110023169be4bSmrgAC_LANG_CASE(
110033169be4bSmrg	[C], [
110043169be4bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
110053169be4bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
110063169be4bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
110073169be4bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
110083169be4bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
110093169be4bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
110103169be4bSmrg	]
110113169be4bSmrg)
110123169be4bSmrg
110133169be4bSmrg# This chunk adds additional warnings that could catch undesired effects.
110143169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
110153169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
110163169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
110173169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
110183169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
110193169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
110203169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
110213169be4bSmrg
110223169be4bSmrg# These are currently disabled because they are noisy.  They will be enabled
110233169be4bSmrg# in the future once the codebase is sufficiently modernized to silence
110243169be4bSmrg# them.  For now, I don't want them to drown out the other warnings.
110253169be4bSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
110263169be4bSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
110273169be4bSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
110283169be4bSmrg
110293169be4bSmrg# Turn some warnings into errors, so we don't accidently get successful builds
110303169be4bSmrg# when there are problems that should be fixed.
110313169be4bSmrg
110323169be4bSmrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
110333169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
110343169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
110353169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
110363169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
110373169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
110383169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
110393169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
110403169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
110413169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
110423169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
110433169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
110443169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
110453169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
110463169be4bSmrgelse
110473169be4bSmrgAC_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])
110483169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
110493169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
110503169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
110513169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
110523169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
110533169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
110543169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
110553169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
110563169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
110573169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
110583169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
110593169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
110603169be4bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
11061b242714cSmrgfi
1106267594505Smrg
110633169be4bSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
110643169be4bSmrg]) # XORG_COMPILER_FLAGS
1106567594505Smrg
110663169be4bSmrg# XORG_CWARNFLAGS
110673169be4bSmrg# ---------------
110683169be4bSmrg# Minimum version: 1.2.0
110693169be4bSmrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
110708bd17e5fSmrg#
110713169be4bSmrg# Defines CWARNFLAGS to enable C compiler warnings.
110728bd17e5fSmrg#
110733169be4bSmrg# This function is deprecated because it defines -fno-strict-aliasing
110743169be4bSmrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
110753169be4bSmrg# is needed, then it should be added explicitly in the module when
110763169be4bSmrg# it is updated to use BASE_CFLAGS.
110778bd17e5fSmrg#
110783169be4bSmrgAC_DEFUN([XORG_CWARNFLAGS], [
110793169be4bSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
110803169be4bSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
110813169be4bSmrgAC_LANG_CASE(
110823169be4bSmrg	[C], [
110833169be4bSmrg		CWARNFLAGS="$BASE_CFLAGS"
110843169be4bSmrg		if  test "x$GCC" = xyes ; then
110853169be4bSmrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
110863169be4bSmrg		fi
110873169be4bSmrg		AC_SUBST(CWARNFLAGS)
110883169be4bSmrg	]
110893169be4bSmrg)
110903169be4bSmrg]) # XORG_CWARNFLAGS
110913169be4bSmrg
110923169be4bSmrg# XORG_STRICT_OPTION
110933169be4bSmrg# -----------------------
110943169be4bSmrg# Minimum version: 1.3.0
110958bd17e5fSmrg#
110963169be4bSmrg# Add configure option to enable strict compilation flags, such as treating
110973169be4bSmrg# warnings as fatal errors.
110983169be4bSmrg# If --enable-strict-compilation is passed to configure, adds strict flags to
110993169be4bSmrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
11100b242714cSmrg#
111013169be4bSmrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
111023169be4bSmrg# when strict compilation is unconditionally desired.
111033169be4bSmrgAC_DEFUN([XORG_STRICT_OPTION], [
111043169be4bSmrgAC_REQUIRE([XORG_CWARNFLAGS])
111053169be4bSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
1110667594505Smrg
111073169be4bSmrgAC_ARG_ENABLE(strict-compilation,
111083169be4bSmrg			  AS_HELP_STRING([--enable-strict-compilation],
111093169be4bSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
111103169be4bSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1111167594505Smrg
111123169be4bSmrgAC_LANG_CASE(
111133169be4bSmrg        [C], [
111143169be4bSmrg                define([PREFIX], [C])
111153169be4bSmrg        ],
111163169be4bSmrg        [C++], [
111173169be4bSmrg                define([PREFIX], [CXX])
111183169be4bSmrg        ]
111193169be4bSmrg)
11120b242714cSmrg
111213169be4bSmrg[STRICT_]PREFIX[FLAGS]=""
111223169be4bSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
111233169be4bSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
11124b242714cSmrg
111253169be4bSmrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
111263169be4bSmrg# activate it with -Werror, so we add it here explicitly.
111273169be4bSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
1112867594505Smrg
111293169be4bSmrgif test "x$STRICT_COMPILE" = "xyes"; then
111303169be4bSmrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
111313169be4bSmrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
111328bd17e5fSmrgfi
111333169be4bSmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
111343169be4bSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
111353169be4bSmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
111363169be4bSmrg]) # XORG_STRICT_OPTION
111378bd17e5fSmrg
111383169be4bSmrg# XORG_DEFAULT_OPTIONS
111393169be4bSmrg# --------------------
111403169be4bSmrg# Minimum version: 1.3.0
11141b242714cSmrg#
111423169be4bSmrg# Defines default options for X.Org modules.
11143b242714cSmrg#
111443169be4bSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
111453169be4bSmrgAC_REQUIRE([AC_PROG_INSTALL])
111463169be4bSmrgXORG_COMPILER_FLAGS
111473169be4bSmrgXORG_CWARNFLAGS
111483169be4bSmrgXORG_STRICT_OPTION
111493169be4bSmrgXORG_RELEASE_VERSION
111503169be4bSmrgXORG_CHANGELOG
111513169be4bSmrgXORG_INSTALL
111523169be4bSmrgXORG_MANPAGE_SECTIONS
111533169be4bSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
111543169be4bSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
111553169be4bSmrg]) # XORG_DEFAULT_OPTIONS
1115667594505Smrg
111573169be4bSmrg# XORG_INSTALL()
11158b242714cSmrg# ----------------
111593169be4bSmrg# Minimum version: 1.4.0
11160b242714cSmrg#
111613169be4bSmrg# Defines the variable INSTALL_CMD as the command to copy
111623169be4bSmrg# INSTALL from $prefix/share/util-macros.
11163b242714cSmrg#
111643169be4bSmrgAC_DEFUN([XORG_INSTALL], [
111653169be4bSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
111663169be4bSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
111673169be4bSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
111683169be4bSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
111693169be4bSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
111703169be4bSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
111713169be4bSmrgAC_SUBST([INSTALL_CMD])
111723169be4bSmrg]) # XORG_INSTALL
111733169be4bSmrgdnl Copyright 2005 Red Hat, Inc
111743169be4bSmrgdnl
111753169be4bSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
111763169be4bSmrgdnl documentation for any purpose is hereby granted without fee, provided that
111773169be4bSmrgdnl the above copyright notice appear in all copies and that both that
111783169be4bSmrgdnl copyright notice and this permission notice appear in supporting
111793169be4bSmrgdnl documentation.
111803169be4bSmrgdnl
111813169be4bSmrgdnl The above copyright notice and this permission notice shall be included
111823169be4bSmrgdnl in all copies or substantial portions of the Software.
111833169be4bSmrgdnl
111843169be4bSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
111853169be4bSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
111863169be4bSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
111873169be4bSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
111883169be4bSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
111893169be4bSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
111903169be4bSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
111913169be4bSmrgdnl
111923169be4bSmrgdnl Except as contained in this notice, the name of the copyright holders shall
111933169be4bSmrgdnl not be used in advertising or otherwise to promote the sale, use or
111943169be4bSmrgdnl other dealings in this Software without prior written authorization
111953169be4bSmrgdnl from the copyright holders.
111963169be4bSmrgdnl
1119767594505Smrg
111983169be4bSmrg# XORG_RELEASE_VERSION
111993169be4bSmrg# --------------------
112003169be4bSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
112013169be4bSmrg
112023169be4bSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
112033169be4bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
112043169be4bSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
112053169be4bSmrg		[Major version of this package])
112063169be4bSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
112073169be4bSmrg	if test "x$PVM" = "x"; then
112083169be4bSmrg		PVM="0"
112093169be4bSmrg	fi
112103169be4bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
112113169be4bSmrg		[$PVM],
112123169be4bSmrg		[Minor version of this package])
112133169be4bSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
112143169be4bSmrg	if test "x$PVP" = "x"; then
112153169be4bSmrg		PVP="0"
112163169be4bSmrg	fi
112173169be4bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
112183169be4bSmrg		[$PVP],
112193169be4bSmrg		[Patch version of this package])
112203169be4bSmrg])
112213169be4bSmrg
112223169be4bSmrg# XORG_CHANGELOG()
11223b242714cSmrg# ----------------
112243169be4bSmrg# Minimum version: 1.2.0
1122567594505Smrg#
112263169be4bSmrg# Defines the variable CHANGELOG_CMD as the command to generate
112273169be4bSmrg# ChangeLog from git.
11228b242714cSmrg#
11229b242714cSmrg#
112303169be4bSmrgAC_DEFUN([XORG_CHANGELOG], [
112313169be4bSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
112323169be4bSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
112333169be4bSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
112343169be4bSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
112353169be4bSmrgAC_SUBST([CHANGELOG_CMD])
112363169be4bSmrg]) # XORG_CHANGELOG
112373169be4bSmrg
112383169be4bSmrg# Copyright (C) 2002-2014 Free Software Foundation, Inc.
112393169be4bSmrg#
112403169be4bSmrg# This file is free software; the Free Software Foundation
112413169be4bSmrg# gives unlimited permission to copy and/or distribute it,
112423169be4bSmrg# with or without modifications, as long as this notice is preserved.
112433169be4bSmrg
112443169be4bSmrg# AM_AUTOMAKE_VERSION(VERSION)
112453169be4bSmrg# ----------------------------
112463169be4bSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
112473169be4bSmrg# generated from the m4 files accompanying Automake X.Y.
112483169be4bSmrg# (This private macro should not be called outside this file.)
112493169be4bSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
112503169be4bSmrg[am__api_version='1.15'
112513169be4bSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
112523169be4bSmrgdnl require some minimum version.  Point them to the right macro.
112533169be4bSmrgm4_if([$1], [1.15], [],
112543169be4bSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
112553169be4bSmrg])
112563169be4bSmrg
112573169be4bSmrg# _AM_AUTOCONF_VERSION(VERSION)
112583169be4bSmrg# -----------------------------
112593169be4bSmrg# aclocal traces this macro to find the Autoconf version.
112603169be4bSmrg# This is a private macro too.  Using m4_define simplifies
112613169be4bSmrg# the logic in aclocal, which can simply ignore this definition.
112623169be4bSmrgm4_define([_AM_AUTOCONF_VERSION], [])
112633169be4bSmrg
112643169be4bSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
112653169be4bSmrg# -------------------------------
112663169be4bSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
112673169be4bSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
112683169be4bSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
112693169be4bSmrg[AM_AUTOMAKE_VERSION([1.15])dnl
112703169be4bSmrgm4_ifndef([AC_AUTOCONF_VERSION],
112713169be4bSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
112723169be4bSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
112733169be4bSmrg
112743169be4bSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
112753169be4bSmrg
112763169be4bSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
112773169be4bSmrg#
112783169be4bSmrg# This file is free software; the Free Software Foundation
112793169be4bSmrg# gives unlimited permission to copy and/or distribute it,
112803169be4bSmrg# with or without modifications, as long as this notice is preserved.
112813169be4bSmrg
112823169be4bSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
112833169be4bSmrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
112843169be4bSmrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
112853169be4bSmrg#
112863169be4bSmrg# Of course, Automake must honor this variable whenever it calls a
112873169be4bSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
112883169be4bSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
112893169be4bSmrg# depending on how configure is run.  This is pretty annoying, since
112903169be4bSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
112913169be4bSmrg# source directory, any form will work fine, but in subdirectories a
112923169be4bSmrg# relative path needs to be adjusted first.
112933169be4bSmrg#
112943169be4bSmrg# $ac_aux_dir/missing
112953169be4bSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
112963169be4bSmrg# $top_srcdir/$ac_aux_dir/missing
112973169be4bSmrg#    fails if $ac_aux_dir is absolute,
112983169be4bSmrg#    fails when called from a subdirectory in a VPATH build with
112993169be4bSmrg#          a relative $ac_aux_dir
113003169be4bSmrg#
113013169be4bSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
113023169be4bSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
113033169be4bSmrg# harmless because $srcdir is '.', but things will broke when you
113043169be4bSmrg# start a VPATH build or use an absolute $srcdir.
113053169be4bSmrg#
113063169be4bSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
113073169be4bSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
113083169be4bSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
113093169be4bSmrg# and then we would define $MISSING as
113103169be4bSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
113113169be4bSmrg# This will work as long as MISSING is not called from configure, because
113123169be4bSmrg# unfortunately $(top_srcdir) has no meaning in configure.
113133169be4bSmrg# However there are other variables, like CC, which are often used in
113143169be4bSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
113153169be4bSmrg#
113163169be4bSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
113173169be4bSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
113183169be4bSmrg# configured tree to be moved without reconfiguration.
113193169be4bSmrg
113203169be4bSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
113213169be4bSmrg[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
113223169be4bSmrg# Expand $ac_aux_dir to an absolute path.
113233169be4bSmrgam_aux_dir=`cd "$ac_aux_dir" && pwd`
113243169be4bSmrg])
113253169be4bSmrg
113263169be4bSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
113273169be4bSmrg
113283169be4bSmrg# Copyright (C) 1997-2014 Free Software Foundation, Inc.
113293169be4bSmrg#
113303169be4bSmrg# This file is free software; the Free Software Foundation
113313169be4bSmrg# gives unlimited permission to copy and/or distribute it,
113323169be4bSmrg# with or without modifications, as long as this notice is preserved.
113333169be4bSmrg
113343169be4bSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
113353169be4bSmrg# -------------------------------------
113363169be4bSmrg# Define a conditional.
113373169be4bSmrgAC_DEFUN([AM_CONDITIONAL],
113383169be4bSmrg[AC_PREREQ([2.52])dnl
113393169be4bSmrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
113403169be4bSmrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
113413169be4bSmrgAC_SUBST([$1_TRUE])dnl
113423169be4bSmrgAC_SUBST([$1_FALSE])dnl
113433169be4bSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
113443169be4bSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
113453169be4bSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
113463169be4bSmrgif $2; then
113473169be4bSmrg  $1_TRUE=
113483169be4bSmrg  $1_FALSE='#'
113493169be4bSmrgelse
113503169be4bSmrg  $1_TRUE='#'
113513169be4bSmrg  $1_FALSE=
113523169be4bSmrgfi
113533169be4bSmrgAC_CONFIG_COMMANDS_PRE(
113543169be4bSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
113553169be4bSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
113563169be4bSmrgUsually this means the macro was only invoked conditionally.]])
113573169be4bSmrgfi])])
113583169be4bSmrg
113593169be4bSmrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
113603169be4bSmrg#
113613169be4bSmrg# This file is free software; the Free Software Foundation
113623169be4bSmrg# gives unlimited permission to copy and/or distribute it,
113633169be4bSmrg# with or without modifications, as long as this notice is preserved.
113643169be4bSmrg
113653169be4bSmrg
113663169be4bSmrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
113673169be4bSmrg# written in clear, in which case automake, when reading aclocal.m4,
113683169be4bSmrg# will think it sees a *use*, and therefore will trigger all it's
113693169be4bSmrg# C support machinery.  Also note that it means that autoscan, seeing
113703169be4bSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
113713169be4bSmrg
113723169be4bSmrg
113733169be4bSmrg# _AM_DEPENDENCIES(NAME)
113743169be4bSmrg# ----------------------
113753169be4bSmrg# See how the compiler implements dependency checking.
113763169be4bSmrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
113773169be4bSmrg# We try a few techniques and use that to set a single cache variable.
113783169be4bSmrg#
113793169be4bSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
113803169be4bSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
113813169be4bSmrg# dependency, and given that the user is not expected to run this macro,
113823169be4bSmrg# just rely on AC_PROG_CC.
113833169be4bSmrgAC_DEFUN([_AM_DEPENDENCIES],
113843169be4bSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
113853169be4bSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
113863169be4bSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
113873169be4bSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
113883169be4bSmrg
113893169be4bSmrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
113903169be4bSmrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
113913169be4bSmrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
113923169be4bSmrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
113933169be4bSmrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
113943169be4bSmrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
113953169be4bSmrg                    [depcc="$$1"   am_compiler_list=])
113963169be4bSmrg
113973169be4bSmrgAC_CACHE_CHECK([dependency style of $depcc],
113983169be4bSmrg               [am_cv_$1_dependencies_compiler_type],
113993169be4bSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
114003169be4bSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
114013169be4bSmrg  # making bogus files that we don't know about and never remove.  For
114023169be4bSmrg  # instance it was reported that on HP-UX the gcc test will end up
114033169be4bSmrg  # making a dummy file named 'D' -- because '-MD' means "put the output
114043169be4bSmrg  # in D".
114053169be4bSmrg  rm -rf conftest.dir
114063169be4bSmrg  mkdir conftest.dir
114073169be4bSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
114083169be4bSmrg  # using a relative directory.
114093169be4bSmrg  cp "$am_depcomp" conftest.dir
114103169be4bSmrg  cd conftest.dir
114113169be4bSmrg  # We will build objects and dependencies in a subdirectory because
114123169be4bSmrg  # it helps to detect inapplicable dependency modes.  For instance
114133169be4bSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
114143169be4bSmrg  # side effect of compilation, but ICC will put the dependencies in
114153169be4bSmrg  # the current directory while Tru64 will put them in the object
114163169be4bSmrg  # directory.
114173169be4bSmrg  mkdir sub
114183169be4bSmrg
114193169be4bSmrg  am_cv_$1_dependencies_compiler_type=none
114203169be4bSmrg  if test "$am_compiler_list" = ""; then
114213169be4bSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
114223169be4bSmrg  fi
114233169be4bSmrg  am__universal=false
114243169be4bSmrg  m4_case([$1], [CC],
114253169be4bSmrg    [case " $depcc " in #(
114263169be4bSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
114273169be4bSmrg     esac],
114283169be4bSmrg    [CXX],
114293169be4bSmrg    [case " $depcc " in #(
114303169be4bSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
114313169be4bSmrg     esac])
114323169be4bSmrg
114333169be4bSmrg  for depmode in $am_compiler_list; do
114343169be4bSmrg    # Setup a source with many dependencies, because some compilers
114353169be4bSmrg    # like to wrap large dependency lists on column 80 (with \), and
114363169be4bSmrg    # we should not choose a depcomp mode which is confused by this.
114373169be4bSmrg    #
114383169be4bSmrg    # We need to recreate these files for each test, as the compiler may
114393169be4bSmrg    # overwrite some of them when testing with obscure command lines.
114403169be4bSmrg    # This happens at least with the AIX C compiler.
114413169be4bSmrg    : > sub/conftest.c
114423169be4bSmrg    for i in 1 2 3 4 5 6; do
114433169be4bSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
114443169be4bSmrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
114453169be4bSmrg      # Solaris 10 /bin/sh.
114463169be4bSmrg      echo '/* dummy */' > sub/conftst$i.h
114473169be4bSmrg    done
114483169be4bSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
114493169be4bSmrg
114503169be4bSmrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
114513169be4bSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
114523169be4bSmrg    # handle '-M -o', and we need to detect this.  Also, some Intel
114533169be4bSmrg    # versions had trouble with output in subdirs.
114543169be4bSmrg    am__obj=sub/conftest.${OBJEXT-o}
114553169be4bSmrg    am__minus_obj="-o $am__obj"
114563169be4bSmrg    case $depmode in
114573169be4bSmrg    gcc)
114583169be4bSmrg      # This depmode causes a compiler race in universal mode.
114593169be4bSmrg      test "$am__universal" = false || continue
114603169be4bSmrg      ;;
114613169be4bSmrg    nosideeffect)
114623169be4bSmrg      # After this tag, mechanisms are not by side-effect, so they'll
114633169be4bSmrg      # only be used when explicitly requested.
114643169be4bSmrg      if test "x$enable_dependency_tracking" = xyes; then
114653169be4bSmrg	continue
114663169be4bSmrg      else
114673169be4bSmrg	break
114683169be4bSmrg      fi
114693169be4bSmrg      ;;
114703169be4bSmrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
114713169be4bSmrg      # This compiler won't grok '-c -o', but also, the minuso test has
114723169be4bSmrg      # not run yet.  These depmodes are late enough in the game, and
114733169be4bSmrg      # so weak that their functioning should not be impacted.
114743169be4bSmrg      am__obj=conftest.${OBJEXT-o}
114753169be4bSmrg      am__minus_obj=
114763169be4bSmrg      ;;
114773169be4bSmrg    none) break ;;
114783169be4bSmrg    esac
114793169be4bSmrg    if depmode=$depmode \
114803169be4bSmrg       source=sub/conftest.c object=$am__obj \
114813169be4bSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
114823169be4bSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
114833169be4bSmrg         >/dev/null 2>conftest.err &&
114843169be4bSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
114853169be4bSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
114863169be4bSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
114873169be4bSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
114883169be4bSmrg      # icc doesn't choke on unknown options, it will just issue warnings
114893169be4bSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
114903169be4bSmrg      # that says an option was ignored or not supported.
114913169be4bSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
114923169be4bSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
114933169be4bSmrg      # The diagnosis changed in icc 8.0:
114943169be4bSmrg      #   icc: Command line remark: option '-MP' not supported
114953169be4bSmrg      if (grep 'ignoring option' conftest.err ||
114963169be4bSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
114973169be4bSmrg        am_cv_$1_dependencies_compiler_type=$depmode
114983169be4bSmrg        break
114993169be4bSmrg      fi
115003169be4bSmrg    fi
115013169be4bSmrg  done
115023169be4bSmrg
115033169be4bSmrg  cd ..
115043169be4bSmrg  rm -rf conftest.dir
115053169be4bSmrgelse
115063169be4bSmrg  am_cv_$1_dependencies_compiler_type=none
115073169be4bSmrgfi
115083169be4bSmrg])
115093169be4bSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
115103169be4bSmrgAM_CONDITIONAL([am__fastdep$1], [
115113169be4bSmrg  test "x$enable_dependency_tracking" != xno \
115123169be4bSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
115133169be4bSmrg])
115143169be4bSmrg
115153169be4bSmrg
115163169be4bSmrg# AM_SET_DEPDIR
115173169be4bSmrg# -------------
115183169be4bSmrg# Choose a directory name for dependency files.
115193169be4bSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
115203169be4bSmrgAC_DEFUN([AM_SET_DEPDIR],
115213169be4bSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
115223169be4bSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
115233169be4bSmrg])
115243169be4bSmrg
115253169be4bSmrg
115263169be4bSmrg# AM_DEP_TRACK
115273169be4bSmrg# ------------
115283169be4bSmrgAC_DEFUN([AM_DEP_TRACK],
115293169be4bSmrg[AC_ARG_ENABLE([dependency-tracking], [dnl
115303169be4bSmrgAS_HELP_STRING(
115313169be4bSmrg  [--enable-dependency-tracking],
115323169be4bSmrg  [do not reject slow dependency extractors])
115333169be4bSmrgAS_HELP_STRING(
115343169be4bSmrg  [--disable-dependency-tracking],
115353169be4bSmrg  [speeds up one-time build])])
115363169be4bSmrgif test "x$enable_dependency_tracking" != xno; then
115373169be4bSmrg  am_depcomp="$ac_aux_dir/depcomp"
115383169be4bSmrg  AMDEPBACKSLASH='\'
115393169be4bSmrg  am__nodep='_no'
115403169be4bSmrgfi
115413169be4bSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
115423169be4bSmrgAC_SUBST([AMDEPBACKSLASH])dnl
115433169be4bSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
115443169be4bSmrgAC_SUBST([am__nodep])dnl
115453169be4bSmrg_AM_SUBST_NOTMAKE([am__nodep])dnl
115463169be4bSmrg])
115478c4a8e55Smrg
115483169be4bSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
115498c4a8e55Smrg
115503169be4bSmrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
11551b242714cSmrg#
115523169be4bSmrg# This file is free software; the Free Software Foundation
115533169be4bSmrg# gives unlimited permission to copy and/or distribute it,
115543169be4bSmrg# with or without modifications, as long as this notice is preserved.
115558c4a8e55Smrg
1155667594505Smrg
115573169be4bSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
115583169be4bSmrg# ------------------------------
115593169be4bSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
115603169be4bSmrg[{
115613169be4bSmrg  # Older Autoconf quotes --file arguments for eval, but not when files
115623169be4bSmrg  # are listed without --file.  Let's play safe and only enable the eval
115633169be4bSmrg  # if we detect the quoting.
115643169be4bSmrg  case $CONFIG_FILES in
115653169be4bSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
115663169be4bSmrg  *)   set x $CONFIG_FILES ;;
115673169be4bSmrg  esac
115683169be4bSmrg  shift
115693169be4bSmrg  for mf
115703169be4bSmrg  do
115713169be4bSmrg    # Strip MF so we end up with the name of the file.
115723169be4bSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
115733169be4bSmrg    # Check whether this is an Automake generated Makefile or not.
115743169be4bSmrg    # We used to match only the files named 'Makefile.in', but
115753169be4bSmrg    # some people rename them; so instead we look at the file content.
115763169be4bSmrg    # Grep'ing the first line is not enough: some people post-process
115773169be4bSmrg    # each Makefile.in and add a new line on top of each file to say so.
115783169be4bSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
115793169be4bSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
115803169be4bSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
115813169be4bSmrg      dirpart=`AS_DIRNAME("$mf")`
115823169be4bSmrg    else
115833169be4bSmrg      continue
115843169be4bSmrg    fi
115853169be4bSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
115863169be4bSmrg    # from the Makefile without running 'make'.
115873169be4bSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
115883169be4bSmrg    test -z "$DEPDIR" && continue
115893169be4bSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
115903169be4bSmrg    test -z "$am__include" && continue
115913169be4bSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
115923169be4bSmrg    # Find all dependency output files, they are included files with
115933169be4bSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
115943169be4bSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
115953169be4bSmrg    # expansion.
115963169be4bSmrg    for file in `sed -n "
115973169be4bSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
115983169be4bSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
115993169be4bSmrg      # Make sure the directory exists.
116003169be4bSmrg      test -f "$dirpart/$file" && continue
116013169be4bSmrg      fdir=`AS_DIRNAME(["$file"])`
116023169be4bSmrg      AS_MKDIR_P([$dirpart/$fdir])
116033169be4bSmrg      # echo "creating $dirpart/$file"
116043169be4bSmrg      echo '# dummy' > "$dirpart/$file"
116053169be4bSmrg    done
116063169be4bSmrg  done
116073169be4bSmrg}
116083169be4bSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1160967594505Smrg
116103169be4bSmrg
116113169be4bSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
116123169be4bSmrg# -----------------------------
116133169be4bSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
11614b242714cSmrg#
116153169be4bSmrg# This code is only required when automatic dependency tracking
116163169be4bSmrg# is enabled.  FIXME.  This creates each '.P' file that we will
116173169be4bSmrg# need in order to bootstrap the dependency handling code.
116183169be4bSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
116193169be4bSmrg[AC_CONFIG_COMMANDS([depfiles],
116203169be4bSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
116213169be4bSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
116223169be4bSmrg])
11623b042e37fSmrg
116243169be4bSmrg# Do all the work for Automake.                             -*- Autoconf -*-
11625b042e37fSmrg
116263169be4bSmrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
116273169be4bSmrg#
116283169be4bSmrg# This file is free software; the Free Software Foundation
116293169be4bSmrg# gives unlimited permission to copy and/or distribute it,
116303169be4bSmrg# with or without modifications, as long as this notice is preserved.
116310597fb56Smrg
116323169be4bSmrg# This macro actually does too much.  Some checks are only needed if
116333169be4bSmrg# your package does certain things.  But this isn't really a big deal.
116343169be4bSmrg
116353169be4bSmrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
116363169be4bSmrgm4_define([AC_PROG_CC],
116373169be4bSmrgm4_defn([AC_PROG_CC])
116383169be4bSmrg[_AM_PROG_CC_C_O
116393169be4bSmrg])
116408bd17e5fSmrg
116413169be4bSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
116423169be4bSmrg# AM_INIT_AUTOMAKE([OPTIONS])
116433169be4bSmrg# -----------------------------------------------
116443169be4bSmrg# The call with PACKAGE and VERSION arguments is the old style
116453169be4bSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
116463169be4bSmrg# and VERSION should now be passed to AC_INIT and removed from
116473169be4bSmrg# the call to AM_INIT_AUTOMAKE.
116483169be4bSmrg# We support both call styles for the transition.  After
116493169be4bSmrg# the next Automake release, Autoconf can make the AC_INIT
116503169be4bSmrg# arguments mandatory, and then we can depend on a new Autoconf
116513169be4bSmrg# release and drop the old call support.
116523169be4bSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
116533169be4bSmrg[AC_PREREQ([2.65])dnl
116543169be4bSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
116553169be4bSmrgdnl the ones we care about.
116563169be4bSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
116573169be4bSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
116583169be4bSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
116593169be4bSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
116603169be4bSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
116613169be4bSmrg  # is not polluted with repeated "-I."
116623169be4bSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
116633169be4bSmrg  # test to see if srcdir already configured
116643169be4bSmrg  if test -f $srcdir/config.status; then
116653169be4bSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
11666b242714cSmrg  fi
11667b242714cSmrgfi
116688bd17e5fSmrg
116693169be4bSmrg# test whether we have cygpath
116703169be4bSmrgif test -z "$CYGPATH_W"; then
116713169be4bSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
116723169be4bSmrg    CYGPATH_W='cygpath -w'
116733169be4bSmrg  else
116743169be4bSmrg    CYGPATH_W=echo
11675b242714cSmrg  fi
11676b242714cSmrgfi
116773169be4bSmrgAC_SUBST([CYGPATH_W])
11678b242714cSmrg
116793169be4bSmrg# Define the identity of the package.
116803169be4bSmrgdnl Distinguish between old-style and new-style calls.
116813169be4bSmrgm4_ifval([$2],
116823169be4bSmrg[AC_DIAGNOSE([obsolete],
116833169be4bSmrg             [$0: two- and three-arguments forms are deprecated.])
116843169be4bSmrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
116853169be4bSmrg AC_SUBST([PACKAGE], [$1])dnl
116863169be4bSmrg AC_SUBST([VERSION], [$2])],
116873169be4bSmrg[_AM_SET_OPTIONS([$1])dnl
116883169be4bSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
116893169be4bSmrgm4_if(
116903169be4bSmrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
116913169be4bSmrg  [ok:ok],,
116923169be4bSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
116933169be4bSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
116943169be4bSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1169567594505Smrg
116963169be4bSmrg_AM_IF_OPTION([no-define],,
116973169be4bSmrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
116983169be4bSmrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
11699b242714cSmrg
117003169be4bSmrg# Some tools Automake needs.
117013169be4bSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
117023169be4bSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
117033169be4bSmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
117043169be4bSmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
117053169be4bSmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
117063169be4bSmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
117073169be4bSmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
117083169be4bSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
117093169be4bSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
117103169be4bSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
117113169be4bSmrg# For better backward compatibility.  To be removed once Automake 1.9.x
117123169be4bSmrg# dies out for good.  For more background, see:
117133169be4bSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
117143169be4bSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
117153169be4bSmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
117163169be4bSmrg# We need awk for the "check" target (and possibly the TAP driver).  The
117173169be4bSmrg# system "awk" is bad on some platforms.
117183169be4bSmrgAC_REQUIRE([AC_PROG_AWK])dnl
117193169be4bSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
117203169be4bSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
117213169be4bSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
117223169be4bSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
117233169be4bSmrg			     [_AM_PROG_TAR([v7])])])
117243169be4bSmrg_AM_IF_OPTION([no-dependencies],,
117253169be4bSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
117263169be4bSmrg		  [_AM_DEPENDENCIES([CC])],
117273169be4bSmrg		  [m4_define([AC_PROG_CC],
117283169be4bSmrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
117293169be4bSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
117303169be4bSmrg		  [_AM_DEPENDENCIES([CXX])],
117313169be4bSmrg		  [m4_define([AC_PROG_CXX],
117323169be4bSmrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
117333169be4bSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
117343169be4bSmrg		  [_AM_DEPENDENCIES([OBJC])],
117353169be4bSmrg		  [m4_define([AC_PROG_OBJC],
117363169be4bSmrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
117373169be4bSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
117383169be4bSmrg		  [_AM_DEPENDENCIES([OBJCXX])],
117393169be4bSmrg		  [m4_define([AC_PROG_OBJCXX],
117403169be4bSmrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
117413169be4bSmrg])
117423169be4bSmrgAC_REQUIRE([AM_SILENT_RULES])dnl
117433169be4bSmrgdnl The testsuite driver may need to know about EXEEXT, so add the
117443169be4bSmrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
117453169be4bSmrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
117463169be4bSmrgAC_CONFIG_COMMANDS_PRE(dnl
117473169be4bSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
117483169be4bSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
117498c4a8e55Smrg
117503169be4bSmrg# POSIX will say in a future version that running "rm -f" with no argument
117513169be4bSmrg# is OK; and we want to be able to make that assumption in our Makefile
117523169be4bSmrg# recipes.  So use an aggressive probe to check that the usage we want is
117533169be4bSmrg# actually supported "in the wild" to an acceptable degree.
117543169be4bSmrg# See automake bug#10828.
117553169be4bSmrg# To make any issue more visible, cause the running configure to be aborted
117563169be4bSmrg# by default if the 'rm' program in use doesn't match our expectations; the
117573169be4bSmrg# user can still override this though.
117583169be4bSmrgif rm -f && rm -fr && rm -rf; then : OK; else
117593169be4bSmrg  cat >&2 <<'END'
117603169be4bSmrgOops!
117618c4a8e55Smrg
117623169be4bSmrgYour 'rm' program seems unable to run without file operands specified
117633169be4bSmrgon the command line, even when the '-f' option is present.  This is contrary
117643169be4bSmrgto the behaviour of most rm programs out there, and not conforming with
117653169be4bSmrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
117668c4a8e55Smrg
117673169be4bSmrgPlease tell bug-automake@gnu.org about your system, including the value
117683169be4bSmrgof your $PATH and any error possibly output before this message.  This
117693169be4bSmrgcan help us improve future automake versions.
117708c4a8e55Smrg
117713169be4bSmrgEND
117723169be4bSmrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
117733169be4bSmrg    echo 'Configuration will proceed anyway, since you have set the' >&2
117743169be4bSmrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
117753169be4bSmrg    echo >&2
117763169be4bSmrg  else
117773169be4bSmrg    cat >&2 <<'END'
117783169be4bSmrgAborting the configuration process, to ensure you take notice of the issue.
117798c4a8e55Smrg
117803169be4bSmrgYou can download and install GNU coreutils to get an 'rm' implementation
117813169be4bSmrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
11782706b6b52Smrg
117833169be4bSmrgIf you want to complete the configuration process using your problematic
117843169be4bSmrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
117853169be4bSmrgto "yes", and re-run configure.
117863169be4bSmrg
117873169be4bSmrgEND
117883169be4bSmrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
117893169be4bSmrg  fi
1179067594505Smrgfi
117913169be4bSmrgdnl The trailing newline in this macro's definition is deliberate, for
117923169be4bSmrgdnl backward compatibility and to allow trailing 'dnl'-style comments
117933169be4bSmrgdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
117943169be4bSmrg])
11795706b6b52Smrg
117963169be4bSmrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
117973169be4bSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
117983169be4bSmrgdnl mangled by Autoconf and run in a shell conditional statement.
117993169be4bSmrgm4_define([_AC_COMPILER_EXEEXT],
118003169be4bSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
11801706b6b52Smrg
118023169be4bSmrg# When config.status generates a header, we must update the stamp-h file.
118033169be4bSmrg# This file resides in the same directory as the config header
118043169be4bSmrg# that is generated.  The stamp files are numbered to have different names.
118058c4a8e55Smrg
118063169be4bSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
118073169be4bSmrg# loop where config.status creates the headers, so we can generate
118083169be4bSmrg# our stamp files there.
118093169be4bSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
118103169be4bSmrg[# Compute $1's index in $config_headers.
118113169be4bSmrg_am_arg=$1
118123169be4bSmrg_am_stamp_count=1
118133169be4bSmrgfor _am_header in $config_headers :; do
118143169be4bSmrg  case $_am_header in
118153169be4bSmrg    $_am_arg | $_am_arg:* )
118163169be4bSmrg      break ;;
118173169be4bSmrg    * )
118183169be4bSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
118193169be4bSmrg  esac
118203169be4bSmrgdone
118213169be4bSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
118228c4a8e55Smrg
118233169be4bSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
118243169be4bSmrg#
118253169be4bSmrg# This file is free software; the Free Software Foundation
118263169be4bSmrg# gives unlimited permission to copy and/or distribute it,
118273169be4bSmrg# with or without modifications, as long as this notice is preserved.
11828b242714cSmrg
118293169be4bSmrg# AM_PROG_INSTALL_SH
118303169be4bSmrg# ------------------
118313169be4bSmrg# Define $install_sh.
118323169be4bSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
118333169be4bSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
118343169be4bSmrgif test x"${install_sh+set}" != xset; then
118353169be4bSmrg  case $am_aux_dir in
118363169be4bSmrg  *\ * | *\	*)
118373169be4bSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
118383169be4bSmrg  *)
118393169be4bSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
118403169be4bSmrg  esac
118410597fb56Smrgfi
118423169be4bSmrgAC_SUBST([install_sh])])
11843706b6b52Smrg
118443169be4bSmrg# Copyright (C) 2003-2014 Free Software Foundation, Inc.
118453169be4bSmrg#
118463169be4bSmrg# This file is free software; the Free Software Foundation
118473169be4bSmrg# gives unlimited permission to copy and/or distribute it,
118483169be4bSmrg# with or without modifications, as long as this notice is preserved.
1184967594505Smrg
118503169be4bSmrg# Check whether the underlying file-system supports filenames
118513169be4bSmrg# with a leading dot.  For instance MS-DOS doesn't.
118523169be4bSmrgAC_DEFUN([AM_SET_LEADING_DOT],
118533169be4bSmrg[rm -rf .tst 2>/dev/null
118543169be4bSmrgmkdir .tst 2>/dev/null
118553169be4bSmrgif test -d .tst; then
118563169be4bSmrg  am__leading_dot=.
118573169be4bSmrgelse
118583169be4bSmrg  am__leading_dot=_
118593169be4bSmrgfi
118603169be4bSmrgrmdir .tst 2>/dev/null
118613169be4bSmrgAC_SUBST([am__leading_dot])])
1186267594505Smrg
118633169be4bSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
1186467594505Smrg
118653169be4bSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
11866b242714cSmrg#
118673169be4bSmrg# This file is free software; the Free Software Foundation
118683169be4bSmrg# gives unlimited permission to copy and/or distribute it,
118693169be4bSmrg# with or without modifications, as long as this notice is preserved.
11870706b6b52Smrg
118713169be4bSmrg# AM_MAKE_INCLUDE()
118723169be4bSmrg# -----------------
118733169be4bSmrg# Check to see how make treats includes.
118743169be4bSmrgAC_DEFUN([AM_MAKE_INCLUDE],
118753169be4bSmrg[am_make=${MAKE-make}
118763169be4bSmrgcat > confinc << 'END'
118773169be4bSmrgam__doit:
118783169be4bSmrg	@echo this is the am__doit target
118793169be4bSmrg.PHONY: am__doit
118803169be4bSmrgEND
118813169be4bSmrg# If we don't find an include directive, just comment out the code.
118823169be4bSmrgAC_MSG_CHECKING([for style of include used by $am_make])
118833169be4bSmrgam__include="#"
118843169be4bSmrgam__quote=
118853169be4bSmrg_am_result=none
118863169be4bSmrg# First try GNU make style include.
118873169be4bSmrgecho "include confinc" > confmf
118883169be4bSmrg# Ignore all kinds of additional output from 'make'.
118893169be4bSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
118903169be4bSmrg*the\ am__doit\ target*)
118913169be4bSmrg  am__include=include
118923169be4bSmrg  am__quote=
118933169be4bSmrg  _am_result=GNU
118943169be4bSmrg  ;;
118953169be4bSmrgesac
118963169be4bSmrg# Now try BSD make style include.
118973169be4bSmrgif test "$am__include" = "#"; then
118983169be4bSmrg   echo '.include "confinc"' > confmf
118993169be4bSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
119003169be4bSmrg   *the\ am__doit\ target*)
119013169be4bSmrg     am__include=.include
119023169be4bSmrg     am__quote="\""
119033169be4bSmrg     _am_result=BSD
119043169be4bSmrg     ;;
119053169be4bSmrg   esac
11906b242714cSmrgfi
119073169be4bSmrgAC_SUBST([am__include])
119083169be4bSmrgAC_SUBST([am__quote])
119093169be4bSmrgAC_MSG_RESULT([$_am_result])
119103169be4bSmrgrm -f confinc confmf
119113169be4bSmrg])
11912706b6b52Smrg
119133169be4bSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
119140597fb56Smrg
119153169be4bSmrg# Copyright (C) 1997-2014 Free Software Foundation, Inc.
11916b242714cSmrg#
119173169be4bSmrg# This file is free software; the Free Software Foundation
119183169be4bSmrg# gives unlimited permission to copy and/or distribute it,
119193169be4bSmrg# with or without modifications, as long as this notice is preserved.
11920b242714cSmrg
119213169be4bSmrg# AM_MISSING_PROG(NAME, PROGRAM)
119223169be4bSmrg# ------------------------------
119233169be4bSmrgAC_DEFUN([AM_MISSING_PROG],
119243169be4bSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
119253169be4bSmrg$1=${$1-"${am_missing_run}$2"}
119263169be4bSmrgAC_SUBST($1)])
11927b242714cSmrg
119283169be4bSmrg# AM_MISSING_HAS_RUN
119293169be4bSmrg# ------------------
119303169be4bSmrg# Define MISSING if not defined so far and test if it is modern enough.
119313169be4bSmrg# If it is, set am_missing_run to use it, otherwise, to nothing.
119323169be4bSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
119333169be4bSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
119343169be4bSmrgAC_REQUIRE_AUX_FILE([missing])dnl
119353169be4bSmrgif test x"${MISSING+set}" != xset; then
119363169be4bSmrg  case $am_aux_dir in
119373169be4bSmrg  *\ * | *\	*)
119383169be4bSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
119393169be4bSmrg  *)
119403169be4bSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
119413169be4bSmrg  esac
119420597fb56Smrgfi
119433169be4bSmrg# Use eval to expand $SHELL
119443169be4bSmrgif eval "$MISSING --is-lightweight"; then
119453169be4bSmrg  am_missing_run="$MISSING "
119463169be4bSmrgelse
119473169be4bSmrg  am_missing_run=
119483169be4bSmrg  AC_MSG_WARN(['missing' script is too old or missing])
1194967594505Smrgfi
119503169be4bSmrg])
11951b242714cSmrg
119523169be4bSmrg# Helper functions for option handling.                     -*- Autoconf -*-
11953b242714cSmrg
119543169be4bSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
119553169be4bSmrg#
119563169be4bSmrg# This file is free software; the Free Software Foundation
119573169be4bSmrg# gives unlimited permission to copy and/or distribute it,
119583169be4bSmrg# with or without modifications, as long as this notice is preserved.
11959b242714cSmrg
119603169be4bSmrg# _AM_MANGLE_OPTION(NAME)
119613169be4bSmrg# -----------------------
119623169be4bSmrgAC_DEFUN([_AM_MANGLE_OPTION],
119633169be4bSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
11964b242714cSmrg
119653169be4bSmrg# _AM_SET_OPTION(NAME)
119663169be4bSmrg# --------------------
119673169be4bSmrg# Set option NAME.  Presently that only means defining a flag for this option.
119683169be4bSmrgAC_DEFUN([_AM_SET_OPTION],
119693169be4bSmrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
11970b242714cSmrg
119713169be4bSmrg# _AM_SET_OPTIONS(OPTIONS)
119723169be4bSmrg# ------------------------
119733169be4bSmrg# OPTIONS is a space-separated list of Automake options.
119743169be4bSmrgAC_DEFUN([_AM_SET_OPTIONS],
119753169be4bSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
11976b242714cSmrg
119773169be4bSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
119783169be4bSmrg# -------------------------------------------
119793169be4bSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
119803169be4bSmrgAC_DEFUN([_AM_IF_OPTION],
119813169be4bSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
119820597fb56Smrg
119833169be4bSmrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
11984b242714cSmrg#
119853169be4bSmrg# This file is free software; the Free Software Foundation
119863169be4bSmrg# gives unlimited permission to copy and/or distribute it,
119873169be4bSmrg# with or without modifications, as long as this notice is preserved.
11988b242714cSmrg
119893169be4bSmrg# _AM_PROG_CC_C_O
119903169be4bSmrg# ---------------
119913169be4bSmrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
119923169be4bSmrg# to automatically call this.
119933169be4bSmrgAC_DEFUN([_AM_PROG_CC_C_O],
119943169be4bSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
119953169be4bSmrgAC_REQUIRE_AUX_FILE([compile])dnl
119963169be4bSmrgAC_LANG_PUSH([C])dnl
119973169be4bSmrgAC_CACHE_CHECK(
119983169be4bSmrg  [whether $CC understands -c and -o together],
119993169be4bSmrg  [am_cv_prog_cc_c_o],
120003169be4bSmrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
120013169be4bSmrg  # Make sure it works both with $CC and with simple cc.
120023169be4bSmrg  # Following AC_PROG_CC_C_O, we do the test twice because some
120033169be4bSmrg  # compilers refuse to overwrite an existing .o file with -o,
120043169be4bSmrg  # though they will create one.
120053169be4bSmrg  am_cv_prog_cc_c_o=yes
120063169be4bSmrg  for am_i in 1 2; do
120073169be4bSmrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
120083169be4bSmrg         && test -f conftest2.$ac_objext; then
120093169be4bSmrg      : OK
120103169be4bSmrg    else
120113169be4bSmrg      am_cv_prog_cc_c_o=no
120123169be4bSmrg      break
120133169be4bSmrg    fi
120143169be4bSmrg  done
120153169be4bSmrg  rm -f core conftest*
120163169be4bSmrg  unset am_i])
120173169be4bSmrgif test "$am_cv_prog_cc_c_o" != yes; then
120183169be4bSmrg   # Losing compiler, so override with the script.
120193169be4bSmrg   # FIXME: It is wrong to rewrite CC.
120203169be4bSmrg   # But if we don't then we get into trouble of one sort or another.
120213169be4bSmrg   # A longer-term fix would be to have automake use am__CC in this case,
120223169be4bSmrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
120233169be4bSmrg   CC="$am_aux_dir/compile $CC"
1202467594505Smrgfi
120253169be4bSmrgAC_LANG_POP([C])])
1202667594505Smrg
120273169be4bSmrg# For backward compatibility.
120283169be4bSmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
120293169be4bSmrg
120303169be4bSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
120313169be4bSmrg#
120323169be4bSmrg# This file is free software; the Free Software Foundation
120333169be4bSmrg# gives unlimited permission to copy and/or distribute it,
120343169be4bSmrg# with or without modifications, as long as this notice is preserved.
120353169be4bSmrg
120363169be4bSmrg# AM_RUN_LOG(COMMAND)
120373169be4bSmrg# -------------------
120383169be4bSmrg# Run COMMAND, save the exit status in ac_status, and log it.
120393169be4bSmrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
120403169be4bSmrgAC_DEFUN([AM_RUN_LOG],
120413169be4bSmrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
120423169be4bSmrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
120433169be4bSmrg   ac_status=$?
120443169be4bSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
120453169be4bSmrg   (exit $ac_status); }])
1204667594505Smrg
120473169be4bSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
120488c4a8e55Smrg
120493169be4bSmrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
120503169be4bSmrg#
120513169be4bSmrg# This file is free software; the Free Software Foundation
120523169be4bSmrg# gives unlimited permission to copy and/or distribute it,
120533169be4bSmrg# with or without modifications, as long as this notice is preserved.
120548c4a8e55Smrg
120553169be4bSmrg# AM_SANITY_CHECK
120563169be4bSmrg# ---------------
120573169be4bSmrgAC_DEFUN([AM_SANITY_CHECK],
120583169be4bSmrg[AC_MSG_CHECKING([whether build environment is sane])
120593169be4bSmrg# Reject unsafe characters in $srcdir or the absolute working directory
120603169be4bSmrg# name.  Accept space and tab only in the latter.
120613169be4bSmrgam_lf='
120623169be4bSmrg'
120633169be4bSmrgcase `pwd` in
120643169be4bSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
120653169be4bSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
120663169be4bSmrgesac
120673169be4bSmrgcase $srcdir in
120683169be4bSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
120693169be4bSmrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
120703169be4bSmrgesac
12071706b6b52Smrg
120723169be4bSmrg# Do 'set' in a subshell so we don't clobber the current shell's
120733169be4bSmrg# arguments.  Must try -L first in case configure is actually a
120743169be4bSmrg# symlink; some systems play weird games with the mod time of symlinks
120753169be4bSmrg# (eg FreeBSD returns the mod time of the symlink's containing
120763169be4bSmrg# directory).
120773169be4bSmrgif (
120783169be4bSmrg   am_has_slept=no
120793169be4bSmrg   for am_try in 1 2; do
120803169be4bSmrg     echo "timestamp, slept: $am_has_slept" > conftest.file
120813169be4bSmrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
120823169be4bSmrg     if test "$[*]" = "X"; then
120833169be4bSmrg	# -L didn't work.
120843169be4bSmrg	set X `ls -t "$srcdir/configure" conftest.file`
120853169be4bSmrg     fi
120863169be4bSmrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
120873169be4bSmrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
12088706b6b52Smrg
120893169be4bSmrg	# If neither matched, then we have a broken ls.  This can happen
120903169be4bSmrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
120913169be4bSmrg	# broken ls alias from the environment.  This has actually
120923169be4bSmrg	# happened.  Such a system could not be considered "sane".
120933169be4bSmrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
120943169be4bSmrg  alias in your environment])
120953169be4bSmrg     fi
120963169be4bSmrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
120973169be4bSmrg       break
120983169be4bSmrg     fi
120993169be4bSmrg     # Just in case.
121003169be4bSmrg     sleep 1
121013169be4bSmrg     am_has_slept=yes
121023169be4bSmrg   done
121033169be4bSmrg   test "$[2]" = conftest.file
121043169be4bSmrg   )
121053169be4bSmrgthen
121063169be4bSmrg   # Ok.
121073169be4bSmrg   :
12108b242714cSmrgelse
121093169be4bSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
121103169be4bSmrgCheck your system clock])
12111b242714cSmrgfi
121123169be4bSmrgAC_MSG_RESULT([yes])
121133169be4bSmrg# If we didn't sleep, we still need to ensure time stamps of config.status and
121143169be4bSmrg# generated files are strictly newer.
121153169be4bSmrgam_sleep_pid=
121163169be4bSmrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
121173169be4bSmrg  ( sleep 1 ) &
121183169be4bSmrg  am_sleep_pid=$!
121193169be4bSmrgfi
121203169be4bSmrgAC_CONFIG_COMMANDS_PRE(
121213169be4bSmrg  [AC_MSG_CHECKING([that generated files are newer than configure])
121223169be4bSmrg   if test -n "$am_sleep_pid"; then
121233169be4bSmrg     # Hide warnings about reused PIDs.
121243169be4bSmrg     wait $am_sleep_pid 2>/dev/null
121253169be4bSmrg   fi
121263169be4bSmrg   AC_MSG_RESULT([done])])
121273169be4bSmrgrm -f conftest.file
121283169be4bSmrg])
121298c4a8e55Smrg
121303169be4bSmrg# Copyright (C) 2009-2014 Free Software Foundation, Inc.
121318bd17e5fSmrg#
121323169be4bSmrg# This file is free software; the Free Software Foundation
121333169be4bSmrg# gives unlimited permission to copy and/or distribute it,
121343169be4bSmrg# with or without modifications, as long as this notice is preserved.
12135fc98c8e2Smrg
121363169be4bSmrg# AM_SILENT_RULES([DEFAULT])
121373169be4bSmrg# --------------------------
121383169be4bSmrg# Enable less verbose build rules; with the default set to DEFAULT
121393169be4bSmrg# ("yes" being less verbose, "no" or empty being verbose).
121403169be4bSmrgAC_DEFUN([AM_SILENT_RULES],
121413169be4bSmrg[AC_ARG_ENABLE([silent-rules], [dnl
121423169be4bSmrgAS_HELP_STRING(
121433169be4bSmrg  [--enable-silent-rules],
121443169be4bSmrg  [less verbose build output (undo: "make V=1")])
121453169be4bSmrgAS_HELP_STRING(
121463169be4bSmrg  [--disable-silent-rules],
121473169be4bSmrg  [verbose build output (undo: "make V=0")])dnl
121483169be4bSmrg])
121493169be4bSmrgcase $enable_silent_rules in @%:@ (((
121503169be4bSmrg  yes) AM_DEFAULT_VERBOSITY=0;;
121513169be4bSmrg   no) AM_DEFAULT_VERBOSITY=1;;
121523169be4bSmrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
121533169be4bSmrgesac
121543169be4bSmrgdnl
121553169be4bSmrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
121563169be4bSmrgdnl do not support nested variable expansions.
121573169be4bSmrgdnl See automake bug#9928 and bug#10237.
121583169be4bSmrgam_make=${MAKE-make}
121593169be4bSmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
121603169be4bSmrg   [am_cv_make_support_nested_variables],
121613169be4bSmrg   [if AS_ECHO([['TRUE=$(BAR$(V))
121623169be4bSmrgBAR0=false
121633169be4bSmrgBAR1=true
121643169be4bSmrgV=1
121653169be4bSmrgam__doit:
121663169be4bSmrg	@$(TRUE)
121673169be4bSmrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
121683169be4bSmrg  am_cv_make_support_nested_variables=yes
121693169be4bSmrgelse
121703169be4bSmrg  am_cv_make_support_nested_variables=no
121713169be4bSmrgfi])
121723169be4bSmrgif test $am_cv_make_support_nested_variables = yes; then
121733169be4bSmrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
121743169be4bSmrg  AM_V='$(V)'
121753169be4bSmrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
121763169be4bSmrgelse
121773169be4bSmrg  AM_V=$AM_DEFAULT_VERBOSITY
121783169be4bSmrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
121793169be4bSmrgfi
121803169be4bSmrgAC_SUBST([AM_V])dnl
121813169be4bSmrgAM_SUBST_NOTMAKE([AM_V])dnl
121823169be4bSmrgAC_SUBST([AM_DEFAULT_V])dnl
121833169be4bSmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
121843169be4bSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
121853169be4bSmrgAM_BACKSLASH='\'
121863169be4bSmrgAC_SUBST([AM_BACKSLASH])dnl
121873169be4bSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
121883169be4bSmrg])
121893169be4bSmrg
121903169be4bSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
12191b242714cSmrg#
121923169be4bSmrg# This file is free software; the Free Software Foundation
121933169be4bSmrg# gives unlimited permission to copy and/or distribute it,
121943169be4bSmrg# with or without modifications, as long as this notice is preserved.
121953169be4bSmrg
121963169be4bSmrg# AM_PROG_INSTALL_STRIP
121973169be4bSmrg# ---------------------
121983169be4bSmrg# One issue with vendor 'install' (even GNU) is that you can't
121993169be4bSmrg# specify the program used to strip binaries.  This is especially
122003169be4bSmrg# annoying in cross-compiling environments, where the build's strip
122013169be4bSmrg# is unlikely to handle the host's binaries.
122023169be4bSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
122033169be4bSmrg# always use install-sh in "make install-strip", and initialize
122043169be4bSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
122053169be4bSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
122063169be4bSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
122073169be4bSmrg# Installed binaries are usually stripped using 'strip' when the user
122083169be4bSmrg# run "make install-strip".  However 'strip' might not be the right
122093169be4bSmrg# tool to use in cross-compilation environments, therefore Automake
122103169be4bSmrg# will honor the 'STRIP' environment variable to overrule this program.
122113169be4bSmrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
122123169be4bSmrgif test "$cross_compiling" != no; then
122133169be4bSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
122143169be4bSmrgfi
122153169be4bSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
122163169be4bSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
122170597fb56Smrg
122183169be4bSmrg# Copyright (C) 2006-2014 Free Software Foundation, Inc.
122193169be4bSmrg#
122203169be4bSmrg# This file is free software; the Free Software Foundation
122213169be4bSmrg# gives unlimited permission to copy and/or distribute it,
122223169be4bSmrg# with or without modifications, as long as this notice is preserved.
1222367594505Smrg
122243169be4bSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
122253169be4bSmrg# ---------------------------
122263169be4bSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
122273169be4bSmrg# This macro is traced by Automake.
122283169be4bSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
1222967594505Smrg
122303169be4bSmrg# AM_SUBST_NOTMAKE(VARIABLE)
122313169be4bSmrg# --------------------------
122323169be4bSmrg# Public sister of _AM_SUBST_NOTMAKE.
122333169be4bSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1223467594505Smrg
122353169be4bSmrg# Check how to create a tarball.                            -*- Autoconf -*-
1223667594505Smrg
122373169be4bSmrg# Copyright (C) 2004-2014 Free Software Foundation, Inc.
122383169be4bSmrg#
122393169be4bSmrg# This file is free software; the Free Software Foundation
122403169be4bSmrg# gives unlimited permission to copy and/or distribute it,
122413169be4bSmrg# with or without modifications, as long as this notice is preserved.
1224267594505Smrg
122433169be4bSmrg# _AM_PROG_TAR(FORMAT)
12244b242714cSmrg# --------------------
122453169be4bSmrg# Check how to create a tarball in format FORMAT.
122463169be4bSmrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
12247b242714cSmrg#
122483169be4bSmrg# Substitute a variable $(am__tar) that is a command
122493169be4bSmrg# writing to stdout a FORMAT-tarball containing the directory
122503169be4bSmrg# $tardir.
122513169be4bSmrg#     tardir=directory && $(am__tar) > result.tar
12252b242714cSmrg#
122533169be4bSmrg# Substitute a variable $(am__untar) that extract such
122543169be4bSmrg# a tarball read from stdin.
122553169be4bSmrg#     $(am__untar) < result.tar
12256b242714cSmrg#
122573169be4bSmrgAC_DEFUN([_AM_PROG_TAR],
122583169be4bSmrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
122593169be4bSmrg# in the wild :-(  We should find a proper way to deprecate it ...
122603169be4bSmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
1226167594505Smrg
122623169be4bSmrg# We'll loop over all known methods to create a tar archive until one works.
122633169be4bSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1226467594505Smrg
122653169be4bSmrgm4_if([$1], [v7],
122663169be4bSmrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
1226767594505Smrg
122683169be4bSmrg  [m4_case([$1],
122693169be4bSmrg    [ustar],
122703169be4bSmrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
122713169be4bSmrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
122723169be4bSmrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
122733169be4bSmrg      # and bug#13588).
122743169be4bSmrg      am_max_uid=2097151 # 2^21 - 1
122753169be4bSmrg      am_max_gid=$am_max_uid
122763169be4bSmrg      # The $UID and $GID variables are not portable, so we need to resort
122773169be4bSmrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
122783169be4bSmrg      # below are definitely unexpected, so allow the users to see them
122793169be4bSmrg      # (that is, avoid stderr redirection).
122803169be4bSmrg      am_uid=`id -u || echo unknown`
122813169be4bSmrg      am_gid=`id -g || echo unknown`
122823169be4bSmrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
122833169be4bSmrg      if test $am_uid -le $am_max_uid; then
122843169be4bSmrg         AC_MSG_RESULT([yes])
122853169be4bSmrg      else
122863169be4bSmrg         AC_MSG_RESULT([no])
122873169be4bSmrg         _am_tools=none
122883169be4bSmrg      fi
122893169be4bSmrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
122903169be4bSmrg      if test $am_gid -le $am_max_gid; then
122913169be4bSmrg         AC_MSG_RESULT([yes])
122923169be4bSmrg      else
122933169be4bSmrg        AC_MSG_RESULT([no])
122943169be4bSmrg        _am_tools=none
122953169be4bSmrg      fi],
122963169be4bSmrg
122973169be4bSmrg  [pax],
122983169be4bSmrg    [],
122993169be4bSmrg
123003169be4bSmrg  [m4_fatal([Unknown tar format])])
123013169be4bSmrg
123023169be4bSmrg  AC_MSG_CHECKING([how to create a $1 tar archive])
123033169be4bSmrg
123043169be4bSmrg  # Go ahead even if we have the value already cached.  We do so because we
123053169be4bSmrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
123063169be4bSmrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
123073169be4bSmrg
123083169be4bSmrg  for _am_tool in $_am_tools; do
123093169be4bSmrg    case $_am_tool in
123103169be4bSmrg    gnutar)
123113169be4bSmrg      for _am_tar in tar gnutar gtar; do
123123169be4bSmrg        AM_RUN_LOG([$_am_tar --version]) && break
123133169be4bSmrg      done
123143169be4bSmrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
123153169be4bSmrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
123163169be4bSmrg      am__untar="$_am_tar -xf -"
123173169be4bSmrg      ;;
123183169be4bSmrg    plaintar)
123193169be4bSmrg      # Must skip GNU tar: if it does not support --format= it doesn't create
123203169be4bSmrg      # ustar tarball either.
123213169be4bSmrg      (tar --version) >/dev/null 2>&1 && continue
123223169be4bSmrg      am__tar='tar chf - "$$tardir"'
123233169be4bSmrg      am__tar_='tar chf - "$tardir"'
123243169be4bSmrg      am__untar='tar xf -'
123253169be4bSmrg      ;;
123263169be4bSmrg    pax)
123273169be4bSmrg      am__tar='pax -L -x $1 -w "$$tardir"'
123283169be4bSmrg      am__tar_='pax -L -x $1 -w "$tardir"'
123293169be4bSmrg      am__untar='pax -r'
123303169be4bSmrg      ;;
123313169be4bSmrg    cpio)
123323169be4bSmrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
123333169be4bSmrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
123343169be4bSmrg      am__untar='cpio -i -H $1 -d'
123353169be4bSmrg      ;;
123363169be4bSmrg    none)
123373169be4bSmrg      am__tar=false
123383169be4bSmrg      am__tar_=false
123393169be4bSmrg      am__untar=false
123403169be4bSmrg      ;;
123413169be4bSmrg    esac
123423169be4bSmrg
123433169be4bSmrg    # If the value was cached, stop now.  We just wanted to have am__tar
123443169be4bSmrg    # and am__untar set.
123453169be4bSmrg    test -n "${am_cv_prog_tar_$1}" && break
123463169be4bSmrg
123473169be4bSmrg    # tar/untar a dummy directory, and stop if the command works.
123483169be4bSmrg    rm -rf conftest.dir
123493169be4bSmrg    mkdir conftest.dir
123503169be4bSmrg    echo GrepMe > conftest.dir/file
123513169be4bSmrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
123523169be4bSmrg    rm -rf conftest.dir
123533169be4bSmrg    if test -s conftest.tar; then
123543169be4bSmrg      AM_RUN_LOG([$am__untar <conftest.tar])
123553169be4bSmrg      AM_RUN_LOG([cat conftest.dir/file])
123563169be4bSmrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
123573169be4bSmrg    fi
123583169be4bSmrg  done
123593169be4bSmrg  rm -rf conftest.dir
123603169be4bSmrg
123613169be4bSmrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
123623169be4bSmrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
123633169be4bSmrg
123643169be4bSmrgAC_SUBST([am__tar])
123653169be4bSmrgAC_SUBST([am__untar])
123663169be4bSmrg]) # _AM_PROG_TAR
12367b042e37fSmrg
12368