aclocal.m4 revision f395c03e
1f395c03eSmrg# generated automatically by aclocal 1.15 -*- Autoconf -*-
2df9ffc95Smrg
3f395c03eSmrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
409885543Smrg
509885543Smrg# This file is free software; the Free Software Foundation
609885543Smrg# gives unlimited permission to copy and/or distribute it,
709885543Smrg# with or without modifications, as long as this notice is preserved.
809885543Smrg
909885543Smrg# This program is distributed in the hope that it will be useful,
1009885543Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1109885543Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1209885543Smrg# PARTICULAR PURPOSE.
1309885543Smrg
14df9ffc95Smrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
157104f784Smrgm4_ifndef([AC_AUTOCONF_VERSION],
167104f784Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17df9ffc95Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
18df9ffc95Smrg[m4_warning([this file was generated for autoconf 2.69.
197104f784SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
207104f784SmrgIf you have problems, you may need to regenerate the build system entirely.
21df9ffc95SmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
227104f784Smrg
237b58d2e0Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
24e4f6584cSmrg#
25f395c03eSmrg#   Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
267b58d2e0Smrg#   Written by Gordon Matzigkeit, 1996
27e4f6584cSmrg#
287b58d2e0Smrg# This file is free software; the Free Software Foundation gives
297b58d2e0Smrg# unlimited permission to copy and/or distribute it, with or without
307b58d2e0Smrg# modifications, as long as this notice is preserved.
312ec8c4b4Smrg
327b58d2e0Smrgm4_define([_LT_COPYING], [dnl
33f395c03eSmrg# Copyright (C) 2014 Free Software Foundation, Inc.
34f395c03eSmrg# This is free software; see the source for copying conditions.  There is NO
35f395c03eSmrg# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
36f395c03eSmrg
37f395c03eSmrg# GNU Libtool is free software; you can redistribute it and/or modify
38f395c03eSmrg# it under the terms of the GNU General Public License as published by
39f395c03eSmrg# the Free Software Foundation; either version 2 of of the License, or
40f395c03eSmrg# (at your option) any later version.
41e4f6584cSmrg#
42f395c03eSmrg# As a special exception to the GNU General Public License, if you
43f395c03eSmrg# distribute this file as part of a program or library that is built
44f395c03eSmrg# using GNU Libtool, you may include this file under the  same
45f395c03eSmrg# distribution terms that you use for the rest of that program.
46e4f6584cSmrg#
47f395c03eSmrg# GNU Libtool is distributed in the hope that it will be useful, but
48f395c03eSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
497b58d2e0Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
507b58d2e0Smrg# GNU General Public License for more details.
51e4f6584cSmrg#
527b58d2e0Smrg# You should have received a copy of the GNU General Public License
53f395c03eSmrg# along with this program.  If not, see <http://www.gnu.org/licenses/>.
54e4f6584cSmrg])
55b698ba48Smrg
56f395c03eSmrg# serial 58 LT_INIT
572ec8c4b4Smrg
5809885543Smrg
597b58d2e0Smrg# LT_PREREQ(VERSION)
607b58d2e0Smrg# ------------------
617b58d2e0Smrg# Complain and exit if this libtool version is less that VERSION.
627b58d2e0Smrgm4_defun([LT_PREREQ],
637b58d2e0Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
647b58d2e0Smrg       [m4_default([$3],
657b58d2e0Smrg		   [m4_fatal([Libtool version $1 or higher is required],
667b58d2e0Smrg		             63)])],
677b58d2e0Smrg       [$2])])
6809885543Smrg
6909885543Smrg
707b58d2e0Smrg# _LT_CHECK_BUILDDIR
717b58d2e0Smrg# ------------------
727b58d2e0Smrg# Complain if the absolute build directory name contains unusual characters
737b58d2e0Smrgm4_defun([_LT_CHECK_BUILDDIR],
747b58d2e0Smrg[case `pwd` in
757b58d2e0Smrg  *\ * | *\	*)
767b58d2e0Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
777b58d2e0Smrgesac
787b58d2e0Smrg])
7909885543Smrg
8009885543Smrg
817b58d2e0Smrg# LT_INIT([OPTIONS])
827b58d2e0Smrg# ------------------
837b58d2e0SmrgAC_DEFUN([LT_INIT],
84f395c03eSmrg[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
85b12e5c03SmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
867b58d2e0SmrgAC_BEFORE([$0], [LT_LANG])dnl
877b58d2e0SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
887b58d2e0SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
897b58d2e0Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
9009885543Smrg
917b58d2e0Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
927b58d2e0Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
937b58d2e0Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
947b58d2e0Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
957b58d2e0Smrgdnl unless we require an AC_DEFUNed macro:
967b58d2e0SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
977b58d2e0SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
987b58d2e0SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
997b58d2e0SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
1007b58d2e0Smrgm4_require([_LT_PROG_LTMAIN])dnl
101b698ba48Smrg
102b12e5c03Smrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
103b12e5c03Smrg
1047b58d2e0Smrgdnl Parse OPTIONS
1057b58d2e0Smrg_LT_SET_OPTIONS([$0], [$1])
10609885543Smrg
1077b58d2e0Smrg# This can be used to rebuild libtool when needed
108f395c03eSmrgLIBTOOL_DEPS=$ltmain
10909885543Smrg
1107b58d2e0Smrg# Always use our own libtool.
1117b58d2e0SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
1127b58d2e0SmrgAC_SUBST(LIBTOOL)dnl
113b698ba48Smrg
1147b58d2e0Smrg_LT_SETUP
11509885543Smrg
1167b58d2e0Smrg# Only expand once:
1177b58d2e0Smrgm4_define([LT_INIT])
1187b58d2e0Smrg])# LT_INIT
11909885543Smrg
1207b58d2e0Smrg# Old names:
1217b58d2e0SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
1227b58d2e0SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
1237b58d2e0Smrgdnl aclocal-1.4 backwards compatibility:
1247b58d2e0Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
1257b58d2e0Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
126b698ba48Smrg
1277b58d2e0Smrg
128f395c03eSmrg# _LT_PREPARE_CC_BASENAME
129f395c03eSmrg# -----------------------
130f395c03eSmrgm4_defun([_LT_PREPARE_CC_BASENAME], [
131f395c03eSmrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
132f395c03eSmrgfunc_cc_basename ()
133f395c03eSmrg{
134f395c03eSmrg    for cc_temp in @S|@*""; do
135f395c03eSmrg      case $cc_temp in
136f395c03eSmrg        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
137f395c03eSmrg        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
138f395c03eSmrg        \-*) ;;
139f395c03eSmrg        *) break;;
140f395c03eSmrg      esac
141f395c03eSmrg    done
142f395c03eSmrg    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
143f395c03eSmrg}
144f395c03eSmrg])# _LT_PREPARE_CC_BASENAME
145f395c03eSmrg
146f395c03eSmrg
1477b58d2e0Smrg# _LT_CC_BASENAME(CC)
1487b58d2e0Smrg# -------------------
149f395c03eSmrg# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
150f395c03eSmrg# but that macro is also expanded into generated libtool script, which
151f395c03eSmrg# arranges for $SED and $ECHO to be set by different means.
1527b58d2e0Smrgm4_defun([_LT_CC_BASENAME],
153f395c03eSmrg[m4_require([_LT_PREPARE_CC_BASENAME])dnl
154f395c03eSmrgAC_REQUIRE([_LT_DECL_SED])dnl
155f395c03eSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
156f395c03eSmrgfunc_cc_basename $1
157f395c03eSmrgcc_basename=$func_cc_basename_result
158e4f6584cSmrg])
159b698ba48Smrg
16009885543Smrg
1617b58d2e0Smrg# _LT_FILEUTILS_DEFAULTS
1627b58d2e0Smrg# ----------------------
1637b58d2e0Smrg# It is okay to use these file commands and assume they have been set
164f395c03eSmrg# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
1657b58d2e0Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
1667b58d2e0Smrg[: ${CP="cp -f"}
1677b58d2e0Smrg: ${MV="mv -f"}
1687b58d2e0Smrg: ${RM="rm -f"}
1697b58d2e0Smrg])# _LT_FILEUTILS_DEFAULTS
1707104f784Smrg
1712ec8c4b4Smrg
1727b58d2e0Smrg# _LT_SETUP
1737b58d2e0Smrg# ---------
1747b58d2e0Smrgm4_defun([_LT_SETUP],
1757b58d2e0Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1767b58d2e0SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
177b12e5c03SmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
178b12e5c03SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
179b12e5c03Smrg
180b12e5c03Smrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
181b12e5c03Smrgdnl
1827b58d2e0Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
1837b58d2e0Smrg_LT_DECL([], [host], [0])dnl
1847b58d2e0Smrg_LT_DECL([], [host_os], [0])dnl
1857b58d2e0Smrgdnl
1867b58d2e0Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
1877b58d2e0Smrg_LT_DECL([], [build], [0])dnl
1887b58d2e0Smrg_LT_DECL([], [build_os], [0])dnl
1897b58d2e0Smrgdnl
1907b58d2e0SmrgAC_REQUIRE([AC_PROG_CC])dnl
1917b58d2e0SmrgAC_REQUIRE([LT_PATH_LD])dnl
1927b58d2e0SmrgAC_REQUIRE([LT_PATH_NM])dnl
1937b58d2e0Smrgdnl
1947b58d2e0SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
1957b58d2e0Smrgtest -z "$LN_S" && LN_S="ln -s"
1967b58d2e0Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
1977b58d2e0Smrgdnl
1987b58d2e0SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
1997b58d2e0Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
2007b58d2e0Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
2017b58d2e0Smrgdnl
2027b58d2e0Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2037b58d2e0Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
204b12e5c03Smrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
2057b58d2e0Smrgm4_require([_LT_CMD_RELOAD])dnl
2067b58d2e0Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
207b12e5c03Smrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
2087b58d2e0Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
2097b58d2e0Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
210b12e5c03Smrgm4_require([_LT_WITH_SYSROOT])dnl
211f395c03eSmrgm4_require([_LT_CMD_TRUNCATE])dnl
2127b58d2e0Smrg
2137b58d2e0Smrg_LT_CONFIG_LIBTOOL_INIT([
214f395c03eSmrg# See if we are running on zsh, and set the options that allow our
2157b58d2e0Smrg# commands through without removal of \ escapes INIT.
216f395c03eSmrgif test -n "\${ZSH_VERSION+set}"; then
2177b58d2e0Smrg   setopt NO_GLOB_SUBST
218e4f6584cSmrgfi
219e4f6584cSmrg])
220f395c03eSmrgif test -n "${ZSH_VERSION+set}"; then
2217b58d2e0Smrg   setopt NO_GLOB_SUBST
2227b58d2e0Smrgfi
2232ec8c4b4Smrg
2247b58d2e0Smrg_LT_CHECK_OBJDIR
2252ec8c4b4Smrg
2267b58d2e0Smrgm4_require([_LT_TAG_COMPILER])dnl
2272ec8c4b4Smrg
2287b58d2e0Smrgcase $host_os in
2297b58d2e0Smrgaix3*)
2307b58d2e0Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
2317b58d2e0Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
2327b58d2e0Smrg  # vanish in a puff of smoke.
233f395c03eSmrg  if test set != "${COLLECT_NAMES+set}"; then
2347b58d2e0Smrg    COLLECT_NAMES=
2357b58d2e0Smrg    export COLLECT_NAMES
2367b58d2e0Smrg  fi
2377b58d2e0Smrg  ;;
2387b58d2e0Smrgesac
23909885543Smrg
2407b58d2e0Smrg# Global variables:
2417b58d2e0Smrgofile=libtool
2427b58d2e0Smrgcan_build_shared=yes
24309885543Smrg
244f395c03eSmrg# All known linkers require a '.a' archive for static linking (except MSVC,
2457b58d2e0Smrg# which needs '.lib').
2467b58d2e0Smrglibext=a
24709885543Smrg
248f395c03eSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
24909885543Smrg
250f395c03eSmrgold_CC=$CC
251f395c03eSmrgold_CFLAGS=$CFLAGS
25209885543Smrg
2537b58d2e0Smrg# Set sane defaults for various variables
2547b58d2e0Smrgtest -z "$CC" && CC=cc
2557b58d2e0Smrgtest -z "$LTCC" && LTCC=$CC
2567b58d2e0Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
2577b58d2e0Smrgtest -z "$LD" && LD=ld
2587b58d2e0Smrgtest -z "$ac_objext" && ac_objext=o
2597104f784Smrg
2607b58d2e0Smrg_LT_CC_BASENAME([$compiler])
26109885543Smrg
2627b58d2e0Smrg# Only perform the check for file, if the check method requires it
2637b58d2e0Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
2647b58d2e0Smrgcase $deplibs_check_method in
2657b58d2e0Smrgfile_magic*)
2667b58d2e0Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
2677b58d2e0Smrg    _LT_PATH_MAGIC
268e4f6584cSmrg  fi
2697b58d2e0Smrg  ;;
2707b58d2e0Smrgesac
27109885543Smrg
2727b58d2e0Smrg# Use C for the default configuration in the libtool script
2737b58d2e0SmrgLT_SUPPORTED_TAG([CC])
2747b58d2e0Smrg_LT_LANG_C_CONFIG
2757b58d2e0Smrg_LT_LANG_DEFAULT_CONFIG
2767b58d2e0Smrg_LT_CONFIG_COMMANDS
2777b58d2e0Smrg])# _LT_SETUP
27809885543Smrg
27909885543Smrg
280b12e5c03Smrg# _LT_PREPARE_SED_QUOTE_VARS
281b12e5c03Smrg# --------------------------
282b12e5c03Smrg# Define a few sed substitution that help us do robust quoting.
283b12e5c03Smrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
284b12e5c03Smrg[# Backslashify metacharacters that are still active within
285b12e5c03Smrg# double-quoted strings.
286b12e5c03Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
287b12e5c03Smrg
288b12e5c03Smrg# Same as above, but do not quote variable references.
289b12e5c03Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
290b12e5c03Smrg
291b12e5c03Smrg# Sed substitution to delay expansion of an escaped shell variable in a
292b12e5c03Smrg# double_quote_subst'ed string.
293b12e5c03Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
294b12e5c03Smrg
295b12e5c03Smrg# Sed substitution to delay expansion of an escaped single quote.
296b12e5c03Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
297b12e5c03Smrg
298b12e5c03Smrg# Sed substitution to avoid accidental globbing in evaled expressions
299b12e5c03Smrgno_glob_subst='s/\*/\\\*/g'
300b12e5c03Smrg])
301b12e5c03Smrg
3027b58d2e0Smrg# _LT_PROG_LTMAIN
3037b58d2e0Smrg# ---------------
304f395c03eSmrg# Note that this code is called both from 'configure', and 'config.status'
3057b58d2e0Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
306f395c03eSmrg# 'config.status' has no value for ac_aux_dir unless we are using Automake,
3077b58d2e0Smrg# so we pass a copy along to make sure it has a sensible value anyway.
3087b58d2e0Smrgm4_defun([_LT_PROG_LTMAIN],
3097b58d2e0Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
3107b58d2e0Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
311f395c03eSmrgltmain=$ac_aux_dir/ltmain.sh
3127b58d2e0Smrg])# _LT_PROG_LTMAIN
31309885543Smrg
31409885543Smrg
31509885543Smrg
3167b58d2e0Smrg# So that we can recreate a full libtool script including additional
3177b58d2e0Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
318f395c03eSmrg# in macros and then make a single call at the end using the 'libtool'
3197b58d2e0Smrg# label.
32009885543Smrg
32109885543Smrg
3227b58d2e0Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
3237b58d2e0Smrg# ----------------------------------------
3247b58d2e0Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
3257b58d2e0Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
3267b58d2e0Smrg[m4_ifval([$1],
3277b58d2e0Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
3287b58d2e0Smrg                     [$1
3297b58d2e0Smrg])])])
33009885543Smrg
3317b58d2e0Smrg# Initialize.
3327b58d2e0Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
33309885543Smrg
33409885543Smrg
3357b58d2e0Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
3367b58d2e0Smrg# ------------------------------
3377b58d2e0Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
3387b58d2e0Smrgm4_define([_LT_CONFIG_LIBTOOL],
3397b58d2e0Smrg[m4_ifval([$1],
3407b58d2e0Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
3417b58d2e0Smrg                     [$1
3427b58d2e0Smrg])])])
34309885543Smrg
3447b58d2e0Smrg# Initialize.
3457b58d2e0Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
34609885543Smrg
34709885543Smrg
3487b58d2e0Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
3497b58d2e0Smrg# -----------------------------------------------------
3507b58d2e0Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
3517b58d2e0Smrg[_LT_CONFIG_LIBTOOL([$1])
3527b58d2e0Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
3537b58d2e0Smrg])
35409885543Smrg
35509885543Smrg
3567b58d2e0Smrg# _LT_FORMAT_COMMENT([COMMENT])
3577b58d2e0Smrg# -----------------------------
3587b58d2e0Smrg# Add leading comment marks to the start of each line, and a trailing
3597b58d2e0Smrg# full-stop to the whole comment if one is not present already.
3607b58d2e0Smrgm4_define([_LT_FORMAT_COMMENT],
3617b58d2e0Smrg[m4_ifval([$1], [
3627b58d2e0Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
3637b58d2e0Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
3647b58d2e0Smrg)])
36509885543Smrg
36609885543Smrg
36709885543Smrg
36809885543Smrg
369b698ba48Smrg
3707b58d2e0Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
3717b58d2e0Smrg# -------------------------------------------------------------------
3727b58d2e0Smrg# CONFIGNAME is the name given to the value in the libtool script.
3737b58d2e0Smrg# VARNAME is the (base) name used in the configure script.
3747b58d2e0Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
3757b58d2e0Smrg# VARNAME.  Any other value will be used directly.
3767b58d2e0Smrgm4_define([_LT_DECL],
3777b58d2e0Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
3787b58d2e0Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
3797b58d2e0Smrg	[m4_ifval([$1], [$1], [$2])])
3807b58d2e0Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
3817b58d2e0Smrg    m4_ifval([$4],
3827b58d2e0Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
3837b58d2e0Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
3847b58d2e0Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
385e4f6584cSmrg])
38609885543Smrg
387e4f6584cSmrg
3887b58d2e0Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
3897b58d2e0Smrg# --------------------------------------------------------
3907b58d2e0Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
3912ec8c4b4Smrg
39209885543Smrg
3937b58d2e0Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
3947b58d2e0Smrg# ------------------------------------------------
3957b58d2e0Smrgm4_define([lt_decl_tag_varnames],
3967b58d2e0Smrg[_lt_decl_filter([tagged?], [yes], $@)])
39709885543Smrg
39809885543Smrg
3997b58d2e0Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
4007b58d2e0Smrg# ---------------------------------------------------------
4017b58d2e0Smrgm4_define([_lt_decl_filter],
4027b58d2e0Smrg[m4_case([$#],
4037b58d2e0Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
4047b58d2e0Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
4057b58d2e0Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
4067b58d2e0Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
4077b58d2e0Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
408e4f6584cSmrg])
40909885543Smrg
4102ec8c4b4Smrg
4117b58d2e0Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
4127b58d2e0Smrg# --------------------------------------------------
4137b58d2e0Smrgm4_define([lt_decl_quote_varnames],
4147b58d2e0Smrg[_lt_decl_filter([value], [1], $@)])
41509885543Smrg
41609885543Smrg
4177b58d2e0Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
4187b58d2e0Smrg# ---------------------------------------------------
4197b58d2e0Smrgm4_define([lt_decl_dquote_varnames],
4207b58d2e0Smrg[_lt_decl_filter([value], [2], $@)])
42109885543Smrg
42209885543Smrg
4237b58d2e0Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
4247b58d2e0Smrg# ---------------------------------------------------
4257b58d2e0Smrgm4_define([lt_decl_varnames_tagged],
4267b58d2e0Smrg[m4_assert([$# <= 2])dnl
4277b58d2e0Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
4287b58d2e0Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
4297b58d2e0Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
4307b58d2e0Smrgm4_define([_lt_decl_varnames_tagged],
4317b58d2e0Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
43209885543Smrg
43309885543Smrg
4347b58d2e0Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
4357b58d2e0Smrg# ------------------------------------------------
4367b58d2e0Smrgm4_define([lt_decl_all_varnames],
4377b58d2e0Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
4387b58d2e0Smrg     m4_if([$2], [],
4397b58d2e0Smrg	   m4_quote(lt_decl_varnames),
4407b58d2e0Smrg	m4_quote(m4_shift($@))))[]dnl
4417b58d2e0Smrg])
4427b58d2e0Smrgm4_define([_lt_decl_all_varnames],
4437b58d2e0Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
4447b58d2e0Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
4457b58d2e0Smrg])
44609885543Smrg
44709885543Smrg
4487b58d2e0Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
4497b58d2e0Smrg# ------------------------------------
450f395c03eSmrg# Quote a variable value, and forward it to 'config.status' so that its
451f395c03eSmrg# declaration there will have the same value as in 'configure'.  VARNAME
4527b58d2e0Smrg# must have a single quote delimited value for this to work.
4537b58d2e0Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
454b12e5c03Smrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
45509885543Smrg
4567b58d2e0Smrg
4577b58d2e0Smrg# _LT_CONFIG_STATUS_DECLARATIONS
4587b58d2e0Smrg# ------------------------------
4597b58d2e0Smrg# We delimit libtool config variables with single quotes, so when
4607b58d2e0Smrg# we write them to config.status, we have to be sure to quote all
4617b58d2e0Smrg# embedded single quotes properly.  In configure, this macro expands
4627b58d2e0Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
463e4f6584cSmrg#
464b12e5c03Smrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
4657b58d2e0Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
4667b58d2e0Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
4677b58d2e0Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
46809885543Smrg
46909885543Smrg
4707b58d2e0Smrg# _LT_LIBTOOL_TAGS
4717b58d2e0Smrg# ----------------
4727b58d2e0Smrg# Output comment and list of tags supported by the script
4737b58d2e0Smrgm4_defun([_LT_LIBTOOL_TAGS],
4747b58d2e0Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
475f395c03eSmrgavailable_tags='_LT_TAGS'dnl
4767b58d2e0Smrg])
47709885543Smrg
47809885543Smrg
4797b58d2e0Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
4807b58d2e0Smrg# -----------------------------------
4817b58d2e0Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
4827b58d2e0Smrg# expand to a commented shell variable setting:
483e4f6584cSmrg#
4847b58d2e0Smrg#    # Some comment about what VAR is for.
4857b58d2e0Smrg#    visible_name=$lt_internal_name
4867b58d2e0Smrgm4_define([_LT_LIBTOOL_DECLARE],
4877b58d2e0Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
4887b58d2e0Smrg					   [description])))[]dnl
4897b58d2e0Smrgm4_pushdef([_libtool_name],
4907b58d2e0Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
4917b58d2e0Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
4927b58d2e0Smrg    [0], [_libtool_name=[$]$1],
4937b58d2e0Smrg    [1], [_libtool_name=$lt_[]$1],
4947b58d2e0Smrg    [2], [_libtool_name=$lt_[]$1],
4957b58d2e0Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
4967b58d2e0Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
497e4f6584cSmrg])
49809885543Smrg
49909885543Smrg
5007b58d2e0Smrg# _LT_LIBTOOL_CONFIG_VARS
5017b58d2e0Smrg# -----------------------
5027b58d2e0Smrg# Produce commented declarations of non-tagged libtool config variables
503f395c03eSmrg# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
5047b58d2e0Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
5057b58d2e0Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
5067b58d2e0Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
5077b58d2e0Smrg[m4_foreach([_lt_var],
5087b58d2e0Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
5097b58d2e0Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
51009885543Smrg
51109885543Smrg
5127b58d2e0Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
5137b58d2e0Smrg# -------------------------
5147b58d2e0Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
5157b58d2e0Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
5167b58d2e0Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
51709885543Smrg
51809885543Smrg
5197b58d2e0Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
5207b58d2e0Smrg# ------------------------------
5217b58d2e0Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
52209885543Smrg
52309885543Smrg
5247b58d2e0Smrg# _LT_CONFIG_COMMANDS
5257b58d2e0Smrg# -------------------
5267b58d2e0Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
5277b58d2e0Smrg# variables for single and double quote escaping we saved from calls
5287b58d2e0Smrg# to _LT_DECL, we can put quote escaped variables declarations
529f395c03eSmrg# into 'config.status', and then the shell code to quote escape them in
530f395c03eSmrg# for loops in 'config.status'.  Finally, any additional code accumulated
5317b58d2e0Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
5327b58d2e0Smrgm4_defun([_LT_CONFIG_COMMANDS],
5337b58d2e0Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
5347b58d2e0Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
5357b58d2e0Smrg	dnl instead of duplicating it all over again into config.status,
5367b58d2e0Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
5377b58d2e0Smrg	dnl needs to know what name is stored there:
5387b58d2e0Smrg        [AC_CONFIG_COMMANDS([libtool],
5397b58d2e0Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
5407b58d2e0Smrg    dnl If the libtool generation code is destined for config.status,
5417b58d2e0Smrg    dnl expand the accumulated commands and init code now:
5427b58d2e0Smrg    [AC_CONFIG_COMMANDS([libtool],
5437b58d2e0Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
5447b58d2e0Smrg])#_LT_CONFIG_COMMANDS
54509885543Smrg
546e4f6584cSmrg
5477b58d2e0Smrg# Initialize.
5487b58d2e0Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
5497b58d2e0Smrg[
55009885543Smrg
5517b58d2e0Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
5527b58d2e0Smrg# if CDPATH is set.
5537b58d2e0Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
554e4f6584cSmrg
5557b58d2e0Smrgsed_quote_subst='$sed_quote_subst'
5567b58d2e0Smrgdouble_quote_subst='$double_quote_subst'
5577b58d2e0Smrgdelay_variable_subst='$delay_variable_subst'
5587b58d2e0Smrg_LT_CONFIG_STATUS_DECLARATIONS
5597b58d2e0SmrgLTCC='$LTCC'
5607b58d2e0SmrgLTCFLAGS='$LTCFLAGS'
5617b58d2e0Smrgcompiler='$compiler_DEFAULT'
56209885543Smrg
563b12e5c03Smrg# A function that is used when there is no print builtin or printf.
564b12e5c03Smrgfunc_fallback_echo ()
565b12e5c03Smrg{
566b12e5c03Smrg  eval 'cat <<_LTECHO_EOF
567b12e5c03Smrg\$[]1
568b12e5c03Smrg_LTECHO_EOF'
569b12e5c03Smrg}
570b12e5c03Smrg
5717b58d2e0Smrg# Quote evaled strings.
5727b58d2e0Smrgfor var in lt_decl_all_varnames([[ \
5737b58d2e0Smrg]], lt_decl_quote_varnames); do
574b12e5c03Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
5757b58d2e0Smrg    *[[\\\\\\\`\\"\\\$]]*)
576f395c03eSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
5777b58d2e0Smrg      ;;
5787b58d2e0Smrg    *)
5797b58d2e0Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
5807b58d2e0Smrg      ;;
5817b58d2e0Smrg    esac
5827b58d2e0Smrgdone
58309885543Smrg
5847b58d2e0Smrg# Double-quote double-evaled strings.
5857b58d2e0Smrgfor var in lt_decl_all_varnames([[ \
5867b58d2e0Smrg]], lt_decl_dquote_varnames); do
587b12e5c03Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
5887b58d2e0Smrg    *[[\\\\\\\`\\"\\\$]]*)
589f395c03eSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
5907b58d2e0Smrg      ;;
5917b58d2e0Smrg    *)
5927b58d2e0Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
5937b58d2e0Smrg      ;;
5947b58d2e0Smrg    esac
5957b58d2e0Smrgdone
59609885543Smrg
5977b58d2e0Smrg_LT_OUTPUT_LIBTOOL_INIT
5987b58d2e0Smrg])
59909885543Smrg
600b12e5c03Smrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
601b12e5c03Smrg# ------------------------------------
602b12e5c03Smrg# Generate a child script FILE with all initialization necessary to
603b12e5c03Smrg# reuse the environment learned by the parent script, and make the
604b12e5c03Smrg# file executable.  If COMMENT is supplied, it is inserted after the
605f395c03eSmrg# '#!' sequence but before initialization text begins.  After this
606b12e5c03Smrg# macro, additional text can be appended to FILE to form the body of
607b12e5c03Smrg# the child script.  The macro ends with non-zero status if the
608b12e5c03Smrg# file could not be fully written (such as if the disk is full).
609b12e5c03Smrgm4_ifdef([AS_INIT_GENERATED],
610b12e5c03Smrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
611b12e5c03Smrg[m4_defun([_LT_GENERATED_FILE_INIT],
612b12e5c03Smrg[m4_require([AS_PREPARE])]dnl
613b12e5c03Smrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
614b12e5c03Smrg[lt_write_fail=0
615b12e5c03Smrgcat >$1 <<_ASEOF || lt_write_fail=1
616b12e5c03Smrg#! $SHELL
617b12e5c03Smrg# Generated by $as_me.
618b12e5c03Smrg$2
619b12e5c03SmrgSHELL=\${CONFIG_SHELL-$SHELL}
620b12e5c03Smrgexport SHELL
621b12e5c03Smrg_ASEOF
622b12e5c03Smrgcat >>$1 <<\_ASEOF || lt_write_fail=1
623b12e5c03SmrgAS_SHELL_SANITIZE
624b12e5c03Smrg_AS_PREPARE
625b12e5c03Smrgexec AS_MESSAGE_FD>&1
626b12e5c03Smrg_ASEOF
627f395c03eSmrgtest 0 = "$lt_write_fail" && chmod +x $1[]dnl
628b12e5c03Smrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
62909885543Smrg
6307b58d2e0Smrg# LT_OUTPUT
6317b58d2e0Smrg# ---------
6327b58d2e0Smrg# This macro allows early generation of the libtool script (before
6337b58d2e0Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
6347b58d2e0Smrg# tests.
6357b58d2e0SmrgAC_DEFUN([LT_OUTPUT],
6367b58d2e0Smrg[: ${CONFIG_LT=./config.lt}
6377b58d2e0SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
638b12e5c03Smrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
639b12e5c03Smrg[# Run this file to recreate a libtool stub with the current configuration.])
64009885543Smrg
6417b58d2e0Smrgcat >>"$CONFIG_LT" <<\_LTEOF
642b12e5c03Smrglt_cl_silent=false
6437b58d2e0Smrgexec AS_MESSAGE_LOG_FD>>config.log
6447b58d2e0Smrg{
6457b58d2e0Smrg  echo
6467b58d2e0Smrg  AS_BOX([Running $as_me.])
6477b58d2e0Smrg} >&AS_MESSAGE_LOG_FD
6482ec8c4b4Smrg
6497b58d2e0Smrglt_cl_help="\
650f395c03eSmrg'$as_me' creates a local libtool stub from the current configuration,
6517b58d2e0Smrgfor use in further configure time tests before the real libtool is
6527b58d2e0Smrggenerated.
65309885543Smrg
6547b58d2e0SmrgUsage: $[0] [[OPTIONS]]
65509885543Smrg
6567b58d2e0Smrg  -h, --help      print this help, then exit
6577b58d2e0Smrg  -V, --version   print version number, then exit
6587b58d2e0Smrg  -q, --quiet     do not print progress messages
6597b58d2e0Smrg  -d, --debug     don't remove temporary files
66009885543Smrg
6617b58d2e0SmrgReport bugs to <bug-libtool@gnu.org>."
66209885543Smrg
6637b58d2e0Smrglt_cl_version="\
6647b58d2e0Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
6657b58d2e0Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
6667b58d2e0Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
66709885543Smrg
668b12e5c03SmrgCopyright (C) 2011 Free Software Foundation, Inc.
6697b58d2e0SmrgThis config.lt script is free software; the Free Software Foundation
6707b58d2e0Smrggives unlimited permision to copy, distribute and modify it."
67109885543Smrg
672f395c03eSmrgwhile test 0 != $[#]
6737b58d2e0Smrgdo
6747b58d2e0Smrg  case $[1] in
6757b58d2e0Smrg    --version | --v* | -V )
6767b58d2e0Smrg      echo "$lt_cl_version"; exit 0 ;;
6777b58d2e0Smrg    --help | --h* | -h )
6787b58d2e0Smrg      echo "$lt_cl_help"; exit 0 ;;
6797b58d2e0Smrg    --debug | --d* | -d )
6807b58d2e0Smrg      debug=: ;;
6817b58d2e0Smrg    --quiet | --q* | --silent | --s* | -q )
6827b58d2e0Smrg      lt_cl_silent=: ;;
683e4f6584cSmrg
6847b58d2e0Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
685f395c03eSmrgTry '$[0] --help' for more information.]) ;;
686e4f6584cSmrg
6877b58d2e0Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
688f395c03eSmrgTry '$[0] --help' for more information.]) ;;
6897b58d2e0Smrg  esac
6907b58d2e0Smrg  shift
6917b58d2e0Smrgdone
6927b58d2e0Smrg
6937b58d2e0Smrgif $lt_cl_silent; then
6947b58d2e0Smrg  exec AS_MESSAGE_FD>/dev/null
69509885543Smrgfi
6967b58d2e0Smrg_LTEOF
69709885543Smrg
6987b58d2e0Smrgcat >>"$CONFIG_LT" <<_LTEOF
6997b58d2e0Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
7007b58d2e0Smrg_LTEOF
70109885543Smrg
7027b58d2e0Smrgcat >>"$CONFIG_LT" <<\_LTEOF
7037b58d2e0SmrgAC_MSG_NOTICE([creating $ofile])
7047b58d2e0Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
7057b58d2e0SmrgAS_EXIT(0)
7067b58d2e0Smrg_LTEOF
7077b58d2e0Smrgchmod +x "$CONFIG_LT"
70809885543Smrg
7097b58d2e0Smrg# configure is writing to config.log, but config.lt does its own redirection,
7107b58d2e0Smrg# appending to config.log, which fails on DOS, as config.log is still kept
7117b58d2e0Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
7127b58d2e0Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
713b12e5c03Smrglt_cl_success=:
714f395c03eSmrgtest yes = "$silent" &&
715b12e5c03Smrg  lt_config_lt_args="$lt_config_lt_args --quiet"
716b12e5c03Smrgexec AS_MESSAGE_LOG_FD>/dev/null
717b12e5c03Smrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
718b12e5c03Smrgexec AS_MESSAGE_LOG_FD>>config.log
719b12e5c03Smrg$lt_cl_success || AS_EXIT(1)
7207b58d2e0Smrg])# LT_OUTPUT
721e4f6584cSmrg
722e4f6584cSmrg
7237b58d2e0Smrg# _LT_CONFIG(TAG)
7247b58d2e0Smrg# ---------------
7257b58d2e0Smrg# If TAG is the built-in tag, create an initial libtool script with a
7267b58d2e0Smrg# default configuration from the untagged config vars.  Otherwise add code
7277b58d2e0Smrg# to config.status for appending the configuration named by TAG from the
7287b58d2e0Smrg# matching tagged config vars.
7297b58d2e0Smrgm4_defun([_LT_CONFIG],
7307b58d2e0Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7317b58d2e0Smrg_LT_CONFIG_SAVE_COMMANDS([
7327b58d2e0Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
7337b58d2e0Smrg  m4_if(_LT_TAG, [C], [
734f395c03eSmrg    # See if we are running on zsh, and set the options that allow our
7357b58d2e0Smrg    # commands through without removal of \ escapes.
736f395c03eSmrg    if test -n "${ZSH_VERSION+set}"; then
7377b58d2e0Smrg      setopt NO_GLOB_SUBST
7387b58d2e0Smrg    fi
73909885543Smrg
740f395c03eSmrg    cfgfile=${ofile}T
7417b58d2e0Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
7427b58d2e0Smrg    $RM "$cfgfile"
74309885543Smrg
7447b58d2e0Smrg    cat <<_LT_EOF >> "$cfgfile"
7457b58d2e0Smrg#! $SHELL
746f395c03eSmrg# Generated automatically by $as_me ($PACKAGE) $VERSION
7477b58d2e0Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
7487b58d2e0Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
749f395c03eSmrg
750f395c03eSmrg# Provide generalized library-building support services.
751f395c03eSmrg# Written by Gordon Matzigkeit, 1996
752f395c03eSmrg
7537b58d2e0Smrg_LT_COPYING
7547b58d2e0Smrg_LT_LIBTOOL_TAGS
755e4f6584cSmrg
756f395c03eSmrg# Configured defaults for sys_lib_dlsearch_path munging.
757f395c03eSmrg: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
758f395c03eSmrg
7597b58d2e0Smrg# ### BEGIN LIBTOOL CONFIG
7607b58d2e0Smrg_LT_LIBTOOL_CONFIG_VARS
7617b58d2e0Smrg_LT_LIBTOOL_TAG_VARS
7627b58d2e0Smrg# ### END LIBTOOL CONFIG
7637b58d2e0Smrg
764f395c03eSmrg_LT_EOF
765f395c03eSmrg
766f395c03eSmrg    cat <<'_LT_EOF' >> "$cfgfile"
767f395c03eSmrg
768f395c03eSmrg# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
769f395c03eSmrg
770f395c03eSmrg_LT_PREPARE_MUNGE_PATH_LIST
771f395c03eSmrg_LT_PREPARE_CC_BASENAME
772f395c03eSmrg
773f395c03eSmrg# ### END FUNCTIONS SHARED WITH CONFIGURE
774f395c03eSmrg
7757b58d2e0Smrg_LT_EOF
7767b58d2e0Smrg
7777b58d2e0Smrg  case $host_os in
7787b58d2e0Smrg  aix3*)
7797b58d2e0Smrg    cat <<\_LT_EOF >> "$cfgfile"
7807b58d2e0Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
7817b58d2e0Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
7827b58d2e0Smrg# vanish in a puff of smoke.
783f395c03eSmrgif test set != "${COLLECT_NAMES+set}"; then
7847b58d2e0Smrg  COLLECT_NAMES=
7857b58d2e0Smrg  export COLLECT_NAMES
78609885543Smrgfi
7877b58d2e0Smrg_LT_EOF
7887b58d2e0Smrg    ;;
7897b58d2e0Smrg  esac
79009885543Smrg
7917b58d2e0Smrg  _LT_PROG_LTMAIN
79209885543Smrg
7937b58d2e0Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
7947b58d2e0Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
7957b58d2e0Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
7967b58d2e0Smrg  # is reportedly fixed, but why not run on old versions too?
797b12e5c03Smrg  sed '$q' "$ltmain" >> "$cfgfile" \
798b12e5c03Smrg     || (rm -f "$cfgfile"; exit 1)
79909885543Smrg
800b12e5c03Smrg   mv -f "$cfgfile" "$ofile" ||
8017b58d2e0Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
8027b58d2e0Smrg  chmod +x "$ofile"
8037b58d2e0Smrg],
8047b58d2e0Smrg[cat <<_LT_EOF >> "$ofile"
80509885543Smrg
8067b58d2e0Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
8077b58d2e0Smrgdnl in a comment (ie after a #).
8087b58d2e0Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
8097b58d2e0Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
8107b58d2e0Smrg# ### END LIBTOOL TAG CONFIG: $1
8117b58d2e0Smrg_LT_EOF
8127b58d2e0Smrg])dnl /m4_if
8137b58d2e0Smrg],
8147b58d2e0Smrg[m4_if([$1], [], [
8157b58d2e0Smrg    PACKAGE='$PACKAGE'
8167b58d2e0Smrg    VERSION='$VERSION'
8177b58d2e0Smrg    RM='$RM'
8187b58d2e0Smrg    ofile='$ofile'], [])
8197b58d2e0Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
8207b58d2e0Smrg])# _LT_CONFIG
82109885543Smrg
82209885543Smrg
8237b58d2e0Smrg# LT_SUPPORTED_TAG(TAG)
8247b58d2e0Smrg# ---------------------
8257b58d2e0Smrg# Trace this macro to discover what tags are supported by the libtool
8267b58d2e0Smrg# --tag option, using:
8277b58d2e0Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
8287b58d2e0SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
82909885543Smrg
83009885543Smrg
8317b58d2e0Smrg# C support is built-in for now
8327b58d2e0Smrgm4_define([_LT_LANG_C_enabled], [])
8337b58d2e0Smrgm4_define([_LT_TAGS], [])
83409885543Smrg
83509885543Smrg
8367b58d2e0Smrg# LT_LANG(LANG)
8377b58d2e0Smrg# -------------
8387b58d2e0Smrg# Enable libtool support for the given language if not already enabled.
8397b58d2e0SmrgAC_DEFUN([LT_LANG],
8407b58d2e0Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
8417b58d2e0Smrgm4_case([$1],
8427b58d2e0Smrg  [C],			[_LT_LANG(C)],
8437b58d2e0Smrg  [C++],		[_LT_LANG(CXX)],
844b12e5c03Smrg  [Go],			[_LT_LANG(GO)],
8457b58d2e0Smrg  [Java],		[_LT_LANG(GCJ)],
8467b58d2e0Smrg  [Fortran 77],		[_LT_LANG(F77)],
8477b58d2e0Smrg  [Fortran],		[_LT_LANG(FC)],
8487b58d2e0Smrg  [Windows Resource],	[_LT_LANG(RC)],
8497b58d2e0Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
8507b58d2e0Smrg    [_LT_LANG($1)],
8517b58d2e0Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
8527b58d2e0Smrg])# LT_LANG
85309885543Smrg
85409885543Smrg
8557b58d2e0Smrg# _LT_LANG(LANGNAME)
8567b58d2e0Smrg# ------------------
8577b58d2e0Smrgm4_defun([_LT_LANG],
8587b58d2e0Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
8597b58d2e0Smrg  [LT_SUPPORTED_TAG([$1])dnl
8607b58d2e0Smrg  m4_append([_LT_TAGS], [$1 ])dnl
8617b58d2e0Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
8627b58d2e0Smrg  _LT_LANG_$1_CONFIG($1)])dnl
8637b58d2e0Smrg])# _LT_LANG
864e4f6584cSmrg
86509885543Smrg
866b12e5c03Smrgm4_ifndef([AC_PROG_GO], [
867b12e5c03Smrg# NOTE: This macro has been submitted for inclusion into   #
868b12e5c03Smrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
869b12e5c03Smrg#  a released version of Autoconf we should remove this    #
870b12e5c03Smrg#  macro and use it instead.                               #
871b12e5c03Smrgm4_defun([AC_PROG_GO],
872b12e5c03Smrg[AC_LANG_PUSH(Go)dnl
873b12e5c03SmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
874b12e5c03SmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
875b12e5c03Smrg_AC_ARG_VAR_LDFLAGS()dnl
876b12e5c03SmrgAC_CHECK_TOOL(GOC, gccgo)
877b12e5c03Smrgif test -z "$GOC"; then
878b12e5c03Smrg  if test -n "$ac_tool_prefix"; then
879b12e5c03Smrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
880b12e5c03Smrg  fi
881b12e5c03Smrgfi
882b12e5c03Smrgif test -z "$GOC"; then
883b12e5c03Smrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
884b12e5c03Smrgfi
885b12e5c03Smrg])#m4_defun
886b12e5c03Smrg])#m4_ifndef
887b12e5c03Smrg
888b12e5c03Smrg
8897b58d2e0Smrg# _LT_LANG_DEFAULT_CONFIG
8907b58d2e0Smrg# -----------------------
8917b58d2e0Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
8927b58d2e0Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
8937b58d2e0Smrg  [LT_LANG(CXX)],
8947b58d2e0Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
895e4f6584cSmrg
8967b58d2e0SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
8977b58d2e0Smrg  [LT_LANG(F77)],
8987b58d2e0Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
89909885543Smrg
9007b58d2e0SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
9017b58d2e0Smrg  [LT_LANG(FC)],
9027b58d2e0Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
903e4f6584cSmrg
9047b58d2e0Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
9057b58d2e0Smrgdnl pulling things in needlessly.
9067b58d2e0SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
9077b58d2e0Smrg  [LT_LANG(GCJ)],
9087b58d2e0Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
9097b58d2e0Smrg    [LT_LANG(GCJ)],
9107b58d2e0Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
9117b58d2e0Smrg      [LT_LANG(GCJ)],
9127b58d2e0Smrg      [m4_ifdef([AC_PROG_GCJ],
9137b58d2e0Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
9147b58d2e0Smrg       m4_ifdef([A][M_PROG_GCJ],
9157b58d2e0Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
9167b58d2e0Smrg       m4_ifdef([LT_PROG_GCJ],
9177b58d2e0Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
91809885543Smrg
919b12e5c03SmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
920b12e5c03Smrg  [LT_LANG(GO)],
921b12e5c03Smrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
922b12e5c03Smrg
9237b58d2e0SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
9247b58d2e0Smrg  [LT_LANG(RC)],
9257b58d2e0Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
9267b58d2e0Smrg])# _LT_LANG_DEFAULT_CONFIG
9277b58d2e0Smrg
9287b58d2e0Smrg# Obsolete macros:
9297b58d2e0SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
9307b58d2e0SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
9317b58d2e0SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
9327b58d2e0SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
933b12e5c03SmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
9347b58d2e0Smrgdnl aclocal-1.4 backwards compatibility:
9357b58d2e0Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
9367b58d2e0Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
9377b58d2e0Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
9387b58d2e0Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
939b12e5c03Smrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
9407b58d2e0Smrg
9417b58d2e0Smrg
9427b58d2e0Smrg# _LT_TAG_COMPILER
943e4f6584cSmrg# ----------------
9447b58d2e0Smrgm4_defun([_LT_TAG_COMPILER],
9457b58d2e0Smrg[AC_REQUIRE([AC_PROG_CC])dnl
946e4f6584cSmrg
9477b58d2e0Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
9487b58d2e0Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
9497b58d2e0Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
9507b58d2e0Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
95109885543Smrg
9527b58d2e0Smrg# If no C compiler was specified, use CC.
9537b58d2e0SmrgLTCC=${LTCC-"$CC"}
954e4f6584cSmrg
9557b58d2e0Smrg# If no C compiler flags were specified, use CFLAGS.
9567b58d2e0SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
95709885543Smrg
9587b58d2e0Smrg# Allow CC to be a program name with arguments.
9597b58d2e0Smrgcompiler=$CC
9607b58d2e0Smrg])# _LT_TAG_COMPILER
961e4f6584cSmrg
96209885543Smrg
9637b58d2e0Smrg# _LT_COMPILER_BOILERPLATE
9647b58d2e0Smrg# ------------------------
9657b58d2e0Smrg# Check for compiler boilerplate output or warnings with
9667b58d2e0Smrg# the simple compiler test code.
9677b58d2e0Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
9687b58d2e0Smrg[m4_require([_LT_DECL_SED])dnl
9697b58d2e0Smrgac_outfile=conftest.$ac_objext
9707b58d2e0Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
9717b58d2e0Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
9727b58d2e0Smrg_lt_compiler_boilerplate=`cat conftest.err`
9737b58d2e0Smrg$RM conftest*
9747b58d2e0Smrg])# _LT_COMPILER_BOILERPLATE
975e4f6584cSmrg
976e4f6584cSmrg
9777b58d2e0Smrg# _LT_LINKER_BOILERPLATE
978e4f6584cSmrg# ----------------------
9797b58d2e0Smrg# Check for linker boilerplate output or warnings with
9807b58d2e0Smrg# the simple link test code.
9817b58d2e0Smrgm4_defun([_LT_LINKER_BOILERPLATE],
9827b58d2e0Smrg[m4_require([_LT_DECL_SED])dnl
9837b58d2e0Smrgac_outfile=conftest.$ac_objext
9847b58d2e0Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
9857b58d2e0Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
9867b58d2e0Smrg_lt_linker_boilerplate=`cat conftest.err`
9877b58d2e0Smrg$RM -r conftest*
9887b58d2e0Smrg])# _LT_LINKER_BOILERPLATE
98909885543Smrg
9907b58d2e0Smrg# _LT_REQUIRED_DARWIN_CHECKS
9917b58d2e0Smrg# -------------------------
9927b58d2e0Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
9937b58d2e0Smrg  case $host_os in
9947b58d2e0Smrg    rhapsody* | darwin*)
9957b58d2e0Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
9967b58d2e0Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
9977b58d2e0Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
9987b58d2e0Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
9997b58d2e0Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
10007b58d2e0Smrg    _LT_DECL([], [DSYMUTIL], [1],
10017b58d2e0Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
10027b58d2e0Smrg    _LT_DECL([], [NMEDIT], [1],
10037b58d2e0Smrg      [Tool to change global to local symbols on Mac OS X])
10047b58d2e0Smrg    _LT_DECL([], [LIPO], [1],
10057b58d2e0Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
10067b58d2e0Smrg    _LT_DECL([], [OTOOL], [1],
10077b58d2e0Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
10087b58d2e0Smrg    _LT_DECL([], [OTOOL64], [1],
10097b58d2e0Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
101009885543Smrg
10117b58d2e0Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
10127b58d2e0Smrg      [lt_cv_apple_cc_single_mod=no
1013f395c03eSmrg      if test -z "$LT_MULTI_MODULE"; then
10147b58d2e0Smrg	# By default we will add the -single_module flag. You can override
10157b58d2e0Smrg	# by either setting the environment variable LT_MULTI_MODULE
10167b58d2e0Smrg	# non-empty at configure time, or by adding -multi_module to the
10177b58d2e0Smrg	# link flags.
10187b58d2e0Smrg	rm -rf libconftest.dylib*
10197b58d2e0Smrg	echo "int foo(void){return 1;}" > conftest.c
10207b58d2e0Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
10217b58d2e0Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
10227b58d2e0Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
10237b58d2e0Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
10247b58d2e0Smrg        _lt_result=$?
1025b12e5c03Smrg	# If there is a non-empty error log, and "single_module"
1026b12e5c03Smrg	# appears in it, assume the flag caused a linker warning
1027b12e5c03Smrg        if test -s conftest.err && $GREP single_module conftest.err; then
1028b12e5c03Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
1029b12e5c03Smrg	# Otherwise, if the output was created with a 0 exit code from
1030b12e5c03Smrg	# the compiler, it worked.
1031f395c03eSmrg	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
10327b58d2e0Smrg	  lt_cv_apple_cc_single_mod=yes
1033e4f6584cSmrg	else
10347b58d2e0Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
1035e4f6584cSmrg	fi
10367b58d2e0Smrg	rm -rf libconftest.dylib*
10377b58d2e0Smrg	rm -f conftest.*
10387b58d2e0Smrg      fi])
1039b12e5c03Smrg
10407b58d2e0Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
10417b58d2e0Smrg      [lt_cv_ld_exported_symbols_list],
10427b58d2e0Smrg      [lt_cv_ld_exported_symbols_list=no
10437b58d2e0Smrg      save_LDFLAGS=$LDFLAGS
10447b58d2e0Smrg      echo "_main" > conftest.sym
10457b58d2e0Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
10467b58d2e0Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
10477b58d2e0Smrg	[lt_cv_ld_exported_symbols_list=yes],
10487b58d2e0Smrg	[lt_cv_ld_exported_symbols_list=no])
1049f395c03eSmrg	LDFLAGS=$save_LDFLAGS
10507b58d2e0Smrg    ])
1051b12e5c03Smrg
1052b12e5c03Smrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
1053b12e5c03Smrg      [lt_cv_ld_force_load=no
1054b12e5c03Smrg      cat > conftest.c << _LT_EOF
1055b12e5c03Smrgint forced_loaded() { return 2;}
1056b12e5c03Smrg_LT_EOF
1057b12e5c03Smrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
1058b12e5c03Smrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
1059b12e5c03Smrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
1060b12e5c03Smrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
1061b12e5c03Smrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
1062b12e5c03Smrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
1063b12e5c03Smrg      cat > conftest.c << _LT_EOF
1064b12e5c03Smrgint main() { return 0;}
1065b12e5c03Smrg_LT_EOF
1066b12e5c03Smrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
1067b12e5c03Smrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
1068b12e5c03Smrg      _lt_result=$?
1069b12e5c03Smrg      if test -s conftest.err && $GREP force_load conftest.err; then
1070b12e5c03Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
1071f395c03eSmrg      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
1072b12e5c03Smrg	lt_cv_ld_force_load=yes
1073b12e5c03Smrg      else
1074b12e5c03Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
1075b12e5c03Smrg      fi
1076b12e5c03Smrg        rm -f conftest.err libconftest.a conftest conftest.c
1077b12e5c03Smrg        rm -rf conftest.dSYM
1078b12e5c03Smrg    ])
10797b58d2e0Smrg    case $host_os in
10807b58d2e0Smrg    rhapsody* | darwin1.[[012]])
1081f395c03eSmrg      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
10827b58d2e0Smrg    darwin1.*)
1083f395c03eSmrg      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
10847b58d2e0Smrg    darwin*) # darwin 5.x on
10857b58d2e0Smrg      # if running on 10.5 or later, the deployment target defaults
10867b58d2e0Smrg      # to the OS version, if on x86, and 10.4, the deployment
10877b58d2e0Smrg      # target defaults to 10.4. Don't you love it?
10887b58d2e0Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
10897b58d2e0Smrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
1090f395c03eSmrg	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1091f395c03eSmrg	10.[[012]][[,.]]*)
1092f395c03eSmrg	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
10937b58d2e0Smrg	10.*)
1094f395c03eSmrg	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
10957b58d2e0Smrg      esac
10967b58d2e0Smrg    ;;
10977b58d2e0Smrg  esac
1098f395c03eSmrg    if test yes = "$lt_cv_apple_cc_single_mod"; then
10997b58d2e0Smrg      _lt_dar_single_mod='$single_module'
1100e4f6584cSmrg    fi
1101f395c03eSmrg    if test yes = "$lt_cv_ld_exported_symbols_list"; then
1102f395c03eSmrg      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
11037b58d2e0Smrg    else
1104f395c03eSmrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
11057b58d2e0Smrg    fi
1106f395c03eSmrg    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
11077b58d2e0Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
11087b58d2e0Smrg    else
11097b58d2e0Smrg      _lt_dsymutil=
11107b58d2e0Smrg    fi
11117b58d2e0Smrg    ;;
11127b58d2e0Smrg  esac
11137b58d2e0Smrg])
111409885543Smrg
1115e4f6584cSmrg
1116b12e5c03Smrg# _LT_DARWIN_LINKER_FEATURES([TAG])
1117b12e5c03Smrg# ---------------------------------
11187b58d2e0Smrg# Checks for linker and compiler features on darwin
11197b58d2e0Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
11207b58d2e0Smrg[
11217b58d2e0Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
11227b58d2e0Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
11237b58d2e0Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
11247b58d2e0Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
11257b58d2e0Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1126f395c03eSmrg  if test yes = "$lt_cv_ld_force_load"; then
1127f395c03eSmrg    _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\"`'
1128b12e5c03Smrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
1129b12e5c03Smrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
1130b12e5c03Smrg  else
1131b12e5c03Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1132b12e5c03Smrg  fi
11337b58d2e0Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
1134f395c03eSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
11357b58d2e0Smrg  case $cc_basename in
1136f395c03eSmrg     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
11377b58d2e0Smrg     *) _lt_dar_can_shared=$GCC ;;
11387b58d2e0Smrg  esac
1139f395c03eSmrg  if test yes = "$_lt_dar_can_shared"; then
1140b12e5c03Smrg    output_verbose_link_cmd=func_echo_all
1141f395c03eSmrg    _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"
1142f395c03eSmrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
1143f395c03eSmrg    _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"
1144f395c03eSmrg    _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"
11457b58d2e0Smrg    m4_if([$1], [CXX],
1146f395c03eSmrg[   if test yes != "$lt_cv_apple_cc_single_mod"; then
1147f395c03eSmrg      _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"
1148f395c03eSmrg      _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"
11497b58d2e0Smrg    fi
11507b58d2e0Smrg],[])
11517b58d2e0Smrg  else
11527b58d2e0Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
11537b58d2e0Smrg  fi
11547b58d2e0Smrg])
115509885543Smrg
1156b12e5c03Smrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
1157b12e5c03Smrg# ----------------------------------
11587b58d2e0Smrg# Links a minimal program and checks the executable
11597b58d2e0Smrg# for the system default hardcoded library path. In most cases,
11607b58d2e0Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
11617b58d2e0Smrg# the location of the communication and MPI libs are included too.
11627b58d2e0Smrg# If we don't find anything, use the default library path according
11637b58d2e0Smrg# to the aix ld manual.
1164b12e5c03Smrg# Store the results from the different compilers for each TAGNAME.
1165b12e5c03Smrg# Allow to override them for all tags through lt_cv_aix_libpath.
11667b58d2e0Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
11677b58d2e0Smrg[m4_require([_LT_DECL_SED])dnl
1168f395c03eSmrgif test set = "${lt_cv_aix_libpath+set}"; then
1169b12e5c03Smrg  aix_libpath=$lt_cv_aix_libpath
1170b12e5c03Smrgelse
1171b12e5c03Smrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
1172b12e5c03Smrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
1173b12e5c03Smrg  lt_aix_libpath_sed='[
1174b12e5c03Smrg      /Import File Strings/,/^$/ {
1175b12e5c03Smrg	  /^0/ {
1176b12e5c03Smrg	      s/^0  *\([^ ]*\) *$/\1/
1177b12e5c03Smrg	      p
1178b12e5c03Smrg	  }
1179b12e5c03Smrg      }]'
1180b12e5c03Smrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1181b12e5c03Smrg  # Check for a 64-bit object if we didn't find anything.
1182b12e5c03Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1183b12e5c03Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1184b12e5c03Smrg  fi],[])
1185b12e5c03Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1186f395c03eSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
1187b12e5c03Smrg  fi
1188b12e5c03Smrg  ])
1189b12e5c03Smrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
1190b12e5c03Smrgfi
11917b58d2e0Smrg])# _LT_SYS_MODULE_PATH_AIX
1192e4f6584cSmrg
1193b698ba48Smrg
11947b58d2e0Smrg# _LT_SHELL_INIT(ARG)
11957b58d2e0Smrg# -------------------
11967b58d2e0Smrgm4_define([_LT_SHELL_INIT],
1197b12e5c03Smrg[m4_divert_text([M4SH-INIT], [$1
1198b12e5c03Smrg])])# _LT_SHELL_INIT
1199b12e5c03Smrg
1200b698ba48Smrg
1201b698ba48Smrg
12027b58d2e0Smrg# _LT_PROG_ECHO_BACKSLASH
12037b58d2e0Smrg# -----------------------
1204b12e5c03Smrg# Find how we can fake an echo command that does not interpret backslash.
1205b12e5c03Smrg# In particular, with Autoconf 2.60 or later we add some code to the start
1206f395c03eSmrg# of the generated configure script that will find a shell with a builtin
1207f395c03eSmrg# printf (that we can use as an echo command).
12087b58d2e0Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
1209b12e5c03Smrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1210b12e5c03SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1211b12e5c03SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1212b12e5c03Smrg
1213b12e5c03SmrgAC_MSG_CHECKING([how to print strings])
1214b12e5c03Smrg# Test print first, because it will be a builtin if present.
1215b12e5c03Smrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
1216b12e5c03Smrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
1217b12e5c03Smrg  ECHO='print -r --'
1218b12e5c03Smrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
1219b12e5c03Smrg  ECHO='printf %s\n'
12207b58d2e0Smrgelse
1221b12e5c03Smrg  # Use this function as a fallback that always works.
1222b12e5c03Smrg  func_fallback_echo ()
1223b12e5c03Smrg  {
1224b12e5c03Smrg    eval 'cat <<_LTECHO_EOF
1225b12e5c03Smrg$[]1
1226b12e5c03Smrg_LTECHO_EOF'
1227b12e5c03Smrg  }
1228b12e5c03Smrg  ECHO='func_fallback_echo'
1229e4f6584cSmrgfi
123009885543Smrg
1231b12e5c03Smrg# func_echo_all arg...
1232b12e5c03Smrg# Invoke $ECHO with all args, space-separated.
1233b12e5c03Smrgfunc_echo_all ()
1234b12e5c03Smrg{
1235f395c03eSmrg    $ECHO "$*"
1236b12e5c03Smrg}
123709885543Smrg
1238f395c03eSmrgcase $ECHO in
1239b12e5c03Smrg  printf*) AC_MSG_RESULT([printf]) ;;
1240b12e5c03Smrg  print*) AC_MSG_RESULT([print -r]) ;;
1241b12e5c03Smrg  *) AC_MSG_RESULT([cat]) ;;
1242b12e5c03Smrgesac
124309885543Smrg
1244b12e5c03Smrgm4_ifdef([_AS_DETECT_SUGGESTED],
1245b12e5c03Smrg[_AS_DETECT_SUGGESTED([
1246b12e5c03Smrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
1247b12e5c03Smrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1248b12e5c03Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1249b12e5c03Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1250b12e5c03Smrg    PATH=/empty FPATH=/empty; export PATH FPATH
1251b12e5c03Smrg    test "X`printf %s $ECHO`" = "X$ECHO" \
1252b12e5c03Smrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
125309885543Smrg
12547b58d2e0Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1255b12e5c03Smrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
12567b58d2e0Smrg])# _LT_PROG_ECHO_BACKSLASH
125709885543Smrg
125809885543Smrg
1259b12e5c03Smrg# _LT_WITH_SYSROOT
1260b12e5c03Smrg# ----------------
1261b12e5c03SmrgAC_DEFUN([_LT_WITH_SYSROOT],
1262b12e5c03Smrg[AC_MSG_CHECKING([for sysroot])
1263b12e5c03SmrgAC_ARG_WITH([sysroot],
1264f395c03eSmrg[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
1265f395c03eSmrg  [Search for dependent libraries within DIR (or the compiler's sysroot
1266f395c03eSmrg   if not specified).])],
1267b12e5c03Smrg[], [with_sysroot=no])
1268b12e5c03Smrg
1269b12e5c03Smrgdnl lt_sysroot will always be passed unquoted.  We quote it here
1270b12e5c03Smrgdnl in case the user passed a directory name.
1271b12e5c03Smrglt_sysroot=
1272f395c03eSmrgcase $with_sysroot in #(
1273b12e5c03Smrg yes)
1274f395c03eSmrg   if test yes = "$GCC"; then
1275b12e5c03Smrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
1276b12e5c03Smrg   fi
1277b12e5c03Smrg   ;; #(
1278b12e5c03Smrg /*)
1279b12e5c03Smrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
1280b12e5c03Smrg   ;; #(
1281b12e5c03Smrg no|'')
1282b12e5c03Smrg   ;; #(
1283b12e5c03Smrg *)
1284f395c03eSmrg   AC_MSG_RESULT([$with_sysroot])
1285b12e5c03Smrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
1286b12e5c03Smrg   ;;
1287b12e5c03Smrgesac
1288b12e5c03Smrg
1289b12e5c03Smrg AC_MSG_RESULT([${lt_sysroot:-no}])
1290b12e5c03Smrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
1291f395c03eSmrg[dependent libraries, and where our libraries should be installed.])])
1292b12e5c03Smrg
12937b58d2e0Smrg# _LT_ENABLE_LOCK
12947b58d2e0Smrg# ---------------
12957b58d2e0Smrgm4_defun([_LT_ENABLE_LOCK],
12967b58d2e0Smrg[AC_ARG_ENABLE([libtool-lock],
12977b58d2e0Smrg  [AS_HELP_STRING([--disable-libtool-lock],
12987b58d2e0Smrg    [avoid locking (might break parallel builds)])])
1299f395c03eSmrgtest no = "$enable_libtool_lock" || enable_libtool_lock=yes
1300e4f6584cSmrg
13017b58d2e0Smrg# Some flags need to be propagated to the compiler or linker for good
13027b58d2e0Smrg# libtool support.
13037b58d2e0Smrgcase $host in
13047b58d2e0Smrgia64-*-hpux*)
1305f395c03eSmrg  # Find out what ABI is being produced by ac_compile, and set mode
1306f395c03eSmrg  # options accordingly.
13077b58d2e0Smrg  echo 'int i;' > conftest.$ac_ext
13087b58d2e0Smrg  if AC_TRY_EVAL(ac_compile); then
13097b58d2e0Smrg    case `/usr/bin/file conftest.$ac_objext` in
13107b58d2e0Smrg      *ELF-32*)
1311f395c03eSmrg	HPUX_IA64_MODE=32
13127b58d2e0Smrg	;;
13137b58d2e0Smrg      *ELF-64*)
1314f395c03eSmrg	HPUX_IA64_MODE=64
13157b58d2e0Smrg	;;
13167b58d2e0Smrg    esac
13177b58d2e0Smrg  fi
13187b58d2e0Smrg  rm -rf conftest*
13197b58d2e0Smrg  ;;
13207b58d2e0Smrg*-*-irix6*)
1321f395c03eSmrg  # Find out what ABI is being produced by ac_compile, and set linker
1322f395c03eSmrg  # options accordingly.
1323b12e5c03Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
13247b58d2e0Smrg  if AC_TRY_EVAL(ac_compile); then
1325f395c03eSmrg    if test yes = "$lt_cv_prog_gnu_ld"; then
13267b58d2e0Smrg      case `/usr/bin/file conftest.$ac_objext` in
13277b58d2e0Smrg	*32-bit*)
13287b58d2e0Smrg	  LD="${LD-ld} -melf32bsmip"
13297b58d2e0Smrg	  ;;
13307b58d2e0Smrg	*N32*)
13317b58d2e0Smrg	  LD="${LD-ld} -melf32bmipn32"
13327b58d2e0Smrg	  ;;
13337b58d2e0Smrg	*64-bit*)
13347b58d2e0Smrg	  LD="${LD-ld} -melf64bmip"
13357b58d2e0Smrg	;;
13367b58d2e0Smrg      esac
13377b58d2e0Smrg    else
13387b58d2e0Smrg      case `/usr/bin/file conftest.$ac_objext` in
13397b58d2e0Smrg	*32-bit*)
13407b58d2e0Smrg	  LD="${LD-ld} -32"
13417b58d2e0Smrg	  ;;
13427b58d2e0Smrg	*N32*)
13437b58d2e0Smrg	  LD="${LD-ld} -n32"
13447b58d2e0Smrg	  ;;
13457b58d2e0Smrg	*64-bit*)
13467b58d2e0Smrg	  LD="${LD-ld} -64"
13477b58d2e0Smrg	  ;;
13487b58d2e0Smrg      esac
13497b58d2e0Smrg    fi
13507b58d2e0Smrg  fi
13517b58d2e0Smrg  rm -rf conftest*
13527b58d2e0Smrg  ;;
135309885543Smrg
1354f395c03eSmrgmips64*-*linux*)
1355f395c03eSmrg  # Find out what ABI is being produced by ac_compile, and set linker
1356f395c03eSmrg  # options accordingly.
1357f395c03eSmrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1358f395c03eSmrg  if AC_TRY_EVAL(ac_compile); then
1359f395c03eSmrg    emul=elf
1360f395c03eSmrg    case `/usr/bin/file conftest.$ac_objext` in
1361f395c03eSmrg      *32-bit*)
1362f395c03eSmrg	emul="${emul}32"
1363f395c03eSmrg	;;
1364f395c03eSmrg      *64-bit*)
1365f395c03eSmrg	emul="${emul}64"
1366f395c03eSmrg	;;
1367f395c03eSmrg    esac
1368f395c03eSmrg    case `/usr/bin/file conftest.$ac_objext` in
1369f395c03eSmrg      *MSB*)
1370f395c03eSmrg	emul="${emul}btsmip"
1371f395c03eSmrg	;;
1372f395c03eSmrg      *LSB*)
1373f395c03eSmrg	emul="${emul}ltsmip"
1374f395c03eSmrg	;;
1375f395c03eSmrg    esac
1376f395c03eSmrg    case `/usr/bin/file conftest.$ac_objext` in
1377f395c03eSmrg      *N32*)
1378f395c03eSmrg	emul="${emul}n32"
1379f395c03eSmrg	;;
1380f395c03eSmrg    esac
1381f395c03eSmrg    LD="${LD-ld} -m $emul"
1382f395c03eSmrg  fi
1383f395c03eSmrg  rm -rf conftest*
1384f395c03eSmrg  ;;
1385f395c03eSmrg
1386df9ffc95Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
13877b58d2e0Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1388f395c03eSmrg  # Find out what ABI is being produced by ac_compile, and set linker
1389f395c03eSmrg  # options accordingly.  Note that the listed cases only cover the
1390f395c03eSmrg  # situations where additional linker options are needed (such as when
1391f395c03eSmrg  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
1392f395c03eSmrg  # vice versa); the common cases where no linker options are needed do
1393f395c03eSmrg  # not appear in the list.
13947b58d2e0Smrg  echo 'int i;' > conftest.$ac_ext
13957b58d2e0Smrg  if AC_TRY_EVAL(ac_compile); then
13967b58d2e0Smrg    case `/usr/bin/file conftest.o` in
13977b58d2e0Smrg      *32-bit*)
13987b58d2e0Smrg	case $host in
13997b58d2e0Smrg	  x86_64-*kfreebsd*-gnu)
14007b58d2e0Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
14017b58d2e0Smrg	    ;;
14027b58d2e0Smrg	  x86_64-*linux*)
1403df9ffc95Smrg	    case `/usr/bin/file conftest.o` in
1404df9ffc95Smrg	      *x86-64*)
1405df9ffc95Smrg		LD="${LD-ld} -m elf32_x86_64"
1406df9ffc95Smrg		;;
1407df9ffc95Smrg	      *)
1408df9ffc95Smrg		LD="${LD-ld} -m elf_i386"
1409df9ffc95Smrg		;;
1410df9ffc95Smrg	    esac
1411df9ffc95Smrg	    ;;
1412f395c03eSmrg	  powerpc64le-*linux*)
1413df9ffc95Smrg	    LD="${LD-ld} -m elf32lppclinux"
14147b58d2e0Smrg	    ;;
1415f395c03eSmrg	  powerpc64-*linux*)
14167b58d2e0Smrg	    LD="${LD-ld} -m elf32ppclinux"
14177b58d2e0Smrg	    ;;
14187b58d2e0Smrg	  s390x-*linux*)
14197b58d2e0Smrg	    LD="${LD-ld} -m elf_s390"
14207b58d2e0Smrg	    ;;
14217b58d2e0Smrg	  sparc64-*linux*)
14227b58d2e0Smrg	    LD="${LD-ld} -m elf32_sparc"
14237b58d2e0Smrg	    ;;
14247b58d2e0Smrg	esac
14257b58d2e0Smrg	;;
14267b58d2e0Smrg      *64-bit*)
14277b58d2e0Smrg	case $host in
14287b58d2e0Smrg	  x86_64-*kfreebsd*-gnu)
14297b58d2e0Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
14307b58d2e0Smrg	    ;;
14317b58d2e0Smrg	  x86_64-*linux*)
14327b58d2e0Smrg	    LD="${LD-ld} -m elf_x86_64"
14337b58d2e0Smrg	    ;;
1434f395c03eSmrg	  powerpcle-*linux*)
1435df9ffc95Smrg	    LD="${LD-ld} -m elf64lppc"
1436df9ffc95Smrg	    ;;
1437f395c03eSmrg	  powerpc-*linux*)
14387b58d2e0Smrg	    LD="${LD-ld} -m elf64ppc"
14397b58d2e0Smrg	    ;;
14407b58d2e0Smrg	  s390*-*linux*|s390*-*tpf*)
14417b58d2e0Smrg	    LD="${LD-ld} -m elf64_s390"
14427b58d2e0Smrg	    ;;
14437b58d2e0Smrg	  sparc*-*linux*)
14447b58d2e0Smrg	    LD="${LD-ld} -m elf64_sparc"
14457b58d2e0Smrg	    ;;
14467b58d2e0Smrg	esac
14477b58d2e0Smrg	;;
14487b58d2e0Smrg    esac
14497b58d2e0Smrg  fi
14507b58d2e0Smrg  rm -rf conftest*
14517b58d2e0Smrg  ;;
1452e4f6584cSmrg
14537b58d2e0Smrg*-*-sco3.2v5*)
14547b58d2e0Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1455f395c03eSmrg  SAVE_CFLAGS=$CFLAGS
14567b58d2e0Smrg  CFLAGS="$CFLAGS -belf"
14577b58d2e0Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
14587b58d2e0Smrg    [AC_LANG_PUSH(C)
14597b58d2e0Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
14607b58d2e0Smrg     AC_LANG_POP])
1461f395c03eSmrg  if test yes != "$lt_cv_cc_needs_belf"; then
14627b58d2e0Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1463f395c03eSmrg    CFLAGS=$SAVE_CFLAGS
14647b58d2e0Smrg  fi
14657b58d2e0Smrg  ;;
1466b12e5c03Smrg*-*solaris*)
1467f395c03eSmrg  # Find out what ABI is being produced by ac_compile, and set linker
1468f395c03eSmrg  # options accordingly.
14697b58d2e0Smrg  echo 'int i;' > conftest.$ac_ext
14707b58d2e0Smrg  if AC_TRY_EVAL(ac_compile); then
14717b58d2e0Smrg    case `/usr/bin/file conftest.o` in
14727b58d2e0Smrg    *64-bit*)
14737b58d2e0Smrg      case $lt_cv_prog_gnu_ld in
1474b12e5c03Smrg      yes*)
1475b12e5c03Smrg        case $host in
1476f395c03eSmrg        i?86-*-solaris*|x86_64-*-solaris*)
1477b12e5c03Smrg          LD="${LD-ld} -m elf_x86_64"
1478b12e5c03Smrg          ;;
1479b12e5c03Smrg        sparc*-*-solaris*)
1480b12e5c03Smrg          LD="${LD-ld} -m elf64_sparc"
1481b12e5c03Smrg          ;;
1482b12e5c03Smrg        esac
1483b12e5c03Smrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
1484b12e5c03Smrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
1485f395c03eSmrg          LD=${LD-ld}_sol2
1486b12e5c03Smrg        fi
1487b12e5c03Smrg        ;;
14887b58d2e0Smrg      *)
14897b58d2e0Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
14907b58d2e0Smrg	  LD="${LD-ld} -64"
14917b58d2e0Smrg	fi
14927b58d2e0Smrg	;;
14937b58d2e0Smrg      esac
14947b58d2e0Smrg      ;;
14957b58d2e0Smrg    esac
14967b58d2e0Smrg  fi
14977b58d2e0Smrg  rm -rf conftest*
14987b58d2e0Smrg  ;;
149909885543Smrgesac
1500e4f6584cSmrg
1501f395c03eSmrgneed_locks=$enable_libtool_lock
15027b58d2e0Smrg])# _LT_ENABLE_LOCK
1503e4f6584cSmrg
1504e4f6584cSmrg
1505b12e5c03Smrg# _LT_PROG_AR
1506b12e5c03Smrg# -----------
1507b12e5c03Smrgm4_defun([_LT_PROG_AR],
1508b12e5c03Smrg[AC_CHECK_TOOLS(AR, [ar], false)
1509b12e5c03Smrg: ${AR=ar}
1510b12e5c03Smrg: ${AR_FLAGS=cru}
1511b12e5c03Smrg_LT_DECL([], [AR], [1], [The archiver])
1512b12e5c03Smrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
1513b12e5c03Smrg
1514b12e5c03SmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
1515b12e5c03Smrg  [lt_cv_ar_at_file=no
1516b12e5c03Smrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
1517b12e5c03Smrg     [echo conftest.$ac_objext > conftest.lst
1518b12e5c03Smrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
1519b12e5c03Smrg      AC_TRY_EVAL([lt_ar_try])
1520f395c03eSmrg      if test 0 -eq "$ac_status"; then
1521b12e5c03Smrg	# Ensure the archiver fails upon bogus file names.
1522b12e5c03Smrg	rm -f conftest.$ac_objext libconftest.a
1523b12e5c03Smrg	AC_TRY_EVAL([lt_ar_try])
1524f395c03eSmrg	if test 0 -ne "$ac_status"; then
1525b12e5c03Smrg          lt_cv_ar_at_file=@
1526b12e5c03Smrg        fi
1527b12e5c03Smrg      fi
1528b12e5c03Smrg      rm -f conftest.* libconftest.a
1529b12e5c03Smrg     ])
1530b12e5c03Smrg  ])
1531b12e5c03Smrg
1532f395c03eSmrgif test no = "$lt_cv_ar_at_file"; then
1533b12e5c03Smrg  archiver_list_spec=
1534b12e5c03Smrgelse
1535b12e5c03Smrg  archiver_list_spec=$lt_cv_ar_at_file
1536b12e5c03Smrgfi
1537b12e5c03Smrg_LT_DECL([], [archiver_list_spec], [1],
1538b12e5c03Smrg  [How to feed a file listing to the archiver])
1539b12e5c03Smrg])# _LT_PROG_AR
1540b12e5c03Smrg
1541b12e5c03Smrg
15427b58d2e0Smrg# _LT_CMD_OLD_ARCHIVE
15437b58d2e0Smrg# -------------------
15447b58d2e0Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
1545b12e5c03Smrg[_LT_PROG_AR
1546e4f6584cSmrg
15477b58d2e0SmrgAC_CHECK_TOOL(STRIP, strip, :)
15487b58d2e0Smrgtest -z "$STRIP" && STRIP=:
15497b58d2e0Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
155009885543Smrg
15517b58d2e0SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
15527b58d2e0Smrgtest -z "$RANLIB" && RANLIB=:
15537b58d2e0Smrg_LT_DECL([], [RANLIB], [1],
15547b58d2e0Smrg    [Commands used to install an old-style archive])
15552ec8c4b4Smrg
15567b58d2e0Smrg# Determine commands to create old-style static archives.
15577b58d2e0Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
15587b58d2e0Smrgold_postinstall_cmds='chmod 644 $oldlib'
15597b58d2e0Smrgold_postuninstall_cmds=
156009885543Smrg
15617b58d2e0Smrgif test -n "$RANLIB"; then
15627b58d2e0Smrg  case $host_os in
1563f395c03eSmrg  bitrig* | openbsd*)
1564b12e5c03Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
15657b58d2e0Smrg    ;;
15667b58d2e0Smrg  *)
1567b12e5c03Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
15687b58d2e0Smrg    ;;
15697b58d2e0Smrg  esac
1570b12e5c03Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
15717b58d2e0Smrgfi
1572b12e5c03Smrg
1573b12e5c03Smrgcase $host_os in
1574b12e5c03Smrg  darwin*)
1575b12e5c03Smrg    lock_old_archive_extraction=yes ;;
1576b12e5c03Smrg  *)
1577b12e5c03Smrg    lock_old_archive_extraction=no ;;
1578b12e5c03Smrgesac
15797b58d2e0Smrg_LT_DECL([], [old_postinstall_cmds], [2])
15807b58d2e0Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
15817b58d2e0Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
15827b58d2e0Smrg    [Commands used to build an old-style archive])
1583b12e5c03Smrg_LT_DECL([], [lock_old_archive_extraction], [0],
1584b12e5c03Smrg    [Whether to use a lock for old archive extraction])
15857b58d2e0Smrg])# _LT_CMD_OLD_ARCHIVE
158609885543Smrg
1587e4f6584cSmrg
15887b58d2e0Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
15897b58d2e0Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
15907b58d2e0Smrg# ----------------------------------------------------------------
15917b58d2e0Smrg# Check whether the given compiler option works
15927b58d2e0SmrgAC_DEFUN([_LT_COMPILER_OPTION],
15937b58d2e0Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
15947b58d2e0Smrgm4_require([_LT_DECL_SED])dnl
15957b58d2e0SmrgAC_CACHE_CHECK([$1], [$2],
15967b58d2e0Smrg  [$2=no
15977b58d2e0Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
15987b58d2e0Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1599f395c03eSmrg   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
16007b58d2e0Smrg   # Insert the option either (1) after the last *FLAGS variable, or
16017b58d2e0Smrg   # (2) before a word containing "conftest.", or (3) at the end.
16027b58d2e0Smrg   # Note that $ac_compile itself does not contain backslashes and begins
16037b58d2e0Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
16047b58d2e0Smrg   # The option is referenced via a variable to avoid confusing sed.
16057b58d2e0Smrg   lt_compile=`echo "$ac_compile" | $SED \
16067b58d2e0Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
16077b58d2e0Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
16087b58d2e0Smrg   -e 's:$: $lt_compiler_flag:'`
1609b12e5c03Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
16107b58d2e0Smrg   (eval "$lt_compile" 2>conftest.err)
16117b58d2e0Smrg   ac_status=$?
16127b58d2e0Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
1613b12e5c03Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
16147b58d2e0Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
16157b58d2e0Smrg     # The compiler can only warn and ignore the option if not recognized
16167b58d2e0Smrg     # So say no if there are warnings other than the usual output.
1617b12e5c03Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
16187b58d2e0Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
16197b58d2e0Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
16207b58d2e0Smrg       $2=yes
16217b58d2e0Smrg     fi
16227b58d2e0Smrg   fi
16237b58d2e0Smrg   $RM conftest*
1624e4f6584cSmrg])
162509885543Smrg
1626f395c03eSmrgif test yes = "[$]$2"; then
16277b58d2e0Smrg    m4_if([$5], , :, [$5])
16287b58d2e0Smrgelse
16297b58d2e0Smrg    m4_if([$6], , :, [$6])
1630e4f6584cSmrgfi
16317b58d2e0Smrg])# _LT_COMPILER_OPTION
1632e4f6584cSmrg
16337b58d2e0Smrg# Old name:
16347b58d2e0SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
16357b58d2e0Smrgdnl aclocal-1.4 backwards compatibility:
16367b58d2e0Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
163709885543Smrg
163809885543Smrg
16397b58d2e0Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
16407b58d2e0Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
16417b58d2e0Smrg# ----------------------------------------------------
16427b58d2e0Smrg# Check whether the given linker option works
16437b58d2e0SmrgAC_DEFUN([_LT_LINKER_OPTION],
16447b58d2e0Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
16457b58d2e0Smrgm4_require([_LT_DECL_SED])dnl
16467b58d2e0SmrgAC_CACHE_CHECK([$1], [$2],
16477b58d2e0Smrg  [$2=no
1648f395c03eSmrg   save_LDFLAGS=$LDFLAGS
16497b58d2e0Smrg   LDFLAGS="$LDFLAGS $3"
16507b58d2e0Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
16517b58d2e0Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
16527b58d2e0Smrg     # The linker can only warn and ignore the option if not recognized
16537b58d2e0Smrg     # So say no if there are warnings
16547b58d2e0Smrg     if test -s conftest.err; then
16557b58d2e0Smrg       # Append any errors to the config.log.
16567b58d2e0Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
1657b12e5c03Smrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
16587b58d2e0Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
16597b58d2e0Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
16607b58d2e0Smrg         $2=yes
16617b58d2e0Smrg       fi
16627b58d2e0Smrg     else
16637b58d2e0Smrg       $2=yes
16647b58d2e0Smrg     fi
16657b58d2e0Smrg   fi
16667b58d2e0Smrg   $RM -r conftest*
1667f395c03eSmrg   LDFLAGS=$save_LDFLAGS
16687b58d2e0Smrg])
166909885543Smrg
1670f395c03eSmrgif test yes = "[$]$2"; then
16717b58d2e0Smrg    m4_if([$4], , :, [$4])
16727b58d2e0Smrgelse
16737b58d2e0Smrg    m4_if([$5], , :, [$5])
16747b58d2e0Smrgfi
16757b58d2e0Smrg])# _LT_LINKER_OPTION
167609885543Smrg
16777b58d2e0Smrg# Old name:
16787b58d2e0SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
16797b58d2e0Smrgdnl aclocal-1.4 backwards compatibility:
16807b58d2e0Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
168109885543Smrg
168209885543Smrg
16837b58d2e0Smrg# LT_CMD_MAX_LEN
16847b58d2e0Smrg#---------------
16857b58d2e0SmrgAC_DEFUN([LT_CMD_MAX_LEN],
16867b58d2e0Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
16877b58d2e0Smrg# find the maximum length of command line arguments
16887b58d2e0SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
16897b58d2e0SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
16907b58d2e0Smrg  i=0
1691f395c03eSmrg  teststring=ABCD
1692e4f6584cSmrg
16937b58d2e0Smrg  case $build_os in
16947b58d2e0Smrg  msdosdjgpp*)
16957b58d2e0Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
16967b58d2e0Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
16977b58d2e0Smrg    # during glob expansion).  Even if it were fixed, the result of this
16987b58d2e0Smrg    # check would be larger than it should be.
16997b58d2e0Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
17007b58d2e0Smrg    ;;
170109885543Smrg
17027b58d2e0Smrg  gnu*)
17037b58d2e0Smrg    # Under GNU Hurd, this test is not required because there is
17047b58d2e0Smrg    # no limit to the length of command line arguments.
17057b58d2e0Smrg    # Libtool will interpret -1 as no limit whatsoever
17067b58d2e0Smrg    lt_cv_sys_max_cmd_len=-1;
17077b58d2e0Smrg    ;;
170809885543Smrg
17097b58d2e0Smrg  cygwin* | mingw* | cegcc*)
17107b58d2e0Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
17117b58d2e0Smrg    # about 5 minutes as the teststring grows exponentially.
17127b58d2e0Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
17137b58d2e0Smrg    # you end up with a "frozen" computer, even though with patience
17147b58d2e0Smrg    # the test eventually succeeds (with a max line length of 256k).
17157b58d2e0Smrg    # Instead, let's just punt: use the minimum linelength reported by
17167b58d2e0Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
17177b58d2e0Smrg    lt_cv_sys_max_cmd_len=8192;
17187b58d2e0Smrg    ;;
171909885543Smrg
1720b12e5c03Smrg  mint*)
1721b12e5c03Smrg    # On MiNT this can take a long time and run out of memory.
1722b12e5c03Smrg    lt_cv_sys_max_cmd_len=8192;
1723b12e5c03Smrg    ;;
1724b12e5c03Smrg
17257b58d2e0Smrg  amigaos*)
17267b58d2e0Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
17277b58d2e0Smrg    # So we just punt and use a minimum line length of 8192.
17287b58d2e0Smrg    lt_cv_sys_max_cmd_len=8192;
17297b58d2e0Smrg    ;;
173009885543Smrg
1731f395c03eSmrg  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
17327b58d2e0Smrg    # This has been around since 386BSD, at least.  Likely further.
17337b58d2e0Smrg    if test -x /sbin/sysctl; then
17347b58d2e0Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
17357b58d2e0Smrg    elif test -x /usr/sbin/sysctl; then
17367b58d2e0Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
17377b58d2e0Smrg    else
17387b58d2e0Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
17397b58d2e0Smrg    fi
17407b58d2e0Smrg    # And add a safety zone
17417b58d2e0Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
17427b58d2e0Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
17437b58d2e0Smrg    ;;
1744e4f6584cSmrg
17457b58d2e0Smrg  interix*)
17467b58d2e0Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
17477b58d2e0Smrg    lt_cv_sys_max_cmd_len=196608
17487b58d2e0Smrg    ;;
174909885543Smrg
1750b12e5c03Smrg  os2*)
1751b12e5c03Smrg    # The test takes a long time on OS/2.
1752b12e5c03Smrg    lt_cv_sys_max_cmd_len=8192
1753b12e5c03Smrg    ;;
1754b12e5c03Smrg
17557b58d2e0Smrg  osf*)
17567b58d2e0Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
17577b58d2e0Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
17587b58d2e0Smrg    # nice to cause kernel panics so lets avoid the loop below.
17597b58d2e0Smrg    # First set a reasonable default.
17607b58d2e0Smrg    lt_cv_sys_max_cmd_len=16384
17617b58d2e0Smrg    #
17627b58d2e0Smrg    if test -x /sbin/sysconfig; then
17637b58d2e0Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
17647b58d2e0Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
17657b58d2e0Smrg      esac
17667b58d2e0Smrg    fi
17677b58d2e0Smrg    ;;
17687b58d2e0Smrg  sco3.2v5*)
17697b58d2e0Smrg    lt_cv_sys_max_cmd_len=102400
17707b58d2e0Smrg    ;;
17717b58d2e0Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
17727b58d2e0Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
17737b58d2e0Smrg    if test -n "$kargmax"; then
17747b58d2e0Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
17757b58d2e0Smrg    else
17767b58d2e0Smrg      lt_cv_sys_max_cmd_len=32768
17777b58d2e0Smrg    fi
17787b58d2e0Smrg    ;;
17797b58d2e0Smrg  *)
17807b58d2e0Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1781df9ffc95Smrg    if test -n "$lt_cv_sys_max_cmd_len" && \
1782f395c03eSmrg       test undefined != "$lt_cv_sys_max_cmd_len"; then
17837b58d2e0Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
17847b58d2e0Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
17857b58d2e0Smrg    else
17867b58d2e0Smrg      # Make teststring a little bigger before we do anything with it.
17877b58d2e0Smrg      # a 1K string should be a reasonable start.
1788f395c03eSmrg      for i in 1 2 3 4 5 6 7 8; do
17897b58d2e0Smrg        teststring=$teststring$teststring
17907b58d2e0Smrg      done
17917b58d2e0Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
17927b58d2e0Smrg      # If test is not a shell built-in, we'll probably end up computing a
17937b58d2e0Smrg      # maximum length that is only half of the actual maximum length, but
17947b58d2e0Smrg      # we can't tell.
1795f395c03eSmrg      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
1796b12e5c03Smrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
1797f395c03eSmrg	      test 17 != "$i" # 1/2 MB should be enough
17987b58d2e0Smrg      do
17997b58d2e0Smrg        i=`expr $i + 1`
18007b58d2e0Smrg        teststring=$teststring$teststring
18017b58d2e0Smrg      done
18027b58d2e0Smrg      # Only check the string length outside the loop.
18037b58d2e0Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
18047b58d2e0Smrg      teststring=
18057b58d2e0Smrg      # Add a significant safety factor because C++ compilers can tack on
18067b58d2e0Smrg      # massive amounts of additional arguments before passing them to the
18077b58d2e0Smrg      # linker.  It appears as though 1/2 is a usable value.
18087b58d2e0Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
18097b58d2e0Smrg    fi
18107b58d2e0Smrg    ;;
18117b58d2e0Smrg  esac
18127b58d2e0Smrg])
1813f395c03eSmrgif test -n "$lt_cv_sys_max_cmd_len"; then
18147b58d2e0Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
18157b58d2e0Smrgelse
18167b58d2e0Smrg  AC_MSG_RESULT(none)
18177b58d2e0Smrgfi
18187b58d2e0Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
18197b58d2e0Smrg_LT_DECL([], [max_cmd_len], [0],
18207b58d2e0Smrg    [What is the maximum length of a command?])
18217b58d2e0Smrg])# LT_CMD_MAX_LEN
182209885543Smrg
18237b58d2e0Smrg# Old name:
18247b58d2e0SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
18257b58d2e0Smrgdnl aclocal-1.4 backwards compatibility:
18267b58d2e0Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
182709885543Smrg
1828b698ba48Smrg
18297b58d2e0Smrg# _LT_HEADER_DLFCN
18307b58d2e0Smrg# ----------------
18317b58d2e0Smrgm4_defun([_LT_HEADER_DLFCN],
18327b58d2e0Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
18337b58d2e0Smrg])# _LT_HEADER_DLFCN
1834b698ba48Smrg
1835b698ba48Smrg
18367b58d2e0Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
18377b58d2e0Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
18387b58d2e0Smrg# ----------------------------------------------------------------
18397b58d2e0Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
18407b58d2e0Smrg[m4_require([_LT_HEADER_DLFCN])dnl
1841f395c03eSmrgif test yes = "$cross_compiling"; then :
18427b58d2e0Smrg  [$4]
18437b58d2e0Smrgelse
18447b58d2e0Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
18457b58d2e0Smrg  lt_status=$lt_dlunknown
18467b58d2e0Smrg  cat > conftest.$ac_ext <<_LT_EOF
1847b12e5c03Smrg[#line $LINENO "configure"
18487b58d2e0Smrg#include "confdefs.h"
1849b698ba48Smrg
18507b58d2e0Smrg#if HAVE_DLFCN_H
18517b58d2e0Smrg#include <dlfcn.h>
18527b58d2e0Smrg#endif
1853b698ba48Smrg
18547b58d2e0Smrg#include <stdio.h>
1855e4f6584cSmrg
18567b58d2e0Smrg#ifdef RTLD_GLOBAL
18577b58d2e0Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
18587b58d2e0Smrg#else
18597b58d2e0Smrg#  ifdef DL_GLOBAL
18607b58d2e0Smrg#    define LT_DLGLOBAL		DL_GLOBAL
18617b58d2e0Smrg#  else
18627b58d2e0Smrg#    define LT_DLGLOBAL		0
18637b58d2e0Smrg#  endif
18647b58d2e0Smrg#endif
1865e4f6584cSmrg
18667b58d2e0Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
18677b58d2e0Smrg   find out it does not work in some platform. */
18687b58d2e0Smrg#ifndef LT_DLLAZY_OR_NOW
18697b58d2e0Smrg#  ifdef RTLD_LAZY
18707b58d2e0Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
18717b58d2e0Smrg#  else
18727b58d2e0Smrg#    ifdef DL_LAZY
18737b58d2e0Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
18747b58d2e0Smrg#    else
18757b58d2e0Smrg#      ifdef RTLD_NOW
18767b58d2e0Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
18777b58d2e0Smrg#      else
18787b58d2e0Smrg#        ifdef DL_NOW
18797b58d2e0Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
18807b58d2e0Smrg#        else
18817b58d2e0Smrg#          define LT_DLLAZY_OR_NOW	0
18827b58d2e0Smrg#        endif
18837b58d2e0Smrg#      endif
18847b58d2e0Smrg#    endif
18857b58d2e0Smrg#  endif
18867b58d2e0Smrg#endif
1887e4f6584cSmrg
1888f395c03eSmrg/* When -fvisibility=hidden is used, assume the code has been annotated
1889b12e5c03Smrg   correspondingly for the symbols needed.  */
1890f395c03eSmrg#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1891b12e5c03Smrgint fnord () __attribute__((visibility("default")));
1892b12e5c03Smrg#endif
1893b12e5c03Smrg
1894b12e5c03Smrgint fnord () { return 42; }
18957b58d2e0Smrgint main ()
18967b58d2e0Smrg{
18977b58d2e0Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
18987b58d2e0Smrg  int status = $lt_dlunknown;
1899b698ba48Smrg
19007b58d2e0Smrg  if (self)
19017b58d2e0Smrg    {
19027b58d2e0Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1903b12e5c03Smrg      else
1904b12e5c03Smrg        {
1905b12e5c03Smrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
1906b12e5c03Smrg          else puts (dlerror ());
1907b12e5c03Smrg	}
19087b58d2e0Smrg      /* dlclose (self); */
19097b58d2e0Smrg    }
19107b58d2e0Smrg  else
19117b58d2e0Smrg    puts (dlerror ());
191209885543Smrg
19137b58d2e0Smrg  return status;
19147b58d2e0Smrg}]
19157b58d2e0Smrg_LT_EOF
1916f395c03eSmrg  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
19177b58d2e0Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
19187b58d2e0Smrg    lt_status=$?
19197b58d2e0Smrg    case x$lt_status in
19207b58d2e0Smrg      x$lt_dlno_uscore) $1 ;;
19217b58d2e0Smrg      x$lt_dlneed_uscore) $2 ;;
19227b58d2e0Smrg      x$lt_dlunknown|x*) $3 ;;
19237b58d2e0Smrg    esac
19247b58d2e0Smrg  else :
19257b58d2e0Smrg    # compilation failed
19267b58d2e0Smrg    $3
19277b58d2e0Smrg  fi
19287b58d2e0Smrgfi
19297b58d2e0Smrgrm -fr conftest*
19307b58d2e0Smrg])# _LT_TRY_DLOPEN_SELF
1931e4f6584cSmrg
1932e4f6584cSmrg
19337b58d2e0Smrg# LT_SYS_DLOPEN_SELF
19347b58d2e0Smrg# ------------------
19357b58d2e0SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
19367b58d2e0Smrg[m4_require([_LT_HEADER_DLFCN])dnl
1937f395c03eSmrgif test yes != "$enable_dlopen"; then
19387b58d2e0Smrg  enable_dlopen=unknown
19397b58d2e0Smrg  enable_dlopen_self=unknown
19407b58d2e0Smrg  enable_dlopen_self_static=unknown
19417b58d2e0Smrgelse
19427b58d2e0Smrg  lt_cv_dlopen=no
19437b58d2e0Smrg  lt_cv_dlopen_libs=
1944e4f6584cSmrg
19457b58d2e0Smrg  case $host_os in
19467b58d2e0Smrg  beos*)
1947f395c03eSmrg    lt_cv_dlopen=load_add_on
19487b58d2e0Smrg    lt_cv_dlopen_libs=
19497b58d2e0Smrg    lt_cv_dlopen_self=yes
19507b58d2e0Smrg    ;;
1951e4f6584cSmrg
19527b58d2e0Smrg  mingw* | pw32* | cegcc*)
1953f395c03eSmrg    lt_cv_dlopen=LoadLibrary
19547b58d2e0Smrg    lt_cv_dlopen_libs=
19557b58d2e0Smrg    ;;
1956e4f6584cSmrg
19577b58d2e0Smrg  cygwin*)
1958f395c03eSmrg    lt_cv_dlopen=dlopen
19597b58d2e0Smrg    lt_cv_dlopen_libs=
19607b58d2e0Smrg    ;;
196109885543Smrg
19627b58d2e0Smrg  darwin*)
1963f395c03eSmrg    # if libdl is installed we need to link against it
19647b58d2e0Smrg    AC_CHECK_LIB([dl], [dlopen],
1965f395c03eSmrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
1966f395c03eSmrg    lt_cv_dlopen=dyld
19677b58d2e0Smrg    lt_cv_dlopen_libs=
19687b58d2e0Smrg    lt_cv_dlopen_self=yes
19697b58d2e0Smrg    ])
19707b58d2e0Smrg    ;;
197109885543Smrg
1972f395c03eSmrg  tpf*)
1973f395c03eSmrg    # Don't try to run any link tests for TPF.  We know it's impossible
1974f395c03eSmrg    # because TPF is a cross-compiler, and we know how we open DSOs.
1975f395c03eSmrg    lt_cv_dlopen=dlopen
1976f395c03eSmrg    lt_cv_dlopen_libs=
1977f395c03eSmrg    lt_cv_dlopen_self=no
1978f395c03eSmrg    ;;
1979f395c03eSmrg
19807b58d2e0Smrg  *)
19817b58d2e0Smrg    AC_CHECK_FUNC([shl_load],
1982f395c03eSmrg	  [lt_cv_dlopen=shl_load],
19837b58d2e0Smrg      [AC_CHECK_LIB([dld], [shl_load],
1984f395c03eSmrg	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
19857b58d2e0Smrg	[AC_CHECK_FUNC([dlopen],
1986f395c03eSmrg	      [lt_cv_dlopen=dlopen],
19877b58d2e0Smrg	  [AC_CHECK_LIB([dl], [dlopen],
1988f395c03eSmrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
19897b58d2e0Smrg	    [AC_CHECK_LIB([svld], [dlopen],
1990f395c03eSmrg		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
19917b58d2e0Smrg	      [AC_CHECK_LIB([dld], [dld_link],
1992f395c03eSmrg		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
19937b58d2e0Smrg	      ])
19947b58d2e0Smrg	    ])
19957b58d2e0Smrg	  ])
19967b58d2e0Smrg	])
19977b58d2e0Smrg      ])
19987b58d2e0Smrg    ;;
19997b58d2e0Smrg  esac
200009885543Smrg
2001f395c03eSmrg  if test no = "$lt_cv_dlopen"; then
20027b58d2e0Smrg    enable_dlopen=no
2003f395c03eSmrg  else
2004f395c03eSmrg    enable_dlopen=yes
20057b58d2e0Smrg  fi
200609885543Smrg
20077b58d2e0Smrg  case $lt_cv_dlopen in
20087b58d2e0Smrg  dlopen)
2009f395c03eSmrg    save_CPPFLAGS=$CPPFLAGS
2010f395c03eSmrg    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
201109885543Smrg
2012f395c03eSmrg    save_LDFLAGS=$LDFLAGS
20137b58d2e0Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
201409885543Smrg
2015f395c03eSmrg    save_LIBS=$LIBS
20167b58d2e0Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
201709885543Smrg
20187b58d2e0Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
20197b58d2e0Smrg	  lt_cv_dlopen_self, [dnl
20207b58d2e0Smrg	  _LT_TRY_DLOPEN_SELF(
20217b58d2e0Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
20227b58d2e0Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
20237b58d2e0Smrg    ])
202409885543Smrg
2025f395c03eSmrg    if test yes = "$lt_cv_dlopen_self"; then
20267b58d2e0Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
20277b58d2e0Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
20287b58d2e0Smrg	  lt_cv_dlopen_self_static, [dnl
20297b58d2e0Smrg	  _LT_TRY_DLOPEN_SELF(
20307b58d2e0Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
20317b58d2e0Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
20327b58d2e0Smrg      ])
20337b58d2e0Smrg    fi
2034b698ba48Smrg
2035f395c03eSmrg    CPPFLAGS=$save_CPPFLAGS
2036f395c03eSmrg    LDFLAGS=$save_LDFLAGS
2037f395c03eSmrg    LIBS=$save_LIBS
20387b58d2e0Smrg    ;;
20397b58d2e0Smrg  esac
2040b698ba48Smrg
20417b58d2e0Smrg  case $lt_cv_dlopen_self in
20427b58d2e0Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
20437b58d2e0Smrg  *) enable_dlopen_self=unknown ;;
20447b58d2e0Smrg  esac
2045b698ba48Smrg
20467b58d2e0Smrg  case $lt_cv_dlopen_self_static in
20477b58d2e0Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
20487b58d2e0Smrg  *) enable_dlopen_self_static=unknown ;;
20497b58d2e0Smrg  esac
20507b58d2e0Smrgfi
20517b58d2e0Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
20527b58d2e0Smrg	 [Whether dlopen is supported])
20537b58d2e0Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
20547b58d2e0Smrg	 [Whether dlopen of programs is supported])
20557b58d2e0Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
20567b58d2e0Smrg	 [Whether dlopen of statically linked programs is supported])
20577b58d2e0Smrg])# LT_SYS_DLOPEN_SELF
2058b698ba48Smrg
20597b58d2e0Smrg# Old name:
20607b58d2e0SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
20617b58d2e0Smrgdnl aclocal-1.4 backwards compatibility:
20627b58d2e0Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
2063b698ba48Smrg
2064b698ba48Smrg
20657b58d2e0Smrg# _LT_COMPILER_C_O([TAGNAME])
20667b58d2e0Smrg# ---------------------------
20677b58d2e0Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
20687b58d2e0Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
20697b58d2e0Smrgm4_defun([_LT_COMPILER_C_O],
20707b58d2e0Smrg[m4_require([_LT_DECL_SED])dnl
20717b58d2e0Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
20727b58d2e0Smrgm4_require([_LT_TAG_COMPILER])dnl
20737b58d2e0SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
20747b58d2e0Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
20757b58d2e0Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
20767b58d2e0Smrg   $RM -r conftest 2>/dev/null
20777b58d2e0Smrg   mkdir conftest
20787b58d2e0Smrg   cd conftest
20797b58d2e0Smrg   mkdir out
20807b58d2e0Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2081b698ba48Smrg
20827b58d2e0Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
20837b58d2e0Smrg   # Insert the option either (1) after the last *FLAGS variable, or
20847b58d2e0Smrg   # (2) before a word containing "conftest.", or (3) at the end.
20857b58d2e0Smrg   # Note that $ac_compile itself does not contain backslashes and begins
20867b58d2e0Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
20877b58d2e0Smrg   lt_compile=`echo "$ac_compile" | $SED \
20887b58d2e0Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
20897b58d2e0Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
20907b58d2e0Smrg   -e 's:$: $lt_compiler_flag:'`
2091b12e5c03Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
20927b58d2e0Smrg   (eval "$lt_compile" 2>out/conftest.err)
20937b58d2e0Smrg   ac_status=$?
20947b58d2e0Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
2095b12e5c03Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
20967b58d2e0Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
20977b58d2e0Smrg   then
20987b58d2e0Smrg     # The compiler can only warn and ignore the option if not recognized
20997b58d2e0Smrg     # So say no if there are warnings
2100b12e5c03Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
21017b58d2e0Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
21027b58d2e0Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
21037b58d2e0Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
21047b58d2e0Smrg     fi
21057b58d2e0Smrg   fi
21067b58d2e0Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
21077b58d2e0Smrg   $RM conftest*
21087b58d2e0Smrg   # SGI C++ compiler will create directory out/ii_files/ for
21097b58d2e0Smrg   # template instantiation
21107b58d2e0Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
21117b58d2e0Smrg   $RM out/* && rmdir out
21127b58d2e0Smrg   cd ..
21137b58d2e0Smrg   $RM -r conftest
21147b58d2e0Smrg   $RM conftest*
21157b58d2e0Smrg])
21167b58d2e0Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
21177b58d2e0Smrg	[Does compiler simultaneously support -c and -o options?])
21187b58d2e0Smrg])# _LT_COMPILER_C_O
2119b698ba48Smrg
2120b698ba48Smrg
21217b58d2e0Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
21227b58d2e0Smrg# ----------------------------------
21237b58d2e0Smrg# Check to see if we can do hard links to lock some files if needed
21247b58d2e0Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
21257b58d2e0Smrg[m4_require([_LT_ENABLE_LOCK])dnl
21267b58d2e0Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
21277b58d2e0Smrg_LT_COMPILER_C_O([$1])
2128b698ba48Smrg
2129f395c03eSmrghard_links=nottested
2130f395c03eSmrgif test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
21317b58d2e0Smrg  # do not overwrite the value of need_locks provided by the user
21327b58d2e0Smrg  AC_MSG_CHECKING([if we can lock with hard links])
21337b58d2e0Smrg  hard_links=yes
21347b58d2e0Smrg  $RM conftest*
21357b58d2e0Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
21367b58d2e0Smrg  touch conftest.a
21377b58d2e0Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
21387b58d2e0Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
21397b58d2e0Smrg  AC_MSG_RESULT([$hard_links])
2140f395c03eSmrg  if test no = "$hard_links"; then
2141f395c03eSmrg    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
21427b58d2e0Smrg    need_locks=warn
21437b58d2e0Smrg  fi
21447b58d2e0Smrgelse
21457b58d2e0Smrg  need_locks=no
21467b58d2e0Smrgfi
21477b58d2e0Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
21487b58d2e0Smrg])# _LT_COMPILER_FILE_LOCKS
2149b698ba48Smrg
2150b698ba48Smrg
21517b58d2e0Smrg# _LT_CHECK_OBJDIR
2152e4f6584cSmrg# ----------------
21537b58d2e0Smrgm4_defun([_LT_CHECK_OBJDIR],
21547b58d2e0Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
21557b58d2e0Smrg[rm -f .libs 2>/dev/null
21567b58d2e0Smrgmkdir .libs 2>/dev/null
21577b58d2e0Smrgif test -d .libs; then
21587b58d2e0Smrg  lt_cv_objdir=.libs
21597b58d2e0Smrgelse
21607b58d2e0Smrg  # MS-DOS does not allow filenames that begin with a dot.
21617b58d2e0Smrg  lt_cv_objdir=_libs
21627b58d2e0Smrgfi
21637b58d2e0Smrgrmdir .libs 2>/dev/null])
21647b58d2e0Smrgobjdir=$lt_cv_objdir
21657b58d2e0Smrg_LT_DECL([], [objdir], [0],
21667b58d2e0Smrg         [The name of the directory that contains temporary libtool files])dnl
21677b58d2e0Smrgm4_pattern_allow([LT_OBJDIR])dnl
2168f395c03eSmrgAC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
2169f395c03eSmrg  [Define to the sub-directory where libtool stores uninstalled libraries.])
21707b58d2e0Smrg])# _LT_CHECK_OBJDIR
217109885543Smrg
2172b698ba48Smrg
21737b58d2e0Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
21747b58d2e0Smrg# --------------------------------------
21757b58d2e0Smrg# Check hardcoding attributes.
21767b58d2e0Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
21777b58d2e0Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
21787b58d2e0Smrg_LT_TAGVAR(hardcode_action, $1)=
21797b58d2e0Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
21807b58d2e0Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
2181f395c03eSmrg   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
218209885543Smrg
21837b58d2e0Smrg  # We can hardcode non-existent directories.
2184f395c03eSmrg  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
21857b58d2e0Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
21867b58d2e0Smrg     # have to relink, otherwise we might link with an installed library
21877b58d2e0Smrg     # when we should be linking with a yet-to-be-installed one
2188f395c03eSmrg     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
2189f395c03eSmrg     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
21907b58d2e0Smrg    # Linking always hardcodes the temporary library directory.
21917b58d2e0Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
21927b58d2e0Smrg  else
21937b58d2e0Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
21947b58d2e0Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
21957b58d2e0Smrg  fi
21967b58d2e0Smrgelse
21977b58d2e0Smrg  # We cannot hardcode anything, or else we can only hardcode existing
21987b58d2e0Smrg  # directories.
21997b58d2e0Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
22007b58d2e0Smrgfi
22017b58d2e0SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
220209885543Smrg
2203f395c03eSmrgif test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
2204f395c03eSmrg   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
22057b58d2e0Smrg  # Fast installation is not supported
22067b58d2e0Smrg  enable_fast_install=no
2207f395c03eSmrgelif test yes = "$shlibpath_overrides_runpath" ||
2208f395c03eSmrg     test no = "$enable_shared"; then
22097b58d2e0Smrg  # Fast installation is not necessary
22107b58d2e0Smrg  enable_fast_install=needless
22117b58d2e0Smrgfi
22127b58d2e0Smrg_LT_TAGDECL([], [hardcode_action], [0],
22137b58d2e0Smrg    [How to hardcode a shared library path into an executable])
22147b58d2e0Smrg])# _LT_LINKER_HARDCODE_LIBPATH
2215b698ba48Smrg
2216b698ba48Smrg
22177b58d2e0Smrg# _LT_CMD_STRIPLIB
22187b58d2e0Smrg# ----------------
22197b58d2e0Smrgm4_defun([_LT_CMD_STRIPLIB],
22207b58d2e0Smrg[m4_require([_LT_DECL_EGREP])
22217b58d2e0Smrgstriplib=
22227b58d2e0Smrgold_striplib=
22237b58d2e0SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
22247b58d2e0Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
22257b58d2e0Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
22267b58d2e0Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
22277b58d2e0Smrg  AC_MSG_RESULT([yes])
22287b58d2e0Smrgelse
22297b58d2e0Smrg# FIXME - insert some real tests, host_os isn't really good enough
22307b58d2e0Smrg  case $host_os in
22317b58d2e0Smrg  darwin*)
2232f395c03eSmrg    if test -n "$STRIP"; then
22337b58d2e0Smrg      striplib="$STRIP -x"
22347b58d2e0Smrg      old_striplib="$STRIP -S"
22357b58d2e0Smrg      AC_MSG_RESULT([yes])
22367b58d2e0Smrg    else
22377b58d2e0Smrg      AC_MSG_RESULT([no])
22387b58d2e0Smrg    fi
22397b58d2e0Smrg    ;;
22407b58d2e0Smrg  *)
22417b58d2e0Smrg    AC_MSG_RESULT([no])
22427b58d2e0Smrg    ;;
22437b58d2e0Smrg  esac
22447b58d2e0Smrgfi
22457b58d2e0Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
22467b58d2e0Smrg_LT_DECL([], [striplib], [1])
22477b58d2e0Smrg])# _LT_CMD_STRIPLIB
2248b698ba48Smrg
2249e4f6584cSmrg
2250f395c03eSmrg# _LT_PREPARE_MUNGE_PATH_LIST
2251f395c03eSmrg# ---------------------------
2252f395c03eSmrg# Make sure func_munge_path_list() is defined correctly.
2253f395c03eSmrgm4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
2254f395c03eSmrg[[# func_munge_path_list VARIABLE PATH
2255f395c03eSmrg# -----------------------------------
2256f395c03eSmrg# VARIABLE is name of variable containing _space_ separated list of
2257f395c03eSmrg# directories to be munged by the contents of PATH, which is string
2258f395c03eSmrg# having a format:
2259f395c03eSmrg# "DIR[:DIR]:"
2260f395c03eSmrg#       string "DIR[ DIR]" will be prepended to VARIABLE
2261f395c03eSmrg# ":DIR[:DIR]"
2262f395c03eSmrg#       string "DIR[ DIR]" will be appended to VARIABLE
2263f395c03eSmrg# "DIRP[:DIRP]::[DIRA:]DIRA"
2264f395c03eSmrg#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
2265f395c03eSmrg#       "DIRA[ DIRA]" will be appended to VARIABLE
2266f395c03eSmrg# "DIR[:DIR]"
2267f395c03eSmrg#       VARIABLE will be replaced by "DIR[ DIR]"
2268f395c03eSmrgfunc_munge_path_list ()
2269f395c03eSmrg{
2270f395c03eSmrg    case x@S|@2 in
2271f395c03eSmrg    x)
2272f395c03eSmrg        ;;
2273f395c03eSmrg    *:)
2274f395c03eSmrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
2275f395c03eSmrg        ;;
2276f395c03eSmrg    x:*)
2277f395c03eSmrg        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
2278f395c03eSmrg        ;;
2279f395c03eSmrg    *::*)
2280f395c03eSmrg        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
2281f395c03eSmrg        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
2282f395c03eSmrg        ;;
2283f395c03eSmrg    *)
2284f395c03eSmrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
2285f395c03eSmrg        ;;
2286f395c03eSmrg    esac
2287f395c03eSmrg}
2288f395c03eSmrg]])# _LT_PREPARE_PATH_LIST
2289f395c03eSmrg
2290f395c03eSmrg
22917b58d2e0Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
22927b58d2e0Smrg# -----------------------------
22937b58d2e0Smrg# PORTME Fill in your ld.so characteristics
22947b58d2e0Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
22957b58d2e0Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
22967b58d2e0Smrgm4_require([_LT_DECL_EGREP])dnl
22977b58d2e0Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
22987b58d2e0Smrgm4_require([_LT_DECL_OBJDUMP])dnl
22997b58d2e0Smrgm4_require([_LT_DECL_SED])dnl
2300b12e5c03Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
2301f395c03eSmrgm4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
23027b58d2e0SmrgAC_MSG_CHECKING([dynamic linker characteristics])
23037b58d2e0Smrgm4_if([$1],
23047b58d2e0Smrg	[], [
2305f395c03eSmrgif test yes = "$GCC"; then
23067b58d2e0Smrg  case $host_os in
2307f395c03eSmrg    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
2308f395c03eSmrg    *) lt_awk_arg='/^libraries:/' ;;
23097b58d2e0Smrg  esac
2310b12e5c03Smrg  case $host_os in
2311f395c03eSmrg    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
2312f395c03eSmrg    *) lt_sed_strip_eq='s|=/|/|g' ;;
2313b12e5c03Smrg  esac
2314b12e5c03Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
2315b12e5c03Smrg  case $lt_search_path_spec in
2316b12e5c03Smrg  *\;*)
23177b58d2e0Smrg    # if the path contains ";" then we assume it to be the separator
23187b58d2e0Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
23197b58d2e0Smrg    # assumed that no part of a normal pathname contains ";" but that should
23207b58d2e0Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
2321b12e5c03Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
2322b12e5c03Smrg    ;;
2323b12e5c03Smrg  *)
2324b12e5c03Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
2325b12e5c03Smrg    ;;
2326b12e5c03Smrg  esac
23277b58d2e0Smrg  # Ok, now we have the path, separated by spaces, we can step through it
2328f395c03eSmrg  # and add multilib dir if necessary...
23297b58d2e0Smrg  lt_tmp_lt_search_path_spec=
2330f395c03eSmrg  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2331f395c03eSmrg  # ...but if some path component already ends with the multilib dir we assume
2332f395c03eSmrg  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
2333f395c03eSmrg  case "$lt_multi_os_dir; $lt_search_path_spec " in
2334f395c03eSmrg  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
2335f395c03eSmrg    lt_multi_os_dir=
2336f395c03eSmrg    ;;
2337f395c03eSmrg  esac
23387b58d2e0Smrg  for lt_sys_path in $lt_search_path_spec; do
2339f395c03eSmrg    if test -d "$lt_sys_path$lt_multi_os_dir"; then
2340f395c03eSmrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
2341f395c03eSmrg    elif test -n "$lt_multi_os_dir"; then
23427b58d2e0Smrg      test -d "$lt_sys_path" && \
23437b58d2e0Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
23447b58d2e0Smrg    fi
23457b58d2e0Smrg  done
2346b12e5c03Smrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
2347f395c03eSmrgBEGIN {RS = " "; FS = "/|\n";} {
2348f395c03eSmrg  lt_foo = "";
2349f395c03eSmrg  lt_count = 0;
23507b58d2e0Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
23517b58d2e0Smrg    if ($lt_i != "" && $lt_i != ".") {
23527b58d2e0Smrg      if ($lt_i == "..") {
23537b58d2e0Smrg        lt_count++;
23547b58d2e0Smrg      } else {
23557b58d2e0Smrg        if (lt_count == 0) {
2356f395c03eSmrg          lt_foo = "/" $lt_i lt_foo;
23577b58d2e0Smrg        } else {
23587b58d2e0Smrg          lt_count--;
23597b58d2e0Smrg        }
23607b58d2e0Smrg      }
23617b58d2e0Smrg    }
23627b58d2e0Smrg  }
23637b58d2e0Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
23647b58d2e0Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
23657b58d2e0Smrg}'`
2366b12e5c03Smrg  # AWK program above erroneously prepends '/' to C:/dos/paths
2367b12e5c03Smrg  # for these hosts.
2368b12e5c03Smrg  case $host_os in
2369b12e5c03Smrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
2370f395c03eSmrg      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
2371b12e5c03Smrg  esac
2372b12e5c03Smrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
23737b58d2e0Smrgelse
23747b58d2e0Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
23757b58d2e0Smrgfi])
23767b58d2e0Smrglibrary_names_spec=
23777b58d2e0Smrglibname_spec='lib$name'
23787b58d2e0Smrgsoname_spec=
2379f395c03eSmrgshrext_cmds=.so
23807b58d2e0Smrgpostinstall_cmds=
23817b58d2e0Smrgpostuninstall_cmds=
23827b58d2e0Smrgfinish_cmds=
23837b58d2e0Smrgfinish_eval=
23847b58d2e0Smrgshlibpath_var=
23857b58d2e0Smrgshlibpath_overrides_runpath=unknown
23867b58d2e0Smrgversion_type=none
23877b58d2e0Smrgdynamic_linker="$host_os ld.so"
23887b58d2e0Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
23897b58d2e0Smrgneed_lib_prefix=unknown
23907b58d2e0Smrghardcode_into_libs=no
2391e4f6584cSmrg
23927b58d2e0Smrg# when you set need_version to no, make sure it does not cause -set_version
23937b58d2e0Smrg# flags to be left without arguments
23947b58d2e0Smrgneed_version=unknown
2395b698ba48Smrg
2396f395c03eSmrgAC_ARG_VAR([LT_SYS_LIBRARY_PATH],
2397f395c03eSmrg[User-defined run-time library search path.])
2398f395c03eSmrg
23997b58d2e0Smrgcase $host_os in
24007b58d2e0Smrgaix3*)
2401b12e5c03Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2402f395c03eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
24037b58d2e0Smrg  shlibpath_var=LIBPATH
2404b698ba48Smrg
24057b58d2e0Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
2406f395c03eSmrg  soname_spec='$libname$release$shared_ext$major'
24077b58d2e0Smrg  ;;
2408e4f6584cSmrg
24097b58d2e0Smrgaix[[4-9]]*)
2410b12e5c03Smrg  version_type=linux # correct to gnu/linux during the next big refactor
24117b58d2e0Smrg  need_lib_prefix=no
24127b58d2e0Smrg  need_version=no
24137b58d2e0Smrg  hardcode_into_libs=yes
2414f395c03eSmrg  if test ia64 = "$host_cpu"; then
24157b58d2e0Smrg    # AIX 5 supports IA64
2416f395c03eSmrg    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
24177b58d2e0Smrg    shlibpath_var=LD_LIBRARY_PATH
24187b58d2e0Smrg  else
24197b58d2e0Smrg    # With GCC up to 2.95.x, collect2 would create an import file
24207b58d2e0Smrg    # for dependence libraries.  The import file would start with
2421f395c03eSmrg    # the line '#! .'.  This would cause the generated library to
2422f395c03eSmrg    # depend on '.', always an invalid library.  This was fixed in
24237b58d2e0Smrg    # development snapshots of GCC prior to 3.0.
24247b58d2e0Smrg    case $host_os in
24257b58d2e0Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
24267b58d2e0Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
24277b58d2e0Smrg	   echo ' yes '
2428f395c03eSmrg	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
24297b58d2e0Smrg	:
24307b58d2e0Smrg      else
24317b58d2e0Smrg	can_build_shared=no
24327b58d2e0Smrg      fi
24332ec8c4b4Smrg      ;;
2434b698ba48Smrg    esac
2435f395c03eSmrg    # Using Import Files as archive members, it is possible to support
2436f395c03eSmrg    # filename-based versioning of shared library archives on AIX. While
2437f395c03eSmrg    # this would work for both with and without runtime linking, it will
2438f395c03eSmrg    # prevent static linking of such archives. So we do filename-based
2439f395c03eSmrg    # shared library versioning with .so extension only, which is used
2440f395c03eSmrg    # when both runtime linking and shared linking is enabled.
2441f395c03eSmrg    # Unfortunately, runtime linking may impact performance, so we do
2442f395c03eSmrg    # not want this to be the default eventually. Also, we use the
2443f395c03eSmrg    # versioned .so libs for executables only if there is the -brtl
2444f395c03eSmrg    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
2445f395c03eSmrg    # To allow for filename-based versioning support, we need to create
2446f395c03eSmrg    # libNAME.so.V as an archive file, containing:
2447f395c03eSmrg    # *) an Import File, referring to the versioned filename of the
2448f395c03eSmrg    #    archive as well as the shared archive member, telling the
2449f395c03eSmrg    #    bitwidth (32 or 64) of that shared object, and providing the
2450f395c03eSmrg    #    list of exported symbols of that shared object, eventually
2451f395c03eSmrg    #    decorated with the 'weak' keyword
2452f395c03eSmrg    # *) the shared object with the F_LOADONLY flag set, to really avoid
2453f395c03eSmrg    #    it being seen by the linker.
2454f395c03eSmrg    # At run time we better use the real file rather than another symlink,
2455f395c03eSmrg    # but for link time we create the symlink libNAME.so -> libNAME.so.V
2456f395c03eSmrg
2457f395c03eSmrg    case $with_aix_soname,$aix_use_runtimelinking in
2458f395c03eSmrg    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
24597b58d2e0Smrg    # soname into executable. Probably we can add versioning support to
24607b58d2e0Smrg    # collect2, so additional links can be useful in future.
2461f395c03eSmrg    aix,yes) # traditional libtool
2462f395c03eSmrg      dynamic_linker='AIX unversionable lib.so'
24637b58d2e0Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
24647b58d2e0Smrg      # instead of lib<name>.a to let people know that these are not
24657b58d2e0Smrg      # typical AIX shared libraries.
2466f395c03eSmrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2467f395c03eSmrg      ;;
2468f395c03eSmrg    aix,no) # traditional AIX only
2469f395c03eSmrg      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
24707b58d2e0Smrg      # We preserve .a as extension for shared libraries through AIX4.2
24717b58d2e0Smrg      # and later when we are not doing run time linking.
2472f395c03eSmrg      library_names_spec='$libname$release.a $libname.a'
2473f395c03eSmrg      soname_spec='$libname$release$shared_ext$major'
2474f395c03eSmrg      ;;
2475f395c03eSmrg    svr4,*) # full svr4 only
2476f395c03eSmrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
2477f395c03eSmrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2478f395c03eSmrg      # We do not specify a path in Import Files, so LIBPATH fires.
2479f395c03eSmrg      shlibpath_overrides_runpath=yes
2480f395c03eSmrg      ;;
2481f395c03eSmrg    *,yes) # both, prefer svr4
2482f395c03eSmrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
2483f395c03eSmrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2484f395c03eSmrg      # unpreferred sharedlib libNAME.a needs extra handling
2485f395c03eSmrg      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"'
2486f395c03eSmrg      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"'
2487f395c03eSmrg      # We do not specify a path in Import Files, so LIBPATH fires.
2488f395c03eSmrg      shlibpath_overrides_runpath=yes
2489f395c03eSmrg      ;;
2490f395c03eSmrg    *,no) # both, prefer aix
2491f395c03eSmrg      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
2492f395c03eSmrg      library_names_spec='$libname$release.a $libname.a'
2493f395c03eSmrg      soname_spec='$libname$release$shared_ext$major'
2494f395c03eSmrg      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
2495f395c03eSmrg      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)'
2496f395c03eSmrg      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"'
2497f395c03eSmrg      ;;
2498f395c03eSmrg    esac
24997b58d2e0Smrg    shlibpath_var=LIBPATH
25007b58d2e0Smrg  fi
2501e4f6584cSmrg  ;;
2502b698ba48Smrg
25037b58d2e0Smrgamigaos*)
25047b58d2e0Smrg  case $host_cpu in
25057b58d2e0Smrg  powerpc)
25067b58d2e0Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
25077b58d2e0Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2508f395c03eSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
25097b58d2e0Smrg    ;;
25107b58d2e0Smrg  m68k)
25117b58d2e0Smrg    library_names_spec='$libname.ixlibrary $libname.a'
25127b58d2e0Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
2513f395c03eSmrg    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'
25147b58d2e0Smrg    ;;
25157b58d2e0Smrg  esac
25167b58d2e0Smrg  ;;
2517e4f6584cSmrg
25187b58d2e0Smrgbeos*)
2519f395c03eSmrg  library_names_spec='$libname$shared_ext'
25207b58d2e0Smrg  dynamic_linker="$host_os ld.so"
25217b58d2e0Smrg  shlibpath_var=LIBRARY_PATH
25227b58d2e0Smrg  ;;
2523e4f6584cSmrg
25247b58d2e0Smrgbsdi[[45]]*)
2525b12e5c03Smrg  version_type=linux # correct to gnu/linux during the next big refactor
25267b58d2e0Smrg  need_version=no
2527f395c03eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2528f395c03eSmrg  soname_spec='$libname$release$shared_ext$major'
25297b58d2e0Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
25307b58d2e0Smrg  shlibpath_var=LD_LIBRARY_PATH
25317b58d2e0Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
25327b58d2e0Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
25337b58d2e0Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
25347b58d2e0Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
25357b58d2e0Smrg  # libtool to hard-code these into programs
25367b58d2e0Smrg  ;;
2537e4f6584cSmrg
25387b58d2e0Smrgcygwin* | mingw* | pw32* | cegcc*)
25397b58d2e0Smrg  version_type=windows
2540f395c03eSmrg  shrext_cmds=.dll
25417b58d2e0Smrg  need_version=no
25427b58d2e0Smrg  need_lib_prefix=no
2543e4f6584cSmrg
2544b12e5c03Smrg  case $GCC,$cc_basename in
2545b12e5c03Smrg  yes,*)
2546b12e5c03Smrg    # gcc
25477b58d2e0Smrg    library_names_spec='$libname.dll.a'
25487b58d2e0Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2549f395c03eSmrg    postinstall_cmds='base_file=`basename \$file`~
2550f395c03eSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
25517b58d2e0Smrg      dldir=$destdir/`dirname \$dlpath`~
25527b58d2e0Smrg      test -d \$dldir || mkdir -p \$dldir~
25537b58d2e0Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
25547b58d2e0Smrg      chmod a+x \$dldir/$dlname~
25557b58d2e0Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
25567b58d2e0Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
25577b58d2e0Smrg      fi'
25587b58d2e0Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
25597b58d2e0Smrg      dlpath=$dir/\$dldll~
25607b58d2e0Smrg       $RM \$dlpath'
25617b58d2e0Smrg    shlibpath_overrides_runpath=yes
2562e4f6584cSmrg
25637b58d2e0Smrg    case $host_os in
25647b58d2e0Smrg    cygwin*)
25657b58d2e0Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2566f395c03eSmrg      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2567b12e5c03Smrgm4_if([$1], [],[
2568b12e5c03Smrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
25697b58d2e0Smrg      ;;
25707b58d2e0Smrg    mingw* | cegcc*)
25717b58d2e0Smrg      # MinGW DLLs use traditional 'lib' prefix
2572f395c03eSmrg      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
25737b58d2e0Smrg      ;;
25747b58d2e0Smrg    pw32*)
25757b58d2e0Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
2576f395c03eSmrg      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
25777b58d2e0Smrg      ;;
25787b58d2e0Smrg    esac
2579b12e5c03Smrg    dynamic_linker='Win32 ld.exe'
2580b12e5c03Smrg    ;;
2581b12e5c03Smrg
2582b12e5c03Smrg  *,cl*)
2583b12e5c03Smrg    # Native MSVC
2584b12e5c03Smrg    libname_spec='$name'
2585f395c03eSmrg    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2586f395c03eSmrg    library_names_spec='$libname.dll.lib'
2587b12e5c03Smrg
2588b12e5c03Smrg    case $build_os in
2589b12e5c03Smrg    mingw*)
2590b12e5c03Smrg      sys_lib_search_path_spec=
2591b12e5c03Smrg      lt_save_ifs=$IFS
2592b12e5c03Smrg      IFS=';'
2593b12e5c03Smrg      for lt_path in $LIB
2594b12e5c03Smrg      do
2595b12e5c03Smrg        IFS=$lt_save_ifs
2596b12e5c03Smrg        # Let DOS variable expansion print the short 8.3 style file name.
2597b12e5c03Smrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
2598b12e5c03Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
2599b12e5c03Smrg      done
2600b12e5c03Smrg      IFS=$lt_save_ifs
2601b12e5c03Smrg      # Convert to MSYS style.
2602b12e5c03Smrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
2603b12e5c03Smrg      ;;
2604b12e5c03Smrg    cygwin*)
2605b12e5c03Smrg      # Convert to unix form, then to dos form, then back to unix form
2606b12e5c03Smrg      # but this time dos style (no spaces!) so that the unix form looks
2607b12e5c03Smrg      # like /cygdrive/c/PROGRA~1:/cygdr...
2608b12e5c03Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
2609b12e5c03Smrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
2610b12e5c03Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2611b12e5c03Smrg      ;;
2612b12e5c03Smrg    *)
2613f395c03eSmrg      sys_lib_search_path_spec=$LIB
2614b12e5c03Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2615b12e5c03Smrg        # It is most probably a Windows format PATH.
2616b12e5c03Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2617b12e5c03Smrg      else
2618b12e5c03Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2619b12e5c03Smrg      fi
2620b12e5c03Smrg      # FIXME: find the short name or the path components, as spaces are
2621b12e5c03Smrg      # common. (e.g. "Program Files" -> "PROGRA~1")
2622b12e5c03Smrg      ;;
2623b12e5c03Smrg    esac
2624b12e5c03Smrg
2625b12e5c03Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2626f395c03eSmrg    postinstall_cmds='base_file=`basename \$file`~
2627f395c03eSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2628b12e5c03Smrg      dldir=$destdir/`dirname \$dlpath`~
2629b12e5c03Smrg      test -d \$dldir || mkdir -p \$dldir~
2630b12e5c03Smrg      $install_prog $dir/$dlname \$dldir/$dlname'
2631b12e5c03Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2632b12e5c03Smrg      dlpath=$dir/\$dldll~
2633b12e5c03Smrg       $RM \$dlpath'
2634b12e5c03Smrg    shlibpath_overrides_runpath=yes
2635b12e5c03Smrg    dynamic_linker='Win32 link.exe'
26367b58d2e0Smrg    ;;
2637e4f6584cSmrg
26387b58d2e0Smrg  *)
2639b12e5c03Smrg    # Assume MSVC wrapper
2640f395c03eSmrg    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
2641b12e5c03Smrg    dynamic_linker='Win32 ld.exe'
26427b58d2e0Smrg    ;;
26437b58d2e0Smrg  esac
26447b58d2e0Smrg  # FIXME: first we should search . and the directory the executable is in
26457b58d2e0Smrg  shlibpath_var=PATH
26467b58d2e0Smrg  ;;
2647e4f6584cSmrg
26487b58d2e0Smrgdarwin* | rhapsody*)
26497b58d2e0Smrg  dynamic_linker="$host_os dyld"
26507b58d2e0Smrg  version_type=darwin
26517b58d2e0Smrg  need_lib_prefix=no
26527b58d2e0Smrg  need_version=no
2653f395c03eSmrg  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
2654f395c03eSmrg  soname_spec='$libname$release$major$shared_ext'
26557b58d2e0Smrg  shlibpath_overrides_runpath=yes
26567b58d2e0Smrg  shlibpath_var=DYLD_LIBRARY_PATH
26577b58d2e0Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
26587b58d2e0Smrgm4_if([$1], [],[
26597b58d2e0Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
26607b58d2e0Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
26617b58d2e0Smrg  ;;
2662e4f6584cSmrg
26637b58d2e0Smrgdgux*)
2664b12e5c03Smrg  version_type=linux # correct to gnu/linux during the next big refactor
26657b58d2e0Smrg  need_lib_prefix=no
26667b58d2e0Smrg  need_version=no
2667f395c03eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2668f395c03eSmrg  soname_spec='$libname$release$shared_ext$major'
26697b58d2e0Smrg  shlibpath_var=LD_LIBRARY_PATH
26707b58d2e0Smrg  ;;
2671e4f6584cSmrg
26727b58d2e0Smrgfreebsd* | dragonfly*)
26737b58d2e0Smrg  # DragonFly does not have aout.  When/if they implement a new
26747b58d2e0Smrg  # versioning mechanism, adjust this.
26757b58d2e0Smrg  if test -x /usr/bin/objformat; then
26767b58d2e0Smrg    objformat=`/usr/bin/objformat`
26777b58d2e0Smrg  else
26787b58d2e0Smrg    case $host_os in
2679b12e5c03Smrg    freebsd[[23]].*) objformat=aout ;;
26807b58d2e0Smrg    *) objformat=elf ;;
26817b58d2e0Smrg    esac
26827b58d2e0Smrg  fi
2683f395c03eSmrg  # Handle Gentoo/FreeBSD as it was Linux
2684f395c03eSmrg  case $host_vendor in
2685f395c03eSmrg    gentoo)
2686f395c03eSmrg      version_type=linux ;;
2687f395c03eSmrg    *)
2688f395c03eSmrg      version_type=freebsd-$objformat ;;
2689f395c03eSmrg  esac
2690f395c03eSmrg
26917b58d2e0Smrg  case $version_type in
26927b58d2e0Smrg    freebsd-elf*)
2693f395c03eSmrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2694f395c03eSmrg      soname_spec='$libname$release$shared_ext$major'
26957b58d2e0Smrg      need_version=no
26967b58d2e0Smrg      need_lib_prefix=no
26977b58d2e0Smrg      ;;
26987b58d2e0Smrg    freebsd-*)
2699f395c03eSmrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
27007b58d2e0Smrg      need_version=yes
27017b58d2e0Smrg      ;;
2702f395c03eSmrg    linux)
2703f395c03eSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2704f395c03eSmrg      soname_spec='${libname}${release}${shared_ext}$major'
2705f395c03eSmrg      need_lib_prefix=no
2706f395c03eSmrg      need_version=no
2707f395c03eSmrg      ;;
2708e4f6584cSmrg  esac
27097b58d2e0Smrg  shlibpath_var=LD_LIBRARY_PATH
27107b58d2e0Smrg  case $host_os in
2711b12e5c03Smrg  freebsd2.*)
27127b58d2e0Smrg    shlibpath_overrides_runpath=yes
27137b58d2e0Smrg    ;;
27147b58d2e0Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
27157b58d2e0Smrg    shlibpath_overrides_runpath=yes
27167b58d2e0Smrg    hardcode_into_libs=yes
27177b58d2e0Smrg    ;;
27187b58d2e0Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
27197b58d2e0Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
27207b58d2e0Smrg    shlibpath_overrides_runpath=no
27217b58d2e0Smrg    hardcode_into_libs=yes
27227b58d2e0Smrg    ;;
27237b58d2e0Smrg  *) # from 4.6 on, and DragonFly
27247b58d2e0Smrg    shlibpath_overrides_runpath=yes
27257b58d2e0Smrg    hardcode_into_libs=yes
27267b58d2e0Smrg    ;;
27277b58d2e0Smrg  esac
27287b58d2e0Smrg  ;;
2729e4f6584cSmrg
2730b12e5c03Smrghaiku*)
2731b12e5c03Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2732b12e5c03Smrg  need_lib_prefix=no
2733b12e5c03Smrg  need_version=no
2734b12e5c03Smrg  dynamic_linker="$host_os runtime_loader"
2735f395c03eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2736f395c03eSmrg  soname_spec='$libname$release$shared_ext$major'
2737b12e5c03Smrg  shlibpath_var=LIBRARY_PATH
2738f395c03eSmrg  shlibpath_overrides_runpath=no
2739b12e5c03Smrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
27407b58d2e0Smrg  hardcode_into_libs=yes
27417b58d2e0Smrg  ;;
2742e4f6584cSmrg
27437b58d2e0Smrghpux9* | hpux10* | hpux11*)
27447b58d2e0Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
27457b58d2e0Smrg  # link against other versions.
27467b58d2e0Smrg  version_type=sunos
27477b58d2e0Smrg  need_lib_prefix=no
27487b58d2e0Smrg  need_version=no
27497b58d2e0Smrg  case $host_cpu in
27507b58d2e0Smrg  ia64*)
27517b58d2e0Smrg    shrext_cmds='.so'
27527b58d2e0Smrg    hardcode_into_libs=yes
27537b58d2e0Smrg    dynamic_linker="$host_os dld.so"
27547b58d2e0Smrg    shlibpath_var=LD_LIBRARY_PATH
27557b58d2e0Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2756f395c03eSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2757f395c03eSmrg    soname_spec='$libname$release$shared_ext$major'
2758f395c03eSmrg    if test 32 = "$HPUX_IA64_MODE"; then
27597b58d2e0Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2760f395c03eSmrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
27617b58d2e0Smrg    else
27627b58d2e0Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2763f395c03eSmrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
2764b698ba48Smrg    fi
27657b58d2e0Smrg    ;;
27667b58d2e0Smrg  hppa*64*)
27677b58d2e0Smrg    shrext_cmds='.sl'
27687b58d2e0Smrg    hardcode_into_libs=yes
27697b58d2e0Smrg    dynamic_linker="$host_os dld.sl"
27707b58d2e0Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
27717b58d2e0Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2772f395c03eSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2773f395c03eSmrg    soname_spec='$libname$release$shared_ext$major'
27747b58d2e0Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
27757b58d2e0Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
27767b58d2e0Smrg    ;;
27777b58d2e0Smrg  *)
27787b58d2e0Smrg    shrext_cmds='.sl'
27797b58d2e0Smrg    dynamic_linker="$host_os dld.sl"
27807b58d2e0Smrg    shlibpath_var=SHLIB_PATH
27817b58d2e0Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2782f395c03eSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2783f395c03eSmrg    soname_spec='$libname$release$shared_ext$major'
27847b58d2e0Smrg    ;;
27857b58d2e0Smrg  esac
2786b12e5c03Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
27877b58d2e0Smrg  postinstall_cmds='chmod 555 $lib'
2788b12e5c03Smrg  # or fails outright, so override atomically:
2789b12e5c03Smrg  install_override_mode=555
27907b58d2e0Smrg  ;;
2791e4f6584cSmrg
27927b58d2e0Smrginterix[[3-9]]*)
2793b12e5c03Smrg  version_type=linux # correct to gnu/linux during the next big refactor
27947b58d2e0Smrg  need_lib_prefix=no
27957b58d2e0Smrg  need_version=no
2796f395c03eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2797f395c03eSmrg  soname_spec='$libname$release$shared_ext$major'
27987b58d2e0Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
27997b58d2e0Smrg  shlibpath_var=LD_LIBRARY_PATH
28007b58d2e0Smrg  shlibpath_overrides_runpath=no
28017b58d2e0Smrg  hardcode_into_libs=yes
28027b58d2e0Smrg  ;;
2803e4f6584cSmrg
28047b58d2e0Smrgirix5* | irix6* | nonstopux*)
2805e4f6584cSmrg  case $host_os in
28067b58d2e0Smrg    nonstopux*) version_type=nonstopux ;;
28077b58d2e0Smrg    *)
2808f395c03eSmrg	if test yes = "$lt_cv_prog_gnu_ld"; then
2809b12e5c03Smrg		version_type=linux # correct to gnu/linux during the next big refactor
28107b58d2e0Smrg	else
28117b58d2e0Smrg		version_type=irix
28127b58d2e0Smrg	fi ;;
28137b58d2e0Smrg  esac
28147b58d2e0Smrg  need_lib_prefix=no
28157b58d2e0Smrg  need_version=no
2816f395c03eSmrg  soname_spec='$libname$release$shared_ext$major'
2817f395c03eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
28187b58d2e0Smrg  case $host_os in
28197b58d2e0Smrg  irix5* | nonstopux*)
28207b58d2e0Smrg    libsuff= shlibsuff=
28217b58d2e0Smrg    ;;
28227b58d2e0Smrg  *)
28237b58d2e0Smrg    case $LD in # libtool.m4 will add one of these switches to LD
28247b58d2e0Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
28257b58d2e0Smrg      libsuff= shlibsuff= libmagic=32-bit;;
28267b58d2e0Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
28277b58d2e0Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
28287b58d2e0Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
28297b58d2e0Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
28307b58d2e0Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
28317b58d2e0Smrg    esac
2832b698ba48Smrg    ;;
2833e4f6584cSmrg  esac
28347b58d2e0Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
28357b58d2e0Smrg  shlibpath_overrides_runpath=no
2836f395c03eSmrg  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
2837f395c03eSmrg  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
28387b58d2e0Smrg  hardcode_into_libs=yes
28397b58d2e0Smrg  ;;
2840b698ba48Smrg
28417b58d2e0Smrg# No shared lib support for Linux oldld, aout, or coff.
28427b58d2e0Smrglinux*oldld* | linux*aout* | linux*coff*)
28437b58d2e0Smrg  dynamic_linker=no
28447b58d2e0Smrg  ;;
2845b698ba48Smrg
2846f395c03eSmrglinux*android*)
2847f395c03eSmrg  version_type=none # Android doesn't support versioned libraries.
2848f395c03eSmrg  need_lib_prefix=no
2849f395c03eSmrg  need_version=no
2850f395c03eSmrg  library_names_spec='$libname$release$shared_ext'
2851f395c03eSmrg  soname_spec='$libname$release$shared_ext'
2852f395c03eSmrg  finish_cmds=
2853f395c03eSmrg  shlibpath_var=LD_LIBRARY_PATH
2854f395c03eSmrg  shlibpath_overrides_runpath=yes
2855f395c03eSmrg
2856f395c03eSmrg  # This implies no fast_install, which is unacceptable.
2857f395c03eSmrg  # Some rework will be needed to allow for fast_install
2858f395c03eSmrg  # before this can be enabled.
2859f395c03eSmrg  hardcode_into_libs=yes
2860f395c03eSmrg
2861f395c03eSmrg  dynamic_linker='Android linker'
2862f395c03eSmrg  # Don't embed -rpath directories since the linker doesn't support them.
2863f395c03eSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
2864f395c03eSmrg  ;;
2865f395c03eSmrg
2866b12e5c03Smrg# This must be glibc/ELF.
2867df9ffc95Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
2868b12e5c03Smrg  version_type=linux # correct to gnu/linux during the next big refactor
28697b58d2e0Smrg  need_lib_prefix=no
28707b58d2e0Smrg  need_version=no
2871f395c03eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2872f395c03eSmrg  soname_spec='$libname$release$shared_ext$major'
28737b58d2e0Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
28747b58d2e0Smrg  shlibpath_var=LD_LIBRARY_PATH
28757b58d2e0Smrg  shlibpath_overrides_runpath=no
2876b12e5c03Smrg
28777b58d2e0Smrg  # Some binutils ld are patched to set DT_RUNPATH
2878b12e5c03Smrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
2879b12e5c03Smrg    [lt_cv_shlibpath_overrides_runpath=no
2880b12e5c03Smrg    save_LDFLAGS=$LDFLAGS
2881b12e5c03Smrg    save_libdir=$libdir
2882b12e5c03Smrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2883b12e5c03Smrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2884b12e5c03Smrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2885b12e5c03Smrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2886b12e5c03Smrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
2887b12e5c03Smrg    LDFLAGS=$save_LDFLAGS
2888b12e5c03Smrg    libdir=$save_libdir
2889b12e5c03Smrg    ])
2890b12e5c03Smrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
2891b698ba48Smrg
28927b58d2e0Smrg  # This implies no fast_install, which is unacceptable.
28937b58d2e0Smrg  # Some rework will be needed to allow for fast_install
28947b58d2e0Smrg  # before this can be enabled.
28957b58d2e0Smrg  hardcode_into_libs=yes
2896b698ba48Smrg
2897f395c03eSmrg  # Ideally, we could use ldconfig to report *all* directores which are
2898f395c03eSmrg  # searched for libraries, however this is still not possible.  Aside from not
2899f395c03eSmrg  # being certain /sbin/ldconfig is available, command
2900f395c03eSmrg  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
2901f395c03eSmrg  # even though it is searched at run-time.  Try to do the best guess by
2902f395c03eSmrg  # appending ld.so.conf contents (and includes) to the search path.
29037b58d2e0Smrg  if test -f /etc/ld.so.conf; then
2904b12e5c03Smrg    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' ' '`
2905df9ffc95Smrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
29067b58d2e0Smrg  fi
2907b698ba48Smrg
29087b58d2e0Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
29097b58d2e0Smrg  # powerpc, because MkLinux only supported shared libraries with the
29107b58d2e0Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
29117b58d2e0Smrg  # most powerpc-linux boxes support dynamic linking these days and
29127b58d2e0Smrg  # people can always --disable-shared, the test was removed, and we
29137b58d2e0Smrg  # assume the GNU/Linux dynamic linker is in use.
29147b58d2e0Smrg  dynamic_linker='GNU/Linux ld.so'
29157b58d2e0Smrg  ;;
2916e4f6584cSmrg
29177b58d2e0Smrgnetbsd*)
29187b58d2e0Smrg  version_type=sunos
29197b58d2e0Smrg  need_lib_prefix=no
29207b58d2e0Smrg  need_version=no
29217b58d2e0Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2922f395c03eSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
29237b58d2e0Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
29247b58d2e0Smrg    dynamic_linker='NetBSD (a.out) ld.so'
29257b58d2e0Smrg  else
2926f395c03eSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2927f395c03eSmrg    soname_spec='$libname$release$shared_ext$major'
29287b58d2e0Smrg    dynamic_linker='NetBSD ld.elf_so'
29297b58d2e0Smrg  fi
29307b58d2e0Smrg  shlibpath_var=LD_LIBRARY_PATH
29317b58d2e0Smrg  shlibpath_overrides_runpath=yes
29327b58d2e0Smrg  hardcode_into_libs=yes
29337b58d2e0Smrg  ;;
2934e4f6584cSmrg
29357b58d2e0Smrgnewsos6)
2936b12e5c03Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2937f395c03eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
29387b58d2e0Smrg  shlibpath_var=LD_LIBRARY_PATH
29397b58d2e0Smrg  shlibpath_overrides_runpath=yes
29407b58d2e0Smrg  ;;
2941e4f6584cSmrg
29427b58d2e0Smrg*nto* | *qnx*)
29437b58d2e0Smrg  version_type=qnx
29447b58d2e0Smrg  need_lib_prefix=no
29457b58d2e0Smrg  need_version=no
2946f395c03eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2947f395c03eSmrg  soname_spec='$libname$release$shared_ext$major'
29487b58d2e0Smrg  shlibpath_var=LD_LIBRARY_PATH
29497b58d2e0Smrg  shlibpath_overrides_runpath=no
29507b58d2e0Smrg  hardcode_into_libs=yes
29517b58d2e0Smrg  dynamic_linker='ldqnx.so'
29527b58d2e0Smrg  ;;
2953e4f6584cSmrg
2954f395c03eSmrgopenbsd* | bitrig*)
29557b58d2e0Smrg  version_type=sunos
2956f395c03eSmrg  sys_lib_dlsearch_path_spec=/usr/lib
29577b58d2e0Smrg  need_lib_prefix=no
2958f395c03eSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
2959f395c03eSmrg    need_version=no
29607b58d2e0Smrg  else
2961f395c03eSmrg    need_version=yes
29627b58d2e0Smrg  fi
2963f395c03eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2964f395c03eSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2965f395c03eSmrg  shlibpath_var=LD_LIBRARY_PATH
2966f395c03eSmrg  shlibpath_overrides_runpath=yes
29677b58d2e0Smrg  ;;
2968e4f6584cSmrg
29697b58d2e0Smrgos2*)
29707b58d2e0Smrg  libname_spec='$name'
2971f395c03eSmrg  version_type=windows
2972f395c03eSmrg  shrext_cmds=.dll
2973f395c03eSmrg  need_version=no
29747b58d2e0Smrg  need_lib_prefix=no
2975f395c03eSmrg  # OS/2 can only load a DLL with a base name of 8 characters or less.
2976f395c03eSmrg  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
2977f395c03eSmrg    v=$($ECHO $release$versuffix | tr -d .-);
2978f395c03eSmrg    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
2979f395c03eSmrg    $ECHO $n$v`$shared_ext'
2980f395c03eSmrg  library_names_spec='${libname}_dll.$libext'
29817b58d2e0Smrg  dynamic_linker='OS/2 ld.exe'
2982f395c03eSmrg  shlibpath_var=BEGINLIBPATH
2983f395c03eSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2984f395c03eSmrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2985f395c03eSmrg  postinstall_cmds='base_file=`basename \$file`~
2986f395c03eSmrg    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
2987f395c03eSmrg    dldir=$destdir/`dirname \$dlpath`~
2988f395c03eSmrg    test -d \$dldir || mkdir -p \$dldir~
2989f395c03eSmrg    $install_prog $dir/$dlname \$dldir/$dlname~
2990f395c03eSmrg    chmod a+x \$dldir/$dlname~
2991f395c03eSmrg    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2992f395c03eSmrg      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2993f395c03eSmrg    fi'
2994f395c03eSmrg  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
2995f395c03eSmrg    dlpath=$dir/\$dldll~
2996f395c03eSmrg    $RM \$dlpath'
29977b58d2e0Smrg  ;;
2998e4f6584cSmrg
29997b58d2e0Smrgosf3* | osf4* | osf5*)
30007b58d2e0Smrg  version_type=osf
30017b58d2e0Smrg  need_lib_prefix=no
30027b58d2e0Smrg  need_version=no
3003f395c03eSmrg  soname_spec='$libname$release$shared_ext$major'
3004f395c03eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
30057b58d2e0Smrg  shlibpath_var=LD_LIBRARY_PATH
30067b58d2e0Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
3007f395c03eSmrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
30087b58d2e0Smrg  ;;
3009e4f6584cSmrg
30107b58d2e0Smrgrdos*)
30117b58d2e0Smrg  dynamic_linker=no
30127b58d2e0Smrg  ;;
3013e4f6584cSmrg
30147b58d2e0Smrgsolaris*)
3015b12e5c03Smrg  version_type=linux # correct to gnu/linux during the next big refactor
30167b58d2e0Smrg  need_lib_prefix=no
30177b58d2e0Smrg  need_version=no
3018f395c03eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3019f395c03eSmrg  soname_spec='$libname$release$shared_ext$major'
30207b58d2e0Smrg  shlibpath_var=LD_LIBRARY_PATH
30217b58d2e0Smrg  shlibpath_overrides_runpath=yes
30227b58d2e0Smrg  hardcode_into_libs=yes
30237b58d2e0Smrg  # ldd complains unless libraries are executable
30247b58d2e0Smrg  postinstall_cmds='chmod +x $lib'
30257b58d2e0Smrg  ;;
3026e4f6584cSmrg
30277b58d2e0Smrgsunos4*)
30287b58d2e0Smrg  version_type=sunos
3029f395c03eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
30307b58d2e0Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
30317b58d2e0Smrg  shlibpath_var=LD_LIBRARY_PATH
30327b58d2e0Smrg  shlibpath_overrides_runpath=yes
3033f395c03eSmrg  if test yes = "$with_gnu_ld"; then
30347b58d2e0Smrg    need_lib_prefix=no
30357b58d2e0Smrg  fi
30367b58d2e0Smrg  need_version=yes
30377b58d2e0Smrg  ;;
3038e4f6584cSmrg
30397b58d2e0Smrgsysv4 | sysv4.3*)
3040b12e5c03Smrg  version_type=linux # correct to gnu/linux during the next big refactor
3041f395c03eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3042f395c03eSmrg  soname_spec='$libname$release$shared_ext$major'
30437b58d2e0Smrg  shlibpath_var=LD_LIBRARY_PATH
30447b58d2e0Smrg  case $host_vendor in
30457b58d2e0Smrg    sni)
30467b58d2e0Smrg      shlibpath_overrides_runpath=no
30477b58d2e0Smrg      need_lib_prefix=no
30487b58d2e0Smrg      runpath_var=LD_RUN_PATH
30497b58d2e0Smrg      ;;
30507b58d2e0Smrg    siemens)
30517b58d2e0Smrg      need_lib_prefix=no
30527b58d2e0Smrg      ;;
30537b58d2e0Smrg    motorola)
30547b58d2e0Smrg      need_lib_prefix=no
30557b58d2e0Smrg      need_version=no
30567b58d2e0Smrg      shlibpath_overrides_runpath=no
30577b58d2e0Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
30587b58d2e0Smrg      ;;
30597b58d2e0Smrg  esac
30607b58d2e0Smrg  ;;
3061e4f6584cSmrg
30627b58d2e0Smrgsysv4*MP*)
3063f395c03eSmrg  if test -d /usr/nec; then
3064b12e5c03Smrg    version_type=linux # correct to gnu/linux during the next big refactor
3065f395c03eSmrg    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
3066f395c03eSmrg    soname_spec='$libname$shared_ext.$major'
30677b58d2e0Smrg    shlibpath_var=LD_LIBRARY_PATH
30687b58d2e0Smrg  fi
30697b58d2e0Smrg  ;;
3070e4f6584cSmrg
30717b58d2e0Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3072f395c03eSmrg  version_type=sco
30737b58d2e0Smrg  need_lib_prefix=no
30747b58d2e0Smrg  need_version=no
3075f395c03eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
3076f395c03eSmrg  soname_spec='$libname$release$shared_ext$major'
30777b58d2e0Smrg  shlibpath_var=LD_LIBRARY_PATH
30787b58d2e0Smrg  shlibpath_overrides_runpath=yes
30797b58d2e0Smrg  hardcode_into_libs=yes
3080f395c03eSmrg  if test yes = "$with_gnu_ld"; then
30817b58d2e0Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
30827b58d2e0Smrg  else
30837b58d2e0Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
30847b58d2e0Smrg    case $host_os in
30857b58d2e0Smrg      sco3.2v5*)
30867b58d2e0Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
30877b58d2e0Smrg	;;
30887b58d2e0Smrg    esac
30897b58d2e0Smrg  fi
30907b58d2e0Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
30917b58d2e0Smrg  ;;
3092e4f6584cSmrg
30937b58d2e0Smrgtpf*)
30947b58d2e0Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
3095b12e5c03Smrg  version_type=linux # correct to gnu/linux during the next big refactor
30967b58d2e0Smrg  need_lib_prefix=no
30977b58d2e0Smrg  need_version=no
3098f395c03eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
30997b58d2e0Smrg  shlibpath_var=LD_LIBRARY_PATH
31007b58d2e0Smrg  shlibpath_overrides_runpath=no
31017b58d2e0Smrg  hardcode_into_libs=yes
31027b58d2e0Smrg  ;;
3103e4f6584cSmrg
31047b58d2e0Smrguts4*)
3105b12e5c03Smrg  version_type=linux # correct to gnu/linux during the next big refactor
3106f395c03eSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3107f395c03eSmrg  soname_spec='$libname$release$shared_ext$major'
31087b58d2e0Smrg  shlibpath_var=LD_LIBRARY_PATH
31097b58d2e0Smrg  ;;
3110e4f6584cSmrg
31117b58d2e0Smrg*)
31127b58d2e0Smrg  dynamic_linker=no
31137b58d2e0Smrg  ;;
31147b58d2e0Smrgesac
31157b58d2e0SmrgAC_MSG_RESULT([$dynamic_linker])
3116f395c03eSmrgtest no = "$dynamic_linker" && can_build_shared=no
3117e4f6584cSmrg
31187b58d2e0Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3119f395c03eSmrgif test yes = "$GCC"; then
31207b58d2e0Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
31217b58d2e0Smrgfi
3122e4f6584cSmrg
3123f395c03eSmrgif test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
3124f395c03eSmrg  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
31257b58d2e0Smrgfi
3126f395c03eSmrg
3127f395c03eSmrgif test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
3128f395c03eSmrg  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
31297b58d2e0Smrgfi
3130e4f6584cSmrg
3131f395c03eSmrg# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
3132f395c03eSmrgconfigure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
3133f395c03eSmrg
3134f395c03eSmrg# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
3135f395c03eSmrgfunc_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
3136f395c03eSmrg
3137f395c03eSmrg# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
3138f395c03eSmrgconfigure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
3139f395c03eSmrg
31407b58d2e0Smrg_LT_DECL([], [variables_saved_for_relink], [1],
31417b58d2e0Smrg    [Variables whose values should be saved in libtool wrapper scripts and
31427b58d2e0Smrg    restored at link time])
31437b58d2e0Smrg_LT_DECL([], [need_lib_prefix], [0],
31447b58d2e0Smrg    [Do we need the "lib" prefix for modules?])
31457b58d2e0Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
31467b58d2e0Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
31477b58d2e0Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
31487b58d2e0Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
31497b58d2e0Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
31507b58d2e0Smrg    [Is shlibpath searched before the hard-coded library search path?])
31517b58d2e0Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
31527b58d2e0Smrg_LT_DECL([], [library_names_spec], [1],
31537b58d2e0Smrg    [[List of archive names.  First name is the real one, the rest are links.
31547b58d2e0Smrg    The last name is the one that the linker finds with -lNAME]])
31557b58d2e0Smrg_LT_DECL([], [soname_spec], [1],
31567b58d2e0Smrg    [[The coded name of the library, if different from the real name]])
3157b12e5c03Smrg_LT_DECL([], [install_override_mode], [1],
3158b12e5c03Smrg    [Permission mode override for installation of shared libraries])
31597b58d2e0Smrg_LT_DECL([], [postinstall_cmds], [2],
31607b58d2e0Smrg    [Command to use after installation of a shared archive])
31617b58d2e0Smrg_LT_DECL([], [postuninstall_cmds], [2],
31627b58d2e0Smrg    [Command to use after uninstallation of a shared archive])
31637b58d2e0Smrg_LT_DECL([], [finish_cmds], [2],
31647b58d2e0Smrg    [Commands used to finish a libtool library installation in a directory])
31657b58d2e0Smrg_LT_DECL([], [finish_eval], [1],
31667b58d2e0Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
31677b58d2e0Smrg    not shown]])
31687b58d2e0Smrg_LT_DECL([], [hardcode_into_libs], [0],
31697b58d2e0Smrg    [Whether we should hardcode library paths into libraries])
31707b58d2e0Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
31717b58d2e0Smrg    [Compile-time system search path for libraries])
3172f395c03eSmrg_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
3173f395c03eSmrg    [Detected run-time system search path for libraries])
3174f395c03eSmrg_LT_DECL([], [configure_time_lt_sys_library_path], [2],
3175f395c03eSmrg    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
31767b58d2e0Smrg])# _LT_SYS_DYNAMIC_LINKER
3177e4f6584cSmrg
3178e4f6584cSmrg
31797b58d2e0Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
31807b58d2e0Smrg# --------------------------
3181f395c03eSmrg# find a file program that can recognize shared library
31827b58d2e0SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
31837b58d2e0Smrg[m4_require([_LT_DECL_EGREP])dnl
31847b58d2e0SmrgAC_MSG_CHECKING([for $1])
31857b58d2e0SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
31867b58d2e0Smrg[case $MAGIC_CMD in
31877b58d2e0Smrg[[\\/*] |  ?:[\\/]*])
3188f395c03eSmrg  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
31897b58d2e0Smrg  ;;
31907b58d2e0Smrg*)
3191f395c03eSmrg  lt_save_MAGIC_CMD=$MAGIC_CMD
3192f395c03eSmrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
31937b58d2e0Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
31947b58d2e0Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
31957b58d2e0Smrgdnl not every word.  This closes a longstanding sh security hole.
31967b58d2e0Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
31977b58d2e0Smrg  for ac_dir in $ac_dummy; do
3198f395c03eSmrg    IFS=$lt_save_ifs
31997b58d2e0Smrg    test -z "$ac_dir" && ac_dir=.
3200f395c03eSmrg    if test -f "$ac_dir/$1"; then
3201f395c03eSmrg      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
32027b58d2e0Smrg      if test -n "$file_magic_test_file"; then
32037b58d2e0Smrg	case $deplibs_check_method in
32047b58d2e0Smrg	"file_magic "*)
32057b58d2e0Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
3206f395c03eSmrg	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
32077b58d2e0Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
32087b58d2e0Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
32097b58d2e0Smrg	    :
32107b58d2e0Smrg	  else
32117b58d2e0Smrg	    cat <<_LT_EOF 1>&2
3212e4f6584cSmrg
32137b58d2e0Smrg*** Warning: the command libtool uses to detect shared libraries,
32147b58d2e0Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
32157b58d2e0Smrg*** The result is that libtool may fail to recognize shared libraries
32167b58d2e0Smrg*** as such.  This will affect the creation of libtool libraries that
32177b58d2e0Smrg*** depend on shared libraries, but programs linked with such libtool
32187b58d2e0Smrg*** libraries will work regardless of this problem.  Nevertheless, you
32197b58d2e0Smrg*** may want to report the problem to your system manager and/or to
32207b58d2e0Smrg*** bug-libtool@gnu.org
3221e4f6584cSmrg
32227b58d2e0Smrg_LT_EOF
32237b58d2e0Smrg	  fi ;;
32247b58d2e0Smrg	esac
32257b58d2e0Smrg      fi
32267b58d2e0Smrg      break
32277b58d2e0Smrg    fi
32287b58d2e0Smrg  done
3229f395c03eSmrg  IFS=$lt_save_ifs
3230f395c03eSmrg  MAGIC_CMD=$lt_save_MAGIC_CMD
32317b58d2e0Smrg  ;;
32327b58d2e0Smrgesac])
3233f395c03eSmrgMAGIC_CMD=$lt_cv_path_MAGIC_CMD
32347b58d2e0Smrgif test -n "$MAGIC_CMD"; then
32357b58d2e0Smrg  AC_MSG_RESULT($MAGIC_CMD)
32367b58d2e0Smrgelse
32377b58d2e0Smrg  AC_MSG_RESULT(no)
32387b58d2e0Smrgfi
32397b58d2e0Smrg_LT_DECL([], [MAGIC_CMD], [0],
32407b58d2e0Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
32417b58d2e0Smrg])# _LT_PATH_TOOL_PREFIX
3242b698ba48Smrg
32437b58d2e0Smrg# Old name:
32447b58d2e0SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
32457b58d2e0Smrgdnl aclocal-1.4 backwards compatibility:
32467b58d2e0Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3247b698ba48Smrg
3248b698ba48Smrg
32497b58d2e0Smrg# _LT_PATH_MAGIC
32507b58d2e0Smrg# --------------
3251f395c03eSmrg# find a file program that can recognize a shared library
32527b58d2e0Smrgm4_defun([_LT_PATH_MAGIC],
32537b58d2e0Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
32547b58d2e0Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
32557b58d2e0Smrg  if test -n "$ac_tool_prefix"; then
32567b58d2e0Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
32577b58d2e0Smrg  else
32587b58d2e0Smrg    MAGIC_CMD=:
32597b58d2e0Smrg  fi
32607b58d2e0Smrgfi
32617b58d2e0Smrg])# _LT_PATH_MAGIC
3262b698ba48Smrg
3263b698ba48Smrg
32647b58d2e0Smrg# LT_PATH_LD
32657b58d2e0Smrg# ----------
32667b58d2e0Smrg# find the pathname to the GNU or non-GNU linker
32677b58d2e0SmrgAC_DEFUN([LT_PATH_LD],
32687b58d2e0Smrg[AC_REQUIRE([AC_PROG_CC])dnl
32697b58d2e0SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
32707b58d2e0SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
32717b58d2e0Smrgm4_require([_LT_DECL_SED])dnl
32727b58d2e0Smrgm4_require([_LT_DECL_EGREP])dnl
3273b12e5c03Smrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
327409885543Smrg
32757b58d2e0SmrgAC_ARG_WITH([gnu-ld],
32767b58d2e0Smrg    [AS_HELP_STRING([--with-gnu-ld],
32777b58d2e0Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
3278f395c03eSmrg    [test no = "$withval" || with_gnu_ld=yes],
32797b58d2e0Smrg    [with_gnu_ld=no])dnl
32807b58d2e0Smrg
32817b58d2e0Smrgac_prog=ld
3282f395c03eSmrgif test yes = "$GCC"; then
32837b58d2e0Smrg  # Check if gcc -print-prog-name=ld gives a path.
32847b58d2e0Smrg  AC_MSG_CHECKING([for ld used by $CC])
32857b58d2e0Smrg  case $host in
32867b58d2e0Smrg  *-*-mingw*)
3287f395c03eSmrg    # gcc leaves a trailing carriage return, which upsets mingw
32887b58d2e0Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
32897b58d2e0Smrg  *)
32907b58d2e0Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3291e4f6584cSmrg  esac
32927b58d2e0Smrg  case $ac_prog in
32937b58d2e0Smrg    # Accept absolute paths.
32947b58d2e0Smrg    [[\\/]]* | ?:[[\\/]]*)
32957b58d2e0Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
32967b58d2e0Smrg      # Canonicalize the pathname of ld
32977b58d2e0Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
32987b58d2e0Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
32997b58d2e0Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
33007b58d2e0Smrg      done
3301f395c03eSmrg      test -z "$LD" && LD=$ac_prog
33027b58d2e0Smrg      ;;
33037b58d2e0Smrg  "")
33047b58d2e0Smrg    # If it fails, then pretend we aren't using GCC.
33057b58d2e0Smrg    ac_prog=ld
33067b58d2e0Smrg    ;;
33077b58d2e0Smrg  *)
33087b58d2e0Smrg    # If it is relative, then search for the first ld in PATH.
33097b58d2e0Smrg    with_gnu_ld=unknown
33107b58d2e0Smrg    ;;
33117b58d2e0Smrg  esac
3312f395c03eSmrgelif test yes = "$with_gnu_ld"; then
33137b58d2e0Smrg  AC_MSG_CHECKING([for GNU ld])
33147b58d2e0Smrgelse
33157b58d2e0Smrg  AC_MSG_CHECKING([for non-GNU ld])
33167b58d2e0Smrgfi
33177b58d2e0SmrgAC_CACHE_VAL(lt_cv_path_LD,
33187b58d2e0Smrg[if test -z "$LD"; then
3319f395c03eSmrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
33207b58d2e0Smrg  for ac_dir in $PATH; do
3321f395c03eSmrg    IFS=$lt_save_ifs
33227b58d2e0Smrg    test -z "$ac_dir" && ac_dir=.
33237b58d2e0Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3324f395c03eSmrg      lt_cv_path_LD=$ac_dir/$ac_prog
33257b58d2e0Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
33267b58d2e0Smrg      # but apparently some variants of GNU ld only accept -v.
33277b58d2e0Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
33287b58d2e0Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
33297b58d2e0Smrg      *GNU* | *'with BFD'*)
3330f395c03eSmrg	test no != "$with_gnu_ld" && break
33317b58d2e0Smrg	;;
33327b58d2e0Smrg      *)
3333f395c03eSmrg	test yes != "$with_gnu_ld" && break
33347b58d2e0Smrg	;;
33357b58d2e0Smrg      esac
3336e4f6584cSmrg    fi
33377b58d2e0Smrg  done
3338f395c03eSmrg  IFS=$lt_save_ifs
33397b58d2e0Smrgelse
3340f395c03eSmrg  lt_cv_path_LD=$LD # Let the user override the test with a path.
33417b58d2e0Smrgfi])
3342f395c03eSmrgLD=$lt_cv_path_LD
33437b58d2e0Smrgif test -n "$LD"; then
33447b58d2e0Smrg  AC_MSG_RESULT($LD)
33457b58d2e0Smrgelse
33467b58d2e0Smrg  AC_MSG_RESULT(no)
33477b58d2e0Smrgfi
33487b58d2e0Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
33497b58d2e0Smrg_LT_PATH_LD_GNU
33507b58d2e0SmrgAC_SUBST([LD])
335109885543Smrg
33527b58d2e0Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
33537b58d2e0Smrg])# LT_PATH_LD
335409885543Smrg
33557b58d2e0Smrg# Old names:
33567b58d2e0SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
33577b58d2e0SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
33587b58d2e0Smrgdnl aclocal-1.4 backwards compatibility:
33597b58d2e0Smrgdnl AC_DEFUN([AM_PROG_LD], [])
33607b58d2e0Smrgdnl AC_DEFUN([AC_PROG_LD], [])
336109885543Smrg
33627104f784Smrg
33637b58d2e0Smrg# _LT_PATH_LD_GNU
33647b58d2e0Smrg#- --------------
33657b58d2e0Smrgm4_defun([_LT_PATH_LD_GNU],
33667b58d2e0Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
33677b58d2e0Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
33687b58d2e0Smrgcase `$LD -v 2>&1 </dev/null` in
33697b58d2e0Smrg*GNU* | *'with BFD'*)
33707b58d2e0Smrg  lt_cv_prog_gnu_ld=yes
33717b58d2e0Smrg  ;;
33727b58d2e0Smrg*)
33737b58d2e0Smrg  lt_cv_prog_gnu_ld=no
33747b58d2e0Smrg  ;;
33757b58d2e0Smrgesac])
33767b58d2e0Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
33777b58d2e0Smrg])# _LT_PATH_LD_GNU
337809885543Smrg
33797104f784Smrg
33807b58d2e0Smrg# _LT_CMD_RELOAD
33817b58d2e0Smrg# --------------
33827b58d2e0Smrg# find reload flag for linker
33837b58d2e0Smrg#   -- PORTME Some linkers may need a different reload flag.
33847b58d2e0Smrgm4_defun([_LT_CMD_RELOAD],
33857b58d2e0Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
33867b58d2e0Smrg  lt_cv_ld_reload_flag,
33877b58d2e0Smrg  [lt_cv_ld_reload_flag='-r'])
33887b58d2e0Smrgreload_flag=$lt_cv_ld_reload_flag
33897b58d2e0Smrgcase $reload_flag in
33907b58d2e0Smrg"" | " "*) ;;
33917b58d2e0Smrg*) reload_flag=" $reload_flag" ;;
3392e4f6584cSmrgesac
33937b58d2e0Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
33947b58d2e0Smrgcase $host_os in
3395b12e5c03Smrg  cygwin* | mingw* | pw32* | cegcc*)
3396f395c03eSmrg    if test yes != "$GCC"; then
3397b12e5c03Smrg      reload_cmds=false
3398b12e5c03Smrg    fi
3399b12e5c03Smrg    ;;
34007b58d2e0Smrg  darwin*)
3401f395c03eSmrg    if test yes = "$GCC"; then
3402f395c03eSmrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
34037b58d2e0Smrg    else
34047b58d2e0Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
34057b58d2e0Smrg    fi
34067b58d2e0Smrg    ;;
34077b58d2e0Smrgesac
3408b12e5c03Smrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
3409b12e5c03Smrg_LT_TAGDECL([], [reload_cmds], [2])dnl
34107b58d2e0Smrg])# _LT_CMD_RELOAD
34117104f784Smrg
341209885543Smrg
3413f395c03eSmrg# _LT_PATH_DD
3414f395c03eSmrg# -----------
3415f395c03eSmrg# find a working dd
3416f395c03eSmrgm4_defun([_LT_PATH_DD],
3417f395c03eSmrg[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
3418f395c03eSmrg[printf 0123456789abcdef0123456789abcdef >conftest.i
3419f395c03eSmrgcat conftest.i conftest.i >conftest2.i
3420f395c03eSmrg: ${lt_DD:=$DD}
3421f395c03eSmrgAC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
3422f395c03eSmrg[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3423f395c03eSmrg  cmp -s conftest.i conftest.out \
3424f395c03eSmrg  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
3425f395c03eSmrgfi])
3426f395c03eSmrgrm -f conftest.i conftest2.i conftest.out])
3427f395c03eSmrg])# _LT_PATH_DD
3428f395c03eSmrg
3429f395c03eSmrg
3430f395c03eSmrg# _LT_CMD_TRUNCATE
3431f395c03eSmrg# ----------------
3432f395c03eSmrg# find command to truncate a binary pipe
3433f395c03eSmrgm4_defun([_LT_CMD_TRUNCATE],
3434f395c03eSmrg[m4_require([_LT_PATH_DD])
3435f395c03eSmrgAC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
3436f395c03eSmrg[printf 0123456789abcdef0123456789abcdef >conftest.i
3437f395c03eSmrgcat conftest.i conftest.i >conftest2.i
3438f395c03eSmrglt_cv_truncate_bin=
3439f395c03eSmrgif "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3440f395c03eSmrg  cmp -s conftest.i conftest.out \
3441f395c03eSmrg  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
3442f395c03eSmrgfi
3443f395c03eSmrgrm -f conftest.i conftest2.i conftest.out
3444f395c03eSmrgtest -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
3445f395c03eSmrg_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
3446f395c03eSmrg  [Command to truncate a binary pipe])
3447f395c03eSmrg])# _LT_CMD_TRUNCATE
3448f395c03eSmrg
3449f395c03eSmrg
34507b58d2e0Smrg# _LT_CHECK_MAGIC_METHOD
34517b58d2e0Smrg# ----------------------
34527b58d2e0Smrg# how to check for library dependencies
34537b58d2e0Smrg#  -- PORTME fill in with the dynamic library characteristics
34547b58d2e0Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
34557b58d2e0Smrg[m4_require([_LT_DECL_EGREP])
34567b58d2e0Smrgm4_require([_LT_DECL_OBJDUMP])
34577b58d2e0SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
34587b58d2e0Smrglt_cv_deplibs_check_method,
34597b58d2e0Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
34607b58d2e0Smrglt_cv_file_magic_test_file=
34617b58d2e0Smrglt_cv_deplibs_check_method='unknown'
34627b58d2e0Smrg# Need to set the preceding variable on all platforms that support
34637b58d2e0Smrg# interlibrary dependencies.
34647b58d2e0Smrg# 'none' -- dependencies not supported.
3465f395c03eSmrg# 'unknown' -- same as none, but documents that we really don't know.
34667b58d2e0Smrg# 'pass_all' -- all dependencies passed with no checks.
34677b58d2e0Smrg# 'test_compile' -- check by making test program.
34687b58d2e0Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
3469f395c03eSmrg# that responds to the $file_magic_cmd with a given extended regex.
3470f395c03eSmrg# If you have 'file' or equivalent on your system and you're not sure
3471f395c03eSmrg# whether 'pass_all' will *always* work, you probably want this one.
347209885543Smrg
34737b58d2e0Smrgcase $host_os in
34747b58d2e0Smrgaix[[4-9]]*)
34757b58d2e0Smrg  lt_cv_deplibs_check_method=pass_all
34767b58d2e0Smrg  ;;
347709885543Smrg
34787b58d2e0Smrgbeos*)
34797b58d2e0Smrg  lt_cv_deplibs_check_method=pass_all
34807b58d2e0Smrg  ;;
348109885543Smrg
34827b58d2e0Smrgbsdi[[45]]*)
34837b58d2e0Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
34847b58d2e0Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
34857b58d2e0Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
34867b58d2e0Smrg  ;;
348709885543Smrg
34887b58d2e0Smrgcygwin*)
34897b58d2e0Smrg  # func_win32_libid is a shell function defined in ltmain.sh
34907b58d2e0Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
34917b58d2e0Smrg  lt_cv_file_magic_cmd='func_win32_libid'
34927b58d2e0Smrg  ;;
3493b698ba48Smrg
34947b58d2e0Smrgmingw* | pw32*)
34957b58d2e0Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
34967b58d2e0Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
34977b58d2e0Smrg  # unless we find 'file', for example because we are cross-compiling.
3498f395c03eSmrg  if ( file / ) >/dev/null 2>&1; then
34997b58d2e0Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
35007b58d2e0Smrg    lt_cv_file_magic_cmd='func_win32_libid'
35017b58d2e0Smrg  else
3502b12e5c03Smrg    # Keep this pattern in sync with the one in func_win32_libid.
3503b12e5c03Smrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
35047b58d2e0Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
35057b58d2e0Smrg  fi
35067b58d2e0Smrg  ;;
350709885543Smrg
3508b12e5c03Smrgcegcc*)
35097b58d2e0Smrg  # use the weaker test based on 'objdump'. See mingw*.
35107b58d2e0Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
35117b58d2e0Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
35127b58d2e0Smrg  ;;
35137b58d2e0Smrg
35147b58d2e0Smrgdarwin* | rhapsody*)
35157b58d2e0Smrg  lt_cv_deplibs_check_method=pass_all
35167b58d2e0Smrg  ;;
35177b58d2e0Smrg
35187b58d2e0Smrgfreebsd* | dragonfly*)
35197b58d2e0Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
35207b58d2e0Smrg    case $host_cpu in
35217b58d2e0Smrg    i*86 )
35227b58d2e0Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
35237b58d2e0Smrg      # Let's accept both of them until this is cleared up.
35247b58d2e0Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
35257b58d2e0Smrg      lt_cv_file_magic_cmd=/usr/bin/file
35267b58d2e0Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
35277b58d2e0Smrg      ;;
35287b58d2e0Smrg    esac
35297b58d2e0Smrg  else
35307b58d2e0Smrg    lt_cv_deplibs_check_method=pass_all
3531e4f6584cSmrg  fi
35327b58d2e0Smrg  ;;
353309885543Smrg
3534b12e5c03Smrghaiku*)
3535b12e5c03Smrg  lt_cv_deplibs_check_method=pass_all
3536b12e5c03Smrg  ;;
3537b12e5c03Smrg
35387b58d2e0Smrghpux10.20* | hpux11*)
35397b58d2e0Smrg  lt_cv_file_magic_cmd=/usr/bin/file
35407b58d2e0Smrg  case $host_cpu in
35417b58d2e0Smrg  ia64*)
35427b58d2e0Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
35437b58d2e0Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
35447b58d2e0Smrg    ;;
35457b58d2e0Smrg  hppa*64*)
3546b12e5c03Smrg    [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]']
35477b58d2e0Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
35487b58d2e0Smrg    ;;
35497b58d2e0Smrg  *)
3550b12e5c03Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
35517b58d2e0Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
35527b58d2e0Smrg    ;;
35537b58d2e0Smrg  esac
35547b58d2e0Smrg  ;;
355509885543Smrg
35567b58d2e0Smrginterix[[3-9]]*)
35577b58d2e0Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
35587b58d2e0Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
35597b58d2e0Smrg  ;;
356009885543Smrg
35617b58d2e0Smrgirix5* | irix6* | nonstopux*)
35627b58d2e0Smrg  case $LD in
35637b58d2e0Smrg  *-32|*"-32 ") libmagic=32-bit;;
35647b58d2e0Smrg  *-n32|*"-n32 ") libmagic=N32;;
35657b58d2e0Smrg  *-64|*"-64 ") libmagic=64-bit;;
35667b58d2e0Smrg  *) libmagic=never-match;;
35677b58d2e0Smrg  esac
35687b58d2e0Smrg  lt_cv_deplibs_check_method=pass_all
35697b58d2e0Smrg  ;;
3570e4f6584cSmrg
3571b12e5c03Smrg# This must be glibc/ELF.
3572df9ffc95Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
35737b58d2e0Smrg  lt_cv_deplibs_check_method=pass_all
35747b58d2e0Smrg  ;;
35757b58d2e0Smrg
3576f395c03eSmrgnetbsd*)
35777b58d2e0Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
35787b58d2e0Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
35797b58d2e0Smrg  else
35807b58d2e0Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3581e4f6584cSmrg  fi
3582e4f6584cSmrg  ;;
35837b58d2e0Smrg
35847b58d2e0Smrgnewos6*)
35857b58d2e0Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
35867b58d2e0Smrg  lt_cv_file_magic_cmd=/usr/bin/file
35877b58d2e0Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
35887b58d2e0Smrg  ;;
35897b58d2e0Smrg
35907b58d2e0Smrg*nto* | *qnx*)
35917b58d2e0Smrg  lt_cv_deplibs_check_method=pass_all
35927b58d2e0Smrg  ;;
35937b58d2e0Smrg
3594f395c03eSmrgopenbsd* | bitrig*)
3595f395c03eSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
35967b58d2e0Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
35977b58d2e0Smrg  else
35987b58d2e0Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3599e4f6584cSmrg  fi
3600b698ba48Smrg  ;;
3601b698ba48Smrg
36027b58d2e0Smrgosf3* | osf4* | osf5*)
36037b58d2e0Smrg  lt_cv_deplibs_check_method=pass_all
3604b698ba48Smrg  ;;
360509885543Smrg
36067b58d2e0Smrgrdos*)
36077b58d2e0Smrg  lt_cv_deplibs_check_method=pass_all
3608b698ba48Smrg  ;;
360909885543Smrg
36107b58d2e0Smrgsolaris*)
36117b58d2e0Smrg  lt_cv_deplibs_check_method=pass_all
36127b58d2e0Smrg  ;;
361309885543Smrg
36147b58d2e0Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
36157b58d2e0Smrg  lt_cv_deplibs_check_method=pass_all
36167b58d2e0Smrg  ;;
361709885543Smrg
36187b58d2e0Smrgsysv4 | sysv4.3*)
36197b58d2e0Smrg  case $host_vendor in
36207b58d2e0Smrg  motorola)
36217b58d2e0Smrg    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]]'
36227b58d2e0Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3623e4f6584cSmrg    ;;
36247b58d2e0Smrg  ncr)
36257b58d2e0Smrg    lt_cv_deplibs_check_method=pass_all
36267b58d2e0Smrg    ;;
36277b58d2e0Smrg  sequent)
36287b58d2e0Smrg    lt_cv_file_magic_cmd='/bin/file'
36297b58d2e0Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
36307b58d2e0Smrg    ;;
36317b58d2e0Smrg  sni)
36327b58d2e0Smrg    lt_cv_file_magic_cmd='/bin/file'
36337b58d2e0Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
36347b58d2e0Smrg    lt_cv_file_magic_test_file=/lib/libc.so
36357b58d2e0Smrg    ;;
36367b58d2e0Smrg  siemens)
36377b58d2e0Smrg    lt_cv_deplibs_check_method=pass_all
36387b58d2e0Smrg    ;;
36397b58d2e0Smrg  pc)
36407b58d2e0Smrg    lt_cv_deplibs_check_method=pass_all
3641e4f6584cSmrg    ;;
3642e4f6584cSmrg  esac
36437b58d2e0Smrg  ;;
364409885543Smrg
36457b58d2e0Smrgtpf*)
36467b58d2e0Smrg  lt_cv_deplibs_check_method=pass_all
36477b58d2e0Smrg  ;;
3648f395c03eSmrgos2*)
3649f395c03eSmrg  lt_cv_deplibs_check_method=pass_all
3650f395c03eSmrg  ;;
36517b58d2e0Smrgesac
3652e4f6584cSmrg])
365309885543Smrg
3654b12e5c03Smrgfile_magic_glob=
3655b12e5c03Smrgwant_nocaseglob=no
3656b12e5c03Smrgif test "$build" = "$host"; then
3657b12e5c03Smrg  case $host_os in
3658b12e5c03Smrg  mingw* | pw32*)
3659b12e5c03Smrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
3660b12e5c03Smrg      want_nocaseglob=yes
3661b12e5c03Smrg    else
3662b12e5c03Smrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
3663b12e5c03Smrg    fi
3664b12e5c03Smrg    ;;
3665b12e5c03Smrg  esac
3666b12e5c03Smrgfi
3667b12e5c03Smrg
3668b12e5c03Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
3669b12e5c03Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
3670b12e5c03Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
3671b12e5c03Smrg
3672b12e5c03Smrg_LT_DECL([], [deplibs_check_method], [1],
3673b12e5c03Smrg    [Method to check whether dependent libraries are shared objects])
3674b12e5c03Smrg_LT_DECL([], [file_magic_cmd], [1],
3675b12e5c03Smrg    [Command to use when deplibs_check_method = "file_magic"])
3676b12e5c03Smrg_LT_DECL([], [file_magic_glob], [1],
3677b12e5c03Smrg    [How to find potential files when deplibs_check_method = "file_magic"])
3678b12e5c03Smrg_LT_DECL([], [want_nocaseglob], [1],
3679b12e5c03Smrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
3680b12e5c03Smrg])# _LT_CHECK_MAGIC_METHOD
368109885543Smrg
368209885543Smrg
36837b58d2e0Smrg# LT_PATH_NM
36847b58d2e0Smrg# ----------
36857b58d2e0Smrg# find the pathname to a BSD- or MS-compatible name lister
36867b58d2e0SmrgAC_DEFUN([LT_PATH_NM],
36877b58d2e0Smrg[AC_REQUIRE([AC_PROG_CC])dnl
36887b58d2e0SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
36897b58d2e0Smrg[if test -n "$NM"; then
36907b58d2e0Smrg  # Let the user override the test.
3691f395c03eSmrg  lt_cv_path_NM=$NM
3692e4f6584cSmrgelse
3693f395c03eSmrg  lt_nm_to_check=${ac_tool_prefix}nm
36947b58d2e0Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
36957b58d2e0Smrg    lt_nm_to_check="$lt_nm_to_check nm"
36967b58d2e0Smrg  fi
36977b58d2e0Smrg  for lt_tmp_nm in $lt_nm_to_check; do
3698f395c03eSmrg    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
36997b58d2e0Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3700f395c03eSmrg      IFS=$lt_save_ifs
37017b58d2e0Smrg      test -z "$ac_dir" && ac_dir=.
3702f395c03eSmrg      tmp_nm=$ac_dir/$lt_tmp_nm
3703f395c03eSmrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
37047b58d2e0Smrg	# Check to see if the nm accepts a BSD-compat flag.
3705f395c03eSmrg	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
37067b58d2e0Smrg	#   nm: unknown option "B" ignored
37077b58d2e0Smrg	# Tru64's nm complains that /dev/null is an invalid object file
3708f395c03eSmrg	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
3709f395c03eSmrg	case $build_os in
3710f395c03eSmrg	mingw*) lt_bad_file=conftest.nm/nofile ;;
3711f395c03eSmrg	*) lt_bad_file=/dev/null ;;
3712f395c03eSmrg	esac
3713f395c03eSmrg	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
3714f395c03eSmrg	*$lt_bad_file* | *'Invalid file or object type'*)
37157b58d2e0Smrg	  lt_cv_path_NM="$tmp_nm -B"
3716f395c03eSmrg	  break 2
37177b58d2e0Smrg	  ;;
37187b58d2e0Smrg	*)
37197b58d2e0Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
37207b58d2e0Smrg	  */dev/null*)
37217b58d2e0Smrg	    lt_cv_path_NM="$tmp_nm -p"
3722f395c03eSmrg	    break 2
37237b58d2e0Smrg	    ;;
37247b58d2e0Smrg	  *)
37257b58d2e0Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
37267b58d2e0Smrg	    continue # so that we can try to find one that supports BSD flags
37277b58d2e0Smrg	    ;;
37287b58d2e0Smrg	  esac
37297b58d2e0Smrg	  ;;
37307b58d2e0Smrg	esac
37317b58d2e0Smrg      fi
37327b58d2e0Smrg    done
3733f395c03eSmrg    IFS=$lt_save_ifs
37347b58d2e0Smrg  done
37357b58d2e0Smrg  : ${lt_cv_path_NM=no}
37367b58d2e0Smrgfi])
3737f395c03eSmrgif test no != "$lt_cv_path_NM"; then
3738f395c03eSmrg  NM=$lt_cv_path_NM
37397b58d2e0Smrgelse
37407b58d2e0Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
3741b12e5c03Smrg  if test -n "$DUMPBIN"; then :
3742b12e5c03Smrg    # Let the user override the test.
3743b12e5c03Smrg  else
3744b12e5c03Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
3745f395c03eSmrg    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
3746b12e5c03Smrg    *COFF*)
3747f395c03eSmrg      DUMPBIN="$DUMPBIN -symbols -headers"
3748b12e5c03Smrg      ;;
3749b12e5c03Smrg    *)
3750b12e5c03Smrg      DUMPBIN=:
3751b12e5c03Smrg      ;;
3752b12e5c03Smrg    esac
3753b12e5c03Smrg  fi
37547b58d2e0Smrg  AC_SUBST([DUMPBIN])
3755f395c03eSmrg  if test : != "$DUMPBIN"; then
3756f395c03eSmrg    NM=$DUMPBIN
37577b58d2e0Smrg  fi
37587b58d2e0Smrgfi
37597b58d2e0Smrgtest -z "$NM" && NM=nm
37607b58d2e0SmrgAC_SUBST([NM])
37617b58d2e0Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
376209885543Smrg
37637b58d2e0SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
37647b58d2e0Smrg  [lt_cv_nm_interface="BSD nm"
37657b58d2e0Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
3766b12e5c03Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
37677b58d2e0Smrg  (eval "$ac_compile" 2>conftest.err)
37687b58d2e0Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3769b12e5c03Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
37707b58d2e0Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
37717b58d2e0Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3772b12e5c03Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
37737b58d2e0Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
37747b58d2e0Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
37757b58d2e0Smrg    lt_cv_nm_interface="MS dumpbin"
37767b58d2e0Smrg  fi
37777b58d2e0Smrg  rm -f conftest*])
37787b58d2e0Smrg])# LT_PATH_NM
377909885543Smrg
37807b58d2e0Smrg# Old names:
37817b58d2e0SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
37827b58d2e0SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
37837b58d2e0Smrgdnl aclocal-1.4 backwards compatibility:
37847b58d2e0Smrgdnl AC_DEFUN([AM_PROG_NM], [])
37857b58d2e0Smrgdnl AC_DEFUN([AC_PROG_NM], [])
378609885543Smrg
3787b12e5c03Smrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3788b12e5c03Smrg# --------------------------------
3789b12e5c03Smrg# how to determine the name of the shared library
3790b12e5c03Smrg# associated with a specific link library.
3791b12e5c03Smrg#  -- PORTME fill in with the dynamic library characteristics
3792b12e5c03Smrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
3793b12e5c03Smrg[m4_require([_LT_DECL_EGREP])
3794b12e5c03Smrgm4_require([_LT_DECL_OBJDUMP])
3795b12e5c03Smrgm4_require([_LT_DECL_DLLTOOL])
3796b12e5c03SmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
3797b12e5c03Smrglt_cv_sharedlib_from_linklib_cmd,
3798b12e5c03Smrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
3799b12e5c03Smrg
3800b12e5c03Smrgcase $host_os in
3801b12e5c03Smrgcygwin* | mingw* | pw32* | cegcc*)
3802f395c03eSmrg  # two different shell functions defined in ltmain.sh;
3803f395c03eSmrg  # decide which one to use based on capabilities of $DLLTOOL
3804b12e5c03Smrg  case `$DLLTOOL --help 2>&1` in
3805b12e5c03Smrg  *--identify-strict*)
3806b12e5c03Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
3807b12e5c03Smrg    ;;
3808b12e5c03Smrg  *)
3809b12e5c03Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
3810b12e5c03Smrg    ;;
3811b12e5c03Smrg  esac
3812b12e5c03Smrg  ;;
3813b12e5c03Smrg*)
3814b12e5c03Smrg  # fallback: assume linklib IS sharedlib
3815f395c03eSmrg  lt_cv_sharedlib_from_linklib_cmd=$ECHO
3816b12e5c03Smrg  ;;
3817b12e5c03Smrgesac
3818b12e5c03Smrg])
3819b12e5c03Smrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
3820b12e5c03Smrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3821b12e5c03Smrg
3822b12e5c03Smrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
3823b12e5c03Smrg    [Command to associate shared and link libraries])
3824b12e5c03Smrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3825b12e5c03Smrg
3826b12e5c03Smrg
3827b12e5c03Smrg# _LT_PATH_MANIFEST_TOOL
3828b12e5c03Smrg# ----------------------
3829b12e5c03Smrg# locate the manifest tool
3830b12e5c03Smrgm4_defun([_LT_PATH_MANIFEST_TOOL],
3831b12e5c03Smrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
3832b12e5c03Smrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
3833b12e5c03SmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
3834b12e5c03Smrg  [lt_cv_path_mainfest_tool=no
3835b12e5c03Smrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
3836b12e5c03Smrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
3837b12e5c03Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3838b12e5c03Smrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
3839b12e5c03Smrg    lt_cv_path_mainfest_tool=yes
3840b12e5c03Smrg  fi
3841b12e5c03Smrg  rm -f conftest*])
3842f395c03eSmrgif test yes != "$lt_cv_path_mainfest_tool"; then
3843b12e5c03Smrg  MANIFEST_TOOL=:
3844b12e5c03Smrgfi
3845b12e5c03Smrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
3846b12e5c03Smrg])# _LT_PATH_MANIFEST_TOOL
3847b12e5c03Smrg
384809885543Smrg
3849f395c03eSmrg# _LT_DLL_DEF_P([FILE])
3850f395c03eSmrg# ---------------------
3851f395c03eSmrg# True iff FILE is a Windows DLL '.def' file.
3852f395c03eSmrg# Keep in sync with func_dll_def_p in the libtool script
3853f395c03eSmrgAC_DEFUN([_LT_DLL_DEF_P],
3854f395c03eSmrg[dnl
3855f395c03eSmrg  test DEF = "`$SED -n dnl
3856f395c03eSmrg    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
3857f395c03eSmrg    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
3858f395c03eSmrg    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
3859f395c03eSmrg    -e q dnl                          Only consider the first "real" line
3860f395c03eSmrg    $1`" dnl
3861f395c03eSmrg])# _LT_DLL_DEF_P
3862f395c03eSmrg
3863f395c03eSmrg
38647b58d2e0Smrg# LT_LIB_M
38657b58d2e0Smrg# --------
38667b58d2e0Smrg# check for math library
38677b58d2e0SmrgAC_DEFUN([LT_LIB_M],
38687b58d2e0Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
38697b58d2e0SmrgLIBM=
38707b58d2e0Smrgcase $host in
3871b12e5c03Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
38727b58d2e0Smrg  # These system don't have libm, or don't need it
38737b58d2e0Smrg  ;;
38747b58d2e0Smrg*-ncr-sysv4.3*)
3875f395c03eSmrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
38767b58d2e0Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
38777b58d2e0Smrg  ;;
38787b58d2e0Smrg*)
3879f395c03eSmrg  AC_CHECK_LIB(m, cos, LIBM=-lm)
38807b58d2e0Smrg  ;;
38817b58d2e0Smrgesac
38827b58d2e0SmrgAC_SUBST([LIBM])
38837b58d2e0Smrg])# LT_LIB_M
38842ec8c4b4Smrg
38857b58d2e0Smrg# Old name:
38867b58d2e0SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
38877b58d2e0Smrgdnl aclocal-1.4 backwards compatibility:
38887b58d2e0Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
388909885543Smrg
389009885543Smrg
38917b58d2e0Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
38927b58d2e0Smrg# -------------------------------
38937b58d2e0Smrgm4_defun([_LT_COMPILER_NO_RTTI],
38947b58d2e0Smrg[m4_require([_LT_TAG_COMPILER])dnl
389509885543Smrg
38967b58d2e0Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
389709885543Smrg
3898f395c03eSmrgif test yes = "$GCC"; then
3899b12e5c03Smrg  case $cc_basename in
3900b12e5c03Smrg  nvcc*)
3901b12e5c03Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
3902b12e5c03Smrg  *)
3903b12e5c03Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
3904b12e5c03Smrg  esac
390509885543Smrg
39067b58d2e0Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
39077b58d2e0Smrg    lt_cv_prog_compiler_rtti_exceptions,
39087b58d2e0Smrg    [-fno-rtti -fno-exceptions], [],
39097b58d2e0Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
39107b58d2e0Smrgfi
39117b58d2e0Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
39127b58d2e0Smrg	[Compiler flag to turn off builtin functions])
39137b58d2e0Smrg])# _LT_COMPILER_NO_RTTI
391409885543Smrg
391509885543Smrg
39167b58d2e0Smrg# _LT_CMD_GLOBAL_SYMBOLS
39177b58d2e0Smrg# ----------------------
39187b58d2e0Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
39197b58d2e0Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
39207b58d2e0SmrgAC_REQUIRE([AC_PROG_CC])dnl
3921b12e5c03SmrgAC_REQUIRE([AC_PROG_AWK])dnl
39227b58d2e0SmrgAC_REQUIRE([LT_PATH_NM])dnl
39237b58d2e0SmrgAC_REQUIRE([LT_PATH_LD])dnl
39247b58d2e0Smrgm4_require([_LT_DECL_SED])dnl
39257b58d2e0Smrgm4_require([_LT_DECL_EGREP])dnl
39267b58d2e0Smrgm4_require([_LT_TAG_COMPILER])dnl
392709885543Smrg
39287b58d2e0Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
39297b58d2e0SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
39307b58d2e0SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
39317b58d2e0Smrg[
39327b58d2e0Smrg# These are sane defaults that work on at least a few old systems.
39337b58d2e0Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
393409885543Smrg
39357b58d2e0Smrg# Character class describing NM global symbol codes.
39367b58d2e0Smrgsymcode='[[BCDEGRST]]'
393709885543Smrg
39387b58d2e0Smrg# Regexp to match symbols that can be accessed directly from C.
39397b58d2e0Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
394009885543Smrg
39417b58d2e0Smrg# Define system-specific variables.
39427b58d2e0Smrgcase $host_os in
39437b58d2e0Smrgaix*)
39447b58d2e0Smrg  symcode='[[BCDT]]'
39457b58d2e0Smrg  ;;
39467b58d2e0Smrgcygwin* | mingw* | pw32* | cegcc*)
39477b58d2e0Smrg  symcode='[[ABCDGISTW]]'
39487b58d2e0Smrg  ;;
39497b58d2e0Smrghpux*)
3950f395c03eSmrg  if test ia64 = "$host_cpu"; then
39517b58d2e0Smrg    symcode='[[ABCDEGRST]]'
3952e4f6584cSmrg  fi
39537b58d2e0Smrg  ;;
39547b58d2e0Smrgirix* | nonstopux*)
39557b58d2e0Smrg  symcode='[[BCDEGRST]]'
39567b58d2e0Smrg  ;;
39577b58d2e0Smrgosf*)
39587b58d2e0Smrg  symcode='[[BCDEGQRST]]'
39597b58d2e0Smrg  ;;
39607b58d2e0Smrgsolaris*)
39617b58d2e0Smrg  symcode='[[BDRT]]'
39627b58d2e0Smrg  ;;
39637b58d2e0Smrgsco3.2v5*)
39647b58d2e0Smrg  symcode='[[DT]]'
39657b58d2e0Smrg  ;;
39667b58d2e0Smrgsysv4.2uw2*)
39677b58d2e0Smrg  symcode='[[DT]]'
39687b58d2e0Smrg  ;;
39697b58d2e0Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
39707b58d2e0Smrg  symcode='[[ABDT]]'
39717b58d2e0Smrg  ;;
39727b58d2e0Smrgsysv4)
39737b58d2e0Smrg  symcode='[[DFNSTU]]'
39747b58d2e0Smrg  ;;
39757b58d2e0Smrgesac
397609885543Smrg
39777b58d2e0Smrg# If we're using GNU nm, then use its standard symbol codes.
39787b58d2e0Smrgcase `$NM -V 2>&1` in
39797b58d2e0Smrg*GNU* | *'with BFD'*)
39807b58d2e0Smrg  symcode='[[ABCDGIRSTW]]' ;;
39817b58d2e0Smrgesac
398209885543Smrg
3983f395c03eSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
3984f395c03eSmrg  # Gets list of data symbols to import.
3985f395c03eSmrg  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
3986f395c03eSmrg  # Adjust the below global symbol transforms to fixup imported variables.
3987f395c03eSmrg  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
3988f395c03eSmrg  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
3989f395c03eSmrg  lt_c_name_lib_hook="\
3990f395c03eSmrg  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
3991f395c03eSmrg  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
3992f395c03eSmrgelse
3993f395c03eSmrg  # Disable hooks by default.
3994f395c03eSmrg  lt_cv_sys_global_symbol_to_import=
3995f395c03eSmrg  lt_cdecl_hook=
3996f395c03eSmrg  lt_c_name_hook=
3997f395c03eSmrg  lt_c_name_lib_hook=
3998f395c03eSmrgfi
3999f395c03eSmrg
40007b58d2e0Smrg# Transform an extracted symbol line into a proper C declaration.
40017b58d2e0Smrg# Some systems (esp. on ia64) link data and code symbols differently,
40027b58d2e0Smrg# so use this general approach.
4003f395c03eSmrglt_cv_sys_global_symbol_to_cdecl="sed -n"\
4004f395c03eSmrg$lt_cdecl_hook\
4005f395c03eSmrg" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
4006f395c03eSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
400709885543Smrg
40087b58d2e0Smrg# Transform an extracted symbol line into symbol name and symbol address
4009f395c03eSmrglt_cv_sys_global_symbol_to_c_name_address="sed -n"\
4010f395c03eSmrg$lt_c_name_hook\
4011f395c03eSmrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
4012f395c03eSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
4013f395c03eSmrg
4014f395c03eSmrg# Transform an extracted symbol line into symbol name with lib prefix and
4015f395c03eSmrg# symbol address.
4016f395c03eSmrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
4017f395c03eSmrg$lt_c_name_lib_hook\
4018f395c03eSmrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
4019f395c03eSmrg" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
4020f395c03eSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
402109885543Smrg
40227b58d2e0Smrg# Handle CRLF in mingw tool chain
40237b58d2e0Smrgopt_cr=
40247b58d2e0Smrgcase $build_os in
40257b58d2e0Smrgmingw*)
40267b58d2e0Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
40277b58d2e0Smrg  ;;
40287b58d2e0Smrgesac
402909885543Smrg
40307b58d2e0Smrg# Try without a prefix underscore, then with it.
40317b58d2e0Smrgfor ac_symprfx in "" "_"; do
403209885543Smrg
40337b58d2e0Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
40347b58d2e0Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
403509885543Smrg
40367b58d2e0Smrg  # Write the raw and C identifiers.
40377b58d2e0Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4038f395c03eSmrg    # Fake it for dumpbin and say T for any non-static function,
4039f395c03eSmrg    # D for any global variable and I for any imported variable.
40407b58d2e0Smrg    # Also find C++ and __fastcall symbols from MSVC++,
40417b58d2e0Smrg    # which start with @ or ?.
40427b58d2e0Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
40437b58d2e0Smrg"     {last_section=section; section=\$ 3};"\
4044b12e5c03Smrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
40457b58d2e0Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
4046f395c03eSmrg"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
4047f395c03eSmrg"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
4048f395c03eSmrg"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
40497b58d2e0Smrg"     \$ 0!~/External *\|/{next};"\
40507b58d2e0Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
40517b58d2e0Smrg"     {if(hide[section]) next};"\
4052f395c03eSmrg"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
4053f395c03eSmrg"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
4054f395c03eSmrg"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
4055f395c03eSmrg"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
40567b58d2e0Smrg"     ' prfx=^$ac_symprfx]"
4057e4f6584cSmrg  else
40587b58d2e0Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4059b698ba48Smrg  fi
4060b12e5c03Smrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
406109885543Smrg
40627b58d2e0Smrg  # Check to see that the pipe works correctly.
40637b58d2e0Smrg  pipe_works=no
406409885543Smrg
40657b58d2e0Smrg  rm -f conftest*
40667b58d2e0Smrg  cat > conftest.$ac_ext <<_LT_EOF
40677b58d2e0Smrg#ifdef __cplusplus
40687b58d2e0Smrgextern "C" {
40697b58d2e0Smrg#endif
40707b58d2e0Smrgchar nm_test_var;
40717b58d2e0Smrgvoid nm_test_func(void);
40727b58d2e0Smrgvoid nm_test_func(void){}
40737b58d2e0Smrg#ifdef __cplusplus
40747b58d2e0Smrg}
40757b58d2e0Smrg#endif
40767b58d2e0Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
40777b58d2e0Smrg_LT_EOF
407809885543Smrg
40797b58d2e0Smrg  if AC_TRY_EVAL(ac_compile); then
40807b58d2e0Smrg    # Now try to grab the symbols.
40817b58d2e0Smrg    nlist=conftest.nm
4082b12e5c03Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
40837b58d2e0Smrg      # Try sorting and uniquifying the output.
40847b58d2e0Smrg      if sort "$nlist" | uniq > "$nlist"T; then
40857b58d2e0Smrg	mv -f "$nlist"T "$nlist"
40867b58d2e0Smrg      else
40877b58d2e0Smrg	rm -f "$nlist"T
40887b58d2e0Smrg      fi
408909885543Smrg
40907b58d2e0Smrg      # Make sure that we snagged all the symbols we need.
40917b58d2e0Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
40927b58d2e0Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
40937b58d2e0Smrg	  cat <<_LT_EOF > conftest.$ac_ext
4094b12e5c03Smrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
4095f395c03eSmrg#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
4096f395c03eSmrg/* DATA imports from DLLs on WIN32 can't be const, because runtime
4097b12e5c03Smrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
4098b12e5c03Smrg# define LT@&t@_DLSYM_CONST
4099f395c03eSmrg#elif defined __osf__
4100b12e5c03Smrg/* This system does not cope well with relocations in const data.  */
4101b12e5c03Smrg# define LT@&t@_DLSYM_CONST
4102b12e5c03Smrg#else
4103b12e5c03Smrg# define LT@&t@_DLSYM_CONST const
4104b12e5c03Smrg#endif
4105b12e5c03Smrg
41067b58d2e0Smrg#ifdef __cplusplus
41077b58d2e0Smrgextern "C" {
41087b58d2e0Smrg#endif
410909885543Smrg
41107b58d2e0Smrg_LT_EOF
41117b58d2e0Smrg	  # Now generate the symbol file.
41127b58d2e0Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
411309885543Smrg
41147b58d2e0Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
411509885543Smrg
41167b58d2e0Smrg/* The mapping between symbol names and symbols.  */
4117b12e5c03SmrgLT@&t@_DLSYM_CONST struct {
41187b58d2e0Smrg  const char *name;
41197b58d2e0Smrg  void       *address;
41207b58d2e0Smrg}
41217b58d2e0Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
41227b58d2e0Smrg{
41237b58d2e0Smrg  { "@PROGRAM@", (void *) 0 },
41247b58d2e0Smrg_LT_EOF
4125f395c03eSmrg	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
41267b58d2e0Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
41277b58d2e0Smrg  {0, (void *) 0}
41287b58d2e0Smrg};
412909885543Smrg
41307b58d2e0Smrg/* This works around a problem in FreeBSD linker */
41317b58d2e0Smrg#ifdef FREEBSD_WORKAROUND
41327b58d2e0Smrgstatic const void *lt_preloaded_setup() {
41337b58d2e0Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
41347b58d2e0Smrg}
41357b58d2e0Smrg#endif
413609885543Smrg
41377b58d2e0Smrg#ifdef __cplusplus
41387b58d2e0Smrg}
41397b58d2e0Smrg#endif
41407b58d2e0Smrg_LT_EOF
41417b58d2e0Smrg	  # Now try linking the two files.
41427b58d2e0Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
4143b12e5c03Smrg	  lt_globsym_save_LIBS=$LIBS
4144b12e5c03Smrg	  lt_globsym_save_CFLAGS=$CFLAGS
4145f395c03eSmrg	  LIBS=conftstm.$ac_objext
41467b58d2e0Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4147f395c03eSmrg	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
41487b58d2e0Smrg	    pipe_works=yes
41497b58d2e0Smrg	  fi
4150b12e5c03Smrg	  LIBS=$lt_globsym_save_LIBS
4151b12e5c03Smrg	  CFLAGS=$lt_globsym_save_CFLAGS
41527b58d2e0Smrg	else
41537b58d2e0Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
41547b58d2e0Smrg	fi
41557b58d2e0Smrg      else
41567b58d2e0Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
41577b58d2e0Smrg      fi
41587b58d2e0Smrg    else
41597b58d2e0Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
41607b58d2e0Smrg    fi
41617b58d2e0Smrg  else
41627b58d2e0Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
41637b58d2e0Smrg    cat conftest.$ac_ext >&5
41647b58d2e0Smrg  fi
41657b58d2e0Smrg  rm -rf conftest* conftst*
416609885543Smrg
41677b58d2e0Smrg  # Do not use the global_symbol_pipe unless it works.
4168f395c03eSmrg  if test yes = "$pipe_works"; then
41697b58d2e0Smrg    break
41707b58d2e0Smrg  else
41717b58d2e0Smrg    lt_cv_sys_global_symbol_pipe=
4172e4f6584cSmrg  fi
41737b58d2e0Smrgdone
41747b58d2e0Smrg])
41757b58d2e0Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
41767b58d2e0Smrg  lt_cv_sys_global_symbol_to_cdecl=
41777b58d2e0Smrgfi
41787b58d2e0Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
41797b58d2e0Smrg  AC_MSG_RESULT(failed)
4180e4f6584cSmrgelse
41817b58d2e0Smrg  AC_MSG_RESULT(ok)
4182e4f6584cSmrgfi
418309885543Smrg
4184b12e5c03Smrg# Response file support.
4185b12e5c03Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
4186b12e5c03Smrg  nm_file_list_spec='@'
4187b12e5c03Smrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
4188b12e5c03Smrg  nm_file_list_spec='@'
4189b12e5c03Smrgfi
4190b12e5c03Smrg
41917b58d2e0Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
41927b58d2e0Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
41937b58d2e0Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
41947b58d2e0Smrg    [Transform the output of nm in a proper C declaration])
4195f395c03eSmrg_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
4196f395c03eSmrg    [Transform the output of nm into a list of symbols to manually relocate])
41977b58d2e0Smrg_LT_DECL([global_symbol_to_c_name_address],
41987b58d2e0Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
41997b58d2e0Smrg    [Transform the output of nm in a C name address pair])
42007b58d2e0Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
42017b58d2e0Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
42027b58d2e0Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
4203f395c03eSmrg_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
4204f395c03eSmrg    [The name lister interface])
4205b12e5c03Smrg_LT_DECL([], [nm_file_list_spec], [1],
4206b12e5c03Smrg    [Specify filename containing input files for $NM])
42077b58d2e0Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
420809885543Smrg
420909885543Smrg
42107b58d2e0Smrg# _LT_COMPILER_PIC([TAGNAME])
42117b58d2e0Smrg# ---------------------------
42127b58d2e0Smrgm4_defun([_LT_COMPILER_PIC],
42137b58d2e0Smrg[m4_require([_LT_TAG_COMPILER])dnl
42147b58d2e0Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
42157b58d2e0Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
42167b58d2e0Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
421709885543Smrg
42187b58d2e0Smrgm4_if([$1], [CXX], [
42197b58d2e0Smrg  # C++ specific cases for pic, static, wl, etc.
4220f395c03eSmrg  if test yes = "$GXX"; then
42217b58d2e0Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
42227b58d2e0Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
422309885543Smrg
4224e4f6584cSmrg    case $host_os in
42257b58d2e0Smrg    aix*)
42267b58d2e0Smrg      # All AIX code is PIC.
4227f395c03eSmrg      if test ia64 = "$host_cpu"; then
42287b58d2e0Smrg	# AIX 5 now supports IA64 processor
42297b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4230e4f6584cSmrg      fi
4231f395c03eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4232e4f6584cSmrg      ;;
423309885543Smrg
42347b58d2e0Smrg    amigaos*)
42357b58d2e0Smrg      case $host_cpu in
42367b58d2e0Smrg      powerpc)
42377b58d2e0Smrg            # see comment about AmigaOS4 .so support
42387b58d2e0Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42397b58d2e0Smrg        ;;
42407b58d2e0Smrg      m68k)
42417b58d2e0Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
4242f395c03eSmrg            # adding the '-m68020' flag to GCC prevents building anything better,
4243f395c03eSmrg            # like '-m68040'.
42447b58d2e0Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
42457b58d2e0Smrg        ;;
42467b58d2e0Smrg      esac
42477b58d2e0Smrg      ;;
424809885543Smrg
42497b58d2e0Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
42507b58d2e0Smrg      # PIC is the default for these OSes.
4251e4f6584cSmrg      ;;
42527b58d2e0Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
42537b58d2e0Smrg      # This hack is so that the source file can tell whether it is being
42547b58d2e0Smrg      # built for inclusion in a dll (and should export symbols for example).
42557b58d2e0Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
42567b58d2e0Smrg      # (--disable-auto-import) libraries
42577b58d2e0Smrg      m4_if([$1], [GCJ], [],
42587b58d2e0Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4259f395c03eSmrg      case $host_os in
4260f395c03eSmrg      os2*)
4261f395c03eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4262f395c03eSmrg	;;
4263f395c03eSmrg      esac
42647b58d2e0Smrg      ;;
42657b58d2e0Smrg    darwin* | rhapsody*)
42667b58d2e0Smrg      # PIC is the default on this platform
42677b58d2e0Smrg      # Common symbols not allowed in MH_DYLIB files
42687b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
42697b58d2e0Smrg      ;;
42707b58d2e0Smrg    *djgpp*)
42717b58d2e0Smrg      # DJGPP does not support shared libraries at all
42727b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
42737b58d2e0Smrg      ;;
4274b12e5c03Smrg    haiku*)
4275b12e5c03Smrg      # PIC is the default for Haiku.
4276b12e5c03Smrg      # The "-static" flag exists, but is broken.
4277b12e5c03Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4278b12e5c03Smrg      ;;
42797b58d2e0Smrg    interix[[3-9]]*)
42807b58d2e0Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
42817b58d2e0Smrg      # Instead, we relocate shared libraries at runtime.
42827b58d2e0Smrg      ;;
42837b58d2e0Smrg    sysv4*MP*)
42847b58d2e0Smrg      if test -d /usr/nec; then
42857b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4286e4f6584cSmrg      fi
4287e4f6584cSmrg      ;;
42887b58d2e0Smrg    hpux*)
42897b58d2e0Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
42907b58d2e0Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
42917b58d2e0Smrg      # sets the default TLS model and affects inlining.
42927b58d2e0Smrg      case $host_cpu in
42937b58d2e0Smrg      hppa*64*)
42947b58d2e0Smrg	;;
42957b58d2e0Smrg      *)
42967b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42977b58d2e0Smrg	;;
42987b58d2e0Smrg      esac
42997b58d2e0Smrg      ;;
43007b58d2e0Smrg    *qnx* | *nto*)
43017b58d2e0Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
43027b58d2e0Smrg      # it will coredump.
43037b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
43047b58d2e0Smrg      ;;
43057b58d2e0Smrg    *)
43067b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4307e4f6584cSmrg      ;;
4308e4f6584cSmrg    esac
4309e4f6584cSmrg  else
4310e4f6584cSmrg    case $host_os in
43117b58d2e0Smrg      aix[[4-9]]*)
43127b58d2e0Smrg	# All AIX code is PIC.
4313f395c03eSmrg	if test ia64 = "$host_cpu"; then
43147b58d2e0Smrg	  # AIX 5 now supports IA64 processor
43157b58d2e0Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4316e4f6584cSmrg	else
43177b58d2e0Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
43187b58d2e0Smrg	fi
4319e4f6584cSmrg	;;
43207b58d2e0Smrg      chorus*)
43217b58d2e0Smrg	case $cc_basename in
43227b58d2e0Smrg	cxch68*)
43237b58d2e0Smrg	  # Green Hills C++ Compiler
43247b58d2e0Smrg	  # _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"
43257b58d2e0Smrg	  ;;
43267b58d2e0Smrg	esac
4327e4f6584cSmrg	;;
4328b12e5c03Smrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
4329b12e5c03Smrg	# This hack is so that the source file can tell whether it is being
4330b12e5c03Smrg	# built for inclusion in a dll (and should export symbols for example).
4331b12e5c03Smrg	m4_if([$1], [GCJ], [],
4332b12e5c03Smrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4333b12e5c03Smrg	;;
43347b58d2e0Smrg      dgux*)
43357b58d2e0Smrg	case $cc_basename in
43367b58d2e0Smrg	  ec++*)
43377b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
43387b58d2e0Smrg	    ;;
43397b58d2e0Smrg	  ghcx*)
43407b58d2e0Smrg	    # Green Hills C++ Compiler
43417b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
43427b58d2e0Smrg	    ;;
43437b58d2e0Smrg	  *)
43447b58d2e0Smrg	    ;;
43457b58d2e0Smrg	esac
4346e4f6584cSmrg	;;
43477b58d2e0Smrg      freebsd* | dragonfly*)
43487b58d2e0Smrg	# FreeBSD uses GNU C++
43497b58d2e0Smrg	;;
43507b58d2e0Smrg      hpux9* | hpux10* | hpux11*)
43517b58d2e0Smrg	case $cc_basename in
43527b58d2e0Smrg	  CC*)
43537b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4354f395c03eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4355f395c03eSmrg	    if test ia64 != "$host_cpu"; then
43567b58d2e0Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
43577b58d2e0Smrg	    fi
43587b58d2e0Smrg	    ;;
43597b58d2e0Smrg	  aCC*)
43607b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4361f395c03eSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
43627b58d2e0Smrg	    case $host_cpu in
43637b58d2e0Smrg	    hppa*64*|ia64*)
43647b58d2e0Smrg	      # +Z the default
43657b58d2e0Smrg	      ;;
43667b58d2e0Smrg	    *)
43677b58d2e0Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
43687b58d2e0Smrg	      ;;
43697b58d2e0Smrg	    esac
43707b58d2e0Smrg	    ;;
43717b58d2e0Smrg	  *)
43727b58d2e0Smrg	    ;;
43737b58d2e0Smrg	esac
43747b58d2e0Smrg	;;
43757b58d2e0Smrg      interix*)
43767b58d2e0Smrg	# This is c89, which is MS Visual C++ (no shared libs)
43777b58d2e0Smrg	# Anyone wants to do a port?
43787b58d2e0Smrg	;;
43797b58d2e0Smrg      irix5* | irix6* | nonstopux*)
43807b58d2e0Smrg	case $cc_basename in
43817b58d2e0Smrg	  CC*)
43827b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43837b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
43847b58d2e0Smrg	    # CC pic flag -KPIC is the default.
43857b58d2e0Smrg	    ;;
43867b58d2e0Smrg	  *)
43877b58d2e0Smrg	    ;;
43887b58d2e0Smrg	esac
43897b58d2e0Smrg	;;
4390df9ffc95Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
43917b58d2e0Smrg	case $cc_basename in
43927b58d2e0Smrg	  KCC*)
43937b58d2e0Smrg	    # KAI C++ Compiler
43947b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
43957b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
43967b58d2e0Smrg	    ;;
43977b58d2e0Smrg	  ecpc* )
4398f395c03eSmrg	    # old Intel C++ for x86_64, which still supported -KPIC.
43997b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44007b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44017b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
44027b58d2e0Smrg	    ;;
44037b58d2e0Smrg	  icpc* )
44047b58d2e0Smrg	    # Intel C++, used to be incompatible with GCC.
44057b58d2e0Smrg	    # ICC 10 doesn't accept -KPIC any more.
44067b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44077b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
44087b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
44097b58d2e0Smrg	    ;;
44107b58d2e0Smrg	  pgCC* | pgcpp*)
44117b58d2e0Smrg	    # Portland Group C++ compiler
44127b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44137b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
44147b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44157b58d2e0Smrg	    ;;
44167b58d2e0Smrg	  cxx*)
44177b58d2e0Smrg	    # Compaq C++
44187b58d2e0Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
44197b58d2e0Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
44207b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
44217b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
44227b58d2e0Smrg	    ;;
4423b12e5c03Smrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
4424b12e5c03Smrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
44257b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44267b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
44277b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
44287b58d2e0Smrg	    ;;
44297b58d2e0Smrg	  *)
44307b58d2e0Smrg	    case `$CC -V 2>&1 | sed 5q` in
44317b58d2e0Smrg	    *Sun\ C*)
44327b58d2e0Smrg	      # Sun C++ 5.9
44337b58d2e0Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44347b58d2e0Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44357b58d2e0Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
44367b58d2e0Smrg	      ;;
44377b58d2e0Smrg	    esac
44387b58d2e0Smrg	    ;;
44397b58d2e0Smrg	esac
44407b58d2e0Smrg	;;
44417b58d2e0Smrg      lynxos*)
44427b58d2e0Smrg	;;
44437b58d2e0Smrg      m88k*)
44447b58d2e0Smrg	;;
44457b58d2e0Smrg      mvs*)
44467b58d2e0Smrg	case $cc_basename in
44477b58d2e0Smrg	  cxx*)
44487b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
44497b58d2e0Smrg	    ;;
44507b58d2e0Smrg	  *)
44517b58d2e0Smrg	    ;;
44527b58d2e0Smrg	esac
44537b58d2e0Smrg	;;
4454f395c03eSmrg      netbsd*)
44557b58d2e0Smrg	;;
44567b58d2e0Smrg      *qnx* | *nto*)
44577b58d2e0Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
44587b58d2e0Smrg        # it will coredump.
44597b58d2e0Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
44607b58d2e0Smrg        ;;
44617b58d2e0Smrg      osf3* | osf4* | osf5*)
44627b58d2e0Smrg	case $cc_basename in
44637b58d2e0Smrg	  KCC*)
44647b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
44657b58d2e0Smrg	    ;;
44667b58d2e0Smrg	  RCC*)
44677b58d2e0Smrg	    # Rational C++ 2.4.1
44687b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
44697b58d2e0Smrg	    ;;
44707b58d2e0Smrg	  cxx*)
44717b58d2e0Smrg	    # Digital/Compaq C++
44727b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44737b58d2e0Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
44747b58d2e0Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
44757b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
44767b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
44777b58d2e0Smrg	    ;;
44787b58d2e0Smrg	  *)
44797b58d2e0Smrg	    ;;
44807b58d2e0Smrg	esac
44817b58d2e0Smrg	;;
44827b58d2e0Smrg      psos*)
44837b58d2e0Smrg	;;
44847b58d2e0Smrg      solaris*)
44857b58d2e0Smrg	case $cc_basename in
4486b12e5c03Smrg	  CC* | sunCC*)
44877b58d2e0Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
44887b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44897b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44907b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
44917b58d2e0Smrg	    ;;
44927b58d2e0Smrg	  gcx*)
44937b58d2e0Smrg	    # Green Hills C++ Compiler
44947b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
44957b58d2e0Smrg	    ;;
44967b58d2e0Smrg	  *)
44977b58d2e0Smrg	    ;;
44987b58d2e0Smrg	esac
44997b58d2e0Smrg	;;
45007b58d2e0Smrg      sunos4*)
45017b58d2e0Smrg	case $cc_basename in
45027b58d2e0Smrg	  CC*)
45037b58d2e0Smrg	    # Sun C++ 4.x
45047b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
45057b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
45067b58d2e0Smrg	    ;;
45077b58d2e0Smrg	  lcc*)
45087b58d2e0Smrg	    # Lucid
45097b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
45107b58d2e0Smrg	    ;;
45117b58d2e0Smrg	  *)
45127b58d2e0Smrg	    ;;
45137b58d2e0Smrg	esac
45147b58d2e0Smrg	;;
45157b58d2e0Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
45167b58d2e0Smrg	case $cc_basename in
45177b58d2e0Smrg	  CC*)
45187b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
45197b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
45207b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
45217b58d2e0Smrg	    ;;
45227b58d2e0Smrg	esac
45237b58d2e0Smrg	;;
45247b58d2e0Smrg      tandem*)
45257b58d2e0Smrg	case $cc_basename in
45267b58d2e0Smrg	  NCC*)
45277b58d2e0Smrg	    # NonStop-UX NCC 3.20
45287b58d2e0Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
45297b58d2e0Smrg	    ;;
45307b58d2e0Smrg	  *)
45317b58d2e0Smrg	    ;;
45327b58d2e0Smrg	esac
45337b58d2e0Smrg	;;
45347b58d2e0Smrg      vxworks*)
45357b58d2e0Smrg	;;
45367b58d2e0Smrg      *)
45377b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
45387b58d2e0Smrg	;;
45397b58d2e0Smrg    esac
45407b58d2e0Smrg  fi
45417b58d2e0Smrg],
45427b58d2e0Smrg[
4543f395c03eSmrg  if test yes = "$GCC"; then
45447b58d2e0Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
45457b58d2e0Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
454609885543Smrg
45477b58d2e0Smrg    case $host_os in
45487b58d2e0Smrg      aix*)
45497b58d2e0Smrg      # All AIX code is PIC.
4550f395c03eSmrg      if test ia64 = "$host_cpu"; then
45517b58d2e0Smrg	# AIX 5 now supports IA64 processor
45527b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
45537b58d2e0Smrg      fi
4554f395c03eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
45557b58d2e0Smrg      ;;
455609885543Smrg
45577b58d2e0Smrg    amigaos*)
45587b58d2e0Smrg      case $host_cpu in
45597b58d2e0Smrg      powerpc)
45607b58d2e0Smrg            # see comment about AmigaOS4 .so support
45617b58d2e0Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
45627b58d2e0Smrg        ;;
45637b58d2e0Smrg      m68k)
45647b58d2e0Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
4565f395c03eSmrg            # adding the '-m68020' flag to GCC prevents building anything better,
4566f395c03eSmrg            # like '-m68040'.
45677b58d2e0Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
45687b58d2e0Smrg        ;;
45697b58d2e0Smrg      esac
45707b58d2e0Smrg      ;;
457109885543Smrg
45727b58d2e0Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
45737b58d2e0Smrg      # PIC is the default for these OSes.
45747b58d2e0Smrg      ;;
457509885543Smrg
45767b58d2e0Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
45777b58d2e0Smrg      # This hack is so that the source file can tell whether it is being
45787b58d2e0Smrg      # built for inclusion in a dll (and should export symbols for example).
45797b58d2e0Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
45807b58d2e0Smrg      # (--disable-auto-import) libraries
45817b58d2e0Smrg      m4_if([$1], [GCJ], [],
45827b58d2e0Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4583f395c03eSmrg      case $host_os in
4584f395c03eSmrg      os2*)
4585f395c03eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4586f395c03eSmrg	;;
4587f395c03eSmrg      esac
45887b58d2e0Smrg      ;;
4589e4f6584cSmrg
45907b58d2e0Smrg    darwin* | rhapsody*)
45917b58d2e0Smrg      # PIC is the default on this platform
45927b58d2e0Smrg      # Common symbols not allowed in MH_DYLIB files
45937b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
45947b58d2e0Smrg      ;;
4595e4f6584cSmrg
4596b12e5c03Smrg    haiku*)
4597b12e5c03Smrg      # PIC is the default for Haiku.
4598b12e5c03Smrg      # The "-static" flag exists, but is broken.
4599b12e5c03Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4600b12e5c03Smrg      ;;
4601b12e5c03Smrg
46027b58d2e0Smrg    hpux*)
46037b58d2e0Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
46047b58d2e0Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
46057b58d2e0Smrg      # sets the default TLS model and affects inlining.
46067b58d2e0Smrg      case $host_cpu in
46077b58d2e0Smrg      hppa*64*)
46087b58d2e0Smrg	# +Z the default
46097b58d2e0Smrg	;;
46107b58d2e0Smrg      *)
46117b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
46127b58d2e0Smrg	;;
46137b58d2e0Smrg      esac
46147b58d2e0Smrg      ;;
461509885543Smrg
46167b58d2e0Smrg    interix[[3-9]]*)
46177b58d2e0Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
46187b58d2e0Smrg      # Instead, we relocate shared libraries at runtime.
46197b58d2e0Smrg      ;;
462009885543Smrg
46217b58d2e0Smrg    msdosdjgpp*)
46227b58d2e0Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
46237b58d2e0Smrg      # on systems that don't support them.
46247b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
46257b58d2e0Smrg      enable_shared=no
46267b58d2e0Smrg      ;;
462709885543Smrg
46287b58d2e0Smrg    *nto* | *qnx*)
46297b58d2e0Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
46307b58d2e0Smrg      # it will coredump.
46317b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
46327b58d2e0Smrg      ;;
463309885543Smrg
46347b58d2e0Smrg    sysv4*MP*)
46357b58d2e0Smrg      if test -d /usr/nec; then
46367b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
46377b58d2e0Smrg      fi
46387b58d2e0Smrg      ;;
463909885543Smrg
46407b58d2e0Smrg    *)
46417b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
46427b58d2e0Smrg      ;;
46437b58d2e0Smrg    esac
4644b12e5c03Smrg
4645b12e5c03Smrg    case $cc_basename in
4646b12e5c03Smrg    nvcc*) # Cuda Compiler Driver 2.2
4647b12e5c03Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
4648b12e5c03Smrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4649b12e5c03Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
4650b12e5c03Smrg      fi
4651b12e5c03Smrg      ;;
4652b12e5c03Smrg    esac
4653e4f6584cSmrg  else
46547b58d2e0Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
46557b58d2e0Smrg    case $host_os in
46567b58d2e0Smrg    aix*)
46577b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4658f395c03eSmrg      if test ia64 = "$host_cpu"; then
46597b58d2e0Smrg	# AIX 5 now supports IA64 processor
46607b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
46617b58d2e0Smrg      else
46627b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
46637b58d2e0Smrg      fi
46647b58d2e0Smrg      ;;
466509885543Smrg
4666f395c03eSmrg    darwin* | rhapsody*)
4667f395c03eSmrg      # PIC is the default on this platform
4668f395c03eSmrg      # Common symbols not allowed in MH_DYLIB files
4669f395c03eSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4670f395c03eSmrg      case $cc_basename in
4671f395c03eSmrg      nagfor*)
4672f395c03eSmrg        # NAG Fortran compiler
4673f395c03eSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4674f395c03eSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4675f395c03eSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4676f395c03eSmrg        ;;
4677f395c03eSmrg      esac
4678f395c03eSmrg      ;;
4679f395c03eSmrg
46807b58d2e0Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
46817b58d2e0Smrg      # This hack is so that the source file can tell whether it is being
46827b58d2e0Smrg      # built for inclusion in a dll (and should export symbols for example).
46837b58d2e0Smrg      m4_if([$1], [GCJ], [],
46847b58d2e0Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4685f395c03eSmrg      case $host_os in
4686f395c03eSmrg      os2*)
4687f395c03eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4688f395c03eSmrg	;;
4689f395c03eSmrg      esac
4690e4f6584cSmrg      ;;
46917b58d2e0Smrg
46927b58d2e0Smrg    hpux9* | hpux10* | hpux11*)
46937b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
46947b58d2e0Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
46957b58d2e0Smrg      # not for PA HP-UX.
46967b58d2e0Smrg      case $host_cpu in
46977b58d2e0Smrg      hppa*64*|ia64*)
46987b58d2e0Smrg	# +Z the default
4699e4f6584cSmrg	;;
4700e4f6584cSmrg      *)
47017b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4702e4f6584cSmrg	;;
4703e4f6584cSmrg      esac
47047b58d2e0Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
4705f395c03eSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
47067b58d2e0Smrg      ;;
470709885543Smrg
47087b58d2e0Smrg    irix5* | irix6* | nonstopux*)
47097b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47107b58d2e0Smrg      # PIC (with -KPIC) is the default.
47117b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
47127b58d2e0Smrg      ;;
471309885543Smrg
4714df9ffc95Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
47157b58d2e0Smrg      case $cc_basename in
4716f395c03eSmrg      # old Intel for x86_64, which still supported -KPIC.
47177b58d2e0Smrg      ecc*)
47187b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47197b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
47207b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
47217b58d2e0Smrg        ;;
47227b58d2e0Smrg      # icc used to be incompatible with GCC.
47237b58d2e0Smrg      # ICC 10 doesn't accept -KPIC any more.
47247b58d2e0Smrg      icc* | ifort*)
47257b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47267b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
47277b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
47287b58d2e0Smrg        ;;
47297b58d2e0Smrg      # Lahey Fortran 8.1.
47307b58d2e0Smrg      lf95*)
47317b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47327b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
47337b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
47347b58d2e0Smrg	;;
4735b12e5c03Smrg      nagfor*)
4736b12e5c03Smrg	# NAG Fortran compiler
4737b12e5c03Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4738b12e5c03Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4739b12e5c03Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4740b12e5c03Smrg	;;
4741f395c03eSmrg      tcc*)
4742f395c03eSmrg	# Fabrice Bellard et al's Tiny C Compiler
4743f395c03eSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4744f395c03eSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4745f395c03eSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4746f395c03eSmrg	;;
4747b12e5c03Smrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
47487b58d2e0Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
47497b58d2e0Smrg	# which looks to be a dead project)
47507b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47517b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
47527b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47537b58d2e0Smrg        ;;
47547b58d2e0Smrg      ccc*)
47557b58d2e0Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47567b58d2e0Smrg        # All Alpha code is PIC.
47577b58d2e0Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
47587b58d2e0Smrg        ;;
4759b12e5c03Smrg      xl* | bgxl* | bgf* | mpixl*)
4760b12e5c03Smrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
47617b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47627b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
47637b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
47647b58d2e0Smrg	;;
47657b58d2e0Smrg      *)
47667b58d2e0Smrg	case `$CC -V 2>&1 | sed 5q` in
4767b12e5c03Smrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
4768b12e5c03Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
4769b12e5c03Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4770b12e5c03Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4771b12e5c03Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4772b12e5c03Smrg	  ;;
4773b12e5c03Smrg	*Sun\ F* | *Sun*Fortran*)
4774b12e5c03Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4775b12e5c03Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4776b12e5c03Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4777b12e5c03Smrg	  ;;
47787b58d2e0Smrg	*Sun\ C*)
47797b58d2e0Smrg	  # Sun C 5.9
47807b58d2e0Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
47817b58d2e0Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47827b58d2e0Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47837b58d2e0Smrg	  ;;
4784b12e5c03Smrg        *Intel*\ [[CF]]*Compiler*)
4785b12e5c03Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4786b12e5c03Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4787b12e5c03Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4788b12e5c03Smrg	  ;;
4789b12e5c03Smrg	*Portland\ Group*)
4790b12e5c03Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4791b12e5c03Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
47927b58d2e0Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47937b58d2e0Smrg	  ;;
47947b58d2e0Smrg	esac
47957b58d2e0Smrg	;;
47967b58d2e0Smrg      esac
47977b58d2e0Smrg      ;;
479809885543Smrg
47997b58d2e0Smrg    newsos6)
48007b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
48017b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48027b58d2e0Smrg      ;;
480309885543Smrg
48047b58d2e0Smrg    *nto* | *qnx*)
48057b58d2e0Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
48067b58d2e0Smrg      # it will coredump.
48077b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
48087b58d2e0Smrg      ;;
480909885543Smrg
48107b58d2e0Smrg    osf3* | osf4* | osf5*)
48117b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
48127b58d2e0Smrg      # All OSF/1 code is PIC.
48137b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
48147b58d2e0Smrg      ;;
481509885543Smrg
48167b58d2e0Smrg    rdos*)
48177b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
48187b58d2e0Smrg      ;;
481909885543Smrg
48207b58d2e0Smrg    solaris*)
48217b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
48227b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48237b58d2e0Smrg      case $cc_basename in
4824b12e5c03Smrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
48257b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
48267b58d2e0Smrg      *)
48277b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
48287b58d2e0Smrg      esac
48297b58d2e0Smrg      ;;
483009885543Smrg
48317b58d2e0Smrg    sunos4*)
48327b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
48337b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
48347b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48357b58d2e0Smrg      ;;
483609885543Smrg
48377b58d2e0Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
48387b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
48397b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
48407b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48417b58d2e0Smrg      ;;
484209885543Smrg
48437b58d2e0Smrg    sysv4*MP*)
4844f395c03eSmrg      if test -d /usr/nec; then
48457b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
48467b58d2e0Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48477b58d2e0Smrg      fi
48487b58d2e0Smrg      ;;
484909885543Smrg
48507b58d2e0Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
48517b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
48527b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
48537b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48547b58d2e0Smrg      ;;
485509885543Smrg
48567b58d2e0Smrg    unicos*)
48577b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
48587b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
48597b58d2e0Smrg      ;;
486009885543Smrg
48617b58d2e0Smrg    uts4*)
48627b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
48637b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48647b58d2e0Smrg      ;;
486509885543Smrg
48667b58d2e0Smrg    *)
48677b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4868e4f6584cSmrg      ;;
4869e4f6584cSmrg    esac
4870e4f6584cSmrg  fi
48717b58d2e0Smrg])
48727b58d2e0Smrgcase $host_os in
4873f395c03eSmrg  # For platforms that do not support PIC, -DPIC is meaningless:
48747b58d2e0Smrg  *djgpp*)
48757b58d2e0Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4876e4f6584cSmrg    ;;
4877e4f6584cSmrg  *)
48787b58d2e0Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4879e4f6584cSmrg    ;;
48807b58d2e0Smrgesac
4881b12e5c03Smrg
4882b12e5c03SmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
4883b12e5c03Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
4884b12e5c03Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4885b12e5c03Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
488609885543Smrg
48877b58d2e0Smrg#
48887b58d2e0Smrg# Check to make sure the PIC flag actually works.
48897b58d2e0Smrg#
48907b58d2e0Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
48917b58d2e0Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
48927b58d2e0Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
48937b58d2e0Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
48947b58d2e0Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
48957b58d2e0Smrg     "" | " "*) ;;
48967b58d2e0Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
48977b58d2e0Smrg     esac],
48987b58d2e0Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
48997b58d2e0Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
49007b58d2e0Smrgfi
49017b58d2e0Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
49027b58d2e0Smrg	[Additional compiler flags for building library objects])
490309885543Smrg
4904b12e5c03Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4905b12e5c03Smrg	[How to pass a linker flag through the compiler])
49067b58d2e0Smrg#
49077b58d2e0Smrg# Check to make sure the static flag actually works.
49087b58d2e0Smrg#
49097b58d2e0Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
49107b58d2e0Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
49117b58d2e0Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
49127b58d2e0Smrg  $lt_tmp_static_flag,
49137b58d2e0Smrg  [],
49147b58d2e0Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
49157b58d2e0Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
49167b58d2e0Smrg	[Compiler flag to prevent dynamic linking])
49177b58d2e0Smrg])# _LT_COMPILER_PIC
491809885543Smrg
49192ec8c4b4Smrg
49207b58d2e0Smrg# _LT_LINKER_SHLIBS([TAGNAME])
49217b58d2e0Smrg# ----------------------------
49227b58d2e0Smrg# See if the linker supports building shared libraries.
49237b58d2e0Smrgm4_defun([_LT_LINKER_SHLIBS],
49247b58d2e0Smrg[AC_REQUIRE([LT_PATH_LD])dnl
49257b58d2e0SmrgAC_REQUIRE([LT_PATH_NM])dnl
4926b12e5c03Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
49277b58d2e0Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
49287b58d2e0Smrgm4_require([_LT_DECL_EGREP])dnl
49297b58d2e0Smrgm4_require([_LT_DECL_SED])dnl
49307b58d2e0Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
49317b58d2e0Smrgm4_require([_LT_TAG_COMPILER])dnl
49327b58d2e0SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
49337b58d2e0Smrgm4_if([$1], [CXX], [
49347b58d2e0Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4935b12e5c03Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
49367b58d2e0Smrg  case $host_os in
49377b58d2e0Smrg  aix[[4-9]]*)
49387b58d2e0Smrg    # If we're using GNU nm, then we don't want the "-C" option.
4939f395c03eSmrg    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
4940f395c03eSmrg    # Without the "-l" option, or with the "-B" option, AIX nm treats
4941f395c03eSmrg    # weak defined symbols like other global defined symbols, whereas
4942f395c03eSmrg    # GNU nm marks them as "W".
4943f395c03eSmrg    # While the 'weak' keyword is ignored in the Export File, we need
4944f395c03eSmrg    # it in the Import File for the 'aix-soname' feature, so we have
4945f395c03eSmrg    # to replace the "-B" option with "-P" for AIX nm.
49467b58d2e0Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4947f395c03eSmrg      _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'
49487b58d2e0Smrg    else
4949f395c03eSmrg      _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'
49507b58d2e0Smrg    fi
49517b58d2e0Smrg    ;;
49527b58d2e0Smrg  pw32*)
4953f395c03eSmrg    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
4954b12e5c03Smrg    ;;
49557b58d2e0Smrg  cygwin* | mingw* | cegcc*)
4956b12e5c03Smrg    case $cc_basename in
4957b12e5c03Smrg    cl*)
4958b12e5c03Smrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
4959b12e5c03Smrg      ;;
4960b12e5c03Smrg    *)
4961b12e5c03Smrg      _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'
4962b12e5c03Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4963b12e5c03Smrg      ;;
4964b12e5c03Smrg    esac
4965b12e5c03Smrg    ;;
49667b58d2e0Smrg  *)
49677b58d2e0Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4968b12e5c03Smrg    ;;
49697b58d2e0Smrg  esac
49707b58d2e0Smrg], [
49717b58d2e0Smrg  runpath_var=
49727b58d2e0Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
49737b58d2e0Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
49747b58d2e0Smrg  _LT_TAGVAR(archive_cmds, $1)=
49757b58d2e0Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
49767b58d2e0Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
49777b58d2e0Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
49787b58d2e0Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
49797b58d2e0Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
49807b58d2e0Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
49817b58d2e0Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
49827b58d2e0Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
49837b58d2e0Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
49847b58d2e0Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
49857b58d2e0Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
49867b58d2e0Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
49877b58d2e0Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
49887b58d2e0Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
49897b58d2e0Smrg  _LT_TAGVAR(module_cmds, $1)=
49907b58d2e0Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
49917b58d2e0Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
49927b58d2e0Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
49937b58d2e0Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
49947b58d2e0Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
49957b58d2e0Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
49967b58d2e0Smrg  # included in the symbol list
49977b58d2e0Smrg  _LT_TAGVAR(include_expsyms, $1)=
49987b58d2e0Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
4999f395c03eSmrg  # it will be wrapped by ' (' and ')$', so one must not match beginning or
5000f395c03eSmrg  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
5001f395c03eSmrg  # as well as any symbol that contains 'd'.
50027b58d2e0Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
50037b58d2e0Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
50047b58d2e0Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
50057b58d2e0Smrg  # the symbol is explicitly referenced.  Since portable code cannot
50067b58d2e0Smrg  # rely on this symbol name, it's probably fine to never include it in
50077b58d2e0Smrg  # preloaded symbol tables.
50087b58d2e0Smrg  # Exclude shared library initialization/finalization symbols.
50097b58d2e0Smrgdnl Note also adjust exclude_expsyms for C++ above.
50107b58d2e0Smrg  extract_expsyms_cmds=
50112ec8c4b4Smrg
50127b58d2e0Smrg  case $host_os in
50137b58d2e0Smrg  cygwin* | mingw* | pw32* | cegcc*)
50147b58d2e0Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
50157b58d2e0Smrg    # When not using gcc, we currently assume that we are using
50167b58d2e0Smrg    # Microsoft Visual C++.
5017f395c03eSmrg    if test yes != "$GCC"; then
50187b58d2e0Smrg      with_gnu_ld=no
50197b58d2e0Smrg    fi
5020e4f6584cSmrg    ;;
50217b58d2e0Smrg  interix*)
50227b58d2e0Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
50237b58d2e0Smrg    with_gnu_ld=yes
5024e4f6584cSmrg    ;;
5025f395c03eSmrg  openbsd* | bitrig*)
50267b58d2e0Smrg    with_gnu_ld=no
5027e4f6584cSmrg    ;;
5028b698ba48Smrg  esac
50292ec8c4b4Smrg
50307b58d2e0Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
5031b12e5c03Smrg
5032b12e5c03Smrg  # On some targets, GNU ld is compatible enough with the native linker
5033b12e5c03Smrg  # that we're better off using the native interface for both.
5034b12e5c03Smrg  lt_use_gnu_ld_interface=no
5035f395c03eSmrg  if test yes = "$with_gnu_ld"; then
5036b12e5c03Smrg    case $host_os in
5037b12e5c03Smrg      aix*)
5038b12e5c03Smrg	# The AIX port of GNU ld has always aspired to compatibility
5039b12e5c03Smrg	# with the native linker.  However, as the warning in the GNU ld
5040b12e5c03Smrg	# block says, versions before 2.19.5* couldn't really create working
5041b12e5c03Smrg	# shared libraries, regardless of the interface used.
5042b12e5c03Smrg	case `$LD -v 2>&1` in
5043b12e5c03Smrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
5044b12e5c03Smrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
5045b12e5c03Smrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
5046b12e5c03Smrg	  *)
5047b12e5c03Smrg	    lt_use_gnu_ld_interface=yes
5048b12e5c03Smrg	    ;;
5049b12e5c03Smrg	esac
5050b12e5c03Smrg	;;
5051b12e5c03Smrg      *)
5052b12e5c03Smrg	lt_use_gnu_ld_interface=yes
5053b12e5c03Smrg	;;
5054b12e5c03Smrg    esac
5055b12e5c03Smrg  fi
5056b12e5c03Smrg
5057f395c03eSmrg  if test yes = "$lt_use_gnu_ld_interface"; then
50587b58d2e0Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
5059f395c03eSmrg    wlarc='$wl'
5060e4f6584cSmrg
50617b58d2e0Smrg    # Set some defaults for GNU ld with shared library support. These
50627b58d2e0Smrg    # are reset later if shared libraries are not supported. Putting them
50637b58d2e0Smrg    # here allows them to be overridden if necessary.
50647b58d2e0Smrg    runpath_var=LD_RUN_PATH
5065f395c03eSmrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5066f395c03eSmrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
50677b58d2e0Smrg    # ancient GNU ld didn't support --whole-archive et. al.
50687b58d2e0Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
5069f395c03eSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
50707b58d2e0Smrg    else
50717b58d2e0Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
50727b58d2e0Smrg    fi
50737b58d2e0Smrg    supports_anon_versioning=no
5074f395c03eSmrg    case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
50757b58d2e0Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
50767b58d2e0Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
50777b58d2e0Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
50787b58d2e0Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
50797b58d2e0Smrg      *\ 2.11.*) ;; # other 2.11 versions
50807b58d2e0Smrg      *) supports_anon_versioning=yes ;;
50817b58d2e0Smrg    esac
5082e4f6584cSmrg
50837b58d2e0Smrg    # See if GNU ld supports shared libraries.
50847b58d2e0Smrg    case $host_os in
50857b58d2e0Smrg    aix[[3-9]]*)
50867b58d2e0Smrg      # On AIX/PPC, the GNU linker is very broken
5087f395c03eSmrg      if test ia64 != "$host_cpu"; then
50887b58d2e0Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
50897b58d2e0Smrg	cat <<_LT_EOF 1>&2
5090e4f6584cSmrg
5091b12e5c03Smrg*** Warning: the GNU linker, at least up to release 2.19, is reported
50927b58d2e0Smrg*** to be unable to reliably create shared libraries on AIX.
50937b58d2e0Smrg*** Therefore, libtool is disabling shared libraries support.  If you
5094b12e5c03Smrg*** really care for shared libraries, you may want to install binutils
5095b12e5c03Smrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
5096b12e5c03Smrg*** You will then need to restart the configuration process.
509709885543Smrg
50987b58d2e0Smrg_LT_EOF
50997b58d2e0Smrg      fi
51007b58d2e0Smrg      ;;
510109885543Smrg
51027b58d2e0Smrg    amigaos*)
51037b58d2e0Smrg      case $host_cpu in
51047b58d2e0Smrg      powerpc)
51057b58d2e0Smrg            # see comment about AmigaOS4 .so support
5106f395c03eSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
51077b58d2e0Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
51087b58d2e0Smrg        ;;
51097b58d2e0Smrg      m68k)
51107b58d2e0Smrg            _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)'
51117b58d2e0Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
51127b58d2e0Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
51137b58d2e0Smrg        ;;
51147b58d2e0Smrg      esac
51157b58d2e0Smrg      ;;
51162ec8c4b4Smrg
51177b58d2e0Smrg    beos*)
51187b58d2e0Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
51197b58d2e0Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
51207b58d2e0Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
51217b58d2e0Smrg	# support --undefined.  This deserves some investigation.  FIXME
5122f395c03eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
51237b58d2e0Smrg      else
51247b58d2e0Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
51257b58d2e0Smrg      fi
51267b58d2e0Smrg      ;;
5127e4f6584cSmrg
51287b58d2e0Smrg    cygwin* | mingw* | pw32* | cegcc*)
51297b58d2e0Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
51307b58d2e0Smrg      # as there is no search path for DLLs.
51317b58d2e0Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5132f395c03eSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
51337b58d2e0Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
51347b58d2e0Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
51357b58d2e0Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5136b12e5c03Smrg      _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'
5137b12e5c03Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5138e4f6584cSmrg
51397b58d2e0Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5140f395c03eSmrg        _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'
5141f395c03eSmrg	# If the export-symbols file already is a .def file, use it as
5142f395c03eSmrg	# is; otherwise, prepend EXPORTS...
5143f395c03eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5144f395c03eSmrg          cp $export_symbols $output_objdir/$soname.def;
5145f395c03eSmrg        else
5146f395c03eSmrg          echo EXPORTS > $output_objdir/$soname.def;
5147f395c03eSmrg          cat $export_symbols >> $output_objdir/$soname.def;
5148f395c03eSmrg        fi~
5149f395c03eSmrg        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
51507b58d2e0Smrg      else
51517b58d2e0Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
51527b58d2e0Smrg      fi
51537b58d2e0Smrg      ;;
5154e4f6584cSmrg
5155b12e5c03Smrg    haiku*)
5156f395c03eSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5157b12e5c03Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5158b12e5c03Smrg      ;;
5159b12e5c03Smrg
5160f395c03eSmrg    os2*)
5161f395c03eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5162f395c03eSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5163f395c03eSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5164f395c03eSmrg      shrext_cmds=.dll
5165f395c03eSmrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5166f395c03eSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5167f395c03eSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5168f395c03eSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5169f395c03eSmrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5170f395c03eSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5171f395c03eSmrg	emximp -o $lib $output_objdir/$libname.def'
5172f395c03eSmrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5173f395c03eSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5174f395c03eSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5175f395c03eSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5176f395c03eSmrg	prefix_cmds="$SED"~
5177f395c03eSmrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
5178f395c03eSmrg	  prefix_cmds="$prefix_cmds -e 1d";
5179f395c03eSmrg	fi~
5180f395c03eSmrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5181f395c03eSmrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5182f395c03eSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5183f395c03eSmrg	emximp -o $lib $output_objdir/$libname.def'
5184f395c03eSmrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5185f395c03eSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5186f395c03eSmrg      ;;
5187f395c03eSmrg
51887b58d2e0Smrg    interix[[3-9]]*)
51897b58d2e0Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
51907b58d2e0Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5191f395c03eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5192f395c03eSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
51937b58d2e0Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
51947b58d2e0Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
51957b58d2e0Smrg      # default) and relocated if they conflict, which is a slow very memory
51967b58d2e0Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
51977b58d2e0Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
51987b58d2e0Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5199f395c03eSmrg      _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'
5200f395c03eSmrg      _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'
52017b58d2e0Smrg      ;;
5202e4f6584cSmrg
52037b58d2e0Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
52047b58d2e0Smrg      tmp_diet=no
5205f395c03eSmrg      if test linux-dietlibc = "$host_os"; then
52067b58d2e0Smrg	case $cc_basename in
52077b58d2e0Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
52087b58d2e0Smrg	esac
52097b58d2e0Smrg      fi
52107b58d2e0Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
5211f395c03eSmrg	 && test no = "$tmp_diet"
52127b58d2e0Smrg      then
5213b12e5c03Smrg	tmp_addflag=' $pic_flag'
52147b58d2e0Smrg	tmp_sharedflag='-shared'
52157b58d2e0Smrg	case $cc_basename,$host_cpu in
52167b58d2e0Smrg        pgcc*)				# Portland Group C compiler
5217f395c03eSmrg	  _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'
52187b58d2e0Smrg	  tmp_addflag=' $pic_flag'
52197b58d2e0Smrg	  ;;
5220b12e5c03Smrg	pgf77* | pgf90* | pgf95* | pgfortran*)
5221b12e5c03Smrg					# Portland Group f77 and f90 compilers
5222f395c03eSmrg	  _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'
52237b58d2e0Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
52247b58d2e0Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
52257b58d2e0Smrg	  tmp_addflag=' -i_dynamic' ;;
52267b58d2e0Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
52277b58d2e0Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
52287b58d2e0Smrg	ifc* | ifort*)			# Intel Fortran compiler
52297b58d2e0Smrg	  tmp_addflag=' -nofor_main' ;;
52307b58d2e0Smrg	lf95*)				# Lahey Fortran 8.1
52317b58d2e0Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
52327b58d2e0Smrg	  tmp_sharedflag='--shared' ;;
5233f395c03eSmrg        nagfor*)                        # NAGFOR 5.3
5234f395c03eSmrg          tmp_sharedflag='-Wl,-shared' ;;
5235b12e5c03Smrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
52367b58d2e0Smrg	  tmp_sharedflag='-qmkshrobj'
52377b58d2e0Smrg	  tmp_addflag= ;;
5238b12e5c03Smrg	nvcc*)	# Cuda Compiler Driver 2.2
5239f395c03eSmrg	  _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'
5240b12e5c03Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5241b12e5c03Smrg	  ;;
52427b58d2e0Smrg	esac
52437b58d2e0Smrg	case `$CC -V 2>&1 | sed 5q` in
52447b58d2e0Smrg	*Sun\ C*)			# Sun C 5.9
5245f395c03eSmrg	  _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'
52467b58d2e0Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
52477b58d2e0Smrg	  tmp_sharedflag='-G' ;;
52487b58d2e0Smrg	*Sun\ F*)			# Sun Fortran 8.3
52497b58d2e0Smrg	  tmp_sharedflag='-G' ;;
52507b58d2e0Smrg	esac
5251f395c03eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
52522ec8c4b4Smrg
5253f395c03eSmrg        if test yes = "$supports_anon_versioning"; then
52547b58d2e0Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5255f395c03eSmrg            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5256f395c03eSmrg            echo "local: *; };" >> $output_objdir/$libname.ver~
5257f395c03eSmrg            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
52587b58d2e0Smrg        fi
52592ec8c4b4Smrg
52607b58d2e0Smrg	case $cc_basename in
5261f395c03eSmrg	tcc*)
5262f395c03eSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
5263f395c03eSmrg	  ;;
5264b12e5c03Smrg	xlf* | bgf* | bgxlf* | mpixlf*)
52657b58d2e0Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
52667b58d2e0Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
5267f395c03eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5268b12e5c03Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
5269f395c03eSmrg	  if test yes = "$supports_anon_versioning"; then
52707b58d2e0Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5271f395c03eSmrg              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5272f395c03eSmrg              echo "local: *; };" >> $output_objdir/$libname.ver~
5273f395c03eSmrg              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
52747b58d2e0Smrg	  fi
52757b58d2e0Smrg	  ;;
52767b58d2e0Smrg	esac
52777b58d2e0Smrg      else
52787b58d2e0Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
52797b58d2e0Smrg      fi
52807b58d2e0Smrg      ;;
52812ec8c4b4Smrg
5282f395c03eSmrg    netbsd*)
52837b58d2e0Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
52847b58d2e0Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
52857b58d2e0Smrg	wlarc=
52867b58d2e0Smrg      else
5287f395c03eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5288f395c03eSmrg	_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'
52897b58d2e0Smrg      fi
52907b58d2e0Smrg      ;;
52912ec8c4b4Smrg
52927b58d2e0Smrg    solaris*)
52937b58d2e0Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
52947b58d2e0Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
52957b58d2e0Smrg	cat <<_LT_EOF 1>&2
52962ec8c4b4Smrg
52977b58d2e0Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
52987b58d2e0Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
52997b58d2e0Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
53007b58d2e0Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
53017b58d2e0Smrg*** your PATH or compiler configuration so that the native linker is
53027b58d2e0Smrg*** used, and then restart.
53032ec8c4b4Smrg
53047b58d2e0Smrg_LT_EOF
53057b58d2e0Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5306f395c03eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5307f395c03eSmrg	_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'
53087b58d2e0Smrg      else
53097b58d2e0Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
53107b58d2e0Smrg      fi
53117b58d2e0Smrg      ;;
5312e4f6584cSmrg
53137b58d2e0Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
53147b58d2e0Smrg      case `$LD -v 2>&1` in
53157b58d2e0Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
53167b58d2e0Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
53177b58d2e0Smrg	cat <<_LT_EOF 1>&2
5318e4f6584cSmrg
5319f395c03eSmrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
53207b58d2e0Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
53217b58d2e0Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
53227b58d2e0Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
53237b58d2e0Smrg*** your PATH or compiler configuration so that the native linker is
53247b58d2e0Smrg*** used, and then restart.
5325e4f6584cSmrg
53267b58d2e0Smrg_LT_EOF
53277b58d2e0Smrg	;;
53287b58d2e0Smrg	*)
53297b58d2e0Smrg	  # For security reasons, it is highly recommended that you always
53307b58d2e0Smrg	  # use absolute paths for naming shared libraries, and exclude the
53317b58d2e0Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
53327b58d2e0Smrg	  # requires that you compile everything twice, which is a pain.
53337b58d2e0Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5334f395c03eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5335f395c03eSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5336f395c03eSmrg	    _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'
53377b58d2e0Smrg	  else
53387b58d2e0Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
53397b58d2e0Smrg	  fi
53407b58d2e0Smrg	;;
53417b58d2e0Smrg      esac
53427b58d2e0Smrg      ;;
53432ec8c4b4Smrg
53447b58d2e0Smrg    sunos4*)
53457b58d2e0Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
53467b58d2e0Smrg      wlarc=
53477b58d2e0Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
53487b58d2e0Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
53497b58d2e0Smrg      ;;
53502ec8c4b4Smrg
53517b58d2e0Smrg    *)
53527b58d2e0Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5353f395c03eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5354f395c03eSmrg	_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'
53557b58d2e0Smrg      else
53567b58d2e0Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
53577b58d2e0Smrg      fi
53587b58d2e0Smrg      ;;
53597b58d2e0Smrg    esac
53602ec8c4b4Smrg
5361f395c03eSmrg    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
53627b58d2e0Smrg      runpath_var=
53637b58d2e0Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
53647b58d2e0Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
53657b58d2e0Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
53667b58d2e0Smrg    fi
5367e4f6584cSmrg  else
53687b58d2e0Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
53697b58d2e0Smrg    case $host_os in
53707b58d2e0Smrg    aix3*)
53717b58d2e0Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
53727b58d2e0Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
53737b58d2e0Smrg      _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'
53747b58d2e0Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
53757b58d2e0Smrg      # are no directories specified by -L.
53767b58d2e0Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5377f395c03eSmrg      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
53787b58d2e0Smrg	# Neither direct hardcoding nor static linking is supported with a
53797b58d2e0Smrg	# broken collect2.
53807b58d2e0Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
53817b58d2e0Smrg      fi
53827b58d2e0Smrg      ;;
53832ec8c4b4Smrg
53847b58d2e0Smrg    aix[[4-9]]*)
5385f395c03eSmrg      if test ia64 = "$host_cpu"; then
53867b58d2e0Smrg	# On IA64, the linker does run time linking by default, so we don't
53877b58d2e0Smrg	# have to do anything special.
53887b58d2e0Smrg	aix_use_runtimelinking=no
53897b58d2e0Smrg	exp_sym_flag='-Bexport'
5390f395c03eSmrg	no_entry_flag=
53917b58d2e0Smrg      else
53927b58d2e0Smrg	# If we're using GNU nm, then we don't want the "-C" option.
5393f395c03eSmrg	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
5394f395c03eSmrg	# Without the "-l" option, or with the "-B" option, AIX nm treats
5395f395c03eSmrg	# weak defined symbols like other global defined symbols, whereas
5396f395c03eSmrg	# GNU nm marks them as "W".
5397f395c03eSmrg	# While the 'weak' keyword is ignored in the Export File, we need
5398f395c03eSmrg	# it in the Import File for the 'aix-soname' feature, so we have
5399f395c03eSmrg	# to replace the "-B" option with "-P" for AIX nm.
54007b58d2e0Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5401f395c03eSmrg	  _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'
54027b58d2e0Smrg	else
5403f395c03eSmrg	  _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'
54047b58d2e0Smrg	fi
54057b58d2e0Smrg	aix_use_runtimelinking=no
54062ec8c4b4Smrg
54077b58d2e0Smrg	# Test if we are trying to use run time linking or normal
54087b58d2e0Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
5409f395c03eSmrg	# have runtime linking enabled, and use it for executables.
5410f395c03eSmrg	# For shared libraries, we enable/disable runtime linking
5411f395c03eSmrg	# depending on the kind of the shared library created -
5412f395c03eSmrg	# when "with_aix_soname,aix_use_runtimelinking" is:
5413f395c03eSmrg	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
5414f395c03eSmrg	# "aix,yes"  lib.so          shared, rtl:yes, for executables
5415f395c03eSmrg	#            lib.a           static archive
5416f395c03eSmrg	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
5417f395c03eSmrg	#            lib.a(lib.so.V) shared, rtl:no,  for executables
5418f395c03eSmrg	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
5419f395c03eSmrg	#            lib.a(lib.so.V) shared, rtl:no
5420f395c03eSmrg	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
5421f395c03eSmrg	#            lib.a           static archive
54227b58d2e0Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
54237b58d2e0Smrg	  for ld_flag in $LDFLAGS; do
5424f395c03eSmrg	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
54257b58d2e0Smrg	    aix_use_runtimelinking=yes
54267b58d2e0Smrg	    break
54277b58d2e0Smrg	  fi
54287b58d2e0Smrg	  done
5429f395c03eSmrg	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
5430f395c03eSmrg	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
5431f395c03eSmrg	    # so we don't have lib.a shared libs to link our executables.
5432f395c03eSmrg	    # We have to force runtime linking in this case.
5433f395c03eSmrg	    aix_use_runtimelinking=yes
5434f395c03eSmrg	    LDFLAGS="$LDFLAGS -Wl,-brtl"
5435f395c03eSmrg	  fi
54367b58d2e0Smrg	  ;;
54377b58d2e0Smrg	esac
543809885543Smrg
54397b58d2e0Smrg	exp_sym_flag='-bexport'
54407b58d2e0Smrg	no_entry_flag='-bnoentry'
5441b698ba48Smrg      fi
54422ec8c4b4Smrg
54437b58d2e0Smrg      # When large executables or shared objects are built, AIX ld can
54447b58d2e0Smrg      # have problems creating the table of contents.  If linking a library
54457b58d2e0Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
54467b58d2e0Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
54477b58d2e0Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
54482ec8c4b4Smrg
54497b58d2e0Smrg      _LT_TAGVAR(archive_cmds, $1)=''
54507b58d2e0Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
54517b58d2e0Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
54527b58d2e0Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
54537b58d2e0Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5454f395c03eSmrg      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
5455f395c03eSmrg      case $with_aix_soname,$aix_use_runtimelinking in
5456f395c03eSmrg      aix,*) ;; # traditional, no import file
5457f395c03eSmrg      svr4,* | *,yes) # use import file
5458f395c03eSmrg	# The Import File defines what to hardcode.
5459f395c03eSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
5460f395c03eSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5461f395c03eSmrg	;;
5462f395c03eSmrg      esac
54632ec8c4b4Smrg
5464f395c03eSmrg      if test yes = "$GCC"; then
54657b58d2e0Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
54667b58d2e0Smrg	# We only want to do this on AIX 4.2 and lower, the check
54677b58d2e0Smrg	# below for broken collect2 doesn't work under 4.3+
5468f395c03eSmrg	  collect2name=`$CC -print-prog-name=collect2`
54697b58d2e0Smrg	  if test -f "$collect2name" &&
54707b58d2e0Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
54717b58d2e0Smrg	  then
54727b58d2e0Smrg	  # We have reworked collect2
54737b58d2e0Smrg	  :
54747b58d2e0Smrg	  else
54757b58d2e0Smrg	  # We have old collect2
54767b58d2e0Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
54777b58d2e0Smrg	  # It fails to find uninstalled libraries when the uninstalled
54787b58d2e0Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
54797b58d2e0Smrg	  # to unsupported forces relinking
54807b58d2e0Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
54817b58d2e0Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
54827b58d2e0Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5483b698ba48Smrg	  fi
54847b58d2e0Smrg	  ;;
54857b58d2e0Smrg	esac
54867b58d2e0Smrg	shared_flag='-shared'
5487f395c03eSmrg	if test yes = "$aix_use_runtimelinking"; then
5488f395c03eSmrg	  shared_flag="$shared_flag "'$wl-G'
54892ec8c4b4Smrg	fi
5490f395c03eSmrg	# Need to ensure runtime linking is disabled for the traditional
5491f395c03eSmrg	# shared library, or the linker may eventually find shared libraries
5492f395c03eSmrg	# /with/ Import File - we do not want to mix them.
5493f395c03eSmrg	shared_flag_aix='-shared'
5494f395c03eSmrg	shared_flag_svr4='-shared $wl-G'
5495b698ba48Smrg      else
54967b58d2e0Smrg	# not using gcc
5497f395c03eSmrg	if test ia64 = "$host_cpu"; then
54987b58d2e0Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
54997b58d2e0Smrg	# chokes on -Wl,-G. The following line is correct:
55007b58d2e0Smrg	  shared_flag='-G'
55017b58d2e0Smrg	else
5502f395c03eSmrg	  if test yes = "$aix_use_runtimelinking"; then
5503f395c03eSmrg	    shared_flag='$wl-G'
55047b58d2e0Smrg	  else
5505f395c03eSmrg	    shared_flag='$wl-bM:SRE'
55067b58d2e0Smrg	  fi
5507f395c03eSmrg	  shared_flag_aix='$wl-bM:SRE'
5508f395c03eSmrg	  shared_flag_svr4='$wl-G'
55097b58d2e0Smrg	fi
5510b698ba48Smrg      fi
551109885543Smrg
5512f395c03eSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
55137b58d2e0Smrg      # It seems that -bexpall does not export symbols beginning with
55147b58d2e0Smrg      # underscore (_), so it is better to generate a list of symbols to export.
55157b58d2e0Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
5516f395c03eSmrg      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
55177b58d2e0Smrg	# Warning - without using the other runtime loading flags (-brtl),
55187b58d2e0Smrg	# -berok will link without error, but may produce a broken library.
55197b58d2e0Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
55207b58d2e0Smrg        # Determine the default libpath from the value encoded in an
55217b58d2e0Smrg        # empty executable.
5522b12e5c03Smrg        _LT_SYS_MODULE_PATH_AIX([$1])
5523f395c03eSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5524f395c03eSmrg        _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
55257b58d2e0Smrg      else
5526f395c03eSmrg	if test ia64 = "$host_cpu"; then
5527f395c03eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
55287b58d2e0Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5529f395c03eSmrg	  _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"
55307b58d2e0Smrg	else
55317b58d2e0Smrg	 # Determine the default libpath from the value encoded in an
55327b58d2e0Smrg	 # empty executable.
5533b12e5c03Smrg	 _LT_SYS_MODULE_PATH_AIX([$1])
5534f395c03eSmrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
55357b58d2e0Smrg	  # Warning - without using the other run time loading flags,
55367b58d2e0Smrg	  # -berok will link without error, but may produce a broken library.
5537f395c03eSmrg	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
5538f395c03eSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
5539f395c03eSmrg	  if test yes = "$with_gnu_ld"; then
5540b12e5c03Smrg	    # We only use this code for GNU lds that support --whole-archive.
5541f395c03eSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
5542b12e5c03Smrg	  else
5543b12e5c03Smrg	    # Exported symbols can be pulled into shared objects from archives
5544b12e5c03Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5545b12e5c03Smrg	  fi
55467b58d2e0Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5547f395c03eSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
5548f395c03eSmrg	  # -brtl affects multiple linker settings, -berok does not and is overridden later
5549f395c03eSmrg	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
5550f395c03eSmrg	  if test svr4 != "$with_aix_soname"; then
5551f395c03eSmrg	    # This is similar to how AIX traditionally builds its shared libraries.
5552f395c03eSmrg	    _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'
5553f395c03eSmrg	  fi
5554f395c03eSmrg	  if test aix != "$with_aix_soname"; then
5555f395c03eSmrg	    _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'
5556f395c03eSmrg	  else
5557f395c03eSmrg	    # used by -dlpreopen to get the symbols
5558f395c03eSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
5559f395c03eSmrg	  fi
5560f395c03eSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
55617b58d2e0Smrg	fi
5562b698ba48Smrg      fi
5563b698ba48Smrg      ;;
5564e4f6584cSmrg
5565b698ba48Smrg    amigaos*)
5566e4f6584cSmrg      case $host_cpu in
5567e4f6584cSmrg      powerpc)
5568e4f6584cSmrg            # see comment about AmigaOS4 .so support
5569f395c03eSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
55707b58d2e0Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5571e4f6584cSmrg        ;;
5572e4f6584cSmrg      m68k)
55737b58d2e0Smrg            _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)'
55747b58d2e0Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
55757b58d2e0Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5576e4f6584cSmrg        ;;
5577e4f6584cSmrg      esac
5578b698ba48Smrg      ;;
5579e4f6584cSmrg
55807b58d2e0Smrg    bsdi[[45]]*)
55817b58d2e0Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
5582b698ba48Smrg      ;;
55837b58d2e0Smrg
55847b58d2e0Smrg    cygwin* | mingw* | pw32* | cegcc*)
55857b58d2e0Smrg      # When not using gcc, we currently assume that we are using
55867b58d2e0Smrg      # Microsoft Visual C++.
55877b58d2e0Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
55887b58d2e0Smrg      # no search path for DLLs.
5589b12e5c03Smrg      case $cc_basename in
5590b12e5c03Smrg      cl*)
5591b12e5c03Smrg	# Native MSVC
5592b12e5c03Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5593b12e5c03Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5594b12e5c03Smrg	_LT_TAGVAR(always_export_symbols, $1)=yes
5595b12e5c03Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
5596b12e5c03Smrg	# Tell ltmain to make .lib files, not .a files.
5597b12e5c03Smrg	libext=lib
5598b12e5c03Smrg	# Tell ltmain to make .dll files, not .so files.
5599f395c03eSmrg	shrext_cmds=.dll
5600b12e5c03Smrg	# FIXME: Setting linknames here is a bad hack.
5601f395c03eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
5602f395c03eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5603f395c03eSmrg            cp "$export_symbols" "$output_objdir/$soname.def";
5604f395c03eSmrg            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
5605f395c03eSmrg          else
5606f395c03eSmrg            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
5607f395c03eSmrg          fi~
5608f395c03eSmrg          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5609f395c03eSmrg          linknames='
5610b12e5c03Smrg	# The linker will not automatically build a static lib if we build a DLL.
5611b12e5c03Smrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5612b12e5c03Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5613b12e5c03Smrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5614b12e5c03Smrg	_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'
5615b12e5c03Smrg	# Don't use ranlib
5616b12e5c03Smrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
5617b12e5c03Smrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
5618f395c03eSmrg          lt_tool_outputfile="@TOOL_OUTPUT@"~
5619f395c03eSmrg          case $lt_outputfile in
5620f395c03eSmrg            *.exe|*.EXE) ;;
5621f395c03eSmrg            *)
5622f395c03eSmrg              lt_outputfile=$lt_outputfile.exe
5623f395c03eSmrg              lt_tool_outputfile=$lt_tool_outputfile.exe
5624f395c03eSmrg              ;;
5625f395c03eSmrg          esac~
5626f395c03eSmrg          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
5627f395c03eSmrg            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5628f395c03eSmrg            $RM "$lt_outputfile.manifest";
5629f395c03eSmrg          fi'
5630b12e5c03Smrg	;;
5631b12e5c03Smrg      *)
5632b12e5c03Smrg	# Assume MSVC wrapper
5633b12e5c03Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5634b12e5c03Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5635b12e5c03Smrg	# Tell ltmain to make .lib files, not .a files.
5636b12e5c03Smrg	libext=lib
5637b12e5c03Smrg	# Tell ltmain to make .dll files, not .so files.
5638f395c03eSmrg	shrext_cmds=.dll
5639b12e5c03Smrg	# FIXME: Setting linknames here is a bad hack.
5640b12e5c03Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
5641b12e5c03Smrg	# The linker will automatically build a .lib file if we build a DLL.
5642b12e5c03Smrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5643b12e5c03Smrg	# FIXME: Should let the user specify the lib program.
5644b12e5c03Smrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
5645b12e5c03Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5646b12e5c03Smrg	;;
5647b12e5c03Smrg      esac
5648b698ba48Smrg      ;;
56497b58d2e0Smrg
5650b698ba48Smrg    darwin* | rhapsody*)
56517b58d2e0Smrg      _LT_DARWIN_LINKER_FEATURES($1)
5652b698ba48Smrg      ;;
56537b58d2e0Smrg
56547b58d2e0Smrg    dgux*)
56557b58d2e0Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
56567b58d2e0Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
56577b58d2e0Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5658b698ba48Smrg      ;;
56597b58d2e0Smrg
56607b58d2e0Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
56617b58d2e0Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
56627b58d2e0Smrg    # does not break anything, and helps significantly (at the cost of a little
56637b58d2e0Smrg    # extra space).
56647b58d2e0Smrg    freebsd2.2*)
56657b58d2e0Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
56667b58d2e0Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
56677b58d2e0Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
56687b58d2e0Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5669b698ba48Smrg      ;;
56707b58d2e0Smrg
56717b58d2e0Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5672b12e5c03Smrg    freebsd2.*)
56737b58d2e0Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
56747b58d2e0Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
56757b58d2e0Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
56767b58d2e0Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5677e4f6584cSmrg      ;;
56787b58d2e0Smrg
56797b58d2e0Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
56807b58d2e0Smrg    freebsd* | dragonfly*)
5681b12e5c03Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
56827b58d2e0Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
56837b58d2e0Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
56847b58d2e0Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5685b698ba48Smrg      ;;
56867b58d2e0Smrg
56877b58d2e0Smrg    hpux9*)
5688f395c03eSmrg      if test yes = "$GCC"; then
5689f395c03eSmrg	_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'
56907b58d2e0Smrg      else
5691f395c03eSmrg	_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'
56927b58d2e0Smrg      fi
5693f395c03eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
56947b58d2e0Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
56957b58d2e0Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
56967b58d2e0Smrg
56977b58d2e0Smrg      # hardcode_minus_L: Not really in the search PATH,
56987b58d2e0Smrg      # but as the default location of the library.
56997b58d2e0Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5700f395c03eSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
57017b58d2e0Smrg      ;;
57027b58d2e0Smrg
57037b58d2e0Smrg    hpux10*)
5704f395c03eSmrg      if test yes,no = "$GCC,$with_gnu_ld"; then
5705f395c03eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
57067b58d2e0Smrg      else
57077b58d2e0Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
57087b58d2e0Smrg      fi
5709f395c03eSmrg      if test no = "$with_gnu_ld"; then
5710f395c03eSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
57117b58d2e0Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
57127b58d2e0Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
57137b58d2e0Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5714f395c03eSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
57157b58d2e0Smrg	# hardcode_minus_L: Not really in the search PATH,
57167b58d2e0Smrg	# but as the default location of the library.
57177b58d2e0Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
57187b58d2e0Smrg      fi
57197b58d2e0Smrg      ;;
57207b58d2e0Smrg
57217b58d2e0Smrg    hpux11*)
5722f395c03eSmrg      if test yes,no = "$GCC,$with_gnu_ld"; then
57237b58d2e0Smrg	case $host_cpu in
57247b58d2e0Smrg	hppa*64*)
5725f395c03eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
57267b58d2e0Smrg	  ;;
57277b58d2e0Smrg	ia64*)
5728f395c03eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
57297b58d2e0Smrg	  ;;
57307b58d2e0Smrg	*)
5731f395c03eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5732b698ba48Smrg	  ;;
5733b698ba48Smrg	esac
57347b58d2e0Smrg      else
57357b58d2e0Smrg	case $host_cpu in
57367b58d2e0Smrg	hppa*64*)
5737f395c03eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
57387b58d2e0Smrg	  ;;
57397b58d2e0Smrg	ia64*)
5740f395c03eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
57417b58d2e0Smrg	  ;;
57427b58d2e0Smrg	*)
5743b12e5c03Smrg	m4_if($1, [], [
5744b12e5c03Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
5745b12e5c03Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
5746b12e5c03Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
5747b12e5c03Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
5748f395c03eSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
5749b12e5c03Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
5750f395c03eSmrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
57517b58d2e0Smrg	  ;;
5752b698ba48Smrg	esac
57537b58d2e0Smrg      fi
5754f395c03eSmrg      if test no = "$with_gnu_ld"; then
5755f395c03eSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
57567b58d2e0Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
57577b58d2e0Smrg
57587b58d2e0Smrg	case $host_cpu in
57597b58d2e0Smrg	hppa*64*|ia64*)
57607b58d2e0Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
57617b58d2e0Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
57627b58d2e0Smrg	  ;;
57637b58d2e0Smrg	*)
57647b58d2e0Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
57657b58d2e0Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5766f395c03eSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
57677b58d2e0Smrg
57687b58d2e0Smrg	  # hardcode_minus_L: Not really in the search PATH,
57697b58d2e0Smrg	  # but as the default location of the library.
57707b58d2e0Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
57717b58d2e0Smrg	  ;;
5772b698ba48Smrg	esac
57737b58d2e0Smrg      fi
57747b58d2e0Smrg      ;;
57757b58d2e0Smrg
57767b58d2e0Smrg    irix5* | irix6* | nonstopux*)
5777f395c03eSmrg      if test yes = "$GCC"; then
5778f395c03eSmrg	_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'
57797b58d2e0Smrg	# Try to use the -exported_symbol ld option, if it does not
57807b58d2e0Smrg	# work, assume that -exports_file does not work either and
57817b58d2e0Smrg	# implicitly export all symbols.
5782b12e5c03Smrg	# This should be the same for all languages, so no per-tag cache variable.
5783b12e5c03Smrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
5784b12e5c03Smrg	  [lt_cv_irix_exported_symbol],
5785f395c03eSmrg	  [save_LDFLAGS=$LDFLAGS
5786f395c03eSmrg	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
5787b12e5c03Smrg	   AC_LINK_IFELSE(
5788b12e5c03Smrg	     [AC_LANG_SOURCE(
5789b12e5c03Smrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
5790b12e5c03Smrg			      [C++], [[int foo (void) { return 0; }]],
5791b12e5c03Smrg			      [Fortran 77], [[
5792b12e5c03Smrg      subroutine foo
5793b12e5c03Smrg      end]],
5794b12e5c03Smrg			      [Fortran], [[
5795b12e5c03Smrg      subroutine foo
5796b12e5c03Smrg      end]])])],
5797b12e5c03Smrg	      [lt_cv_irix_exported_symbol=yes],
5798b12e5c03Smrg	      [lt_cv_irix_exported_symbol=no])
5799f395c03eSmrg           LDFLAGS=$save_LDFLAGS])
5800f395c03eSmrg	if test yes = "$lt_cv_irix_exported_symbol"; then
5801f395c03eSmrg          _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'
5802b12e5c03Smrg	fi
58037b58d2e0Smrg      else
5804f395c03eSmrg	_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'
5805f395c03eSmrg	_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'
58067b58d2e0Smrg      fi
58077b58d2e0Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5808f395c03eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
58097b58d2e0Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
58107b58d2e0Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
58117b58d2e0Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
58127b58d2e0Smrg      ;;
58137b58d2e0Smrg
5814f395c03eSmrg    linux*)
5815f395c03eSmrg      case $cc_basename in
5816f395c03eSmrg      tcc*)
5817f395c03eSmrg	# Fabrice Bellard et al's Tiny C Compiler
5818f395c03eSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
5819f395c03eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5820f395c03eSmrg	;;
5821f395c03eSmrg      esac
5822f395c03eSmrg      ;;
5823f395c03eSmrg
5824f395c03eSmrg    netbsd*)
58257b58d2e0Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
58267b58d2e0Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
58277b58d2e0Smrg      else
58287b58d2e0Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
58297b58d2e0Smrg      fi
58307b58d2e0Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
58317b58d2e0Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
58327b58d2e0Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
58337b58d2e0Smrg      ;;
58347b58d2e0Smrg
58357b58d2e0Smrg    newsos6)
58367b58d2e0Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
58377b58d2e0Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5838f395c03eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
58397b58d2e0Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
58407b58d2e0Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
58417b58d2e0Smrg      ;;
58427b58d2e0Smrg
58437b58d2e0Smrg    *nto* | *qnx*)
58447b58d2e0Smrg      ;;
58457b58d2e0Smrg
5846f395c03eSmrg    openbsd* | bitrig*)
58477b58d2e0Smrg      if test -f /usr/libexec/ld.so; then
58487b58d2e0Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
58497b58d2e0Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
58507b58d2e0Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5851f395c03eSmrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
58527b58d2e0Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5853f395c03eSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
5854f395c03eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5855f395c03eSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
58567b58d2e0Smrg	else
5857f395c03eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5858f395c03eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
58597b58d2e0Smrg	fi
58607b58d2e0Smrg      else
58617b58d2e0Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
58627b58d2e0Smrg      fi
58637b58d2e0Smrg      ;;
58647b58d2e0Smrg
58657b58d2e0Smrg    os2*)
58667b58d2e0Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
58677b58d2e0Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
58687b58d2e0Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5869f395c03eSmrg      shrext_cmds=.dll
5870f395c03eSmrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5871f395c03eSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5872f395c03eSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5873f395c03eSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5874f395c03eSmrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5875f395c03eSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5876f395c03eSmrg	emximp -o $lib $output_objdir/$libname.def'
5877f395c03eSmrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5878f395c03eSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5879f395c03eSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5880f395c03eSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5881f395c03eSmrg	prefix_cmds="$SED"~
5882f395c03eSmrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
5883f395c03eSmrg	  prefix_cmds="$prefix_cmds -e 1d";
5884f395c03eSmrg	fi~
5885f395c03eSmrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5886f395c03eSmrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5887f395c03eSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5888f395c03eSmrg	emximp -o $lib $output_objdir/$libname.def'
5889f395c03eSmrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5890f395c03eSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
58917b58d2e0Smrg      ;;
58927b58d2e0Smrg
58937b58d2e0Smrg    osf3*)
5894f395c03eSmrg      if test yes = "$GCC"; then
5895f395c03eSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5896f395c03eSmrg	_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'
58977b58d2e0Smrg      else
58987b58d2e0Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5899f395c03eSmrg	_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'
59007b58d2e0Smrg      fi
59017b58d2e0Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5902f395c03eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
59037b58d2e0Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
59047b58d2e0Smrg      ;;
59057b58d2e0Smrg
59067b58d2e0Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
5907f395c03eSmrg      if test yes = "$GCC"; then
5908f395c03eSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5909f395c03eSmrg	_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'
5910f395c03eSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
59117b58d2e0Smrg      else
59127b58d2e0Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5913f395c03eSmrg	_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'
59147b58d2e0Smrg	_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~
5915f395c03eSmrg          $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'
59167b58d2e0Smrg
59177b58d2e0Smrg	# Both c and cxx compiler support -rpath directly
59187b58d2e0Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
59197b58d2e0Smrg      fi
59207b58d2e0Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
59217b58d2e0Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
59227b58d2e0Smrg      ;;
59237b58d2e0Smrg
59247b58d2e0Smrg    solaris*)
59257b58d2e0Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
5926f395c03eSmrg      if test yes = "$GCC"; then
5927f395c03eSmrg	wlarc='$wl'
5928f395c03eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
59297b58d2e0Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5930f395c03eSmrg          $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'
59317b58d2e0Smrg      else
59327b58d2e0Smrg	case `$CC -V 2>&1` in
59337b58d2e0Smrg	*"Compilers 5.0"*)
59347b58d2e0Smrg	  wlarc=''
5935f395c03eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
59367b58d2e0Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5937f395c03eSmrg            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
59387b58d2e0Smrg	  ;;
59397b58d2e0Smrg	*)
5940f395c03eSmrg	  wlarc='$wl'
5941f395c03eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
59427b58d2e0Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5943f395c03eSmrg            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
59447b58d2e0Smrg	  ;;
5945b698ba48Smrg	esac
59467b58d2e0Smrg      fi
59477b58d2e0Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
59487b58d2e0Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
59497b58d2e0Smrg      case $host_os in
59507b58d2e0Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
59517b58d2e0Smrg      *)
59527b58d2e0Smrg	# The compiler driver will combine and reorder linker options,
5953f395c03eSmrg	# but understands '-z linker_flag'.  GCC discards it without '$wl',
59547b58d2e0Smrg	# but is careful enough not to reorder.
59557b58d2e0Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
5956f395c03eSmrg	if test yes = "$GCC"; then
5957f395c03eSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
59587b58d2e0Smrg	else
59597b58d2e0Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
59607b58d2e0Smrg	fi
5961b698ba48Smrg	;;
59627b58d2e0Smrg      esac
59637b58d2e0Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
59647b58d2e0Smrg      ;;
59657b58d2e0Smrg
59667b58d2e0Smrg    sunos4*)
5967f395c03eSmrg      if test sequent = "$host_vendor"; then
59687b58d2e0Smrg	# Use $CC to link under sequent, because it throws in some extra .o
59697b58d2e0Smrg	# files that make .init and .fini sections work.
5970f395c03eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
59717b58d2e0Smrg      else
59727b58d2e0Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
59737b58d2e0Smrg      fi
59747b58d2e0Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
59757b58d2e0Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
59767b58d2e0Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
59777b58d2e0Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
59787b58d2e0Smrg      ;;
59797b58d2e0Smrg
59807b58d2e0Smrg    sysv4)
59817b58d2e0Smrg      case $host_vendor in
59827b58d2e0Smrg	sni)
59837b58d2e0Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
59847b58d2e0Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5985b698ba48Smrg	;;
59867b58d2e0Smrg	siemens)
59877b58d2e0Smrg	  ## LD is ld it makes a PLAMLIB
59887b58d2e0Smrg	  ## CC just makes a GrossModule.
59897b58d2e0Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
59907b58d2e0Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
59917b58d2e0Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
59927b58d2e0Smrg        ;;
59937b58d2e0Smrg	motorola)
59947b58d2e0Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
59957b58d2e0Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
5996b698ba48Smrg	;;
59977b58d2e0Smrg      esac
59987b58d2e0Smrg      runpath_var='LD_RUN_PATH'
59997b58d2e0Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60007b58d2e0Smrg      ;;
60017b58d2e0Smrg
60027b58d2e0Smrg    sysv4.3*)
60037b58d2e0Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
60047b58d2e0Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60057b58d2e0Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
60067b58d2e0Smrg      ;;
60077b58d2e0Smrg
60087b58d2e0Smrg    sysv4*MP*)
60097b58d2e0Smrg      if test -d /usr/nec; then
60107b58d2e0Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
60117b58d2e0Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60127b58d2e0Smrg	runpath_var=LD_RUN_PATH
60137b58d2e0Smrg	hardcode_runpath_var=yes
60147b58d2e0Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
60157b58d2e0Smrg      fi
60167b58d2e0Smrg      ;;
60177b58d2e0Smrg
60187b58d2e0Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6019f395c03eSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
60207b58d2e0Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
60217b58d2e0Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60227b58d2e0Smrg      runpath_var='LD_RUN_PATH'
60237b58d2e0Smrg
6024f395c03eSmrg      if test yes = "$GCC"; then
6025f395c03eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6026f395c03eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60277b58d2e0Smrg      else
6028f395c03eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6029f395c03eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60307b58d2e0Smrg      fi
60317b58d2e0Smrg      ;;
60327b58d2e0Smrg
60337b58d2e0Smrg    sysv5* | sco3.2v5* | sco5v6*)
6034f395c03eSmrg      # Note: We CANNOT use -z defs as we might desire, because we do not
60357b58d2e0Smrg      # link with -lc, and that would cause any symbols used from libc to
60367b58d2e0Smrg      # always be unresolved, which means just about no library would
60377b58d2e0Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
60387b58d2e0Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
60397b58d2e0Smrg      # as -z defs.
6040f395c03eSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
6041f395c03eSmrg      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
60427b58d2e0Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
60437b58d2e0Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6044f395c03eSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
60457b58d2e0Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
60467b58d2e0Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
6047f395c03eSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
60487b58d2e0Smrg      runpath_var='LD_RUN_PATH'
60497b58d2e0Smrg
6050f395c03eSmrg      if test yes = "$GCC"; then
6051f395c03eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6052f395c03eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60537b58d2e0Smrg      else
6054f395c03eSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6055f395c03eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60567b58d2e0Smrg      fi
60577b58d2e0Smrg      ;;
60587b58d2e0Smrg
60597b58d2e0Smrg    uts4*)
60607b58d2e0Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
60617b58d2e0Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
60627b58d2e0Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60637b58d2e0Smrg      ;;
60647b58d2e0Smrg
60657b58d2e0Smrg    *)
60667b58d2e0Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
60677b58d2e0Smrg      ;;
60687b58d2e0Smrg    esac
60697b58d2e0Smrg
6070f395c03eSmrg    if test sni = "$host_vendor"; then
60717b58d2e0Smrg      case $host in
60727b58d2e0Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6073f395c03eSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
60747b58d2e0Smrg	;;
60757b58d2e0Smrg      esac
60767b58d2e0Smrg    fi
60777b58d2e0Smrg  fi
60787b58d2e0Smrg])
60797b58d2e0SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6080f395c03eSmrgtest no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
60817b58d2e0Smrg
60827b58d2e0Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
60837b58d2e0Smrg
60847b58d2e0Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
60857b58d2e0Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
60867b58d2e0Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
60877b58d2e0Smrg    [The commands to extract the exported symbol list from a shared archive])
60887b58d2e0Smrg
60897b58d2e0Smrg#
60907b58d2e0Smrg# Do we need to explicitly link libc?
60917b58d2e0Smrg#
60927b58d2e0Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
60937b58d2e0Smrgx|xyes)
60947b58d2e0Smrg  # Assume -lc should be added
60957b58d2e0Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
60967b58d2e0Smrg
6097f395c03eSmrg  if test yes,yes = "$GCC,$enable_shared"; then
60987b58d2e0Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
60997b58d2e0Smrg    *'~'*)
61007b58d2e0Smrg      # FIXME: we may have to deal with multi-command sequences.
61017b58d2e0Smrg      ;;
61027b58d2e0Smrg    '$CC '*)
61037b58d2e0Smrg      # Test whether the compiler implicitly links with -lc since on some
61047b58d2e0Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
61057b58d2e0Smrg      # to ld, don't add -lc before -lgcc.
6106b12e5c03Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
6107b12e5c03Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
6108b12e5c03Smrg	[$RM conftest*
6109b12e5c03Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6110b12e5c03Smrg
6111b12e5c03Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6112b12e5c03Smrg	  soname=conftest
6113b12e5c03Smrg	  lib=conftest
6114b12e5c03Smrg	  libobjs=conftest.$ac_objext
6115b12e5c03Smrg	  deplibs=
6116b12e5c03Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
6117b12e5c03Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
6118b12e5c03Smrg	  compiler_flags=-v
6119b12e5c03Smrg	  linker_flags=-v
6120b12e5c03Smrg	  verstring=
6121b12e5c03Smrg	  output_objdir=.
6122b12e5c03Smrg	  libname=conftest
6123b12e5c03Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
6124b12e5c03Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
6125b12e5c03Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
6126b12e5c03Smrg	  then
6127b12e5c03Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6128b12e5c03Smrg	  else
6129b12e5c03Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6130b12e5c03Smrg	  fi
6131b12e5c03Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6132b12e5c03Smrg	else
6133b12e5c03Smrg	  cat conftest.err 1>&5
6134b12e5c03Smrg	fi
6135b12e5c03Smrg	$RM conftest*
6136b12e5c03Smrg	])
6137b12e5c03Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
61387b58d2e0Smrg      ;;
61397b58d2e0Smrg    esac
61407b58d2e0Smrg  fi
61417b58d2e0Smrg  ;;
61427b58d2e0Smrgesac
61437b58d2e0Smrg
61447b58d2e0Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
61457b58d2e0Smrg    [Whether or not to add -lc for building shared libraries])
61467b58d2e0Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
61477b58d2e0Smrg    [enable_shared_with_static_runtimes], [0],
61487b58d2e0Smrg    [Whether or not to disallow shared libs when runtime libs are static])
61497b58d2e0Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
61507b58d2e0Smrg    [Compiler flag to allow reflexive dlopens])
61517b58d2e0Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
61527b58d2e0Smrg    [Compiler flag to generate shared objects directly from archives])
61537b58d2e0Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
61547b58d2e0Smrg    [Whether the compiler copes with passing no objects directly])
61557b58d2e0Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
61567b58d2e0Smrg    [Create an old-style archive from a shared archive])
61577b58d2e0Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
61587b58d2e0Smrg    [Create a temporary old-style archive to link instead of a shared archive])
61597b58d2e0Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
61607b58d2e0Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
61617b58d2e0Smrg_LT_TAGDECL([], [module_cmds], [2],
61627b58d2e0Smrg    [Commands used to build a loadable module if different from building
61637b58d2e0Smrg    a shared archive.])
61647b58d2e0Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
61657b58d2e0Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
61667b58d2e0Smrg    [Whether we are building with GNU ld or not])
61677b58d2e0Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
61687b58d2e0Smrg    [Flag that allows shared libraries with undefined symbols to be built])
61697b58d2e0Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
61707b58d2e0Smrg    [Flag that enforces no undefined symbols])
61717b58d2e0Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
61727b58d2e0Smrg    [Flag to hardcode $libdir into a binary during linking.
61737b58d2e0Smrg    This must work even if $libdir does not exist])
61747b58d2e0Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
61757b58d2e0Smrg    [Whether we need a single "-rpath" flag with a separated argument])
61767b58d2e0Smrg_LT_TAGDECL([], [hardcode_direct], [0],
6177f395c03eSmrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
61787b58d2e0Smrg    DIR into the resulting binary])
61797b58d2e0Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
6180f395c03eSmrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
61817b58d2e0Smrg    DIR into the resulting binary and the resulting library dependency is
6182f395c03eSmrg    "absolute", i.e impossible to change by setting $shlibpath_var if the
61837b58d2e0Smrg    library is relocated])
61847b58d2e0Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
61857b58d2e0Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
61867b58d2e0Smrg    into the resulting binary])
61877b58d2e0Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
61887b58d2e0Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
61897b58d2e0Smrg    into the resulting binary])
61907b58d2e0Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
61917b58d2e0Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
61927b58d2e0Smrg    into the library and all subsequent libraries and executables linked
61937b58d2e0Smrg    against it])
61947b58d2e0Smrg_LT_TAGDECL([], [inherit_rpath], [0],
61957b58d2e0Smrg    [Set to yes if linker adds runtime paths of dependent libraries
61967b58d2e0Smrg    to runtime path list])
61977b58d2e0Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
61987b58d2e0Smrg    [Whether libtool must link a program against all its dependency libraries])
61997b58d2e0Smrg_LT_TAGDECL([], [always_export_symbols], [0],
62007b58d2e0Smrg    [Set to "yes" if exported symbols are required])
62017b58d2e0Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
62027b58d2e0Smrg    [The commands to list exported symbols])
62037b58d2e0Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
62047b58d2e0Smrg    [Symbols that should not be listed in the preloaded symbols])
62057b58d2e0Smrg_LT_TAGDECL([], [include_expsyms], [1],
62067b58d2e0Smrg    [Symbols that must always be exported])
62077b58d2e0Smrg_LT_TAGDECL([], [prelink_cmds], [2],
62087b58d2e0Smrg    [Commands necessary for linking programs (against libraries) with templates])
6209b12e5c03Smrg_LT_TAGDECL([], [postlink_cmds], [2],
6210b12e5c03Smrg    [Commands necessary for finishing linking programs])
62117b58d2e0Smrg_LT_TAGDECL([], [file_list_spec], [1],
62127b58d2e0Smrg    [Specify filename containing input files])
62137b58d2e0Smrgdnl FIXME: Not yet implemented
62147b58d2e0Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
62157b58d2e0Smrgdnl    [Compiler flag to generate thread safe objects])
62167b58d2e0Smrg])# _LT_LINKER_SHLIBS
62177b58d2e0Smrg
62187b58d2e0Smrg
62197b58d2e0Smrg# _LT_LANG_C_CONFIG([TAG])
62207b58d2e0Smrg# ------------------------
62217b58d2e0Smrg# Ensure that the configuration variables for a C compiler are suitably
62227b58d2e0Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
6223f395c03eSmrg# the compiler configuration to 'libtool'.
62247b58d2e0Smrgm4_defun([_LT_LANG_C_CONFIG],
62257b58d2e0Smrg[m4_require([_LT_DECL_EGREP])dnl
6226f395c03eSmrglt_save_CC=$CC
62277b58d2e0SmrgAC_LANG_PUSH(C)
62287b58d2e0Smrg
62297b58d2e0Smrg# Source file extension for C test sources.
62307b58d2e0Smrgac_ext=c
62317b58d2e0Smrg
62327b58d2e0Smrg# Object file extension for compiled C test sources.
62337b58d2e0Smrgobjext=o
62347b58d2e0Smrg_LT_TAGVAR(objext, $1)=$objext
62357b58d2e0Smrg
62367b58d2e0Smrg# Code to be used in simple compile tests
62377b58d2e0Smrglt_simple_compile_test_code="int some_variable = 0;"
62387b58d2e0Smrg
62397b58d2e0Smrg# Code to be used in simple link tests
62407b58d2e0Smrglt_simple_link_test_code='int main(){return(0);}'
62417b58d2e0Smrg
62427b58d2e0Smrg_LT_TAG_COMPILER
62437b58d2e0Smrg# Save the default compiler, since it gets overwritten when the other
62447b58d2e0Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
62457b58d2e0Smrgcompiler_DEFAULT=$CC
62467b58d2e0Smrg
62477b58d2e0Smrg# save warnings/boilerplate of simple test code
62487b58d2e0Smrg_LT_COMPILER_BOILERPLATE
62497b58d2e0Smrg_LT_LINKER_BOILERPLATE
62507b58d2e0Smrg
62517b58d2e0Smrgif test -n "$compiler"; then
62527b58d2e0Smrg  _LT_COMPILER_NO_RTTI($1)
62537b58d2e0Smrg  _LT_COMPILER_PIC($1)
62547b58d2e0Smrg  _LT_COMPILER_C_O($1)
62557b58d2e0Smrg  _LT_COMPILER_FILE_LOCKS($1)
62567b58d2e0Smrg  _LT_LINKER_SHLIBS($1)
62577b58d2e0Smrg  _LT_SYS_DYNAMIC_LINKER($1)
62587b58d2e0Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
62597b58d2e0Smrg  LT_SYS_DLOPEN_SELF
62607b58d2e0Smrg  _LT_CMD_STRIPLIB
62617b58d2e0Smrg
6262f395c03eSmrg  # Report what library types will actually be built
62637b58d2e0Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
62647b58d2e0Smrg  AC_MSG_RESULT([$can_build_shared])
62657b58d2e0Smrg
62667b58d2e0Smrg  AC_MSG_CHECKING([whether to build shared libraries])
6267f395c03eSmrg  test no = "$can_build_shared" && enable_shared=no
62687b58d2e0Smrg
62697b58d2e0Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
62707b58d2e0Smrg  # are all built from PIC.
62717b58d2e0Smrg  case $host_os in
62727b58d2e0Smrg  aix3*)
6273f395c03eSmrg    test yes = "$enable_shared" && enable_static=no
62747b58d2e0Smrg    if test -n "$RANLIB"; then
62757b58d2e0Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
62767b58d2e0Smrg      postinstall_cmds='$RANLIB $lib'
62777b58d2e0Smrg    fi
62787b58d2e0Smrg    ;;
62797b58d2e0Smrg
62807b58d2e0Smrg  aix[[4-9]]*)
6281f395c03eSmrg    if test ia64 != "$host_cpu"; then
6282f395c03eSmrg      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
6283f395c03eSmrg      yes,aix,yes) ;;			# shared object as lib.so file only
6284f395c03eSmrg      yes,svr4,*) ;;			# shared object as lib.so archive member only
6285f395c03eSmrg      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
6286f395c03eSmrg      esac
62877b58d2e0Smrg    fi
62887b58d2e0Smrg    ;;
62897b58d2e0Smrg  esac
62907b58d2e0Smrg  AC_MSG_RESULT([$enable_shared])
62917b58d2e0Smrg
62927b58d2e0Smrg  AC_MSG_CHECKING([whether to build static libraries])
62937b58d2e0Smrg  # Make sure either enable_shared or enable_static is yes.
6294f395c03eSmrg  test yes = "$enable_shared" || enable_static=yes
62957b58d2e0Smrg  AC_MSG_RESULT([$enable_static])
62967b58d2e0Smrg
62977b58d2e0Smrg  _LT_CONFIG($1)
62987b58d2e0Smrgfi
62997b58d2e0SmrgAC_LANG_POP
6300f395c03eSmrgCC=$lt_save_CC
63017b58d2e0Smrg])# _LT_LANG_C_CONFIG
63027b58d2e0Smrg
63037b58d2e0Smrg
63047b58d2e0Smrg# _LT_LANG_CXX_CONFIG([TAG])
63057b58d2e0Smrg# --------------------------
63067b58d2e0Smrg# Ensure that the configuration variables for a C++ compiler are suitably
63077b58d2e0Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
6308f395c03eSmrg# the compiler configuration to 'libtool'.
63097b58d2e0Smrgm4_defun([_LT_LANG_CXX_CONFIG],
6310b12e5c03Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
63117b58d2e0Smrgm4_require([_LT_DECL_EGREP])dnl
6312b12e5c03Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
6313f395c03eSmrgif test -n "$CXX" && ( test no != "$CXX" &&
6314f395c03eSmrg    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
6315f395c03eSmrg    (test g++ != "$CXX"))); then
6316b12e5c03Smrg  AC_PROG_CXXCPP
6317b12e5c03Smrgelse
6318b12e5c03Smrg  _lt_caught_CXX_error=yes
6319b12e5c03Smrgfi
63207b58d2e0Smrg
63217b58d2e0SmrgAC_LANG_PUSH(C++)
63227b58d2e0Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
63237b58d2e0Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
63247b58d2e0Smrg_LT_TAGVAR(always_export_symbols, $1)=no
63257b58d2e0Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
63267b58d2e0Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
63277b58d2e0Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
63287b58d2e0Smrg_LT_TAGVAR(hardcode_direct, $1)=no
63297b58d2e0Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
63307b58d2e0Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
63317b58d2e0Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
63327b58d2e0Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
63337b58d2e0Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
63347b58d2e0Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
63357b58d2e0Smrg_LT_TAGVAR(inherit_rpath, $1)=no
63367b58d2e0Smrg_LT_TAGVAR(module_cmds, $1)=
63377b58d2e0Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
63387b58d2e0Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
63397b58d2e0Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6340b12e5c03Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
6341b12e5c03Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
63427b58d2e0Smrg_LT_TAGVAR(no_undefined_flag, $1)=
63437b58d2e0Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
63447b58d2e0Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
63457b58d2e0Smrg
63467b58d2e0Smrg# Source file extension for C++ test sources.
63477b58d2e0Smrgac_ext=cpp
63487b58d2e0Smrg
63497b58d2e0Smrg# Object file extension for compiled C++ test sources.
63507b58d2e0Smrgobjext=o
63517b58d2e0Smrg_LT_TAGVAR(objext, $1)=$objext
63527b58d2e0Smrg
63537b58d2e0Smrg# No sense in running all these tests if we already determined that
63547b58d2e0Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
63557b58d2e0Smrg# are currently assumed to apply to all compilers on this platform,
63567b58d2e0Smrg# and will be corrupted by setting them based on a non-working compiler.
6357f395c03eSmrgif test yes != "$_lt_caught_CXX_error"; then
63587b58d2e0Smrg  # Code to be used in simple compile tests
63597b58d2e0Smrg  lt_simple_compile_test_code="int some_variable = 0;"
63607b58d2e0Smrg
63617b58d2e0Smrg  # Code to be used in simple link tests
63627b58d2e0Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
63637b58d2e0Smrg
63647b58d2e0Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
63657b58d2e0Smrg  _LT_TAG_COMPILER
63667b58d2e0Smrg
63677b58d2e0Smrg  # save warnings/boilerplate of simple test code
63687b58d2e0Smrg  _LT_COMPILER_BOILERPLATE
63697b58d2e0Smrg  _LT_LINKER_BOILERPLATE
63707b58d2e0Smrg
63717b58d2e0Smrg  # Allow CC to be a program name with arguments.
63727b58d2e0Smrg  lt_save_CC=$CC
6373b12e5c03Smrg  lt_save_CFLAGS=$CFLAGS
63747b58d2e0Smrg  lt_save_LD=$LD
63757b58d2e0Smrg  lt_save_GCC=$GCC
63767b58d2e0Smrg  GCC=$GXX
63777b58d2e0Smrg  lt_save_with_gnu_ld=$with_gnu_ld
63787b58d2e0Smrg  lt_save_path_LD=$lt_cv_path_LD
63797b58d2e0Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
63807b58d2e0Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
63817b58d2e0Smrg  else
63827b58d2e0Smrg    $as_unset lt_cv_prog_gnu_ld
6383b698ba48Smrg  fi
63847b58d2e0Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
63857b58d2e0Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
63867b58d2e0Smrg  else
63877b58d2e0Smrg    $as_unset lt_cv_path_LD
63887b58d2e0Smrg  fi
63897b58d2e0Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
63907b58d2e0Smrg  CC=${CXX-"c++"}
6391b12e5c03Smrg  CFLAGS=$CXXFLAGS
63927b58d2e0Smrg  compiler=$CC
63937b58d2e0Smrg  _LT_TAGVAR(compiler, $1)=$CC
63947b58d2e0Smrg  _LT_CC_BASENAME([$compiler])
63952ec8c4b4Smrg
63967b58d2e0Smrg  if test -n "$compiler"; then
63977b58d2e0Smrg    # We don't want -fno-exception when compiling C++ code, so set the
63987b58d2e0Smrg    # no_builtin_flag separately
6399f395c03eSmrg    if test yes = "$GXX"; then
64007b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
64017b58d2e0Smrg    else
64027b58d2e0Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
64037b58d2e0Smrg    fi
64047b58d2e0Smrg
6405f395c03eSmrg    if test yes = "$GXX"; then
64067b58d2e0Smrg      # Set up default GNU C++ configuration
64077b58d2e0Smrg
64087b58d2e0Smrg      LT_PATH_LD
64097b58d2e0Smrg
64107b58d2e0Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
64117b58d2e0Smrg      # archiving commands below assume that GNU ld is being used.
6412f395c03eSmrg      if test yes = "$with_gnu_ld"; then
6413f395c03eSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6414f395c03eSmrg        _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'
64157b58d2e0Smrg
6416f395c03eSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6417f395c03eSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
64187b58d2e0Smrg
64197b58d2e0Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
64207b58d2e0Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
64217b58d2e0Smrg        #     investigate it a little bit more. (MM)
6422f395c03eSmrg        wlarc='$wl'
64237b58d2e0Smrg
64247b58d2e0Smrg        # ancient GNU ld didn't support --whole-archive et. al.
64257b58d2e0Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
64267b58d2e0Smrg	  $GREP 'no-whole-archive' > /dev/null; then
6427f395c03eSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
64287b58d2e0Smrg        else
64297b58d2e0Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
64307b58d2e0Smrg        fi
64317b58d2e0Smrg      else
64327b58d2e0Smrg        with_gnu_ld=no
64337b58d2e0Smrg        wlarc=
64347b58d2e0Smrg
64357b58d2e0Smrg        # A generic and very simple default shared library creation
64367b58d2e0Smrg        # command for GNU C++ for the case where it uses the native
64377b58d2e0Smrg        # linker, instead of GNU ld.  If possible, this setting should
64387b58d2e0Smrg        # overridden to take advantage of the native linker features on
64397b58d2e0Smrg        # the platform it is being used on.
64407b58d2e0Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6441b698ba48Smrg      fi
64422ec8c4b4Smrg
64437b58d2e0Smrg      # Commands to make compiler produce verbose output that lists
64447b58d2e0Smrg      # what "hidden" libraries, object files and flags are used when
64457b58d2e0Smrg      # linking a shared library.
6446b12e5c03Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
64477b58d2e0Smrg
64487b58d2e0Smrg    else
64497b58d2e0Smrg      GXX=no
64507b58d2e0Smrg      with_gnu_ld=no
64517b58d2e0Smrg      wlarc=
64527b58d2e0Smrg    fi
64537b58d2e0Smrg
64547b58d2e0Smrg    # PORTME: fill in a description of your system's C++ link characteristics
64557b58d2e0Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
64567b58d2e0Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
64577b58d2e0Smrg    case $host_os in
64587b58d2e0Smrg      aix3*)
64597b58d2e0Smrg        # FIXME: insert proper C++ library support
64607b58d2e0Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6461e4f6584cSmrg        ;;
64627b58d2e0Smrg      aix[[4-9]]*)
6463f395c03eSmrg        if test ia64 = "$host_cpu"; then
64647b58d2e0Smrg          # On IA64, the linker does run time linking by default, so we don't
64657b58d2e0Smrg          # have to do anything special.
64667b58d2e0Smrg          aix_use_runtimelinking=no
64677b58d2e0Smrg          exp_sym_flag='-Bexport'
6468f395c03eSmrg          no_entry_flag=
64697b58d2e0Smrg        else
64707b58d2e0Smrg          aix_use_runtimelinking=no
64712ec8c4b4Smrg
64727b58d2e0Smrg          # Test if we are trying to use run time linking or normal
64737b58d2e0Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
6474f395c03eSmrg          # have runtime linking enabled, and use it for executables.
6475f395c03eSmrg          # For shared libraries, we enable/disable runtime linking
6476f395c03eSmrg          # depending on the kind of the shared library created -
6477f395c03eSmrg          # when "with_aix_soname,aix_use_runtimelinking" is:
6478f395c03eSmrg          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
6479f395c03eSmrg          # "aix,yes"  lib.so          shared, rtl:yes, for executables
6480f395c03eSmrg          #            lib.a           static archive
6481f395c03eSmrg          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
6482f395c03eSmrg          #            lib.a(lib.so.V) shared, rtl:no,  for executables
6483f395c03eSmrg          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
6484f395c03eSmrg          #            lib.a(lib.so.V) shared, rtl:no
6485f395c03eSmrg          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
6486f395c03eSmrg          #            lib.a           static archive
64877b58d2e0Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
64887b58d2e0Smrg	    for ld_flag in $LDFLAGS; do
64897b58d2e0Smrg	      case $ld_flag in
64907b58d2e0Smrg	      *-brtl*)
64917b58d2e0Smrg	        aix_use_runtimelinking=yes
64927b58d2e0Smrg	        break
64937b58d2e0Smrg	        ;;
64947b58d2e0Smrg	      esac
64957b58d2e0Smrg	    done
6496f395c03eSmrg	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
6497f395c03eSmrg	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
6498f395c03eSmrg	      # so we don't have lib.a shared libs to link our executables.
6499f395c03eSmrg	      # We have to force runtime linking in this case.
6500f395c03eSmrg	      aix_use_runtimelinking=yes
6501f395c03eSmrg	      LDFLAGS="$LDFLAGS -Wl,-brtl"
6502f395c03eSmrg	    fi
65037b58d2e0Smrg	    ;;
65047b58d2e0Smrg          esac
65052ec8c4b4Smrg
65067b58d2e0Smrg          exp_sym_flag='-bexport'
65077b58d2e0Smrg          no_entry_flag='-bnoentry'
65087b58d2e0Smrg        fi
65092ec8c4b4Smrg
65107b58d2e0Smrg        # When large executables or shared objects are built, AIX ld can
65117b58d2e0Smrg        # have problems creating the table of contents.  If linking a library
65127b58d2e0Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
65137b58d2e0Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
65147b58d2e0Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6515e4f6584cSmrg
65167b58d2e0Smrg        _LT_TAGVAR(archive_cmds, $1)=''
65177b58d2e0Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
65187b58d2e0Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
65197b58d2e0Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
65207b58d2e0Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
6521f395c03eSmrg        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
6522f395c03eSmrg        case $with_aix_soname,$aix_use_runtimelinking in
6523f395c03eSmrg        aix,*) ;;	# no import file
6524f395c03eSmrg        svr4,* | *,yes) # use import file
6525f395c03eSmrg          # The Import File defines what to hardcode.
6526f395c03eSmrg          _LT_TAGVAR(hardcode_direct, $1)=no
6527f395c03eSmrg          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6528f395c03eSmrg          ;;
6529f395c03eSmrg        esac
65302ec8c4b4Smrg
6531f395c03eSmrg        if test yes = "$GXX"; then
65327b58d2e0Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
65337b58d2e0Smrg          # We only want to do this on AIX 4.2 and lower, the check
65347b58d2e0Smrg          # below for broken collect2 doesn't work under 4.3+
6535f395c03eSmrg	  collect2name=`$CC -print-prog-name=collect2`
65367b58d2e0Smrg	  if test -f "$collect2name" &&
65377b58d2e0Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
65387b58d2e0Smrg	  then
65397b58d2e0Smrg	    # We have reworked collect2
65407b58d2e0Smrg	    :
65417b58d2e0Smrg	  else
65427b58d2e0Smrg	    # We have old collect2
65437b58d2e0Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
65447b58d2e0Smrg	    # It fails to find uninstalled libraries when the uninstalled
65457b58d2e0Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
65467b58d2e0Smrg	    # to unsupported forces relinking
65477b58d2e0Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
65487b58d2e0Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
65497b58d2e0Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
65507b58d2e0Smrg	  fi
65517b58d2e0Smrg          esac
65527b58d2e0Smrg          shared_flag='-shared'
6553f395c03eSmrg	  if test yes = "$aix_use_runtimelinking"; then
6554f395c03eSmrg	    shared_flag=$shared_flag' $wl-G'
65557b58d2e0Smrg	  fi
6556f395c03eSmrg	  # Need to ensure runtime linking is disabled for the traditional
6557f395c03eSmrg	  # shared library, or the linker may eventually find shared libraries
6558f395c03eSmrg	  # /with/ Import File - we do not want to mix them.
6559f395c03eSmrg	  shared_flag_aix='-shared'
6560f395c03eSmrg	  shared_flag_svr4='-shared $wl-G'
65617b58d2e0Smrg        else
65627b58d2e0Smrg          # not using gcc
6563f395c03eSmrg          if test ia64 = "$host_cpu"; then
65647b58d2e0Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
65657b58d2e0Smrg	  # chokes on -Wl,-G. The following line is correct:
65667b58d2e0Smrg	  shared_flag='-G'
65677b58d2e0Smrg          else
6568f395c03eSmrg	    if test yes = "$aix_use_runtimelinking"; then
6569f395c03eSmrg	      shared_flag='$wl-G'
65707b58d2e0Smrg	    else
6571f395c03eSmrg	      shared_flag='$wl-bM:SRE'
65727b58d2e0Smrg	    fi
6573f395c03eSmrg	    shared_flag_aix='$wl-bM:SRE'
6574f395c03eSmrg	    shared_flag_svr4='$wl-G'
65757b58d2e0Smrg          fi
65767b58d2e0Smrg        fi
65772ec8c4b4Smrg
6578f395c03eSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
65797b58d2e0Smrg        # It seems that -bexpall does not export symbols beginning with
65807b58d2e0Smrg        # underscore (_), so it is better to generate a list of symbols to
65817b58d2e0Smrg	# export.
65827b58d2e0Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
6583f395c03eSmrg	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
65847b58d2e0Smrg          # Warning - without using the other runtime loading flags (-brtl),
65857b58d2e0Smrg          # -berok will link without error, but may produce a broken library.
6586f395c03eSmrg          # The "-G" linker flag allows undefined symbols.
6587f395c03eSmrg          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
65887b58d2e0Smrg          # Determine the default libpath from the value encoded in an empty
65897b58d2e0Smrg          # executable.
6590b12e5c03Smrg          _LT_SYS_MODULE_PATH_AIX([$1])
6591f395c03eSmrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
65922ec8c4b4Smrg
6593f395c03eSmrg          _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
65947b58d2e0Smrg        else
6595f395c03eSmrg          if test ia64 = "$host_cpu"; then
6596f395c03eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
65977b58d2e0Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6598f395c03eSmrg	    _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"
65997b58d2e0Smrg          else
66007b58d2e0Smrg	    # Determine the default libpath from the value encoded in an
66017b58d2e0Smrg	    # empty executable.
6602b12e5c03Smrg	    _LT_SYS_MODULE_PATH_AIX([$1])
6603f395c03eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
66047b58d2e0Smrg	    # Warning - without using the other run time loading flags,
66057b58d2e0Smrg	    # -berok will link without error, but may produce a broken library.
6606f395c03eSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
6607f395c03eSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
6608f395c03eSmrg	    if test yes = "$with_gnu_ld"; then
6609b12e5c03Smrg	      # We only use this code for GNU lds that support --whole-archive.
6610f395c03eSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
6611b12e5c03Smrg	    else
6612b12e5c03Smrg	      # Exported symbols can be pulled into shared objects from archives
6613b12e5c03Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6614b12e5c03Smrg	    fi
66157b58d2e0Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6616f395c03eSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
6617f395c03eSmrg	    # -brtl affects multiple linker settings, -berok does not and is overridden later
6618f395c03eSmrg	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
6619f395c03eSmrg	    if test svr4 != "$with_aix_soname"; then
6620f395c03eSmrg	      # This is similar to how AIX traditionally builds its shared
6621f395c03eSmrg	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
6622f395c03eSmrg	      _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'
6623f395c03eSmrg	    fi
6624f395c03eSmrg	    if test aix != "$with_aix_soname"; then
6625f395c03eSmrg	      _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'
6626f395c03eSmrg	    else
6627f395c03eSmrg	      # used by -dlpreopen to get the symbols
6628f395c03eSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
6629f395c03eSmrg	    fi
6630f395c03eSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
66317b58d2e0Smrg          fi
66327b58d2e0Smrg        fi
66337b58d2e0Smrg        ;;
6634e4f6584cSmrg
66357b58d2e0Smrg      beos*)
66367b58d2e0Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
66377b58d2e0Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
66387b58d2e0Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
66397b58d2e0Smrg	  # support --undefined.  This deserves some investigation.  FIXME
6640f395c03eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
66417b58d2e0Smrg	else
66427b58d2e0Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
66437b58d2e0Smrg	fi
66447b58d2e0Smrg	;;
66452ec8c4b4Smrg
66467b58d2e0Smrg      chorus*)
66477b58d2e0Smrg        case $cc_basename in
66487b58d2e0Smrg          *)
66497b58d2e0Smrg	  # FIXME: insert proper C++ library support
66507b58d2e0Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
66517b58d2e0Smrg	  ;;
66527b58d2e0Smrg        esac
66537b58d2e0Smrg        ;;
66542ec8c4b4Smrg
66557b58d2e0Smrg      cygwin* | mingw* | pw32* | cegcc*)
6656b12e5c03Smrg	case $GXX,$cc_basename in
6657b12e5c03Smrg	,cl* | no,cl*)
6658b12e5c03Smrg	  # Native MSVC
6659b12e5c03Smrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
6660b12e5c03Smrg	  # no search path for DLLs.
6661b12e5c03Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6662b12e5c03Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6663b12e5c03Smrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
6664b12e5c03Smrg	  _LT_TAGVAR(file_list_spec, $1)='@'
6665b12e5c03Smrg	  # Tell ltmain to make .lib files, not .a files.
6666b12e5c03Smrg	  libext=lib
6667b12e5c03Smrg	  # Tell ltmain to make .dll files, not .so files.
6668f395c03eSmrg	  shrext_cmds=.dll
6669b12e5c03Smrg	  # FIXME: Setting linknames here is a bad hack.
6670f395c03eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
6671f395c03eSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6672f395c03eSmrg              cp "$export_symbols" "$output_objdir/$soname.def";
6673f395c03eSmrg              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
6674f395c03eSmrg            else
6675f395c03eSmrg              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
6676f395c03eSmrg            fi~
6677f395c03eSmrg            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6678f395c03eSmrg            linknames='
6679b12e5c03Smrg	  # The linker will not automatically build a static lib if we build a DLL.
6680b12e5c03Smrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6681b12e5c03Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6682b12e5c03Smrg	  # Don't use ranlib
6683b12e5c03Smrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6684b12e5c03Smrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6685f395c03eSmrg            lt_tool_outputfile="@TOOL_OUTPUT@"~
6686f395c03eSmrg            case $lt_outputfile in
6687f395c03eSmrg              *.exe|*.EXE) ;;
6688f395c03eSmrg              *)
6689f395c03eSmrg                lt_outputfile=$lt_outputfile.exe
6690f395c03eSmrg                lt_tool_outputfile=$lt_tool_outputfile.exe
6691f395c03eSmrg                ;;
6692f395c03eSmrg            esac~
6693f395c03eSmrg            func_to_tool_file "$lt_outputfile"~
6694f395c03eSmrg            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
6695f395c03eSmrg              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6696f395c03eSmrg              $RM "$lt_outputfile.manifest";
6697f395c03eSmrg            fi'
6698b12e5c03Smrg	  ;;
6699b12e5c03Smrg	*)
6700b12e5c03Smrg	  # g++
6701b12e5c03Smrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6702b12e5c03Smrg	  # as there is no search path for DLLs.
6703b12e5c03Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6704f395c03eSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
6705b12e5c03Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6706b12e5c03Smrg	  _LT_TAGVAR(always_export_symbols, $1)=no
6707b12e5c03Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6708b12e5c03Smrg
6709b12e5c03Smrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6710f395c03eSmrg	    _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'
6711f395c03eSmrg	    # If the export-symbols file already is a .def file, use it as
6712f395c03eSmrg	    # is; otherwise, prepend EXPORTS...
6713f395c03eSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6714f395c03eSmrg              cp $export_symbols $output_objdir/$soname.def;
6715f395c03eSmrg            else
6716f395c03eSmrg              echo EXPORTS > $output_objdir/$soname.def;
6717f395c03eSmrg              cat $export_symbols >> $output_objdir/$soname.def;
6718f395c03eSmrg            fi~
6719f395c03eSmrg            $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'
6720b12e5c03Smrg	  else
6721b12e5c03Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6722b12e5c03Smrg	  fi
6723b12e5c03Smrg	  ;;
6724b12e5c03Smrg	esac
6725b12e5c03Smrg	;;
67267b58d2e0Smrg      darwin* | rhapsody*)
67277b58d2e0Smrg        _LT_DARWIN_LINKER_FEATURES($1)
6728b698ba48Smrg	;;
67292ec8c4b4Smrg
6730f395c03eSmrg      os2*)
6731f395c03eSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6732f395c03eSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
6733f395c03eSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6734f395c03eSmrg	shrext_cmds=.dll
6735f395c03eSmrg	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6736f395c03eSmrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6737f395c03eSmrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6738f395c03eSmrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
6739f395c03eSmrg	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
6740f395c03eSmrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6741f395c03eSmrg	  emximp -o $lib $output_objdir/$libname.def'
6742f395c03eSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6743f395c03eSmrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6744f395c03eSmrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6745f395c03eSmrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
6746f395c03eSmrg	  prefix_cmds="$SED"~
6747f395c03eSmrg	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
6748f395c03eSmrg	    prefix_cmds="$prefix_cmds -e 1d";
6749f395c03eSmrg	  fi~
6750f395c03eSmrg	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
6751f395c03eSmrg	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
6752f395c03eSmrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6753f395c03eSmrg	  emximp -o $lib $output_objdir/$libname.def'
6754f395c03eSmrg	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
6755f395c03eSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6756f395c03eSmrg	;;
6757f395c03eSmrg
67587b58d2e0Smrg      dgux*)
67597b58d2e0Smrg        case $cc_basename in
67607b58d2e0Smrg          ec++*)
67617b58d2e0Smrg	    # FIXME: insert proper C++ library support
67627b58d2e0Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67637b58d2e0Smrg	    ;;
67647b58d2e0Smrg          ghcx*)
67657b58d2e0Smrg	    # Green Hills C++ Compiler
67667b58d2e0Smrg	    # FIXME: insert proper C++ library support
67677b58d2e0Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67687b58d2e0Smrg	    ;;
67697b58d2e0Smrg          *)
67707b58d2e0Smrg	    # FIXME: insert proper C++ library support
67717b58d2e0Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67727b58d2e0Smrg	    ;;
67737b58d2e0Smrg        esac
67747b58d2e0Smrg        ;;
67752ec8c4b4Smrg
6776b12e5c03Smrg      freebsd2.*)
67777b58d2e0Smrg        # C++ shared libraries reported to be fairly broken before
67787b58d2e0Smrg	# switch to ELF
67797b58d2e0Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6780b698ba48Smrg        ;;
67817b58d2e0Smrg
67827b58d2e0Smrg      freebsd-elf*)
67837b58d2e0Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6784e4f6584cSmrg        ;;
67857b58d2e0Smrg
67867b58d2e0Smrg      freebsd* | dragonfly*)
67877b58d2e0Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
67887b58d2e0Smrg        # conventions
67897b58d2e0Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
6790b698ba48Smrg        ;;
67917b58d2e0Smrg
6792b12e5c03Smrg      haiku*)
6793f395c03eSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6794b12e5c03Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
6795b12e5c03Smrg        ;;
6796b12e5c03Smrg
67977b58d2e0Smrg      hpux9*)
6798f395c03eSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
67997b58d2e0Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6800f395c03eSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
68017b58d2e0Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
68027b58d2e0Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
68037b58d2e0Smrg				             # but as the default
68047b58d2e0Smrg				             # location of the library.
68057b58d2e0Smrg
68067b58d2e0Smrg        case $cc_basename in
68077b58d2e0Smrg          CC*)
68087b58d2e0Smrg            # FIXME: insert proper C++ library support
68097b58d2e0Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
68107b58d2e0Smrg            ;;
68117b58d2e0Smrg          aCC*)
6812f395c03eSmrg            _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'
68137b58d2e0Smrg            # Commands to make compiler produce verbose output that lists
68147b58d2e0Smrg            # what "hidden" libraries, object files and flags are used when
68157b58d2e0Smrg            # linking a shared library.
68167b58d2e0Smrg            #
68177b58d2e0Smrg            # There doesn't appear to be a way to prevent this compiler from
68187b58d2e0Smrg            # explicitly linking system object files so we need to strip them
68197b58d2e0Smrg            # from the output so that they don't get included in the library
68207b58d2e0Smrg            # dependencies.
6821f395c03eSmrg            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"'
68227b58d2e0Smrg            ;;
68237b58d2e0Smrg          *)
6824f395c03eSmrg            if test yes = "$GXX"; then
6825f395c03eSmrg              _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'
68267b58d2e0Smrg            else
68277b58d2e0Smrg              # FIXME: insert proper C++ library support
68287b58d2e0Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
68297b58d2e0Smrg            fi
68307b58d2e0Smrg            ;;
68317b58d2e0Smrg        esac
6832b698ba48Smrg        ;;
68332ec8c4b4Smrg
68347b58d2e0Smrg      hpux10*|hpux11*)
6835f395c03eSmrg        if test no = "$with_gnu_ld"; then
6836f395c03eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
68377b58d2e0Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6838e4f6584cSmrg
68397b58d2e0Smrg          case $host_cpu in
68407b58d2e0Smrg            hppa*64*|ia64*)
68417b58d2e0Smrg              ;;
68427b58d2e0Smrg            *)
6843f395c03eSmrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
68447b58d2e0Smrg              ;;
68457b58d2e0Smrg          esac
68467b58d2e0Smrg        fi
68477b58d2e0Smrg        case $host_cpu in
68487b58d2e0Smrg          hppa*64*|ia64*)
68497b58d2e0Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
68507b58d2e0Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
68517b58d2e0Smrg            ;;
68527b58d2e0Smrg          *)
68537b58d2e0Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
68547b58d2e0Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
68557b58d2e0Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
68567b58d2e0Smrg					         # but as the default
68577b58d2e0Smrg					         # location of the library.
68587b58d2e0Smrg            ;;
68597b58d2e0Smrg        esac
6860e4f6584cSmrg
68617b58d2e0Smrg        case $cc_basename in
68627b58d2e0Smrg          CC*)
68637b58d2e0Smrg	    # FIXME: insert proper C++ library support
68647b58d2e0Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
68657b58d2e0Smrg	    ;;
68667b58d2e0Smrg          aCC*)
68677b58d2e0Smrg	    case $host_cpu in
68687b58d2e0Smrg	      hppa*64*)
6869f395c03eSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
68707b58d2e0Smrg	        ;;
68717b58d2e0Smrg	      ia64*)
6872f395c03eSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
68737b58d2e0Smrg	        ;;
68747b58d2e0Smrg	      *)
6875f395c03eSmrg	        _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'
68767b58d2e0Smrg	        ;;
68777b58d2e0Smrg	    esac
68787b58d2e0Smrg	    # Commands to make compiler produce verbose output that lists
68797b58d2e0Smrg	    # what "hidden" libraries, object files and flags are used when
68807b58d2e0Smrg	    # linking a shared library.
68817b58d2e0Smrg	    #
68827b58d2e0Smrg	    # There doesn't appear to be a way to prevent this compiler from
68837b58d2e0Smrg	    # explicitly linking system object files so we need to strip them
68847b58d2e0Smrg	    # from the output so that they don't get included in the library
68857b58d2e0Smrg	    # dependencies.
6886f395c03eSmrg	    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"'
68877b58d2e0Smrg	    ;;
68887b58d2e0Smrg          *)
6889f395c03eSmrg	    if test yes = "$GXX"; then
6890f395c03eSmrg	      if test no = "$with_gnu_ld"; then
68917b58d2e0Smrg	        case $host_cpu in
68927b58d2e0Smrg	          hppa*64*)
6893f395c03eSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
68947b58d2e0Smrg	            ;;
68957b58d2e0Smrg	          ia64*)
6896f395c03eSmrg	            _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'
68977b58d2e0Smrg	            ;;
68987b58d2e0Smrg	          *)
6899f395c03eSmrg	            _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'
69007b58d2e0Smrg	            ;;
69017b58d2e0Smrg	        esac
69027b58d2e0Smrg	      fi
69037b58d2e0Smrg	    else
69047b58d2e0Smrg	      # FIXME: insert proper C++ library support
69057b58d2e0Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
69067b58d2e0Smrg	    fi
69077b58d2e0Smrg	    ;;
69087b58d2e0Smrg        esac
69097b58d2e0Smrg        ;;
69102ec8c4b4Smrg
69117b58d2e0Smrg      interix[[3-9]]*)
69127b58d2e0Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
69137b58d2e0Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6914f395c03eSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6915f395c03eSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
69167b58d2e0Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
69177b58d2e0Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
69187b58d2e0Smrg	# default) and relocated if they conflict, which is a slow very memory
69197b58d2e0Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
69207b58d2e0Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
69217b58d2e0Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
6922f395c03eSmrg	_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'
6923f395c03eSmrg	_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'
69247b58d2e0Smrg	;;
69257b58d2e0Smrg      irix5* | irix6*)
69267b58d2e0Smrg        case $cc_basename in
69277b58d2e0Smrg          CC*)
69287b58d2e0Smrg	    # SGI C++
6929f395c03eSmrg	    _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'
69302ec8c4b4Smrg
69317b58d2e0Smrg	    # Archives containing C++ object files must be created using
69327b58d2e0Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
69337b58d2e0Smrg	    # necessary to make sure instantiated templates are included
69347b58d2e0Smrg	    # in the archive.
69357b58d2e0Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
69367b58d2e0Smrg	    ;;
69377b58d2e0Smrg          *)
6938f395c03eSmrg	    if test yes = "$GXX"; then
6939f395c03eSmrg	      if test no = "$with_gnu_ld"; then
6940f395c03eSmrg	        _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'
69417b58d2e0Smrg	      else
6942f395c03eSmrg	        _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'
69437b58d2e0Smrg	      fi
69447b58d2e0Smrg	    fi
69457b58d2e0Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
69467b58d2e0Smrg	    ;;
69477b58d2e0Smrg        esac
6948f395c03eSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
69497b58d2e0Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
69507b58d2e0Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
69517b58d2e0Smrg        ;;
69522ec8c4b4Smrg
6953df9ffc95Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
69547b58d2e0Smrg        case $cc_basename in
69557b58d2e0Smrg          KCC*)
69567b58d2e0Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
69572ec8c4b4Smrg
69587b58d2e0Smrg	    # KCC will only create a shared library if the output file
69597b58d2e0Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
69607b58d2e0Smrg	    # to its proper name (with version) after linking.
6961f395c03eSmrg	    _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'
6962f395c03eSmrg	    _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'
69637b58d2e0Smrg	    # Commands to make compiler produce verbose output that lists
69647b58d2e0Smrg	    # what "hidden" libraries, object files and flags are used when
69657b58d2e0Smrg	    # linking a shared library.
69667b58d2e0Smrg	    #
69677b58d2e0Smrg	    # There doesn't appear to be a way to prevent this compiler from
69687b58d2e0Smrg	    # explicitly linking system object files so we need to strip them
69697b58d2e0Smrg	    # from the output so that they don't get included in the library
69707b58d2e0Smrg	    # dependencies.
6971f395c03eSmrg	    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"'
69722ec8c4b4Smrg
6973f395c03eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6974f395c03eSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
69752ec8c4b4Smrg
69767b58d2e0Smrg	    # Archives containing C++ object files must be created using
69777b58d2e0Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
69787b58d2e0Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
69797b58d2e0Smrg	    ;;
69807b58d2e0Smrg	  icpc* | ecpc* )
69817b58d2e0Smrg	    # Intel C++
69827b58d2e0Smrg	    with_gnu_ld=yes
69837b58d2e0Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
69847b58d2e0Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
69857b58d2e0Smrg	    # earlier do not add the objects themselves.
69867b58d2e0Smrg	    case `$CC -V 2>&1` in
69877b58d2e0Smrg	      *"Version 7."*)
6988f395c03eSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6989f395c03eSmrg		_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'
69907b58d2e0Smrg		;;
69917b58d2e0Smrg	      *)  # Version 8.0 or newer
69927b58d2e0Smrg	        tmp_idyn=
69937b58d2e0Smrg	        case $host_cpu in
69947b58d2e0Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
69957b58d2e0Smrg		esac
6996f395c03eSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6997f395c03eSmrg		_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'
69987b58d2e0Smrg		;;
69997b58d2e0Smrg	    esac
70007b58d2e0Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7001f395c03eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7002f395c03eSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7003f395c03eSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
70047b58d2e0Smrg	    ;;
70057b58d2e0Smrg          pgCC* | pgcpp*)
70067b58d2e0Smrg            # Portland Group C++ compiler
70077b58d2e0Smrg	    case `$CC -V` in
7008b12e5c03Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
70097b58d2e0Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
7010f395c03eSmrg               rm -rf $tpldir~
7011f395c03eSmrg               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
7012f395c03eSmrg               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
70137b58d2e0Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
7014f395c03eSmrg                rm -rf $tpldir~
7015f395c03eSmrg                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
7016f395c03eSmrg                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
7017f395c03eSmrg                $RANLIB $oldlib'
70187b58d2e0Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
7019f395c03eSmrg                rm -rf $tpldir~
7020f395c03eSmrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7021f395c03eSmrg                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
70227b58d2e0Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
7023f395c03eSmrg                rm -rf $tpldir~
7024f395c03eSmrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7025f395c03eSmrg                $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'
70267b58d2e0Smrg	      ;;
7027b12e5c03Smrg	    *) # Version 6 and above use weak symbols
7028f395c03eSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7029f395c03eSmrg	      _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'
70307b58d2e0Smrg	      ;;
70317b58d2e0Smrg	    esac
70322ec8c4b4Smrg
7033f395c03eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
7034f395c03eSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7035f395c03eSmrg	    _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'
70367b58d2e0Smrg            ;;
70377b58d2e0Smrg	  cxx*)
70387b58d2e0Smrg	    # Compaq C++
7039f395c03eSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7040f395c03eSmrg	    _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'
70412ec8c4b4Smrg
70427b58d2e0Smrg	    runpath_var=LD_RUN_PATH
70437b58d2e0Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
70447b58d2e0Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
70452ec8c4b4Smrg
70467b58d2e0Smrg	    # Commands to make compiler produce verbose output that lists
70477b58d2e0Smrg	    # what "hidden" libraries, object files and flags are used when
70487b58d2e0Smrg	    # linking a shared library.
70497b58d2e0Smrg	    #
70507b58d2e0Smrg	    # There doesn't appear to be a way to prevent this compiler from
70517b58d2e0Smrg	    # explicitly linking system object files so we need to strip them
70527b58d2e0Smrg	    # from the output so that they don't get included in the library
70537b58d2e0Smrg	    # dependencies.
7054f395c03eSmrg	    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'
70557b58d2e0Smrg	    ;;
7056b12e5c03Smrg	  xl* | mpixl* | bgxl*)
70577b58d2e0Smrg	    # IBM XL 8.0 on PPC, with GNU ld
7058f395c03eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7059f395c03eSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7060f395c03eSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
7061f395c03eSmrg	    if test yes = "$supports_anon_versioning"; then
70627b58d2e0Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
7063f395c03eSmrg                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7064f395c03eSmrg                echo "local: *; };" >> $output_objdir/$libname.ver~
7065f395c03eSmrg                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
70667b58d2e0Smrg	    fi
70677b58d2e0Smrg	    ;;
70687b58d2e0Smrg	  *)
70697b58d2e0Smrg	    case `$CC -V 2>&1 | sed 5q` in
70707b58d2e0Smrg	    *Sun\ C*)
70717b58d2e0Smrg	      # Sun C++ 5.9
70727b58d2e0Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7073f395c03eSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7074f395c03eSmrg	      _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'
70757b58d2e0Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7076f395c03eSmrg	      _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'
70777b58d2e0Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
7078e4f6584cSmrg
70797b58d2e0Smrg	      # Not sure whether something based on
70807b58d2e0Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
70817b58d2e0Smrg	      # would be better.
7082b12e5c03Smrg	      output_verbose_link_cmd='func_echo_all'
708309885543Smrg
70847b58d2e0Smrg	      # Archives containing C++ object files must be created using
70857b58d2e0Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
70867b58d2e0Smrg	      # necessary to make sure instantiated templates are included
70877b58d2e0Smrg	      # in the archive.
70887b58d2e0Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
70897b58d2e0Smrg	      ;;
70907b58d2e0Smrg	    esac
70917b58d2e0Smrg	    ;;
70927b58d2e0Smrg	esac
70937b58d2e0Smrg	;;
709409885543Smrg
70957b58d2e0Smrg      lynxos*)
70967b58d2e0Smrg        # FIXME: insert proper C++ library support
70977b58d2e0Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
70987b58d2e0Smrg	;;
709909885543Smrg
71007b58d2e0Smrg      m88k*)
71017b58d2e0Smrg        # FIXME: insert proper C++ library support
71027b58d2e0Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
71037b58d2e0Smrg	;;
7104e4f6584cSmrg
71057b58d2e0Smrg      mvs*)
71067b58d2e0Smrg        case $cc_basename in
71077b58d2e0Smrg          cxx*)
71087b58d2e0Smrg	    # FIXME: insert proper C++ library support
71097b58d2e0Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
71107b58d2e0Smrg	    ;;
71117b58d2e0Smrg	  *)
71127b58d2e0Smrg	    # FIXME: insert proper C++ library support
71137b58d2e0Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
71147b58d2e0Smrg	    ;;
71157b58d2e0Smrg	esac
71167b58d2e0Smrg	;;
711709885543Smrg
71187b58d2e0Smrg      netbsd*)
71197b58d2e0Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
71207b58d2e0Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
71217b58d2e0Smrg	  wlarc=
71227b58d2e0Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
71237b58d2e0Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
71247b58d2e0Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
71257b58d2e0Smrg	fi
71267b58d2e0Smrg	# Workaround some broken pre-1.5 toolchains
71277b58d2e0Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
71287b58d2e0Smrg	;;
712909885543Smrg
71307b58d2e0Smrg      *nto* | *qnx*)
71317b58d2e0Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
71327b58d2e0Smrg	;;
713309885543Smrg
7134f395c03eSmrg      openbsd* | bitrig*)
71357b58d2e0Smrg	if test -f /usr/libexec/ld.so; then
71367b58d2e0Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
71377b58d2e0Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
71387b58d2e0Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
71397b58d2e0Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7140f395c03eSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7141f395c03eSmrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
7142f395c03eSmrg	    _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'
7143f395c03eSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
7144f395c03eSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
71457b58d2e0Smrg	  fi
7146b12e5c03Smrg	  output_verbose_link_cmd=func_echo_all
71477b58d2e0Smrg	else
71487b58d2e0Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
71497b58d2e0Smrg	fi
71507b58d2e0Smrg	;;
715109885543Smrg
71527b58d2e0Smrg      osf3* | osf4* | osf5*)
71537b58d2e0Smrg        case $cc_basename in
71547b58d2e0Smrg          KCC*)
71557b58d2e0Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
715609885543Smrg
71577b58d2e0Smrg	    # KCC will only create a shared library if the output file
71587b58d2e0Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
71597b58d2e0Smrg	    # to its proper name (with version) after linking.
7160f395c03eSmrg	    _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'
716109885543Smrg
7162f395c03eSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
71637b58d2e0Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
716409885543Smrg
71657b58d2e0Smrg	    # Archives containing C++ object files must be created using
71667b58d2e0Smrg	    # the KAI C++ compiler.
71677b58d2e0Smrg	    case $host in
71687b58d2e0Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
71697b58d2e0Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
71707b58d2e0Smrg	    esac
71717b58d2e0Smrg	    ;;
71727b58d2e0Smrg          RCC*)
71737b58d2e0Smrg	    # Rational C++ 2.4.1
71747b58d2e0Smrg	    # FIXME: insert proper C++ library support
71757b58d2e0Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
71767b58d2e0Smrg	    ;;
71777b58d2e0Smrg          cxx*)
71787b58d2e0Smrg	    case $host in
71797b58d2e0Smrg	      osf3*)
7180f395c03eSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7181f395c03eSmrg	        _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'
7182f395c03eSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
71837b58d2e0Smrg		;;
71847b58d2e0Smrg	      *)
71857b58d2e0Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7186f395c03eSmrg	        _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'
71877b58d2e0Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7188f395c03eSmrg                  echo "-hidden">> $lib.exp~
7189f395c03eSmrg                  $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~
7190f395c03eSmrg                  $RM $lib.exp'
71917b58d2e0Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
71927b58d2e0Smrg		;;
71937b58d2e0Smrg	    esac
719409885543Smrg
71957b58d2e0Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7196e4f6584cSmrg
71977b58d2e0Smrg	    # Commands to make compiler produce verbose output that lists
71987b58d2e0Smrg	    # what "hidden" libraries, object files and flags are used when
71997b58d2e0Smrg	    # linking a shared library.
72007b58d2e0Smrg	    #
72017b58d2e0Smrg	    # There doesn't appear to be a way to prevent this compiler from
72027b58d2e0Smrg	    # explicitly linking system object files so we need to strip them
72037b58d2e0Smrg	    # from the output so that they don't get included in the library
72047b58d2e0Smrg	    # dependencies.
7205f395c03eSmrg	    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"'
72067b58d2e0Smrg	    ;;
72077b58d2e0Smrg	  *)
7208f395c03eSmrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
7209f395c03eSmrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
72107b58d2e0Smrg	      case $host in
72117b58d2e0Smrg	        osf3*)
7212f395c03eSmrg	          _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'
72137b58d2e0Smrg		  ;;
72147b58d2e0Smrg	        *)
7215f395c03eSmrg	          _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'
72167b58d2e0Smrg		  ;;
72177b58d2e0Smrg	      esac
721809885543Smrg
7219f395c03eSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
72207b58d2e0Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
72212ec8c4b4Smrg
72227b58d2e0Smrg	      # Commands to make compiler produce verbose output that lists
72237b58d2e0Smrg	      # what "hidden" libraries, object files and flags are used when
72247b58d2e0Smrg	      # linking a shared library.
7225b12e5c03Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
72262ec8c4b4Smrg
72277b58d2e0Smrg	    else
72287b58d2e0Smrg	      # FIXME: insert proper C++ library support
72297b58d2e0Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
72307b58d2e0Smrg	    fi
72317b58d2e0Smrg	    ;;
72327b58d2e0Smrg        esac
72337b58d2e0Smrg        ;;
7234e4f6584cSmrg
72357b58d2e0Smrg      psos*)
72367b58d2e0Smrg        # FIXME: insert proper C++ library support
7237e4f6584cSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
72387b58d2e0Smrg        ;;
72397b58d2e0Smrg
72407b58d2e0Smrg      sunos4*)
72417b58d2e0Smrg        case $cc_basename in
72427b58d2e0Smrg          CC*)
72437b58d2e0Smrg	    # Sun C++ 4.x
72447b58d2e0Smrg	    # FIXME: insert proper C++ library support
72457b58d2e0Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72467b58d2e0Smrg	    ;;
72477b58d2e0Smrg          lcc*)
72487b58d2e0Smrg	    # Lucid
72497b58d2e0Smrg	    # FIXME: insert proper C++ library support
72507b58d2e0Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72517b58d2e0Smrg	    ;;
72527b58d2e0Smrg          *)
72537b58d2e0Smrg	    # FIXME: insert proper C++ library support
72547b58d2e0Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72557b58d2e0Smrg	    ;;
72567b58d2e0Smrg        esac
72577b58d2e0Smrg        ;;
72587b58d2e0Smrg
72597b58d2e0Smrg      solaris*)
72607b58d2e0Smrg        case $cc_basename in
7261b12e5c03Smrg          CC* | sunCC*)
72627b58d2e0Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
72637b58d2e0Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
72647b58d2e0Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7265f395c03eSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
72667b58d2e0Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7267f395c03eSmrg              $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'
72682ec8c4b4Smrg
72697b58d2e0Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
72707b58d2e0Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
72717b58d2e0Smrg	    case $host_os in
72727b58d2e0Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
72737b58d2e0Smrg	      *)
72747b58d2e0Smrg		# The compiler driver will combine and reorder linker options,
7275f395c03eSmrg		# but understands '-z linker_flag'.
72767b58d2e0Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
72777b58d2e0Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
72787b58d2e0Smrg	        ;;
72797b58d2e0Smrg	    esac
72807b58d2e0Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
72812ec8c4b4Smrg
7282b12e5c03Smrg	    output_verbose_link_cmd='func_echo_all'
728309885543Smrg
72847b58d2e0Smrg	    # Archives containing C++ object files must be created using
72857b58d2e0Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
72867b58d2e0Smrg	    # necessary to make sure instantiated templates are included
72877b58d2e0Smrg	    # in the archive.
72887b58d2e0Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
72897b58d2e0Smrg	    ;;
72907b58d2e0Smrg          gcx*)
72917b58d2e0Smrg	    # Green Hills C++ Compiler
7292f395c03eSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
729309885543Smrg
72947b58d2e0Smrg	    # The C++ compiler must be used to create the archive.
72957b58d2e0Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
72967b58d2e0Smrg	    ;;
72977b58d2e0Smrg          *)
72987b58d2e0Smrg	    # GNU C++ compiler with Solaris linker
7299f395c03eSmrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
7300f395c03eSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
73017b58d2e0Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
7302f395c03eSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
73037b58d2e0Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7304f395c03eSmrg                  $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'
730509885543Smrg
73067b58d2e0Smrg	        # Commands to make compiler produce verbose output that lists
73077b58d2e0Smrg	        # what "hidden" libraries, object files and flags are used when
73087b58d2e0Smrg	        # linking a shared library.
7309b12e5c03Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
73107b58d2e0Smrg	      else
7311f395c03eSmrg	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
73127b58d2e0Smrg	        # platform.
7313f395c03eSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
73147b58d2e0Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7315f395c03eSmrg                  $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'
731609885543Smrg
73177b58d2e0Smrg	        # Commands to make compiler produce verbose output that lists
73187b58d2e0Smrg	        # what "hidden" libraries, object files and flags are used when
73197b58d2e0Smrg	        # linking a shared library.
7320b12e5c03Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
73217b58d2e0Smrg	      fi
732209885543Smrg
7323f395c03eSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
73247b58d2e0Smrg	      case $host_os in
73257b58d2e0Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
73267b58d2e0Smrg		*)
7327f395c03eSmrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
73287b58d2e0Smrg		  ;;
73297b58d2e0Smrg	      esac
73307b58d2e0Smrg	    fi
73317b58d2e0Smrg	    ;;
73327b58d2e0Smrg        esac
73337b58d2e0Smrg        ;;
73347b58d2e0Smrg
73357b58d2e0Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7336f395c03eSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
73377b58d2e0Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
73387b58d2e0Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
73397b58d2e0Smrg      runpath_var='LD_RUN_PATH'
73407b58d2e0Smrg
73417b58d2e0Smrg      case $cc_basename in
73427b58d2e0Smrg        CC*)
7343f395c03eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7344f395c03eSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73457b58d2e0Smrg	  ;;
7346b698ba48Smrg	*)
7347f395c03eSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7348f395c03eSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73497b58d2e0Smrg	  ;;
7350b698ba48Smrg      esac
7351b698ba48Smrg      ;;
735209885543Smrg
73537b58d2e0Smrg      sysv5* | sco3.2v5* | sco5v6*)
7354f395c03eSmrg	# Note: We CANNOT use -z defs as we might desire, because we do not
73557b58d2e0Smrg	# link with -lc, and that would cause any symbols used from libc to
73567b58d2e0Smrg	# always be unresolved, which means just about no library would
73577b58d2e0Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
73587b58d2e0Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
73597b58d2e0Smrg	# as -z defs.
7360f395c03eSmrg	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7361f395c03eSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
73627b58d2e0Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
73637b58d2e0Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7364f395c03eSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
73657b58d2e0Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
73667b58d2e0Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
7367f395c03eSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
73687b58d2e0Smrg	runpath_var='LD_RUN_PATH'
736909885543Smrg
73707b58d2e0Smrg	case $cc_basename in
73717b58d2e0Smrg          CC*)
7372f395c03eSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7373f395c03eSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7374b12e5c03Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
7375f395c03eSmrg              '"$_LT_TAGVAR(old_archive_cmds, $1)"
7376b12e5c03Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
7377f395c03eSmrg              '"$_LT_TAGVAR(reload_cmds, $1)"
73787b58d2e0Smrg	    ;;
73797b58d2e0Smrg	  *)
7380f395c03eSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7381f395c03eSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73827b58d2e0Smrg	    ;;
73837b58d2e0Smrg	esac
7384b698ba48Smrg      ;;
73857b58d2e0Smrg
73867b58d2e0Smrg      tandem*)
73877b58d2e0Smrg        case $cc_basename in
73887b58d2e0Smrg          NCC*)
73897b58d2e0Smrg	    # NonStop-UX NCC 3.20
73907b58d2e0Smrg	    # FIXME: insert proper C++ library support
73917b58d2e0Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
73927b58d2e0Smrg	    ;;
73937b58d2e0Smrg          *)
73947b58d2e0Smrg	    # FIXME: insert proper C++ library support
73957b58d2e0Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
73967b58d2e0Smrg	    ;;
73977b58d2e0Smrg        esac
73987b58d2e0Smrg        ;;
73997b58d2e0Smrg
74007b58d2e0Smrg      vxworks*)
74017b58d2e0Smrg        # FIXME: insert proper C++ library support
74027b58d2e0Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
74037b58d2e0Smrg        ;;
74047b58d2e0Smrg
74057b58d2e0Smrg      *)
74067b58d2e0Smrg        # FIXME: insert proper C++ library support
74077b58d2e0Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
74087b58d2e0Smrg        ;;
7409b698ba48Smrg    esac
741009885543Smrg
74117b58d2e0Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7412f395c03eSmrg    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
741309885543Smrg
7414f395c03eSmrg    _LT_TAGVAR(GCC, $1)=$GXX
7415f395c03eSmrg    _LT_TAGVAR(LD, $1)=$LD
74167b58d2e0Smrg
74177b58d2e0Smrg    ## CAVEAT EMPTOR:
74187b58d2e0Smrg    ## There is no encapsulation within the following macros, do not change
74197b58d2e0Smrg    ## the running order or otherwise move them around unless you know exactly
74207b58d2e0Smrg    ## what you are doing...
74217b58d2e0Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
74227b58d2e0Smrg    _LT_COMPILER_PIC($1)
74237b58d2e0Smrg    _LT_COMPILER_C_O($1)
74247b58d2e0Smrg    _LT_COMPILER_FILE_LOCKS($1)
74257b58d2e0Smrg    _LT_LINKER_SHLIBS($1)
74267b58d2e0Smrg    _LT_SYS_DYNAMIC_LINKER($1)
74277b58d2e0Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
74287b58d2e0Smrg
74297b58d2e0Smrg    _LT_CONFIG($1)
74307b58d2e0Smrg  fi # test -n "$compiler"
74317b58d2e0Smrg
74327b58d2e0Smrg  CC=$lt_save_CC
7433b12e5c03Smrg  CFLAGS=$lt_save_CFLAGS
74347b58d2e0Smrg  LDCXX=$LD
74357b58d2e0Smrg  LD=$lt_save_LD
74367b58d2e0Smrg  GCC=$lt_save_GCC
74377b58d2e0Smrg  with_gnu_ld=$lt_save_with_gnu_ld
74387b58d2e0Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
74397b58d2e0Smrg  lt_cv_path_LD=$lt_save_path_LD
74407b58d2e0Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
74417b58d2e0Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
7442f395c03eSmrgfi # test yes != "$_lt_caught_CXX_error"
744309885543Smrg
74447b58d2e0SmrgAC_LANG_POP
74457b58d2e0Smrg])# _LT_LANG_CXX_CONFIG
744609885543Smrg
744709885543Smrg
7448b12e5c03Smrg# _LT_FUNC_STRIPNAME_CNF
7449b12e5c03Smrg# ----------------------
7450b12e5c03Smrg# func_stripname_cnf prefix suffix name
7451b12e5c03Smrg# strip PREFIX and SUFFIX off of NAME.
7452b12e5c03Smrg# PREFIX and SUFFIX must not contain globbing or regex special
7453b12e5c03Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
7454b12e5c03Smrg# dot (in which case that matches only a dot).
7455b12e5c03Smrg#
7456b12e5c03Smrg# This function is identical to the (non-XSI) version of func_stripname,
7457b12e5c03Smrg# except this one can be used by m4 code that may be executed by configure,
7458b12e5c03Smrg# rather than the libtool script.
7459b12e5c03Smrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
7460b12e5c03SmrgAC_REQUIRE([_LT_DECL_SED])
7461b12e5c03SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
7462b12e5c03Smrgfunc_stripname_cnf ()
7463b12e5c03Smrg{
7464f395c03eSmrg  case @S|@2 in
7465f395c03eSmrg  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
7466f395c03eSmrg  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
7467b12e5c03Smrg  esac
7468b12e5c03Smrg} # func_stripname_cnf
7469b12e5c03Smrg])# _LT_FUNC_STRIPNAME_CNF
7470b12e5c03Smrg
7471f395c03eSmrg
74727b58d2e0Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
74737b58d2e0Smrg# ---------------------------------
74747b58d2e0Smrg# Figure out "hidden" library dependencies from verbose
74757b58d2e0Smrg# compiler output when linking a shared library.
74767b58d2e0Smrg# Parse the compiler output and extract the necessary
74777b58d2e0Smrg# objects, libraries and library flags.
74787b58d2e0Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
74797b58d2e0Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7480b12e5c03SmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
74817b58d2e0Smrg# Dependencies to place before and after the object being linked:
74827b58d2e0Smrg_LT_TAGVAR(predep_objects, $1)=
74837b58d2e0Smrg_LT_TAGVAR(postdep_objects, $1)=
74847b58d2e0Smrg_LT_TAGVAR(predeps, $1)=
74857b58d2e0Smrg_LT_TAGVAR(postdeps, $1)=
74867b58d2e0Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
748709885543Smrg
74887b58d2e0Smrgdnl we can't use the lt_simple_compile_test_code here,
74897b58d2e0Smrgdnl because it contains code intended for an executable,
74907b58d2e0Smrgdnl not a library.  It's possible we should let each
74917b58d2e0Smrgdnl tag define a new lt_????_link_test_code variable,
74927b58d2e0Smrgdnl but it's only used here...
74937b58d2e0Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
74947b58d2e0Smrgint a;
74957b58d2e0Smrgvoid foo (void) { a = 0; }
74967b58d2e0Smrg_LT_EOF
74977b58d2e0Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
74987b58d2e0Smrgclass Foo
74997b58d2e0Smrg{
75007b58d2e0Smrgpublic:
75017b58d2e0Smrg  Foo (void) { a = 0; }
75027b58d2e0Smrgprivate:
75037b58d2e0Smrg  int a;
75047b58d2e0Smrg};
75057b58d2e0Smrg_LT_EOF
75067b58d2e0Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
75077b58d2e0Smrg      subroutine foo
75087b58d2e0Smrg      implicit none
75097b58d2e0Smrg      integer*4 a
75107b58d2e0Smrg      a=0
75117b58d2e0Smrg      return
75127b58d2e0Smrg      end
75137b58d2e0Smrg_LT_EOF
75147b58d2e0Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
75157b58d2e0Smrg      subroutine foo
75167b58d2e0Smrg      implicit none
75177b58d2e0Smrg      integer a
75187b58d2e0Smrg      a=0
75197b58d2e0Smrg      return
75207b58d2e0Smrg      end
75217b58d2e0Smrg_LT_EOF
75227b58d2e0Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
75237b58d2e0Smrgpublic class foo {
75247b58d2e0Smrg  private int a;
75257b58d2e0Smrg  public void bar (void) {
75267b58d2e0Smrg    a = 0;
75277b58d2e0Smrg  }
75287b58d2e0Smrg};
75297b58d2e0Smrg_LT_EOF
7530b12e5c03Smrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
7531b12e5c03Smrgpackage foo
7532b12e5c03Smrgfunc foo() {
7533b12e5c03Smrg}
7534b12e5c03Smrg_LT_EOF
75357b58d2e0Smrg])
7536b12e5c03Smrg
7537b12e5c03Smrg_lt_libdeps_save_CFLAGS=$CFLAGS
7538b12e5c03Smrgcase "$CC $CFLAGS " in #(
7539b12e5c03Smrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
7540b12e5c03Smrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
7541b12e5c03Smrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
7542b12e5c03Smrgesac
7543b12e5c03Smrg
75447b58d2e0Smrgdnl Parse the compiler output and extract the necessary
75457b58d2e0Smrgdnl objects, libraries and library flags.
75467b58d2e0Smrgif AC_TRY_EVAL(ac_compile); then
75477b58d2e0Smrg  # Parse the compiler output and extract the necessary
75487b58d2e0Smrg  # objects, libraries and library flags.
754909885543Smrg
75507b58d2e0Smrg  # Sentinel used to keep track of whether or not we are before
75517b58d2e0Smrg  # the conftest object file.
75527b58d2e0Smrg  pre_test_object_deps_done=no
755309885543Smrg
75547b58d2e0Smrg  for p in `eval "$output_verbose_link_cmd"`; do
7555f395c03eSmrg    case $prev$p in
755609885543Smrg
75577b58d2e0Smrg    -L* | -R* | -l*)
75587b58d2e0Smrg       # Some compilers place space between "-{L,R}" and the path.
75597b58d2e0Smrg       # Remove the space.
7560f395c03eSmrg       if test x-L = "$p" ||
7561f395c03eSmrg          test x-R = "$p"; then
75627b58d2e0Smrg	 prev=$p
75637b58d2e0Smrg	 continue
75647b58d2e0Smrg       fi
756509885543Smrg
7566b12e5c03Smrg       # Expand the sysroot to ease extracting the directories later.
7567b12e5c03Smrg       if test -z "$prev"; then
7568b12e5c03Smrg         case $p in
7569b12e5c03Smrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
7570b12e5c03Smrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
7571b12e5c03Smrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
7572b12e5c03Smrg         esac
7573b12e5c03Smrg       fi
7574b12e5c03Smrg       case $p in
7575b12e5c03Smrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
7576b12e5c03Smrg       esac
7577f395c03eSmrg       if test no = "$pre_test_object_deps_done"; then
7578f395c03eSmrg	 case $prev in
7579b12e5c03Smrg	 -L | -R)
75807b58d2e0Smrg	   # Internal compiler library paths should come after those
75817b58d2e0Smrg	   # provided the user.  The postdeps already come after the
75827b58d2e0Smrg	   # user supplied libs so there is no need to process them.
75837b58d2e0Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
7584f395c03eSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
75857b58d2e0Smrg	   else
7586f395c03eSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
75877b58d2e0Smrg	   fi
75887b58d2e0Smrg	   ;;
75897b58d2e0Smrg	 # The "-l" case would never come before the object being
75907b58d2e0Smrg	 # linked, so don't bother handling this case.
75917b58d2e0Smrg	 esac
75927b58d2e0Smrg       else
75937b58d2e0Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
7594f395c03eSmrg	   _LT_TAGVAR(postdeps, $1)=$prev$p
75957b58d2e0Smrg	 else
7596f395c03eSmrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
75977b58d2e0Smrg	 fi
75987b58d2e0Smrg       fi
7599b12e5c03Smrg       prev=
76007b58d2e0Smrg       ;;
760109885543Smrg
7602b12e5c03Smrg    *.lto.$objext) ;; # Ignore GCC LTO objects
76037b58d2e0Smrg    *.$objext)
76047b58d2e0Smrg       # This assumes that the test object file only shows up
76057b58d2e0Smrg       # once in the compiler output.
76067b58d2e0Smrg       if test "$p" = "conftest.$objext"; then
76077b58d2e0Smrg	 pre_test_object_deps_done=yes
76087b58d2e0Smrg	 continue
76097b58d2e0Smrg       fi
76107b58d2e0Smrg
7611f395c03eSmrg       if test no = "$pre_test_object_deps_done"; then
76127b58d2e0Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
7613f395c03eSmrg	   _LT_TAGVAR(predep_objects, $1)=$p
76147b58d2e0Smrg	 else
76157b58d2e0Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
76167b58d2e0Smrg	 fi
76177b58d2e0Smrg       else
76187b58d2e0Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
7619f395c03eSmrg	   _LT_TAGVAR(postdep_objects, $1)=$p
76207b58d2e0Smrg	 else
76217b58d2e0Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
76227b58d2e0Smrg	 fi
76237b58d2e0Smrg       fi
76247b58d2e0Smrg       ;;
762509885543Smrg
76267b58d2e0Smrg    *) ;; # Ignore the rest.
762709885543Smrg
76287b58d2e0Smrg    esac
76297b58d2e0Smrg  done
763009885543Smrg
76317b58d2e0Smrg  # Clean up.
76327b58d2e0Smrg  rm -f a.out a.exe
76337b58d2e0Smrgelse
76347b58d2e0Smrg  echo "libtool.m4: error: problem compiling $1 test program"
76357b58d2e0Smrgfi
763609885543Smrg
76377b58d2e0Smrg$RM -f confest.$objext
7638b12e5c03SmrgCFLAGS=$_lt_libdeps_save_CFLAGS
763909885543Smrg
76407b58d2e0Smrg# PORTME: override above test on systems where it is broken
76417b58d2e0Smrgm4_if([$1], [CXX],
76427b58d2e0Smrg[case $host_os in
76437b58d2e0Smrginterix[[3-9]]*)
76447b58d2e0Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
76457b58d2e0Smrg  # hack all around it, let's just trust "g++" to DTRT.
76467b58d2e0Smrg  _LT_TAGVAR(predep_objects,$1)=
76477b58d2e0Smrg  _LT_TAGVAR(postdep_objects,$1)=
76487b58d2e0Smrg  _LT_TAGVAR(postdeps,$1)=
76497b58d2e0Smrg  ;;
76507b58d2e0Smrgesac
76517b58d2e0Smrg])
765209885543Smrg
76537b58d2e0Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
76547b58d2e0Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
76557b58d2e0Smrgesac
76567b58d2e0Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
76577b58d2e0Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
7658f395c03eSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
76597b58d2e0Smrgfi
76607b58d2e0Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
76617b58d2e0Smrg    [The directories searched by this compiler when creating a shared library])
76627b58d2e0Smrg_LT_TAGDECL([], [predep_objects], [1],
76637b58d2e0Smrg    [Dependencies to place before and after the objects being linked to
76647b58d2e0Smrg    create a shared library])
76657b58d2e0Smrg_LT_TAGDECL([], [postdep_objects], [1])
76667b58d2e0Smrg_LT_TAGDECL([], [predeps], [1])
76677b58d2e0Smrg_LT_TAGDECL([], [postdeps], [1])
76687b58d2e0Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
76697b58d2e0Smrg    [The library search path used internally by the compiler when linking
76707b58d2e0Smrg    a shared library])
76717b58d2e0Smrg])# _LT_SYS_HIDDEN_LIBDEPS
767209885543Smrg
76732ec8c4b4Smrg
76747b58d2e0Smrg# _LT_LANG_F77_CONFIG([TAG])
76757b58d2e0Smrg# --------------------------
76767b58d2e0Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
76777b58d2e0Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7678f395c03eSmrg# to write the compiler configuration to 'libtool'.
76797b58d2e0Smrgm4_defun([_LT_LANG_F77_CONFIG],
7680b12e5c03Smrg[AC_LANG_PUSH(Fortran 77)
7681f395c03eSmrgif test -z "$F77" || test no = "$F77"; then
7682b12e5c03Smrg  _lt_disable_F77=yes
7683b12e5c03Smrgfi
76847b58d2e0Smrg
76857b58d2e0Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
76867b58d2e0Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
76877b58d2e0Smrg_LT_TAGVAR(always_export_symbols, $1)=no
76887b58d2e0Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
76897b58d2e0Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
76907b58d2e0Smrg_LT_TAGVAR(hardcode_direct, $1)=no
76917b58d2e0Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
76927b58d2e0Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
76937b58d2e0Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
76947b58d2e0Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
76957b58d2e0Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
76967b58d2e0Smrg_LT_TAGVAR(inherit_rpath, $1)=no
76977b58d2e0Smrg_LT_TAGVAR(module_cmds, $1)=
76987b58d2e0Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
76997b58d2e0Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
77007b58d2e0Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7701b12e5c03Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7702b12e5c03Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
77037b58d2e0Smrg_LT_TAGVAR(no_undefined_flag, $1)=
77047b58d2e0Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
77057b58d2e0Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
770609885543Smrg
77077b58d2e0Smrg# Source file extension for f77 test sources.
77087b58d2e0Smrgac_ext=f
770909885543Smrg
77107b58d2e0Smrg# Object file extension for compiled f77 test sources.
77117b58d2e0Smrgobjext=o
77127b58d2e0Smrg_LT_TAGVAR(objext, $1)=$objext
7713e4f6584cSmrg
77147b58d2e0Smrg# No sense in running all these tests if we already determined that
77157b58d2e0Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
77167b58d2e0Smrg# are currently assumed to apply to all compilers on this platform,
77177b58d2e0Smrg# and will be corrupted by setting them based on a non-working compiler.
7718f395c03eSmrgif test yes != "$_lt_disable_F77"; then
77197b58d2e0Smrg  # Code to be used in simple compile tests
77207b58d2e0Smrg  lt_simple_compile_test_code="\
77217b58d2e0Smrg      subroutine t
77227b58d2e0Smrg      return
77237b58d2e0Smrg      end
77247b58d2e0Smrg"
772509885543Smrg
77267b58d2e0Smrg  # Code to be used in simple link tests
77277b58d2e0Smrg  lt_simple_link_test_code="\
77287b58d2e0Smrg      program t
77297b58d2e0Smrg      end
77307b58d2e0Smrg"
773109885543Smrg
77327b58d2e0Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
77337b58d2e0Smrg  _LT_TAG_COMPILER
773409885543Smrg
77357b58d2e0Smrg  # save warnings/boilerplate of simple test code
77367b58d2e0Smrg  _LT_COMPILER_BOILERPLATE
77377b58d2e0Smrg  _LT_LINKER_BOILERPLATE
773809885543Smrg
77397b58d2e0Smrg  # Allow CC to be a program name with arguments.
7740f395c03eSmrg  lt_save_CC=$CC
77417b58d2e0Smrg  lt_save_GCC=$GCC
7742b12e5c03Smrg  lt_save_CFLAGS=$CFLAGS
77437b58d2e0Smrg  CC=${F77-"f77"}
7744b12e5c03Smrg  CFLAGS=$FFLAGS
77457b58d2e0Smrg  compiler=$CC
77467b58d2e0Smrg  _LT_TAGVAR(compiler, $1)=$CC
77477b58d2e0Smrg  _LT_CC_BASENAME([$compiler])
77487b58d2e0Smrg  GCC=$G77
77497b58d2e0Smrg  if test -n "$compiler"; then
77507b58d2e0Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
77517b58d2e0Smrg    AC_MSG_RESULT([$can_build_shared])
775209885543Smrg
77537b58d2e0Smrg    AC_MSG_CHECKING([whether to build shared libraries])
7754f395c03eSmrg    test no = "$can_build_shared" && enable_shared=no
775509885543Smrg
77567b58d2e0Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
77577b58d2e0Smrg    # are all built from PIC.
77587b58d2e0Smrg    case $host_os in
77597b58d2e0Smrg      aix3*)
7760f395c03eSmrg        test yes = "$enable_shared" && enable_static=no
77617b58d2e0Smrg        if test -n "$RANLIB"; then
77627b58d2e0Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
77637b58d2e0Smrg          postinstall_cmds='$RANLIB $lib'
77647b58d2e0Smrg        fi
77657b58d2e0Smrg        ;;
77667b58d2e0Smrg      aix[[4-9]]*)
7767f395c03eSmrg	if test ia64 != "$host_cpu"; then
7768f395c03eSmrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7769f395c03eSmrg	  yes,aix,yes) ;;		# shared object as lib.so file only
7770f395c03eSmrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
7771f395c03eSmrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
7772f395c03eSmrg	  esac
77737104f784Smrg	fi
77747b58d2e0Smrg        ;;
77757b58d2e0Smrg    esac
77767b58d2e0Smrg    AC_MSG_RESULT([$enable_shared])
777709885543Smrg
77787b58d2e0Smrg    AC_MSG_CHECKING([whether to build static libraries])
77797b58d2e0Smrg    # Make sure either enable_shared or enable_static is yes.
7780f395c03eSmrg    test yes = "$enable_shared" || enable_static=yes
77817b58d2e0Smrg    AC_MSG_RESULT([$enable_static])
778209885543Smrg
7783f395c03eSmrg    _LT_TAGVAR(GCC, $1)=$G77
7784f395c03eSmrg    _LT_TAGVAR(LD, $1)=$LD
778509885543Smrg
77867b58d2e0Smrg    ## CAVEAT EMPTOR:
77877b58d2e0Smrg    ## There is no encapsulation within the following macros, do not change
77887b58d2e0Smrg    ## the running order or otherwise move them around unless you know exactly
77897b58d2e0Smrg    ## what you are doing...
77907b58d2e0Smrg    _LT_COMPILER_PIC($1)
77917b58d2e0Smrg    _LT_COMPILER_C_O($1)
77927b58d2e0Smrg    _LT_COMPILER_FILE_LOCKS($1)
77937b58d2e0Smrg    _LT_LINKER_SHLIBS($1)
77947b58d2e0Smrg    _LT_SYS_DYNAMIC_LINKER($1)
77957b58d2e0Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
779609885543Smrg
77977b58d2e0Smrg    _LT_CONFIG($1)
77987b58d2e0Smrg  fi # test -n "$compiler"
779909885543Smrg
78007b58d2e0Smrg  GCC=$lt_save_GCC
7801f395c03eSmrg  CC=$lt_save_CC
7802f395c03eSmrg  CFLAGS=$lt_save_CFLAGS
7803f395c03eSmrgfi # test yes != "$_lt_disable_F77"
78047b58d2e0Smrg
78057b58d2e0SmrgAC_LANG_POP
78067b58d2e0Smrg])# _LT_LANG_F77_CONFIG
780709885543Smrg
780809885543Smrg
78097b58d2e0Smrg# _LT_LANG_FC_CONFIG([TAG])
78107b58d2e0Smrg# -------------------------
78117b58d2e0Smrg# Ensure that the configuration variables for a Fortran compiler are
78127b58d2e0Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7813f395c03eSmrg# to write the compiler configuration to 'libtool'.
78147b58d2e0Smrgm4_defun([_LT_LANG_FC_CONFIG],
7815b12e5c03Smrg[AC_LANG_PUSH(Fortran)
7816b12e5c03Smrg
7817f395c03eSmrgif test -z "$FC" || test no = "$FC"; then
7818b12e5c03Smrg  _lt_disable_FC=yes
7819b12e5c03Smrgfi
7820e4f6584cSmrg
78217b58d2e0Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
78227b58d2e0Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
78237b58d2e0Smrg_LT_TAGVAR(always_export_symbols, $1)=no
78247b58d2e0Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
78257b58d2e0Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
78267b58d2e0Smrg_LT_TAGVAR(hardcode_direct, $1)=no
78277b58d2e0Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
78287b58d2e0Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
78297b58d2e0Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
78307b58d2e0Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
78317b58d2e0Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
78327b58d2e0Smrg_LT_TAGVAR(inherit_rpath, $1)=no
78337b58d2e0Smrg_LT_TAGVAR(module_cmds, $1)=
78347b58d2e0Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
78357b58d2e0Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
78367b58d2e0Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7837b12e5c03Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7838b12e5c03Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
78397b58d2e0Smrg_LT_TAGVAR(no_undefined_flag, $1)=
78407b58d2e0Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
78417b58d2e0Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7842e4f6584cSmrg
78437b58d2e0Smrg# Source file extension for fc test sources.
78447b58d2e0Smrgac_ext=${ac_fc_srcext-f}
7845e4f6584cSmrg
78467b58d2e0Smrg# Object file extension for compiled fc test sources.
78477b58d2e0Smrgobjext=o
78487b58d2e0Smrg_LT_TAGVAR(objext, $1)=$objext
784909885543Smrg
78507b58d2e0Smrg# No sense in running all these tests if we already determined that
78517b58d2e0Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
78527b58d2e0Smrg# are currently assumed to apply to all compilers on this platform,
78537b58d2e0Smrg# and will be corrupted by setting them based on a non-working compiler.
7854f395c03eSmrgif test yes != "$_lt_disable_FC"; then
78557b58d2e0Smrg  # Code to be used in simple compile tests
78567b58d2e0Smrg  lt_simple_compile_test_code="\
78577b58d2e0Smrg      subroutine t
78587b58d2e0Smrg      return
78597b58d2e0Smrg      end
78607b58d2e0Smrg"
786109885543Smrg
78627b58d2e0Smrg  # Code to be used in simple link tests
78637b58d2e0Smrg  lt_simple_link_test_code="\
78647b58d2e0Smrg      program t
78657b58d2e0Smrg      end
78667b58d2e0Smrg"
786709885543Smrg
78687b58d2e0Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
78697b58d2e0Smrg  _LT_TAG_COMPILER
787009885543Smrg
78717b58d2e0Smrg  # save warnings/boilerplate of simple test code
78727b58d2e0Smrg  _LT_COMPILER_BOILERPLATE
78737b58d2e0Smrg  _LT_LINKER_BOILERPLATE
78747b58d2e0Smrg
78757b58d2e0Smrg  # Allow CC to be a program name with arguments.
7876f395c03eSmrg  lt_save_CC=$CC
78777b58d2e0Smrg  lt_save_GCC=$GCC
7878b12e5c03Smrg  lt_save_CFLAGS=$CFLAGS
78797b58d2e0Smrg  CC=${FC-"f95"}
7880b12e5c03Smrg  CFLAGS=$FCFLAGS
78817b58d2e0Smrg  compiler=$CC
78827b58d2e0Smrg  GCC=$ac_cv_fc_compiler_gnu
7883e4f6584cSmrg
78847b58d2e0Smrg  _LT_TAGVAR(compiler, $1)=$CC
78857b58d2e0Smrg  _LT_CC_BASENAME([$compiler])
7886e4f6584cSmrg
78877b58d2e0Smrg  if test -n "$compiler"; then
78887b58d2e0Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
78897b58d2e0Smrg    AC_MSG_RESULT([$can_build_shared])
789009885543Smrg
78917b58d2e0Smrg    AC_MSG_CHECKING([whether to build shared libraries])
7892f395c03eSmrg    test no = "$can_build_shared" && enable_shared=no
789309885543Smrg
78947b58d2e0Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
78957b58d2e0Smrg    # are all built from PIC.
78967b58d2e0Smrg    case $host_os in
78977b58d2e0Smrg      aix3*)
7898f395c03eSmrg        test yes = "$enable_shared" && enable_static=no
78997b58d2e0Smrg        if test -n "$RANLIB"; then
79007b58d2e0Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
79017b58d2e0Smrg          postinstall_cmds='$RANLIB $lib'
79027b58d2e0Smrg        fi
79037b58d2e0Smrg        ;;
79047b58d2e0Smrg      aix[[4-9]]*)
7905f395c03eSmrg	if test ia64 != "$host_cpu"; then
7906f395c03eSmrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7907f395c03eSmrg	  yes,aix,yes) ;;		# shared object as lib.so file only
7908f395c03eSmrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
7909f395c03eSmrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
7910f395c03eSmrg	  esac
79117b58d2e0Smrg	fi
79127b58d2e0Smrg        ;;
79137b58d2e0Smrg    esac
79147b58d2e0Smrg    AC_MSG_RESULT([$enable_shared])
79157b58d2e0Smrg
79167b58d2e0Smrg    AC_MSG_CHECKING([whether to build static libraries])
79177b58d2e0Smrg    # Make sure either enable_shared or enable_static is yes.
7918f395c03eSmrg    test yes = "$enable_shared" || enable_static=yes
79197b58d2e0Smrg    AC_MSG_RESULT([$enable_static])
79207b58d2e0Smrg
7921f395c03eSmrg    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
7922f395c03eSmrg    _LT_TAGVAR(LD, $1)=$LD
79237b58d2e0Smrg
79247b58d2e0Smrg    ## CAVEAT EMPTOR:
79257b58d2e0Smrg    ## There is no encapsulation within the following macros, do not change
79267b58d2e0Smrg    ## the running order or otherwise move them around unless you know exactly
79277b58d2e0Smrg    ## what you are doing...
79287b58d2e0Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
79297b58d2e0Smrg    _LT_COMPILER_PIC($1)
79307b58d2e0Smrg    _LT_COMPILER_C_O($1)
79317b58d2e0Smrg    _LT_COMPILER_FILE_LOCKS($1)
79327b58d2e0Smrg    _LT_LINKER_SHLIBS($1)
79337b58d2e0Smrg    _LT_SYS_DYNAMIC_LINKER($1)
79347b58d2e0Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
79357b58d2e0Smrg
79367b58d2e0Smrg    _LT_CONFIG($1)
79377b58d2e0Smrg  fi # test -n "$compiler"
79387b58d2e0Smrg
79397b58d2e0Smrg  GCC=$lt_save_GCC
7940b12e5c03Smrg  CC=$lt_save_CC
7941b12e5c03Smrg  CFLAGS=$lt_save_CFLAGS
7942f395c03eSmrgfi # test yes != "$_lt_disable_FC"
79437b58d2e0Smrg
79447b58d2e0SmrgAC_LANG_POP
79457b58d2e0Smrg])# _LT_LANG_FC_CONFIG
79467b58d2e0Smrg
79477b58d2e0Smrg
79487b58d2e0Smrg# _LT_LANG_GCJ_CONFIG([TAG])
79497b58d2e0Smrg# --------------------------
79507b58d2e0Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
79517b58d2e0Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7952f395c03eSmrg# to write the compiler configuration to 'libtool'.
79537b58d2e0Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
79547b58d2e0Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
79557b58d2e0SmrgAC_LANG_SAVE
79567b58d2e0Smrg
79577b58d2e0Smrg# Source file extension for Java test sources.
79587b58d2e0Smrgac_ext=java
79597b58d2e0Smrg
79607b58d2e0Smrg# Object file extension for compiled Java test sources.
7961e4f6584cSmrgobjext=o
7962e4f6584cSmrg_LT_TAGVAR(objext, $1)=$objext
796309885543Smrg
7964e4f6584cSmrg# Code to be used in simple compile tests
79657b58d2e0Smrglt_simple_compile_test_code="class foo {}"
796609885543Smrg
7967e4f6584cSmrg# Code to be used in simple link tests
79687b58d2e0Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
796909885543Smrg
79707b58d2e0Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7971e4f6584cSmrg_LT_TAG_COMPILER
797209885543Smrg
7973e4f6584cSmrg# save warnings/boilerplate of simple test code
7974e4f6584cSmrg_LT_COMPILER_BOILERPLATE
7975e4f6584cSmrg_LT_LINKER_BOILERPLATE
797609885543Smrg
79777b58d2e0Smrg# Allow CC to be a program name with arguments.
7978b12e5c03Smrglt_save_CC=$CC
7979b12e5c03Smrglt_save_CFLAGS=$CFLAGS
79807b58d2e0Smrglt_save_GCC=$GCC
79817b58d2e0SmrgGCC=yes
79827b58d2e0SmrgCC=${GCJ-"gcj"}
7983b12e5c03SmrgCFLAGS=$GCJFLAGS
79847b58d2e0Smrgcompiler=$CC
79857b58d2e0Smrg_LT_TAGVAR(compiler, $1)=$CC
7986f395c03eSmrg_LT_TAGVAR(LD, $1)=$LD
79877b58d2e0Smrg_LT_CC_BASENAME([$compiler])
79887b58d2e0Smrg
79897b58d2e0Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
79907b58d2e0Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
79917b58d2e0Smrg
79927b58d2e0Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7993b12e5c03Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7994b12e5c03Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
79957b58d2e0Smrg
7996e4f6584cSmrgif test -n "$compiler"; then
7997e4f6584cSmrg  _LT_COMPILER_NO_RTTI($1)
7998e4f6584cSmrg  _LT_COMPILER_PIC($1)
7999e4f6584cSmrg  _LT_COMPILER_C_O($1)
8000e4f6584cSmrg  _LT_COMPILER_FILE_LOCKS($1)
8001e4f6584cSmrg  _LT_LINKER_SHLIBS($1)
8002e4f6584cSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8003e4f6584cSmrg
80047b58d2e0Smrg  _LT_CONFIG($1)
80057b58d2e0Smrgfi
8006e4f6584cSmrg
80077b58d2e0SmrgAC_LANG_RESTORE
8008e4f6584cSmrg
80097b58d2e0SmrgGCC=$lt_save_GCC
8010b12e5c03SmrgCC=$lt_save_CC
8011b12e5c03SmrgCFLAGS=$lt_save_CFLAGS
80127b58d2e0Smrg])# _LT_LANG_GCJ_CONFIG
80132ec8c4b4Smrg
8014e4f6584cSmrg
8015b12e5c03Smrg# _LT_LANG_GO_CONFIG([TAG])
8016b12e5c03Smrg# --------------------------
8017b12e5c03Smrg# Ensure that the configuration variables for the GNU Go compiler
8018b12e5c03Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8019f395c03eSmrg# to write the compiler configuration to 'libtool'.
8020b12e5c03Smrgm4_defun([_LT_LANG_GO_CONFIG],
8021b12e5c03Smrg[AC_REQUIRE([LT_PROG_GO])dnl
8022b12e5c03SmrgAC_LANG_SAVE
8023b12e5c03Smrg
8024b12e5c03Smrg# Source file extension for Go test sources.
8025b12e5c03Smrgac_ext=go
8026b12e5c03Smrg
8027b12e5c03Smrg# Object file extension for compiled Go test sources.
8028b12e5c03Smrgobjext=o
8029b12e5c03Smrg_LT_TAGVAR(objext, $1)=$objext
8030b12e5c03Smrg
8031b12e5c03Smrg# Code to be used in simple compile tests
8032b12e5c03Smrglt_simple_compile_test_code="package main; func main() { }"
8033b12e5c03Smrg
8034b12e5c03Smrg# Code to be used in simple link tests
8035b12e5c03Smrglt_simple_link_test_code='package main; func main() { }'
8036b12e5c03Smrg
8037b12e5c03Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8038b12e5c03Smrg_LT_TAG_COMPILER
8039b12e5c03Smrg
8040b12e5c03Smrg# save warnings/boilerplate of simple test code
8041b12e5c03Smrg_LT_COMPILER_BOILERPLATE
8042b12e5c03Smrg_LT_LINKER_BOILERPLATE
8043b12e5c03Smrg
8044b12e5c03Smrg# Allow CC to be a program name with arguments.
8045b12e5c03Smrglt_save_CC=$CC
8046b12e5c03Smrglt_save_CFLAGS=$CFLAGS
8047b12e5c03Smrglt_save_GCC=$GCC
8048b12e5c03SmrgGCC=yes
8049b12e5c03SmrgCC=${GOC-"gccgo"}
8050b12e5c03SmrgCFLAGS=$GOFLAGS
8051b12e5c03Smrgcompiler=$CC
8052b12e5c03Smrg_LT_TAGVAR(compiler, $1)=$CC
8053f395c03eSmrg_LT_TAGVAR(LD, $1)=$LD
8054b12e5c03Smrg_LT_CC_BASENAME([$compiler])
8055b12e5c03Smrg
8056b12e5c03Smrg# Go did not exist at the time GCC didn't implicitly link libc in.
8057b12e5c03Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8058b12e5c03Smrg
8059b12e5c03Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8060b12e5c03Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
8061b12e5c03Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8062b12e5c03Smrg
8063b12e5c03Smrgif test -n "$compiler"; then
8064b12e5c03Smrg  _LT_COMPILER_NO_RTTI($1)
8065b12e5c03Smrg  _LT_COMPILER_PIC($1)
8066b12e5c03Smrg  _LT_COMPILER_C_O($1)
8067b12e5c03Smrg  _LT_COMPILER_FILE_LOCKS($1)
8068b12e5c03Smrg  _LT_LINKER_SHLIBS($1)
8069b12e5c03Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8070b12e5c03Smrg
8071b12e5c03Smrg  _LT_CONFIG($1)
8072b12e5c03Smrgfi
8073b12e5c03Smrg
8074b12e5c03SmrgAC_LANG_RESTORE
8075b12e5c03Smrg
8076b12e5c03SmrgGCC=$lt_save_GCC
8077b12e5c03SmrgCC=$lt_save_CC
8078b12e5c03SmrgCFLAGS=$lt_save_CFLAGS
8079b12e5c03Smrg])# _LT_LANG_GO_CONFIG
8080b12e5c03Smrg
8081b12e5c03Smrg
80827b58d2e0Smrg# _LT_LANG_RC_CONFIG([TAG])
80837b58d2e0Smrg# -------------------------
80847b58d2e0Smrg# Ensure that the configuration variables for the Windows resource compiler
80857b58d2e0Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8086f395c03eSmrg# to write the compiler configuration to 'libtool'.
80877b58d2e0Smrgm4_defun([_LT_LANG_RC_CONFIG],
80887b58d2e0Smrg[AC_REQUIRE([LT_PROG_RC])dnl
80897b58d2e0SmrgAC_LANG_SAVE
809009885543Smrg
80917b58d2e0Smrg# Source file extension for RC test sources.
80927b58d2e0Smrgac_ext=rc
80937104f784Smrg
80947b58d2e0Smrg# Object file extension for compiled RC test sources.
80957b58d2e0Smrgobjext=o
80967b58d2e0Smrg_LT_TAGVAR(objext, $1)=$objext
80977104f784Smrg
80987b58d2e0Smrg# Code to be used in simple compile tests
80997b58d2e0Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
81007104f784Smrg
81017b58d2e0Smrg# Code to be used in simple link tests
8102f395c03eSmrglt_simple_link_test_code=$lt_simple_compile_test_code
81037104f784Smrg
81047b58d2e0Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
81057b58d2e0Smrg_LT_TAG_COMPILER
8106e4f6584cSmrg
81077b58d2e0Smrg# save warnings/boilerplate of simple test code
81087b58d2e0Smrg_LT_COMPILER_BOILERPLATE
81097b58d2e0Smrg_LT_LINKER_BOILERPLATE
8110e4f6584cSmrg
81117b58d2e0Smrg# Allow CC to be a program name with arguments.
8112f395c03eSmrglt_save_CC=$CC
8113b12e5c03Smrglt_save_CFLAGS=$CFLAGS
81147b58d2e0Smrglt_save_GCC=$GCC
81157b58d2e0SmrgGCC=
81167b58d2e0SmrgCC=${RC-"windres"}
8117b12e5c03SmrgCFLAGS=
81187b58d2e0Smrgcompiler=$CC
81197b58d2e0Smrg_LT_TAGVAR(compiler, $1)=$CC
81207b58d2e0Smrg_LT_CC_BASENAME([$compiler])
81217b58d2e0Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8122e4f6584cSmrg
81237b58d2e0Smrgif test -n "$compiler"; then
81247b58d2e0Smrg  :
81257b58d2e0Smrg  _LT_CONFIG($1)
81267b58d2e0Smrgfi
81277b58d2e0Smrg
81287b58d2e0SmrgGCC=$lt_save_GCC
81297b58d2e0SmrgAC_LANG_RESTORE
8130b12e5c03SmrgCC=$lt_save_CC
8131b12e5c03SmrgCFLAGS=$lt_save_CFLAGS
81327b58d2e0Smrg])# _LT_LANG_RC_CONFIG
81337b58d2e0Smrg
81347b58d2e0Smrg
81357b58d2e0Smrg# LT_PROG_GCJ
81367b58d2e0Smrg# -----------
81377b58d2e0SmrgAC_DEFUN([LT_PROG_GCJ],
81387b58d2e0Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
81397b58d2e0Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
81407b58d2e0Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
8141f395c03eSmrg      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
81427b58d2e0Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
81437b58d2e0Smrg])
81447b58d2e0Smrg
81457b58d2e0Smrg# Old name:
81467b58d2e0SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
81477b58d2e0Smrgdnl aclocal-1.4 backwards compatibility:
81487b58d2e0Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8149e4f6584cSmrg
8150e4f6584cSmrg
8151b12e5c03Smrg# LT_PROG_GO
8152b12e5c03Smrg# ----------
8153b12e5c03SmrgAC_DEFUN([LT_PROG_GO],
8154b12e5c03Smrg[AC_CHECK_TOOL(GOC, gccgo,)
8155b12e5c03Smrg])
8156b12e5c03Smrg
8157b12e5c03Smrg
81587b58d2e0Smrg# LT_PROG_RC
81597b58d2e0Smrg# ----------
81607b58d2e0SmrgAC_DEFUN([LT_PROG_RC],
81617b58d2e0Smrg[AC_CHECK_TOOL(RC, windres,)
81627b58d2e0Smrg])
8163e4f6584cSmrg
81647b58d2e0Smrg# Old name:
81657b58d2e0SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
81667b58d2e0Smrgdnl aclocal-1.4 backwards compatibility:
81677b58d2e0Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
8168e4f6584cSmrg
8169e4f6584cSmrg
81707b58d2e0Smrg# _LT_DECL_EGREP
81717b58d2e0Smrg# --------------
81727b58d2e0Smrg# If we don't have a new enough Autoconf to choose the best grep
81737b58d2e0Smrg# available, choose the one first in the user's PATH.
81747b58d2e0Smrgm4_defun([_LT_DECL_EGREP],
81757b58d2e0Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
81767b58d2e0SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
81777b58d2e0Smrgtest -z "$GREP" && GREP=grep
81787b58d2e0Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
81797b58d2e0Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
81807b58d2e0Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
81817b58d2e0Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
81827b58d2e0SmrgAC_SUBST([GREP])
81837b58d2e0Smrg])
8184e4f6584cSmrg
8185e4f6584cSmrg
81867b58d2e0Smrg# _LT_DECL_OBJDUMP
81877b58d2e0Smrg# --------------
81887b58d2e0Smrg# If we don't have a new enough Autoconf to choose the best objdump
81897b58d2e0Smrg# available, choose the one first in the user's PATH.
81907b58d2e0Smrgm4_defun([_LT_DECL_OBJDUMP],
81917b58d2e0Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
81927b58d2e0Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
81937b58d2e0Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
81947b58d2e0SmrgAC_SUBST([OBJDUMP])
81957b58d2e0Smrg])
81962ec8c4b4Smrg
8197b12e5c03Smrg# _LT_DECL_DLLTOOL
8198b12e5c03Smrg# ----------------
8199b12e5c03Smrg# Ensure DLLTOOL variable is set.
8200b12e5c03Smrgm4_defun([_LT_DECL_DLLTOOL],
8201b12e5c03Smrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8202b12e5c03Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
8203b12e5c03Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
8204b12e5c03SmrgAC_SUBST([DLLTOOL])
8205b12e5c03Smrg])
820609885543Smrg
82077b58d2e0Smrg# _LT_DECL_SED
82087b58d2e0Smrg# ------------
82097b58d2e0Smrg# Check for a fully-functional sed program, that truncates
82107b58d2e0Smrg# as few characters as possible.  Prefer GNU sed if found.
82117b58d2e0Smrgm4_defun([_LT_DECL_SED],
82127b58d2e0Smrg[AC_PROG_SED
82137b58d2e0Smrgtest -z "$SED" && SED=sed
82147b58d2e0SmrgXsed="$SED -e 1s/^X//"
82157b58d2e0Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
82167b58d2e0Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
82177b58d2e0Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
82187b58d2e0Smrg])# _LT_DECL_SED
821909885543Smrg
82207b58d2e0Smrgm4_ifndef([AC_PROG_SED], [
82217b58d2e0Smrg# NOTE: This macro has been submitted for inclusion into   #
82227b58d2e0Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
82237b58d2e0Smrg#  a released version of Autoconf we should remove this    #
82247b58d2e0Smrg#  macro and use it instead.                               #
822509885543Smrg
82267b58d2e0Smrgm4_defun([AC_PROG_SED],
82277b58d2e0Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
82287b58d2e0SmrgAC_CACHE_VAL(lt_cv_path_SED,
82297b58d2e0Smrg[# Loop through the user's path and test for sed and gsed.
82307b58d2e0Smrg# Then use that list of sed's as ones to test for truncation.
82317b58d2e0Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
82327b58d2e0Smrgfor as_dir in $PATH
82337b58d2e0Smrgdo
82347b58d2e0Smrg  IFS=$as_save_IFS
82357b58d2e0Smrg  test -z "$as_dir" && as_dir=.
82367b58d2e0Smrg  for lt_ac_prog in sed gsed; do
82377b58d2e0Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
82387b58d2e0Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
82397b58d2e0Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
82407b58d2e0Smrg      fi
82417b58d2e0Smrg    done
82427b58d2e0Smrg  done
82437b58d2e0Smrgdone
82447b58d2e0SmrgIFS=$as_save_IFS
82457b58d2e0Smrglt_ac_max=0
82467b58d2e0Smrglt_ac_count=0
82477b58d2e0Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
82487b58d2e0Smrg# along with /bin/sed that truncates output.
82497b58d2e0Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8250f395c03eSmrg  test ! -f "$lt_ac_sed" && continue
82517b58d2e0Smrg  cat /dev/null > conftest.in
82527b58d2e0Smrg  lt_ac_count=0
82537b58d2e0Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
82547b58d2e0Smrg  # Check for GNU sed and select it if it is found.
82557b58d2e0Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
82567b58d2e0Smrg    lt_cv_path_SED=$lt_ac_sed
82577b58d2e0Smrg    break
82587b58d2e0Smrg  fi
82597b58d2e0Smrg  while true; do
82607b58d2e0Smrg    cat conftest.in conftest.in >conftest.tmp
82617b58d2e0Smrg    mv conftest.tmp conftest.in
82627b58d2e0Smrg    cp conftest.in conftest.nl
82637b58d2e0Smrg    echo >>conftest.nl
82647b58d2e0Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
82657b58d2e0Smrg    cmp -s conftest.out conftest.nl || break
82667b58d2e0Smrg    # 10000 chars as input seems more than enough
8267f395c03eSmrg    test 10 -lt "$lt_ac_count" && break
82687b58d2e0Smrg    lt_ac_count=`expr $lt_ac_count + 1`
8269f395c03eSmrg    if test "$lt_ac_count" -gt "$lt_ac_max"; then
82707b58d2e0Smrg      lt_ac_max=$lt_ac_count
82717b58d2e0Smrg      lt_cv_path_SED=$lt_ac_sed
82727b58d2e0Smrg    fi
82737b58d2e0Smrg  done
82747b58d2e0Smrgdone
82757b58d2e0Smrg])
82767b58d2e0SmrgSED=$lt_cv_path_SED
82777b58d2e0SmrgAC_SUBST([SED])
82787b58d2e0SmrgAC_MSG_RESULT([$SED])
82797b58d2e0Smrg])#AC_PROG_SED
82807b58d2e0Smrg])#m4_ifndef
828109885543Smrg
82827b58d2e0Smrg# Old name:
82837b58d2e0SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
82847b58d2e0Smrgdnl aclocal-1.4 backwards compatibility:
82857b58d2e0Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
828609885543Smrg
8287e4f6584cSmrg
82887b58d2e0Smrg# _LT_CHECK_SHELL_FEATURES
82897b58d2e0Smrg# ------------------------
82907b58d2e0Smrg# Find out whether the shell is Bourne or XSI compatible,
82917b58d2e0Smrg# or has some other useful features.
82927b58d2e0Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
8293f395c03eSmrg[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
82947b58d2e0Smrg  lt_unset=unset
82957b58d2e0Smrgelse
82967b58d2e0Smrg  lt_unset=false
82977b58d2e0Smrgfi
82987b58d2e0Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8299e4f6584cSmrg
8300b12e5c03Smrg# test EBCDIC or ASCII
8301b12e5c03Smrgcase `echo X|tr X '\101'` in
8302b12e5c03Smrg A) # ASCII based system
8303b12e5c03Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8304b12e5c03Smrg  lt_SP2NL='tr \040 \012'
8305b12e5c03Smrg  lt_NL2SP='tr \015\012 \040\040'
8306b12e5c03Smrg  ;;
8307b12e5c03Smrg *) # EBCDIC based system
8308b12e5c03Smrg  lt_SP2NL='tr \100 \n'
8309b12e5c03Smrg  lt_NL2SP='tr \r\n \100\100'
8310b12e5c03Smrg  ;;
8311b12e5c03Smrgesac
8312b12e5c03Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8313b12e5c03Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8314b12e5c03Smrg])# _LT_CHECK_SHELL_FEATURES
83157b58d2e0Smrg
83167b58d2e0Smrg
8317b12e5c03Smrg# _LT_PATH_CONVERSION_FUNCTIONS
8318b12e5c03Smrg# -----------------------------
8319f395c03eSmrg# Determine what file name conversion functions should be used by
8320b12e5c03Smrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
8321b12e5c03Smrg# for certain cross-compile configurations and native mingw.
8322b12e5c03Smrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
8323b12e5c03Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8324b12e5c03SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
8325b12e5c03SmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
8326b12e5c03SmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
8327b12e5c03Smrg[case $host in
8328b12e5c03Smrg  *-*-mingw* )
8329b12e5c03Smrg    case $build in
8330b12e5c03Smrg      *-*-mingw* ) # actually msys
8331b12e5c03Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
8332b12e5c03Smrg        ;;
8333b12e5c03Smrg      *-*-cygwin* )
8334b12e5c03Smrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
8335b12e5c03Smrg        ;;
8336b12e5c03Smrg      * ) # otherwise, assume *nix
8337b12e5c03Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
8338b12e5c03Smrg        ;;
8339b12e5c03Smrg    esac
83407b58d2e0Smrg    ;;
8341b12e5c03Smrg  *-*-cygwin* )
8342b12e5c03Smrg    case $build in
8343b12e5c03Smrg      *-*-mingw* ) # actually msys
8344b12e5c03Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
8345b12e5c03Smrg        ;;
8346b12e5c03Smrg      *-*-cygwin* )
8347b12e5c03Smrg        lt_cv_to_host_file_cmd=func_convert_file_noop
8348b12e5c03Smrg        ;;
8349b12e5c03Smrg      * ) # otherwise, assume *nix
8350b12e5c03Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
8351b12e5c03Smrg        ;;
8352b12e5c03Smrg    esac
8353b12e5c03Smrg    ;;
8354b12e5c03Smrg  * ) # unhandled hosts (and "normal" native builds)
8355b12e5c03Smrg    lt_cv_to_host_file_cmd=func_convert_file_noop
8356b12e5c03Smrg    ;;
8357b12e5c03Smrgesac
8358b12e5c03Smrg])
8359b12e5c03Smrgto_host_file_cmd=$lt_cv_to_host_file_cmd
8360b12e5c03SmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
8361b12e5c03Smrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
8362b12e5c03Smrg         [0], [convert $build file names to $host format])dnl
8363b12e5c03Smrg
8364b12e5c03SmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
8365b12e5c03SmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
8366b12e5c03Smrg[#assume ordinary cross tools, or native build.
8367b12e5c03Smrglt_cv_to_tool_file_cmd=func_convert_file_noop
8368b12e5c03Smrgcase $host in
8369b12e5c03Smrg  *-*-mingw* )
8370b12e5c03Smrg    case $build in
8371b12e5c03Smrg      *-*-mingw* ) # actually msys
8372b12e5c03Smrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
8373b12e5c03Smrg        ;;
8374b12e5c03Smrg    esac
8375b12e5c03Smrg    ;;
8376b12e5c03Smrgesac
83777b58d2e0Smrg])
8378b12e5c03Smrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
8379b12e5c03SmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
8380b12e5c03Smrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
8381b12e5c03Smrg         [0], [convert $build files to toolchain format])dnl
8382b12e5c03Smrg])# _LT_PATH_CONVERSION_FUNCTIONS
838309885543Smrg
83847b58d2e0Smrg# Helper functions for option handling.                    -*- Autoconf -*-
83857b58d2e0Smrg#
8386f395c03eSmrg#   Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
8387f395c03eSmrg#   Foundation, Inc.
83887b58d2e0Smrg#   Written by Gary V. Vaughan, 2004
83897b58d2e0Smrg#
83907b58d2e0Smrg# This file is free software; the Free Software Foundation gives
83917b58d2e0Smrg# unlimited permission to copy and/or distribute it, with or without
83927b58d2e0Smrg# modifications, as long as this notice is preserved.
8393e4f6584cSmrg
8394f395c03eSmrg# serial 8 ltoptions.m4
8395e4f6584cSmrg
83967b58d2e0Smrg# This is to help aclocal find these macros, as it can't see m4_define.
83977b58d2e0SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
8398e4f6584cSmrg
839909885543Smrg
84007b58d2e0Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
84017b58d2e0Smrg# ------------------------------------------
84027b58d2e0Smrgm4_define([_LT_MANGLE_OPTION],
84037b58d2e0Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
840409885543Smrg
840509885543Smrg
84067b58d2e0Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
84077b58d2e0Smrg# ---------------------------------------
84087b58d2e0Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
84097b58d2e0Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
84107b58d2e0Smrg# saved as a flag.
84117b58d2e0Smrgm4_define([_LT_SET_OPTION],
84127b58d2e0Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
84137b58d2e0Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
84147b58d2e0Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
8415f395c03eSmrg    [m4_warning([Unknown $1 option '$2'])])[]dnl
84167b58d2e0Smrg])
8417e4f6584cSmrg
8418e4f6584cSmrg
84197b58d2e0Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
84207b58d2e0Smrg# ------------------------------------------------------------
84217b58d2e0Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
84227b58d2e0Smrgm4_define([_LT_IF_OPTION],
84237b58d2e0Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
842409885543Smrg
842509885543Smrg
84267b58d2e0Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
84277b58d2e0Smrg# -------------------------------------------------------
84287b58d2e0Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
84297b58d2e0Smrg# are set.
84307b58d2e0Smrgm4_define([_LT_UNLESS_OPTIONS],
84317b58d2e0Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
84327b58d2e0Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
84337b58d2e0Smrg		      [m4_define([$0_found])])])[]dnl
84347b58d2e0Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
84357b58d2e0Smrg])[]dnl
84367b58d2e0Smrg])
843709885543Smrg
8438e4f6584cSmrg
84397b58d2e0Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
84407b58d2e0Smrg# ----------------------------------------
84417b58d2e0Smrg# OPTION-LIST is a space-separated list of Libtool options associated
84427b58d2e0Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
84437b58d2e0Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
84447b58d2e0Smrg# the unknown option and exit.
84457b58d2e0Smrgm4_defun([_LT_SET_OPTIONS],
84467b58d2e0Smrg[# Set options
84477b58d2e0Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
84487b58d2e0Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
844909885543Smrg
84507b58d2e0Smrgm4_if([$1],[LT_INIT],[
84517b58d2e0Smrg  dnl
84527b58d2e0Smrg  dnl Simply set some default values (i.e off) if boolean options were not
84537b58d2e0Smrg  dnl specified:
84547b58d2e0Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
84557b58d2e0Smrg  ])
84567b58d2e0Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
84577b58d2e0Smrg  ])
84587b58d2e0Smrg  dnl
84597b58d2e0Smrg  dnl If no reference was made to various pairs of opposing options, then
84607b58d2e0Smrg  dnl we run the default mode handler for the pair.  For example, if neither
8461f395c03eSmrg  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
84627b58d2e0Smrg  dnl archives by default:
84637b58d2e0Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
84647b58d2e0Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
84657b58d2e0Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
84667b58d2e0Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
8467f395c03eSmrg		   [_LT_ENABLE_FAST_INSTALL])
8468f395c03eSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
8469f395c03eSmrg		   [_LT_WITH_AIX_SONAME([aix])])
84707b58d2e0Smrg  ])
84717b58d2e0Smrg])# _LT_SET_OPTIONS
847209885543Smrg
847309885543Smrg
847409885543Smrg
84757b58d2e0Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
84767b58d2e0Smrg# -----------------------------------------
84777b58d2e0Smrgm4_define([_LT_MANGLE_DEFUN],
84787b58d2e0Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
84797b58d2e0Smrg
84807b58d2e0Smrg
84817b58d2e0Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
84827b58d2e0Smrg# -----------------------------------------------
84837b58d2e0Smrgm4_define([LT_OPTION_DEFINE],
84847b58d2e0Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
84857b58d2e0Smrg])# LT_OPTION_DEFINE
84867b58d2e0Smrg
84877b58d2e0Smrg
84887b58d2e0Smrg# dlopen
84897b58d2e0Smrg# ------
84907b58d2e0SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
84917b58d2e0Smrg])
8492e4f6584cSmrg
84937b58d2e0SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
84947b58d2e0Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
84957b58d2e0SmrgAC_DIAGNOSE([obsolete],
84967b58d2e0Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8497f395c03eSmrgput the 'dlopen' option into LT_INIT's first parameter.])
84987b58d2e0Smrg])
8499e4f6584cSmrg
85007b58d2e0Smrgdnl aclocal-1.4 backwards compatibility:
85017b58d2e0Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
8502e4f6584cSmrg
8503e4f6584cSmrg
85047b58d2e0Smrg# win32-dll
85057b58d2e0Smrg# ---------
85067b58d2e0Smrg# Declare package support for building win32 dll's.
85077b58d2e0SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
85087b58d2e0Smrg[enable_win32_dll=yes
8509e4f6584cSmrg
85107b58d2e0Smrgcase $host in
8511b12e5c03Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
85127b58d2e0Smrg  AC_CHECK_TOOL(AS, as, false)
85137b58d2e0Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
85147b58d2e0Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
85157b58d2e0Smrg  ;;
85167b58d2e0Smrgesac
8517e4f6584cSmrg
85187b58d2e0Smrgtest -z "$AS" && AS=as
8519b12e5c03Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
8520e4f6584cSmrg
85217b58d2e0Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
8522b12e5c03Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
8523e4f6584cSmrg
85247b58d2e0Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
8525b12e5c03Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
85267b58d2e0Smrg])# win32-dll
8527e4f6584cSmrg
85287b58d2e0SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
85297b58d2e0Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
85307b58d2e0Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
85317b58d2e0SmrgAC_DIAGNOSE([obsolete],
85327b58d2e0Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8533f395c03eSmrgput the 'win32-dll' option into LT_INIT's first parameter.])
85347b58d2e0Smrg])
8535e4f6584cSmrg
85367b58d2e0Smrgdnl aclocal-1.4 backwards compatibility:
85377b58d2e0Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
8538e4f6584cSmrg
8539e4f6584cSmrg
85407b58d2e0Smrg# _LT_ENABLE_SHARED([DEFAULT])
85417b58d2e0Smrg# ----------------------------
8542f395c03eSmrg# implement the --enable-shared flag, and supports the 'shared' and
8543f395c03eSmrg# 'disable-shared' LT_INIT options.
8544f395c03eSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
85457b58d2e0Smrgm4_define([_LT_ENABLE_SHARED],
85467b58d2e0Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
85477b58d2e0SmrgAC_ARG_ENABLE([shared],
85487b58d2e0Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
85497b58d2e0Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
85507b58d2e0Smrg    [p=${PACKAGE-default}
85517b58d2e0Smrg    case $enableval in
85527b58d2e0Smrg    yes) enable_shared=yes ;;
85537b58d2e0Smrg    no) enable_shared=no ;;
85547b58d2e0Smrg    *)
85557b58d2e0Smrg      enable_shared=no
85567b58d2e0Smrg      # Look at the argument we got.  We use all the common list separators.
8557f395c03eSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
85587b58d2e0Smrg      for pkg in $enableval; do
8559f395c03eSmrg	IFS=$lt_save_ifs
85607b58d2e0Smrg	if test "X$pkg" = "X$p"; then
85617b58d2e0Smrg	  enable_shared=yes
85627b58d2e0Smrg	fi
85637b58d2e0Smrg      done
8564f395c03eSmrg      IFS=$lt_save_ifs
85657b58d2e0Smrg      ;;
85667b58d2e0Smrg    esac],
85677b58d2e0Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
8568e4f6584cSmrg
85697b58d2e0Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
85707b58d2e0Smrg	[Whether or not to build shared libraries])
85717b58d2e0Smrg])# _LT_ENABLE_SHARED
8572e4f6584cSmrg
85737b58d2e0SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
85747b58d2e0SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
8575e4f6584cSmrg
85767b58d2e0Smrg# Old names:
85777b58d2e0SmrgAC_DEFUN([AC_ENABLE_SHARED],
85787b58d2e0Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
85797b58d2e0Smrg])
8580e4f6584cSmrg
85817b58d2e0SmrgAC_DEFUN([AC_DISABLE_SHARED],
85827b58d2e0Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
85837b58d2e0Smrg])
8584e4f6584cSmrg
85857b58d2e0SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
85867b58d2e0SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
85877b58d2e0Smrg
85887b58d2e0Smrgdnl aclocal-1.4 backwards compatibility:
85897b58d2e0Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
85907b58d2e0Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
8591e4f6584cSmrg
8592e4f6584cSmrg
8593e4f6584cSmrg
85947b58d2e0Smrg# _LT_ENABLE_STATIC([DEFAULT])
85957b58d2e0Smrg# ----------------------------
8596f395c03eSmrg# implement the --enable-static flag, and support the 'static' and
8597f395c03eSmrg# 'disable-static' LT_INIT options.
8598f395c03eSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
85997b58d2e0Smrgm4_define([_LT_ENABLE_STATIC],
86007b58d2e0Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
86017b58d2e0SmrgAC_ARG_ENABLE([static],
86027b58d2e0Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
86037b58d2e0Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
86047b58d2e0Smrg    [p=${PACKAGE-default}
86057b58d2e0Smrg    case $enableval in
86067b58d2e0Smrg    yes) enable_static=yes ;;
86077b58d2e0Smrg    no) enable_static=no ;;
86087b58d2e0Smrg    *)
86097b58d2e0Smrg     enable_static=no
86107b58d2e0Smrg      # Look at the argument we got.  We use all the common list separators.
8611f395c03eSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
86127b58d2e0Smrg      for pkg in $enableval; do
8613f395c03eSmrg	IFS=$lt_save_ifs
86147b58d2e0Smrg	if test "X$pkg" = "X$p"; then
86157b58d2e0Smrg	  enable_static=yes
86167b58d2e0Smrg	fi
86177b58d2e0Smrg      done
8618f395c03eSmrg      IFS=$lt_save_ifs
8619e4f6584cSmrg      ;;
86207b58d2e0Smrg    esac],
86217b58d2e0Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
862209885543Smrg
86237b58d2e0Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
86247b58d2e0Smrg	[Whether or not to build static libraries])
86257b58d2e0Smrg])# _LT_ENABLE_STATIC
862609885543Smrg
86277b58d2e0SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
86287b58d2e0SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
862909885543Smrg
86307b58d2e0Smrg# Old names:
86317b58d2e0SmrgAC_DEFUN([AC_ENABLE_STATIC],
86327b58d2e0Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
86337b58d2e0Smrg])
863409885543Smrg
86357b58d2e0SmrgAC_DEFUN([AC_DISABLE_STATIC],
86367b58d2e0Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
86377b58d2e0Smrg])
863809885543Smrg
86397b58d2e0SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
86407b58d2e0SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
864109885543Smrg
86427b58d2e0Smrgdnl aclocal-1.4 backwards compatibility:
86437b58d2e0Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
86447b58d2e0Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
8645e4f6584cSmrg
8646e4f6584cSmrg
8647e4f6584cSmrg
86487b58d2e0Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
86497b58d2e0Smrg# ----------------------------------
8650f395c03eSmrg# implement the --enable-fast-install flag, and support the 'fast-install'
8651f395c03eSmrg# and 'disable-fast-install' LT_INIT options.
8652f395c03eSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
86537b58d2e0Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
86547b58d2e0Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
86557b58d2e0SmrgAC_ARG_ENABLE([fast-install],
86567b58d2e0Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
86577b58d2e0Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
86587b58d2e0Smrg    [p=${PACKAGE-default}
86597b58d2e0Smrg    case $enableval in
86607b58d2e0Smrg    yes) enable_fast_install=yes ;;
86617b58d2e0Smrg    no) enable_fast_install=no ;;
86627b58d2e0Smrg    *)
86637b58d2e0Smrg      enable_fast_install=no
86647b58d2e0Smrg      # Look at the argument we got.  We use all the common list separators.
8665f395c03eSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
86667b58d2e0Smrg      for pkg in $enableval; do
8667f395c03eSmrg	IFS=$lt_save_ifs
86687b58d2e0Smrg	if test "X$pkg" = "X$p"; then
86697b58d2e0Smrg	  enable_fast_install=yes
86707b58d2e0Smrg	fi
86717b58d2e0Smrg      done
8672f395c03eSmrg      IFS=$lt_save_ifs
86737b58d2e0Smrg      ;;
86747b58d2e0Smrg    esac],
86757b58d2e0Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
8676e4f6584cSmrg
86777b58d2e0Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
86787b58d2e0Smrg	 [Whether or not to optimize for fast installation])dnl
86797b58d2e0Smrg])# _LT_ENABLE_FAST_INSTALL
868009885543Smrg
86817b58d2e0SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
86827b58d2e0SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
868309885543Smrg
86847b58d2e0Smrg# Old names:
86857b58d2e0SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
86867b58d2e0Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
86877b58d2e0SmrgAC_DIAGNOSE([obsolete],
86887b58d2e0Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8689f395c03eSmrgthe 'fast-install' option into LT_INIT's first parameter.])
86907b58d2e0Smrg])
869109885543Smrg
86927b58d2e0SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
86937b58d2e0Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
86947b58d2e0SmrgAC_DIAGNOSE([obsolete],
86957b58d2e0Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8696f395c03eSmrgthe 'disable-fast-install' option into LT_INIT's first parameter.])
86977b58d2e0Smrg])
869809885543Smrg
86997b58d2e0Smrgdnl aclocal-1.4 backwards compatibility:
87007b58d2e0Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
87017b58d2e0Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
87027b58d2e0Smrg
87037b58d2e0Smrg
8704f395c03eSmrg# _LT_WITH_AIX_SONAME([DEFAULT])
8705f395c03eSmrg# ----------------------------------
8706f395c03eSmrg# implement the --with-aix-soname flag, and support the `aix-soname=aix'
8707f395c03eSmrg# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
8708f395c03eSmrg# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
8709f395c03eSmrgm4_define([_LT_WITH_AIX_SONAME],
8710f395c03eSmrg[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
8711f395c03eSmrgshared_archive_member_spec=
8712f395c03eSmrgcase $host,$enable_shared in
8713f395c03eSmrgpower*-*-aix[[5-9]]*,yes)
8714f395c03eSmrg  AC_MSG_CHECKING([which variant of shared library versioning to provide])
8715f395c03eSmrg  AC_ARG_WITH([aix-soname],
8716f395c03eSmrg    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
8717f395c03eSmrg      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
8718f395c03eSmrg    [case $withval in
8719f395c03eSmrg    aix|svr4|both)
8720f395c03eSmrg      ;;
8721f395c03eSmrg    *)
8722f395c03eSmrg      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
8723f395c03eSmrg      ;;
8724f395c03eSmrg    esac
8725f395c03eSmrg    lt_cv_with_aix_soname=$with_aix_soname],
8726f395c03eSmrg    [AC_CACHE_VAL([lt_cv_with_aix_soname],
8727f395c03eSmrg      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
8728f395c03eSmrg    with_aix_soname=$lt_cv_with_aix_soname])
8729f395c03eSmrg  AC_MSG_RESULT([$with_aix_soname])
8730f395c03eSmrg  if test aix != "$with_aix_soname"; then
8731f395c03eSmrg    # For the AIX way of multilib, we name the shared archive member
8732f395c03eSmrg    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
8733f395c03eSmrg    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
8734f395c03eSmrg    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
8735f395c03eSmrg    # the AIX toolchain works better with OBJECT_MODE set (default 32).
8736f395c03eSmrg    if test 64 = "${OBJECT_MODE-32}"; then
8737f395c03eSmrg      shared_archive_member_spec=shr_64
8738f395c03eSmrg    else
8739f395c03eSmrg      shared_archive_member_spec=shr
8740f395c03eSmrg    fi
8741f395c03eSmrg  fi
8742f395c03eSmrg  ;;
8743f395c03eSmrg*)
8744f395c03eSmrg  with_aix_soname=aix
8745f395c03eSmrg  ;;
8746f395c03eSmrgesac
8747f395c03eSmrg
8748f395c03eSmrg_LT_DECL([], [shared_archive_member_spec], [0],
8749f395c03eSmrg    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
8750f395c03eSmrg])# _LT_WITH_AIX_SONAME
8751f395c03eSmrg
8752f395c03eSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
8753f395c03eSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
8754f395c03eSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
8755f395c03eSmrg
8756f395c03eSmrg
87577b58d2e0Smrg# _LT_WITH_PIC([MODE])
87587b58d2e0Smrg# --------------------
8759f395c03eSmrg# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
87607b58d2e0Smrg# LT_INIT options.
8761f395c03eSmrg# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
87627b58d2e0Smrgm4_define([_LT_WITH_PIC],
87637b58d2e0Smrg[AC_ARG_WITH([pic],
8764b12e5c03Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
87657b58d2e0Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
8766b12e5c03Smrg    [lt_p=${PACKAGE-default}
8767b12e5c03Smrg    case $withval in
8768b12e5c03Smrg    yes|no) pic_mode=$withval ;;
8769b12e5c03Smrg    *)
8770b12e5c03Smrg      pic_mode=default
8771b12e5c03Smrg      # Look at the argument we got.  We use all the common list separators.
8772f395c03eSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8773b12e5c03Smrg      for lt_pkg in $withval; do
8774f395c03eSmrg	IFS=$lt_save_ifs
8775b12e5c03Smrg	if test "X$lt_pkg" = "X$lt_p"; then
8776b12e5c03Smrg	  pic_mode=yes
8777b12e5c03Smrg	fi
8778b12e5c03Smrg      done
8779f395c03eSmrg      IFS=$lt_save_ifs
8780b12e5c03Smrg      ;;
8781b12e5c03Smrg    esac],
8782f395c03eSmrg    [pic_mode=m4_default([$1], [default])])
87837b58d2e0Smrg
87847b58d2e0Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
87857b58d2e0Smrg])# _LT_WITH_PIC
87867b58d2e0Smrg
87877b58d2e0SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
87887b58d2e0SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
87897b58d2e0Smrg
87907b58d2e0Smrg# Old name:
87917b58d2e0SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
87927b58d2e0Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
87937b58d2e0SmrgAC_DIAGNOSE([obsolete],
87947b58d2e0Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8795f395c03eSmrgput the 'pic-only' option into LT_INIT's first parameter.])
8796e4f6584cSmrg])
879709885543Smrg
87987b58d2e0Smrgdnl aclocal-1.4 backwards compatibility:
87997b58d2e0Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
880009885543Smrg
880109885543Smrg
88027b58d2e0Smrgm4_define([_LTDL_MODE], [])
88037b58d2e0SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
88047b58d2e0Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
88057b58d2e0SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
88067b58d2e0Smrg		 [m4_define([_LTDL_MODE], [recursive])])
88077b58d2e0SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
88087b58d2e0Smrg		 [m4_define([_LTDL_MODE], [subproject])])
880909885543Smrg
88107b58d2e0Smrgm4_define([_LTDL_TYPE], [])
88117b58d2e0SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
88127b58d2e0Smrg		 [m4_define([_LTDL_TYPE], [installable])])
88137b58d2e0SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
88147b58d2e0Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
881509885543Smrg
88167b58d2e0Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
88177b58d2e0Smrg#
8818f395c03eSmrg# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
8819f395c03eSmrg# Foundation, Inc.
88207b58d2e0Smrg# Written by Gary V. Vaughan, 2004
88217b58d2e0Smrg#
88227b58d2e0Smrg# This file is free software; the Free Software Foundation gives
88237b58d2e0Smrg# unlimited permission to copy and/or distribute it, with or without
88247b58d2e0Smrg# modifications, as long as this notice is preserved.
882509885543Smrg
88267b58d2e0Smrg# serial 6 ltsugar.m4
882709885543Smrg
88287b58d2e0Smrg# This is to help aclocal find these macros, as it can't see m4_define.
88297b58d2e0SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
883009885543Smrg
8831e4f6584cSmrg
88327b58d2e0Smrg# lt_join(SEP, ARG1, [ARG2...])
88337b58d2e0Smrg# -----------------------------
88347b58d2e0Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
88357b58d2e0Smrg# associated separator.
88367b58d2e0Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
88377b58d2e0Smrg# versions in m4sugar had bugs.
88387b58d2e0Smrgm4_define([lt_join],
88397b58d2e0Smrg[m4_if([$#], [1], [],
88407b58d2e0Smrg       [$#], [2], [[$2]],
88417b58d2e0Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
88427b58d2e0Smrgm4_define([_lt_join],
88437b58d2e0Smrg[m4_if([$#$2], [2], [],
88447b58d2e0Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
884509885543Smrg
884609885543Smrg
88477b58d2e0Smrg# lt_car(LIST)
88487b58d2e0Smrg# lt_cdr(LIST)
88497b58d2e0Smrg# ------------
88507b58d2e0Smrg# Manipulate m4 lists.
88517b58d2e0Smrg# These macros are necessary as long as will still need to support
8852f395c03eSmrg# Autoconf-2.59, which quotes differently.
88537b58d2e0Smrgm4_define([lt_car], [[$1]])
88547b58d2e0Smrgm4_define([lt_cdr],
88557b58d2e0Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
88567b58d2e0Smrg       [$#], 1, [],
88577b58d2e0Smrg       [m4_dquote(m4_shift($@))])])
88587b58d2e0Smrgm4_define([lt_unquote], $1)
885909885543Smrg
886009885543Smrg
88617b58d2e0Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
88627b58d2e0Smrg# ------------------------------------------
8863f395c03eSmrg# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
88647b58d2e0Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
88657b58d2e0Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
88667b58d2e0Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
88677b58d2e0Smrg# than defined and empty).
88687b58d2e0Smrg#
88697b58d2e0Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
88707b58d2e0Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
88717b58d2e0Smrgm4_define([lt_append],
88727b58d2e0Smrg[m4_define([$1],
88737b58d2e0Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
887409885543Smrg
887509885543Smrg
887609885543Smrg
88777b58d2e0Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
88787b58d2e0Smrg# ----------------------------------------------------------
88797b58d2e0Smrg# Produce a SEP delimited list of all paired combinations of elements of
88807b58d2e0Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
88817b58d2e0Smrg# has the form PREFIXmINFIXSUFFIXn.
88827b58d2e0Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
88837b58d2e0Smrgm4_define([lt_combine],
88847b58d2e0Smrg[m4_if(m4_eval([$# > 3]), [1],
88857b58d2e0Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
88867b58d2e0Smrg[[m4_foreach([_Lt_prefix], [$2],
88877b58d2e0Smrg	     [m4_foreach([_Lt_suffix],
88887b58d2e0Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
88897b58d2e0Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
889009885543Smrg
88917b58d2e0Smrg
88927b58d2e0Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
88937b58d2e0Smrg# -----------------------------------------------------------------------
88947b58d2e0Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
88957b58d2e0Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
88967b58d2e0Smrgm4_define([lt_if_append_uniq],
88977b58d2e0Smrg[m4_ifdef([$1],
88987b58d2e0Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
88997b58d2e0Smrg		 [lt_append([$1], [$2], [$3])$4],
89007b58d2e0Smrg		 [$5])],
89017b58d2e0Smrg	  [lt_append([$1], [$2], [$3])$4])])
8902e4f6584cSmrg
8903e4f6584cSmrg
89047b58d2e0Smrg# lt_dict_add(DICT, KEY, VALUE)
89057b58d2e0Smrg# -----------------------------
89067b58d2e0Smrgm4_define([lt_dict_add],
89077b58d2e0Smrg[m4_define([$1($2)], [$3])])
890809885543Smrg
890909885543Smrg
89107b58d2e0Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
89117b58d2e0Smrg# --------------------------------------------
89127b58d2e0Smrgm4_define([lt_dict_add_subkey],
89137b58d2e0Smrg[m4_define([$1($2:$3)], [$4])])
891409885543Smrg
891509885543Smrg
89167b58d2e0Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
89177b58d2e0Smrg# ----------------------------------
89187b58d2e0Smrgm4_define([lt_dict_fetch],
89197b58d2e0Smrg[m4_ifval([$3],
89207b58d2e0Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
89217b58d2e0Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
892209885543Smrg
892309885543Smrg
89247b58d2e0Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
89257b58d2e0Smrg# -----------------------------------------------------------------
89267b58d2e0Smrgm4_define([lt_if_dict_fetch],
89277b58d2e0Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
89287b58d2e0Smrg	[$5],
89297b58d2e0Smrg    [$6])])
8930e4f6584cSmrg
893109885543Smrg
89327b58d2e0Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
89337b58d2e0Smrg# --------------------------------------------------------------
89347b58d2e0Smrgm4_define([lt_dict_filter],
89357b58d2e0Smrg[m4_if([$5], [], [],
89367b58d2e0Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
89377b58d2e0Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
89387b58d2e0Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
89397b58d2e0Smrg])
894009885543Smrg
89417b58d2e0Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
89427b58d2e0Smrg#
8943f395c03eSmrg#   Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
89447b58d2e0Smrg#   Written by Scott James Remnant, 2004
89457b58d2e0Smrg#
89467b58d2e0Smrg# This file is free software; the Free Software Foundation gives
89477b58d2e0Smrg# unlimited permission to copy and/or distribute it, with or without
89487b58d2e0Smrg# modifications, as long as this notice is preserved.
894909885543Smrg
8950b12e5c03Smrg# @configure_input@
895109885543Smrg
8952f395c03eSmrg# serial 4179 ltversion.m4
89537b58d2e0Smrg# This file is part of GNU Libtool
895409885543Smrg
8955f395c03eSmrgm4_define([LT_PACKAGE_VERSION], [2.4.6])
8956f395c03eSmrgm4_define([LT_PACKAGE_REVISION], [2.4.6])
895709885543Smrg
89587b58d2e0SmrgAC_DEFUN([LTVERSION_VERSION],
8959f395c03eSmrg[macro_version='2.4.6'
8960f395c03eSmrgmacro_revision='2.4.6'
89617b58d2e0Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
89627b58d2e0Smrg_LT_DECL(, macro_revision, 0)
89637b58d2e0Smrg])
8964e4f6584cSmrg
89657b58d2e0Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
89667b58d2e0Smrg#
8967f395c03eSmrg#   Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
8968f395c03eSmrg#   Foundation, Inc.
89697b58d2e0Smrg#   Written by Scott James Remnant, 2004.
89707b58d2e0Smrg#
89717b58d2e0Smrg# This file is free software; the Free Software Foundation gives
89727b58d2e0Smrg# unlimited permission to copy and/or distribute it, with or without
89737b58d2e0Smrg# modifications, as long as this notice is preserved.
89747b58d2e0Smrg
8975b12e5c03Smrg# serial 5 lt~obsolete.m4
89767b58d2e0Smrg
89777b58d2e0Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
89787b58d2e0Smrg#
8979f395c03eSmrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
89807b58d2e0Smrg# which have later been changed to m4_define as they aren't part of the
89817b58d2e0Smrg# exported API, or moved to Autoconf or Automake where they belong.
89827b58d2e0Smrg#
89837b58d2e0Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
89847b58d2e0Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
89857b58d2e0Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
89867b58d2e0Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
89877b58d2e0Smrg# and doesn't know about Autoconf macros at all.)
89887b58d2e0Smrg#
89897b58d2e0Smrg# So we provide this file, which has a silly filename so it's always
89907b58d2e0Smrg# included after everything else.  This provides aclocal with the
89917b58d2e0Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
89927b58d2e0Smrg# because those macros already exist, or will be overwritten later.
8993f395c03eSmrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
89947b58d2e0Smrg#
89957b58d2e0Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
89967b58d2e0Smrg# Yes, that means every name once taken will need to remain here until
89977b58d2e0Smrg# we give up compatibility with versions before 1.7, at which point
89987b58d2e0Smrg# we need to keep only those names which we still refer to.
89997b58d2e0Smrg
90007b58d2e0Smrg# This is to help aclocal find these macros, as it can't see m4_define.
90017b58d2e0SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
90027b58d2e0Smrg
90037b58d2e0Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
90047b58d2e0Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
90057b58d2e0Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
90067b58d2e0Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
90077b58d2e0Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
90087b58d2e0Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
90097b58d2e0Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
90107b58d2e0Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
90117b58d2e0Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
90127b58d2e0Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
90137b58d2e0Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
90147b58d2e0Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
90157b58d2e0Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
90167b58d2e0Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
90177b58d2e0Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
90187b58d2e0Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
90197b58d2e0Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
90207b58d2e0Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
90217b58d2e0Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
90227b58d2e0Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
90237b58d2e0Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
90247b58d2e0Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
90257b58d2e0Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
90267b58d2e0Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
90277b58d2e0Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
90287b58d2e0Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
90297b58d2e0Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
90307b58d2e0Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
90317b58d2e0Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
90327b58d2e0Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
90337b58d2e0Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
90347b58d2e0Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
90357b58d2e0Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
90367b58d2e0Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
90377b58d2e0Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
90387b58d2e0Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
90397b58d2e0Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
90407b58d2e0Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
90417b58d2e0Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
90427b58d2e0Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
90437b58d2e0Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
90447b58d2e0Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
90457b58d2e0Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
90467b58d2e0Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
90477b58d2e0Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
90487b58d2e0Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
90497b58d2e0Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
90507b58d2e0Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
90517b58d2e0Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
90527b58d2e0Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
90537b58d2e0Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
90547b58d2e0Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
90557b58d2e0Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
90567b58d2e0Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
9057b12e5c03Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
9058b12e5c03Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
9059b12e5c03Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
9060b12e5c03Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
9061b12e5c03Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
9062b12e5c03Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
9063b12e5c03Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
90647b58d2e0Smrg
90657b58d2e0Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
90667b58d2e0Smrg# serial 1 (pkg-config-0.24)
90677b58d2e0Smrg# 
90687b58d2e0Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
90697b58d2e0Smrg#
90707b58d2e0Smrg# This program is free software; you can redistribute it and/or modify
90717b58d2e0Smrg# it under the terms of the GNU General Public License as published by
90727b58d2e0Smrg# the Free Software Foundation; either version 2 of the License, or
90737b58d2e0Smrg# (at your option) any later version.
90747b58d2e0Smrg#
90757b58d2e0Smrg# This program is distributed in the hope that it will be useful, but
90767b58d2e0Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
90777b58d2e0Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
90787b58d2e0Smrg# General Public License for more details.
90797b58d2e0Smrg#
90807b58d2e0Smrg# You should have received a copy of the GNU General Public License
90817b58d2e0Smrg# along with this program; if not, write to the Free Software
90827b58d2e0Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
90837b58d2e0Smrg#
90847b58d2e0Smrg# As a special exception to the GNU General Public License, if you
90857b58d2e0Smrg# distribute this file as part of a program that contains a
90867b58d2e0Smrg# configuration script generated by Autoconf, you may include it under
90877b58d2e0Smrg# the same distribution terms that you use for the rest of that program.
9088e4f6584cSmrg
90897b58d2e0Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
90907b58d2e0Smrg# ----------------------------------
90917b58d2e0SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
90927b58d2e0Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
9093df9ffc95Smrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
9094df9ffc95Smrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
90957b58d2e0SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
90967b58d2e0SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
90977b58d2e0SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
9098e4f6584cSmrg
90997b58d2e0Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
91007b58d2e0Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
91017b58d2e0Smrgfi
91027b58d2e0Smrgif test -n "$PKG_CONFIG"; then
91037b58d2e0Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
91047b58d2e0Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
91057b58d2e0Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
91067b58d2e0Smrg		AC_MSG_RESULT([yes])
91077b58d2e0Smrg	else
91087b58d2e0Smrg		AC_MSG_RESULT([no])
91097b58d2e0Smrg		PKG_CONFIG=""
91107b58d2e0Smrg	fi
91117b58d2e0Smrgfi[]dnl
91127b58d2e0Smrg])# PKG_PROG_PKG_CONFIG
9113e4f6584cSmrg
91147b58d2e0Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
91157b58d2e0Smrg#
91167b58d2e0Smrg# Check to see whether a particular set of modules exists.  Similar
91177b58d2e0Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
91187b58d2e0Smrg#
91197b58d2e0Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
91207b58d2e0Smrg# only at the first occurence in configure.ac, so if the first place
91217b58d2e0Smrg# it's called might be skipped (such as if it is within an "if", you
91227b58d2e0Smrg# have to call PKG_CHECK_EXISTS manually
91237b58d2e0Smrg# --------------------------------------------------------------
91247b58d2e0SmrgAC_DEFUN([PKG_CHECK_EXISTS],
91257b58d2e0Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
91267b58d2e0Smrgif test -n "$PKG_CONFIG" && \
91277b58d2e0Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
91287b58d2e0Smrg  m4_default([$2], [:])
91297b58d2e0Smrgm4_ifvaln([$3], [else
91307b58d2e0Smrg  $3])dnl
91317b58d2e0Smrgfi])
9132e4f6584cSmrg
91337b58d2e0Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
91347b58d2e0Smrg# ---------------------------------------------
91357b58d2e0Smrgm4_define([_PKG_CONFIG],
91367b58d2e0Smrg[if test -n "$$1"; then
91377b58d2e0Smrg    pkg_cv_[]$1="$$1"
91387b58d2e0Smrg elif test -n "$PKG_CONFIG"; then
91397b58d2e0Smrg    PKG_CHECK_EXISTS([$3],
9140df9ffc95Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
9141df9ffc95Smrg		      test "x$?" != "x0" && pkg_failed=yes ],
91427b58d2e0Smrg		     [pkg_failed=yes])
91437b58d2e0Smrg else
91447b58d2e0Smrg    pkg_failed=untried
91457b58d2e0Smrgfi[]dnl
91467b58d2e0Smrg])# _PKG_CONFIG
914709885543Smrg
91487b58d2e0Smrg# _PKG_SHORT_ERRORS_SUPPORTED
91497b58d2e0Smrg# -----------------------------
91507b58d2e0SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
91517b58d2e0Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
91527b58d2e0Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
91537b58d2e0Smrg        _pkg_short_errors_supported=yes
91547b58d2e0Smrgelse
91557b58d2e0Smrg        _pkg_short_errors_supported=no
91567b58d2e0Smrgfi[]dnl
91577b58d2e0Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
9158e4f6584cSmrg
9159e4f6584cSmrg
91607b58d2e0Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
91617b58d2e0Smrg# [ACTION-IF-NOT-FOUND])
91627b58d2e0Smrg#
91637b58d2e0Smrg#
91647b58d2e0Smrg# Note that if there is a possibility the first call to
91657b58d2e0Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
91667b58d2e0Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
91677b58d2e0Smrg#
91687b58d2e0Smrg#
91697b58d2e0Smrg# --------------------------------------------------------------
91707b58d2e0SmrgAC_DEFUN([PKG_CHECK_MODULES],
91717b58d2e0Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
91727b58d2e0SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
91737b58d2e0SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
9174e4f6584cSmrg
91757b58d2e0Smrgpkg_failed=no
91767b58d2e0SmrgAC_MSG_CHECKING([for $1])
9177e4f6584cSmrg
91787b58d2e0Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
91797b58d2e0Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
9180e4f6584cSmrg
91817b58d2e0Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
91827b58d2e0Smrgand $1[]_LIBS to avoid the need to call pkg-config.
91837b58d2e0SmrgSee the pkg-config man page for more details.])
9184e4f6584cSmrg
91857b58d2e0Smrgif test $pkg_failed = yes; then
91867b58d2e0Smrg   	AC_MSG_RESULT([no])
91877b58d2e0Smrg        _PKG_SHORT_ERRORS_SUPPORTED
91887b58d2e0Smrg        if test $_pkg_short_errors_supported = yes; then
9189df9ffc95Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
91907b58d2e0Smrg        else 
9191df9ffc95Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
91927b58d2e0Smrg        fi
91937b58d2e0Smrg	# Put the nasty error message in config.log where it belongs
91947b58d2e0Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
9195e4f6584cSmrg
91967b58d2e0Smrg	m4_default([$4], [AC_MSG_ERROR(
91977b58d2e0Smrg[Package requirements ($2) were not met:
9198e4f6584cSmrg
91997b58d2e0Smrg$$1_PKG_ERRORS
9200e4f6584cSmrg
92017b58d2e0SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
92027b58d2e0Smrginstalled software in a non-standard prefix.
9203e4f6584cSmrg
9204df9ffc95Smrg_PKG_TEXT])[]dnl
92057b58d2e0Smrg        ])
92067b58d2e0Smrgelif test $pkg_failed = untried; then
92077b58d2e0Smrg     	AC_MSG_RESULT([no])
92087b58d2e0Smrg	m4_default([$4], [AC_MSG_FAILURE(
92097b58d2e0Smrg[The pkg-config script could not be found or is too old.  Make sure it
92107b58d2e0Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
92117b58d2e0Smrgpath to pkg-config.
9212e4f6584cSmrg
92137b58d2e0Smrg_PKG_TEXT
9214e4f6584cSmrg
9215df9ffc95SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
92167b58d2e0Smrg        ])
92177b58d2e0Smrgelse
92187b58d2e0Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
92197b58d2e0Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
92207b58d2e0Smrg        AC_MSG_RESULT([yes])
92217b58d2e0Smrg	$3
92227b58d2e0Smrgfi[]dnl
92237b58d2e0Smrg])# PKG_CHECK_MODULES
9224e4f6584cSmrg
9225df9ffc95Smrg
9226df9ffc95Smrg# PKG_INSTALLDIR(DIRECTORY)
9227df9ffc95Smrg# -------------------------
9228df9ffc95Smrg# Substitutes the variable pkgconfigdir as the location where a module
9229df9ffc95Smrg# should install pkg-config .pc files. By default the directory is
9230df9ffc95Smrg# $libdir/pkgconfig, but the default can be changed by passing
9231df9ffc95Smrg# DIRECTORY. The user can override through the --with-pkgconfigdir
9232df9ffc95Smrg# parameter.
9233df9ffc95SmrgAC_DEFUN([PKG_INSTALLDIR],
9234df9ffc95Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
9235df9ffc95Smrgm4_pushdef([pkg_description],
9236df9ffc95Smrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
9237df9ffc95SmrgAC_ARG_WITH([pkgconfigdir],
9238df9ffc95Smrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
9239df9ffc95Smrg    [with_pkgconfigdir=]pkg_default)
9240df9ffc95SmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
9241df9ffc95Smrgm4_popdef([pkg_default])
9242df9ffc95Smrgm4_popdef([pkg_description])
9243df9ffc95Smrg]) dnl PKG_INSTALLDIR
9244df9ffc95Smrg
9245df9ffc95Smrg
9246df9ffc95Smrg# PKG_NOARCH_INSTALLDIR(DIRECTORY)
9247df9ffc95Smrg# -------------------------
9248df9ffc95Smrg# Substitutes the variable noarch_pkgconfigdir as the location where a
9249df9ffc95Smrg# module should install arch-independent pkg-config .pc files. By
9250df9ffc95Smrg# default the directory is $datadir/pkgconfig, but the default can be
9251df9ffc95Smrg# changed by passing DIRECTORY. The user can override through the
9252df9ffc95Smrg# --with-noarch-pkgconfigdir parameter.
9253df9ffc95SmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
9254df9ffc95Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
9255df9ffc95Smrgm4_pushdef([pkg_description],
9256df9ffc95Smrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
9257df9ffc95SmrgAC_ARG_WITH([noarch-pkgconfigdir],
9258df9ffc95Smrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
9259df9ffc95Smrg    [with_noarch_pkgconfigdir=]pkg_default)
9260df9ffc95SmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
9261df9ffc95Smrgm4_popdef([pkg_default])
9262df9ffc95Smrgm4_popdef([pkg_description])
9263df9ffc95Smrg]) dnl PKG_NOARCH_INSTALLDIR
9264df9ffc95Smrg
9265df9ffc95Smrg
9266df9ffc95Smrg# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
9267df9ffc95Smrg# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
9268df9ffc95Smrg# -------------------------------------------
9269df9ffc95Smrg# Retrieves the value of the pkg-config variable for the given module.
9270df9ffc95SmrgAC_DEFUN([PKG_CHECK_VAR],
9271df9ffc95Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9272df9ffc95SmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
9273df9ffc95Smrg
9274df9ffc95Smrg_PKG_CONFIG([$1], [variable="][$3]["], [$2])
9275df9ffc95SmrgAS_VAR_COPY([$1], [pkg_cv_][$1])
9276df9ffc95Smrg
9277df9ffc95SmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl
9278df9ffc95Smrg])# PKG_CHECK_VAR
9279df9ffc95Smrg
92807b58d2e0Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
92817b58d2e0Smrgdnl
9282b12e5c03Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
9283df9ffc95Smrgdnl
92847b58d2e0Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
92857b58d2e0Smrgdnl copy of this software and associated documentation files (the "Software"),
92867b58d2e0Smrgdnl to deal in the Software without restriction, including without limitation
92877b58d2e0Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
92887b58d2e0Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
92897b58d2e0Smrgdnl Software is furnished to do so, subject to the following conditions:
92907b58d2e0Smrgdnl
92917b58d2e0Smrgdnl The above copyright notice and this permission notice (including the next
92927b58d2e0Smrgdnl paragraph) shall be included in all copies or substantial portions of the
92937b58d2e0Smrgdnl Software.
92947b58d2e0Smrgdnl
92957b58d2e0Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
92967b58d2e0Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
92977b58d2e0Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
92987b58d2e0Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
92997b58d2e0Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
93007b58d2e0Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
93017b58d2e0Smrgdnl DEALINGS IN THE SOFTWARE.
9302e4f6584cSmrg
93037b58d2e0Smrg# XORG_MACROS_VERSION(required-version)
93047b58d2e0Smrg# -------------------------------------
93057b58d2e0Smrg# Minimum version: 1.1.0
93067b58d2e0Smrg#
93077b58d2e0Smrg# If you're using a macro added in Version 1.1 or newer, include this in
93087b58d2e0Smrg# your configure.ac with the minimum required version, such as:
93097b58d2e0Smrg# XORG_MACROS_VERSION(1.1)
93107b58d2e0Smrg#
93117b58d2e0Smrg# To ensure that this macro is defined, also add:
93127b58d2e0Smrg# m4_ifndef([XORG_MACROS_VERSION],
93137b58d2e0Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
93147b58d2e0Smrg#
93157b58d2e0Smrg#
9316df9ffc95Smrg# See the "minimum version" comment for each macro you use to see what
93177b58d2e0Smrg# version you require.
93187b58d2e0Smrgm4_defun([XORG_MACROS_VERSION],[
9319df9ffc95Smrgm4_define([vers_have], [1.19.0])
93207b58d2e0Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
93217b58d2e0Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
93227b58d2e0Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
93237b58d2e0Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
93247b58d2e0Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
93257b58d2e0Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
93267b58d2e0Smrgm4_undefine([vers_have])
93277b58d2e0Smrgm4_undefine([maj_have])
93287b58d2e0Smrgm4_undefine([maj_needed])
93297b58d2e0Smrg]) # XORG_MACROS_VERSION
9330e4f6584cSmrg
93317b58d2e0Smrg# XORG_PROG_RAWCPP()
93327b58d2e0Smrg# ------------------
93337b58d2e0Smrg# Minimum version: 1.0.0
93347b58d2e0Smrg#
93357b58d2e0Smrg# Find cpp program and necessary flags for use in pre-processing text files
93367b58d2e0Smrg# such as man pages and config files
93377b58d2e0SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
93387b58d2e0SmrgAC_REQUIRE([AC_PROG_CPP])
9339df9ffc95SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
93407b58d2e0Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9341e4f6584cSmrg
93427b58d2e0Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
93437b58d2e0Smrg# which is not the best choice for supporting other OS'es, but covers most
93447b58d2e0Smrg# of the ones we need for now.
93457b58d2e0SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
9346b12e5c03SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
93477b58d2e0Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
93487b58d2e0Smrg	AC_MSG_RESULT([no])
93497b58d2e0Smrgelse
93507b58d2e0Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
93517b58d2e0Smrg		RAWCPPFLAGS=-undef
93527b58d2e0Smrg		AC_MSG_RESULT([yes])
93537b58d2e0Smrg	# under Cygwin unix is still defined even with -undef
93547b58d2e0Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
93557b58d2e0Smrg		RAWCPPFLAGS="-undef -ansi"
93567b58d2e0Smrg		AC_MSG_RESULT([yes, with -ansi])
93577b58d2e0Smrg	else
93587b58d2e0Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
93597b58d2e0Smrg	fi
93607b58d2e0Smrgfi
93617b58d2e0Smrgrm -f conftest.$ac_ext
9362e4f6584cSmrg
93637b58d2e0SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
9364b12e5c03SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
93657b58d2e0Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
93667b58d2e0Smrg	AC_MSG_RESULT([no])
93677b58d2e0Smrgelse
93687b58d2e0Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9369df9ffc95Smrg		TRADITIONALCPPFLAGS="-traditional"
93707b58d2e0Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
93717b58d2e0Smrg		AC_MSG_RESULT([yes])
93727b58d2e0Smrg	else
93737b58d2e0Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
937409885543Smrg	fi
93757b58d2e0Smrgfi
93767b58d2e0Smrgrm -f conftest.$ac_ext
93777b58d2e0SmrgAC_SUBST(RAWCPPFLAGS)
9378df9ffc95SmrgAC_SUBST(TRADITIONALCPPFLAGS)
93797b58d2e0Smrg]) # XORG_PROG_RAWCPP
9380e4f6584cSmrg
93817b58d2e0Smrg# XORG_MANPAGE_SECTIONS()
93827b58d2e0Smrg# -----------------------
93837b58d2e0Smrg# Minimum version: 1.0.0
93847b58d2e0Smrg#
93857b58d2e0Smrg# Determine which sections man pages go in for the different man page types
93867b58d2e0Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
93877b58d2e0Smrg# Not sure if there's any better way than just hardcoding by OS name.
93887b58d2e0Smrg# Override default settings by setting environment variables
93897b58d2e0Smrg# Added MAN_SUBSTS in version 1.8
93907b58d2e0Smrg# Added AC_PROG_SED in version 1.8
9391e4f6584cSmrg
93927b58d2e0SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
93937b58d2e0SmrgAC_REQUIRE([AC_CANONICAL_HOST])
93947b58d2e0SmrgAC_REQUIRE([AC_PROG_SED])
9395e4f6584cSmrg
93967b58d2e0Smrgif test x$APP_MAN_SUFFIX = x    ; then
93977b58d2e0Smrg    APP_MAN_SUFFIX=1
93987b58d2e0Smrgfi
93997b58d2e0Smrgif test x$APP_MAN_DIR = x    ; then
94007b58d2e0Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
94017b58d2e0Smrgfi
9402e4f6584cSmrg
94037b58d2e0Smrgif test x$LIB_MAN_SUFFIX = x    ; then
94047b58d2e0Smrg    LIB_MAN_SUFFIX=3
94057b58d2e0Smrgfi
94067b58d2e0Smrgif test x$LIB_MAN_DIR = x    ; then
94077b58d2e0Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
94087b58d2e0Smrgfi
9409e4f6584cSmrg
94107b58d2e0Smrgif test x$FILE_MAN_SUFFIX = x    ; then
94117b58d2e0Smrg    case $host_os in
94127b58d2e0Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
94137b58d2e0Smrg	*)		FILE_MAN_SUFFIX=5  ;;
94147b58d2e0Smrg    esac
94157b58d2e0Smrgfi
94167b58d2e0Smrgif test x$FILE_MAN_DIR = x    ; then
94177b58d2e0Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
94187b58d2e0Smrgfi
941909885543Smrg
94207b58d2e0Smrgif test x$MISC_MAN_SUFFIX = x    ; then
94217b58d2e0Smrg    case $host_os in
94227b58d2e0Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
94237b58d2e0Smrg	*)		MISC_MAN_SUFFIX=7  ;;
94247b58d2e0Smrg    esac
94257b58d2e0Smrgfi
94267b58d2e0Smrgif test x$MISC_MAN_DIR = x    ; then
94277b58d2e0Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
94287b58d2e0Smrgfi
94297104f784Smrg
94307b58d2e0Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
94317b58d2e0Smrg    case $host_os in
94327b58d2e0Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
94337b58d2e0Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
94347b58d2e0Smrg    esac
94357b58d2e0Smrgfi
94367b58d2e0Smrgif test x$DRIVER_MAN_DIR = x    ; then
94377b58d2e0Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
94387b58d2e0Smrgfi
943909885543Smrg
94407b58d2e0Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
94417b58d2e0Smrg    case $host_os in
94427b58d2e0Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
94437b58d2e0Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
94447b58d2e0Smrg    esac
94457b58d2e0Smrgfi
94467b58d2e0Smrgif test x$ADMIN_MAN_DIR = x    ; then
94477b58d2e0Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
94487b58d2e0Smrgfi
94497104f784Smrg
945009885543Smrg
94517b58d2e0SmrgAC_SUBST([APP_MAN_SUFFIX])
94527b58d2e0SmrgAC_SUBST([LIB_MAN_SUFFIX])
94537b58d2e0SmrgAC_SUBST([FILE_MAN_SUFFIX])
94547b58d2e0SmrgAC_SUBST([MISC_MAN_SUFFIX])
94557b58d2e0SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
94567b58d2e0SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
94577b58d2e0SmrgAC_SUBST([APP_MAN_DIR])
94587b58d2e0SmrgAC_SUBST([LIB_MAN_DIR])
94597b58d2e0SmrgAC_SUBST([FILE_MAN_DIR])
94607b58d2e0SmrgAC_SUBST([MISC_MAN_DIR])
94617b58d2e0SmrgAC_SUBST([DRIVER_MAN_DIR])
94627b58d2e0SmrgAC_SUBST([ADMIN_MAN_DIR])
946309885543Smrg
94647b58d2e0SmrgXORG_MAN_PAGE="X Version 11"
94657b58d2e0SmrgAC_SUBST([XORG_MAN_PAGE])
94667b58d2e0SmrgMAN_SUBSTS="\
94677b58d2e0Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
94687b58d2e0Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
94697b58d2e0Smrg	-e 's|__xservername__|Xorg|g' \
94707b58d2e0Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
94717b58d2e0Smrg	-e 's|__projectroot__|\$(prefix)|g' \
9472b12e5c03Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
94737b58d2e0Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
94747b58d2e0Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
94757b58d2e0Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
94767b58d2e0Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
94777b58d2e0Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
94787b58d2e0Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
94797b58d2e0SmrgAC_SUBST([MAN_SUBSTS])
948009885543Smrg
94817b58d2e0Smrg]) # XORG_MANPAGE_SECTIONS
948209885543Smrg
94837b58d2e0Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
94847b58d2e0Smrg# ------------------------
94857b58d2e0Smrg# Minimum version: 1.7.0
94867b58d2e0Smrg#
94877b58d2e0Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
94887b58d2e0Smrg# provided by xorg-sgml-doctools, if installed.
94897b58d2e0SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
94907b58d2e0SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
94917b58d2e0SmrgXORG_SGML_PATH=
94927b58d2e0SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
94937b58d2e0Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
94947b58d2e0Smrg    [m4_ifval([$1],[:],
94957b58d2e0Smrg        [if test x"$cross_compiling" != x"yes" ; then
94967b58d2e0Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
94977b58d2e0Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
94987b58d2e0Smrg         fi])
94997b58d2e0Smrg    ])
950009885543Smrg
95017b58d2e0Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
95027b58d2e0Smrg# the path and the name of the doc stylesheet
95037b58d2e0Smrgif test "x$XORG_SGML_PATH" != "x" ; then
95047b58d2e0Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
95057b58d2e0Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
95067b58d2e0Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
95077b58d2e0Smrgelse
95087b58d2e0Smrg   AC_MSG_RESULT([no])
95097b58d2e0Smrgfi
951009885543Smrg
95117b58d2e0SmrgAC_SUBST(XORG_SGML_PATH)
95127b58d2e0SmrgAC_SUBST(STYLESHEET_SRCDIR)
95137b58d2e0SmrgAC_SUBST(XSL_STYLESHEET)
95147b58d2e0SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
95157b58d2e0Smrg]) # XORG_CHECK_SGML_DOCTOOLS
951609885543Smrg
95177b58d2e0Smrg# XORG_CHECK_LINUXDOC
95187b58d2e0Smrg# -------------------
95197b58d2e0Smrg# Minimum version: 1.0.0
95207b58d2e0Smrg#
95217b58d2e0Smrg# Defines the variable MAKE_TEXT if the necessary tools and
95227b58d2e0Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
95237b58d2e0Smrg# Whether or not the necessary tools and files are found can be checked
95247b58d2e0Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
95257b58d2e0SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
95267b58d2e0SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
95277b58d2e0SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
952809885543Smrg
95297b58d2e0SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
953009885543Smrg
95317b58d2e0SmrgAC_MSG_CHECKING([whether to build documentation])
9532e4f6584cSmrg
95337b58d2e0Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
95347b58d2e0Smrg   BUILDDOC=yes
95357b58d2e0Smrgelse
95367b58d2e0Smrg   BUILDDOC=no
953709885543Smrgfi
953809885543Smrg
95397b58d2e0SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
954009885543Smrg
95417b58d2e0SmrgAC_MSG_RESULT([$BUILDDOC])
954209885543Smrg
95437b58d2e0SmrgAC_MSG_CHECKING([whether to build pdf documentation])
954409885543Smrg
95457b58d2e0Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
95467b58d2e0Smrg   BUILDPDFDOC=yes
95477b58d2e0Smrgelse
95487b58d2e0Smrg   BUILDPDFDOC=no
95497b58d2e0Smrgfi
955009885543Smrg
95517b58d2e0SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
955209885543Smrg
95537b58d2e0SmrgAC_MSG_RESULT([$BUILDPDFDOC])
955409885543Smrg
95557b58d2e0SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
95567b58d2e0SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
95577b58d2e0SmrgMAKE_PDF="$PS2PDF"
95587b58d2e0SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
955909885543Smrg
95607b58d2e0SmrgAC_SUBST(MAKE_TEXT)
95617b58d2e0SmrgAC_SUBST(MAKE_PS)
95627b58d2e0SmrgAC_SUBST(MAKE_PDF)
95637b58d2e0SmrgAC_SUBST(MAKE_HTML)
95647b58d2e0Smrg]) # XORG_CHECK_LINUXDOC
9565b698ba48Smrg
95667b58d2e0Smrg# XORG_CHECK_DOCBOOK
95677b58d2e0Smrg# -------------------
95687b58d2e0Smrg# Minimum version: 1.0.0
95697b58d2e0Smrg#
95707b58d2e0Smrg# Checks for the ability to build output formats from SGML DocBook source.
95717b58d2e0Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
95727b58d2e0Smrg# indicates whether the necessary tools and files are found and, if set,
95737b58d2e0Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
95747b58d2e0SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
95757b58d2e0SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
957609885543Smrg
95777b58d2e0SmrgBUILDTXTDOC=no
95787b58d2e0SmrgBUILDPDFDOC=no
95797b58d2e0SmrgBUILDPSDOC=no
95807b58d2e0SmrgBUILDHTMLDOC=no
958109885543Smrg
95827b58d2e0SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
95837b58d2e0SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
95847b58d2e0SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
95857b58d2e0SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
9586e4f6584cSmrg
95877b58d2e0SmrgAC_MSG_CHECKING([whether to build text documentation])
95887b58d2e0Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
95897b58d2e0Smrg   test x$BUILD_TXTDOC != xno; then
95907b58d2e0Smrg	BUILDTXTDOC=yes
959109885543Smrgfi
95927b58d2e0SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
95937b58d2e0SmrgAC_MSG_RESULT([$BUILDTXTDOC])
9594e4f6584cSmrg
95957b58d2e0SmrgAC_MSG_CHECKING([whether to build PDF documentation])
95967b58d2e0Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
95977b58d2e0Smrg   test x$BUILD_PDFDOC != xno; then
95987b58d2e0Smrg	BUILDPDFDOC=yes
95997b58d2e0Smrgfi
96007b58d2e0SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
96017b58d2e0SmrgAC_MSG_RESULT([$BUILDPDFDOC])
9602e4f6584cSmrg
96037b58d2e0SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
96047b58d2e0Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
96057b58d2e0Smrg   test x$BUILD_PSDOC != xno; then
96067b58d2e0Smrg	BUILDPSDOC=yes
96077b58d2e0Smrgfi
96087b58d2e0SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
96097b58d2e0SmrgAC_MSG_RESULT([$BUILDPSDOC])
9610e4f6584cSmrg
96117b58d2e0SmrgAC_MSG_CHECKING([whether to build HTML documentation])
96127b58d2e0Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
96137b58d2e0Smrg   test x$BUILD_HTMLDOC != xno; then
96147b58d2e0Smrg	BUILDHTMLDOC=yes
96157b58d2e0Smrgfi
96167b58d2e0SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
96177b58d2e0SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
9618e4f6584cSmrg
96197b58d2e0SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
96207b58d2e0SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
96217b58d2e0SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
96227b58d2e0SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
9623e4f6584cSmrg
96247b58d2e0SmrgAC_SUBST(MAKE_TEXT)
96257b58d2e0SmrgAC_SUBST(MAKE_PS)
96267b58d2e0SmrgAC_SUBST(MAKE_PDF)
96277b58d2e0SmrgAC_SUBST(MAKE_HTML)
96287b58d2e0Smrg]) # XORG_CHECK_DOCBOOK
9629e4f6584cSmrg
9630b12e5c03Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
96317b58d2e0Smrg# ----------------
96327b58d2e0Smrg# Minimum version: 1.5.0
9633b12e5c03Smrg# Minimum version for optional DEFAULT argument: 1.11.0
96347b58d2e0Smrg#
96357b58d2e0Smrg# Documentation tools are not always available on all platforms and sometimes
96367b58d2e0Smrg# not at the appropriate level. This macro enables a module to test for the
96377b58d2e0Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
96387b58d2e0Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
9639b12e5c03Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
9640b12e5c03Smrg# --with-xmlto assumes 'auto'.
96417b58d2e0Smrg#
96427b58d2e0Smrg# Interface to module:
96437b58d2e0Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
96447b58d2e0Smrg# XMLTO:	returns the path of the xmlto program found
96457b58d2e0Smrg#		returns the path set by the user in the environment
96467b58d2e0Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
96477b58d2e0Smrg#		'no' user instructs the module not to use xmlto
96487b58d2e0Smrg#
96497b58d2e0Smrg# Added in version 1.10.0
96507b58d2e0Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
96517b58d2e0Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
96527b58d2e0Smrg#
96537b58d2e0Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
96547b58d2e0Smrg#
96557b58d2e0SmrgAC_DEFUN([XORG_WITH_XMLTO],[
96567b58d2e0SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
9657b12e5c03Smrgm4_define([_defopt], m4_default([$2], [auto]))
96587b58d2e0SmrgAC_ARG_WITH(xmlto,
96597b58d2e0Smrg	AS_HELP_STRING([--with-xmlto],
9660b12e5c03Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
9661b12e5c03Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
9662b12e5c03Smrgm4_undefine([_defopt])
966309885543Smrg
96647b58d2e0Smrgif test "x$use_xmlto" = x"auto"; then
96657b58d2e0Smrg   AC_PATH_PROG([XMLTO], [xmlto])
96667b58d2e0Smrg   if test "x$XMLTO" = "x"; then
96677b58d2e0Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
96687b58d2e0Smrg	have_xmlto=no
96697b58d2e0Smrg   else
96707b58d2e0Smrg        have_xmlto=yes
96717b58d2e0Smrg   fi
96727b58d2e0Smrgelif test "x$use_xmlto" = x"yes" ; then
96737b58d2e0Smrg   AC_PATH_PROG([XMLTO], [xmlto])
96747b58d2e0Smrg   if test "x$XMLTO" = "x"; then
96757b58d2e0Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
96767b58d2e0Smrg   fi
96777b58d2e0Smrg   have_xmlto=yes
96787b58d2e0Smrgelif test "x$use_xmlto" = x"no" ; then
96797b58d2e0Smrg   if test "x$XMLTO" != "x"; then
96807b58d2e0Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
96817b58d2e0Smrg   fi
96827b58d2e0Smrg   have_xmlto=no
96837b58d2e0Smrgelse
96847b58d2e0Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
96857b58d2e0Smrgfi
968609885543Smrg
96877b58d2e0Smrg# Test for a minimum version of xmlto, if provided.
96887b58d2e0Smrgm4_ifval([$1],
96897b58d2e0Smrg[if test "$have_xmlto" = yes; then
96907b58d2e0Smrg    # scrape the xmlto version
96917b58d2e0Smrg    AC_MSG_CHECKING([the xmlto version])
96927b58d2e0Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
96937b58d2e0Smrg    AC_MSG_RESULT([$xmlto_version])
96947b58d2e0Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
96957b58d2e0Smrg        [if test "x$use_xmlto" = xauto; then
96967b58d2e0Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
96977b58d2e0Smrg            have_xmlto=no
96987b58d2e0Smrg        else
96997b58d2e0Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
97007b58d2e0Smrg        fi])
97017b58d2e0Smrgfi])
9702e4f6584cSmrg
97037b58d2e0Smrg# Test for the ability of xmlto to generate a text target
97047b58d2e0Smrghave_xmlto_text=no
97057b58d2e0Smrgcat > conftest.xml << "EOF"
97067b58d2e0SmrgEOF
97077b58d2e0SmrgAS_IF([test "$have_xmlto" = yes],
97087b58d2e0Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
97097b58d2e0Smrg             [have_xmlto_text=yes],
97107b58d2e0Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
97117b58d2e0Smrgrm -f conftest.xml
97127b58d2e0SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
97137b58d2e0SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
97147b58d2e0Smrg]) # XORG_WITH_XMLTO
971509885543Smrg
9716b12e5c03Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
9717b12e5c03Smrg# --------------------------------------------
9718b12e5c03Smrg# Minimum version: 1.12.0
9719b12e5c03Smrg# Minimum version for optional DEFAULT argument: 1.12.0
9720b12e5c03Smrg#
9721b12e5c03Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
9722b12e5c03Smrg# XML-based language used for the transformation of XML documents.
9723b12e5c03Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
9724b12e5c03Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
9725b12e5c03Smrg# The XSLT processor is often used as a standalone tool for transformations.
9726b12e5c03Smrg# It should not be assumed that this tool is used only to work with documnetation.
9727b12e5c03Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
9728b12e5c03Smrg#
9729b12e5c03Smrg# Interface to module:
9730b12e5c03Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
9731b12e5c03Smrg# XSLTPROC:	 returns the path of the xsltproc program found
9732b12e5c03Smrg#		 returns the path set by the user in the environment
9733b12e5c03Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
9734b12e5c03Smrg#		  'no' user instructs the module not to use xsltproc
9735b12e5c03Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
9736b12e5c03Smrg#
9737b12e5c03Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
9738b12e5c03Smrg#
9739b12e5c03SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
9740b12e5c03SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
9741b12e5c03Smrg# Preserves the interface, should it be implemented later
9742b12e5c03Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
9743b12e5c03Smrgm4_define([_defopt], m4_default([$2], [auto]))
9744b12e5c03SmrgAC_ARG_WITH(xsltproc,
9745b12e5c03Smrg	AS_HELP_STRING([--with-xsltproc],
9746b12e5c03Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
9747b12e5c03Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
9748b12e5c03Smrgm4_undefine([_defopt])
9749b12e5c03Smrg
9750b12e5c03Smrgif test "x$use_xsltproc" = x"auto"; then
9751b12e5c03Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
9752b12e5c03Smrg   if test "x$XSLTPROC" = "x"; then
9753b12e5c03Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
9754b12e5c03Smrg	have_xsltproc=no
9755b12e5c03Smrg   else
9756b12e5c03Smrg        have_xsltproc=yes
9757b12e5c03Smrg   fi
9758b12e5c03Smrgelif test "x$use_xsltproc" = x"yes" ; then
9759b12e5c03Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
9760b12e5c03Smrg   if test "x$XSLTPROC" = "x"; then
9761b12e5c03Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
9762b12e5c03Smrg   fi
9763b12e5c03Smrg   have_xsltproc=yes
9764b12e5c03Smrgelif test "x$use_xsltproc" = x"no" ; then
9765b12e5c03Smrg   if test "x$XSLTPROC" != "x"; then
9766b12e5c03Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
9767b12e5c03Smrg   fi
9768b12e5c03Smrg   have_xsltproc=no
9769b12e5c03Smrgelse
9770b12e5c03Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
9771b12e5c03Smrgfi
9772b12e5c03Smrg
9773b12e5c03SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
9774b12e5c03Smrg]) # XORG_WITH_XSLTPROC
9775b12e5c03Smrg
9776b12e5c03Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
9777b12e5c03Smrg# ----------------------------------------
9778b12e5c03Smrg# Minimum version: 1.15.0
9779b12e5c03Smrg#
9780b12e5c03Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
9781b12e5c03Smrg# scanning arbitrary text files, extracting information from those text files,
9782b12e5c03Smrg# and printing reports based on that information.
9783b12e5c03Smrg#
9784b12e5c03Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
9785b12e5c03Smrg#
9786b12e5c03Smrg# Interface to module:
9787b12e5c03Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
9788b12e5c03Smrg# PERL:	     returns the path of the perl program found
9789b12e5c03Smrg#	     returns the path set by the user in the environment
9790b12e5c03Smrg# --with-perl: 'yes' user instructs the module to use perl
9791b12e5c03Smrg#	       'no' user instructs the module not to use perl
9792b12e5c03Smrg# have_perl: returns yes if perl found in PATH or no
9793b12e5c03Smrg#
9794b12e5c03Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
9795b12e5c03Smrg#
9796b12e5c03SmrgAC_DEFUN([XORG_WITH_PERL],[
9797b12e5c03SmrgAC_ARG_VAR([PERL], [Path to perl command])
9798b12e5c03Smrg# Preserves the interface, should it be implemented later
9799b12e5c03Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
9800b12e5c03Smrgm4_define([_defopt], m4_default([$2], [auto]))
9801b12e5c03SmrgAC_ARG_WITH(perl,
9802b12e5c03Smrg	AS_HELP_STRING([--with-perl],
9803b12e5c03Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
9804b12e5c03Smrg	   [use_perl=$withval], [use_perl=]_defopt)
9805b12e5c03Smrgm4_undefine([_defopt])
9806b12e5c03Smrg
9807b12e5c03Smrgif test "x$use_perl" = x"auto"; then
9808b12e5c03Smrg   AC_PATH_PROG([PERL], [perl])
9809b12e5c03Smrg   if test "x$PERL" = "x"; then
9810b12e5c03Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
9811b12e5c03Smrg	have_perl=no
9812b12e5c03Smrg   else
9813b12e5c03Smrg        have_perl=yes
9814b12e5c03Smrg   fi
9815b12e5c03Smrgelif test "x$use_perl" = x"yes" ; then
9816b12e5c03Smrg   AC_PATH_PROG([PERL], [perl])
9817b12e5c03Smrg   if test "x$PERL" = "x"; then
9818b12e5c03Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
9819b12e5c03Smrg   fi
9820b12e5c03Smrg   have_perl=yes
9821b12e5c03Smrgelif test "x$use_perl" = x"no" ; then
9822b12e5c03Smrg   if test "x$PERL" != "x"; then
9823b12e5c03Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
9824b12e5c03Smrg   fi
9825b12e5c03Smrg   have_perl=no
9826b12e5c03Smrgelse
9827b12e5c03Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
9828b12e5c03Smrgfi
9829b12e5c03Smrg
9830b12e5c03SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
9831b12e5c03Smrg]) # XORG_WITH_PERL
9832b12e5c03Smrg
9833b12e5c03Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
98347b58d2e0Smrg# ----------------
98357b58d2e0Smrg# Minimum version: 1.5.0
9836b12e5c03Smrg# Minimum version for optional DEFAULT argument: 1.11.0
98377b58d2e0Smrg#
98387b58d2e0Smrg# Documentation tools are not always available on all platforms and sometimes
98397b58d2e0Smrg# not at the appropriate level. This macro enables a module to test for the
98407b58d2e0Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
98417b58d2e0Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
9842b12e5c03Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
9843b12e5c03Smrg# --with-asciidoc assumes 'auto'.
98447b58d2e0Smrg#
98457b58d2e0Smrg# Interface to module:
98467b58d2e0Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
98477b58d2e0Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
98487b58d2e0Smrg#		 returns the path set by the user in the environment
98497b58d2e0Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
98507b58d2e0Smrg#		  'no' user instructs the module not to use asciidoc
98517b58d2e0Smrg#
98527b58d2e0Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
98537b58d2e0Smrg#
98547b58d2e0SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
98557b58d2e0SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
9856b12e5c03Smrgm4_define([_defopt], m4_default([$2], [auto]))
98577b58d2e0SmrgAC_ARG_WITH(asciidoc,
98587b58d2e0Smrg	AS_HELP_STRING([--with-asciidoc],
9859b12e5c03Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
9860b12e5c03Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
9861b12e5c03Smrgm4_undefine([_defopt])
986209885543Smrg
98637b58d2e0Smrgif test "x$use_asciidoc" = x"auto"; then
98647b58d2e0Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
98657b58d2e0Smrg   if test "x$ASCIIDOC" = "x"; then
98667b58d2e0Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
98677b58d2e0Smrg	have_asciidoc=no
98687b58d2e0Smrg   else
98697b58d2e0Smrg        have_asciidoc=yes
98707b58d2e0Smrg   fi
98717b58d2e0Smrgelif test "x$use_asciidoc" = x"yes" ; then
98727b58d2e0Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
98737b58d2e0Smrg   if test "x$ASCIIDOC" = "x"; then
98747b58d2e0Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
98757b58d2e0Smrg   fi
98767b58d2e0Smrg   have_asciidoc=yes
98777b58d2e0Smrgelif test "x$use_asciidoc" = x"no" ; then
98787b58d2e0Smrg   if test "x$ASCIIDOC" != "x"; then
98797b58d2e0Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
98807b58d2e0Smrg   fi
98817b58d2e0Smrg   have_asciidoc=no
98827b58d2e0Smrgelse
98837b58d2e0Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
98847b58d2e0Smrgfi
98857b58d2e0Smrgm4_ifval([$1],
98867b58d2e0Smrg[if test "$have_asciidoc" = yes; then
98877b58d2e0Smrg    # scrape the asciidoc version
98887b58d2e0Smrg    AC_MSG_CHECKING([the asciidoc version])
98897b58d2e0Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
98907b58d2e0Smrg    AC_MSG_RESULT([$asciidoc_version])
98917b58d2e0Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
98927b58d2e0Smrg        [if test "x$use_asciidoc" = xauto; then
98937b58d2e0Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
98947b58d2e0Smrg            have_asciidoc=no
98957b58d2e0Smrg        else
98967b58d2e0Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
98977b58d2e0Smrg        fi])
98987b58d2e0Smrgfi])
98997b58d2e0SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
99007b58d2e0Smrg]) # XORG_WITH_ASCIIDOC
990109885543Smrg
9902b12e5c03Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
9903df9ffc95Smrg# -------------------------------------------
99047b58d2e0Smrg# Minimum version: 1.5.0
9905b12e5c03Smrg# Minimum version for optional DEFAULT argument: 1.11.0
9906df9ffc95Smrg# Minimum version for optional DOT checking: 1.18.0
99077b58d2e0Smrg#
99087b58d2e0Smrg# Documentation tools are not always available on all platforms and sometimes
99097b58d2e0Smrg# not at the appropriate level. This macro enables a module to test for the
99107b58d2e0Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
99117b58d2e0Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
9912b12e5c03Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
9913b12e5c03Smrg# --with-doxygen assumes 'auto'.
99147b58d2e0Smrg#
99157b58d2e0Smrg# Interface to module:
99167b58d2e0Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
99177b58d2e0Smrg# DOXYGEN:	 returns the path of the doxygen program found
99187b58d2e0Smrg#		 returns the path set by the user in the environment
99197b58d2e0Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
99207b58d2e0Smrg#		  'no' user instructs the module not to use doxygen
99217b58d2e0Smrg#
99227b58d2e0Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
99237b58d2e0Smrg#
99247b58d2e0SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
99257b58d2e0SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
9926df9ffc95SmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
9927b12e5c03Smrgm4_define([_defopt], m4_default([$2], [auto]))
99287b58d2e0SmrgAC_ARG_WITH(doxygen,
99297b58d2e0Smrg	AS_HELP_STRING([--with-doxygen],
9930b12e5c03Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
9931b12e5c03Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
9932b12e5c03Smrgm4_undefine([_defopt])
993309885543Smrg
99347b58d2e0Smrgif test "x$use_doxygen" = x"auto"; then
99357b58d2e0Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
99367b58d2e0Smrg   if test "x$DOXYGEN" = "x"; then
99377b58d2e0Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
99387b58d2e0Smrg	have_doxygen=no
99397b58d2e0Smrg   else
99407b58d2e0Smrg        have_doxygen=yes
99417b58d2e0Smrg   fi
99427b58d2e0Smrgelif test "x$use_doxygen" = x"yes" ; then
99437b58d2e0Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
99447b58d2e0Smrg   if test "x$DOXYGEN" = "x"; then
99457b58d2e0Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
99467b58d2e0Smrg   fi
99477b58d2e0Smrg   have_doxygen=yes
99487b58d2e0Smrgelif test "x$use_doxygen" = x"no" ; then
99497b58d2e0Smrg   if test "x$DOXYGEN" != "x"; then
99507b58d2e0Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
99517b58d2e0Smrg   fi
99527b58d2e0Smrg   have_doxygen=no
99537b58d2e0Smrgelse
99547b58d2e0Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
99557b58d2e0Smrgfi
99567b58d2e0Smrgm4_ifval([$1],
99577b58d2e0Smrg[if test "$have_doxygen" = yes; then
99587b58d2e0Smrg    # scrape the doxygen version
99597b58d2e0Smrg    AC_MSG_CHECKING([the doxygen version])
99607b58d2e0Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
99617b58d2e0Smrg    AC_MSG_RESULT([$doxygen_version])
99627b58d2e0Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
99637b58d2e0Smrg        [if test "x$use_doxygen" = xauto; then
99647b58d2e0Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
99657b58d2e0Smrg            have_doxygen=no
99667b58d2e0Smrg        else
99677b58d2e0Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
99687b58d2e0Smrg        fi])
99697b58d2e0Smrgfi])
9970df9ffc95Smrg
9971df9ffc95Smrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
9972df9ffc95Smrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
9973df9ffc95Smrgdnl 	HAVE_DOT = @HAVE_DOT@
9974df9ffc95SmrgHAVE_DOT=no
9975df9ffc95Smrgif test "x$have_doxygen" = "xyes"; then
9976df9ffc95Smrg  AC_PATH_PROG([DOT], [dot])
9977df9ffc95Smrg    if test "x$DOT" != "x"; then
9978df9ffc95Smrg      HAVE_DOT=yes
9979df9ffc95Smrg    fi
9980df9ffc95Smrgfi
9981df9ffc95Smrg
9982df9ffc95SmrgAC_SUBST([HAVE_DOT])
9983df9ffc95SmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
99847b58d2e0SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
99857b58d2e0Smrg]) # XORG_WITH_DOXYGEN
998609885543Smrg
9987b12e5c03Smrg# XORG_WITH_GROFF([DEFAULT])
99887b58d2e0Smrg# ----------------
99897b58d2e0Smrg# Minimum version: 1.6.0
9990b12e5c03Smrg# Minimum version for optional DEFAULT argument: 1.11.0
99917b58d2e0Smrg#
99927b58d2e0Smrg# Documentation tools are not always available on all platforms and sometimes
99937b58d2e0Smrg# not at the appropriate level. This macro enables a module to test for the
99947b58d2e0Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
99957b58d2e0Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
9996b12e5c03Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
9997b12e5c03Smrg# --with-groff assumes 'auto'.
99987b58d2e0Smrg#
99997b58d2e0Smrg# Interface to module:
100007b58d2e0Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
100017b58d2e0Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
100027b58d2e0Smrg# HAVE_GROFF_MS: the -ms macros package
100037b58d2e0Smrg# GROFF:	 returns the path of the groff program found
100047b58d2e0Smrg#		 returns the path set by the user in the environment
100057b58d2e0Smrg# --with-groff:	 'yes' user instructs the module to use groff
100067b58d2e0Smrg#		 'no' user instructs the module not to use groff
100077b58d2e0Smrg#
100087b58d2e0Smrg# Added in version 1.9.0:
100097b58d2e0Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
100107b58d2e0Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
100117b58d2e0Smrg#		   psselect from the psutils package.
100127b58d2e0Smrg#		   the ghostcript package. Refer to the grohtml man pages
100137b58d2e0Smrg#
100147b58d2e0Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
100157b58d2e0Smrg#
100167b58d2e0Smrg# OS and distros often splits groff in a basic and full package, the former
100177b58d2e0Smrg# having the groff program and the later having devices, fonts and macros
100187b58d2e0Smrg# Checking for the groff executable is not enough.
100197b58d2e0Smrg#
100207b58d2e0Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
100217b58d2e0Smrg# unset HAVE_GROFF or GROFF env variables.
100227b58d2e0Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
100237b58d2e0Smrg#
100247b58d2e0SmrgAC_DEFUN([XORG_WITH_GROFF],[
100257b58d2e0SmrgAC_ARG_VAR([GROFF], [Path to groff command])
10026b12e5c03Smrgm4_define([_defopt], m4_default([$1], [auto]))
100277b58d2e0SmrgAC_ARG_WITH(groff,
100287b58d2e0Smrg	AS_HELP_STRING([--with-groff],
10029b12e5c03Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
10030b12e5c03Smrg	   [use_groff=$withval], [use_groff=]_defopt)
10031b12e5c03Smrgm4_undefine([_defopt])
1003209885543Smrg
100337b58d2e0Smrgif test "x$use_groff" = x"auto"; then
100347b58d2e0Smrg   AC_PATH_PROG([GROFF], [groff])
100357b58d2e0Smrg   if test "x$GROFF" = "x"; then
100367b58d2e0Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
100377b58d2e0Smrg	have_groff=no
100387b58d2e0Smrg   else
100397b58d2e0Smrg        have_groff=yes
100407b58d2e0Smrg   fi
100417b58d2e0Smrgelif test "x$use_groff" = x"yes" ; then
100427b58d2e0Smrg   AC_PATH_PROG([GROFF], [groff])
100437b58d2e0Smrg   if test "x$GROFF" = "x"; then
100447b58d2e0Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
100457b58d2e0Smrg   fi
100467b58d2e0Smrg   have_groff=yes
100477b58d2e0Smrgelif test "x$use_groff" = x"no" ; then
100487b58d2e0Smrg   if test "x$GROFF" != "x"; then
100497b58d2e0Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
100507b58d2e0Smrg   fi
100517b58d2e0Smrg   have_groff=no
100527b58d2e0Smrgelse
100537b58d2e0Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
100547b58d2e0Smrgfi
10055e4f6584cSmrg
100567b58d2e0Smrg# We have groff, test for the presence of the macro packages
100577b58d2e0Smrgif test "x$have_groff" = x"yes"; then
100587b58d2e0Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
100597b58d2e0Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
100607b58d2e0Smrg        groff_ms_works=yes
100617b58d2e0Smrg    else
100627b58d2e0Smrg        groff_ms_works=no
100637b58d2e0Smrg    fi
100647b58d2e0Smrg    AC_MSG_RESULT([$groff_ms_works])
100657b58d2e0Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
100667b58d2e0Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
100677b58d2e0Smrg        groff_mm_works=yes
100687b58d2e0Smrg    else
100697b58d2e0Smrg        groff_mm_works=no
100707b58d2e0Smrg    fi
100717b58d2e0Smrg    AC_MSG_RESULT([$groff_mm_works])
100727b58d2e0Smrgfi
10073e4f6584cSmrg
100747b58d2e0Smrg# We have groff, test for HTML dependencies, one command per package
100757b58d2e0Smrgif test "x$have_groff" = x"yes"; then
100767b58d2e0Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
100777b58d2e0Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
100787b58d2e0Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
100797b58d2e0Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
100807b58d2e0Smrg      have_groff_html=yes
100817b58d2e0Smrg   else
100827b58d2e0Smrg      have_groff_html=no
100837b58d2e0Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
100847b58d2e0Smrg   fi
100857b58d2e0Smrgfi
10086e4f6584cSmrg
100877b58d2e0Smrg# Set Automake conditionals for Makefiles
100887b58d2e0SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
100897b58d2e0SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
100907b58d2e0SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
100917b58d2e0SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
100927b58d2e0Smrg]) # XORG_WITH_GROFF
10093e4f6584cSmrg
10094b12e5c03Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
10095b12e5c03Smrg# ---------------------------------------
100967b58d2e0Smrg# Minimum version: 1.6.0
10097b12e5c03Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10098b12e5c03Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
100997b58d2e0Smrg#
101007b58d2e0Smrg# Documentation tools are not always available on all platforms and sometimes
101017b58d2e0Smrg# not at the appropriate level. This macro enables a module to test for the
101027b58d2e0Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
101037b58d2e0Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
10104b12e5c03Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
10105b12e5c03Smrg# --with-fop assumes 'auto'.
101067b58d2e0Smrg#
101077b58d2e0Smrg# Interface to module:
101087b58d2e0Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
101097b58d2e0Smrg# FOP:	 	returns the path of the fop program found
101107b58d2e0Smrg#		returns the path set by the user in the environment
101117b58d2e0Smrg# --with-fop: 	'yes' user instructs the module to use fop
101127b58d2e0Smrg#		'no' user instructs the module not to use fop
101137b58d2e0Smrg#
101147b58d2e0Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
101157b58d2e0Smrg#
101167b58d2e0SmrgAC_DEFUN([XORG_WITH_FOP],[
101177b58d2e0SmrgAC_ARG_VAR([FOP], [Path to fop command])
10118b12e5c03Smrgm4_define([_defopt], m4_default([$2], [auto]))
101197b58d2e0SmrgAC_ARG_WITH(fop,
101207b58d2e0Smrg	AS_HELP_STRING([--with-fop],
10121b12e5c03Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
10122b12e5c03Smrg	   [use_fop=$withval], [use_fop=]_defopt)
10123b12e5c03Smrgm4_undefine([_defopt])
10124e4f6584cSmrg
101257b58d2e0Smrgif test "x$use_fop" = x"auto"; then
101267b58d2e0Smrg   AC_PATH_PROG([FOP], [fop])
101277b58d2e0Smrg   if test "x$FOP" = "x"; then
101287b58d2e0Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
101297b58d2e0Smrg	have_fop=no
101307b58d2e0Smrg   else
101317b58d2e0Smrg        have_fop=yes
101327b58d2e0Smrg   fi
101337b58d2e0Smrgelif test "x$use_fop" = x"yes" ; then
101347b58d2e0Smrg   AC_PATH_PROG([FOP], [fop])
101357b58d2e0Smrg   if test "x$FOP" = "x"; then
101367b58d2e0Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
101377b58d2e0Smrg   fi
101387b58d2e0Smrg   have_fop=yes
101397b58d2e0Smrgelif test "x$use_fop" = x"no" ; then
101407b58d2e0Smrg   if test "x$FOP" != "x"; then
101417b58d2e0Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
101427b58d2e0Smrg   fi
101437b58d2e0Smrg   have_fop=no
10144e4f6584cSmrgelse
101457b58d2e0Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
10146e4f6584cSmrgfi
10147b12e5c03Smrg
10148b12e5c03Smrg# Test for a minimum version of fop, if provided.
10149b12e5c03Smrgm4_ifval([$1],
10150b12e5c03Smrg[if test "$have_fop" = yes; then
10151b12e5c03Smrg    # scrape the fop version
10152b12e5c03Smrg    AC_MSG_CHECKING([for fop minimum version])
10153b12e5c03Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
10154b12e5c03Smrg    AC_MSG_RESULT([$fop_version])
10155b12e5c03Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
10156b12e5c03Smrg        [if test "x$use_fop" = xauto; then
10157b12e5c03Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
10158b12e5c03Smrg            have_fop=no
10159b12e5c03Smrg        else
10160b12e5c03Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
10161b12e5c03Smrg        fi])
10162b12e5c03Smrgfi])
101637b58d2e0SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
101647b58d2e0Smrg]) # XORG_WITH_FOP
10165e4f6584cSmrg
10166df9ffc95Smrg# XORG_WITH_M4([MIN-VERSION])
10167df9ffc95Smrg# ---------------------------
10168df9ffc95Smrg# Minimum version: 1.19.0
10169df9ffc95Smrg#
10170df9ffc95Smrg# This macro attempts to locate an m4 macro processor which supports
10171df9ffc95Smrg# -I option and is only useful for modules relying on M4 in order to
10172df9ffc95Smrg# expand macros in source code files.
10173df9ffc95Smrg#
10174df9ffc95Smrg# Interface to module:
10175df9ffc95Smrg# M4:	 	returns the path of the m4 program found
10176df9ffc95Smrg#		returns the path set by the user in the environment
10177df9ffc95Smrg#
10178df9ffc95SmrgAC_DEFUN([XORG_WITH_M4], [
10179df9ffc95SmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
10180df9ffc95Smrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
10181df9ffc95Smrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
10182df9ffc95Smrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
10183df9ffc95Smrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
10184df9ffc95Smrg   [$PATH:/usr/gnu/bin])])
10185df9ffc95Smrg
10186df9ffc95SmrgAC_SUBST([M4], [$ac_cv_path_M4])
10187df9ffc95Smrg]) # XORG_WITH_M4
10188df9ffc95Smrg
10189b12e5c03Smrg# XORG_WITH_PS2PDF([DEFAULT])
101907b58d2e0Smrg# ----------------
101917b58d2e0Smrg# Minimum version: 1.6.0
10192b12e5c03Smrg# Minimum version for optional DEFAULT argument: 1.11.0
101937b58d2e0Smrg#
101947b58d2e0Smrg# Documentation tools are not always available on all platforms and sometimes
101957b58d2e0Smrg# not at the appropriate level. This macro enables a module to test for the
101967b58d2e0Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
101977b58d2e0Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
10198b12e5c03Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
10199b12e5c03Smrg# --with-ps2pdf assumes 'auto'.
102007b58d2e0Smrg#
102017b58d2e0Smrg# Interface to module:
102027b58d2e0Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
102037b58d2e0Smrg# PS2PDF:	returns the path of the ps2pdf program found
102047b58d2e0Smrg#		returns the path set by the user in the environment
102057b58d2e0Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
102067b58d2e0Smrg#		 'no' user instructs the module not to use ps2pdf
102077b58d2e0Smrg#
102087b58d2e0Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
102097b58d2e0Smrg#
102107b58d2e0SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
102117b58d2e0SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
10212b12e5c03Smrgm4_define([_defopt], m4_default([$1], [auto]))
102137b58d2e0SmrgAC_ARG_WITH(ps2pdf,
102147b58d2e0Smrg	AS_HELP_STRING([--with-ps2pdf],
10215b12e5c03Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
10216b12e5c03Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
10217b12e5c03Smrgm4_undefine([_defopt])
10218e4f6584cSmrg
102197b58d2e0Smrgif test "x$use_ps2pdf" = x"auto"; then
102207b58d2e0Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
102217b58d2e0Smrg   if test "x$PS2PDF" = "x"; then
102227b58d2e0Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
102237b58d2e0Smrg	have_ps2pdf=no
102247b58d2e0Smrg   else
102257b58d2e0Smrg        have_ps2pdf=yes
102267b58d2e0Smrg   fi
102277b58d2e0Smrgelif test "x$use_ps2pdf" = x"yes" ; then
102287b58d2e0Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
102297b58d2e0Smrg   if test "x$PS2PDF" = "x"; then
102307b58d2e0Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
102317b58d2e0Smrg   fi
102327b58d2e0Smrg   have_ps2pdf=yes
102337b58d2e0Smrgelif test "x$use_ps2pdf" = x"no" ; then
102347b58d2e0Smrg   if test "x$PS2PDF" != "x"; then
102357b58d2e0Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
102367b58d2e0Smrg   fi
102377b58d2e0Smrg   have_ps2pdf=no
102387b58d2e0Smrgelse
102397b58d2e0Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
102407b58d2e0Smrgfi
102417b58d2e0SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
102427b58d2e0Smrg]) # XORG_WITH_PS2PDF
1024309885543Smrg
102447b58d2e0Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
102457b58d2e0Smrg# ----------------
102467b58d2e0Smrg# Minimum version: 1.6.0
102477b58d2e0Smrg#
102487b58d2e0Smrg# Documentation tools are not always available on all platforms and sometimes
102497b58d2e0Smrg# not at the appropriate level. This macro enables a builder to skip all
102507b58d2e0Smrg# documentation targets except traditional man pages.
102517b58d2e0Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
102527b58d2e0Smrg# maximum flexibilty in controlling documentation building.
102537b58d2e0Smrg# Refer to:
102547b58d2e0Smrg# XORG_WITH_XMLTO         --with-xmlto
102557b58d2e0Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
102567b58d2e0Smrg# XORG_WITH_DOXYGEN       --with-doxygen
102577b58d2e0Smrg# XORG_WITH_FOP           --with-fop
102587b58d2e0Smrg# XORG_WITH_GROFF         --with-groff
102597b58d2e0Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
102607b58d2e0Smrg#
102617b58d2e0Smrg# Interface to module:
102627b58d2e0Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
102637b58d2e0Smrg# --enable-docs: 'yes' user instructs the module to generate docs
102647b58d2e0Smrg#		 'no' user instructs the module not to generate docs
102657b58d2e0Smrg# parm1:	specify the default value, yes or no.
102667b58d2e0Smrg#
102677b58d2e0SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
10268b12e5c03Smrgm4_define([docs_default], m4_default([$1], [yes]))
102697b58d2e0SmrgAC_ARG_ENABLE(docs,
102707b58d2e0Smrg	AS_HELP_STRING([--enable-docs],
10271b12e5c03Smrg	   [Enable building the documentation (default: ]docs_default[)]),
10272b12e5c03Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
10273b12e5c03Smrgm4_undefine([docs_default])
102747b58d2e0SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
102757b58d2e0SmrgAC_MSG_CHECKING([whether to build documentation])
102767b58d2e0SmrgAC_MSG_RESULT([$build_docs])
102777b58d2e0Smrg]) # XORG_ENABLE_DOCS
1027809885543Smrg
102797b58d2e0Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
102807b58d2e0Smrg# ----------------
102817b58d2e0Smrg# Minimum version: 1.6.0
102827b58d2e0Smrg#
102837b58d2e0Smrg# This macro enables a builder to skip all developer documentation.
102847b58d2e0Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
102857b58d2e0Smrg# maximum flexibilty in controlling documentation building.
102867b58d2e0Smrg# Refer to:
102877b58d2e0Smrg# XORG_WITH_XMLTO         --with-xmlto
102887b58d2e0Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
102897b58d2e0Smrg# XORG_WITH_DOXYGEN       --with-doxygen
102907b58d2e0Smrg# XORG_WITH_FOP           --with-fop
102917b58d2e0Smrg# XORG_WITH_GROFF         --with-groff
102927b58d2e0Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
102937b58d2e0Smrg#
102947b58d2e0Smrg# Interface to module:
102957b58d2e0Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
102967b58d2e0Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
102977b58d2e0Smrg#			'no' user instructs the module not to generate developer docs
102987b58d2e0Smrg# parm1:		specify the default value, yes or no.
102997b58d2e0Smrg#
103007b58d2e0SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
10301b12e5c03Smrgm4_define([devel_default], m4_default([$1], [yes]))
103027b58d2e0SmrgAC_ARG_ENABLE(devel-docs,
103037b58d2e0Smrg	AS_HELP_STRING([--enable-devel-docs],
10304b12e5c03Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
10305b12e5c03Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
10306b12e5c03Smrgm4_undefine([devel_default])
103077b58d2e0SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
103087b58d2e0SmrgAC_MSG_CHECKING([whether to build developer documentation])
103097b58d2e0SmrgAC_MSG_RESULT([$build_devel_docs])
103107b58d2e0Smrg]) # XORG_ENABLE_DEVEL_DOCS
1031109885543Smrg
103127b58d2e0Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
103137b58d2e0Smrg# ----------------
103147b58d2e0Smrg# Minimum version: 1.6.0
103157b58d2e0Smrg#
103167b58d2e0Smrg# This macro enables a builder to skip all functional specification targets.
103177b58d2e0Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
103187b58d2e0Smrg# maximum flexibilty in controlling documentation building.
103197b58d2e0Smrg# Refer to:
103207b58d2e0Smrg# XORG_WITH_XMLTO         --with-xmlto
103217b58d2e0Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
103227b58d2e0Smrg# XORG_WITH_DOXYGEN       --with-doxygen
103237b58d2e0Smrg# XORG_WITH_FOP           --with-fop
103247b58d2e0Smrg# XORG_WITH_GROFF         --with-groff
103257b58d2e0Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
103267b58d2e0Smrg#
103277b58d2e0Smrg# Interface to module:
103287b58d2e0Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
103297b58d2e0Smrg# --enable-specs:	'yes' user instructs the module to generate specs
103307b58d2e0Smrg#			'no' user instructs the module not to generate specs
103317b58d2e0Smrg# parm1:		specify the default value, yes or no.
103327b58d2e0Smrg#
103337b58d2e0SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
10334b12e5c03Smrgm4_define([spec_default], m4_default([$1], [yes]))
103357b58d2e0SmrgAC_ARG_ENABLE(specs,
103367b58d2e0Smrg	AS_HELP_STRING([--enable-specs],
10337b12e5c03Smrg	   [Enable building the specs (default: ]spec_default[)]),
10338b12e5c03Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
10339b12e5c03Smrgm4_undefine([spec_default])
103407b58d2e0SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
103417b58d2e0SmrgAC_MSG_CHECKING([whether to build functional specifications])
103427b58d2e0SmrgAC_MSG_RESULT([$build_specs])
103437b58d2e0Smrg]) # XORG_ENABLE_SPECS
1034409885543Smrg
10345b12e5c03Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
10346b12e5c03Smrg# ----------------------------------------------
10347b12e5c03Smrg# Minimum version: 1.13.0
10348b12e5c03Smrg#
10349b12e5c03Smrg# This macro enables a builder to enable/disable unit testing
10350b12e5c03Smrg# It makes no assumption about the test cases implementation
10351b12e5c03Smrg# Test cases may or may not use Automake "Support for test suites"
10352b12e5c03Smrg# They may or may not use the software utility library GLib
10353b12e5c03Smrg#
10354b12e5c03Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
10355b12e5c03Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
10356b12e5c03Smrg# The variable enable_unit_tests is used by other macros in this file.
10357b12e5c03Smrg#
10358b12e5c03Smrg# Interface to module:
10359b12e5c03Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
10360b12e5c03Smrg# enable_unit_tests:    used in configure.ac for additional configuration
10361b12e5c03Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
10362b12e5c03Smrg#			'no' user instructs the module not to build tests
10363b12e5c03Smrg# parm1:		specify the default value, yes or no.
10364b12e5c03Smrg#
10365b12e5c03SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
10366b12e5c03SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
10367b12e5c03SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
10368b12e5c03SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10369b12e5c03Smrgm4_define([_defopt], m4_default([$1], [auto]))
10370b12e5c03SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
10371b12e5c03Smrg	[Enable building unit test cases (default: ]_defopt[)]),
10372b12e5c03Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
10373b12e5c03Smrgm4_undefine([_defopt])
10374b12e5c03SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
10375b12e5c03SmrgAC_MSG_CHECKING([whether to build unit test cases])
10376b12e5c03SmrgAC_MSG_RESULT([$enable_unit_tests])
10377b12e5c03Smrg]) # XORG_ENABLE_UNIT_TESTS
10378b12e5c03Smrg
10379b12e5c03Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
10380b12e5c03Smrg# ------------------------------------------------------
10381b12e5c03Smrg# Minimum version: 1.17.0
10382b12e5c03Smrg#
10383b12e5c03Smrg# This macro enables a builder to enable/disable integration testing
10384b12e5c03Smrg# It makes no assumption about the test cases' implementation
10385b12e5c03Smrg# Test cases may or may not use Automake "Support for test suites"
10386b12e5c03Smrg#
10387b12e5c03Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
10388b12e5c03Smrg# usually requires less dependencies and may be built and run under less
10389b12e5c03Smrg# stringent environments than integration tests.
10390b12e5c03Smrg#
10391b12e5c03Smrg# Interface to module:
10392b12e5c03Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
10393b12e5c03Smrg# enable_integration_tests:   used in configure.ac for additional configuration
10394b12e5c03Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
10395b12e5c03Smrg#                             'no' user instructs the module not to build tests
10396b12e5c03Smrg# parm1:                      specify the default value, yes or no.
10397b12e5c03Smrg#
10398b12e5c03SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
10399b12e5c03SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10400b12e5c03Smrgm4_define([_defopt], m4_default([$1], [auto]))
10401b12e5c03SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
10402b12e5c03Smrg	[Enable building integration test cases (default: ]_defopt[)]),
10403b12e5c03Smrg	[enable_integration_tests=$enableval],
10404b12e5c03Smrg	[enable_integration_tests=]_defopt)
10405b12e5c03Smrgm4_undefine([_defopt])
10406b12e5c03SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
10407b12e5c03Smrg	[test "x$enable_integration_tests" != xno])
10408b12e5c03SmrgAC_MSG_CHECKING([whether to build unit test cases])
10409b12e5c03SmrgAC_MSG_RESULT([$enable_integration_tests])
10410b12e5c03Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
10411b12e5c03Smrg
10412b12e5c03Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
10413b12e5c03Smrg# ----------------------------------------
10414b12e5c03Smrg# Minimum version: 1.13.0
10415b12e5c03Smrg#
10416b12e5c03Smrg# GLib is a library which provides advanced data structures and functions.
10417b12e5c03Smrg# This macro enables a module to test for the presence of Glib.
10418b12e5c03Smrg#
10419b12e5c03Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
10420b12e5c03Smrg# Otherwise the value of $enable_unit_tests is blank.
10421b12e5c03Smrg#
10422b12e5c03Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
10423b12e5c03Smrg# test support usually requires less dependencies and may be built and run under
10424b12e5c03Smrg# less stringent environments than integration tests.
10425b12e5c03Smrg#
10426b12e5c03Smrg# Interface to module:
10427b12e5c03Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
10428b12e5c03Smrg# with_glib: used in configure.ac to know if GLib has been found
10429b12e5c03Smrg# --with-glib:	'yes' user instructs the module to use glib
10430b12e5c03Smrg#		'no' user instructs the module not to use glib
10431b12e5c03Smrg#
10432b12e5c03SmrgAC_DEFUN([XORG_WITH_GLIB],[
10433b12e5c03SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
10434b12e5c03Smrgm4_define([_defopt], m4_default([$2], [auto]))
10435b12e5c03SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
10436b12e5c03Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
10437b12e5c03Smrg	[with_glib=$withval], [with_glib=]_defopt)
10438b12e5c03Smrgm4_undefine([_defopt])
10439b12e5c03Smrg
10440b12e5c03Smrghave_glib=no
10441b12e5c03Smrg# Do not probe GLib if user explicitly disabled unit testing
10442b12e5c03Smrgif test "x$enable_unit_tests" != x"no"; then
10443b12e5c03Smrg  # Do not probe GLib if user explicitly disabled it
10444b12e5c03Smrg  if test "x$with_glib" != x"no"; then
10445b12e5c03Smrg    m4_ifval(
10446b12e5c03Smrg      [$1],
10447b12e5c03Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
10448b12e5c03Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
10449b12e5c03Smrg    )
10450b12e5c03Smrg  fi
10451b12e5c03Smrgfi
10452b12e5c03Smrg
10453b12e5c03Smrg# Not having GLib when unit testing has been explicitly requested is an error
10454b12e5c03Smrgif test "x$enable_unit_tests" = x"yes"; then
10455b12e5c03Smrg  if test "x$have_glib" = x"no"; then
10456b12e5c03Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10457b12e5c03Smrg  fi
10458b12e5c03Smrgfi
10459b12e5c03Smrg
10460b12e5c03Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
10461b12e5c03Smrgif test "x$enable_unit_tests" = x"no"; then
10462b12e5c03Smrg  if test "x$with_glib" = x"yes"; then
10463b12e5c03Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10464b12e5c03Smrg  fi
10465b12e5c03Smrgfi
10466b12e5c03Smrg
10467b12e5c03Smrg# Not having GLib when it has been explicitly requested is an error
10468b12e5c03Smrgif test "x$with_glib" = x"yes"; then
10469b12e5c03Smrg  if test "x$have_glib" = x"no"; then
10470b12e5c03Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
10471b12e5c03Smrg  fi
10472b12e5c03Smrgfi
10473b12e5c03Smrg
10474b12e5c03SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
10475b12e5c03Smrg]) # XORG_WITH_GLIB
10476b12e5c03Smrg
10477b12e5c03Smrg# XORG_LD_WRAP([required|optional])
10478b12e5c03Smrg# ---------------------------------
10479b12e5c03Smrg# Minimum version: 1.13.0
10480b12e5c03Smrg#
10481b12e5c03Smrg# Check if linker supports -wrap, passed via compiler flags
10482b12e5c03Smrg#
10483b12e5c03Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
10484b12e5c03Smrg# Otherwise the value of $enable_unit_tests is blank.
10485b12e5c03Smrg#
10486b12e5c03Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
10487b12e5c03Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
10488b12e5c03Smrg# available, an argument of "optional" allows use when some unit tests require
10489b12e5c03Smrg# ld -wrap and others do not.
10490b12e5c03Smrg#
10491b12e5c03SmrgAC_DEFUN([XORG_LD_WRAP],[
10492b12e5c03SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
10493b12e5c03Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
10494b12e5c03Smrg                      void __wrap_exit(int status) { return; }],
10495b12e5c03Smrg                     [exit(0);])])
10496b12e5c03Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
10497b12e5c03Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
10498b12e5c03Smrg  if test "x$have_ld_wrap" = x"no"; then
10499b12e5c03Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
10500b12e5c03Smrg  fi
10501b12e5c03Smrgfi
10502b12e5c03SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
10503b12e5c03Smrg#
10504b12e5c03Smrg]) # XORG_LD_WRAP
10505b12e5c03Smrg
10506b12e5c03Smrg# XORG_CHECK_LINKER_FLAGS
10507b12e5c03Smrg# -----------------------
10508b12e5c03Smrg# SYNOPSIS
10509b12e5c03Smrg#
10510b12e5c03Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
10511b12e5c03Smrg#
10512b12e5c03Smrg# DESCRIPTION
10513b12e5c03Smrg#
10514b12e5c03Smrg#   Check whether the given linker FLAGS work with the current language's
10515b12e5c03Smrg#   linker, or whether they give an error.
10516b12e5c03Smrg#
10517b12e5c03Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
10518b12e5c03Smrg#   success/failure.
10519b12e5c03Smrg#
10520b12e5c03Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
10521b12e5c03Smrg#
10522b12e5c03Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
10523b12e5c03Smrg#
10524b12e5c03Smrg# LICENSE
10525b12e5c03Smrg#
10526b12e5c03Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
10527b12e5c03Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
10528b12e5c03Smrg#   Copyright (c) 2009 Matteo Frigo
10529b12e5c03Smrg#
10530b12e5c03Smrg#   This program is free software: you can redistribute it and/or modify it
10531b12e5c03Smrg#   under the terms of the GNU General Public License as published by the
10532b12e5c03Smrg#   Free Software Foundation, either version 3 of the License, or (at your
10533b12e5c03Smrg#   option) any later version.
10534b12e5c03Smrg#
10535b12e5c03Smrg#   This program is distributed in the hope that it will be useful, but
10536b12e5c03Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
10537b12e5c03Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
10538b12e5c03Smrg#   Public License for more details.
10539b12e5c03Smrg#
10540b12e5c03Smrg#   You should have received a copy of the GNU General Public License along
10541b12e5c03Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
10542b12e5c03Smrg#
10543b12e5c03Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
10544b12e5c03Smrg#   gives unlimited permission to copy, distribute and modify the configure
10545b12e5c03Smrg#   scripts that are the output of Autoconf when processing the Macro. You
10546b12e5c03Smrg#   need not follow the terms of the GNU General Public License when using
10547b12e5c03Smrg#   or distributing such scripts, even though portions of the text of the
10548b12e5c03Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
10549b12e5c03Smrg#   all other use of the material that constitutes the Autoconf Macro.
10550b12e5c03Smrg#
10551b12e5c03Smrg#   This special exception to the GPL applies to versions of the Autoconf
10552b12e5c03Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
10553b12e5c03Smrg#   modified version of the Autoconf Macro, you may extend this special
10554b12e5c03Smrg#   exception to the GPL to apply to your modified version as well.#
10555b12e5c03SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
10556b12e5c03Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
10557b12e5c03Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
10558b12e5c03SmrgAS_LITERAL_IF([$1],
10559b12e5c03Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
10560b12e5c03Smrg      ax_save_FLAGS=$LDFLAGS
10561b12e5c03Smrg      LDFLAGS="$1"
10562b12e5c03Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
10563b12e5c03Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
10564b12e5c03Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
10565b12e5c03Smrg      LDFLAGS=$ax_save_FLAGS])],
10566b12e5c03Smrg  [ax_save_FLAGS=$LDFLAGS
10567b12e5c03Smrg   LDFLAGS="$1"
10568b12e5c03Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
10569b12e5c03Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
10570b12e5c03Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
10571b12e5c03Smrg   LDFLAGS=$ax_save_FLAGS])
10572b12e5c03Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
10573b12e5c03SmrgAC_MSG_RESULT($xorg_check_linker_flags)
10574b12e5c03Smrgif test "x$xorg_check_linker_flags" = xyes; then
10575b12e5c03Smrg	m4_default([$2], :)
10576b12e5c03Smrgelse
10577b12e5c03Smrg	m4_default([$3], :)
10578b12e5c03Smrgfi
10579b12e5c03Smrg]) # XORG_CHECK_LINKER_FLAGS
10580b12e5c03Smrg
10581b12e5c03Smrg# XORG_MEMORY_CHECK_FLAGS
10582b12e5c03Smrg# -----------------------
10583b12e5c03Smrg# Minimum version: 1.16.0
10584b12e5c03Smrg#
10585b12e5c03Smrg# This macro attempts to find appropriate memory checking functionality
10586b12e5c03Smrg# for various platforms which unit testing code may use to catch various
10587b12e5c03Smrg# forms of memory allocation and access errors in testing.
10588b12e5c03Smrg#
10589b12e5c03Smrg# Interface to module:
10590b12e5c03Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
10591b12e5c03Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
10592b12e5c03Smrg#
10593b12e5c03Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
10594b12e5c03Smrg#
10595b12e5c03SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
10596b12e5c03Smrg
10597b12e5c03SmrgAC_REQUIRE([AC_CANONICAL_HOST])
10598b12e5c03SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
10599b12e5c03Smrg           [Environment variables to enable memory checking in tests])
10600b12e5c03Smrg
10601b12e5c03Smrg# Check for different types of support on different platforms
10602b12e5c03Smrgcase $host_os in
10603b12e5c03Smrg    solaris*)
10604b12e5c03Smrg        AC_CHECK_LIB([umem], [umem_alloc],
10605b12e5c03Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
10606b12e5c03Smrg        ;;
10607b12e5c03Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
10608b12e5c03Smrg        # both directly and inverted, so should not be 0 or 255.
10609b12e5c03Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
10610b12e5c03Smrg        ;;
10611b12e5c03Smrg    darwin*)
10612b12e5c03Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
10613b12e5c03Smrg        ;;
10614b12e5c03Smrg    *bsd*)
10615b12e5c03Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
10616b12e5c03Smrg        ;;
10617b12e5c03Smrgesac
10618b12e5c03Smrg
10619b12e5c03Smrg# User supplied flags override default flags
10620b12e5c03Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
10621b12e5c03Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
10622b12e5c03Smrgfi
10623b12e5c03Smrg
10624b12e5c03SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
10625b12e5c03Smrg]) # XORG_WITH_LINT
10626b12e5c03Smrg
106277b58d2e0Smrg# XORG_CHECK_MALLOC_ZERO
106287b58d2e0Smrg# ----------------------
106297b58d2e0Smrg# Minimum version: 1.0.0
106307b58d2e0Smrg#
106317b58d2e0Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
106327b58d2e0Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
106337b58d2e0Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
106347b58d2e0SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
106357b58d2e0SmrgAC_ARG_ENABLE(malloc0returnsnull,
106367b58d2e0Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
106377b58d2e0Smrg		       [malloc(0) returns NULL (default: auto)]),
106387b58d2e0Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
106397b58d2e0Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1064009885543Smrg
106417b58d2e0SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
106427b58d2e0Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
10643df9ffc95SmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
10644df9ffc95Smrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
10645b12e5c03Smrg#include <stdlib.h>
10646b12e5c03Smrg],[
106477b58d2e0Smrg    char *m0, *r0, *c0, *p;
106487b58d2e0Smrg    m0 = malloc(0);
106497b58d2e0Smrg    p = malloc(10);
106507b58d2e0Smrg    r0 = realloc(p,0);
10651b12e5c03Smrg    c0 = calloc(0,10);
10652b12e5c03Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
10653b12e5c03Smrg])],
10654df9ffc95Smrg		[xorg_cv_malloc0_returns_null=yes],
10655df9ffc95Smrg		[xorg_cv_malloc0_returns_null=no])])
10656df9ffc95SmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
106577b58d2e0Smrgfi
106587b58d2e0SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
1065909885543Smrg
106607b58d2e0Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
106617b58d2e0Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
106627b58d2e0Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
106637b58d2e0Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
106647b58d2e0Smrgelse
106657b58d2e0Smrg	MALLOC_ZERO_CFLAGS=""
106667b58d2e0Smrg	XMALLOC_ZERO_CFLAGS=""
106677b58d2e0Smrg	XTMALLOC_ZERO_CFLAGS=""
106687b58d2e0Smrgfi
1066909885543Smrg
106707b58d2e0SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
106717b58d2e0SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
106727b58d2e0SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
106737b58d2e0Smrg]) # XORG_CHECK_MALLOC_ZERO
1067409885543Smrg
106757b58d2e0Smrg# XORG_WITH_LINT()
106767b58d2e0Smrg# ----------------
106777b58d2e0Smrg# Minimum version: 1.1.0
106787b58d2e0Smrg#
106797b58d2e0Smrg# This macro enables the use of a tool that flags some suspicious and
106807b58d2e0Smrg# non-portable constructs (likely to be bugs) in C language source code.
106817b58d2e0Smrg# It will attempt to locate the tool and use appropriate options.
106827b58d2e0Smrg# There are various lint type tools on different platforms.
106837b58d2e0Smrg#
106847b58d2e0Smrg# Interface to module:
106857b58d2e0Smrg# LINT:		returns the path to the tool found on the platform
106867b58d2e0Smrg#		or the value set to LINT on the configure cmd line
106877b58d2e0Smrg#		also an Automake conditional
106887b58d2e0Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
106897b58d2e0Smrg#
106907b58d2e0Smrg# --with-lint:	'yes' user instructs the module to use lint
106917b58d2e0Smrg#		'no' user instructs the module not to use lint (default)
106927b58d2e0Smrg#
106937b58d2e0Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
106947b58d2e0Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
106957b58d2e0Smrg#
106967b58d2e0SmrgAC_DEFUN([XORG_WITH_LINT],[
1069709885543Smrg
106987b58d2e0SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
106997b58d2e0SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
107007b58d2e0SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
107017b58d2e0Smrg		[Use a lint-style source code checker (default: disabled)])],
107027b58d2e0Smrg		[use_lint=$withval], [use_lint=no])
1070309885543Smrg
107047b58d2e0Smrg# Obtain platform specific info like program name and options
107057b58d2e0Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
107067b58d2e0Smrgcase $host_os in
107077b58d2e0Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
107087b58d2e0Smrg	lint_name=splint
107097b58d2e0Smrg	lint_options="-badflag"
107107b58d2e0Smrg	;;
107117b58d2e0Smrg  *freebsd* | *netbsd*)
107127b58d2e0Smrg	lint_name=lint
107137b58d2e0Smrg	lint_options="-u -b"
107147b58d2e0Smrg	;;
107157b58d2e0Smrg  *solaris*)
107167b58d2e0Smrg	lint_name=lint
107177b58d2e0Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
107187b58d2e0Smrg	;;
107197b58d2e0Smrgesac
1072009885543Smrg
107217b58d2e0Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
107227b58d2e0Smrgif test "x$use_lint" = x"yes" ; then
107237b58d2e0Smrg   AC_PATH_PROG([LINT], [$lint_name])
107247b58d2e0Smrg   if test "x$LINT" = "x"; then
107257b58d2e0Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
107267b58d2e0Smrg   fi
107277b58d2e0Smrgelif test "x$use_lint" = x"no" ; then
107287b58d2e0Smrg   if test "x$LINT" != "x"; then
107297b58d2e0Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
107307b58d2e0Smrg   fi
107317b58d2e0Smrgelse
107327b58d2e0Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
107337b58d2e0Smrgfi
1073409885543Smrg
107357b58d2e0Smrg# User supplied flags override default flags
107367b58d2e0Smrgif test "x$LINT_FLAGS" != "x"; then
107377b58d2e0Smrg   lint_options=$LINT_FLAGS
107387b58d2e0Smrgfi
10739e4f6584cSmrg
107407b58d2e0SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
107417b58d2e0SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
1074209885543Smrg
107437b58d2e0Smrg]) # XORG_WITH_LINT
1074409885543Smrg
107457b58d2e0Smrg# XORG_LINT_LIBRARY(LIBNAME)
107467b58d2e0Smrg# --------------------------
107477b58d2e0Smrg# Minimum version: 1.1.0
107487b58d2e0Smrg#
107497b58d2e0Smrg# Sets up flags for building lint libraries for checking programs that call
107507b58d2e0Smrg# functions in the library.
107517b58d2e0Smrg#
107527b58d2e0Smrg# Interface to module:
107537b58d2e0Smrg# LINTLIB		- Automake variable with the name of lint library file to make
107547b58d2e0Smrg# MAKE_LINT_LIB		- Automake conditional
107557b58d2e0Smrg#
107567b58d2e0Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
107577b58d2e0Smrg#			  - 'no' user instructs the module not to create a lint library (default)
10758b698ba48Smrg
107597b58d2e0SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
107607b58d2e0SmrgAC_REQUIRE([XORG_WITH_LINT])
107617b58d2e0SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
107627b58d2e0Smrg	[Create lint library (default: disabled)])],
107637b58d2e0Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
1076409885543Smrg
107657b58d2e0Smrgif test "x$make_lint_lib" = x"yes" ; then
107667b58d2e0Smrg   LINTLIB=llib-l$1.ln
107677b58d2e0Smrg   if test "x$LINT" = "x"; then
107687b58d2e0Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
107697b58d2e0Smrg   fi
107707b58d2e0Smrgelif test "x$make_lint_lib" != x"no" ; then
107717b58d2e0Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
107727b58d2e0Smrgfi
1077309885543Smrg
107747b58d2e0SmrgAC_SUBST(LINTLIB)
107757b58d2e0SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1077609885543Smrg
107777b58d2e0Smrg]) # XORG_LINT_LIBRARY
1077809885543Smrg
10779b12e5c03Smrg# XORG_COMPILER_BRAND
10780b12e5c03Smrg# -------------------
10781b12e5c03Smrg# Minimum version: 1.14.0
10782b12e5c03Smrg#
10783b12e5c03Smrg# Checks for various brands of compilers and sets flags as appropriate:
10784b12e5c03Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
10785b12e5c03Smrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
10786b12e5c03Smrg#   clang compiler - sets CLANGCC to "yes"
10787b12e5c03Smrg#   Intel compiler - sets INTELCC to "yes"
10788b12e5c03Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
10789b12e5c03Smrg#
10790b12e5c03SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
10791b12e5c03SmrgAC_LANG_CASE(
10792b12e5c03Smrg	[C], [
10793b12e5c03Smrg		AC_REQUIRE([AC_PROG_CC_C99])
10794b12e5c03Smrg	],
10795b12e5c03Smrg	[C++], [
10796b12e5c03Smrg		AC_REQUIRE([AC_PROG_CXX])
10797b12e5c03Smrg	]
10798b12e5c03Smrg)
10799b12e5c03SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
10800b12e5c03SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
10801b12e5c03SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
10802b12e5c03Smrg]) # XORG_COMPILER_BRAND
10803b12e5c03Smrg
10804b12e5c03Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
10805b12e5c03Smrg# ---------------
10806b12e5c03Smrg# Minimum version: 1.16.0
10807b12e5c03Smrg#
10808b12e5c03Smrg# Test if the compiler works when passed the given flag as a command line argument.
10809b12e5c03Smrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
10810b12e5c03Smrg# next flag in the list until there are no more options.
10811b12e5c03Smrg#
10812b12e5c03Smrg# Note that this does not guarantee that the compiler supports the flag as some
10813b12e5c03Smrg# compilers will simply ignore arguments that they do not understand, but we do
10814b12e5c03Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
10815b12e5c03Smrg# -Werror=unused-command-line-argument
10816b12e5c03Smrg#
10817b12e5c03SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
10818b12e5c03Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
10819b12e5c03Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
10820b12e5c03Smrg
10821b12e5c03SmrgAC_LANG_COMPILER_REQUIRE
10822b12e5c03Smrg
10823b12e5c03SmrgAC_LANG_CASE(
10824b12e5c03Smrg	[C], [
10825b12e5c03Smrg		AC_REQUIRE([AC_PROG_CC_C99])
10826b12e5c03Smrg		define([PREFIX], [C])
10827b12e5c03Smrg		define([CACHE_PREFIX], [cc])
10828b12e5c03Smrg		define([COMPILER], [$CC])
10829b12e5c03Smrg	],
10830b12e5c03Smrg	[C++], [
10831b12e5c03Smrg		define([PREFIX], [CXX])
10832b12e5c03Smrg		define([CACHE_PREFIX], [cxx])
10833b12e5c03Smrg		define([COMPILER], [$CXX])
10834b12e5c03Smrg	]
10835b12e5c03Smrg)
10836b12e5c03Smrg
10837b12e5c03Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
10838b12e5c03Smrg
10839b12e5c03Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
10840b12e5c03Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10841b12e5c03Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
10842b12e5c03Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
10843b12e5c03Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
10844b12e5c03Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
10845b12e5c03Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
10846b12e5c03Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
10847b12e5c03Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10848b12e5c03Smrgfi
10849b12e5c03Smrg
10850b12e5c03Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
10851b12e5c03Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
10852b12e5c03Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10853b12e5c03Smrg	fi
10854b12e5c03Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
10855b12e5c03Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
10856b12e5c03Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
10857b12e5c03Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
10858b12e5c03Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
10859b12e5c03Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
10860b12e5c03Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
10861b12e5c03Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10862b12e5c03Smrgfi
10863b12e5c03Smrg
10864b12e5c03Smrgfound="no"
10865b12e5c03Smrgm4_foreach([flag], m4_cdr($@), [
10866b12e5c03Smrg	if test $found = "no" ; then
10867df9ffc95Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
10868b12e5c03Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10869b12e5c03Smrg		fi
10870b12e5c03Smrg
10871df9ffc95Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
10872b12e5c03Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
10873b12e5c03Smrg		fi
10874b12e5c03Smrg
10875b12e5c03Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
10876b12e5c03Smrg
10877b12e5c03Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
10878b12e5c03Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
10879b12e5c03Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
10880b12e5c03Smrg		AC_CACHE_VAL($cacheid,
10881b12e5c03Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
10882b12e5c03Smrg					     [eval $cacheid=yes],
10883b12e5c03Smrg					     [eval $cacheid=no])])
10884b12e5c03Smrg
10885b12e5c03Smrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10886b12e5c03Smrg
10887b12e5c03Smrg		eval supported=\$$cacheid
10888b12e5c03Smrg		AC_MSG_RESULT([$supported])
10889b12e5c03Smrg		if test "$supported" = "yes" ; then
10890b12e5c03Smrg			$1="$$1 ]flag["
10891b12e5c03Smrg			found="yes"
10892b12e5c03Smrg		fi
10893b12e5c03Smrg	fi
10894b12e5c03Smrg])
10895b12e5c03Smrg]) # XORG_TESTSET_CFLAG
10896b12e5c03Smrg
10897b12e5c03Smrg# XORG_COMPILER_FLAGS
10898b12e5c03Smrg# ---------------
10899b12e5c03Smrg# Minimum version: 1.16.0
10900b12e5c03Smrg#
10901b12e5c03Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
10902b12e5c03Smrg# arguments supported by the selected compiler which do NOT alter the generated
10903b12e5c03Smrg# code.  These arguments will cause the compiler to print various warnings
10904b12e5c03Smrg# during compilation AND turn a conservative set of warnings into errors.
10905b12e5c03Smrg#
10906b12e5c03Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
10907b12e5c03Smrg# future versions of util-macros as options are added to new compilers.
10908b12e5c03Smrg#
10909b12e5c03SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
10910b12e5c03SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
10911b12e5c03Smrg
10912b12e5c03SmrgAC_ARG_ENABLE(selective-werror,
10913b12e5c03Smrg              AS_HELP_STRING([--disable-selective-werror],
10914b12e5c03Smrg                             [Turn off selective compiler errors. (default: enabled)]),
10915b12e5c03Smrg              [SELECTIVE_WERROR=$enableval],
10916b12e5c03Smrg              [SELECTIVE_WERROR=yes])
10917b12e5c03Smrg
10918b12e5c03SmrgAC_LANG_CASE(
10919b12e5c03Smrg        [C], [
10920b12e5c03Smrg                define([PREFIX], [C])
10921b12e5c03Smrg        ],
10922b12e5c03Smrg        [C++], [
10923b12e5c03Smrg                define([PREFIX], [CXX])
10924b12e5c03Smrg        ]
10925b12e5c03Smrg)
10926b12e5c03Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
10927b12e5c03Smrgif test "x$SUNCC" = "xyes"; then
10928b12e5c03Smrg    [BASE_]PREFIX[FLAGS]="-v"
10929b12e5c03Smrgelse
10930b12e5c03Smrg    [BASE_]PREFIX[FLAGS]=""
10931b12e5c03Smrgfi
10932b12e5c03Smrg
10933b12e5c03Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
10934b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
10935b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
10936b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
10937b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
10938b12e5c03Smrg
10939b12e5c03SmrgAC_LANG_CASE(
10940b12e5c03Smrg	[C], [
10941b12e5c03Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
10942b12e5c03Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
10943b12e5c03Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
10944b12e5c03Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
10945df9ffc95Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
10946b12e5c03Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
10947b12e5c03Smrg	]
10948b12e5c03Smrg)
10949b12e5c03Smrg
10950b12e5c03Smrg# This chunk adds additional warnings that could catch undesired effects.
10951b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
10952b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
10953b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
10954b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
10955b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
10956b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
10957df9ffc95SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
10958b12e5c03Smrg
10959b12e5c03Smrg# These are currently disabled because they are noisy.  They will be enabled
10960b12e5c03Smrg# in the future once the codebase is sufficiently modernized to silence
10961b12e5c03Smrg# them.  For now, I don't want them to drown out the other warnings.
10962b12e5c03Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
10963b12e5c03Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
10964df9ffc95Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
10965b12e5c03Smrg
10966b12e5c03Smrg# Turn some warnings into errors, so we don't accidently get successful builds
10967b12e5c03Smrg# when there are problems that should be fixed.
10968b12e5c03Smrg
10969b12e5c03Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
10970b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
10971b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
10972b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
10973b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
10974b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
10975b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
10976b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
10977b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
10978b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
10979b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
10980b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
10981b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
10982b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
10983b12e5c03Smrgelse
10984b12e5c03SmrgAC_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])
10985b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
10986b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
10987b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
10988b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
10989b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
10990b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
10991b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
10992b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
10993b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
10994b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
10995b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
10996b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
10997b12e5c03SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
10998b12e5c03Smrgfi
10999b12e5c03Smrg
11000b12e5c03SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
11001b12e5c03Smrg]) # XORG_COMPILER_FLAGS
11002b12e5c03Smrg
110037b58d2e0Smrg# XORG_CWARNFLAGS
110047b58d2e0Smrg# ---------------
110057b58d2e0Smrg# Minimum version: 1.2.0
11006b12e5c03Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
110077b58d2e0Smrg#
110087b58d2e0Smrg# Defines CWARNFLAGS to enable C compiler warnings.
110097b58d2e0Smrg#
11010b12e5c03Smrg# This function is deprecated because it defines -fno-strict-aliasing
11011b12e5c03Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
11012b12e5c03Smrg# is needed, then it should be added explicitly in the module when
11013b12e5c03Smrg# it is updated to use BASE_CFLAGS.
11014b12e5c03Smrg#
110157b58d2e0SmrgAC_DEFUN([XORG_CWARNFLAGS], [
11016b12e5c03SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
11017b12e5c03SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
11018b12e5c03SmrgAC_LANG_CASE(
11019b12e5c03Smrg	[C], [
11020b12e5c03Smrg		CWARNFLAGS="$BASE_CFLAGS"
11021b12e5c03Smrg		if  test "x$GCC" = xyes ; then
11022b12e5c03Smrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
11023b12e5c03Smrg		fi
11024b12e5c03Smrg		AC_SUBST(CWARNFLAGS)
11025b12e5c03Smrg	]
11026b12e5c03Smrg)
110277b58d2e0Smrg]) # XORG_CWARNFLAGS
11028e4f6584cSmrg
110297b58d2e0Smrg# XORG_STRICT_OPTION
110307b58d2e0Smrg# -----------------------
110317b58d2e0Smrg# Minimum version: 1.3.0
110327b58d2e0Smrg#
11033b12e5c03Smrg# Add configure option to enable strict compilation flags, such as treating
11034b12e5c03Smrg# warnings as fatal errors.
11035b12e5c03Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
11036b12e5c03Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
11037b12e5c03Smrg#
11038b12e5c03Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
11039b12e5c03Smrg# when strict compilation is unconditionally desired.
110407b58d2e0SmrgAC_DEFUN([XORG_STRICT_OPTION], [
110417b58d2e0SmrgAC_REQUIRE([XORG_CWARNFLAGS])
11042b12e5c03SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
110437b58d2e0Smrg
110447b58d2e0SmrgAC_ARG_ENABLE(strict-compilation,
110457b58d2e0Smrg			  AS_HELP_STRING([--enable-strict-compilation],
110467b58d2e0Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
110477b58d2e0Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
11048b12e5c03Smrg
11049b12e5c03SmrgAC_LANG_CASE(
11050b12e5c03Smrg        [C], [
11051b12e5c03Smrg                define([PREFIX], [C])
11052b12e5c03Smrg        ],
11053b12e5c03Smrg        [C++], [
11054b12e5c03Smrg                define([PREFIX], [CXX])
11055b12e5c03Smrg        ]
11056b12e5c03Smrg)
11057b12e5c03Smrg
11058b12e5c03Smrg[STRICT_]PREFIX[FLAGS]=""
11059b12e5c03SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
11060b12e5c03SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
11061b12e5c03Smrg
11062b12e5c03Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
11063b12e5c03Smrg# activate it with -Werror, so we add it here explicitly.
11064b12e5c03SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
11065b12e5c03Smrg
110667b58d2e0Smrgif test "x$STRICT_COMPILE" = "xyes"; then
11067b12e5c03Smrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
11068b12e5c03Smrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
110697b58d2e0Smrgfi
11070b12e5c03SmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
11071b12e5c03SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
11072b12e5c03SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
110737b58d2e0Smrg]) # XORG_STRICT_OPTION
11074e4f6584cSmrg
110757b58d2e0Smrg# XORG_DEFAULT_OPTIONS
110767b58d2e0Smrg# --------------------
110777b58d2e0Smrg# Minimum version: 1.3.0
110787b58d2e0Smrg#
110797b58d2e0Smrg# Defines default options for X.Org modules.
110807b58d2e0Smrg#
110817b58d2e0SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
110827b58d2e0SmrgAC_REQUIRE([AC_PROG_INSTALL])
11083b12e5c03SmrgXORG_COMPILER_FLAGS
110847b58d2e0SmrgXORG_CWARNFLAGS
110857b58d2e0SmrgXORG_STRICT_OPTION
110867b58d2e0SmrgXORG_RELEASE_VERSION
110877b58d2e0SmrgXORG_CHANGELOG
110887b58d2e0SmrgXORG_INSTALL
110897b58d2e0SmrgXORG_MANPAGE_SECTIONS
110907b58d2e0Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
110917b58d2e0Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
110927b58d2e0Smrg]) # XORG_DEFAULT_OPTIONS
11093e4f6584cSmrg
110947b58d2e0Smrg# XORG_INSTALL()
110957b58d2e0Smrg# ----------------
110967b58d2e0Smrg# Minimum version: 1.4.0
110977b58d2e0Smrg#
110987b58d2e0Smrg# Defines the variable INSTALL_CMD as the command to copy
110997b58d2e0Smrg# INSTALL from $prefix/share/util-macros.
111007b58d2e0Smrg#
111017b58d2e0SmrgAC_DEFUN([XORG_INSTALL], [
111027b58d2e0SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
111037b58d2e0Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
111047b58d2e0SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
111057b58d2e0Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
111067b58d2e0Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
111077b58d2e0Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
111087b58d2e0SmrgAC_SUBST([INSTALL_CMD])
111097b58d2e0Smrg]) # XORG_INSTALL
111107b58d2e0Smrgdnl Copyright 2005 Red Hat, Inc
111117b58d2e0Smrgdnl
111127b58d2e0Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
111137b58d2e0Smrgdnl documentation for any purpose is hereby granted without fee, provided that
111147b58d2e0Smrgdnl the above copyright notice appear in all copies and that both that
111157b58d2e0Smrgdnl copyright notice and this permission notice appear in supporting
111167b58d2e0Smrgdnl documentation.
111177b58d2e0Smrgdnl
111187b58d2e0Smrgdnl The above copyright notice and this permission notice shall be included
111197b58d2e0Smrgdnl in all copies or substantial portions of the Software.
111207b58d2e0Smrgdnl
111217b58d2e0Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
111227b58d2e0Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
111237b58d2e0Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
111247b58d2e0Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
111257b58d2e0Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
111267b58d2e0Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
111277b58d2e0Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
111287b58d2e0Smrgdnl
111297b58d2e0Smrgdnl Except as contained in this notice, the name of the copyright holders shall
111307b58d2e0Smrgdnl not be used in advertising or otherwise to promote the sale, use or
111317b58d2e0Smrgdnl other dealings in this Software without prior written authorization
111327b58d2e0Smrgdnl from the copyright holders.
111337b58d2e0Smrgdnl
11134e4f6584cSmrg
111357b58d2e0Smrg# XORG_RELEASE_VERSION
111367b58d2e0Smrg# --------------------
111377b58d2e0Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
11138df9ffc95Smrg
111397b58d2e0SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
111407b58d2e0Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
111417b58d2e0Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
111427b58d2e0Smrg		[Major version of this package])
111437b58d2e0Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
111447b58d2e0Smrg	if test "x$PVM" = "x"; then
111457b58d2e0Smrg		PVM="0"
111467b58d2e0Smrg	fi
111477b58d2e0Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
111487b58d2e0Smrg		[$PVM],
111497b58d2e0Smrg		[Minor version of this package])
111507b58d2e0Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
111517b58d2e0Smrg	if test "x$PVP" = "x"; then
111527b58d2e0Smrg		PVP="0"
111537b58d2e0Smrg	fi
111547b58d2e0Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
111557b58d2e0Smrg		[$PVP],
111567b58d2e0Smrg		[Patch version of this package])
11157e4f6584cSmrg])
1115809885543Smrg
111597b58d2e0Smrg# XORG_CHANGELOG()
111607b58d2e0Smrg# ----------------
111617b58d2e0Smrg# Minimum version: 1.2.0
1116209885543Smrg#
111637b58d2e0Smrg# Defines the variable CHANGELOG_CMD as the command to generate
111647b58d2e0Smrg# ChangeLog from git.
11165e4f6584cSmrg#
111667b58d2e0Smrg#
111677b58d2e0SmrgAC_DEFUN([XORG_CHANGELOG], [
111687b58d2e0SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
111697b58d2e0Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
111707b58d2e0Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
111717b58d2e0Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
111727b58d2e0SmrgAC_SUBST([CHANGELOG_CMD])
111737b58d2e0Smrg]) # XORG_CHANGELOG
1117409885543Smrg
111757b58d2e0Smrgdnl Copyright 2005 Red Hat, Inc
111767b58d2e0Smrgdnl 
111777b58d2e0Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
111787b58d2e0Smrgdnl documentation for any purpose is hereby granted without fee, provided that
111797b58d2e0Smrgdnl the above copyright notice appear in all copies and that both that
111807b58d2e0Smrgdnl copyright notice and this permission notice appear in supporting
111817b58d2e0Smrgdnl documentation.
111827b58d2e0Smrgdnl 
111837b58d2e0Smrgdnl The above copyright notice and this permission notice shall be included
111847b58d2e0Smrgdnl in all copies or substantial portions of the Software.
111857b58d2e0Smrgdnl 
111867b58d2e0Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
111877b58d2e0Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
111887b58d2e0Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
111897b58d2e0Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
111907b58d2e0Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
111917b58d2e0Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
111927b58d2e0Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
111937b58d2e0Smrgdnl 
111947b58d2e0Smrgdnl Except as contained in this notice, the name of the copyright holders shall
111957b58d2e0Smrgdnl not be used in advertising or otherwise to promote the sale, use or
111967b58d2e0Smrgdnl other dealings in this Software without prior written authorization
111977b58d2e0Smrgdnl from the copyright holders.
111987b58d2e0Smrgdnl 
11199e4f6584cSmrg
11200df9ffc95Smrg# XORG_DRIVER_CHECK_EXT(MACRO, PROTO)
112017b58d2e0Smrg# --------------------------
11202df9ffc95Smrg# Checks for the MACRO define in xorg-server.h (from the sdk).  If it
11203df9ffc95Smrg# is defined, then add the given PROTO to $REQUIRED_MODULES.
11204e4f6584cSmrg
112057b58d2e0SmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
112067b58d2e0Smrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
112077b58d2e0Smrg	SAVE_CFLAGS="$CFLAGS"
112087b58d2e0Smrg	CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
112097b58d2e0Smrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
112107b58d2e0Smrg#include "xorg-server.h"
112117b58d2e0Smrg#if !defined $1
112127b58d2e0Smrg#error $1 not defined
112137b58d2e0Smrg#endif
112147b58d2e0Smrg		]])],
112157b58d2e0Smrg		[_EXT_CHECK=yes],
112167b58d2e0Smrg		[_EXT_CHECK=no])
112177b58d2e0Smrg	CFLAGS="$SAVE_CFLAGS"
112187b58d2e0Smrg	AC_MSG_CHECKING([if $1 is defined])
112197b58d2e0Smrg	AC_MSG_RESULT([$_EXT_CHECK])
112207b58d2e0Smrg	if test "$_EXT_CHECK" != no; then
112217b58d2e0Smrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
112227b58d2e0Smrg	fi
112237b58d2e0Smrg])
11224e4f6584cSmrg
11225f395c03eSmrg# Copyright (C) 2002-2014 Free Software Foundation, Inc.
112267b58d2e0Smrg#
112277b58d2e0Smrg# This file is free software; the Free Software Foundation
112287b58d2e0Smrg# gives unlimited permission to copy and/or distribute it,
112297b58d2e0Smrg# with or without modifications, as long as this notice is preserved.
11230e4f6584cSmrg
112317b58d2e0Smrg# AM_AUTOMAKE_VERSION(VERSION)
112327b58d2e0Smrg# ----------------------------
112337b58d2e0Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
112347b58d2e0Smrg# generated from the m4 files accompanying Automake X.Y.
112357b58d2e0Smrg# (This private macro should not be called outside this file.)
112367b58d2e0SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
11237f395c03eSmrg[am__api_version='1.15'
112387b58d2e0Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
112397b58d2e0Smrgdnl require some minimum version.  Point them to the right macro.
11240f395c03eSmrgm4_if([$1], [1.15], [],
112417b58d2e0Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
11242e4f6584cSmrg])
11243e4f6584cSmrg
112447b58d2e0Smrg# _AM_AUTOCONF_VERSION(VERSION)
112457b58d2e0Smrg# -----------------------------
112467b58d2e0Smrg# aclocal traces this macro to find the Autoconf version.
112477b58d2e0Smrg# This is a private macro too.  Using m4_define simplifies
112487b58d2e0Smrg# the logic in aclocal, which can simply ignore this definition.
112497b58d2e0Smrgm4_define([_AM_AUTOCONF_VERSION], [])
11250e4f6584cSmrg
112517b58d2e0Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
112527b58d2e0Smrg# -------------------------------
112537b58d2e0Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
112547b58d2e0Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
112557b58d2e0SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
11256f395c03eSmrg[AM_AUTOMAKE_VERSION([1.15])dnl
112577b58d2e0Smrgm4_ifndef([AC_AUTOCONF_VERSION],
112587b58d2e0Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
112597b58d2e0Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
112607b58d2e0Smrg
112617b58d2e0Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
112627b58d2e0Smrg
11263f395c03eSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
112647b58d2e0Smrg#
112657b58d2e0Smrg# This file is free software; the Free Software Foundation
112667b58d2e0Smrg# gives unlimited permission to copy and/or distribute it,
112677b58d2e0Smrg# with or without modifications, as long as this notice is preserved.
11268e4f6584cSmrg
112697b58d2e0Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
11270df9ffc95Smrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
11271df9ffc95Smrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
112727b58d2e0Smrg#
112737b58d2e0Smrg# Of course, Automake must honor this variable whenever it calls a
112747b58d2e0Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
112757b58d2e0Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
112767b58d2e0Smrg# depending on how configure is run.  This is pretty annoying, since
112777b58d2e0Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
112787b58d2e0Smrg# source directory, any form will work fine, but in subdirectories a
112797b58d2e0Smrg# relative path needs to be adjusted first.
112807b58d2e0Smrg#
112817b58d2e0Smrg# $ac_aux_dir/missing
112827b58d2e0Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
112837b58d2e0Smrg# $top_srcdir/$ac_aux_dir/missing
112847b58d2e0Smrg#    fails if $ac_aux_dir is absolute,
112857b58d2e0Smrg#    fails when called from a subdirectory in a VPATH build with
112867b58d2e0Smrg#          a relative $ac_aux_dir
112877b58d2e0Smrg#
112887b58d2e0Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
112897b58d2e0Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
11290df9ffc95Smrg# harmless because $srcdir is '.', but things will broke when you
112917b58d2e0Smrg# start a VPATH build or use an absolute $srcdir.
112927b58d2e0Smrg#
112937b58d2e0Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
112947b58d2e0Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
112957b58d2e0Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
112967b58d2e0Smrg# and then we would define $MISSING as
112977b58d2e0Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
112987b58d2e0Smrg# This will work as long as MISSING is not called from configure, because
112997b58d2e0Smrg# unfortunately $(top_srcdir) has no meaning in configure.
113007b58d2e0Smrg# However there are other variables, like CC, which are often used in
113017b58d2e0Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
113027b58d2e0Smrg#
113037b58d2e0Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
113047b58d2e0Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
113057b58d2e0Smrg# configured tree to be moved without reconfiguration.
11306e4f6584cSmrg
113077b58d2e0SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
11308df9ffc95Smrg[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
11309df9ffc95Smrg# Expand $ac_aux_dir to an absolute path.
11310df9ffc95Smrgam_aux_dir=`cd "$ac_aux_dir" && pwd`
11311e4f6584cSmrg])
11312e4f6584cSmrg
113137b58d2e0Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
11314e4f6584cSmrg
11315f395c03eSmrg# Copyright (C) 1997-2014 Free Software Foundation, Inc.
113167b58d2e0Smrg#
113177b58d2e0Smrg# This file is free software; the Free Software Foundation
113187b58d2e0Smrg# gives unlimited permission to copy and/or distribute it,
113197b58d2e0Smrg# with or without modifications, as long as this notice is preserved.
11320e4f6584cSmrg
113217b58d2e0Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
113227b58d2e0Smrg# -------------------------------------
113237b58d2e0Smrg# Define a conditional.
113247b58d2e0SmrgAC_DEFUN([AM_CONDITIONAL],
11325df9ffc95Smrg[AC_PREREQ([2.52])dnl
11326df9ffc95Smrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
11327df9ffc95Smrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
113287b58d2e0SmrgAC_SUBST([$1_TRUE])dnl
113297b58d2e0SmrgAC_SUBST([$1_FALSE])dnl
113307b58d2e0Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
113317b58d2e0Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
113327b58d2e0Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
113337b58d2e0Smrgif $2; then
113347b58d2e0Smrg  $1_TRUE=
113357b58d2e0Smrg  $1_FALSE='#'
113367b58d2e0Smrgelse
113377b58d2e0Smrg  $1_TRUE='#'
113387b58d2e0Smrg  $1_FALSE=
113397b58d2e0Smrgfi
113407b58d2e0SmrgAC_CONFIG_COMMANDS_PRE(
113417b58d2e0Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
113427b58d2e0Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
113437b58d2e0SmrgUsually this means the macro was only invoked conditionally.]])
113447b58d2e0Smrgfi])])
11345e4f6584cSmrg
11346f395c03eSmrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
113477b58d2e0Smrg#
113487b58d2e0Smrg# This file is free software; the Free Software Foundation
113497b58d2e0Smrg# gives unlimited permission to copy and/or distribute it,
113507b58d2e0Smrg# with or without modifications, as long as this notice is preserved.
11351e4f6584cSmrg
1135209885543Smrg
11353df9ffc95Smrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
113547b58d2e0Smrg# written in clear, in which case automake, when reading aclocal.m4,
113557b58d2e0Smrg# will think it sees a *use*, and therefore will trigger all it's
113567b58d2e0Smrg# C support machinery.  Also note that it means that autoscan, seeing
113577b58d2e0Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1135809885543Smrg
1135909885543Smrg
113607b58d2e0Smrg# _AM_DEPENDENCIES(NAME)
113617b58d2e0Smrg# ----------------------
113627b58d2e0Smrg# See how the compiler implements dependency checking.
11363df9ffc95Smrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
113647b58d2e0Smrg# We try a few techniques and use that to set a single cache variable.
113657b58d2e0Smrg#
113667b58d2e0Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
113677b58d2e0Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
113687b58d2e0Smrg# dependency, and given that the user is not expected to run this macro,
113697b58d2e0Smrg# just rely on AC_PROG_CC.
113707b58d2e0SmrgAC_DEFUN([_AM_DEPENDENCIES],
113717b58d2e0Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
113727b58d2e0SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
113737b58d2e0SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
113747b58d2e0SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1137509885543Smrg
11376df9ffc95Smrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
11377df9ffc95Smrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
11378df9ffc95Smrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
11379df9ffc95Smrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
11380df9ffc95Smrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
11381df9ffc95Smrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
11382df9ffc95Smrg                    [depcc="$$1"   am_compiler_list=])
1138309885543Smrg
113847b58d2e0SmrgAC_CACHE_CHECK([dependency style of $depcc],
113857b58d2e0Smrg               [am_cv_$1_dependencies_compiler_type],
113867b58d2e0Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
113877b58d2e0Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
113887b58d2e0Smrg  # making bogus files that we don't know about and never remove.  For
113897b58d2e0Smrg  # instance it was reported that on HP-UX the gcc test will end up
11390df9ffc95Smrg  # making a dummy file named 'D' -- because '-MD' means "put the output
11391df9ffc95Smrg  # in D".
11392b12e5c03Smrg  rm -rf conftest.dir
113937b58d2e0Smrg  mkdir conftest.dir
113947b58d2e0Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
113957b58d2e0Smrg  # using a relative directory.
113967b58d2e0Smrg  cp "$am_depcomp" conftest.dir
113977b58d2e0Smrg  cd conftest.dir
113987b58d2e0Smrg  # We will build objects and dependencies in a subdirectory because
113997b58d2e0Smrg  # it helps to detect inapplicable dependency modes.  For instance
114007b58d2e0Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
114017b58d2e0Smrg  # side effect of compilation, but ICC will put the dependencies in
114027b58d2e0Smrg  # the current directory while Tru64 will put them in the object
114037b58d2e0Smrg  # directory.
114047b58d2e0Smrg  mkdir sub
1140509885543Smrg
114067b58d2e0Smrg  am_cv_$1_dependencies_compiler_type=none
114077b58d2e0Smrg  if test "$am_compiler_list" = ""; then
114087b58d2e0Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
114097b58d2e0Smrg  fi
114107b58d2e0Smrg  am__universal=false
114117b58d2e0Smrg  m4_case([$1], [CC],
114127b58d2e0Smrg    [case " $depcc " in #(
114137b58d2e0Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
114147b58d2e0Smrg     esac],
114157b58d2e0Smrg    [CXX],
114167b58d2e0Smrg    [case " $depcc " in #(
114177b58d2e0Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
114187b58d2e0Smrg     esac])
1141909885543Smrg
114207b58d2e0Smrg  for depmode in $am_compiler_list; do
114217b58d2e0Smrg    # Setup a source with many dependencies, because some compilers
114227b58d2e0Smrg    # like to wrap large dependency lists on column 80 (with \), and
114237b58d2e0Smrg    # we should not choose a depcomp mode which is confused by this.
114247b58d2e0Smrg    #
114257b58d2e0Smrg    # We need to recreate these files for each test, as the compiler may
114267b58d2e0Smrg    # overwrite some of them when testing with obscure command lines.
114277b58d2e0Smrg    # This happens at least with the AIX C compiler.
114287b58d2e0Smrg    : > sub/conftest.c
114297b58d2e0Smrg    for i in 1 2 3 4 5 6; do
114307b58d2e0Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
11431df9ffc95Smrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
11432df9ffc95Smrg      # Solaris 10 /bin/sh.
11433df9ffc95Smrg      echo '/* dummy */' > sub/conftst$i.h
114347b58d2e0Smrg    done
114357b58d2e0Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1143609885543Smrg
11437df9ffc95Smrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
114387b58d2e0Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
11439df9ffc95Smrg    # handle '-M -o', and we need to detect this.  Also, some Intel
11440df9ffc95Smrg    # versions had trouble with output in subdirs.
114417b58d2e0Smrg    am__obj=sub/conftest.${OBJEXT-o}
114427b58d2e0Smrg    am__minus_obj="-o $am__obj"
114437b58d2e0Smrg    case $depmode in
114447b58d2e0Smrg    gcc)
114457b58d2e0Smrg      # This depmode causes a compiler race in universal mode.
114467b58d2e0Smrg      test "$am__universal" = false || continue
114477b58d2e0Smrg      ;;
114487b58d2e0Smrg    nosideeffect)
11449df9ffc95Smrg      # After this tag, mechanisms are not by side-effect, so they'll
11450df9ffc95Smrg      # only be used when explicitly requested.
114517b58d2e0Smrg      if test "x$enable_dependency_tracking" = xyes; then
114527b58d2e0Smrg	continue
114537b58d2e0Smrg      else
114547b58d2e0Smrg	break
114557b58d2e0Smrg      fi
114567b58d2e0Smrg      ;;
11457b12e5c03Smrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
11458df9ffc95Smrg      # This compiler won't grok '-c -o', but also, the minuso test has
114597b58d2e0Smrg      # not run yet.  These depmodes are late enough in the game, and
114607b58d2e0Smrg      # so weak that their functioning should not be impacted.
114617b58d2e0Smrg      am__obj=conftest.${OBJEXT-o}
114627b58d2e0Smrg      am__minus_obj=
114637b58d2e0Smrg      ;;
114647b58d2e0Smrg    none) break ;;
114657b58d2e0Smrg    esac
114667b58d2e0Smrg    if depmode=$depmode \
114677b58d2e0Smrg       source=sub/conftest.c object=$am__obj \
114687b58d2e0Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
114697b58d2e0Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
114707b58d2e0Smrg         >/dev/null 2>conftest.err &&
114717b58d2e0Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
114727b58d2e0Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
114737b58d2e0Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
114747b58d2e0Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
114757b58d2e0Smrg      # icc doesn't choke on unknown options, it will just issue warnings
114767b58d2e0Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
114777b58d2e0Smrg      # that says an option was ignored or not supported.
114787b58d2e0Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
114797b58d2e0Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
114807b58d2e0Smrg      # The diagnosis changed in icc 8.0:
114817b58d2e0Smrg      #   icc: Command line remark: option '-MP' not supported
114827b58d2e0Smrg      if (grep 'ignoring option' conftest.err ||
114837b58d2e0Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
114847b58d2e0Smrg        am_cv_$1_dependencies_compiler_type=$depmode
114857b58d2e0Smrg        break
114867b58d2e0Smrg      fi
114877b58d2e0Smrg    fi
114887b58d2e0Smrg  done
1148909885543Smrg
114907b58d2e0Smrg  cd ..
114917b58d2e0Smrg  rm -rf conftest.dir
114927b58d2e0Smrgelse
114937b58d2e0Smrg  am_cv_$1_dependencies_compiler_type=none
114947b58d2e0Smrgfi
114957b58d2e0Smrg])
114967b58d2e0SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
114977b58d2e0SmrgAM_CONDITIONAL([am__fastdep$1], [
114987b58d2e0Smrg  test "x$enable_dependency_tracking" != xno \
114997b58d2e0Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
115007b58d2e0Smrg])
11501e4f6584cSmrg
11502e4f6584cSmrg
115037b58d2e0Smrg# AM_SET_DEPDIR
115047b58d2e0Smrg# -------------
115057b58d2e0Smrg# Choose a directory name for dependency files.
11506df9ffc95Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
115077b58d2e0SmrgAC_DEFUN([AM_SET_DEPDIR],
115087b58d2e0Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
115097b58d2e0SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
115107b58d2e0Smrg])
11511e4f6584cSmrg
11512e4f6584cSmrg
115137b58d2e0Smrg# AM_DEP_TRACK
115147b58d2e0Smrg# ------------
115157b58d2e0SmrgAC_DEFUN([AM_DEP_TRACK],
11516df9ffc95Smrg[AC_ARG_ENABLE([dependency-tracking], [dnl
11517df9ffc95SmrgAS_HELP_STRING(
11518df9ffc95Smrg  [--enable-dependency-tracking],
11519df9ffc95Smrg  [do not reject slow dependency extractors])
11520df9ffc95SmrgAS_HELP_STRING(
11521df9ffc95Smrg  [--disable-dependency-tracking],
11522df9ffc95Smrg  [speeds up one-time build])])
115237b58d2e0Smrgif test "x$enable_dependency_tracking" != xno; then
115247b58d2e0Smrg  am_depcomp="$ac_aux_dir/depcomp"
115257b58d2e0Smrg  AMDEPBACKSLASH='\'
11526b12e5c03Smrg  am__nodep='_no'
115277b58d2e0Smrgfi
115287b58d2e0SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
115297b58d2e0SmrgAC_SUBST([AMDEPBACKSLASH])dnl
115307b58d2e0Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
11531b12e5c03SmrgAC_SUBST([am__nodep])dnl
11532b12e5c03Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl
1153309885543Smrg])
1153409885543Smrg
115357b58d2e0Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
1153609885543Smrg
11537f395c03eSmrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
115387b58d2e0Smrg#
115397b58d2e0Smrg# This file is free software; the Free Software Foundation
115407b58d2e0Smrg# gives unlimited permission to copy and/or distribute it,
115417b58d2e0Smrg# with or without modifications, as long as this notice is preserved.
1154209885543Smrg
1154309885543Smrg
115447b58d2e0Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
115457b58d2e0Smrg# ------------------------------
115467b58d2e0SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
115477b58d2e0Smrg[{
11548df9ffc95Smrg  # Older Autoconf quotes --file arguments for eval, but not when files
115497b58d2e0Smrg  # are listed without --file.  Let's play safe and only enable the eval
115507b58d2e0Smrg  # if we detect the quoting.
115517b58d2e0Smrg  case $CONFIG_FILES in
115527b58d2e0Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
115537b58d2e0Smrg  *)   set x $CONFIG_FILES ;;
115547b58d2e0Smrg  esac
115557b58d2e0Smrg  shift
115567b58d2e0Smrg  for mf
115577b58d2e0Smrg  do
115587b58d2e0Smrg    # Strip MF so we end up with the name of the file.
115597b58d2e0Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
115607b58d2e0Smrg    # Check whether this is an Automake generated Makefile or not.
11561df9ffc95Smrg    # We used to match only the files named 'Makefile.in', but
115627b58d2e0Smrg    # some people rename them; so instead we look at the file content.
115637b58d2e0Smrg    # Grep'ing the first line is not enough: some people post-process
115647b58d2e0Smrg    # each Makefile.in and add a new line on top of each file to say so.
115657b58d2e0Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
115667b58d2e0Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
115677b58d2e0Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
115687b58d2e0Smrg      dirpart=`AS_DIRNAME("$mf")`
115697b58d2e0Smrg    else
115707b58d2e0Smrg      continue
115717b58d2e0Smrg    fi
115727b58d2e0Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
11573df9ffc95Smrg    # from the Makefile without running 'make'.
115747b58d2e0Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
115757b58d2e0Smrg    test -z "$DEPDIR" && continue
115767b58d2e0Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
11577df9ffc95Smrg    test -z "$am__include" && continue
115787b58d2e0Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
115797b58d2e0Smrg    # Find all dependency output files, they are included files with
115807b58d2e0Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
115817b58d2e0Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
115827b58d2e0Smrg    # expansion.
115837b58d2e0Smrg    for file in `sed -n "
115847b58d2e0Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
11585df9ffc95Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
115867b58d2e0Smrg      # Make sure the directory exists.
115877b58d2e0Smrg      test -f "$dirpart/$file" && continue
115887b58d2e0Smrg      fdir=`AS_DIRNAME(["$file"])`
115897b58d2e0Smrg      AS_MKDIR_P([$dirpart/$fdir])
115907b58d2e0Smrg      # echo "creating $dirpart/$file"
115917b58d2e0Smrg      echo '# dummy' > "$dirpart/$file"
115927b58d2e0Smrg    done
115937b58d2e0Smrg  done
115947b58d2e0Smrg}
115957b58d2e0Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1159609885543Smrg
1159709885543Smrg
115987b58d2e0Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
115997b58d2e0Smrg# -----------------------------
116007b58d2e0Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
116017b58d2e0Smrg#
116027b58d2e0Smrg# This code is only required when automatic dependency tracking
11603df9ffc95Smrg# is enabled.  FIXME.  This creates each '.P' file that we will
116047b58d2e0Smrg# need in order to bootstrap the dependency handling code.
116057b58d2e0SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
116067b58d2e0Smrg[AC_CONFIG_COMMANDS([depfiles],
116077b58d2e0Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
116087b58d2e0Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1160909885543Smrg])
1161009885543Smrg
116117b58d2e0Smrg# Do all the work for Automake.                             -*- Autoconf -*-
1161209885543Smrg
11613f395c03eSmrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
116147b58d2e0Smrg#
116157b58d2e0Smrg# This file is free software; the Free Software Foundation
116167b58d2e0Smrg# gives unlimited permission to copy and/or distribute it,
116177b58d2e0Smrg# with or without modifications, as long as this notice is preserved.
11618e4f6584cSmrg
116197b58d2e0Smrg# This macro actually does too much.  Some checks are only needed if
116207b58d2e0Smrg# your package does certain things.  But this isn't really a big deal.
11621e4f6584cSmrg
11622df9ffc95Smrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
11623df9ffc95Smrgm4_define([AC_PROG_CC],
11624df9ffc95Smrgm4_defn([AC_PROG_CC])
11625df9ffc95Smrg[_AM_PROG_CC_C_O
11626df9ffc95Smrg])
11627df9ffc95Smrg
116287b58d2e0Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
116297b58d2e0Smrg# AM_INIT_AUTOMAKE([OPTIONS])
116307b58d2e0Smrg# -----------------------------------------------
116317b58d2e0Smrg# The call with PACKAGE and VERSION arguments is the old style
116327b58d2e0Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
116337b58d2e0Smrg# and VERSION should now be passed to AC_INIT and removed from
116347b58d2e0Smrg# the call to AM_INIT_AUTOMAKE.
116357b58d2e0Smrg# We support both call styles for the transition.  After
116367b58d2e0Smrg# the next Automake release, Autoconf can make the AC_INIT
116377b58d2e0Smrg# arguments mandatory, and then we can depend on a new Autoconf
116387b58d2e0Smrg# release and drop the old call support.
116397b58d2e0SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
11640df9ffc95Smrg[AC_PREREQ([2.65])dnl
116417b58d2e0Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
116427b58d2e0Smrgdnl the ones we care about.
116437b58d2e0Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
116447b58d2e0SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
116457b58d2e0SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
116467b58d2e0Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
116477b58d2e0Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
116487b58d2e0Smrg  # is not polluted with repeated "-I."
116497b58d2e0Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
116507b58d2e0Smrg  # test to see if srcdir already configured
116517b58d2e0Smrg  if test -f $srcdir/config.status; then
116527b58d2e0Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
116537b58d2e0Smrg  fi
116547b58d2e0Smrgfi
11655e4f6584cSmrg
116567b58d2e0Smrg# test whether we have cygpath
116577b58d2e0Smrgif test -z "$CYGPATH_W"; then
116587b58d2e0Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
116597b58d2e0Smrg    CYGPATH_W='cygpath -w'
116607b58d2e0Smrg  else
116617b58d2e0Smrg    CYGPATH_W=echo
116627b58d2e0Smrg  fi
116637b58d2e0Smrgfi
116647b58d2e0SmrgAC_SUBST([CYGPATH_W])
11665e4f6584cSmrg
116667b58d2e0Smrg# Define the identity of the package.
116677b58d2e0Smrgdnl Distinguish between old-style and new-style calls.
116687b58d2e0Smrgm4_ifval([$2],
11669df9ffc95Smrg[AC_DIAGNOSE([obsolete],
11670df9ffc95Smrg             [$0: two- and three-arguments forms are deprecated.])
11671df9ffc95Smrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
116727b58d2e0Smrg AC_SUBST([PACKAGE], [$1])dnl
116737b58d2e0Smrg AC_SUBST([VERSION], [$2])],
116747b58d2e0Smrg[_AM_SET_OPTIONS([$1])dnl
116757b58d2e0Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
11676df9ffc95Smrgm4_if(
11677df9ffc95Smrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
11678df9ffc95Smrg  [ok:ok],,
116797b58d2e0Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
116807b58d2e0Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
116817b58d2e0Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
11682e4f6584cSmrg
116837b58d2e0Smrg_AM_IF_OPTION([no-define],,
11684df9ffc95Smrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
11685df9ffc95Smrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
11686e4f6584cSmrg
116877b58d2e0Smrg# Some tools Automake needs.
116887b58d2e0SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
116897b58d2e0SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
11690df9ffc95SmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
11691df9ffc95SmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
11692df9ffc95SmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
11693df9ffc95SmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
11694df9ffc95SmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
116957b58d2e0SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
116967b58d2e0SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
11697df9ffc95SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
11698df9ffc95Smrg# For better backward compatibility.  To be removed once Automake 1.9.x
11699df9ffc95Smrg# dies out for good.  For more background, see:
11700df9ffc95Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
11701df9ffc95Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
11702df9ffc95SmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
11703f395c03eSmrg# We need awk for the "check" target (and possibly the TAP driver).  The
11704f395c03eSmrg# system "awk" is bad on some platforms.
117057b58d2e0SmrgAC_REQUIRE([AC_PROG_AWK])dnl
117067b58d2e0SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
117077b58d2e0SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
117087b58d2e0Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
117097b58d2e0Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
117107b58d2e0Smrg			     [_AM_PROG_TAR([v7])])])
117117b58d2e0Smrg_AM_IF_OPTION([no-dependencies],,
117127b58d2e0Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
11713df9ffc95Smrg		  [_AM_DEPENDENCIES([CC])],
11714df9ffc95Smrg		  [m4_define([AC_PROG_CC],
11715df9ffc95Smrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
117167b58d2e0SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
11717df9ffc95Smrg		  [_AM_DEPENDENCIES([CXX])],
11718df9ffc95Smrg		  [m4_define([AC_PROG_CXX],
11719df9ffc95Smrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
117207b58d2e0SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
11721df9ffc95Smrg		  [_AM_DEPENDENCIES([OBJC])],
11722df9ffc95Smrg		  [m4_define([AC_PROG_OBJC],
11723df9ffc95Smrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
11724df9ffc95SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
11725df9ffc95Smrg		  [_AM_DEPENDENCIES([OBJCXX])],
11726df9ffc95Smrg		  [m4_define([AC_PROG_OBJCXX],
11727df9ffc95Smrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
117287104f784Smrg])
11729df9ffc95SmrgAC_REQUIRE([AM_SILENT_RULES])dnl
11730df9ffc95Smrgdnl The testsuite driver may need to know about EXEEXT, so add the
11731df9ffc95Smrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
11732df9ffc95Smrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
117337b58d2e0SmrgAC_CONFIG_COMMANDS_PRE(dnl
117347b58d2e0Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
117357b58d2e0Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
11736df9ffc95Smrg
11737df9ffc95Smrg# POSIX will say in a future version that running "rm -f" with no argument
11738df9ffc95Smrg# is OK; and we want to be able to make that assumption in our Makefile
11739df9ffc95Smrg# recipes.  So use an aggressive probe to check that the usage we want is
11740df9ffc95Smrg# actually supported "in the wild" to an acceptable degree.
11741df9ffc95Smrg# See automake bug#10828.
11742df9ffc95Smrg# To make any issue more visible, cause the running configure to be aborted
11743df9ffc95Smrg# by default if the 'rm' program in use doesn't match our expectations; the
11744df9ffc95Smrg# user can still override this though.
11745df9ffc95Smrgif rm -f && rm -fr && rm -rf; then : OK; else
11746df9ffc95Smrg  cat >&2 <<'END'
11747df9ffc95SmrgOops!
11748df9ffc95Smrg
11749df9ffc95SmrgYour 'rm' program seems unable to run without file operands specified
11750df9ffc95Smrgon the command line, even when the '-f' option is present.  This is contrary
11751df9ffc95Smrgto the behaviour of most rm programs out there, and not conforming with
11752df9ffc95Smrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
11753df9ffc95Smrg
11754df9ffc95SmrgPlease tell bug-automake@gnu.org about your system, including the value
11755df9ffc95Smrgof your $PATH and any error possibly output before this message.  This
11756df9ffc95Smrgcan help us improve future automake versions.
11757df9ffc95Smrg
11758df9ffc95SmrgEND
11759df9ffc95Smrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
11760df9ffc95Smrg    echo 'Configuration will proceed anyway, since you have set the' >&2
11761df9ffc95Smrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
11762df9ffc95Smrg    echo >&2
11763df9ffc95Smrg  else
11764df9ffc95Smrg    cat >&2 <<'END'
11765df9ffc95SmrgAborting the configuration process, to ensure you take notice of the issue.
11766df9ffc95Smrg
11767df9ffc95SmrgYou can download and install GNU coreutils to get an 'rm' implementation
11768df9ffc95Smrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
11769df9ffc95Smrg
11770df9ffc95SmrgIf you want to complete the configuration process using your problematic
11771df9ffc95Smrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
11772df9ffc95Smrgto "yes", and re-run configure.
11773df9ffc95Smrg
11774df9ffc95SmrgEND
11775df9ffc95Smrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
11776df9ffc95Smrg  fi
11777df9ffc95Smrgfi
11778f395c03eSmrgdnl The trailing newline in this macro's definition is deliberate, for
11779f395c03eSmrgdnl backward compatibility and to allow trailing 'dnl'-style comments
11780f395c03eSmrgdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
11781e4f6584cSmrg])
1178209885543Smrg
11783df9ffc95Smrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
117847b58d2e0Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
117857b58d2e0Smrgdnl mangled by Autoconf and run in a shell conditional statement.
117867b58d2e0Smrgm4_define([_AC_COMPILER_EXEEXT],
117877b58d2e0Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
1178809885543Smrg
117897b58d2e0Smrg# When config.status generates a header, we must update the stamp-h file.
117907b58d2e0Smrg# This file resides in the same directory as the config header
117917b58d2e0Smrg# that is generated.  The stamp files are numbered to have different names.
1179209885543Smrg
117937b58d2e0Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
117947b58d2e0Smrg# loop where config.status creates the headers, so we can generate
117957b58d2e0Smrg# our stamp files there.
117967b58d2e0SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
117977b58d2e0Smrg[# Compute $1's index in $config_headers.
117987b58d2e0Smrg_am_arg=$1
117997b58d2e0Smrg_am_stamp_count=1
118007b58d2e0Smrgfor _am_header in $config_headers :; do
118017b58d2e0Smrg  case $_am_header in
118027b58d2e0Smrg    $_am_arg | $_am_arg:* )
118037b58d2e0Smrg      break ;;
118047b58d2e0Smrg    * )
118057b58d2e0Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
118067b58d2e0Smrg  esac
118077b58d2e0Smrgdone
118087b58d2e0Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1180909885543Smrg
11810f395c03eSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
118117b58d2e0Smrg#
118127b58d2e0Smrg# This file is free software; the Free Software Foundation
118137b58d2e0Smrg# gives unlimited permission to copy and/or distribute it,
118147b58d2e0Smrg# with or without modifications, as long as this notice is preserved.
11815e4f6584cSmrg
118167b58d2e0Smrg# AM_PROG_INSTALL_SH
118177b58d2e0Smrg# ------------------
118187b58d2e0Smrg# Define $install_sh.
118197b58d2e0SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
118207b58d2e0Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
11821f395c03eSmrgif test x"${install_sh+set}" != xset; then
118227b58d2e0Smrg  case $am_aux_dir in
118237b58d2e0Smrg  *\ * | *\	*)
118247b58d2e0Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
118257b58d2e0Smrg  *)
118267b58d2e0Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
118277b58d2e0Smrg  esac
118287b58d2e0Smrgfi
11829df9ffc95SmrgAC_SUBST([install_sh])])
11830e4f6584cSmrg
11831f395c03eSmrg# Copyright (C) 2003-2014 Free Software Foundation, Inc.
118327b58d2e0Smrg#
118337b58d2e0Smrg# This file is free software; the Free Software Foundation
118347b58d2e0Smrg# gives unlimited permission to copy and/or distribute it,
118357b58d2e0Smrg# with or without modifications, as long as this notice is preserved.
11836e4f6584cSmrg
118377b58d2e0Smrg# Check whether the underlying file-system supports filenames
118387b58d2e0Smrg# with a leading dot.  For instance MS-DOS doesn't.
118397b58d2e0SmrgAC_DEFUN([AM_SET_LEADING_DOT],
118407b58d2e0Smrg[rm -rf .tst 2>/dev/null
118417b58d2e0Smrgmkdir .tst 2>/dev/null
118427b58d2e0Smrgif test -d .tst; then
118437b58d2e0Smrg  am__leading_dot=.
118447b58d2e0Smrgelse
118457b58d2e0Smrg  am__leading_dot=_
118467b58d2e0Smrgfi
118477b58d2e0Smrgrmdir .tst 2>/dev/null
118487b58d2e0SmrgAC_SUBST([am__leading_dot])])
11849e4f6584cSmrg
118507b58d2e0Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
118517b58d2e0Smrg# From Jim Meyering
11852e4f6584cSmrg
11853f395c03eSmrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
118547b58d2e0Smrg#
118557b58d2e0Smrg# This file is free software; the Free Software Foundation
118567b58d2e0Smrg# gives unlimited permission to copy and/or distribute it,
118577b58d2e0Smrg# with or without modifications, as long as this notice is preserved.
11858e4f6584cSmrg
118597b58d2e0Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
118607b58d2e0Smrg# ----------------------------------
118617b58d2e0Smrg# Control maintainer-specific portions of Makefiles.
11862df9ffc95Smrg# Default is to disable them, unless 'enable' is passed literally.
11863df9ffc95Smrg# For symmetry, 'disable' may be passed as well.  Anyway, the user
118647b58d2e0Smrg# can override the default with the --enable/--disable switch.
118657b58d2e0SmrgAC_DEFUN([AM_MAINTAINER_MODE],
118667b58d2e0Smrg[m4_case(m4_default([$1], [disable]),
118677b58d2e0Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
118687b58d2e0Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
118697b58d2e0Smrg       [m4_define([am_maintainer_other], [enable])
118707b58d2e0Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
11871b12e5c03SmrgAC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
118727b58d2e0Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
118737b58d2e0Smrg  AC_ARG_ENABLE([maintainer-mode],
11874df9ffc95Smrg    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
11875df9ffc95Smrg      am_maintainer_other[ make rules and dependencies not useful
11876df9ffc95Smrg      (and sometimes confusing) to the casual installer])],
11877df9ffc95Smrg    [USE_MAINTAINER_MODE=$enableval],
11878df9ffc95Smrg    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
118797b58d2e0Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
118807b58d2e0Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
118817b58d2e0Smrg  MAINT=$MAINTAINER_MODE_TRUE
118827b58d2e0Smrg  AC_SUBST([MAINT])dnl
118837b58d2e0Smrg]
118847b58d2e0Smrg)
1188509885543Smrg
118867b58d2e0Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
1188709885543Smrg
11888f395c03eSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
118897b58d2e0Smrg#
118907b58d2e0Smrg# This file is free software; the Free Software Foundation
118917b58d2e0Smrg# gives unlimited permission to copy and/or distribute it,
118927b58d2e0Smrg# with or without modifications, as long as this notice is preserved.
118937b58d2e0Smrg
118947b58d2e0Smrg# AM_MAKE_INCLUDE()
118957b58d2e0Smrg# -----------------
118967b58d2e0Smrg# Check to see how make treats includes.
118977b58d2e0SmrgAC_DEFUN([AM_MAKE_INCLUDE],
118987b58d2e0Smrg[am_make=${MAKE-make}
118997b58d2e0Smrgcat > confinc << 'END'
119007b58d2e0Smrgam__doit:
119017b58d2e0Smrg	@echo this is the am__doit target
119027b58d2e0Smrg.PHONY: am__doit
119037b58d2e0SmrgEND
119047b58d2e0Smrg# If we don't find an include directive, just comment out the code.
119057b58d2e0SmrgAC_MSG_CHECKING([for style of include used by $am_make])
119067b58d2e0Smrgam__include="#"
119077b58d2e0Smrgam__quote=
119087b58d2e0Smrg_am_result=none
119097b58d2e0Smrg# First try GNU make style include.
119107b58d2e0Smrgecho "include confinc" > confmf
11911df9ffc95Smrg# Ignore all kinds of additional output from 'make'.
119127b58d2e0Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
119137b58d2e0Smrg*the\ am__doit\ target*)
119147b58d2e0Smrg  am__include=include
119157b58d2e0Smrg  am__quote=
119167b58d2e0Smrg  _am_result=GNU
119177b58d2e0Smrg  ;;
119187b58d2e0Smrgesac
119197b58d2e0Smrg# Now try BSD make style include.
119207b58d2e0Smrgif test "$am__include" = "#"; then
119217b58d2e0Smrg   echo '.include "confinc"' > confmf
119227b58d2e0Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
119237b58d2e0Smrg   *the\ am__doit\ target*)
119247b58d2e0Smrg     am__include=.include
119257b58d2e0Smrg     am__quote="\""
119267b58d2e0Smrg     _am_result=BSD
119277b58d2e0Smrg     ;;
119287b58d2e0Smrg   esac
119297b58d2e0Smrgfi
119307b58d2e0SmrgAC_SUBST([am__include])
119317b58d2e0SmrgAC_SUBST([am__quote])
119327b58d2e0SmrgAC_MSG_RESULT([$_am_result])
119337b58d2e0Smrgrm -f confinc confmf
11934e4f6584cSmrg])
1193509885543Smrg
119367b58d2e0Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
1193709885543Smrg
11938f395c03eSmrg# Copyright (C) 1997-2014 Free Software Foundation, Inc.
11939e4f6584cSmrg#
119407b58d2e0Smrg# This file is free software; the Free Software Foundation
119417b58d2e0Smrg# gives unlimited permission to copy and/or distribute it,
119427b58d2e0Smrg# with or without modifications, as long as this notice is preserved.
1194309885543Smrg
119447b58d2e0Smrg# AM_MISSING_PROG(NAME, PROGRAM)
119457b58d2e0Smrg# ------------------------------
119467b58d2e0SmrgAC_DEFUN([AM_MISSING_PROG],
119477b58d2e0Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
119487b58d2e0Smrg$1=${$1-"${am_missing_run}$2"}
119497b58d2e0SmrgAC_SUBST($1)])
11950e4f6584cSmrg
119517b58d2e0Smrg# AM_MISSING_HAS_RUN
119527b58d2e0Smrg# ------------------
11953df9ffc95Smrg# Define MISSING if not defined so far and test if it is modern enough.
11954df9ffc95Smrg# If it is, set am_missing_run to use it, otherwise, to nothing.
119557b58d2e0SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
119567b58d2e0Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
119577b58d2e0SmrgAC_REQUIRE_AUX_FILE([missing])dnl
119587b58d2e0Smrgif test x"${MISSING+set}" != xset; then
119597b58d2e0Smrg  case $am_aux_dir in
119607b58d2e0Smrg  *\ * | *\	*)
119617b58d2e0Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
119627b58d2e0Smrg  *)
119637b58d2e0Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
119647b58d2e0Smrg  esac
119657b58d2e0Smrgfi
119667b58d2e0Smrg# Use eval to expand $SHELL
11967df9ffc95Smrgif eval "$MISSING --is-lightweight"; then
11968df9ffc95Smrg  am_missing_run="$MISSING "
119697b58d2e0Smrgelse
119707b58d2e0Smrg  am_missing_run=
11971df9ffc95Smrg  AC_MSG_WARN(['missing' script is too old or missing])
119727b58d2e0Smrgfi
119737b58d2e0Smrg])
11974e4f6584cSmrg
119757b58d2e0Smrg# Helper functions for option handling.                     -*- Autoconf -*-
11976e4f6584cSmrg
11977f395c03eSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
119787104f784Smrg#
119797b58d2e0Smrg# This file is free software; the Free Software Foundation
119807b58d2e0Smrg# gives unlimited permission to copy and/or distribute it,
119817b58d2e0Smrg# with or without modifications, as long as this notice is preserved.
11982e4f6584cSmrg
119837b58d2e0Smrg# _AM_MANGLE_OPTION(NAME)
119847b58d2e0Smrg# -----------------------
119857b58d2e0SmrgAC_DEFUN([_AM_MANGLE_OPTION],
119867b58d2e0Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
11987e4f6584cSmrg
119887b58d2e0Smrg# _AM_SET_OPTION(NAME)
11989b12e5c03Smrg# --------------------
119907b58d2e0Smrg# Set option NAME.  Presently that only means defining a flag for this option.
119917b58d2e0SmrgAC_DEFUN([_AM_SET_OPTION],
11992df9ffc95Smrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
11993e4f6584cSmrg
119947b58d2e0Smrg# _AM_SET_OPTIONS(OPTIONS)
11995b12e5c03Smrg# ------------------------
119967b58d2e0Smrg# OPTIONS is a space-separated list of Automake options.
119977b58d2e0SmrgAC_DEFUN([_AM_SET_OPTIONS],
119987b58d2e0Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
11999e4f6584cSmrg
120007b58d2e0Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
120017b58d2e0Smrg# -------------------------------------------
120027b58d2e0Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
120037b58d2e0SmrgAC_DEFUN([_AM_IF_OPTION],
120047b58d2e0Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
12005e4f6584cSmrg
12006f395c03eSmrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
12007df9ffc95Smrg#
12008df9ffc95Smrg# This file is free software; the Free Software Foundation
12009df9ffc95Smrg# gives unlimited permission to copy and/or distribute it,
12010df9ffc95Smrg# with or without modifications, as long as this notice is preserved.
120117104f784Smrg
12012df9ffc95Smrg# _AM_PROG_CC_C_O
12013df9ffc95Smrg# ---------------
12014df9ffc95Smrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
12015df9ffc95Smrg# to automatically call this.
12016df9ffc95SmrgAC_DEFUN([_AM_PROG_CC_C_O],
12017df9ffc95Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
12018df9ffc95SmrgAC_REQUIRE_AUX_FILE([compile])dnl
12019df9ffc95SmrgAC_LANG_PUSH([C])dnl
12020df9ffc95SmrgAC_CACHE_CHECK(
12021df9ffc95Smrg  [whether $CC understands -c and -o together],
12022df9ffc95Smrg  [am_cv_prog_cc_c_o],
12023df9ffc95Smrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
12024df9ffc95Smrg  # Make sure it works both with $CC and with simple cc.
12025df9ffc95Smrg  # Following AC_PROG_CC_C_O, we do the test twice because some
12026df9ffc95Smrg  # compilers refuse to overwrite an existing .o file with -o,
12027df9ffc95Smrg  # though they will create one.
12028df9ffc95Smrg  am_cv_prog_cc_c_o=yes
12029df9ffc95Smrg  for am_i in 1 2; do
12030df9ffc95Smrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
12031df9ffc95Smrg         && test -f conftest2.$ac_objext; then
12032df9ffc95Smrg      : OK
12033df9ffc95Smrg    else
12034df9ffc95Smrg      am_cv_prog_cc_c_o=no
12035df9ffc95Smrg      break
12036df9ffc95Smrg    fi
12037df9ffc95Smrg  done
12038df9ffc95Smrg  rm -f core conftest*
12039df9ffc95Smrg  unset am_i])
12040df9ffc95Smrgif test "$am_cv_prog_cc_c_o" != yes; then
12041df9ffc95Smrg   # Losing compiler, so override with the script.
12042df9ffc95Smrg   # FIXME: It is wrong to rewrite CC.
12043df9ffc95Smrg   # But if we don't then we get into trouble of one sort or another.
12044df9ffc95Smrg   # A longer-term fix would be to have automake use am__CC in this case,
12045df9ffc95Smrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
12046df9ffc95Smrg   CC="$am_aux_dir/compile $CC"
12047df9ffc95Smrgfi
12048df9ffc95SmrgAC_LANG_POP([C])])
12049df9ffc95Smrg
12050df9ffc95Smrg# For backward compatibility.
12051df9ffc95SmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
12052df9ffc95Smrg
12053f395c03eSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
120547b58d2e0Smrg#
120557b58d2e0Smrg# This file is free software; the Free Software Foundation
120567b58d2e0Smrg# gives unlimited permission to copy and/or distribute it,
120577b58d2e0Smrg# with or without modifications, as long as this notice is preserved.
12058b698ba48Smrg
12059df9ffc95Smrg# AM_RUN_LOG(COMMAND)
12060df9ffc95Smrg# -------------------
12061df9ffc95Smrg# Run COMMAND, save the exit status in ac_status, and log it.
12062df9ffc95Smrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
12063df9ffc95SmrgAC_DEFUN([AM_RUN_LOG],
12064df9ffc95Smrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
12065df9ffc95Smrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
12066df9ffc95Smrg   ac_status=$?
12067df9ffc95Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
12068df9ffc95Smrg   (exit $ac_status); }])
12069df9ffc95Smrg
12070df9ffc95Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
12071df9ffc95Smrg
12072f395c03eSmrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
12073df9ffc95Smrg#
12074df9ffc95Smrg# This file is free software; the Free Software Foundation
12075df9ffc95Smrg# gives unlimited permission to copy and/or distribute it,
12076df9ffc95Smrg# with or without modifications, as long as this notice is preserved.
120777104f784Smrg
120787b58d2e0Smrg# AM_SANITY_CHECK
120797b58d2e0Smrg# ---------------
120807b58d2e0SmrgAC_DEFUN([AM_SANITY_CHECK],
120817b58d2e0Smrg[AC_MSG_CHECKING([whether build environment is sane])
120827b58d2e0Smrg# Reject unsafe characters in $srcdir or the absolute working directory
120837b58d2e0Smrg# name.  Accept space and tab only in the latter.
120847b58d2e0Smrgam_lf='
120857b58d2e0Smrg'
120867b58d2e0Smrgcase `pwd` in
120877b58d2e0Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
120887b58d2e0Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
120897b58d2e0Smrgesac
120907b58d2e0Smrgcase $srcdir in
120917b58d2e0Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
12092df9ffc95Smrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
120937b58d2e0Smrgesac
12094b698ba48Smrg
12095df9ffc95Smrg# Do 'set' in a subshell so we don't clobber the current shell's
120967b58d2e0Smrg# arguments.  Must try -L first in case configure is actually a
120977b58d2e0Smrg# symlink; some systems play weird games with the mod time of symlinks
120987b58d2e0Smrg# (eg FreeBSD returns the mod time of the symlink's containing
120997b58d2e0Smrg# directory).
121007b58d2e0Smrgif (
12101df9ffc95Smrg   am_has_slept=no
12102df9ffc95Smrg   for am_try in 1 2; do
12103df9ffc95Smrg     echo "timestamp, slept: $am_has_slept" > conftest.file
12104df9ffc95Smrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
12105df9ffc95Smrg     if test "$[*]" = "X"; then
12106df9ffc95Smrg	# -L didn't work.
12107df9ffc95Smrg	set X `ls -t "$srcdir/configure" conftest.file`
12108df9ffc95Smrg     fi
12109df9ffc95Smrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
12110df9ffc95Smrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
12111df9ffc95Smrg
12112df9ffc95Smrg	# If neither matched, then we have a broken ls.  This can happen
12113df9ffc95Smrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
12114df9ffc95Smrg	# broken ls alias from the environment.  This has actually
12115df9ffc95Smrg	# happened.  Such a system could not be considered "sane".
12116df9ffc95Smrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
12117df9ffc95Smrg  alias in your environment])
12118df9ffc95Smrg     fi
12119df9ffc95Smrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
12120df9ffc95Smrg       break
12121df9ffc95Smrg     fi
12122df9ffc95Smrg     # Just in case.
12123df9ffc95Smrg     sleep 1
12124df9ffc95Smrg     am_has_slept=yes
12125df9ffc95Smrg   done
121267b58d2e0Smrg   test "$[2]" = conftest.file
121277b58d2e0Smrg   )
121287b58d2e0Smrgthen
121297b58d2e0Smrg   # Ok.
121307b58d2e0Smrg   :
121317b58d2e0Smrgelse
121327b58d2e0Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
121337b58d2e0SmrgCheck your system clock])
121347b58d2e0Smrgfi
12135df9ffc95SmrgAC_MSG_RESULT([yes])
12136df9ffc95Smrg# If we didn't sleep, we still need to ensure time stamps of config.status and
12137df9ffc95Smrg# generated files are strictly newer.
12138df9ffc95Smrgam_sleep_pid=
12139df9ffc95Smrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
12140df9ffc95Smrg  ( sleep 1 ) &
12141df9ffc95Smrg  am_sleep_pid=$!
12142df9ffc95Smrgfi
12143df9ffc95SmrgAC_CONFIG_COMMANDS_PRE(
12144df9ffc95Smrg  [AC_MSG_CHECKING([that generated files are newer than configure])
12145df9ffc95Smrg   if test -n "$am_sleep_pid"; then
12146df9ffc95Smrg     # Hide warnings about reused PIDs.
12147df9ffc95Smrg     wait $am_sleep_pid 2>/dev/null
12148df9ffc95Smrg   fi
12149df9ffc95Smrg   AC_MSG_RESULT([done])])
12150df9ffc95Smrgrm -f conftest.file
12151df9ffc95Smrg])
1215209885543Smrg
12153f395c03eSmrg# Copyright (C) 2009-2014 Free Software Foundation, Inc.
121547b58d2e0Smrg#
121557b58d2e0Smrg# This file is free software; the Free Software Foundation
121567b58d2e0Smrg# gives unlimited permission to copy and/or distribute it,
121577b58d2e0Smrg# with or without modifications, as long as this notice is preserved.
12158e4f6584cSmrg
121597b58d2e0Smrg# AM_SILENT_RULES([DEFAULT])
121607b58d2e0Smrg# --------------------------
121617b58d2e0Smrg# Enable less verbose build rules; with the default set to DEFAULT
12162df9ffc95Smrg# ("yes" being less verbose, "no" or empty being verbose).
121637b58d2e0SmrgAC_DEFUN([AM_SILENT_RULES],
12164df9ffc95Smrg[AC_ARG_ENABLE([silent-rules], [dnl
12165df9ffc95SmrgAS_HELP_STRING(
12166df9ffc95Smrg  [--enable-silent-rules],
12167df9ffc95Smrg  [less verbose build output (undo: "make V=1")])
12168df9ffc95SmrgAS_HELP_STRING(
12169df9ffc95Smrg  [--disable-silent-rules],
12170df9ffc95Smrg  [verbose build output (undo: "make V=0")])dnl
12171df9ffc95Smrg])
12172df9ffc95Smrgcase $enable_silent_rules in @%:@ (((
12173df9ffc95Smrg  yes) AM_DEFAULT_VERBOSITY=0;;
12174df9ffc95Smrg   no) AM_DEFAULT_VERBOSITY=1;;
12175df9ffc95Smrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
121767b58d2e0Smrgesac
12177b12e5c03Smrgdnl
12178df9ffc95Smrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
12179b12e5c03Smrgdnl do not support nested variable expansions.
12180b12e5c03Smrgdnl See automake bug#9928 and bug#10237.
12181b12e5c03Smrgam_make=${MAKE-make}
12182b12e5c03SmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
12183b12e5c03Smrg   [am_cv_make_support_nested_variables],
12184b12e5c03Smrg   [if AS_ECHO([['TRUE=$(BAR$(V))
12185b12e5c03SmrgBAR0=false
12186b12e5c03SmrgBAR1=true
12187b12e5c03SmrgV=1
12188b12e5c03Smrgam__doit:
12189b12e5c03Smrg	@$(TRUE)
12190b12e5c03Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
12191b12e5c03Smrg  am_cv_make_support_nested_variables=yes
12192b12e5c03Smrgelse
12193b12e5c03Smrg  am_cv_make_support_nested_variables=no
12194b12e5c03Smrgfi])
12195b12e5c03Smrgif test $am_cv_make_support_nested_variables = yes; then
12196df9ffc95Smrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
12197b12e5c03Smrg  AM_V='$(V)'
12198b12e5c03Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
12199b12e5c03Smrgelse
12200b12e5c03Smrg  AM_V=$AM_DEFAULT_VERBOSITY
12201b12e5c03Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
12202b12e5c03Smrgfi
12203b12e5c03SmrgAC_SUBST([AM_V])dnl
12204b12e5c03SmrgAM_SUBST_NOTMAKE([AM_V])dnl
12205b12e5c03SmrgAC_SUBST([AM_DEFAULT_V])dnl
12206b12e5c03SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
122077b58d2e0SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
122087b58d2e0SmrgAM_BACKSLASH='\'
122097b58d2e0SmrgAC_SUBST([AM_BACKSLASH])dnl
122107b58d2e0Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
12211e4f6584cSmrg])
12212e4f6584cSmrg
12213f395c03eSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
1221409885543Smrg#
122157b58d2e0Smrg# This file is free software; the Free Software Foundation
122167b58d2e0Smrg# gives unlimited permission to copy and/or distribute it,
122177b58d2e0Smrg# with or without modifications, as long as this notice is preserved.
122187b58d2e0Smrg
122197b58d2e0Smrg# AM_PROG_INSTALL_STRIP
122207b58d2e0Smrg# ---------------------
12221df9ffc95Smrg# One issue with vendor 'install' (even GNU) is that you can't
122227b58d2e0Smrg# specify the program used to strip binaries.  This is especially
122237b58d2e0Smrg# annoying in cross-compiling environments, where the build's strip
122247b58d2e0Smrg# is unlikely to handle the host's binaries.
122257b58d2e0Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
12226df9ffc95Smrg# always use install-sh in "make install-strip", and initialize
122277b58d2e0Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
122287b58d2e0SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
122297b58d2e0Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
12230df9ffc95Smrg# Installed binaries are usually stripped using 'strip' when the user
12231df9ffc95Smrg# run "make install-strip".  However 'strip' might not be the right
122327b58d2e0Smrg# tool to use in cross-compilation environments, therefore Automake
12233df9ffc95Smrg# will honor the 'STRIP' environment variable to overrule this program.
12234df9ffc95Smrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
122357b58d2e0Smrgif test "$cross_compiling" != no; then
122367b58d2e0Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
122377b58d2e0Smrgfi
122387b58d2e0SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
122397b58d2e0SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
122407b58d2e0Smrg
12241f395c03eSmrg# Copyright (C) 2006-2014 Free Software Foundation, Inc.
1224209885543Smrg#
122437b58d2e0Smrg# This file is free software; the Free Software Foundation
122447b58d2e0Smrg# gives unlimited permission to copy and/or distribute it,
122457b58d2e0Smrg# with or without modifications, as long as this notice is preserved.
1224609885543Smrg
122477b58d2e0Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
122487b58d2e0Smrg# ---------------------------
122497b58d2e0Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
122507b58d2e0Smrg# This macro is traced by Automake.
122517b58d2e0SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
1225209885543Smrg
122537b58d2e0Smrg# AM_SUBST_NOTMAKE(VARIABLE)
12254b12e5c03Smrg# --------------------------
122557b58d2e0Smrg# Public sister of _AM_SUBST_NOTMAKE.
122567b58d2e0SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1225709885543Smrg
122587b58d2e0Smrg# Check how to create a tarball.                            -*- Autoconf -*-
12259b698ba48Smrg
12260f395c03eSmrg# Copyright (C) 2004-2014 Free Software Foundation, Inc.
12261e4f6584cSmrg#
122627b58d2e0Smrg# This file is free software; the Free Software Foundation
122637b58d2e0Smrg# gives unlimited permission to copy and/or distribute it,
122647b58d2e0Smrg# with or without modifications, as long as this notice is preserved.
12265b698ba48Smrg
122667b58d2e0Smrg# _AM_PROG_TAR(FORMAT)
122677b58d2e0Smrg# --------------------
122687b58d2e0Smrg# Check how to create a tarball in format FORMAT.
12269df9ffc95Smrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
12270e4f6584cSmrg#
122717b58d2e0Smrg# Substitute a variable $(am__tar) that is a command
122727b58d2e0Smrg# writing to stdout a FORMAT-tarball containing the directory
122737b58d2e0Smrg# $tardir.
122747b58d2e0Smrg#     tardir=directory && $(am__tar) > result.tar
12275e4f6584cSmrg#
122767b58d2e0Smrg# Substitute a variable $(am__untar) that extract such
122777b58d2e0Smrg# a tarball read from stdin.
122787b58d2e0Smrg#     $(am__untar) < result.tar
12279df9ffc95Smrg#
122807b58d2e0SmrgAC_DEFUN([_AM_PROG_TAR],
12281b12e5c03Smrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
12282b12e5c03Smrg# in the wild :-(  We should find a proper way to deprecate it ...
12283b12e5c03SmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
12284df9ffc95Smrg
12285df9ffc95Smrg# We'll loop over all known methods to create a tar archive until one works.
122867b58d2e0Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
12287e4f6584cSmrg
12288df9ffc95Smrgm4_if([$1], [v7],
12289df9ffc95Smrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
12290df9ffc95Smrg
12291df9ffc95Smrg  [m4_case([$1],
12292df9ffc95Smrg    [ustar],
12293df9ffc95Smrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
12294df9ffc95Smrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
12295df9ffc95Smrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
12296df9ffc95Smrg      # and bug#13588).
12297df9ffc95Smrg      am_max_uid=2097151 # 2^21 - 1
12298df9ffc95Smrg      am_max_gid=$am_max_uid
12299df9ffc95Smrg      # The $UID and $GID variables are not portable, so we need to resort
12300df9ffc95Smrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
12301df9ffc95Smrg      # below are definitely unexpected, so allow the users to see them
12302df9ffc95Smrg      # (that is, avoid stderr redirection).
12303df9ffc95Smrg      am_uid=`id -u || echo unknown`
12304df9ffc95Smrg      am_gid=`id -g || echo unknown`
12305df9ffc95Smrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
12306df9ffc95Smrg      if test $am_uid -le $am_max_uid; then
12307df9ffc95Smrg         AC_MSG_RESULT([yes])
12308df9ffc95Smrg      else
12309df9ffc95Smrg         AC_MSG_RESULT([no])
12310df9ffc95Smrg         _am_tools=none
12311df9ffc95Smrg      fi
12312df9ffc95Smrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
12313df9ffc95Smrg      if test $am_gid -le $am_max_gid; then
12314df9ffc95Smrg         AC_MSG_RESULT([yes])
12315df9ffc95Smrg      else
12316df9ffc95Smrg        AC_MSG_RESULT([no])
12317df9ffc95Smrg        _am_tools=none
12318df9ffc95Smrg      fi],
12319e4f6584cSmrg
12320df9ffc95Smrg  [pax],
12321df9ffc95Smrg    [],
12322df9ffc95Smrg
12323df9ffc95Smrg  [m4_fatal([Unknown tar format])])
12324df9ffc95Smrg
12325df9ffc95Smrg  AC_MSG_CHECKING([how to create a $1 tar archive])
12326df9ffc95Smrg
12327df9ffc95Smrg  # Go ahead even if we have the value already cached.  We do so because we
12328df9ffc95Smrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
12329df9ffc95Smrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
12330df9ffc95Smrg
12331df9ffc95Smrg  for _am_tool in $_am_tools; do
12332df9ffc95Smrg    case $_am_tool in
12333df9ffc95Smrg    gnutar)
12334df9ffc95Smrg      for _am_tar in tar gnutar gtar; do
12335df9ffc95Smrg        AM_RUN_LOG([$_am_tar --version]) && break
12336df9ffc95Smrg      done
12337df9ffc95Smrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
12338df9ffc95Smrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
12339df9ffc95Smrg      am__untar="$_am_tar -xf -"
12340df9ffc95Smrg      ;;
12341df9ffc95Smrg    plaintar)
12342df9ffc95Smrg      # Must skip GNU tar: if it does not support --format= it doesn't create
12343df9ffc95Smrg      # ustar tarball either.
12344df9ffc95Smrg      (tar --version) >/dev/null 2>&1 && continue
12345df9ffc95Smrg      am__tar='tar chf - "$$tardir"'
12346df9ffc95Smrg      am__tar_='tar chf - "$tardir"'
12347df9ffc95Smrg      am__untar='tar xf -'
12348df9ffc95Smrg      ;;
12349df9ffc95Smrg    pax)
12350df9ffc95Smrg      am__tar='pax -L -x $1 -w "$$tardir"'
12351df9ffc95Smrg      am__tar_='pax -L -x $1 -w "$tardir"'
12352df9ffc95Smrg      am__untar='pax -r'
12353df9ffc95Smrg      ;;
12354df9ffc95Smrg    cpio)
12355df9ffc95Smrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
12356df9ffc95Smrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
12357df9ffc95Smrg      am__untar='cpio -i -H $1 -d'
12358df9ffc95Smrg      ;;
12359df9ffc95Smrg    none)
12360df9ffc95Smrg      am__tar=false
12361df9ffc95Smrg      am__tar_=false
12362df9ffc95Smrg      am__untar=false
12363df9ffc95Smrg      ;;
12364df9ffc95Smrg    esac
12365df9ffc95Smrg
12366df9ffc95Smrg    # If the value was cached, stop now.  We just wanted to have am__tar
12367df9ffc95Smrg    # and am__untar set.
12368df9ffc95Smrg    test -n "${am_cv_prog_tar_$1}" && break
12369df9ffc95Smrg
12370df9ffc95Smrg    # tar/untar a dummy directory, and stop if the command works.
12371df9ffc95Smrg    rm -rf conftest.dir
12372df9ffc95Smrg    mkdir conftest.dir
12373df9ffc95Smrg    echo GrepMe > conftest.dir/file
12374df9ffc95Smrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
12375df9ffc95Smrg    rm -rf conftest.dir
12376df9ffc95Smrg    if test -s conftest.tar; then
12377df9ffc95Smrg      AM_RUN_LOG([$am__untar <conftest.tar])
12378df9ffc95Smrg      AM_RUN_LOG([cat conftest.dir/file])
12379df9ffc95Smrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
12380df9ffc95Smrg    fi
12381df9ffc95Smrg  done
123827b58d2e0Smrg  rm -rf conftest.dir
123837b58d2e0Smrg
12384df9ffc95Smrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
12385df9ffc95Smrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
12386df9ffc95Smrg
123877b58d2e0SmrgAC_SUBST([am__tar])
123887b58d2e0SmrgAC_SUBST([am__untar])
123897b58d2e0Smrg]) # _AM_PROG_TAR
12390b698ba48Smrg
12391