aclocal.m4 revision 0597fb56
10597fb56Smrg# generated automatically by aclocal 1.11.3 -*- Autoconf -*-
2b042e37fSmrg
3b042e37fSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
40597fb56Smrg# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
50597fb56Smrg# Inc.
6b042e37fSmrg# This file is free software; the Free Software Foundation
7b042e37fSmrg# gives unlimited permission to copy and/or distribute it,
8b042e37fSmrg# with or without modifications, as long as this notice is preserved.
9b042e37fSmrg
10b042e37fSmrg# This program is distributed in the hope that it will be useful,
11b042e37fSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12b042e37fSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13b042e37fSmrg# PARTICULAR PURPOSE.
14b042e37fSmrg
158c4a8e55Smrgm4_ifndef([AC_AUTOCONF_VERSION],
168c4a8e55Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17706b6b52Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
18706b6b52Smrg[m4_warning([this file was generated for autoconf 2.68.
198c4a8e55SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
208c4a8e55SmrgIf you have problems, you may need to regenerate the build system entirely.
218c4a8e55SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
22b042e37fSmrg
230597fb56Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
24b042e37fSmrg#
250597fb56Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
260597fb56Smrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
270597fb56Smrg#                 Foundation, Inc.
280597fb56Smrg#   Written by Gordon Matzigkeit, 1996
29b042e37fSmrg#
300597fb56Smrg# This file is free software; the Free Software Foundation gives
310597fb56Smrg# unlimited permission to copy and/or distribute it, with or without
320597fb56Smrg# modifications, as long as this notice is preserved.
338c4a8e55Smrg
340597fb56Smrgm4_define([_LT_COPYING], [dnl
350597fb56Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
360597fb56Smrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
370597fb56Smrg#                 Foundation, Inc.
380597fb56Smrg#   Written by Gordon Matzigkeit, 1996
39b042e37fSmrg#
400597fb56Smrg#   This file is part of GNU Libtool.
41b042e37fSmrg#
420597fb56Smrg# GNU Libtool is free software; you can redistribute it and/or
430597fb56Smrg# modify it under the terms of the GNU General Public License as
440597fb56Smrg# published by the Free Software Foundation; either version 2 of
450597fb56Smrg# the License, or (at your option) any later version.
46b042e37fSmrg#
470597fb56Smrg# As a special exception to the GNU General Public License,
480597fb56Smrg# if you distribute this file as part of a program or library that
490597fb56Smrg# is built using GNU Libtool, you may include this file under the
500597fb56Smrg# same distribution terms that you use for the rest of that program.
51b042e37fSmrg#
520597fb56Smrg# GNU Libtool is distributed in the hope that it will be useful,
530597fb56Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
540597fb56Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
550597fb56Smrg# GNU General Public License for more details.
56b042e37fSmrg#
570597fb56Smrg# You should have received a copy of the GNU General Public License
580597fb56Smrg# along with GNU Libtool; see the file COPYING.  If not, a copy
590597fb56Smrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
600597fb56Smrg# obtained by writing to the Free Software Foundation, Inc.,
610597fb56Smrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
628c4a8e55Smrg])
63b042e37fSmrg
640597fb56Smrg# serial 57 LT_INIT
65b042e37fSmrg
668c4a8e55Smrg
670597fb56Smrg# LT_PREREQ(VERSION)
680597fb56Smrg# ------------------
690597fb56Smrg# Complain and exit if this libtool version is less that VERSION.
700597fb56Smrgm4_defun([LT_PREREQ],
710597fb56Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
720597fb56Smrg       [m4_default([$3],
730597fb56Smrg		   [m4_fatal([Libtool version $1 or higher is required],
740597fb56Smrg		             63)])],
750597fb56Smrg       [$2])])
768c4a8e55Smrg
77b042e37fSmrg
780597fb56Smrg# _LT_CHECK_BUILDDIR
790597fb56Smrg# ------------------
800597fb56Smrg# Complain if the absolute build directory name contains unusual characters
810597fb56Smrgm4_defun([_LT_CHECK_BUILDDIR],
820597fb56Smrg[case `pwd` in
830597fb56Smrg  *\ * | *\	*)
840597fb56Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
850597fb56Smrgesac
860597fb56Smrg])
87b042e37fSmrg
88b042e37fSmrg
890597fb56Smrg# LT_INIT([OPTIONS])
900597fb56Smrg# ------------------
910597fb56SmrgAC_DEFUN([LT_INIT],
920597fb56Smrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
930597fb56SmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
940597fb56SmrgAC_BEFORE([$0], [LT_LANG])dnl
950597fb56SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
960597fb56SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
970597fb56Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
98b042e37fSmrg
990597fb56Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
1000597fb56Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
1010597fb56Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
1020597fb56Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
1030597fb56Smrgdnl unless we require an AC_DEFUNed macro:
1040597fb56SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
1050597fb56SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
1060597fb56SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
1070597fb56SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
1080597fb56Smrgm4_require([_LT_PROG_LTMAIN])dnl
109b042e37fSmrg
1100597fb56Smrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
111b042e37fSmrg
1120597fb56Smrgdnl Parse OPTIONS
1130597fb56Smrg_LT_SET_OPTIONS([$0], [$1])
114b042e37fSmrg
1150597fb56Smrg# This can be used to rebuild libtool when needed
1160597fb56SmrgLIBTOOL_DEPS="$ltmain"
117b042e37fSmrg
1180597fb56Smrg# Always use our own libtool.
1190597fb56SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
1200597fb56SmrgAC_SUBST(LIBTOOL)dnl
121b042e37fSmrg
1220597fb56Smrg_LT_SETUP
123b042e37fSmrg
1240597fb56Smrg# Only expand once:
1250597fb56Smrgm4_define([LT_INIT])
1260597fb56Smrg])# LT_INIT
127b042e37fSmrg
1280597fb56Smrg# Old names:
1290597fb56SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
1300597fb56SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
1310597fb56Smrgdnl aclocal-1.4 backwards compatibility:
1320597fb56Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
1330597fb56Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
134b042e37fSmrg
135b042e37fSmrg
1360597fb56Smrg# _LT_CC_BASENAME(CC)
1370597fb56Smrg# -------------------
1380597fb56Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
1390597fb56Smrgm4_defun([_LT_CC_BASENAME],
1400597fb56Smrg[for cc_temp in $1""; do
1410597fb56Smrg  case $cc_temp in
1420597fb56Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
1430597fb56Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
1440597fb56Smrg    \-*) ;;
1450597fb56Smrg    *) break;;
1460597fb56Smrg  esac
1470597fb56Smrgdone
1480597fb56Smrgcc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
149706b6b52Smrg])
150b042e37fSmrg
151b042e37fSmrg
1520597fb56Smrg# _LT_FILEUTILS_DEFAULTS
1530597fb56Smrg# ----------------------
1540597fb56Smrg# It is okay to use these file commands and assume they have been set
1550597fb56Smrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
1560597fb56Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
1570597fb56Smrg[: ${CP="cp -f"}
1580597fb56Smrg: ${MV="mv -f"}
1590597fb56Smrg: ${RM="rm -f"}
1600597fb56Smrg])# _LT_FILEUTILS_DEFAULTS
161b042e37fSmrg
162b042e37fSmrg
1630597fb56Smrg# _LT_SETUP
1640597fb56Smrg# ---------
1650597fb56Smrgm4_defun([_LT_SETUP],
1660597fb56Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1670597fb56SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
1680597fb56SmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
1690597fb56SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
170b042e37fSmrg
1710597fb56Smrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
1720597fb56Smrgdnl
1730597fb56Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
1740597fb56Smrg_LT_DECL([], [host], [0])dnl
1750597fb56Smrg_LT_DECL([], [host_os], [0])dnl
1760597fb56Smrgdnl
1770597fb56Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
1780597fb56Smrg_LT_DECL([], [build], [0])dnl
1790597fb56Smrg_LT_DECL([], [build_os], [0])dnl
1800597fb56Smrgdnl
1810597fb56SmrgAC_REQUIRE([AC_PROG_CC])dnl
1820597fb56SmrgAC_REQUIRE([LT_PATH_LD])dnl
1830597fb56SmrgAC_REQUIRE([LT_PATH_NM])dnl
1840597fb56Smrgdnl
1850597fb56SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
1860597fb56Smrgtest -z "$LN_S" && LN_S="ln -s"
1870597fb56Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
1880597fb56Smrgdnl
1890597fb56SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
1900597fb56Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
1910597fb56Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
1920597fb56Smrgdnl
1930597fb56Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
1940597fb56Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
1950597fb56Smrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
1960597fb56Smrgm4_require([_LT_CMD_RELOAD])dnl
1970597fb56Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
1980597fb56Smrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
1990597fb56Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
2000597fb56Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
2010597fb56Smrgm4_require([_LT_WITH_SYSROOT])dnl
202b042e37fSmrg
2030597fb56Smrg_LT_CONFIG_LIBTOOL_INIT([
2040597fb56Smrg# See if we are running on zsh, and set the options which allow our
2050597fb56Smrg# commands through without removal of \ escapes INIT.
2060597fb56Smrgif test -n "\${ZSH_VERSION+set}" ; then
2070597fb56Smrg   setopt NO_GLOB_SUBST
2080597fb56Smrgfi
209706b6b52Smrg])
2100597fb56Smrgif test -n "${ZSH_VERSION+set}" ; then
2110597fb56Smrg   setopt NO_GLOB_SUBST
2120597fb56Smrgfi
213b042e37fSmrg
2140597fb56Smrg_LT_CHECK_OBJDIR
215b042e37fSmrg
2160597fb56Smrgm4_require([_LT_TAG_COMPILER])dnl
217b042e37fSmrg
2180597fb56Smrgcase $host_os in
2190597fb56Smrgaix3*)
2200597fb56Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
2210597fb56Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
2220597fb56Smrg  # vanish in a puff of smoke.
2230597fb56Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
2240597fb56Smrg    COLLECT_NAMES=
2250597fb56Smrg    export COLLECT_NAMES
226706b6b52Smrg  fi
2270597fb56Smrg  ;;
2280597fb56Smrgesac
229b042e37fSmrg
2300597fb56Smrg# Global variables:
2310597fb56Smrgofile=libtool
2320597fb56Smrgcan_build_shared=yes
233b042e37fSmrg
2340597fb56Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
2350597fb56Smrg# which needs '.lib').
2360597fb56Smrglibext=a
237b042e37fSmrg
2380597fb56Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
2398c4a8e55Smrg
2400597fb56Smrgold_CC="$CC"
2410597fb56Smrgold_CFLAGS="$CFLAGS"
2428c4a8e55Smrg
2430597fb56Smrg# Set sane defaults for various variables
2440597fb56Smrgtest -z "$CC" && CC=cc
2450597fb56Smrgtest -z "$LTCC" && LTCC=$CC
2460597fb56Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
2470597fb56Smrgtest -z "$LD" && LD=ld
2480597fb56Smrgtest -z "$ac_objext" && ac_objext=o
2498c4a8e55Smrg
2500597fb56Smrg_LT_CC_BASENAME([$compiler])
251b042e37fSmrg
2520597fb56Smrg# Only perform the check for file, if the check method requires it
2530597fb56Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
2540597fb56Smrgcase $deplibs_check_method in
2550597fb56Smrgfile_magic*)
2560597fb56Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
2570597fb56Smrg    _LT_PATH_MAGIC
2580597fb56Smrg  fi
2590597fb56Smrg  ;;
2600597fb56Smrgesac
261b042e37fSmrg
2620597fb56Smrg# Use C for the default configuration in the libtool script
2630597fb56SmrgLT_SUPPORTED_TAG([CC])
2640597fb56Smrg_LT_LANG_C_CONFIG
2650597fb56Smrg_LT_LANG_DEFAULT_CONFIG
2660597fb56Smrg_LT_CONFIG_COMMANDS
2670597fb56Smrg])# _LT_SETUP
268706b6b52Smrg
269706b6b52Smrg
2700597fb56Smrg# _LT_PREPARE_SED_QUOTE_VARS
2710597fb56Smrg# --------------------------
2720597fb56Smrg# Define a few sed substitution that help us do robust quoting.
2730597fb56Smrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
2740597fb56Smrg[# Backslashify metacharacters that are still active within
2750597fb56Smrg# double-quoted strings.
2760597fb56Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
2778c4a8e55Smrg
2780597fb56Smrg# Same as above, but do not quote variable references.
2790597fb56Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
2808c4a8e55Smrg
2810597fb56Smrg# Sed substitution to delay expansion of an escaped shell variable in a
2820597fb56Smrg# double_quote_subst'ed string.
2830597fb56Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
2848c4a8e55Smrg
2850597fb56Smrg# Sed substitution to delay expansion of an escaped single quote.
2860597fb56Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
2878c4a8e55Smrg
2880597fb56Smrg# Sed substitution to avoid accidental globbing in evaled expressions
2890597fb56Smrgno_glob_subst='s/\*/\\\*/g'
2900597fb56Smrg])
2918c4a8e55Smrg
2920597fb56Smrg# _LT_PROG_LTMAIN
2930597fb56Smrg# ---------------
2940597fb56Smrg# Note that this code is called both from `configure', and `config.status'
2950597fb56Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
2960597fb56Smrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
2970597fb56Smrg# so we pass a copy along to make sure it has a sensible value anyway.
2980597fb56Smrgm4_defun([_LT_PROG_LTMAIN],
2990597fb56Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
3000597fb56Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
3010597fb56Smrgltmain="$ac_aux_dir/ltmain.sh"
3020597fb56Smrg])# _LT_PROG_LTMAIN
303b042e37fSmrg
304b042e37fSmrg
305b042e37fSmrg
3060597fb56Smrg# So that we can recreate a full libtool script including additional
3070597fb56Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
3080597fb56Smrg# in macros and then make a single call at the end using the `libtool'
3090597fb56Smrg# label.
310b042e37fSmrg
311b042e37fSmrg
3120597fb56Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
3130597fb56Smrg# ----------------------------------------
3140597fb56Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
3150597fb56Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
3160597fb56Smrg[m4_ifval([$1],
3170597fb56Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
3180597fb56Smrg                     [$1
3190597fb56Smrg])])])
320b042e37fSmrg
3210597fb56Smrg# Initialize.
3220597fb56Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
323706b6b52Smrg
324b042e37fSmrg
3250597fb56Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
3260597fb56Smrg# ------------------------------
3270597fb56Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
3280597fb56Smrgm4_define([_LT_CONFIG_LIBTOOL],
3290597fb56Smrg[m4_ifval([$1],
3300597fb56Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
3310597fb56Smrg                     [$1
3320597fb56Smrg])])])
333b042e37fSmrg
3340597fb56Smrg# Initialize.
3350597fb56Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
336b042e37fSmrg
337b042e37fSmrg
3380597fb56Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
3390597fb56Smrg# -----------------------------------------------------
3400597fb56Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
3410597fb56Smrg[_LT_CONFIG_LIBTOOL([$1])
3420597fb56Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
3430597fb56Smrg])
344b042e37fSmrg
345b042e37fSmrg
3460597fb56Smrg# _LT_FORMAT_COMMENT([COMMENT])
3470597fb56Smrg# -----------------------------
3480597fb56Smrg# Add leading comment marks to the start of each line, and a trailing
3490597fb56Smrg# full-stop to the whole comment if one is not present already.
3500597fb56Smrgm4_define([_LT_FORMAT_COMMENT],
3510597fb56Smrg[m4_ifval([$1], [
3520597fb56Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
3530597fb56Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
3540597fb56Smrg)])
355b042e37fSmrg
356b042e37fSmrg
357b042e37fSmrg
358b042e37fSmrg
359b042e37fSmrg
3600597fb56Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
3610597fb56Smrg# -------------------------------------------------------------------
3620597fb56Smrg# CONFIGNAME is the name given to the value in the libtool script.
3630597fb56Smrg# VARNAME is the (base) name used in the configure script.
3640597fb56Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
3650597fb56Smrg# VARNAME.  Any other value will be used directly.
3660597fb56Smrgm4_define([_LT_DECL],
3670597fb56Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
3680597fb56Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
3690597fb56Smrg	[m4_ifval([$1], [$1], [$2])])
3700597fb56Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
3710597fb56Smrg    m4_ifval([$4],
3720597fb56Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
3730597fb56Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
3740597fb56Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
3750597fb56Smrg])
376b042e37fSmrg
377b042e37fSmrg
3780597fb56Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
3790597fb56Smrg# --------------------------------------------------------
3800597fb56Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
381b042e37fSmrg
382b042e37fSmrg
3830597fb56Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
3840597fb56Smrg# ------------------------------------------------
3850597fb56Smrgm4_define([lt_decl_tag_varnames],
3860597fb56Smrg[_lt_decl_filter([tagged?], [yes], $@)])
387b042e37fSmrg
388b042e37fSmrg
3890597fb56Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
3900597fb56Smrg# ---------------------------------------------------------
3910597fb56Smrgm4_define([_lt_decl_filter],
3920597fb56Smrg[m4_case([$#],
3930597fb56Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
3940597fb56Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
3950597fb56Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
3960597fb56Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
3970597fb56Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
3980597fb56Smrg])
399b042e37fSmrg
4008c4a8e55Smrg
4010597fb56Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
4020597fb56Smrg# --------------------------------------------------
4030597fb56Smrgm4_define([lt_decl_quote_varnames],
4040597fb56Smrg[_lt_decl_filter([value], [1], $@)])
4058c4a8e55Smrg
406b042e37fSmrg
4070597fb56Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
4080597fb56Smrg# ---------------------------------------------------
4090597fb56Smrgm4_define([lt_decl_dquote_varnames],
4100597fb56Smrg[_lt_decl_filter([value], [2], $@)])
411b042e37fSmrg
4128c4a8e55Smrg
4130597fb56Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
4140597fb56Smrg# ---------------------------------------------------
4150597fb56Smrgm4_define([lt_decl_varnames_tagged],
4160597fb56Smrg[m4_assert([$# <= 2])dnl
4170597fb56Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
4180597fb56Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
4190597fb56Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
4200597fb56Smrgm4_define([_lt_decl_varnames_tagged],
4210597fb56Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
422b042e37fSmrg
423b042e37fSmrg
4240597fb56Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
4250597fb56Smrg# ------------------------------------------------
4260597fb56Smrgm4_define([lt_decl_all_varnames],
4270597fb56Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
4280597fb56Smrg     m4_if([$2], [],
4290597fb56Smrg	   m4_quote(lt_decl_varnames),
4300597fb56Smrg	m4_quote(m4_shift($@))))[]dnl
4310597fb56Smrg])
4320597fb56Smrgm4_define([_lt_decl_all_varnames],
4330597fb56Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
4340597fb56Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
4358c4a8e55Smrg])
436b042e37fSmrg
437b042e37fSmrg
4380597fb56Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
4390597fb56Smrg# ------------------------------------
4400597fb56Smrg# Quote a variable value, and forward it to `config.status' so that its
4410597fb56Smrg# declaration there will have the same value as in `configure'.  VARNAME
4420597fb56Smrg# must have a single quote delimited value for this to work.
4430597fb56Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
4440597fb56Smrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
4458c4a8e55Smrg
446b042e37fSmrg
4470597fb56Smrg# _LT_CONFIG_STATUS_DECLARATIONS
4480597fb56Smrg# ------------------------------
4490597fb56Smrg# We delimit libtool config variables with single quotes, so when
4500597fb56Smrg# we write them to config.status, we have to be sure to quote all
4510597fb56Smrg# embedded single quotes properly.  In configure, this macro expands
4520597fb56Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
4530597fb56Smrg#
4540597fb56Smrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
4550597fb56Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
4560597fb56Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
4570597fb56Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
458b042e37fSmrg
459b042e37fSmrg
4600597fb56Smrg# _LT_LIBTOOL_TAGS
4610597fb56Smrg# ----------------
4620597fb56Smrg# Output comment and list of tags supported by the script
4630597fb56Smrgm4_defun([_LT_LIBTOOL_TAGS],
4640597fb56Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
4650597fb56Smrgavailable_tags="_LT_TAGS"dnl
4660597fb56Smrg])
467b042e37fSmrg
468b042e37fSmrg
4690597fb56Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
4700597fb56Smrg# -----------------------------------
4710597fb56Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
4720597fb56Smrg# expand to a commented shell variable setting:
473706b6b52Smrg#
4740597fb56Smrg#    # Some comment about what VAR is for.
4750597fb56Smrg#    visible_name=$lt_internal_name
4760597fb56Smrgm4_define([_LT_LIBTOOL_DECLARE],
4770597fb56Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
4780597fb56Smrg					   [description])))[]dnl
4790597fb56Smrgm4_pushdef([_libtool_name],
4800597fb56Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
4810597fb56Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
4820597fb56Smrg    [0], [_libtool_name=[$]$1],
4830597fb56Smrg    [1], [_libtool_name=$lt_[]$1],
4840597fb56Smrg    [2], [_libtool_name=$lt_[]$1],
4850597fb56Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
4860597fb56Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
4870597fb56Smrg])
488b042e37fSmrg
4898c4a8e55Smrg
4900597fb56Smrg# _LT_LIBTOOL_CONFIG_VARS
4910597fb56Smrg# -----------------------
4920597fb56Smrg# Produce commented declarations of non-tagged libtool config variables
4930597fb56Smrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
4940597fb56Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
4950597fb56Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
4960597fb56Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
4970597fb56Smrg[m4_foreach([_lt_var],
4980597fb56Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
4990597fb56Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
500b042e37fSmrg
501b042e37fSmrg
5020597fb56Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
5030597fb56Smrg# -------------------------
5040597fb56Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
5050597fb56Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
5060597fb56Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
507b042e37fSmrg
508b042e37fSmrg
5090597fb56Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
5100597fb56Smrg# ------------------------------
5110597fb56Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
512b042e37fSmrg
513b042e37fSmrg
5140597fb56Smrg# _LT_CONFIG_COMMANDS
5150597fb56Smrg# -------------------
5160597fb56Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
5170597fb56Smrg# variables for single and double quote escaping we saved from calls
5180597fb56Smrg# to _LT_DECL, we can put quote escaped variables declarations
5190597fb56Smrg# into `config.status', and then the shell code to quote escape them in
5200597fb56Smrg# for loops in `config.status'.  Finally, any additional code accumulated
5210597fb56Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
5220597fb56Smrgm4_defun([_LT_CONFIG_COMMANDS],
5230597fb56Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
5240597fb56Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
5250597fb56Smrg	dnl instead of duplicating it all over again into config.status,
5260597fb56Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
5270597fb56Smrg	dnl needs to know what name is stored there:
5280597fb56Smrg        [AC_CONFIG_COMMANDS([libtool],
5290597fb56Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
5300597fb56Smrg    dnl If the libtool generation code is destined for config.status,
5310597fb56Smrg    dnl expand the accumulated commands and init code now:
5320597fb56Smrg    [AC_CONFIG_COMMANDS([libtool],
5330597fb56Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
5340597fb56Smrg])#_LT_CONFIG_COMMANDS
535b042e37fSmrg
536b042e37fSmrg
5370597fb56Smrg# Initialize.
5380597fb56Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
5390597fb56Smrg[
540706b6b52Smrg
5410597fb56Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
5420597fb56Smrg# if CDPATH is set.
5430597fb56Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
544706b6b52Smrg
5450597fb56Smrgsed_quote_subst='$sed_quote_subst'
5460597fb56Smrgdouble_quote_subst='$double_quote_subst'
5470597fb56Smrgdelay_variable_subst='$delay_variable_subst'
5480597fb56Smrg_LT_CONFIG_STATUS_DECLARATIONS
5490597fb56SmrgLTCC='$LTCC'
5500597fb56SmrgLTCFLAGS='$LTCFLAGS'
5510597fb56Smrgcompiler='$compiler_DEFAULT'
552b042e37fSmrg
5530597fb56Smrg# A function that is used when there is no print builtin or printf.
5540597fb56Smrgfunc_fallback_echo ()
5550597fb56Smrg{
5560597fb56Smrg  eval 'cat <<_LTECHO_EOF
5570597fb56Smrg\$[]1
5580597fb56Smrg_LTECHO_EOF'
5590597fb56Smrg}
560b042e37fSmrg
5610597fb56Smrg# Quote evaled strings.
5620597fb56Smrgfor var in lt_decl_all_varnames([[ \
5630597fb56Smrg]], lt_decl_quote_varnames); do
5640597fb56Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
5650597fb56Smrg    *[[\\\\\\\`\\"\\\$]]*)
5660597fb56Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
5670597fb56Smrg      ;;
5680597fb56Smrg    *)
5690597fb56Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
5700597fb56Smrg      ;;
571706b6b52Smrg    esac
5720597fb56Smrgdone
573b042e37fSmrg
5740597fb56Smrg# Double-quote double-evaled strings.
5750597fb56Smrgfor var in lt_decl_all_varnames([[ \
5760597fb56Smrg]], lt_decl_dquote_varnames); do
5770597fb56Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
5780597fb56Smrg    *[[\\\\\\\`\\"\\\$]]*)
5790597fb56Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
5800597fb56Smrg      ;;
5810597fb56Smrg    *)
5820597fb56Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
5830597fb56Smrg      ;;
584706b6b52Smrg    esac
5850597fb56Smrgdone
586b042e37fSmrg
5870597fb56Smrg_LT_OUTPUT_LIBTOOL_INIT
5880597fb56Smrg])
589b042e37fSmrg
5900597fb56Smrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
5910597fb56Smrg# ------------------------------------
5920597fb56Smrg# Generate a child script FILE with all initialization necessary to
5930597fb56Smrg# reuse the environment learned by the parent script, and make the
5940597fb56Smrg# file executable.  If COMMENT is supplied, it is inserted after the
5950597fb56Smrg# `#!' sequence but before initialization text begins.  After this
5960597fb56Smrg# macro, additional text can be appended to FILE to form the body of
5970597fb56Smrg# the child script.  The macro ends with non-zero status if the
5980597fb56Smrg# file could not be fully written (such as if the disk is full).
5990597fb56Smrgm4_ifdef([AS_INIT_GENERATED],
6000597fb56Smrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
6010597fb56Smrg[m4_defun([_LT_GENERATED_FILE_INIT],
6020597fb56Smrg[m4_require([AS_PREPARE])]dnl
6030597fb56Smrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
6040597fb56Smrg[lt_write_fail=0
6050597fb56Smrgcat >$1 <<_ASEOF || lt_write_fail=1
6060597fb56Smrg#! $SHELL
6070597fb56Smrg# Generated by $as_me.
6080597fb56Smrg$2
6090597fb56SmrgSHELL=\${CONFIG_SHELL-$SHELL}
6100597fb56Smrgexport SHELL
6110597fb56Smrg_ASEOF
6120597fb56Smrgcat >>$1 <<\_ASEOF || lt_write_fail=1
6130597fb56SmrgAS_SHELL_SANITIZE
6140597fb56Smrg_AS_PREPARE
6150597fb56Smrgexec AS_MESSAGE_FD>&1
6160597fb56Smrg_ASEOF
6170597fb56Smrgtest $lt_write_fail = 0 && chmod +x $1[]dnl
6180597fb56Smrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
619b042e37fSmrg
6200597fb56Smrg# LT_OUTPUT
6210597fb56Smrg# ---------
6220597fb56Smrg# This macro allows early generation of the libtool script (before
6230597fb56Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
6240597fb56Smrg# tests.
6250597fb56SmrgAC_DEFUN([LT_OUTPUT],
6260597fb56Smrg[: ${CONFIG_LT=./config.lt}
6270597fb56SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
6280597fb56Smrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
6290597fb56Smrg[# Run this file to recreate a libtool stub with the current configuration.])
630b042e37fSmrg
6310597fb56Smrgcat >>"$CONFIG_LT" <<\_LTEOF
6320597fb56Smrglt_cl_silent=false
6330597fb56Smrgexec AS_MESSAGE_LOG_FD>>config.log
6340597fb56Smrg{
6350597fb56Smrg  echo
6360597fb56Smrg  AS_BOX([Running $as_me.])
6370597fb56Smrg} >&AS_MESSAGE_LOG_FD
638b042e37fSmrg
6390597fb56Smrglt_cl_help="\
6400597fb56Smrg\`$as_me' creates a local libtool stub from the current configuration,
6410597fb56Smrgfor use in further configure time tests before the real libtool is
6420597fb56Smrggenerated.
643b042e37fSmrg
6440597fb56SmrgUsage: $[0] [[OPTIONS]]
645b042e37fSmrg
6460597fb56Smrg  -h, --help      print this help, then exit
6470597fb56Smrg  -V, --version   print version number, then exit
6480597fb56Smrg  -q, --quiet     do not print progress messages
6490597fb56Smrg  -d, --debug     don't remove temporary files
650b042e37fSmrg
6510597fb56SmrgReport bugs to <bug-libtool@gnu.org>."
652b042e37fSmrg
6530597fb56Smrglt_cl_version="\
6540597fb56Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
6550597fb56Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
6560597fb56Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
6578c4a8e55Smrg
6580597fb56SmrgCopyright (C) 2011 Free Software Foundation, Inc.
6590597fb56SmrgThis config.lt script is free software; the Free Software Foundation
6600597fb56Smrggives unlimited permision to copy, distribute and modify it."
6618c4a8e55Smrg
6620597fb56Smrgwhile test $[#] != 0
6630597fb56Smrgdo
6640597fb56Smrg  case $[1] in
6650597fb56Smrg    --version | --v* | -V )
6660597fb56Smrg      echo "$lt_cl_version"; exit 0 ;;
6670597fb56Smrg    --help | --h* | -h )
6680597fb56Smrg      echo "$lt_cl_help"; exit 0 ;;
6690597fb56Smrg    --debug | --d* | -d )
6700597fb56Smrg      debug=: ;;
6710597fb56Smrg    --quiet | --q* | --silent | --s* | -q )
6720597fb56Smrg      lt_cl_silent=: ;;
673b042e37fSmrg
6740597fb56Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
6750597fb56SmrgTry \`$[0] --help' for more information.]) ;;
676b042e37fSmrg
6770597fb56Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
6780597fb56SmrgTry \`$[0] --help' for more information.]) ;;
6790597fb56Smrg  esac
6800597fb56Smrg  shift
6810597fb56Smrgdone
6828c4a8e55Smrg
6830597fb56Smrgif $lt_cl_silent; then
6840597fb56Smrg  exec AS_MESSAGE_FD>/dev/null
6850597fb56Smrgfi
6860597fb56Smrg_LTEOF
6878c4a8e55Smrg
6880597fb56Smrgcat >>"$CONFIG_LT" <<_LTEOF
6890597fb56Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
6900597fb56Smrg_LTEOF
6918c4a8e55Smrg
6920597fb56Smrgcat >>"$CONFIG_LT" <<\_LTEOF
6930597fb56SmrgAC_MSG_NOTICE([creating $ofile])
6940597fb56Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
6950597fb56SmrgAS_EXIT(0)
6960597fb56Smrg_LTEOF
6970597fb56Smrgchmod +x "$CONFIG_LT"
6988c4a8e55Smrg
6990597fb56Smrg# configure is writing to config.log, but config.lt does its own redirection,
7000597fb56Smrg# appending to config.log, which fails on DOS, as config.log is still kept
7010597fb56Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
7020597fb56Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
7030597fb56Smrglt_cl_success=:
7040597fb56Smrgtest "$silent" = yes &&
7050597fb56Smrg  lt_config_lt_args="$lt_config_lt_args --quiet"
7060597fb56Smrgexec AS_MESSAGE_LOG_FD>/dev/null
7070597fb56Smrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
7080597fb56Smrgexec AS_MESSAGE_LOG_FD>>config.log
7090597fb56Smrg$lt_cl_success || AS_EXIT(1)
7100597fb56Smrg])# LT_OUTPUT
7118c4a8e55Smrg
7128c4a8e55Smrg
7130597fb56Smrg# _LT_CONFIG(TAG)
7140597fb56Smrg# ---------------
7150597fb56Smrg# If TAG is the built-in tag, create an initial libtool script with a
7160597fb56Smrg# default configuration from the untagged config vars.  Otherwise add code
7170597fb56Smrg# to config.status for appending the configuration named by TAG from the
7180597fb56Smrg# matching tagged config vars.
7190597fb56Smrgm4_defun([_LT_CONFIG],
7200597fb56Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7210597fb56Smrg_LT_CONFIG_SAVE_COMMANDS([
7220597fb56Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
7230597fb56Smrg  m4_if(_LT_TAG, [C], [
7240597fb56Smrg    # See if we are running on zsh, and set the options which allow our
7250597fb56Smrg    # commands through without removal of \ escapes.
7260597fb56Smrg    if test -n "${ZSH_VERSION+set}" ; then
7270597fb56Smrg      setopt NO_GLOB_SUBST
7280597fb56Smrg    fi
7298c4a8e55Smrg
7300597fb56Smrg    cfgfile="${ofile}T"
7310597fb56Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
7320597fb56Smrg    $RM "$cfgfile"
733b042e37fSmrg
7340597fb56Smrg    cat <<_LT_EOF >> "$cfgfile"
7350597fb56Smrg#! $SHELL
736b042e37fSmrg
7370597fb56Smrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
7380597fb56Smrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
7390597fb56Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
7400597fb56Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
741706b6b52Smrg#
7420597fb56Smrg_LT_COPYING
7430597fb56Smrg_LT_LIBTOOL_TAGS
744b042e37fSmrg
7450597fb56Smrg# ### BEGIN LIBTOOL CONFIG
7460597fb56Smrg_LT_LIBTOOL_CONFIG_VARS
7470597fb56Smrg_LT_LIBTOOL_TAG_VARS
7480597fb56Smrg# ### END LIBTOOL CONFIG
749b042e37fSmrg
7500597fb56Smrg_LT_EOF
751b042e37fSmrg
7520597fb56Smrg  case $host_os in
7530597fb56Smrg  aix3*)
7540597fb56Smrg    cat <<\_LT_EOF >> "$cfgfile"
7550597fb56Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
7560597fb56Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
7570597fb56Smrg# vanish in a puff of smoke.
7580597fb56Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
7590597fb56Smrg  COLLECT_NAMES=
7600597fb56Smrg  export COLLECT_NAMES
761706b6b52Smrgfi
7620597fb56Smrg_LT_EOF
7630597fb56Smrg    ;;
7640597fb56Smrg  esac
765b042e37fSmrg
7660597fb56Smrg  _LT_PROG_LTMAIN
767b042e37fSmrg
7680597fb56Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
7690597fb56Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
7700597fb56Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
7710597fb56Smrg  # is reportedly fixed, but why not run on old versions too?
7720597fb56Smrg  sed '$q' "$ltmain" >> "$cfgfile" \
7730597fb56Smrg     || (rm -f "$cfgfile"; exit 1)
774b042e37fSmrg
7750597fb56Smrg  _LT_PROG_REPLACE_SHELLFNS
7768c4a8e55Smrg
7770597fb56Smrg   mv -f "$cfgfile" "$ofile" ||
7780597fb56Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
7790597fb56Smrg  chmod +x "$ofile"
7800597fb56Smrg],
7810597fb56Smrg[cat <<_LT_EOF >> "$ofile"
782706b6b52Smrg
7830597fb56Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
7840597fb56Smrgdnl in a comment (ie after a #).
7850597fb56Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
7860597fb56Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
7870597fb56Smrg# ### END LIBTOOL TAG CONFIG: $1
7880597fb56Smrg_LT_EOF
7890597fb56Smrg])dnl /m4_if
7900597fb56Smrg],
7910597fb56Smrg[m4_if([$1], [], [
7920597fb56Smrg    PACKAGE='$PACKAGE'
7930597fb56Smrg    VERSION='$VERSION'
7940597fb56Smrg    TIMESTAMP='$TIMESTAMP'
7950597fb56Smrg    RM='$RM'
7960597fb56Smrg    ofile='$ofile'], [])
7970597fb56Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
7980597fb56Smrg])# _LT_CONFIG
799706b6b52Smrg
800706b6b52Smrg
8010597fb56Smrg# LT_SUPPORTED_TAG(TAG)
8020597fb56Smrg# ---------------------
8030597fb56Smrg# Trace this macro to discover what tags are supported by the libtool
8040597fb56Smrg# --tag option, using:
8050597fb56Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
8060597fb56SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
807706b6b52Smrg
808706b6b52Smrg
8090597fb56Smrg# C support is built-in for now
8100597fb56Smrgm4_define([_LT_LANG_C_enabled], [])
8110597fb56Smrgm4_define([_LT_TAGS], [])
812bd23fbfaSmrg
813bd23fbfaSmrg
8140597fb56Smrg# LT_LANG(LANG)
8150597fb56Smrg# -------------
8160597fb56Smrg# Enable libtool support for the given language if not already enabled.
8170597fb56SmrgAC_DEFUN([LT_LANG],
8180597fb56Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
8190597fb56Smrgm4_case([$1],
8200597fb56Smrg  [C],			[_LT_LANG(C)],
8210597fb56Smrg  [C++],		[_LT_LANG(CXX)],
8220597fb56Smrg  [Go],			[_LT_LANG(GO)],
8230597fb56Smrg  [Java],		[_LT_LANG(GCJ)],
8240597fb56Smrg  [Fortran 77],		[_LT_LANG(F77)],
8250597fb56Smrg  [Fortran],		[_LT_LANG(FC)],
8260597fb56Smrg  [Windows Resource],	[_LT_LANG(RC)],
8270597fb56Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
8280597fb56Smrg    [_LT_LANG($1)],
8290597fb56Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
8300597fb56Smrg])# LT_LANG
831bd23fbfaSmrg
832bd23fbfaSmrg
8330597fb56Smrg# _LT_LANG(LANGNAME)
8340597fb56Smrg# ------------------
8350597fb56Smrgm4_defun([_LT_LANG],
8360597fb56Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
8370597fb56Smrg  [LT_SUPPORTED_TAG([$1])dnl
8380597fb56Smrg  m4_append([_LT_TAGS], [$1 ])dnl
8390597fb56Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
8400597fb56Smrg  _LT_LANG_$1_CONFIG($1)])dnl
8410597fb56Smrg])# _LT_LANG
8420597fb56Smrg
8430597fb56Smrg
8440597fb56Smrgm4_ifndef([AC_PROG_GO], [
8450597fb56Smrg# NOTE: This macro has been submitted for inclusion into   #
8460597fb56Smrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
8470597fb56Smrg#  a released version of Autoconf we should remove this    #
8480597fb56Smrg#  macro and use it instead.                               #
8490597fb56Smrgm4_defun([AC_PROG_GO],
8500597fb56Smrg[AC_LANG_PUSH(Go)dnl
8510597fb56SmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
8520597fb56SmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
8530597fb56Smrg_AC_ARG_VAR_LDFLAGS()dnl
8540597fb56SmrgAC_CHECK_TOOL(GOC, gccgo)
8550597fb56Smrgif test -z "$GOC"; then
8560597fb56Smrg  if test -n "$ac_tool_prefix"; then
8570597fb56Smrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
8580597fb56Smrg  fi
859bd23fbfaSmrgfi
8600597fb56Smrgif test -z "$GOC"; then
8610597fb56Smrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
8620597fb56Smrgfi
8630597fb56Smrg])#m4_defun
8640597fb56Smrg])#m4_ifndef
865bd23fbfaSmrg
866bd23fbfaSmrg
8670597fb56Smrg# _LT_LANG_DEFAULT_CONFIG
8680597fb56Smrg# -----------------------
8690597fb56Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
8700597fb56Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
8710597fb56Smrg  [LT_LANG(CXX)],
8720597fb56Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
873706b6b52Smrg
8740597fb56SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
8750597fb56Smrg  [LT_LANG(F77)],
8760597fb56Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
877706b6b52Smrg
8780597fb56SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
8790597fb56Smrg  [LT_LANG(FC)],
8800597fb56Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
881706b6b52Smrg
8820597fb56Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
8830597fb56Smrgdnl pulling things in needlessly.
8840597fb56SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
8850597fb56Smrg  [LT_LANG(GCJ)],
8860597fb56Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
8870597fb56Smrg    [LT_LANG(GCJ)],
8880597fb56Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
8890597fb56Smrg      [LT_LANG(GCJ)],
8900597fb56Smrg      [m4_ifdef([AC_PROG_GCJ],
8910597fb56Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
8920597fb56Smrg       m4_ifdef([A][M_PROG_GCJ],
8930597fb56Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
8940597fb56Smrg       m4_ifdef([LT_PROG_GCJ],
8950597fb56Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
896706b6b52Smrg
8970597fb56SmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
8980597fb56Smrg  [LT_LANG(GO)],
8990597fb56Smrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
900706b6b52Smrg
9010597fb56SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
9020597fb56Smrg  [LT_LANG(RC)],
9030597fb56Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
9040597fb56Smrg])# _LT_LANG_DEFAULT_CONFIG
905706b6b52Smrg
9060597fb56Smrg# Obsolete macros:
9070597fb56SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
9080597fb56SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
9090597fb56SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
9100597fb56SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
9110597fb56SmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
9120597fb56Smrgdnl aclocal-1.4 backwards compatibility:
9130597fb56Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
9140597fb56Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
9150597fb56Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
9160597fb56Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
9170597fb56Smrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
918b042e37fSmrg
919b042e37fSmrg
9200597fb56Smrg# _LT_TAG_COMPILER
9210597fb56Smrg# ----------------
9220597fb56Smrgm4_defun([_LT_TAG_COMPILER],
9230597fb56Smrg[AC_REQUIRE([AC_PROG_CC])dnl
924b042e37fSmrg
9250597fb56Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
9260597fb56Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
9270597fb56Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
9280597fb56Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
929706b6b52Smrg
9300597fb56Smrg# If no C compiler was specified, use CC.
9310597fb56SmrgLTCC=${LTCC-"$CC"}
932bd23fbfaSmrg
9330597fb56Smrg# If no C compiler flags were specified, use CFLAGS.
9340597fb56SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
935b042e37fSmrg
9360597fb56Smrg# Allow CC to be a program name with arguments.
9370597fb56Smrgcompiler=$CC
9380597fb56Smrg])# _LT_TAG_COMPILER
939706b6b52Smrg
940b042e37fSmrg
9410597fb56Smrg# _LT_COMPILER_BOILERPLATE
9420597fb56Smrg# ------------------------
9430597fb56Smrg# Check for compiler boilerplate output or warnings with
9440597fb56Smrg# the simple compiler test code.
9450597fb56Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
9460597fb56Smrg[m4_require([_LT_DECL_SED])dnl
9470597fb56Smrgac_outfile=conftest.$ac_objext
9480597fb56Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
9490597fb56Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
9500597fb56Smrg_lt_compiler_boilerplate=`cat conftest.err`
9510597fb56Smrg$RM conftest*
9520597fb56Smrg])# _LT_COMPILER_BOILERPLATE
953706b6b52Smrg
954706b6b52Smrg
9550597fb56Smrg# _LT_LINKER_BOILERPLATE
9560597fb56Smrg# ----------------------
9570597fb56Smrg# Check for linker boilerplate output or warnings with
9580597fb56Smrg# the simple link test code.
9590597fb56Smrgm4_defun([_LT_LINKER_BOILERPLATE],
9600597fb56Smrg[m4_require([_LT_DECL_SED])dnl
9610597fb56Smrgac_outfile=conftest.$ac_objext
9620597fb56Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
9630597fb56Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
9640597fb56Smrg_lt_linker_boilerplate=`cat conftest.err`
9650597fb56Smrg$RM -r conftest*
9660597fb56Smrg])# _LT_LINKER_BOILERPLATE
967b042e37fSmrg
9680597fb56Smrg# _LT_REQUIRED_DARWIN_CHECKS
9690597fb56Smrg# -------------------------
9700597fb56Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
9710597fb56Smrg  case $host_os in
9720597fb56Smrg    rhapsody* | darwin*)
9730597fb56Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
9740597fb56Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
9750597fb56Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
9760597fb56Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
9770597fb56Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
9780597fb56Smrg    _LT_DECL([], [DSYMUTIL], [1],
9790597fb56Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
9800597fb56Smrg    _LT_DECL([], [NMEDIT], [1],
9810597fb56Smrg      [Tool to change global to local symbols on Mac OS X])
9820597fb56Smrg    _LT_DECL([], [LIPO], [1],
9830597fb56Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
9840597fb56Smrg    _LT_DECL([], [OTOOL], [1],
9850597fb56Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
9860597fb56Smrg    _LT_DECL([], [OTOOL64], [1],
9870597fb56Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
988bd23fbfaSmrg
9890597fb56Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
9900597fb56Smrg      [lt_cv_apple_cc_single_mod=no
9910597fb56Smrg      if test -z "${LT_MULTI_MODULE}"; then
9920597fb56Smrg	# By default we will add the -single_module flag. You can override
9930597fb56Smrg	# by either setting the environment variable LT_MULTI_MODULE
9940597fb56Smrg	# non-empty at configure time, or by adding -multi_module to the
9950597fb56Smrg	# link flags.
9960597fb56Smrg	rm -rf libconftest.dylib*
9970597fb56Smrg	echo "int foo(void){return 1;}" > conftest.c
9980597fb56Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
9990597fb56Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
10000597fb56Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
10010597fb56Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
10020597fb56Smrg        _lt_result=$?
10030597fb56Smrg	# If there is a non-empty error log, and "single_module"
10040597fb56Smrg	# appears in it, assume the flag caused a linker warning
10050597fb56Smrg        if test -s conftest.err && $GREP single_module conftest.err; then
10060597fb56Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
10070597fb56Smrg	# Otherwise, if the output was created with a 0 exit code from
10080597fb56Smrg	# the compiler, it worked.
10090597fb56Smrg	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
10100597fb56Smrg	  lt_cv_apple_cc_single_mod=yes
10110597fb56Smrg	else
10120597fb56Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
10130597fb56Smrg	fi
10140597fb56Smrg	rm -rf libconftest.dylib*
10150597fb56Smrg	rm -f conftest.*
10160597fb56Smrg      fi])
1017bd23fbfaSmrg
10180597fb56Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
10190597fb56Smrg      [lt_cv_ld_exported_symbols_list],
10200597fb56Smrg      [lt_cv_ld_exported_symbols_list=no
10210597fb56Smrg      save_LDFLAGS=$LDFLAGS
10220597fb56Smrg      echo "_main" > conftest.sym
10230597fb56Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
10240597fb56Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
10250597fb56Smrg	[lt_cv_ld_exported_symbols_list=yes],
10260597fb56Smrg	[lt_cv_ld_exported_symbols_list=no])
10270597fb56Smrg	LDFLAGS="$save_LDFLAGS"
10280597fb56Smrg    ])
1029bd23fbfaSmrg
10300597fb56Smrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
10310597fb56Smrg      [lt_cv_ld_force_load=no
10320597fb56Smrg      cat > conftest.c << _LT_EOF
10330597fb56Smrgint forced_loaded() { return 2;}
10340597fb56Smrg_LT_EOF
10350597fb56Smrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
10360597fb56Smrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
10370597fb56Smrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
10380597fb56Smrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
10390597fb56Smrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
10400597fb56Smrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
10410597fb56Smrg      cat > conftest.c << _LT_EOF
10420597fb56Smrgint main() { return 0;}
10430597fb56Smrg_LT_EOF
10440597fb56Smrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
10450597fb56Smrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
10460597fb56Smrg      _lt_result=$?
10470597fb56Smrg      if test -s conftest.err && $GREP force_load conftest.err; then
10480597fb56Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
10490597fb56Smrg      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
10500597fb56Smrg	lt_cv_ld_force_load=yes
10510597fb56Smrg      else
10520597fb56Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
10530597fb56Smrg      fi
10540597fb56Smrg        rm -f conftest.err libconftest.a conftest conftest.c
10550597fb56Smrg        rm -rf conftest.dSYM
10560597fb56Smrg    ])
10570597fb56Smrg    case $host_os in
10580597fb56Smrg    rhapsody* | darwin1.[[012]])
10590597fb56Smrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
10600597fb56Smrg    darwin1.*)
10610597fb56Smrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
10620597fb56Smrg    darwin*) # darwin 5.x on
10630597fb56Smrg      # if running on 10.5 or later, the deployment target defaults
10640597fb56Smrg      # to the OS version, if on x86, and 10.4, the deployment
10650597fb56Smrg      # target defaults to 10.4. Don't you love it?
10660597fb56Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
10670597fb56Smrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
10680597fb56Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
10690597fb56Smrg	10.[[012]]*)
10700597fb56Smrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
10710597fb56Smrg	10.*)
10720597fb56Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
10730597fb56Smrg      esac
10740597fb56Smrg    ;;
10750597fb56Smrg  esac
10760597fb56Smrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
10770597fb56Smrg      _lt_dar_single_mod='$single_module'
10780597fb56Smrg    fi
10790597fb56Smrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
10800597fb56Smrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
10810597fb56Smrg    else
10820597fb56Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
10830597fb56Smrg    fi
10840597fb56Smrg    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
10850597fb56Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
10860597fb56Smrg    else
10870597fb56Smrg      _lt_dsymutil=
10880597fb56Smrg    fi
10890597fb56Smrg    ;;
10900597fb56Smrg  esac
10910597fb56Smrg])
1092bd23fbfaSmrg
1093bd23fbfaSmrg
10940597fb56Smrg# _LT_DARWIN_LINKER_FEATURES([TAG])
10950597fb56Smrg# ---------------------------------
10960597fb56Smrg# Checks for linker and compiler features on darwin
10970597fb56Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
10980597fb56Smrg[
10990597fb56Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
11000597fb56Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
11010597fb56Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
11020597fb56Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
11030597fb56Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
11040597fb56Smrg  if test "$lt_cv_ld_force_load" = "yes"; then
11050597fb56Smrg    _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\"`'
11060597fb56Smrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
11070597fb56Smrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
11080597fb56Smrg  else
11090597fb56Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1110bd23fbfaSmrg  fi
11110597fb56Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
11120597fb56Smrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
11130597fb56Smrg  case $cc_basename in
11140597fb56Smrg     ifort*) _lt_dar_can_shared=yes ;;
11150597fb56Smrg     *) _lt_dar_can_shared=$GCC ;;
11160597fb56Smrg  esac
11170597fb56Smrg  if test "$_lt_dar_can_shared" = "yes"; then
11180597fb56Smrg    output_verbose_link_cmd=func_echo_all
11190597fb56Smrg    _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}"
11200597fb56Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
11210597fb56Smrg    _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}"
11220597fb56Smrg    _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}"
11230597fb56Smrg    m4_if([$1], [CXX],
11240597fb56Smrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
11250597fb56Smrg      _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}"
11260597fb56Smrg      _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}"
11270597fb56Smrg    fi
11280597fb56Smrg],[])
11290597fb56Smrg  else
11300597fb56Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
11310597fb56Smrg  fi
11320597fb56Smrg])
1133bd23fbfaSmrg
11340597fb56Smrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
11350597fb56Smrg# ----------------------------------
11360597fb56Smrg# Links a minimal program and checks the executable
11370597fb56Smrg# for the system default hardcoded library path. In most cases,
11380597fb56Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
11390597fb56Smrg# the location of the communication and MPI libs are included too.
11400597fb56Smrg# If we don't find anything, use the default library path according
11410597fb56Smrg# to the aix ld manual.
11420597fb56Smrg# Store the results from the different compilers for each TAGNAME.
11430597fb56Smrg# Allow to override them for all tags through lt_cv_aix_libpath.
11440597fb56Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
11450597fb56Smrg[m4_require([_LT_DECL_SED])dnl
11460597fb56Smrgif test "${lt_cv_aix_libpath+set}" = set; then
11470597fb56Smrg  aix_libpath=$lt_cv_aix_libpath
11480597fb56Smrgelse
11490597fb56Smrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
11500597fb56Smrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
11510597fb56Smrg  lt_aix_libpath_sed='[
11520597fb56Smrg      /Import File Strings/,/^$/ {
11530597fb56Smrg	  /^0/ {
11540597fb56Smrg	      s/^0  *\([^ ]*\) *$/\1/
11550597fb56Smrg	      p
11560597fb56Smrg	  }
11570597fb56Smrg      }]'
11580597fb56Smrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
11590597fb56Smrg  # Check for a 64-bit object if we didn't find anything.
11600597fb56Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
11610597fb56Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
11620597fb56Smrg  fi],[])
11630597fb56Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
11640597fb56Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
1165bd23fbfaSmrg  fi
11660597fb56Smrg  ])
11670597fb56Smrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
1168bd23fbfaSmrgfi
11690597fb56Smrg])# _LT_SYS_MODULE_PATH_AIX
1170bd23fbfaSmrg
11710597fb56Smrg
11720597fb56Smrg# _LT_SHELL_INIT(ARG)
11730597fb56Smrg# -------------------
11740597fb56Smrgm4_define([_LT_SHELL_INIT],
11750597fb56Smrg[m4_divert_text([M4SH-INIT], [$1
11760597fb56Smrg])])# _LT_SHELL_INIT
11770597fb56Smrg
11780597fb56Smrg
11790597fb56Smrg
11800597fb56Smrg# _LT_PROG_ECHO_BACKSLASH
1181bd23fbfaSmrg# -----------------------
11820597fb56Smrg# Find how we can fake an echo command that does not interpret backslash.
11830597fb56Smrg# In particular, with Autoconf 2.60 or later we add some code to the start
11840597fb56Smrg# of the generated configure script which will find a shell with a builtin
11850597fb56Smrg# printf (which we can use as an echo command).
11860597fb56Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
11870597fb56Smrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
11880597fb56SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
11890597fb56SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
11900597fb56Smrg
11910597fb56SmrgAC_MSG_CHECKING([how to print strings])
11920597fb56Smrg# Test print first, because it will be a builtin if present.
11930597fb56Smrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
11940597fb56Smrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
11950597fb56Smrg  ECHO='print -r --'
11960597fb56Smrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
11970597fb56Smrg  ECHO='printf %s\n'
1198bd23fbfaSmrgelse
11990597fb56Smrg  # Use this function as a fallback that always works.
12000597fb56Smrg  func_fallback_echo ()
12010597fb56Smrg  {
12020597fb56Smrg    eval 'cat <<_LTECHO_EOF
12030597fb56Smrg$[]1
12040597fb56Smrg_LTECHO_EOF'
12050597fb56Smrg  }
12060597fb56Smrg  ECHO='func_fallback_echo'
1207bd23fbfaSmrgfi
1208bd23fbfaSmrg
12090597fb56Smrg# func_echo_all arg...
12100597fb56Smrg# Invoke $ECHO with all args, space-separated.
12110597fb56Smrgfunc_echo_all ()
12120597fb56Smrg{
12130597fb56Smrg    $ECHO "$*" 
12140597fb56Smrg}
1215b042e37fSmrg
12160597fb56Smrgcase "$ECHO" in
12170597fb56Smrg  printf*) AC_MSG_RESULT([printf]) ;;
12180597fb56Smrg  print*) AC_MSG_RESULT([print -r]) ;;
12190597fb56Smrg  *) AC_MSG_RESULT([cat]) ;;
12200597fb56Smrgesac
1221b042e37fSmrg
12220597fb56Smrgm4_ifdef([_AS_DETECT_SUGGESTED],
12230597fb56Smrg[_AS_DETECT_SUGGESTED([
12240597fb56Smrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
12250597fb56Smrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
12260597fb56Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
12270597fb56Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
12280597fb56Smrg    PATH=/empty FPATH=/empty; export PATH FPATH
12290597fb56Smrg    test "X`printf %s $ECHO`" = "X$ECHO" \
12300597fb56Smrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
1231b042e37fSmrg
12320597fb56Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
12330597fb56Smrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
12340597fb56Smrg])# _LT_PROG_ECHO_BACKSLASH
1235b042e37fSmrg
1236b042e37fSmrg
12370597fb56Smrg# _LT_WITH_SYSROOT
12380597fb56Smrg# ----------------
12390597fb56SmrgAC_DEFUN([_LT_WITH_SYSROOT],
12400597fb56Smrg[AC_MSG_CHECKING([for sysroot])
12410597fb56SmrgAC_ARG_WITH([sysroot],
12420597fb56Smrg[  --with-sysroot[=DIR] Search for dependent libraries within DIR
12430597fb56Smrg                        (or the compiler's sysroot if not specified).],
12440597fb56Smrg[], [with_sysroot=no])
1245b042e37fSmrg
12460597fb56Smrgdnl lt_sysroot will always be passed unquoted.  We quote it here
12470597fb56Smrgdnl in case the user passed a directory name.
12480597fb56Smrglt_sysroot=
12490597fb56Smrgcase ${with_sysroot} in #(
12500597fb56Smrg yes)
12510597fb56Smrg   if test "$GCC" = yes; then
12520597fb56Smrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
12530597fb56Smrg   fi
12540597fb56Smrg   ;; #(
12550597fb56Smrg /*)
12560597fb56Smrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
12570597fb56Smrg   ;; #(
12580597fb56Smrg no|'')
12590597fb56Smrg   ;; #(
12600597fb56Smrg *)
12610597fb56Smrg   AC_MSG_RESULT([${with_sysroot}])
12620597fb56Smrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
12630597fb56Smrg   ;;
12640597fb56Smrgesac
12650597fb56Smrg
12660597fb56Smrg AC_MSG_RESULT([${lt_sysroot:-no}])
12670597fb56Smrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
12680597fb56Smrg[dependent libraries, and in which our libraries should be installed.])])
12690597fb56Smrg
12700597fb56Smrg# _LT_ENABLE_LOCK
12710597fb56Smrg# ---------------
12720597fb56Smrgm4_defun([_LT_ENABLE_LOCK],
12730597fb56Smrg[AC_ARG_ENABLE([libtool-lock],
12740597fb56Smrg  [AS_HELP_STRING([--disable-libtool-lock],
12750597fb56Smrg    [avoid locking (might break parallel builds)])])
12760597fb56Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
12770597fb56Smrg
12780597fb56Smrg# Some flags need to be propagated to the compiler or linker for good
12790597fb56Smrg# libtool support.
12800597fb56Smrgcase $host in
12810597fb56Smrgia64-*-hpux*)
12820597fb56Smrg  # Find out which ABI we are using.
12830597fb56Smrg  echo 'int i;' > conftest.$ac_ext
12840597fb56Smrg  if AC_TRY_EVAL(ac_compile); then
12850597fb56Smrg    case `/usr/bin/file conftest.$ac_objext` in
12860597fb56Smrg      *ELF-32*)
12870597fb56Smrg	HPUX_IA64_MODE="32"
1288706b6b52Smrg	;;
12890597fb56Smrg      *ELF-64*)
12900597fb56Smrg	HPUX_IA64_MODE="64"
1291706b6b52Smrg	;;
12920597fb56Smrg    esac
12930597fb56Smrg  fi
12940597fb56Smrg  rm -rf conftest*
12950597fb56Smrg  ;;
12960597fb56Smrg*-*-irix6*)
12970597fb56Smrg  # Find out which ABI we are using.
12980597fb56Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
12990597fb56Smrg  if AC_TRY_EVAL(ac_compile); then
13000597fb56Smrg    if test "$lt_cv_prog_gnu_ld" = yes; then
13010597fb56Smrg      case `/usr/bin/file conftest.$ac_objext` in
13020597fb56Smrg	*32-bit*)
13030597fb56Smrg	  LD="${LD-ld} -melf32bsmip"
13040597fb56Smrg	  ;;
13050597fb56Smrg	*N32*)
13060597fb56Smrg	  LD="${LD-ld} -melf32bmipn32"
13070597fb56Smrg	  ;;
13080597fb56Smrg	*64-bit*)
13090597fb56Smrg	  LD="${LD-ld} -melf64bmip"
1310706b6b52Smrg	;;
13110597fb56Smrg      esac
13120597fb56Smrg    else
13130597fb56Smrg      case `/usr/bin/file conftest.$ac_objext` in
13140597fb56Smrg	*32-bit*)
13150597fb56Smrg	  LD="${LD-ld} -32"
13160597fb56Smrg	  ;;
13170597fb56Smrg	*N32*)
13180597fb56Smrg	  LD="${LD-ld} -n32"
13190597fb56Smrg	  ;;
13200597fb56Smrg	*64-bit*)
13210597fb56Smrg	  LD="${LD-ld} -64"
13220597fb56Smrg	  ;;
13230597fb56Smrg      esac
13240597fb56Smrg    fi
13250597fb56Smrg  fi
13260597fb56Smrg  rm -rf conftest*
13270597fb56Smrg  ;;
1328b042e37fSmrg
13290597fb56Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
13300597fb56Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
13310597fb56Smrg  # Find out which ABI we are using.
13320597fb56Smrg  echo 'int i;' > conftest.$ac_ext
13330597fb56Smrg  if AC_TRY_EVAL(ac_compile); then
13340597fb56Smrg    case `/usr/bin/file conftest.o` in
13350597fb56Smrg      *32-bit*)
13360597fb56Smrg	case $host in
13370597fb56Smrg	  x86_64-*kfreebsd*-gnu)
13380597fb56Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
13390597fb56Smrg	    ;;
13400597fb56Smrg	  x86_64-*linux*)
13410597fb56Smrg	    LD="${LD-ld} -m elf_i386"
13420597fb56Smrg	    ;;
13430597fb56Smrg	  ppc64-*linux*|powerpc64-*linux*)
13440597fb56Smrg	    LD="${LD-ld} -m elf32ppclinux"
13450597fb56Smrg	    ;;
13460597fb56Smrg	  s390x-*linux*)
13470597fb56Smrg	    LD="${LD-ld} -m elf_s390"
13480597fb56Smrg	    ;;
13490597fb56Smrg	  sparc64-*linux*)
13500597fb56Smrg	    LD="${LD-ld} -m elf32_sparc"
13510597fb56Smrg	    ;;
13520597fb56Smrg	esac
13530597fb56Smrg	;;
13540597fb56Smrg      *64-bit*)
13550597fb56Smrg	case $host in
13560597fb56Smrg	  x86_64-*kfreebsd*-gnu)
13570597fb56Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
13580597fb56Smrg	    ;;
13590597fb56Smrg	  x86_64-*linux*)
13600597fb56Smrg	    LD="${LD-ld} -m elf_x86_64"
13610597fb56Smrg	    ;;
13620597fb56Smrg	  ppc*-*linux*|powerpc*-*linux*)
13630597fb56Smrg	    LD="${LD-ld} -m elf64ppc"
13640597fb56Smrg	    ;;
13650597fb56Smrg	  s390*-*linux*|s390*-*tpf*)
13660597fb56Smrg	    LD="${LD-ld} -m elf64_s390"
13670597fb56Smrg	    ;;
13680597fb56Smrg	  sparc*-*linux*)
13690597fb56Smrg	    LD="${LD-ld} -m elf64_sparc"
13700597fb56Smrg	    ;;
13710597fb56Smrg	esac
13720597fb56Smrg	;;
13730597fb56Smrg    esac
13740597fb56Smrg  fi
13750597fb56Smrg  rm -rf conftest*
13760597fb56Smrg  ;;
1377b042e37fSmrg
13780597fb56Smrg*-*-sco3.2v5*)
13790597fb56Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
13800597fb56Smrg  SAVE_CFLAGS="$CFLAGS"
13810597fb56Smrg  CFLAGS="$CFLAGS -belf"
13820597fb56Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
13830597fb56Smrg    [AC_LANG_PUSH(C)
13840597fb56Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
13850597fb56Smrg     AC_LANG_POP])
13860597fb56Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
13870597fb56Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
13880597fb56Smrg    CFLAGS="$SAVE_CFLAGS"
13890597fb56Smrg  fi
13900597fb56Smrg  ;;
13910597fb56Smrg*-*solaris*)
13920597fb56Smrg  # Find out which ABI we are using.
13930597fb56Smrg  echo 'int i;' > conftest.$ac_ext
13940597fb56Smrg  if AC_TRY_EVAL(ac_compile); then
13950597fb56Smrg    case `/usr/bin/file conftest.o` in
13960597fb56Smrg    *64-bit*)
13970597fb56Smrg      case $lt_cv_prog_gnu_ld in
13980597fb56Smrg      yes*)
13990597fb56Smrg        case $host in
14000597fb56Smrg        i?86-*-solaris*)
14010597fb56Smrg          LD="${LD-ld} -m elf_x86_64"
14020597fb56Smrg          ;;
14030597fb56Smrg        sparc*-*-solaris*)
14040597fb56Smrg          LD="${LD-ld} -m elf64_sparc"
14050597fb56Smrg          ;;
14060597fb56Smrg        esac
14070597fb56Smrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
14080597fb56Smrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
14090597fb56Smrg          LD="${LD-ld}_sol2"
14100597fb56Smrg        fi
14110597fb56Smrg        ;;
14120597fb56Smrg      *)
14130597fb56Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
14140597fb56Smrg	  LD="${LD-ld} -64"
14150597fb56Smrg	fi
14160597fb56Smrg	;;
14170597fb56Smrg      esac
14180597fb56Smrg      ;;
14190597fb56Smrg    esac
14200597fb56Smrg  fi
14210597fb56Smrg  rm -rf conftest*
14220597fb56Smrg  ;;
14230597fb56Smrgesac
1424b042e37fSmrg
14250597fb56Smrgneed_locks="$enable_libtool_lock"
14260597fb56Smrg])# _LT_ENABLE_LOCK
1427b042e37fSmrg
1428706b6b52Smrg
14290597fb56Smrg# _LT_PROG_AR
14300597fb56Smrg# -----------
14310597fb56Smrgm4_defun([_LT_PROG_AR],
14320597fb56Smrg[AC_CHECK_TOOLS(AR, [ar], false)
14330597fb56Smrg: ${AR=ar}
14340597fb56Smrg: ${AR_FLAGS=cru}
14350597fb56Smrg_LT_DECL([], [AR], [1], [The archiver])
14360597fb56Smrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
1437706b6b52Smrg
14380597fb56SmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
14390597fb56Smrg  [lt_cv_ar_at_file=no
14400597fb56Smrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
14410597fb56Smrg     [echo conftest.$ac_objext > conftest.lst
14420597fb56Smrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
14430597fb56Smrg      AC_TRY_EVAL([lt_ar_try])
14440597fb56Smrg      if test "$ac_status" -eq 0; then
14450597fb56Smrg	# Ensure the archiver fails upon bogus file names.
14460597fb56Smrg	rm -f conftest.$ac_objext libconftest.a
14470597fb56Smrg	AC_TRY_EVAL([lt_ar_try])
14480597fb56Smrg	if test "$ac_status" -ne 0; then
14490597fb56Smrg          lt_cv_ar_at_file=@
14500597fb56Smrg        fi
14510597fb56Smrg      fi
14520597fb56Smrg      rm -f conftest.* libconftest.a
14530597fb56Smrg     ])
14540597fb56Smrg  ])
1455b042e37fSmrg
14560597fb56Smrgif test "x$lt_cv_ar_at_file" = xno; then
14570597fb56Smrg  archiver_list_spec=
14580597fb56Smrgelse
14590597fb56Smrg  archiver_list_spec=$lt_cv_ar_at_file
1460b042e37fSmrgfi
14610597fb56Smrg_LT_DECL([], [archiver_list_spec], [1],
14620597fb56Smrg  [How to feed a file listing to the archiver])
14630597fb56Smrg])# _LT_PROG_AR
1464b042e37fSmrg
1465b042e37fSmrg
14660597fb56Smrg# _LT_CMD_OLD_ARCHIVE
1467bd23fbfaSmrg# -------------------
14680597fb56Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
14690597fb56Smrg[_LT_PROG_AR
1470bd23fbfaSmrg
14710597fb56SmrgAC_CHECK_TOOL(STRIP, strip, :)
14720597fb56Smrgtest -z "$STRIP" && STRIP=:
14730597fb56Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1474b042e37fSmrg
14750597fb56SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
14760597fb56Smrgtest -z "$RANLIB" && RANLIB=:
14770597fb56Smrg_LT_DECL([], [RANLIB], [1],
14780597fb56Smrg    [Commands used to install an old-style archive])
1479706b6b52Smrg
14800597fb56Smrg# Determine commands to create old-style static archives.
14810597fb56Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
14820597fb56Smrgold_postinstall_cmds='chmod 644 $oldlib'
14830597fb56Smrgold_postuninstall_cmds=
14840597fb56Smrg
14850597fb56Smrgif test -n "$RANLIB"; then
14860597fb56Smrg  case $host_os in
14870597fb56Smrg  openbsd*)
14880597fb56Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
14890597fb56Smrg    ;;
14900597fb56Smrg  *)
14910597fb56Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
14920597fb56Smrg    ;;
14930597fb56Smrg  esac
14940597fb56Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
1495706b6b52Smrgfi
14968c4a8e55Smrg
14970597fb56Smrgcase $host_os in
14980597fb56Smrg  darwin*)
14990597fb56Smrg    lock_old_archive_extraction=yes ;;
15000597fb56Smrg  *)
15010597fb56Smrg    lock_old_archive_extraction=no ;;
15020597fb56Smrgesac
15030597fb56Smrg_LT_DECL([], [old_postinstall_cmds], [2])
15040597fb56Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
15050597fb56Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
15060597fb56Smrg    [Commands used to build an old-style archive])
15070597fb56Smrg_LT_DECL([], [lock_old_archive_extraction], [0],
15080597fb56Smrg    [Whether to use a lock for old archive extraction])
15090597fb56Smrg])# _LT_CMD_OLD_ARCHIVE
1510706b6b52Smrg
1511706b6b52Smrg
15120597fb56Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
15130597fb56Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
15140597fb56Smrg# ----------------------------------------------------------------
15150597fb56Smrg# Check whether the given compiler option works
15160597fb56SmrgAC_DEFUN([_LT_COMPILER_OPTION],
15170597fb56Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
15180597fb56Smrgm4_require([_LT_DECL_SED])dnl
15190597fb56SmrgAC_CACHE_CHECK([$1], [$2],
15200597fb56Smrg  [$2=no
15210597fb56Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
15220597fb56Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
15230597fb56Smrg   lt_compiler_flag="$3"
15240597fb56Smrg   # Insert the option either (1) after the last *FLAGS variable, or
15250597fb56Smrg   # (2) before a word containing "conftest.", or (3) at the end.
15260597fb56Smrg   # Note that $ac_compile itself does not contain backslashes and begins
15270597fb56Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
15280597fb56Smrg   # The option is referenced via a variable to avoid confusing sed.
15290597fb56Smrg   lt_compile=`echo "$ac_compile" | $SED \
15300597fb56Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
15310597fb56Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
15320597fb56Smrg   -e 's:$: $lt_compiler_flag:'`
15330597fb56Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
15340597fb56Smrg   (eval "$lt_compile" 2>conftest.err)
15350597fb56Smrg   ac_status=$?
15360597fb56Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
15370597fb56Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
15380597fb56Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
15390597fb56Smrg     # The compiler can only warn and ignore the option if not recognized
15400597fb56Smrg     # So say no if there are warnings other than the usual output.
15410597fb56Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
15420597fb56Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
15430597fb56Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
15440597fb56Smrg       $2=yes
15450597fb56Smrg     fi
15460597fb56Smrg   fi
15470597fb56Smrg   $RM conftest*
1548706b6b52Smrg])
1549b042e37fSmrg
15500597fb56Smrgif test x"[$]$2" = xyes; then
15510597fb56Smrg    m4_if([$5], , :, [$5])
15520597fb56Smrgelse
15530597fb56Smrg    m4_if([$6], , :, [$6])
1554706b6b52Smrgfi
15550597fb56Smrg])# _LT_COMPILER_OPTION
15568c4a8e55Smrg
15570597fb56Smrg# Old name:
15580597fb56SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
15590597fb56Smrgdnl aclocal-1.4 backwards compatibility:
15600597fb56Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
15618c4a8e55Smrg
15628c4a8e55Smrg
15630597fb56Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
15640597fb56Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
15650597fb56Smrg# ----------------------------------------------------
15660597fb56Smrg# Check whether the given linker option works
15670597fb56SmrgAC_DEFUN([_LT_LINKER_OPTION],
15680597fb56Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
15690597fb56Smrgm4_require([_LT_DECL_SED])dnl
15700597fb56SmrgAC_CACHE_CHECK([$1], [$2],
15710597fb56Smrg  [$2=no
15720597fb56Smrg   save_LDFLAGS="$LDFLAGS"
15730597fb56Smrg   LDFLAGS="$LDFLAGS $3"
15740597fb56Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
15750597fb56Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
15760597fb56Smrg     # The linker can only warn and ignore the option if not recognized
15770597fb56Smrg     # So say no if there are warnings
15780597fb56Smrg     if test -s conftest.err; then
15790597fb56Smrg       # Append any errors to the config.log.
15800597fb56Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
15810597fb56Smrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
15820597fb56Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
15830597fb56Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
15840597fb56Smrg         $2=yes
15850597fb56Smrg       fi
15860597fb56Smrg     else
15870597fb56Smrg       $2=yes
15880597fb56Smrg     fi
15890597fb56Smrg   fi
15900597fb56Smrg   $RM -r conftest*
15910597fb56Smrg   LDFLAGS="$save_LDFLAGS"
15920597fb56Smrg])
1593b042e37fSmrg
15940597fb56Smrgif test x"[$]$2" = xyes; then
15950597fb56Smrg    m4_if([$4], , :, [$4])
1596706b6b52Smrgelse
15970597fb56Smrg    m4_if([$5], , :, [$5])
15980597fb56Smrgfi
15990597fb56Smrg])# _LT_LINKER_OPTION
1600b042e37fSmrg
16010597fb56Smrg# Old name:
16020597fb56SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
16030597fb56Smrgdnl aclocal-1.4 backwards compatibility:
16040597fb56Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1605b042e37fSmrg
1606b042e37fSmrg
16070597fb56Smrg# LT_CMD_MAX_LEN
16080597fb56Smrg#---------------
16090597fb56SmrgAC_DEFUN([LT_CMD_MAX_LEN],
16100597fb56Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
16110597fb56Smrg# find the maximum length of command line arguments
16120597fb56SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
16130597fb56SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
16140597fb56Smrg  i=0
16150597fb56Smrg  teststring="ABCD"
1616b042e37fSmrg
16170597fb56Smrg  case $build_os in
16180597fb56Smrg  msdosdjgpp*)
16190597fb56Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
16200597fb56Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
16210597fb56Smrg    # during glob expansion).  Even if it were fixed, the result of this
16220597fb56Smrg    # check would be larger than it should be.
16230597fb56Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
16240597fb56Smrg    ;;
1625b042e37fSmrg
16260597fb56Smrg  gnu*)
16270597fb56Smrg    # Under GNU Hurd, this test is not required because there is
16280597fb56Smrg    # no limit to the length of command line arguments.
16290597fb56Smrg    # Libtool will interpret -1 as no limit whatsoever
16300597fb56Smrg    lt_cv_sys_max_cmd_len=-1;
16310597fb56Smrg    ;;
16328c4a8e55Smrg
16330597fb56Smrg  cygwin* | mingw* | cegcc*)
16340597fb56Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
16350597fb56Smrg    # about 5 minutes as the teststring grows exponentially.
16360597fb56Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
16370597fb56Smrg    # you end up with a "frozen" computer, even though with patience
16380597fb56Smrg    # the test eventually succeeds (with a max line length of 256k).
16390597fb56Smrg    # Instead, let's just punt: use the minimum linelength reported by
16400597fb56Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
16410597fb56Smrg    lt_cv_sys_max_cmd_len=8192;
16420597fb56Smrg    ;;
1643b042e37fSmrg
16440597fb56Smrg  mint*)
16450597fb56Smrg    # On MiNT this can take a long time and run out of memory.
16460597fb56Smrg    lt_cv_sys_max_cmd_len=8192;
16470597fb56Smrg    ;;
1648b042e37fSmrg
16490597fb56Smrg  amigaos*)
16500597fb56Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
16510597fb56Smrg    # So we just punt and use a minimum line length of 8192.
16520597fb56Smrg    lt_cv_sys_max_cmd_len=8192;
16530597fb56Smrg    ;;
1654b042e37fSmrg
16550597fb56Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
16560597fb56Smrg    # This has been around since 386BSD, at least.  Likely further.
16570597fb56Smrg    if test -x /sbin/sysctl; then
16580597fb56Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
16590597fb56Smrg    elif test -x /usr/sbin/sysctl; then
16600597fb56Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
16610597fb56Smrg    else
16620597fb56Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
16630597fb56Smrg    fi
16640597fb56Smrg    # And add a safety zone
16650597fb56Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
16660597fb56Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
16670597fb56Smrg    ;;
16688c4a8e55Smrg
16690597fb56Smrg  interix*)
16700597fb56Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
16710597fb56Smrg    lt_cv_sys_max_cmd_len=196608
16720597fb56Smrg    ;;
1673b042e37fSmrg
16740597fb56Smrg  os2*)
16750597fb56Smrg    # The test takes a long time on OS/2.
16760597fb56Smrg    lt_cv_sys_max_cmd_len=8192
16770597fb56Smrg    ;;
1678b042e37fSmrg
16790597fb56Smrg  osf*)
16800597fb56Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
16810597fb56Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
16820597fb56Smrg    # nice to cause kernel panics so lets avoid the loop below.
16830597fb56Smrg    # First set a reasonable default.
16840597fb56Smrg    lt_cv_sys_max_cmd_len=16384
16850597fb56Smrg    #
16860597fb56Smrg    if test -x /sbin/sysconfig; then
16870597fb56Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
16880597fb56Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
16890597fb56Smrg      esac
16900597fb56Smrg    fi
16910597fb56Smrg    ;;
16920597fb56Smrg  sco3.2v5*)
16930597fb56Smrg    lt_cv_sys_max_cmd_len=102400
16940597fb56Smrg    ;;
16950597fb56Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
16960597fb56Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
16970597fb56Smrg    if test -n "$kargmax"; then
16980597fb56Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
16990597fb56Smrg    else
17000597fb56Smrg      lt_cv_sys_max_cmd_len=32768
17010597fb56Smrg    fi
17020597fb56Smrg    ;;
17030597fb56Smrg  *)
17040597fb56Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
17050597fb56Smrg    if test -n "$lt_cv_sys_max_cmd_len"; then
17060597fb56Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
17070597fb56Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
17080597fb56Smrg    else
17090597fb56Smrg      # Make teststring a little bigger before we do anything with it.
17100597fb56Smrg      # a 1K string should be a reasonable start.
17110597fb56Smrg      for i in 1 2 3 4 5 6 7 8 ; do
17120597fb56Smrg        teststring=$teststring$teststring
17130597fb56Smrg      done
17140597fb56Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
17150597fb56Smrg      # If test is not a shell built-in, we'll probably end up computing a
17160597fb56Smrg      # maximum length that is only half of the actual maximum length, but
17170597fb56Smrg      # we can't tell.
17180597fb56Smrg      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
17190597fb56Smrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
17200597fb56Smrg	      test $i != 17 # 1/2 MB should be enough
17210597fb56Smrg      do
17220597fb56Smrg        i=`expr $i + 1`
17230597fb56Smrg        teststring=$teststring$teststring
17240597fb56Smrg      done
17250597fb56Smrg      # Only check the string length outside the loop.
17260597fb56Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
17270597fb56Smrg      teststring=
17280597fb56Smrg      # Add a significant safety factor because C++ compilers can tack on
17290597fb56Smrg      # massive amounts of additional arguments before passing them to the
17300597fb56Smrg      # linker.  It appears as though 1/2 is a usable value.
17310597fb56Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
17320597fb56Smrg    fi
17330597fb56Smrg    ;;
17340597fb56Smrg  esac
17350597fb56Smrg])
17360597fb56Smrgif test -n $lt_cv_sys_max_cmd_len ; then
17370597fb56Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1738706b6b52Smrgelse
17390597fb56Smrg  AC_MSG_RESULT(none)
17400597fb56Smrgfi
17410597fb56Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
17420597fb56Smrg_LT_DECL([], [max_cmd_len], [0],
17430597fb56Smrg    [What is the maximum length of a command?])
17440597fb56Smrg])# LT_CMD_MAX_LEN
1745b042e37fSmrg
17460597fb56Smrg# Old name:
17470597fb56SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
17480597fb56Smrgdnl aclocal-1.4 backwards compatibility:
17490597fb56Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1750b042e37fSmrg
1751b042e37fSmrg
17520597fb56Smrg# _LT_HEADER_DLFCN
17530597fb56Smrg# ----------------
17540597fb56Smrgm4_defun([_LT_HEADER_DLFCN],
17550597fb56Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
17560597fb56Smrg])# _LT_HEADER_DLFCN
1757b042e37fSmrg
1758b042e37fSmrg
17590597fb56Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
17600597fb56Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
17610597fb56Smrg# ----------------------------------------------------------------
17620597fb56Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
17630597fb56Smrg[m4_require([_LT_HEADER_DLFCN])dnl
17640597fb56Smrgif test "$cross_compiling" = yes; then :
17650597fb56Smrg  [$4]
17660597fb56Smrgelse
17670597fb56Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
17680597fb56Smrg  lt_status=$lt_dlunknown
17690597fb56Smrg  cat > conftest.$ac_ext <<_LT_EOF
17700597fb56Smrg[#line $LINENO "configure"
17710597fb56Smrg#include "confdefs.h"
1772b042e37fSmrg
17730597fb56Smrg#if HAVE_DLFCN_H
17740597fb56Smrg#include <dlfcn.h>
17750597fb56Smrg#endif
17768c4a8e55Smrg
17770597fb56Smrg#include <stdio.h>
1778b042e37fSmrg
17790597fb56Smrg#ifdef RTLD_GLOBAL
17800597fb56Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
17810597fb56Smrg#else
17820597fb56Smrg#  ifdef DL_GLOBAL
17830597fb56Smrg#    define LT_DLGLOBAL		DL_GLOBAL
17840597fb56Smrg#  else
17850597fb56Smrg#    define LT_DLGLOBAL		0
17860597fb56Smrg#  endif
17870597fb56Smrg#endif
1788b042e37fSmrg
17890597fb56Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
17900597fb56Smrg   find out it does not work in some platform. */
17910597fb56Smrg#ifndef LT_DLLAZY_OR_NOW
17920597fb56Smrg#  ifdef RTLD_LAZY
17930597fb56Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
17940597fb56Smrg#  else
17950597fb56Smrg#    ifdef DL_LAZY
17960597fb56Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
17970597fb56Smrg#    else
17980597fb56Smrg#      ifdef RTLD_NOW
17990597fb56Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
18000597fb56Smrg#      else
18010597fb56Smrg#        ifdef DL_NOW
18020597fb56Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
18030597fb56Smrg#        else
18040597fb56Smrg#          define LT_DLLAZY_OR_NOW	0
18050597fb56Smrg#        endif
18060597fb56Smrg#      endif
18070597fb56Smrg#    endif
18080597fb56Smrg#  endif
18090597fb56Smrg#endif
1810b042e37fSmrg
18110597fb56Smrg/* When -fvisbility=hidden is used, assume the code has been annotated
18120597fb56Smrg   correspondingly for the symbols needed.  */
18130597fb56Smrg#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
18140597fb56Smrgint fnord () __attribute__((visibility("default")));
18150597fb56Smrg#endif
1816b042e37fSmrg
18170597fb56Smrgint fnord () { return 42; }
18180597fb56Smrgint main ()
18190597fb56Smrg{
18200597fb56Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
18210597fb56Smrg  int status = $lt_dlunknown;
1822b042e37fSmrg
18230597fb56Smrg  if (self)
18240597fb56Smrg    {
18250597fb56Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
18260597fb56Smrg      else
18270597fb56Smrg        {
18280597fb56Smrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
18290597fb56Smrg          else puts (dlerror ());
18300597fb56Smrg	}
18310597fb56Smrg      /* dlclose (self); */
18320597fb56Smrg    }
18330597fb56Smrg  else
18340597fb56Smrg    puts (dlerror ());
1835b042e37fSmrg
18360597fb56Smrg  return status;
18370597fb56Smrg}]
18380597fb56Smrg_LT_EOF
18390597fb56Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
18400597fb56Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
18410597fb56Smrg    lt_status=$?
18420597fb56Smrg    case x$lt_status in
18430597fb56Smrg      x$lt_dlno_uscore) $1 ;;
18440597fb56Smrg      x$lt_dlneed_uscore) $2 ;;
18450597fb56Smrg      x$lt_dlunknown|x*) $3 ;;
18460597fb56Smrg    esac
18470597fb56Smrg  else :
18480597fb56Smrg    # compilation failed
18490597fb56Smrg    $3
18500597fb56Smrg  fi
18510597fb56Smrgfi
18520597fb56Smrgrm -fr conftest*
18530597fb56Smrg])# _LT_TRY_DLOPEN_SELF
1854b042e37fSmrg
1855b042e37fSmrg
18560597fb56Smrg# LT_SYS_DLOPEN_SELF
18570597fb56Smrg# ------------------
18580597fb56SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
18590597fb56Smrg[m4_require([_LT_HEADER_DLFCN])dnl
18600597fb56Smrgif test "x$enable_dlopen" != xyes; then
18610597fb56Smrg  enable_dlopen=unknown
18620597fb56Smrg  enable_dlopen_self=unknown
18630597fb56Smrg  enable_dlopen_self_static=unknown
18640597fb56Smrgelse
18650597fb56Smrg  lt_cv_dlopen=no
18660597fb56Smrg  lt_cv_dlopen_libs=
1867b042e37fSmrg
18680597fb56Smrg  case $host_os in
18690597fb56Smrg  beos*)
18700597fb56Smrg    lt_cv_dlopen="load_add_on"
18710597fb56Smrg    lt_cv_dlopen_libs=
18720597fb56Smrg    lt_cv_dlopen_self=yes
18730597fb56Smrg    ;;
1874b042e37fSmrg
18750597fb56Smrg  mingw* | pw32* | cegcc*)
18760597fb56Smrg    lt_cv_dlopen="LoadLibrary"
18770597fb56Smrg    lt_cv_dlopen_libs=
18780597fb56Smrg    ;;
1879b042e37fSmrg
18800597fb56Smrg  cygwin*)
18810597fb56Smrg    lt_cv_dlopen="dlopen"
18820597fb56Smrg    lt_cv_dlopen_libs=
18830597fb56Smrg    ;;
1884b042e37fSmrg
18850597fb56Smrg  darwin*)
18860597fb56Smrg  # if libdl is installed we need to link against it
18870597fb56Smrg    AC_CHECK_LIB([dl], [dlopen],
18880597fb56Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
18890597fb56Smrg    lt_cv_dlopen="dyld"
18900597fb56Smrg    lt_cv_dlopen_libs=
18910597fb56Smrg    lt_cv_dlopen_self=yes
18920597fb56Smrg    ])
18930597fb56Smrg    ;;
18940597fb56Smrg
18950597fb56Smrg  *)
18960597fb56Smrg    AC_CHECK_FUNC([shl_load],
18970597fb56Smrg	  [lt_cv_dlopen="shl_load"],
18980597fb56Smrg      [AC_CHECK_LIB([dld], [shl_load],
18990597fb56Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
19000597fb56Smrg	[AC_CHECK_FUNC([dlopen],
19010597fb56Smrg	      [lt_cv_dlopen="dlopen"],
19020597fb56Smrg	  [AC_CHECK_LIB([dl], [dlopen],
19030597fb56Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
19040597fb56Smrg	    [AC_CHECK_LIB([svld], [dlopen],
19050597fb56Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
19060597fb56Smrg	      [AC_CHECK_LIB([dld], [dld_link],
19070597fb56Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
19080597fb56Smrg	      ])
19090597fb56Smrg	    ])
19100597fb56Smrg	  ])
19110597fb56Smrg	])
19120597fb56Smrg      ])
19130597fb56Smrg    ;;
1914706b6b52Smrg  esac
1915b042e37fSmrg
19160597fb56Smrg  if test "x$lt_cv_dlopen" != xno; then
19170597fb56Smrg    enable_dlopen=yes
19180597fb56Smrg  else
19190597fb56Smrg    enable_dlopen=no
19200597fb56Smrg  fi
1921b042e37fSmrg
19220597fb56Smrg  case $lt_cv_dlopen in
19230597fb56Smrg  dlopen)
19240597fb56Smrg    save_CPPFLAGS="$CPPFLAGS"
19250597fb56Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1926b042e37fSmrg
19270597fb56Smrg    save_LDFLAGS="$LDFLAGS"
19280597fb56Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1929b042e37fSmrg
19300597fb56Smrg    save_LIBS="$LIBS"
19310597fb56Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
1932b042e37fSmrg
19330597fb56Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
19340597fb56Smrg	  lt_cv_dlopen_self, [dnl
19350597fb56Smrg	  _LT_TRY_DLOPEN_SELF(
19360597fb56Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
19370597fb56Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
19380597fb56Smrg    ])
1939b042e37fSmrg
19400597fb56Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
19410597fb56Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
19420597fb56Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
19430597fb56Smrg	  lt_cv_dlopen_self_static, [dnl
19440597fb56Smrg	  _LT_TRY_DLOPEN_SELF(
19450597fb56Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
19460597fb56Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
19470597fb56Smrg      ])
19480597fb56Smrg    fi
1949b042e37fSmrg
19500597fb56Smrg    CPPFLAGS="$save_CPPFLAGS"
19510597fb56Smrg    LDFLAGS="$save_LDFLAGS"
19520597fb56Smrg    LIBS="$save_LIBS"
19530597fb56Smrg    ;;
19540597fb56Smrg  esac
1955b042e37fSmrg
19560597fb56Smrg  case $lt_cv_dlopen_self in
19570597fb56Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
19580597fb56Smrg  *) enable_dlopen_self=unknown ;;
19590597fb56Smrg  esac
1960b042e37fSmrg
19610597fb56Smrg  case $lt_cv_dlopen_self_static in
19620597fb56Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
19630597fb56Smrg  *) enable_dlopen_self_static=unknown ;;
19640597fb56Smrg  esac
19650597fb56Smrgfi
19660597fb56Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
19670597fb56Smrg	 [Whether dlopen is supported])
19680597fb56Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
19690597fb56Smrg	 [Whether dlopen of programs is supported])
19700597fb56Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
19710597fb56Smrg	 [Whether dlopen of statically linked programs is supported])
19720597fb56Smrg])# LT_SYS_DLOPEN_SELF
1973b042e37fSmrg
19740597fb56Smrg# Old name:
19750597fb56SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
19760597fb56Smrgdnl aclocal-1.4 backwards compatibility:
19770597fb56Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1978b042e37fSmrg
1979b042e37fSmrg
19800597fb56Smrg# _LT_COMPILER_C_O([TAGNAME])
19810597fb56Smrg# ---------------------------
19820597fb56Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
19830597fb56Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
19840597fb56Smrgm4_defun([_LT_COMPILER_C_O],
19850597fb56Smrg[m4_require([_LT_DECL_SED])dnl
19860597fb56Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
19870597fb56Smrgm4_require([_LT_TAG_COMPILER])dnl
19880597fb56SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
19890597fb56Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
19900597fb56Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
19910597fb56Smrg   $RM -r conftest 2>/dev/null
19920597fb56Smrg   mkdir conftest
19930597fb56Smrg   cd conftest
19940597fb56Smrg   mkdir out
19950597fb56Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1996b042e37fSmrg
19970597fb56Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
19980597fb56Smrg   # Insert the option either (1) after the last *FLAGS variable, or
19990597fb56Smrg   # (2) before a word containing "conftest.", or (3) at the end.
20000597fb56Smrg   # Note that $ac_compile itself does not contain backslashes and begins
20010597fb56Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
20020597fb56Smrg   lt_compile=`echo "$ac_compile" | $SED \
20030597fb56Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
20040597fb56Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
20050597fb56Smrg   -e 's:$: $lt_compiler_flag:'`
20060597fb56Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
20070597fb56Smrg   (eval "$lt_compile" 2>out/conftest.err)
20080597fb56Smrg   ac_status=$?
20090597fb56Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
20100597fb56Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
20110597fb56Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
20120597fb56Smrg   then
20130597fb56Smrg     # The compiler can only warn and ignore the option if not recognized
20140597fb56Smrg     # So say no if there are warnings
20150597fb56Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
20160597fb56Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
20170597fb56Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
20180597fb56Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
20190597fb56Smrg     fi
20200597fb56Smrg   fi
20210597fb56Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
20220597fb56Smrg   $RM conftest*
20230597fb56Smrg   # SGI C++ compiler will create directory out/ii_files/ for
20240597fb56Smrg   # template instantiation
20250597fb56Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
20260597fb56Smrg   $RM out/* && rmdir out
20270597fb56Smrg   cd ..
20280597fb56Smrg   $RM -r conftest
20290597fb56Smrg   $RM conftest*
20300597fb56Smrg])
20310597fb56Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
20320597fb56Smrg	[Does compiler simultaneously support -c and -o options?])
20330597fb56Smrg])# _LT_COMPILER_C_O
2034b042e37fSmrg
2035b042e37fSmrg
20360597fb56Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
20370597fb56Smrg# ----------------------------------
20380597fb56Smrg# Check to see if we can do hard links to lock some files if needed
20390597fb56Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
20400597fb56Smrg[m4_require([_LT_ENABLE_LOCK])dnl
20410597fb56Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
20420597fb56Smrg_LT_COMPILER_C_O([$1])
20438c4a8e55Smrg
20440597fb56Smrghard_links="nottested"
20450597fb56Smrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
20460597fb56Smrg  # do not overwrite the value of need_locks provided by the user
20470597fb56Smrg  AC_MSG_CHECKING([if we can lock with hard links])
20480597fb56Smrg  hard_links=yes
20490597fb56Smrg  $RM conftest*
20500597fb56Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
20510597fb56Smrg  touch conftest.a
20520597fb56Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
20530597fb56Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
20540597fb56Smrg  AC_MSG_RESULT([$hard_links])
20550597fb56Smrg  if test "$hard_links" = no; then
20560597fb56Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
20570597fb56Smrg    need_locks=warn
2058706b6b52Smrg  fi
20590597fb56Smrgelse
20600597fb56Smrg  need_locks=no
20610597fb56Smrgfi
20620597fb56Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
20630597fb56Smrg])# _LT_COMPILER_FILE_LOCKS
2064b042e37fSmrg
2065b042e37fSmrg
20660597fb56Smrg# _LT_CHECK_OBJDIR
20670597fb56Smrg# ----------------
20680597fb56Smrgm4_defun([_LT_CHECK_OBJDIR],
20690597fb56Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
20700597fb56Smrg[rm -f .libs 2>/dev/null
20710597fb56Smrgmkdir .libs 2>/dev/null
20720597fb56Smrgif test -d .libs; then
20730597fb56Smrg  lt_cv_objdir=.libs
20740597fb56Smrgelse
20750597fb56Smrg  # MS-DOS does not allow filenames that begin with a dot.
20760597fb56Smrg  lt_cv_objdir=_libs
20770597fb56Smrgfi
20780597fb56Smrgrmdir .libs 2>/dev/null])
20790597fb56Smrgobjdir=$lt_cv_objdir
20800597fb56Smrg_LT_DECL([], [objdir], [0],
20810597fb56Smrg         [The name of the directory that contains temporary libtool files])dnl
20820597fb56Smrgm4_pattern_allow([LT_OBJDIR])dnl
20830597fb56SmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
20840597fb56Smrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
20850597fb56Smrg])# _LT_CHECK_OBJDIR
2086b042e37fSmrg
2087b042e37fSmrg
20880597fb56Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
20890597fb56Smrg# --------------------------------------
20900597fb56Smrg# Check hardcoding attributes.
20910597fb56Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
20920597fb56Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
20930597fb56Smrg_LT_TAGVAR(hardcode_action, $1)=
20940597fb56Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
20950597fb56Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
20960597fb56Smrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
2097b042e37fSmrg
20980597fb56Smrg  # We can hardcode non-existent directories.
20990597fb56Smrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
21000597fb56Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
21010597fb56Smrg     # have to relink, otherwise we might link with an installed library
21020597fb56Smrg     # when we should be linking with a yet-to-be-installed one
21030597fb56Smrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
21040597fb56Smrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
21050597fb56Smrg    # Linking always hardcodes the temporary library directory.
21060597fb56Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
21070597fb56Smrg  else
21080597fb56Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
21090597fb56Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
21100597fb56Smrg  fi
21110597fb56Smrgelse
21120597fb56Smrg  # We cannot hardcode anything, or else we can only hardcode existing
21130597fb56Smrg  # directories.
21140597fb56Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
21150597fb56Smrgfi
21160597fb56SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2117b042e37fSmrg
21180597fb56Smrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
21190597fb56Smrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
21200597fb56Smrg  # Fast installation is not supported
21210597fb56Smrg  enable_fast_install=no
21220597fb56Smrgelif test "$shlibpath_overrides_runpath" = yes ||
21230597fb56Smrg     test "$enable_shared" = no; then
21240597fb56Smrg  # Fast installation is not necessary
21250597fb56Smrg  enable_fast_install=needless
21260597fb56Smrgfi
21270597fb56Smrg_LT_TAGDECL([], [hardcode_action], [0],
21280597fb56Smrg    [How to hardcode a shared library path into an executable])
21290597fb56Smrg])# _LT_LINKER_HARDCODE_LIBPATH
2130b042e37fSmrg
2131b042e37fSmrg
21320597fb56Smrg# _LT_CMD_STRIPLIB
21330597fb56Smrg# ----------------
21340597fb56Smrgm4_defun([_LT_CMD_STRIPLIB],
21350597fb56Smrg[m4_require([_LT_DECL_EGREP])
21360597fb56Smrgstriplib=
21370597fb56Smrgold_striplib=
21380597fb56SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
21390597fb56Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
21400597fb56Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
21410597fb56Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
21420597fb56Smrg  AC_MSG_RESULT([yes])
21430597fb56Smrgelse
21440597fb56Smrg# FIXME - insert some real tests, host_os isn't really good enough
21450597fb56Smrg  case $host_os in
21460597fb56Smrg  darwin*)
21470597fb56Smrg    if test -n "$STRIP" ; then
21480597fb56Smrg      striplib="$STRIP -x"
21490597fb56Smrg      old_striplib="$STRIP -S"
21500597fb56Smrg      AC_MSG_RESULT([yes])
21510597fb56Smrg    else
21520597fb56Smrg      AC_MSG_RESULT([no])
21530597fb56Smrg    fi
21540597fb56Smrg    ;;
21550597fb56Smrg  *)
21560597fb56Smrg    AC_MSG_RESULT([no])
21570597fb56Smrg    ;;
21580597fb56Smrg  esac
21590597fb56Smrgfi
21600597fb56Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
21610597fb56Smrg_LT_DECL([], [striplib], [1])
21620597fb56Smrg])# _LT_CMD_STRIPLIB
2163b042e37fSmrg
2164b042e37fSmrg
21650597fb56Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
2166706b6b52Smrg# -----------------------------
21670597fb56Smrg# PORTME Fill in your ld.so characteristics
21680597fb56Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
21690597fb56Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
21700597fb56Smrgm4_require([_LT_DECL_EGREP])dnl
21710597fb56Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
21720597fb56Smrgm4_require([_LT_DECL_OBJDUMP])dnl
21730597fb56Smrgm4_require([_LT_DECL_SED])dnl
21740597fb56Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
21750597fb56SmrgAC_MSG_CHECKING([dynamic linker characteristics])
21760597fb56Smrgm4_if([$1],
21770597fb56Smrg	[], [
21780597fb56Smrgif test "$GCC" = yes; then
21790597fb56Smrg  case $host_os in
21800597fb56Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
21810597fb56Smrg    *) lt_awk_arg="/^libraries:/" ;;
21820597fb56Smrg  esac
21830597fb56Smrg  case $host_os in
21840597fb56Smrg    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
21850597fb56Smrg    *) lt_sed_strip_eq="s,=/,/,g" ;;
21860597fb56Smrg  esac
21870597fb56Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
21880597fb56Smrg  case $lt_search_path_spec in
21890597fb56Smrg  *\;*)
21900597fb56Smrg    # if the path contains ";" then we assume it to be the separator
21910597fb56Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
21920597fb56Smrg    # assumed that no part of a normal pathname contains ";" but that should
21930597fb56Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
21940597fb56Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
21950597fb56Smrg    ;;
21960597fb56Smrg  *)
21970597fb56Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
21980597fb56Smrg    ;;
21990597fb56Smrg  esac
22000597fb56Smrg  # Ok, now we have the path, separated by spaces, we can step through it
22010597fb56Smrg  # and add multilib dir if necessary.
22020597fb56Smrg  lt_tmp_lt_search_path_spec=
22030597fb56Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
22040597fb56Smrg  for lt_sys_path in $lt_search_path_spec; do
22050597fb56Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
22060597fb56Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
22070597fb56Smrg    else
22080597fb56Smrg      test -d "$lt_sys_path" && \
22090597fb56Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
22100597fb56Smrg    fi
22110597fb56Smrg  done
22120597fb56Smrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
22130597fb56SmrgBEGIN {RS=" "; FS="/|\n";} {
22140597fb56Smrg  lt_foo="";
22150597fb56Smrg  lt_count=0;
22160597fb56Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
22170597fb56Smrg    if ($lt_i != "" && $lt_i != ".") {
22180597fb56Smrg      if ($lt_i == "..") {
22190597fb56Smrg        lt_count++;
22200597fb56Smrg      } else {
22210597fb56Smrg        if (lt_count == 0) {
22220597fb56Smrg          lt_foo="/" $lt_i lt_foo;
22230597fb56Smrg        } else {
22240597fb56Smrg          lt_count--;
22250597fb56Smrg        }
22260597fb56Smrg      }
22270597fb56Smrg    }
22280597fb56Smrg  }
22290597fb56Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
22300597fb56Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
22310597fb56Smrg}'`
22320597fb56Smrg  # AWK program above erroneously prepends '/' to C:/dos/paths
22330597fb56Smrg  # for these hosts.
22340597fb56Smrg  case $host_os in
22350597fb56Smrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
22360597fb56Smrg      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
22370597fb56Smrg  esac
22380597fb56Smrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
22390597fb56Smrgelse
22400597fb56Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
22410597fb56Smrgfi])
22420597fb56Smrglibrary_names_spec=
22430597fb56Smrglibname_spec='lib$name'
22440597fb56Smrgsoname_spec=
22450597fb56Smrgshrext_cmds=".so"
22460597fb56Smrgpostinstall_cmds=
22470597fb56Smrgpostuninstall_cmds=
22480597fb56Smrgfinish_cmds=
22490597fb56Smrgfinish_eval=
22500597fb56Smrgshlibpath_var=
22510597fb56Smrgshlibpath_overrides_runpath=unknown
22520597fb56Smrgversion_type=none
22530597fb56Smrgdynamic_linker="$host_os ld.so"
22540597fb56Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
22550597fb56Smrgneed_lib_prefix=unknown
22560597fb56Smrghardcode_into_libs=no
2257b042e37fSmrg
22580597fb56Smrg# when you set need_version to no, make sure it does not cause -set_version
22590597fb56Smrg# flags to be left without arguments
22600597fb56Smrgneed_version=unknown
2261b042e37fSmrg
22620597fb56Smrgcase $host_os in
22630597fb56Smrgaix3*)
22640597fb56Smrg  version_type=linux # correct to gnu/linux during the next big refactor
22650597fb56Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
22660597fb56Smrg  shlibpath_var=LIBPATH
2267b042e37fSmrg
22680597fb56Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
22690597fb56Smrg  soname_spec='${libname}${release}${shared_ext}$major'
22700597fb56Smrg  ;;
2271b042e37fSmrg
22720597fb56Smrgaix[[4-9]]*)
22730597fb56Smrg  version_type=linux # correct to gnu/linux during the next big refactor
22740597fb56Smrg  need_lib_prefix=no
22750597fb56Smrg  need_version=no
22760597fb56Smrg  hardcode_into_libs=yes
22770597fb56Smrg  if test "$host_cpu" = ia64; then
22780597fb56Smrg    # AIX 5 supports IA64
22790597fb56Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
22800597fb56Smrg    shlibpath_var=LD_LIBRARY_PATH
22810597fb56Smrg  else
22820597fb56Smrg    # With GCC up to 2.95.x, collect2 would create an import file
22830597fb56Smrg    # for dependence libraries.  The import file would start with
22840597fb56Smrg    # the line `#! .'.  This would cause the generated library to
22850597fb56Smrg    # depend on `.', always an invalid library.  This was fixed in
22860597fb56Smrg    # development snapshots of GCC prior to 3.0.
22870597fb56Smrg    case $host_os in
22880597fb56Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
22890597fb56Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
22900597fb56Smrg	   echo ' yes '
22910597fb56Smrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
22920597fb56Smrg	:
22930597fb56Smrg      else
22940597fb56Smrg	can_build_shared=no
22950597fb56Smrg      fi
22960597fb56Smrg      ;;
22970597fb56Smrg    esac
22980597fb56Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
22990597fb56Smrg    # soname into executable. Probably we can add versioning support to
23000597fb56Smrg    # collect2, so additional links can be useful in future.
23010597fb56Smrg    if test "$aix_use_runtimelinking" = yes; then
23020597fb56Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
23030597fb56Smrg      # instead of lib<name>.a to let people know that these are not
23040597fb56Smrg      # typical AIX shared libraries.
23050597fb56Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
23060597fb56Smrg    else
23070597fb56Smrg      # We preserve .a as extension for shared libraries through AIX4.2
23080597fb56Smrg      # and later when we are not doing run time linking.
23090597fb56Smrg      library_names_spec='${libname}${release}.a $libname.a'
23100597fb56Smrg      soname_spec='${libname}${release}${shared_ext}$major'
23110597fb56Smrg    fi
23120597fb56Smrg    shlibpath_var=LIBPATH
23130597fb56Smrg  fi
23140597fb56Smrg  ;;
2315b042e37fSmrg
23160597fb56Smrgamigaos*)
23170597fb56Smrg  case $host_cpu in
23180597fb56Smrg  powerpc)
23190597fb56Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
23200597fb56Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
23210597fb56Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
23220597fb56Smrg    ;;
23230597fb56Smrg  m68k)
23240597fb56Smrg    library_names_spec='$libname.ixlibrary $libname.a'
23250597fb56Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
23260597fb56Smrg    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
23270597fb56Smrg    ;;
23280597fb56Smrg  esac
23290597fb56Smrg  ;;
2330b042e37fSmrg
23310597fb56Smrgbeos*)
23320597fb56Smrg  library_names_spec='${libname}${shared_ext}'
23330597fb56Smrg  dynamic_linker="$host_os ld.so"
23340597fb56Smrg  shlibpath_var=LIBRARY_PATH
23350597fb56Smrg  ;;
23368c4a8e55Smrg
23370597fb56Smrgbsdi[[45]]*)
23380597fb56Smrg  version_type=linux # correct to gnu/linux during the next big refactor
23390597fb56Smrg  need_version=no
23400597fb56Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
23410597fb56Smrg  soname_spec='${libname}${release}${shared_ext}$major'
23420597fb56Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
23430597fb56Smrg  shlibpath_var=LD_LIBRARY_PATH
23440597fb56Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
23450597fb56Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
23460597fb56Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
23470597fb56Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
23480597fb56Smrg  # libtool to hard-code these into programs
23490597fb56Smrg  ;;
2350b042e37fSmrg
23510597fb56Smrgcygwin* | mingw* | pw32* | cegcc*)
23520597fb56Smrg  version_type=windows
23530597fb56Smrg  shrext_cmds=".dll"
23540597fb56Smrg  need_version=no
23550597fb56Smrg  need_lib_prefix=no
2356b042e37fSmrg
23570597fb56Smrg  case $GCC,$cc_basename in
23580597fb56Smrg  yes,*)
23590597fb56Smrg    # gcc
23600597fb56Smrg    library_names_spec='$libname.dll.a'
23610597fb56Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
23620597fb56Smrg    postinstall_cmds='base_file=`basename \${file}`~
23630597fb56Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
23640597fb56Smrg      dldir=$destdir/`dirname \$dlpath`~
23650597fb56Smrg      test -d \$dldir || mkdir -p \$dldir~
23660597fb56Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
23670597fb56Smrg      chmod a+x \$dldir/$dlname~
23680597fb56Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
23690597fb56Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
23700597fb56Smrg      fi'
23710597fb56Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
23720597fb56Smrg      dlpath=$dir/\$dldll~
23730597fb56Smrg       $RM \$dlpath'
23740597fb56Smrg    shlibpath_overrides_runpath=yes
2375b042e37fSmrg
23760597fb56Smrg    case $host_os in
23770597fb56Smrg    cygwin*)
23780597fb56Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
23790597fb56Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
23800597fb56Smrgm4_if([$1], [],[
23810597fb56Smrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
23820597fb56Smrg      ;;
23830597fb56Smrg    mingw* | cegcc*)
23840597fb56Smrg      # MinGW DLLs use traditional 'lib' prefix
23850597fb56Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
23860597fb56Smrg      ;;
23870597fb56Smrg    pw32*)
23880597fb56Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
23890597fb56Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
23900597fb56Smrg      ;;
23910597fb56Smrg    esac
23920597fb56Smrg    dynamic_linker='Win32 ld.exe'
23930597fb56Smrg    ;;
2394b042e37fSmrg
23950597fb56Smrg  *,cl*)
23960597fb56Smrg    # Native MSVC
23970597fb56Smrg    libname_spec='$name'
23980597fb56Smrg    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
23990597fb56Smrg    library_names_spec='${libname}.dll.lib'
2400b042e37fSmrg
24010597fb56Smrg    case $build_os in
24020597fb56Smrg    mingw*)
24030597fb56Smrg      sys_lib_search_path_spec=
24040597fb56Smrg      lt_save_ifs=$IFS
24050597fb56Smrg      IFS=';'
24060597fb56Smrg      for lt_path in $LIB
24070597fb56Smrg      do
24080597fb56Smrg        IFS=$lt_save_ifs
24090597fb56Smrg        # Let DOS variable expansion print the short 8.3 style file name.
24100597fb56Smrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
24110597fb56Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
24120597fb56Smrg      done
24130597fb56Smrg      IFS=$lt_save_ifs
24140597fb56Smrg      # Convert to MSYS style.
24150597fb56Smrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
24160597fb56Smrg      ;;
24170597fb56Smrg    cygwin*)
24180597fb56Smrg      # Convert to unix form, then to dos form, then back to unix form
24190597fb56Smrg      # but this time dos style (no spaces!) so that the unix form looks
24200597fb56Smrg      # like /cygdrive/c/PROGRA~1:/cygdr...
24210597fb56Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
24220597fb56Smrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
24230597fb56Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
24240597fb56Smrg      ;;
24250597fb56Smrg    *)
24260597fb56Smrg      sys_lib_search_path_spec="$LIB"
24270597fb56Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
24280597fb56Smrg        # It is most probably a Windows format PATH.
24290597fb56Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
24300597fb56Smrg      else
24310597fb56Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
24320597fb56Smrg      fi
24330597fb56Smrg      # FIXME: find the short name or the path components, as spaces are
24340597fb56Smrg      # common. (e.g. "Program Files" -> "PROGRA~1")
24350597fb56Smrg      ;;
24360597fb56Smrg    esac
2437b042e37fSmrg
24380597fb56Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
24390597fb56Smrg    postinstall_cmds='base_file=`basename \${file}`~
24400597fb56Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
24410597fb56Smrg      dldir=$destdir/`dirname \$dlpath`~
24420597fb56Smrg      test -d \$dldir || mkdir -p \$dldir~
24430597fb56Smrg      $install_prog $dir/$dlname \$dldir/$dlname'
24440597fb56Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
24450597fb56Smrg      dlpath=$dir/\$dldll~
24460597fb56Smrg       $RM \$dlpath'
24470597fb56Smrg    shlibpath_overrides_runpath=yes
24480597fb56Smrg    dynamic_linker='Win32 link.exe'
24490597fb56Smrg    ;;
2450b042e37fSmrg
24510597fb56Smrg  *)
24520597fb56Smrg    # Assume MSVC wrapper
24530597fb56Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
24540597fb56Smrg    dynamic_linker='Win32 ld.exe'
24550597fb56Smrg    ;;
24560597fb56Smrg  esac
24570597fb56Smrg  # FIXME: first we should search . and the directory the executable is in
24580597fb56Smrg  shlibpath_var=PATH
24590597fb56Smrg  ;;
2460b042e37fSmrg
24610597fb56Smrgdarwin* | rhapsody*)
24620597fb56Smrg  dynamic_linker="$host_os dyld"
24630597fb56Smrg  version_type=darwin
24640597fb56Smrg  need_lib_prefix=no
24650597fb56Smrg  need_version=no
24660597fb56Smrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
24670597fb56Smrg  soname_spec='${libname}${release}${major}$shared_ext'
24680597fb56Smrg  shlibpath_overrides_runpath=yes
24690597fb56Smrg  shlibpath_var=DYLD_LIBRARY_PATH
24700597fb56Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
24710597fb56Smrgm4_if([$1], [],[
24720597fb56Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
24730597fb56Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
24740597fb56Smrg  ;;
2475b042e37fSmrg
24760597fb56Smrgdgux*)
24770597fb56Smrg  version_type=linux # correct to gnu/linux during the next big refactor
24780597fb56Smrg  need_lib_prefix=no
24790597fb56Smrg  need_version=no
24800597fb56Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
24810597fb56Smrg  soname_spec='${libname}${release}${shared_ext}$major'
24820597fb56Smrg  shlibpath_var=LD_LIBRARY_PATH
24830597fb56Smrg  ;;
24848c4a8e55Smrg
24850597fb56Smrgfreebsd* | dragonfly*)
24860597fb56Smrg  # DragonFly does not have aout.  When/if they implement a new
24870597fb56Smrg  # versioning mechanism, adjust this.
24880597fb56Smrg  if test -x /usr/bin/objformat; then
24890597fb56Smrg    objformat=`/usr/bin/objformat`
24900597fb56Smrg  else
24910597fb56Smrg    case $host_os in
24920597fb56Smrg    freebsd[[23]].*) objformat=aout ;;
24930597fb56Smrg    *) objformat=elf ;;
24940597fb56Smrg    esac
24950597fb56Smrg  fi
24960597fb56Smrg  version_type=freebsd-$objformat
24970597fb56Smrg  case $version_type in
24980597fb56Smrg    freebsd-elf*)
24990597fb56Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
25000597fb56Smrg      need_version=no
25010597fb56Smrg      need_lib_prefix=no
25020597fb56Smrg      ;;
25030597fb56Smrg    freebsd-*)
25040597fb56Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
25050597fb56Smrg      need_version=yes
25060597fb56Smrg      ;;
25070597fb56Smrg  esac
25080597fb56Smrg  shlibpath_var=LD_LIBRARY_PATH
25090597fb56Smrg  case $host_os in
25100597fb56Smrg  freebsd2.*)
25110597fb56Smrg    shlibpath_overrides_runpath=yes
25120597fb56Smrg    ;;
25130597fb56Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
25140597fb56Smrg    shlibpath_overrides_runpath=yes
25150597fb56Smrg    hardcode_into_libs=yes
25160597fb56Smrg    ;;
25170597fb56Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
25180597fb56Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
25190597fb56Smrg    shlibpath_overrides_runpath=no
25200597fb56Smrg    hardcode_into_libs=yes
25210597fb56Smrg    ;;
25220597fb56Smrg  *) # from 4.6 on, and DragonFly
25230597fb56Smrg    shlibpath_overrides_runpath=yes
25240597fb56Smrg    hardcode_into_libs=yes
25250597fb56Smrg    ;;
25260597fb56Smrg  esac
25270597fb56Smrg  ;;
2528b042e37fSmrg
25290597fb56Smrggnu*)
25300597fb56Smrg  version_type=linux # correct to gnu/linux during the next big refactor
25310597fb56Smrg  need_lib_prefix=no
25320597fb56Smrg  need_version=no
25330597fb56Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
25340597fb56Smrg  soname_spec='${libname}${release}${shared_ext}$major'
25350597fb56Smrg  shlibpath_var=LD_LIBRARY_PATH
25360597fb56Smrg  shlibpath_overrides_runpath=no
25370597fb56Smrg  hardcode_into_libs=yes
25380597fb56Smrg  ;;
2539b042e37fSmrg
25400597fb56Smrghaiku*)
25410597fb56Smrg  version_type=linux # correct to gnu/linux during the next big refactor
25420597fb56Smrg  need_lib_prefix=no
25430597fb56Smrg  need_version=no
25440597fb56Smrg  dynamic_linker="$host_os runtime_loader"
25450597fb56Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
25460597fb56Smrg  soname_spec='${libname}${release}${shared_ext}$major'
25470597fb56Smrg  shlibpath_var=LIBRARY_PATH
25480597fb56Smrg  shlibpath_overrides_runpath=yes
25490597fb56Smrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
25500597fb56Smrg  hardcode_into_libs=yes
25510597fb56Smrg  ;;
2552b042e37fSmrg
25530597fb56Smrghpux9* | hpux10* | hpux11*)
25540597fb56Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
25550597fb56Smrg  # link against other versions.
25560597fb56Smrg  version_type=sunos
25570597fb56Smrg  need_lib_prefix=no
25580597fb56Smrg  need_version=no
25590597fb56Smrg  case $host_cpu in
25600597fb56Smrg  ia64*)
25610597fb56Smrg    shrext_cmds='.so'
25620597fb56Smrg    hardcode_into_libs=yes
25630597fb56Smrg    dynamic_linker="$host_os dld.so"
25640597fb56Smrg    shlibpath_var=LD_LIBRARY_PATH
25650597fb56Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
25660597fb56Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
25670597fb56Smrg    soname_spec='${libname}${release}${shared_ext}$major'
25680597fb56Smrg    if test "X$HPUX_IA64_MODE" = X32; then
25690597fb56Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
25700597fb56Smrg    else
25710597fb56Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
25720597fb56Smrg    fi
25730597fb56Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
25740597fb56Smrg    ;;
25750597fb56Smrg  hppa*64*)
25760597fb56Smrg    shrext_cmds='.sl'
25770597fb56Smrg    hardcode_into_libs=yes
25780597fb56Smrg    dynamic_linker="$host_os dld.sl"
25790597fb56Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
25800597fb56Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
25810597fb56Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
25820597fb56Smrg    soname_spec='${libname}${release}${shared_ext}$major'
25830597fb56Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
25840597fb56Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
25850597fb56Smrg    ;;
25860597fb56Smrg  *)
25870597fb56Smrg    shrext_cmds='.sl'
25880597fb56Smrg    dynamic_linker="$host_os dld.sl"
25890597fb56Smrg    shlibpath_var=SHLIB_PATH
25900597fb56Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
25910597fb56Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
25920597fb56Smrg    soname_spec='${libname}${release}${shared_ext}$major'
25930597fb56Smrg    ;;
25940597fb56Smrg  esac
25950597fb56Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
25960597fb56Smrg  postinstall_cmds='chmod 555 $lib'
25970597fb56Smrg  # or fails outright, so override atomically:
25980597fb56Smrg  install_override_mode=555
25990597fb56Smrg  ;;
2600b042e37fSmrg
26010597fb56Smrginterix[[3-9]]*)
26020597fb56Smrg  version_type=linux # correct to gnu/linux during the next big refactor
26030597fb56Smrg  need_lib_prefix=no
26040597fb56Smrg  need_version=no
26050597fb56Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
26060597fb56Smrg  soname_spec='${libname}${release}${shared_ext}$major'
26070597fb56Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
26080597fb56Smrg  shlibpath_var=LD_LIBRARY_PATH
26090597fb56Smrg  shlibpath_overrides_runpath=no
26100597fb56Smrg  hardcode_into_libs=yes
26110597fb56Smrg  ;;
2612b042e37fSmrg
26130597fb56Smrgirix5* | irix6* | nonstopux*)
26140597fb56Smrg  case $host_os in
26150597fb56Smrg    nonstopux*) version_type=nonstopux ;;
26160597fb56Smrg    *)
26170597fb56Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
26180597fb56Smrg		version_type=linux # correct to gnu/linux during the next big refactor
26190597fb56Smrg	else
26200597fb56Smrg		version_type=irix
26210597fb56Smrg	fi ;;
26220597fb56Smrg  esac
26230597fb56Smrg  need_lib_prefix=no
26240597fb56Smrg  need_version=no
26250597fb56Smrg  soname_spec='${libname}${release}${shared_ext}$major'
26260597fb56Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
26270597fb56Smrg  case $host_os in
26280597fb56Smrg  irix5* | nonstopux*)
26290597fb56Smrg    libsuff= shlibsuff=
26300597fb56Smrg    ;;
26310597fb56Smrg  *)
26320597fb56Smrg    case $LD in # libtool.m4 will add one of these switches to LD
26330597fb56Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
26340597fb56Smrg      libsuff= shlibsuff= libmagic=32-bit;;
26350597fb56Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
26360597fb56Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
26370597fb56Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
26380597fb56Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
26390597fb56Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
26400597fb56Smrg    esac
26410597fb56Smrg    ;;
26420597fb56Smrg  esac
26430597fb56Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
26440597fb56Smrg  shlibpath_overrides_runpath=no
26450597fb56Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
26460597fb56Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
26470597fb56Smrg  hardcode_into_libs=yes
26480597fb56Smrg  ;;
26498c4a8e55Smrg
26500597fb56Smrg# No shared lib support for Linux oldld, aout, or coff.
26510597fb56Smrglinux*oldld* | linux*aout* | linux*coff*)
26520597fb56Smrg  dynamic_linker=no
26530597fb56Smrg  ;;
2654b042e37fSmrg
26550597fb56Smrg# This must be glibc/ELF.
26560597fb56Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
26570597fb56Smrg  version_type=linux # correct to gnu/linux during the next big refactor
26580597fb56Smrg  need_lib_prefix=no
26590597fb56Smrg  need_version=no
26600597fb56Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
26610597fb56Smrg  soname_spec='${libname}${release}${shared_ext}$major'
26620597fb56Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
26630597fb56Smrg  shlibpath_var=LD_LIBRARY_PATH
26640597fb56Smrg  shlibpath_overrides_runpath=no
2665b042e37fSmrg
26660597fb56Smrg  # Some binutils ld are patched to set DT_RUNPATH
26670597fb56Smrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
26680597fb56Smrg    [lt_cv_shlibpath_overrides_runpath=no
26690597fb56Smrg    save_LDFLAGS=$LDFLAGS
26700597fb56Smrg    save_libdir=$libdir
26710597fb56Smrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
26720597fb56Smrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
26730597fb56Smrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
26740597fb56Smrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
26750597fb56Smrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
26760597fb56Smrg    LDFLAGS=$save_LDFLAGS
26770597fb56Smrg    libdir=$save_libdir
26780597fb56Smrg    ])
26790597fb56Smrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
2680b042e37fSmrg
26810597fb56Smrg  # This implies no fast_install, which is unacceptable.
26820597fb56Smrg  # Some rework will be needed to allow for fast_install
26830597fb56Smrg  # before this can be enabled.
26840597fb56Smrg  hardcode_into_libs=yes
2685b042e37fSmrg
26860597fb56Smrg  # Add ABI-specific directories to the system library path.
26870597fb56Smrg  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
26888c4a8e55Smrg
26890597fb56Smrg  # Append ld.so.conf contents to the search path
26900597fb56Smrg  if test -f /etc/ld.so.conf; then
26910597fb56Smrg    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' ' '`
26920597fb56Smrg    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
26938c4a8e55Smrg
26940597fb56Smrg  fi
26958c4a8e55Smrg
26960597fb56Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
26970597fb56Smrg  # powerpc, because MkLinux only supported shared libraries with the
26980597fb56Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
26990597fb56Smrg  # most powerpc-linux boxes support dynamic linking these days and
27000597fb56Smrg  # people can always --disable-shared, the test was removed, and we
27010597fb56Smrg  # assume the GNU/Linux dynamic linker is in use.
27020597fb56Smrg  dynamic_linker='GNU/Linux ld.so'
27030597fb56Smrg  ;;
2704b042e37fSmrg
27050597fb56Smrgnetbsd*)
27060597fb56Smrg  version_type=sunos
27070597fb56Smrg  need_lib_prefix=no
27080597fb56Smrg  need_version=no
27090597fb56Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
27100597fb56Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
27110597fb56Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
27120597fb56Smrg    dynamic_linker='NetBSD (a.out) ld.so'
27130597fb56Smrg  else
27140597fb56Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
27150597fb56Smrg    soname_spec='${libname}${release}${shared_ext}$major'
27160597fb56Smrg    dynamic_linker='NetBSD ld.elf_so'
27170597fb56Smrg  fi
27180597fb56Smrg  shlibpath_var=LD_LIBRARY_PATH
27190597fb56Smrg  shlibpath_overrides_runpath=yes
27200597fb56Smrg  hardcode_into_libs=yes
27210597fb56Smrg  ;;
2722b042e37fSmrg
27230597fb56Smrgnewsos6)
27240597fb56Smrg  version_type=linux # correct to gnu/linux during the next big refactor
27250597fb56Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
27260597fb56Smrg  shlibpath_var=LD_LIBRARY_PATH
27270597fb56Smrg  shlibpath_overrides_runpath=yes
27280597fb56Smrg  ;;
2729b042e37fSmrg
27300597fb56Smrg*nto* | *qnx*)
27310597fb56Smrg  version_type=qnx
27320597fb56Smrg  need_lib_prefix=no
27330597fb56Smrg  need_version=no
27340597fb56Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
27350597fb56Smrg  soname_spec='${libname}${release}${shared_ext}$major'
27360597fb56Smrg  shlibpath_var=LD_LIBRARY_PATH
27370597fb56Smrg  shlibpath_overrides_runpath=no
27380597fb56Smrg  hardcode_into_libs=yes
27390597fb56Smrg  dynamic_linker='ldqnx.so'
27400597fb56Smrg  ;;
2741b042e37fSmrg
27420597fb56Smrgopenbsd*)
27430597fb56Smrg  version_type=sunos
27440597fb56Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
27450597fb56Smrg  need_lib_prefix=no
27460597fb56Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
27470597fb56Smrg  case $host_os in
27480597fb56Smrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
27490597fb56Smrg    *)				need_version=no  ;;
27500597fb56Smrg  esac
27510597fb56Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
27520597fb56Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
27530597fb56Smrg  shlibpath_var=LD_LIBRARY_PATH
27540597fb56Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
27550597fb56Smrg    case $host_os in
27560597fb56Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
27570597fb56Smrg	shlibpath_overrides_runpath=no
27580597fb56Smrg	;;
27590597fb56Smrg      *)
27600597fb56Smrg	shlibpath_overrides_runpath=yes
27610597fb56Smrg	;;
27620597fb56Smrg      esac
27630597fb56Smrg  else
27640597fb56Smrg    shlibpath_overrides_runpath=yes
27650597fb56Smrg  fi
27660597fb56Smrg  ;;
2767b042e37fSmrg
27680597fb56Smrgos2*)
27690597fb56Smrg  libname_spec='$name'
27700597fb56Smrg  shrext_cmds=".dll"
27710597fb56Smrg  need_lib_prefix=no
27720597fb56Smrg  library_names_spec='$libname${shared_ext} $libname.a'
27730597fb56Smrg  dynamic_linker='OS/2 ld.exe'
27740597fb56Smrg  shlibpath_var=LIBPATH
27750597fb56Smrg  ;;
2776b042e37fSmrg
27770597fb56Smrgosf3* | osf4* | osf5*)
27780597fb56Smrg  version_type=osf
27790597fb56Smrg  need_lib_prefix=no
27800597fb56Smrg  need_version=no
27810597fb56Smrg  soname_spec='${libname}${release}${shared_ext}$major'
27820597fb56Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
27830597fb56Smrg  shlibpath_var=LD_LIBRARY_PATH
27840597fb56Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
27850597fb56Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
27860597fb56Smrg  ;;
27878c4a8e55Smrg
27880597fb56Smrgrdos*)
27890597fb56Smrg  dynamic_linker=no
27900597fb56Smrg  ;;
27918c4a8e55Smrg
27920597fb56Smrgsolaris*)
27930597fb56Smrg  version_type=linux # correct to gnu/linux during the next big refactor
27940597fb56Smrg  need_lib_prefix=no
27950597fb56Smrg  need_version=no
27960597fb56Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
27970597fb56Smrg  soname_spec='${libname}${release}${shared_ext}$major'
27980597fb56Smrg  shlibpath_var=LD_LIBRARY_PATH
27990597fb56Smrg  shlibpath_overrides_runpath=yes
28000597fb56Smrg  hardcode_into_libs=yes
28010597fb56Smrg  # ldd complains unless libraries are executable
28020597fb56Smrg  postinstall_cmds='chmod +x $lib'
28030597fb56Smrg  ;;
2804b042e37fSmrg
28050597fb56Smrgsunos4*)
28060597fb56Smrg  version_type=sunos
28070597fb56Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
28080597fb56Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
28090597fb56Smrg  shlibpath_var=LD_LIBRARY_PATH
28100597fb56Smrg  shlibpath_overrides_runpath=yes
28110597fb56Smrg  if test "$with_gnu_ld" = yes; then
28120597fb56Smrg    need_lib_prefix=no
28130597fb56Smrg  fi
28140597fb56Smrg  need_version=yes
28150597fb56Smrg  ;;
2816b042e37fSmrg
28170597fb56Smrgsysv4 | sysv4.3*)
28180597fb56Smrg  version_type=linux # correct to gnu/linux during the next big refactor
28190597fb56Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
28200597fb56Smrg  soname_spec='${libname}${release}${shared_ext}$major'
28210597fb56Smrg  shlibpath_var=LD_LIBRARY_PATH
28220597fb56Smrg  case $host_vendor in
28230597fb56Smrg    sni)
28240597fb56Smrg      shlibpath_overrides_runpath=no
28250597fb56Smrg      need_lib_prefix=no
28260597fb56Smrg      runpath_var=LD_RUN_PATH
28270597fb56Smrg      ;;
28280597fb56Smrg    siemens)
28290597fb56Smrg      need_lib_prefix=no
28300597fb56Smrg      ;;
28310597fb56Smrg    motorola)
28320597fb56Smrg      need_lib_prefix=no
28330597fb56Smrg      need_version=no
28340597fb56Smrg      shlibpath_overrides_runpath=no
28350597fb56Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
28360597fb56Smrg      ;;
28370597fb56Smrg  esac
28380597fb56Smrg  ;;
28398c4a8e55Smrg
28400597fb56Smrgsysv4*MP*)
28410597fb56Smrg  if test -d /usr/nec ;then
28420597fb56Smrg    version_type=linux # correct to gnu/linux during the next big refactor
28430597fb56Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
28440597fb56Smrg    soname_spec='$libname${shared_ext}.$major'
28450597fb56Smrg    shlibpath_var=LD_LIBRARY_PATH
28460597fb56Smrg  fi
28470597fb56Smrg  ;;
28488c4a8e55Smrg
28490597fb56Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
28500597fb56Smrg  version_type=freebsd-elf
28510597fb56Smrg  need_lib_prefix=no
28520597fb56Smrg  need_version=no
28530597fb56Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
28540597fb56Smrg  soname_spec='${libname}${release}${shared_ext}$major'
28550597fb56Smrg  shlibpath_var=LD_LIBRARY_PATH
28560597fb56Smrg  shlibpath_overrides_runpath=yes
28570597fb56Smrg  hardcode_into_libs=yes
28580597fb56Smrg  if test "$with_gnu_ld" = yes; then
28590597fb56Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
28600597fb56Smrg  else
28610597fb56Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
28620597fb56Smrg    case $host_os in
28630597fb56Smrg      sco3.2v5*)
28640597fb56Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
28650597fb56Smrg	;;
28660597fb56Smrg    esac
28670597fb56Smrg  fi
28680597fb56Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
28690597fb56Smrg  ;;
2870b042e37fSmrg
28710597fb56Smrgtpf*)
28720597fb56Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
28730597fb56Smrg  version_type=linux # correct to gnu/linux during the next big refactor
28740597fb56Smrg  need_lib_prefix=no
28750597fb56Smrg  need_version=no
28760597fb56Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
28770597fb56Smrg  shlibpath_var=LD_LIBRARY_PATH
28780597fb56Smrg  shlibpath_overrides_runpath=no
28790597fb56Smrg  hardcode_into_libs=yes
28800597fb56Smrg  ;;
2881b042e37fSmrg
28820597fb56Smrguts4*)
28830597fb56Smrg  version_type=linux # correct to gnu/linux during the next big refactor
28840597fb56Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
28850597fb56Smrg  soname_spec='${libname}${release}${shared_ext}$major'
28860597fb56Smrg  shlibpath_var=LD_LIBRARY_PATH
28870597fb56Smrg  ;;
2888b042e37fSmrg
28890597fb56Smrg*)
28900597fb56Smrg  dynamic_linker=no
28910597fb56Smrg  ;;
28920597fb56Smrgesac
28930597fb56SmrgAC_MSG_RESULT([$dynamic_linker])
28940597fb56Smrgtest "$dynamic_linker" = no && can_build_shared=no
2895b042e37fSmrg
28960597fb56Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
28970597fb56Smrgif test "$GCC" = yes; then
28980597fb56Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
28990597fb56Smrgfi
2900b042e37fSmrg
29010597fb56Smrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
29020597fb56Smrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
29030597fb56Smrgfi
29040597fb56Smrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
29050597fb56Smrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
2906706b6b52Smrgfi
2907b042e37fSmrg
29080597fb56Smrg_LT_DECL([], [variables_saved_for_relink], [1],
29090597fb56Smrg    [Variables whose values should be saved in libtool wrapper scripts and
29100597fb56Smrg    restored at link time])
29110597fb56Smrg_LT_DECL([], [need_lib_prefix], [0],
29120597fb56Smrg    [Do we need the "lib" prefix for modules?])
29130597fb56Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
29140597fb56Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
29150597fb56Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
29160597fb56Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
29170597fb56Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
29180597fb56Smrg    [Is shlibpath searched before the hard-coded library search path?])
29190597fb56Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
29200597fb56Smrg_LT_DECL([], [library_names_spec], [1],
29210597fb56Smrg    [[List of archive names.  First name is the real one, the rest are links.
29220597fb56Smrg    The last name is the one that the linker finds with -lNAME]])
29230597fb56Smrg_LT_DECL([], [soname_spec], [1],
29240597fb56Smrg    [[The coded name of the library, if different from the real name]])
29250597fb56Smrg_LT_DECL([], [install_override_mode], [1],
29260597fb56Smrg    [Permission mode override for installation of shared libraries])
29270597fb56Smrg_LT_DECL([], [postinstall_cmds], [2],
29280597fb56Smrg    [Command to use after installation of a shared archive])
29290597fb56Smrg_LT_DECL([], [postuninstall_cmds], [2],
29300597fb56Smrg    [Command to use after uninstallation of a shared archive])
29310597fb56Smrg_LT_DECL([], [finish_cmds], [2],
29320597fb56Smrg    [Commands used to finish a libtool library installation in a directory])
29330597fb56Smrg_LT_DECL([], [finish_eval], [1],
29340597fb56Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
29350597fb56Smrg    not shown]])
29360597fb56Smrg_LT_DECL([], [hardcode_into_libs], [0],
29370597fb56Smrg    [Whether we should hardcode library paths into libraries])
29380597fb56Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
29390597fb56Smrg    [Compile-time system search path for libraries])
29400597fb56Smrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
29410597fb56Smrg    [Run-time system search path for libraries])
29420597fb56Smrg])# _LT_SYS_DYNAMIC_LINKER
29438c4a8e55Smrg
2944b042e37fSmrg
29450597fb56Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
29460597fb56Smrg# --------------------------
29470597fb56Smrg# find a file program which can recognize shared library
29480597fb56SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
29490597fb56Smrg[m4_require([_LT_DECL_EGREP])dnl
29500597fb56SmrgAC_MSG_CHECKING([for $1])
29510597fb56SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
29520597fb56Smrg[case $MAGIC_CMD in
29530597fb56Smrg[[\\/*] |  ?:[\\/]*])
29540597fb56Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
29550597fb56Smrg  ;;
29560597fb56Smrg*)
29570597fb56Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
29580597fb56Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
29590597fb56Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
29600597fb56Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
29610597fb56Smrgdnl not every word.  This closes a longstanding sh security hole.
29620597fb56Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
29630597fb56Smrg  for ac_dir in $ac_dummy; do
29640597fb56Smrg    IFS="$lt_save_ifs"
29650597fb56Smrg    test -z "$ac_dir" && ac_dir=.
29660597fb56Smrg    if test -f $ac_dir/$1; then
29670597fb56Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
29680597fb56Smrg      if test -n "$file_magic_test_file"; then
29690597fb56Smrg	case $deplibs_check_method in
29700597fb56Smrg	"file_magic "*)
29710597fb56Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
29720597fb56Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
29730597fb56Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
29740597fb56Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
29750597fb56Smrg	    :
29760597fb56Smrg	  else
29770597fb56Smrg	    cat <<_LT_EOF 1>&2
2978b042e37fSmrg
29790597fb56Smrg*** Warning: the command libtool uses to detect shared libraries,
29800597fb56Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
29810597fb56Smrg*** The result is that libtool may fail to recognize shared libraries
29820597fb56Smrg*** as such.  This will affect the creation of libtool libraries that
29830597fb56Smrg*** depend on shared libraries, but programs linked with such libtool
29840597fb56Smrg*** libraries will work regardless of this problem.  Nevertheless, you
29850597fb56Smrg*** may want to report the problem to your system manager and/or to
29860597fb56Smrg*** bug-libtool@gnu.org
2987b042e37fSmrg
29880597fb56Smrg_LT_EOF
29890597fb56Smrg	  fi ;;
29900597fb56Smrg	esac
29910597fb56Smrg      fi
29920597fb56Smrg      break
2993706b6b52Smrg    fi
29940597fb56Smrg  done
29950597fb56Smrg  IFS="$lt_save_ifs"
29960597fb56Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
29970597fb56Smrg  ;;
29980597fb56Smrgesac])
29990597fb56SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
30000597fb56Smrgif test -n "$MAGIC_CMD"; then
30010597fb56Smrg  AC_MSG_RESULT($MAGIC_CMD)
30020597fb56Smrgelse
30030597fb56Smrg  AC_MSG_RESULT(no)
30040597fb56Smrgfi
30050597fb56Smrg_LT_DECL([], [MAGIC_CMD], [0],
30060597fb56Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
30070597fb56Smrg])# _LT_PATH_TOOL_PREFIX
3008b042e37fSmrg
30090597fb56Smrg# Old name:
30100597fb56SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
30110597fb56Smrgdnl aclocal-1.4 backwards compatibility:
30120597fb56Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3013706b6b52Smrg
3014706b6b52Smrg
30150597fb56Smrg# _LT_PATH_MAGIC
30160597fb56Smrg# --------------
30170597fb56Smrg# find a file program which can recognize a shared library
30180597fb56Smrgm4_defun([_LT_PATH_MAGIC],
30190597fb56Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
30200597fb56Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
30210597fb56Smrg  if test -n "$ac_tool_prefix"; then
30220597fb56Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
30230597fb56Smrg  else
30240597fb56Smrg    MAGIC_CMD=:
30250597fb56Smrg  fi
30260597fb56Smrgfi
30270597fb56Smrg])# _LT_PATH_MAGIC
3028706b6b52Smrg
3029706b6b52Smrg
30300597fb56Smrg# LT_PATH_LD
30310597fb56Smrg# ----------
30320597fb56Smrg# find the pathname to the GNU or non-GNU linker
30330597fb56SmrgAC_DEFUN([LT_PATH_LD],
30340597fb56Smrg[AC_REQUIRE([AC_PROG_CC])dnl
30350597fb56SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
30360597fb56SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
30370597fb56Smrgm4_require([_LT_DECL_SED])dnl
30380597fb56Smrgm4_require([_LT_DECL_EGREP])dnl
30390597fb56Smrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3040706b6b52Smrg
30410597fb56SmrgAC_ARG_WITH([gnu-ld],
30420597fb56Smrg    [AS_HELP_STRING([--with-gnu-ld],
30430597fb56Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
30440597fb56Smrg    [test "$withval" = no || with_gnu_ld=yes],
30450597fb56Smrg    [with_gnu_ld=no])dnl
3046b042e37fSmrg
30470597fb56Smrgac_prog=ld
30480597fb56Smrgif test "$GCC" = yes; then
30490597fb56Smrg  # Check if gcc -print-prog-name=ld gives a path.
30500597fb56Smrg  AC_MSG_CHECKING([for ld used by $CC])
30510597fb56Smrg  case $host in
30520597fb56Smrg  *-*-mingw*)
30530597fb56Smrg    # gcc leaves a trailing carriage return which upsets mingw
30540597fb56Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
30550597fb56Smrg  *)
30560597fb56Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
30570597fb56Smrg  esac
30580597fb56Smrg  case $ac_prog in
30590597fb56Smrg    # Accept absolute paths.
30600597fb56Smrg    [[\\/]]* | ?:[[\\/]]*)
30610597fb56Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
30620597fb56Smrg      # Canonicalize the pathname of ld
30630597fb56Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
30640597fb56Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
30650597fb56Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
30660597fb56Smrg      done
30670597fb56Smrg      test -z "$LD" && LD="$ac_prog"
30680597fb56Smrg      ;;
30690597fb56Smrg  "")
30700597fb56Smrg    # If it fails, then pretend we aren't using GCC.
30710597fb56Smrg    ac_prog=ld
30720597fb56Smrg    ;;
30730597fb56Smrg  *)
30740597fb56Smrg    # If it is relative, then search for the first ld in PATH.
30750597fb56Smrg    with_gnu_ld=unknown
30760597fb56Smrg    ;;
30770597fb56Smrg  esac
30780597fb56Smrgelif test "$with_gnu_ld" = yes; then
30790597fb56Smrg  AC_MSG_CHECKING([for GNU ld])
30800597fb56Smrgelse
30810597fb56Smrg  AC_MSG_CHECKING([for non-GNU ld])
30820597fb56Smrgfi
30830597fb56SmrgAC_CACHE_VAL(lt_cv_path_LD,
30840597fb56Smrg[if test -z "$LD"; then
30850597fb56Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
30860597fb56Smrg  for ac_dir in $PATH; do
30870597fb56Smrg    IFS="$lt_save_ifs"
30880597fb56Smrg    test -z "$ac_dir" && ac_dir=.
30890597fb56Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
30900597fb56Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
30910597fb56Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
30920597fb56Smrg      # but apparently some variants of GNU ld only accept -v.
30930597fb56Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
30940597fb56Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
30950597fb56Smrg      *GNU* | *'with BFD'*)
30960597fb56Smrg	test "$with_gnu_ld" != no && break
30970597fb56Smrg	;;
30980597fb56Smrg      *)
30990597fb56Smrg	test "$with_gnu_ld" != yes && break
31000597fb56Smrg	;;
31010597fb56Smrg      esac
31020597fb56Smrg    fi
31030597fb56Smrg  done
31040597fb56Smrg  IFS="$lt_save_ifs"
31050597fb56Smrgelse
31060597fb56Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
31070597fb56Smrgfi])
31080597fb56SmrgLD="$lt_cv_path_LD"
31090597fb56Smrgif test -n "$LD"; then
31100597fb56Smrg  AC_MSG_RESULT($LD)
31110597fb56Smrgelse
31120597fb56Smrg  AC_MSG_RESULT(no)
31130597fb56Smrgfi
31140597fb56Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
31150597fb56Smrg_LT_PATH_LD_GNU
31160597fb56SmrgAC_SUBST([LD])
3117b042e37fSmrg
31180597fb56Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
31190597fb56Smrg])# LT_PATH_LD
3120b042e37fSmrg
31210597fb56Smrg# Old names:
31220597fb56SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
31230597fb56SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
31240597fb56Smrgdnl aclocal-1.4 backwards compatibility:
31250597fb56Smrgdnl AC_DEFUN([AM_PROG_LD], [])
31260597fb56Smrgdnl AC_DEFUN([AC_PROG_LD], [])
3127b042e37fSmrg
3128b042e37fSmrg
31290597fb56Smrg# _LT_PATH_LD_GNU
31300597fb56Smrg#- --------------
31310597fb56Smrgm4_defun([_LT_PATH_LD_GNU],
31320597fb56Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
31330597fb56Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
31340597fb56Smrgcase `$LD -v 2>&1 </dev/null` in
31350597fb56Smrg*GNU* | *'with BFD'*)
31360597fb56Smrg  lt_cv_prog_gnu_ld=yes
31370597fb56Smrg  ;;
31380597fb56Smrg*)
31390597fb56Smrg  lt_cv_prog_gnu_ld=no
31400597fb56Smrg  ;;
31410597fb56Smrgesac])
31420597fb56Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
31430597fb56Smrg])# _LT_PATH_LD_GNU
3144b042e37fSmrg
3145b042e37fSmrg
31460597fb56Smrg# _LT_CMD_RELOAD
31470597fb56Smrg# --------------
31480597fb56Smrg# find reload flag for linker
31490597fb56Smrg#   -- PORTME Some linkers may need a different reload flag.
31500597fb56Smrgm4_defun([_LT_CMD_RELOAD],
31510597fb56Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
31520597fb56Smrg  lt_cv_ld_reload_flag,
31530597fb56Smrg  [lt_cv_ld_reload_flag='-r'])
31540597fb56Smrgreload_flag=$lt_cv_ld_reload_flag
31550597fb56Smrgcase $reload_flag in
31560597fb56Smrg"" | " "*) ;;
31570597fb56Smrg*) reload_flag=" $reload_flag" ;;
31580597fb56Smrgesac
31590597fb56Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
31600597fb56Smrgcase $host_os in
31610597fb56Smrg  cygwin* | mingw* | pw32* | cegcc*)
31620597fb56Smrg    if test "$GCC" != yes; then
31630597fb56Smrg      reload_cmds=false
31640597fb56Smrg    fi
31650597fb56Smrg    ;;
31660597fb56Smrg  darwin*)
31670597fb56Smrg    if test "$GCC" = yes; then
31680597fb56Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
31690597fb56Smrg    else
31700597fb56Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
31710597fb56Smrg    fi
31720597fb56Smrg    ;;
31730597fb56Smrgesac
31740597fb56Smrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
31750597fb56Smrg_LT_TAGDECL([], [reload_cmds], [2])dnl
31760597fb56Smrg])# _LT_CMD_RELOAD
31778c4a8e55Smrg
3178b042e37fSmrg
31790597fb56Smrg# _LT_CHECK_MAGIC_METHOD
31800597fb56Smrg# ----------------------
31810597fb56Smrg# how to check for library dependencies
31820597fb56Smrg#  -- PORTME fill in with the dynamic library characteristics
31830597fb56Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
31840597fb56Smrg[m4_require([_LT_DECL_EGREP])
31850597fb56Smrgm4_require([_LT_DECL_OBJDUMP])
31860597fb56SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
31870597fb56Smrglt_cv_deplibs_check_method,
31880597fb56Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
31890597fb56Smrglt_cv_file_magic_test_file=
31900597fb56Smrglt_cv_deplibs_check_method='unknown'
31910597fb56Smrg# Need to set the preceding variable on all platforms that support
31920597fb56Smrg# interlibrary dependencies.
31930597fb56Smrg# 'none' -- dependencies not supported.
31940597fb56Smrg# `unknown' -- same as none, but documents that we really don't know.
31950597fb56Smrg# 'pass_all' -- all dependencies passed with no checks.
31960597fb56Smrg# 'test_compile' -- check by making test program.
31970597fb56Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
31980597fb56Smrg# which responds to the $file_magic_cmd with a given extended regex.
31990597fb56Smrg# If you have `file' or equivalent on your system and you're not sure
32000597fb56Smrg# whether `pass_all' will *always* work, you probably want this one.
32018c4a8e55Smrg
32020597fb56Smrgcase $host_os in
32030597fb56Smrgaix[[4-9]]*)
32040597fb56Smrg  lt_cv_deplibs_check_method=pass_all
32050597fb56Smrg  ;;
3206b042e37fSmrg
32070597fb56Smrgbeos*)
32080597fb56Smrg  lt_cv_deplibs_check_method=pass_all
32090597fb56Smrg  ;;
3210b042e37fSmrg
32110597fb56Smrgbsdi[[45]]*)
32120597fb56Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
32130597fb56Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
32140597fb56Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
32150597fb56Smrg  ;;
3216b042e37fSmrg
32170597fb56Smrgcygwin*)
32180597fb56Smrg  # func_win32_libid is a shell function defined in ltmain.sh
32190597fb56Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
32200597fb56Smrg  lt_cv_file_magic_cmd='func_win32_libid'
32210597fb56Smrg  ;;
32228c4a8e55Smrg
32230597fb56Smrgmingw* | pw32*)
32240597fb56Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
32250597fb56Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
32260597fb56Smrg  # unless we find 'file', for example because we are cross-compiling.
32270597fb56Smrg  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
32280597fb56Smrg  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
32290597fb56Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
32300597fb56Smrg    lt_cv_file_magic_cmd='func_win32_libid'
32310597fb56Smrg  else
32320597fb56Smrg    # Keep this pattern in sync with the one in func_win32_libid.
32330597fb56Smrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
32340597fb56Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
32350597fb56Smrg  fi
32360597fb56Smrg  ;;
32378c4a8e55Smrg
32380597fb56Smrgcegcc*)
32390597fb56Smrg  # use the weaker test based on 'objdump'. See mingw*.
32400597fb56Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
32410597fb56Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
32420597fb56Smrg  ;;
3243b042e37fSmrg
32440597fb56Smrgdarwin* | rhapsody*)
32450597fb56Smrg  lt_cv_deplibs_check_method=pass_all
32460597fb56Smrg  ;;
3247b042e37fSmrg
32480597fb56Smrgfreebsd* | dragonfly*)
32490597fb56Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
32500597fb56Smrg    case $host_cpu in
32510597fb56Smrg    i*86 )
32520597fb56Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
32530597fb56Smrg      # Let's accept both of them until this is cleared up.
32540597fb56Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
32550597fb56Smrg      lt_cv_file_magic_cmd=/usr/bin/file
32560597fb56Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
32570597fb56Smrg      ;;
32580597fb56Smrg    esac
32590597fb56Smrg  else
32600597fb56Smrg    lt_cv_deplibs_check_method=pass_all
32610597fb56Smrg  fi
32620597fb56Smrg  ;;
32638c4a8e55Smrg
32640597fb56Smrggnu*)
32650597fb56Smrg  lt_cv_deplibs_check_method=pass_all
32660597fb56Smrg  ;;
3267b042e37fSmrg
32680597fb56Smrghaiku*)
32690597fb56Smrg  lt_cv_deplibs_check_method=pass_all
32700597fb56Smrg  ;;
3271b042e37fSmrg
32720597fb56Smrghpux10.20* | hpux11*)
32730597fb56Smrg  lt_cv_file_magic_cmd=/usr/bin/file
32740597fb56Smrg  case $host_cpu in
32750597fb56Smrg  ia64*)
32760597fb56Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
32770597fb56Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
32780597fb56Smrg    ;;
32790597fb56Smrg  hppa*64*)
32800597fb56Smrg    [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]']
32810597fb56Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
32820597fb56Smrg    ;;
32830597fb56Smrg  *)
32840597fb56Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
32850597fb56Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
32860597fb56Smrg    ;;
32870597fb56Smrg  esac
32880597fb56Smrg  ;;
3289b042e37fSmrg
32900597fb56Smrginterix[[3-9]]*)
32910597fb56Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
32920597fb56Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
32930597fb56Smrg  ;;
3294b042e37fSmrg
32950597fb56Smrgirix5* | irix6* | nonstopux*)
32960597fb56Smrg  case $LD in
32970597fb56Smrg  *-32|*"-32 ") libmagic=32-bit;;
32980597fb56Smrg  *-n32|*"-n32 ") libmagic=N32;;
32990597fb56Smrg  *-64|*"-64 ") libmagic=64-bit;;
33000597fb56Smrg  *) libmagic=never-match;;
33010597fb56Smrg  esac
33020597fb56Smrg  lt_cv_deplibs_check_method=pass_all
33030597fb56Smrg  ;;
3304b042e37fSmrg
33050597fb56Smrg# This must be glibc/ELF.
33060597fb56Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
33070597fb56Smrg  lt_cv_deplibs_check_method=pass_all
33080597fb56Smrg  ;;
3309b042e37fSmrg
33100597fb56Smrgnetbsd*)
33110597fb56Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
33120597fb56Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
33130597fb56Smrg  else
33140597fb56Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
33150597fb56Smrg  fi
33160597fb56Smrg  ;;
3317b042e37fSmrg
33180597fb56Smrgnewos6*)
33190597fb56Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
33200597fb56Smrg  lt_cv_file_magic_cmd=/usr/bin/file
33210597fb56Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
33220597fb56Smrg  ;;
3323b042e37fSmrg
33240597fb56Smrg*nto* | *qnx*)
33250597fb56Smrg  lt_cv_deplibs_check_method=pass_all
33260597fb56Smrg  ;;
3327b042e37fSmrg
33280597fb56Smrgopenbsd*)
33290597fb56Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
33300597fb56Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
33310597fb56Smrg  else
33320597fb56Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
33330597fb56Smrg  fi
33340597fb56Smrg  ;;
3335b042e37fSmrg
33360597fb56Smrgosf3* | osf4* | osf5*)
33370597fb56Smrg  lt_cv_deplibs_check_method=pass_all
33380597fb56Smrg  ;;
3339b042e37fSmrg
33400597fb56Smrgrdos*)
33410597fb56Smrg  lt_cv_deplibs_check_method=pass_all
33420597fb56Smrg  ;;
3343b042e37fSmrg
33440597fb56Smrgsolaris*)
33450597fb56Smrg  lt_cv_deplibs_check_method=pass_all
33460597fb56Smrg  ;;
33470597fb56Smrg
33480597fb56Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
33490597fb56Smrg  lt_cv_deplibs_check_method=pass_all
33500597fb56Smrg  ;;
33510597fb56Smrg
33520597fb56Smrgsysv4 | sysv4.3*)
33530597fb56Smrg  case $host_vendor in
33540597fb56Smrg  motorola)
33550597fb56Smrg    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]]'
33560597fb56Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
33570597fb56Smrg    ;;
33580597fb56Smrg  ncr)
33590597fb56Smrg    lt_cv_deplibs_check_method=pass_all
33600597fb56Smrg    ;;
33610597fb56Smrg  sequent)
33620597fb56Smrg    lt_cv_file_magic_cmd='/bin/file'
33630597fb56Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
33640597fb56Smrg    ;;
33650597fb56Smrg  sni)
33660597fb56Smrg    lt_cv_file_magic_cmd='/bin/file'
33670597fb56Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
33680597fb56Smrg    lt_cv_file_magic_test_file=/lib/libc.so
33690597fb56Smrg    ;;
33700597fb56Smrg  siemens)
33710597fb56Smrg    lt_cv_deplibs_check_method=pass_all
33720597fb56Smrg    ;;
33730597fb56Smrg  pc)
33740597fb56Smrg    lt_cv_deplibs_check_method=pass_all
33750597fb56Smrg    ;;
33760597fb56Smrg  esac
33770597fb56Smrg  ;;
33780597fb56Smrg
33790597fb56Smrgtpf*)
33800597fb56Smrg  lt_cv_deplibs_check_method=pass_all
33810597fb56Smrg  ;;
33820597fb56Smrgesac
33830597fb56Smrg])
33840597fb56Smrg
33850597fb56Smrgfile_magic_glob=
33860597fb56Smrgwant_nocaseglob=no
33870597fb56Smrgif test "$build" = "$host"; then
3388706b6b52Smrg  case $host_os in
33890597fb56Smrg  mingw* | pw32*)
33900597fb56Smrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
33910597fb56Smrg      want_nocaseglob=yes
33920597fb56Smrg    else
33930597fb56Smrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
33940597fb56Smrg    fi
33950597fb56Smrg    ;;
33960597fb56Smrg  esac
33970597fb56Smrgfi
3398b042e37fSmrg
33990597fb56Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
34000597fb56Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
34010597fb56Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
3402b042e37fSmrg
34030597fb56Smrg_LT_DECL([], [deplibs_check_method], [1],
34040597fb56Smrg    [Method to check whether dependent libraries are shared objects])
34050597fb56Smrg_LT_DECL([], [file_magic_cmd], [1],
34060597fb56Smrg    [Command to use when deplibs_check_method = "file_magic"])
34070597fb56Smrg_LT_DECL([], [file_magic_glob], [1],
34080597fb56Smrg    [How to find potential files when deplibs_check_method = "file_magic"])
34090597fb56Smrg_LT_DECL([], [want_nocaseglob], [1],
34100597fb56Smrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
34110597fb56Smrg])# _LT_CHECK_MAGIC_METHOD
3412b042e37fSmrg
34130597fb56Smrg
34140597fb56Smrg# LT_PATH_NM
34150597fb56Smrg# ----------
34160597fb56Smrg# find the pathname to a BSD- or MS-compatible name lister
34170597fb56SmrgAC_DEFUN([LT_PATH_NM],
34180597fb56Smrg[AC_REQUIRE([AC_PROG_CC])dnl
34190597fb56SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
34200597fb56Smrg[if test -n "$NM"; then
34210597fb56Smrg  # Let the user override the test.
34220597fb56Smrg  lt_cv_path_NM="$NM"
34230597fb56Smrgelse
34240597fb56Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
34250597fb56Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
34260597fb56Smrg    lt_nm_to_check="$lt_nm_to_check nm"
3427706b6b52Smrg  fi
34280597fb56Smrg  for lt_tmp_nm in $lt_nm_to_check; do
34290597fb56Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
34300597fb56Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
34310597fb56Smrg      IFS="$lt_save_ifs"
34320597fb56Smrg      test -z "$ac_dir" && ac_dir=.
34330597fb56Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
34340597fb56Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
34350597fb56Smrg	# Check to see if the nm accepts a BSD-compat flag.
34360597fb56Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
34370597fb56Smrg	#   nm: unknown option "B" ignored
34380597fb56Smrg	# Tru64's nm complains that /dev/null is an invalid object file
34390597fb56Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
34400597fb56Smrg	*/dev/null* | *'Invalid file or object type'*)
34410597fb56Smrg	  lt_cv_path_NM="$tmp_nm -B"
34420597fb56Smrg	  break
34430597fb56Smrg	  ;;
34440597fb56Smrg	*)
34450597fb56Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
34460597fb56Smrg	  */dev/null*)
34470597fb56Smrg	    lt_cv_path_NM="$tmp_nm -p"
34480597fb56Smrg	    break
34490597fb56Smrg	    ;;
34500597fb56Smrg	  *)
34510597fb56Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
34520597fb56Smrg	    continue # so that we can try to find one that supports BSD flags
34530597fb56Smrg	    ;;
34540597fb56Smrg	  esac
34550597fb56Smrg	  ;;
34560597fb56Smrg	esac
34570597fb56Smrg      fi
34580597fb56Smrg    done
34590597fb56Smrg    IFS="$lt_save_ifs"
34600597fb56Smrg  done
34610597fb56Smrg  : ${lt_cv_path_NM=no}
34620597fb56Smrgfi])
34630597fb56Smrgif test "$lt_cv_path_NM" != "no"; then
34640597fb56Smrg  NM="$lt_cv_path_NM"
34650597fb56Smrgelse
34660597fb56Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
34670597fb56Smrg  if test -n "$DUMPBIN"; then :
34680597fb56Smrg    # Let the user override the test.
3469706b6b52Smrg  else
34700597fb56Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
34710597fb56Smrg    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
34720597fb56Smrg    *COFF*)
34730597fb56Smrg      DUMPBIN="$DUMPBIN -symbols"
34740597fb56Smrg      ;;
34750597fb56Smrg    *)
34760597fb56Smrg      DUMPBIN=:
34770597fb56Smrg      ;;
34780597fb56Smrg    esac
34798c4a8e55Smrg  fi
34800597fb56Smrg  AC_SUBST([DUMPBIN])
34810597fb56Smrg  if test "$DUMPBIN" != ":"; then
34820597fb56Smrg    NM="$DUMPBIN"
3483bd23fbfaSmrg  fi
3484bd23fbfaSmrgfi
34850597fb56Smrgtest -z "$NM" && NM=nm
34860597fb56SmrgAC_SUBST([NM])
34870597fb56Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3488b042e37fSmrg
34890597fb56SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
34900597fb56Smrg  [lt_cv_nm_interface="BSD nm"
34910597fb56Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
34920597fb56Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
34930597fb56Smrg  (eval "$ac_compile" 2>conftest.err)
34940597fb56Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
34950597fb56Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
34960597fb56Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
34970597fb56Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
34980597fb56Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
34990597fb56Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
35000597fb56Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
35010597fb56Smrg    lt_cv_nm_interface="MS dumpbin"
35020597fb56Smrg  fi
35030597fb56Smrg  rm -f conftest*])
35040597fb56Smrg])# LT_PATH_NM
3505b042e37fSmrg
35060597fb56Smrg# Old names:
35070597fb56SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
35080597fb56SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
35090597fb56Smrgdnl aclocal-1.4 backwards compatibility:
35100597fb56Smrgdnl AC_DEFUN([AM_PROG_NM], [])
35110597fb56Smrgdnl AC_DEFUN([AC_PROG_NM], [])
3512b042e37fSmrg
35130597fb56Smrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
35140597fb56Smrg# --------------------------------
35150597fb56Smrg# how to determine the name of the shared library
35160597fb56Smrg# associated with a specific link library.
35170597fb56Smrg#  -- PORTME fill in with the dynamic library characteristics
35180597fb56Smrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
35190597fb56Smrg[m4_require([_LT_DECL_EGREP])
35200597fb56Smrgm4_require([_LT_DECL_OBJDUMP])
35210597fb56Smrgm4_require([_LT_DECL_DLLTOOL])
35220597fb56SmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
35230597fb56Smrglt_cv_sharedlib_from_linklib_cmd,
35240597fb56Smrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
3525b042e37fSmrg
35260597fb56Smrgcase $host_os in
35270597fb56Smrgcygwin* | mingw* | pw32* | cegcc*)
35280597fb56Smrg  # two different shell functions defined in ltmain.sh
35290597fb56Smrg  # decide which to use based on capabilities of $DLLTOOL
35300597fb56Smrg  case `$DLLTOOL --help 2>&1` in
35310597fb56Smrg  *--identify-strict*)
35320597fb56Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
35330597fb56Smrg    ;;
35340597fb56Smrg  *)
35350597fb56Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
35360597fb56Smrg    ;;
35370597fb56Smrg  esac
35380597fb56Smrg  ;;
35390597fb56Smrg*)
35400597fb56Smrg  # fallback: assume linklib IS sharedlib
35410597fb56Smrg  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
35420597fb56Smrg  ;;
35430597fb56Smrgesac
35440597fb56Smrg])
35450597fb56Smrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
35460597fb56Smrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3547706b6b52Smrg
35480597fb56Smrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
35490597fb56Smrg    [Command to associate shared and link libraries])
35500597fb56Smrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
35510597fb56Smrg
35520597fb56Smrg
35530597fb56Smrg# _LT_PATH_MANIFEST_TOOL
35540597fb56Smrg# ----------------------
35550597fb56Smrg# locate the manifest tool
35560597fb56Smrgm4_defun([_LT_PATH_MANIFEST_TOOL],
35570597fb56Smrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
35580597fb56Smrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
35590597fb56SmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
35600597fb56Smrg  [lt_cv_path_mainfest_tool=no
35610597fb56Smrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
35620597fb56Smrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
35630597fb56Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
35640597fb56Smrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
35650597fb56Smrg    lt_cv_path_mainfest_tool=yes
35660597fb56Smrg  fi
35670597fb56Smrg  rm -f conftest*])
35680597fb56Smrgif test "x$lt_cv_path_mainfest_tool" != xyes; then
35690597fb56Smrg  MANIFEST_TOOL=:
3570706b6b52Smrgfi
35710597fb56Smrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
35720597fb56Smrg])# _LT_PATH_MANIFEST_TOOL
3573b042e37fSmrg
3574b042e37fSmrg
35750597fb56Smrg# LT_LIB_M
35760597fb56Smrg# --------
35770597fb56Smrg# check for math library
35780597fb56SmrgAC_DEFUN([LT_LIB_M],
35790597fb56Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
35800597fb56SmrgLIBM=
35810597fb56Smrgcase $host in
35820597fb56Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
35830597fb56Smrg  # These system don't have libm, or don't need it
35840597fb56Smrg  ;;
35850597fb56Smrg*-ncr-sysv4.3*)
35860597fb56Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
35870597fb56Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
35880597fb56Smrg  ;;
35890597fb56Smrg*)
35900597fb56Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
35910597fb56Smrg  ;;
3592706b6b52Smrgesac
35930597fb56SmrgAC_SUBST([LIBM])
35940597fb56Smrg])# LT_LIB_M
3595b042e37fSmrg
35960597fb56Smrg# Old name:
35970597fb56SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
35980597fb56Smrgdnl aclocal-1.4 backwards compatibility:
35990597fb56Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3600b042e37fSmrg
3601b042e37fSmrg
36020597fb56Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
36030597fb56Smrg# -------------------------------
36040597fb56Smrgm4_defun([_LT_COMPILER_NO_RTTI],
36050597fb56Smrg[m4_require([_LT_TAG_COMPILER])dnl
3606b042e37fSmrg
36070597fb56Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3608bd23fbfaSmrg
36090597fb56Smrgif test "$GCC" = yes; then
36100597fb56Smrg  case $cc_basename in
36110597fb56Smrg  nvcc*)
36120597fb56Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
36130597fb56Smrg  *)
36140597fb56Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
36150597fb56Smrg  esac
3616bd23fbfaSmrg
36170597fb56Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
36180597fb56Smrg    lt_cv_prog_compiler_rtti_exceptions,
36190597fb56Smrg    [-fno-rtti -fno-exceptions], [],
36200597fb56Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
36210597fb56Smrgfi
36220597fb56Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
36230597fb56Smrg	[Compiler flag to turn off builtin functions])
36240597fb56Smrg])# _LT_COMPILER_NO_RTTI
3625bd23fbfaSmrg
3626b042e37fSmrg
36270597fb56Smrg# _LT_CMD_GLOBAL_SYMBOLS
36280597fb56Smrg# ----------------------
36290597fb56Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
36300597fb56Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
36310597fb56SmrgAC_REQUIRE([AC_PROG_CC])dnl
36320597fb56SmrgAC_REQUIRE([AC_PROG_AWK])dnl
36330597fb56SmrgAC_REQUIRE([LT_PATH_NM])dnl
36340597fb56SmrgAC_REQUIRE([LT_PATH_LD])dnl
36350597fb56Smrgm4_require([_LT_DECL_SED])dnl
36360597fb56Smrgm4_require([_LT_DECL_EGREP])dnl
36370597fb56Smrgm4_require([_LT_TAG_COMPILER])dnl
36380597fb56Smrg
36390597fb56Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
36400597fb56SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
36410597fb56SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
36420597fb56Smrg[
36430597fb56Smrg# These are sane defaults that work on at least a few old systems.
36440597fb56Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
36450597fb56Smrg
36460597fb56Smrg# Character class describing NM global symbol codes.
36470597fb56Smrgsymcode='[[BCDEGRST]]'
36480597fb56Smrg
36490597fb56Smrg# Regexp to match symbols that can be accessed directly from C.
36500597fb56Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
36510597fb56Smrg
36520597fb56Smrg# Define system-specific variables.
36530597fb56Smrgcase $host_os in
36540597fb56Smrgaix*)
36550597fb56Smrg  symcode='[[BCDT]]'
3656706b6b52Smrg  ;;
36570597fb56Smrgcygwin* | mingw* | pw32* | cegcc*)
36580597fb56Smrg  symcode='[[ABCDGISTW]]'
36590597fb56Smrg  ;;
36600597fb56Smrghpux*)
36610597fb56Smrg  if test "$host_cpu" = ia64; then
36620597fb56Smrg    symcode='[[ABCDEGRST]]'
3663706b6b52Smrg  fi
3664706b6b52Smrg  ;;
36650597fb56Smrgirix* | nonstopux*)
36660597fb56Smrg  symcode='[[BCDEGRST]]'
3667706b6b52Smrg  ;;
36680597fb56Smrgosf*)
36690597fb56Smrg  symcode='[[BCDEGQRST]]'
3670706b6b52Smrg  ;;
36710597fb56Smrgsolaris*)
36720597fb56Smrg  symcode='[[BDRT]]'
36730597fb56Smrg  ;;
36740597fb56Smrgsco3.2v5*)
36750597fb56Smrg  symcode='[[DT]]'
36760597fb56Smrg  ;;
36770597fb56Smrgsysv4.2uw2*)
36780597fb56Smrg  symcode='[[DT]]'
36790597fb56Smrg  ;;
36800597fb56Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
36810597fb56Smrg  symcode='[[ABDT]]'
36820597fb56Smrg  ;;
36830597fb56Smrgsysv4)
36840597fb56Smrg  symcode='[[DFNSTU]]'
3685706b6b52Smrg  ;;
3686706b6b52Smrgesac
36878c4a8e55Smrg
36880597fb56Smrg# If we're using GNU nm, then use its standard symbol codes.
36890597fb56Smrgcase `$NM -V 2>&1` in
36900597fb56Smrg*GNU* | *'with BFD'*)
36910597fb56Smrg  symcode='[[ABCDGIRSTW]]' ;;
36920597fb56Smrgesac
36938c4a8e55Smrg
36940597fb56Smrg# Transform an extracted symbol line into a proper C declaration.
36950597fb56Smrg# Some systems (esp. on ia64) link data and code symbols differently,
36960597fb56Smrg# so use this general approach.
36970597fb56Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
36988c4a8e55Smrg
36990597fb56Smrg# Transform an extracted symbol line into symbol name and symbol address
37000597fb56Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
37010597fb56Smrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
3702bd23fbfaSmrg
37030597fb56Smrg# Handle CRLF in mingw tool chain
37040597fb56Smrgopt_cr=
37050597fb56Smrgcase $build_os in
37060597fb56Smrgmingw*)
37070597fb56Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
37080597fb56Smrg  ;;
37090597fb56Smrgesac
3710bd23fbfaSmrg
37110597fb56Smrg# Try without a prefix underscore, then with it.
37120597fb56Smrgfor ac_symprfx in "" "_"; do
3713bd23fbfaSmrg
37140597fb56Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
37150597fb56Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
3716bd23fbfaSmrg
37170597fb56Smrg  # Write the raw and C identifiers.
37180597fb56Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
37190597fb56Smrg    # Fake it for dumpbin and say T for any non-static function
37200597fb56Smrg    # and D for any global variable.
37210597fb56Smrg    # Also find C++ and __fastcall symbols from MSVC++,
37220597fb56Smrg    # which start with @ or ?.
37230597fb56Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
37240597fb56Smrg"     {last_section=section; section=\$ 3};"\
37250597fb56Smrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
37260597fb56Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
37270597fb56Smrg"     \$ 0!~/External *\|/{next};"\
37280597fb56Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
37290597fb56Smrg"     {if(hide[section]) next};"\
37300597fb56Smrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
37310597fb56Smrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
37320597fb56Smrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
37330597fb56Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
37340597fb56Smrg"     ' prfx=^$ac_symprfx]"
37350597fb56Smrg  else
37360597fb56Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
37370597fb56Smrg  fi
37380597fb56Smrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
37398c4a8e55Smrg
37400597fb56Smrg  # Check to see that the pipe works correctly.
37410597fb56Smrg  pipe_works=no
3742706b6b52Smrg
37430597fb56Smrg  rm -f conftest*
37440597fb56Smrg  cat > conftest.$ac_ext <<_LT_EOF
37450597fb56Smrg#ifdef __cplusplus
37460597fb56Smrgextern "C" {
37470597fb56Smrg#endif
37480597fb56Smrgchar nm_test_var;
37490597fb56Smrgvoid nm_test_func(void);
37500597fb56Smrgvoid nm_test_func(void){}
37510597fb56Smrg#ifdef __cplusplus
37520597fb56Smrg}
37530597fb56Smrg#endif
37540597fb56Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
37550597fb56Smrg_LT_EOF
3756706b6b52Smrg
37570597fb56Smrg  if AC_TRY_EVAL(ac_compile); then
37580597fb56Smrg    # Now try to grab the symbols.
37590597fb56Smrg    nlist=conftest.nm
37600597fb56Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
37610597fb56Smrg      # Try sorting and uniquifying the output.
37620597fb56Smrg      if sort "$nlist" | uniq > "$nlist"T; then
37630597fb56Smrg	mv -f "$nlist"T "$nlist"
37640597fb56Smrg      else
37650597fb56Smrg	rm -f "$nlist"T
37660597fb56Smrg      fi
3767706b6b52Smrg
37680597fb56Smrg      # Make sure that we snagged all the symbols we need.
37690597fb56Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
37700597fb56Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
37710597fb56Smrg	  cat <<_LT_EOF > conftest.$ac_ext
37720597fb56Smrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
37730597fb56Smrg#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
37740597fb56Smrg/* DATA imports from DLLs on WIN32 con't be const, because runtime
37750597fb56Smrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
37760597fb56Smrg# define LT@&t@_DLSYM_CONST
37770597fb56Smrg#elif defined(__osf__)
37780597fb56Smrg/* This system does not cope well with relocations in const data.  */
37790597fb56Smrg# define LT@&t@_DLSYM_CONST
37800597fb56Smrg#else
37810597fb56Smrg# define LT@&t@_DLSYM_CONST const
37820597fb56Smrg#endif
3783706b6b52Smrg
37840597fb56Smrg#ifdef __cplusplus
37850597fb56Smrgextern "C" {
37860597fb56Smrg#endif
3787706b6b52Smrg
37880597fb56Smrg_LT_EOF
37890597fb56Smrg	  # Now generate the symbol file.
37900597fb56Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
3791706b6b52Smrg
37920597fb56Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
3793706b6b52Smrg
37940597fb56Smrg/* The mapping between symbol names and symbols.  */
37950597fb56SmrgLT@&t@_DLSYM_CONST struct {
37960597fb56Smrg  const char *name;
37970597fb56Smrg  void       *address;
37980597fb56Smrg}
37990597fb56Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
38000597fb56Smrg{
38010597fb56Smrg  { "@PROGRAM@", (void *) 0 },
38020597fb56Smrg_LT_EOF
38030597fb56Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
38040597fb56Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
38050597fb56Smrg  {0, (void *) 0}
38060597fb56Smrg};
3807706b6b52Smrg
38080597fb56Smrg/* This works around a problem in FreeBSD linker */
38090597fb56Smrg#ifdef FREEBSD_WORKAROUND
38100597fb56Smrgstatic const void *lt_preloaded_setup() {
38110597fb56Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
38120597fb56Smrg}
38130597fb56Smrg#endif
3814706b6b52Smrg
38150597fb56Smrg#ifdef __cplusplus
38160597fb56Smrg}
38170597fb56Smrg#endif
38180597fb56Smrg_LT_EOF
38190597fb56Smrg	  # Now try linking the two files.
38200597fb56Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
38210597fb56Smrg	  lt_globsym_save_LIBS=$LIBS
38220597fb56Smrg	  lt_globsym_save_CFLAGS=$CFLAGS
38230597fb56Smrg	  LIBS="conftstm.$ac_objext"
38240597fb56Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
38250597fb56Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
38260597fb56Smrg	    pipe_works=yes
38270597fb56Smrg	  fi
38280597fb56Smrg	  LIBS=$lt_globsym_save_LIBS
38290597fb56Smrg	  CFLAGS=$lt_globsym_save_CFLAGS
38300597fb56Smrg	else
38310597fb56Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
38320597fb56Smrg	fi
38330597fb56Smrg      else
38340597fb56Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
38350597fb56Smrg      fi
38360597fb56Smrg    else
38370597fb56Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
38380597fb56Smrg    fi
38390597fb56Smrg  else
38400597fb56Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
38410597fb56Smrg    cat conftest.$ac_ext >&5
38420597fb56Smrg  fi
38430597fb56Smrg  rm -rf conftest* conftst*
3844706b6b52Smrg
38450597fb56Smrg  # Do not use the global_symbol_pipe unless it works.
38460597fb56Smrg  if test "$pipe_works" = yes; then
38470597fb56Smrg    break
38480597fb56Smrg  else
38490597fb56Smrg    lt_cv_sys_global_symbol_pipe=
38500597fb56Smrg  fi
38510597fb56Smrgdone
3852706b6b52Smrg])
38530597fb56Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
38540597fb56Smrg  lt_cv_sys_global_symbol_to_cdecl=
38550597fb56Smrgfi
38560597fb56Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
38570597fb56Smrg  AC_MSG_RESULT(failed)
3858706b6b52Smrgelse
38590597fb56Smrg  AC_MSG_RESULT(ok)
3860706b6b52Smrgfi
3861706b6b52Smrg
38620597fb56Smrg# Response file support.
38630597fb56Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
38640597fb56Smrg  nm_file_list_spec='@'
38650597fb56Smrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
38660597fb56Smrg  nm_file_list_spec='@'
38670597fb56Smrgfi
3868706b6b52Smrg
38690597fb56Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
38700597fb56Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
38710597fb56Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
38720597fb56Smrg    [Transform the output of nm in a proper C declaration])
38730597fb56Smrg_LT_DECL([global_symbol_to_c_name_address],
38740597fb56Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
38750597fb56Smrg    [Transform the output of nm in a C name address pair])
38760597fb56Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
38770597fb56Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
38780597fb56Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
38790597fb56Smrg_LT_DECL([], [nm_file_list_spec], [1],
38800597fb56Smrg    [Specify filename containing input files for $NM])
38810597fb56Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
3882706b6b52Smrg
3883706b6b52Smrg
38840597fb56Smrg# _LT_COMPILER_PIC([TAGNAME])
38850597fb56Smrg# ---------------------------
38860597fb56Smrgm4_defun([_LT_COMPILER_PIC],
38870597fb56Smrg[m4_require([_LT_TAG_COMPILER])dnl
38880597fb56Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
38890597fb56Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
38900597fb56Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
3891706b6b52Smrg
38920597fb56Smrgm4_if([$1], [CXX], [
38930597fb56Smrg  # C++ specific cases for pic, static, wl, etc.
38940597fb56Smrg  if test "$GXX" = yes; then
38950597fb56Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
38960597fb56Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3897706b6b52Smrg
38980597fb56Smrg    case $host_os in
38990597fb56Smrg    aix*)
39000597fb56Smrg      # All AIX code is PIC.
39010597fb56Smrg      if test "$host_cpu" = ia64; then
39020597fb56Smrg	# AIX 5 now supports IA64 processor
39030597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
39040597fb56Smrg      fi
39050597fb56Smrg      ;;
3906706b6b52Smrg
39070597fb56Smrg    amigaos*)
39080597fb56Smrg      case $host_cpu in
39090597fb56Smrg      powerpc)
39100597fb56Smrg            # see comment about AmigaOS4 .so support
39110597fb56Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
39120597fb56Smrg        ;;
39130597fb56Smrg      m68k)
39140597fb56Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
39150597fb56Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
39160597fb56Smrg            # like `-m68040'.
39170597fb56Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
39180597fb56Smrg        ;;
39190597fb56Smrg      esac
39200597fb56Smrg      ;;
3921706b6b52Smrg
39220597fb56Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
39230597fb56Smrg      # PIC is the default for these OSes.
39240597fb56Smrg      ;;
39250597fb56Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
39260597fb56Smrg      # This hack is so that the source file can tell whether it is being
39270597fb56Smrg      # built for inclusion in a dll (and should export symbols for example).
39280597fb56Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
39290597fb56Smrg      # (--disable-auto-import) libraries
39300597fb56Smrg      m4_if([$1], [GCJ], [],
39310597fb56Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
39320597fb56Smrg      ;;
39330597fb56Smrg    darwin* | rhapsody*)
39340597fb56Smrg      # PIC is the default on this platform
39350597fb56Smrg      # Common symbols not allowed in MH_DYLIB files
39360597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
39370597fb56Smrg      ;;
39380597fb56Smrg    *djgpp*)
39390597fb56Smrg      # DJGPP does not support shared libraries at all
39400597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
39410597fb56Smrg      ;;
39420597fb56Smrg    haiku*)
39430597fb56Smrg      # PIC is the default for Haiku.
39440597fb56Smrg      # The "-static" flag exists, but is broken.
39450597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
39460597fb56Smrg      ;;
39470597fb56Smrg    interix[[3-9]]*)
39480597fb56Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
39490597fb56Smrg      # Instead, we relocate shared libraries at runtime.
39500597fb56Smrg      ;;
39510597fb56Smrg    sysv4*MP*)
39520597fb56Smrg      if test -d /usr/nec; then
39530597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
39540597fb56Smrg      fi
39550597fb56Smrg      ;;
39560597fb56Smrg    hpux*)
39570597fb56Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
39580597fb56Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
39590597fb56Smrg      # sets the default TLS model and affects inlining.
39600597fb56Smrg      case $host_cpu in
39610597fb56Smrg      hppa*64*)
39620597fb56Smrg	;;
39630597fb56Smrg      *)
39640597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
39650597fb56Smrg	;;
3966706b6b52Smrg      esac
39670597fb56Smrg      ;;
39680597fb56Smrg    *qnx* | *nto*)
39690597fb56Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
39700597fb56Smrg      # it will coredump.
39710597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
39720597fb56Smrg      ;;
39730597fb56Smrg    *)
39740597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
39750597fb56Smrg      ;;
3976706b6b52Smrg    esac
3977706b6b52Smrg  else
39780597fb56Smrg    case $host_os in
39790597fb56Smrg      aix[[4-9]]*)
39800597fb56Smrg	# All AIX code is PIC.
39810597fb56Smrg	if test "$host_cpu" = ia64; then
39820597fb56Smrg	  # AIX 5 now supports IA64 processor
39830597fb56Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
39840597fb56Smrg	else
39850597fb56Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
39860597fb56Smrg	fi
39870597fb56Smrg	;;
39880597fb56Smrg      chorus*)
39890597fb56Smrg	case $cc_basename in
39900597fb56Smrg	cxch68*)
39910597fb56Smrg	  # Green Hills C++ Compiler
39920597fb56Smrg	  # _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"
39930597fb56Smrg	  ;;
39940597fb56Smrg	esac
39950597fb56Smrg	;;
39960597fb56Smrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
39970597fb56Smrg	# This hack is so that the source file can tell whether it is being
39980597fb56Smrg	# built for inclusion in a dll (and should export symbols for example).
39990597fb56Smrg	m4_if([$1], [GCJ], [],
40000597fb56Smrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
40010597fb56Smrg	;;
40020597fb56Smrg      dgux*)
40030597fb56Smrg	case $cc_basename in
40040597fb56Smrg	  ec++*)
40050597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
40060597fb56Smrg	    ;;
40070597fb56Smrg	  ghcx*)
40080597fb56Smrg	    # Green Hills C++ Compiler
40090597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
40100597fb56Smrg	    ;;
40110597fb56Smrg	  *)
40120597fb56Smrg	    ;;
40130597fb56Smrg	esac
40140597fb56Smrg	;;
40150597fb56Smrg      freebsd* | dragonfly*)
40160597fb56Smrg	# FreeBSD uses GNU C++
40170597fb56Smrg	;;
40180597fb56Smrg      hpux9* | hpux10* | hpux11*)
40190597fb56Smrg	case $cc_basename in
40200597fb56Smrg	  CC*)
40210597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40220597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
40230597fb56Smrg	    if test "$host_cpu" != ia64; then
40240597fb56Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
40250597fb56Smrg	    fi
40260597fb56Smrg	    ;;
40270597fb56Smrg	  aCC*)
40280597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40290597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
40300597fb56Smrg	    case $host_cpu in
40310597fb56Smrg	    hppa*64*|ia64*)
40320597fb56Smrg	      # +Z the default
40330597fb56Smrg	      ;;
40340597fb56Smrg	    *)
40350597fb56Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
40360597fb56Smrg	      ;;
40370597fb56Smrg	    esac
40380597fb56Smrg	    ;;
40390597fb56Smrg	  *)
40400597fb56Smrg	    ;;
40410597fb56Smrg	esac
40420597fb56Smrg	;;
40430597fb56Smrg      interix*)
40440597fb56Smrg	# This is c89, which is MS Visual C++ (no shared libs)
40450597fb56Smrg	# Anyone wants to do a port?
40460597fb56Smrg	;;
40470597fb56Smrg      irix5* | irix6* | nonstopux*)
40480597fb56Smrg	case $cc_basename in
40490597fb56Smrg	  CC*)
40500597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40510597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
40520597fb56Smrg	    # CC pic flag -KPIC is the default.
40530597fb56Smrg	    ;;
40540597fb56Smrg	  *)
40550597fb56Smrg	    ;;
40560597fb56Smrg	esac
40570597fb56Smrg	;;
40580597fb56Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
40590597fb56Smrg	case $cc_basename in
40600597fb56Smrg	  KCC*)
40610597fb56Smrg	    # KAI C++ Compiler
40620597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
40630597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
40640597fb56Smrg	    ;;
40650597fb56Smrg	  ecpc* )
40660597fb56Smrg	    # old Intel C++ for x86_64 which still supported -KPIC.
40670597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40680597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
40690597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
40700597fb56Smrg	    ;;
40710597fb56Smrg	  icpc* )
40720597fb56Smrg	    # Intel C++, used to be incompatible with GCC.
40730597fb56Smrg	    # ICC 10 doesn't accept -KPIC any more.
40740597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40750597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
40760597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
40770597fb56Smrg	    ;;
40780597fb56Smrg	  pgCC* | pgcpp*)
40790597fb56Smrg	    # Portland Group C++ compiler
40800597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40810597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
40820597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
40830597fb56Smrg	    ;;
40840597fb56Smrg	  cxx*)
40850597fb56Smrg	    # Compaq C++
40860597fb56Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
40870597fb56Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
40880597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
40890597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
40900597fb56Smrg	    ;;
40910597fb56Smrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
40920597fb56Smrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
40930597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
40940597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
40950597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
40960597fb56Smrg	    ;;
40970597fb56Smrg	  *)
40980597fb56Smrg	    case `$CC -V 2>&1 | sed 5q` in
40990597fb56Smrg	    *Sun\ C*)
41000597fb56Smrg	      # Sun C++ 5.9
41010597fb56Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
41020597fb56Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41030597fb56Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
41040597fb56Smrg	      ;;
41050597fb56Smrg	    esac
41060597fb56Smrg	    ;;
41070597fb56Smrg	esac
41080597fb56Smrg	;;
41090597fb56Smrg      lynxos*)
41100597fb56Smrg	;;
41110597fb56Smrg      m88k*)
41120597fb56Smrg	;;
41130597fb56Smrg      mvs*)
41140597fb56Smrg	case $cc_basename in
41150597fb56Smrg	  cxx*)
41160597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
41170597fb56Smrg	    ;;
41180597fb56Smrg	  *)
41190597fb56Smrg	    ;;
41200597fb56Smrg	esac
41210597fb56Smrg	;;
41220597fb56Smrg      netbsd*)
41230597fb56Smrg	;;
41240597fb56Smrg      *qnx* | *nto*)
41250597fb56Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
41260597fb56Smrg        # it will coredump.
41270597fb56Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
41280597fb56Smrg        ;;
41290597fb56Smrg      osf3* | osf4* | osf5*)
41300597fb56Smrg	case $cc_basename in
41310597fb56Smrg	  KCC*)
41320597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
41330597fb56Smrg	    ;;
41340597fb56Smrg	  RCC*)
41350597fb56Smrg	    # Rational C++ 2.4.1
41360597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
41370597fb56Smrg	    ;;
41380597fb56Smrg	  cxx*)
41390597fb56Smrg	    # Digital/Compaq C++
41400597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
41410597fb56Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
41420597fb56Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
41430597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
41440597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
41450597fb56Smrg	    ;;
41460597fb56Smrg	  *)
41470597fb56Smrg	    ;;
41480597fb56Smrg	esac
41490597fb56Smrg	;;
41500597fb56Smrg      psos*)
41510597fb56Smrg	;;
41520597fb56Smrg      solaris*)
41530597fb56Smrg	case $cc_basename in
41540597fb56Smrg	  CC* | sunCC*)
41550597fb56Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
41560597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
41570597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41580597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
41590597fb56Smrg	    ;;
41600597fb56Smrg	  gcx*)
41610597fb56Smrg	    # Green Hills C++ Compiler
41620597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
41630597fb56Smrg	    ;;
41640597fb56Smrg	  *)
41650597fb56Smrg	    ;;
41660597fb56Smrg	esac
41670597fb56Smrg	;;
41680597fb56Smrg      sunos4*)
41690597fb56Smrg	case $cc_basename in
41700597fb56Smrg	  CC*)
41710597fb56Smrg	    # Sun C++ 4.x
41720597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
41730597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41740597fb56Smrg	    ;;
41750597fb56Smrg	  lcc*)
41760597fb56Smrg	    # Lucid
41770597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
41780597fb56Smrg	    ;;
41790597fb56Smrg	  *)
41800597fb56Smrg	    ;;
41810597fb56Smrg	esac
41820597fb56Smrg	;;
41830597fb56Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
41840597fb56Smrg	case $cc_basename in
41850597fb56Smrg	  CC*)
41860597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
41870597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
41880597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
41890597fb56Smrg	    ;;
41900597fb56Smrg	esac
41910597fb56Smrg	;;
41920597fb56Smrg      tandem*)
41930597fb56Smrg	case $cc_basename in
41940597fb56Smrg	  NCC*)
41950597fb56Smrg	    # NonStop-UX NCC 3.20
41960597fb56Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
41970597fb56Smrg	    ;;
41980597fb56Smrg	  *)
41990597fb56Smrg	    ;;
42000597fb56Smrg	esac
42010597fb56Smrg	;;
42020597fb56Smrg      vxworks*)
42030597fb56Smrg	;;
42040597fb56Smrg      *)
42050597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
42060597fb56Smrg	;;
42070597fb56Smrg    esac
4208706b6b52Smrg  fi
42090597fb56Smrg],
42100597fb56Smrg[
42110597fb56Smrg  if test "$GCC" = yes; then
42120597fb56Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
42130597fb56Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4214706b6b52Smrg
42150597fb56Smrg    case $host_os in
42160597fb56Smrg      aix*)
42170597fb56Smrg      # All AIX code is PIC.
42180597fb56Smrg      if test "$host_cpu" = ia64; then
42190597fb56Smrg	# AIX 5 now supports IA64 processor
42200597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
42210597fb56Smrg      fi
42220597fb56Smrg      ;;
4223706b6b52Smrg
42240597fb56Smrg    amigaos*)
42250597fb56Smrg      case $host_cpu in
42260597fb56Smrg      powerpc)
42270597fb56Smrg            # see comment about AmigaOS4 .so support
42280597fb56Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42290597fb56Smrg        ;;
42300597fb56Smrg      m68k)
42310597fb56Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
42320597fb56Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
42330597fb56Smrg            # like `-m68040'.
42340597fb56Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
42350597fb56Smrg        ;;
42360597fb56Smrg      esac
42370597fb56Smrg      ;;
42388c4a8e55Smrg
42390597fb56Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
42400597fb56Smrg      # PIC is the default for these OSes.
42410597fb56Smrg      ;;
42428c4a8e55Smrg
42430597fb56Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
42440597fb56Smrg      # This hack is so that the source file can tell whether it is being
42450597fb56Smrg      # built for inclusion in a dll (and should export symbols for example).
42460597fb56Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
42470597fb56Smrg      # (--disable-auto-import) libraries
42480597fb56Smrg      m4_if([$1], [GCJ], [],
42490597fb56Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
42500597fb56Smrg      ;;
42518c4a8e55Smrg
42520597fb56Smrg    darwin* | rhapsody*)
42530597fb56Smrg      # PIC is the default on this platform
42540597fb56Smrg      # Common symbols not allowed in MH_DYLIB files
42550597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
42560597fb56Smrg      ;;
42578c4a8e55Smrg
42580597fb56Smrg    haiku*)
42590597fb56Smrg      # PIC is the default for Haiku.
42600597fb56Smrg      # The "-static" flag exists, but is broken.
42610597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
42620597fb56Smrg      ;;
42638c4a8e55Smrg
42640597fb56Smrg    hpux*)
42650597fb56Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
42660597fb56Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
42670597fb56Smrg      # sets the default TLS model and affects inlining.
42680597fb56Smrg      case $host_cpu in
42690597fb56Smrg      hppa*64*)
42700597fb56Smrg	# +Z the default
42710597fb56Smrg	;;
42720597fb56Smrg      *)
42730597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42740597fb56Smrg	;;
42750597fb56Smrg      esac
42760597fb56Smrg      ;;
4277b042e37fSmrg
42780597fb56Smrg    interix[[3-9]]*)
42790597fb56Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
42800597fb56Smrg      # Instead, we relocate shared libraries at runtime.
42810597fb56Smrg      ;;
4282b042e37fSmrg
42830597fb56Smrg    msdosdjgpp*)
42840597fb56Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
42850597fb56Smrg      # on systems that don't support them.
42860597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
42870597fb56Smrg      enable_shared=no
42880597fb56Smrg      ;;
4289b042e37fSmrg
42900597fb56Smrg    *nto* | *qnx*)
42910597fb56Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
42920597fb56Smrg      # it will coredump.
42930597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
42940597fb56Smrg      ;;
4295706b6b52Smrg
42960597fb56Smrg    sysv4*MP*)
42970597fb56Smrg      if test -d /usr/nec; then
42980597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
42990597fb56Smrg      fi
43000597fb56Smrg      ;;
4301b042e37fSmrg
43020597fb56Smrg    *)
43030597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
43040597fb56Smrg      ;;
43050597fb56Smrg    esac
43060597fb56Smrg
43070597fb56Smrg    case $cc_basename in
43080597fb56Smrg    nvcc*) # Cuda Compiler Driver 2.2
43090597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
43100597fb56Smrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
43110597fb56Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
43120597fb56Smrg      fi
43130597fb56Smrg      ;;
43140597fb56Smrg    esac
4315706b6b52Smrg  else
43160597fb56Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
4317706b6b52Smrg    case $host_os in
43180597fb56Smrg    aix*)
43190597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43200597fb56Smrg      if test "$host_cpu" = ia64; then
43210597fb56Smrg	# AIX 5 now supports IA64 processor
43220597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4323706b6b52Smrg      else
43240597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4325706b6b52Smrg      fi
43268c4a8e55Smrg      ;;
4327b042e37fSmrg
43280597fb56Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
43290597fb56Smrg      # This hack is so that the source file can tell whether it is being
43300597fb56Smrg      # built for inclusion in a dll (and should export symbols for example).
43310597fb56Smrg      m4_if([$1], [GCJ], [],
43320597fb56Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
43330597fb56Smrg      ;;
4334b042e37fSmrg
43350597fb56Smrg    hpux9* | hpux10* | hpux11*)
43360597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43370597fb56Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
43380597fb56Smrg      # not for PA HP-UX.
43390597fb56Smrg      case $host_cpu in
43400597fb56Smrg      hppa*64*|ia64*)
43410597fb56Smrg	# +Z the default
43420597fb56Smrg	;;
43430597fb56Smrg      *)
43440597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
43450597fb56Smrg	;;
43460597fb56Smrg      esac
43470597fb56Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
43480597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
43490597fb56Smrg      ;;
4350b042e37fSmrg
43510597fb56Smrg    irix5* | irix6* | nonstopux*)
43520597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43530597fb56Smrg      # PIC (with -KPIC) is the default.
43540597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
43550597fb56Smrg      ;;
4356b042e37fSmrg
43570597fb56Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu)
43580597fb56Smrg      case $cc_basename in
43590597fb56Smrg      # old Intel for x86_64 which still supported -KPIC.
43600597fb56Smrg      ecc*)
43610597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43620597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
43630597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
43640597fb56Smrg        ;;
43650597fb56Smrg      # icc used to be incompatible with GCC.
43660597fb56Smrg      # ICC 10 doesn't accept -KPIC any more.
43670597fb56Smrg      icc* | ifort*)
43680597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43690597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
43700597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
43710597fb56Smrg        ;;
43720597fb56Smrg      # Lahey Fortran 8.1.
43730597fb56Smrg      lf95*)
43740597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43750597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
43760597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
43770597fb56Smrg	;;
43780597fb56Smrg      nagfor*)
43790597fb56Smrg	# NAG Fortran compiler
43800597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
43810597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
43820597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
43830597fb56Smrg	;;
43840597fb56Smrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
43850597fb56Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
43860597fb56Smrg	# which looks to be a dead project)
43870597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43880597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
43890597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
43900597fb56Smrg        ;;
43910597fb56Smrg      ccc*)
43920597fb56Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43930597fb56Smrg        # All Alpha code is PIC.
43940597fb56Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
43950597fb56Smrg        ;;
43960597fb56Smrg      xl* | bgxl* | bgf* | mpixl*)
43970597fb56Smrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
43980597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43990597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
44000597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
44010597fb56Smrg	;;
44020597fb56Smrg      *)
44030597fb56Smrg	case `$CC -V 2>&1 | sed 5q` in
44040597fb56Smrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
44050597fb56Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
44060597fb56Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44070597fb56Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44080597fb56Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
44090597fb56Smrg	  ;;
44100597fb56Smrg	*Sun\ F* | *Sun*Fortran*)
44110597fb56Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44120597fb56Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44130597fb56Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
44140597fb56Smrg	  ;;
44150597fb56Smrg	*Sun\ C*)
44160597fb56Smrg	  # Sun C 5.9
44170597fb56Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44180597fb56Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44190597fb56Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44200597fb56Smrg	  ;;
44210597fb56Smrg        *Intel*\ [[CF]]*Compiler*)
44220597fb56Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44230597fb56Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
44240597fb56Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
44250597fb56Smrg	  ;;
44260597fb56Smrg	*Portland\ Group*)
44270597fb56Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44280597fb56Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
44290597fb56Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44300597fb56Smrg	  ;;
44310597fb56Smrg	esac
44320597fb56Smrg	;;
44330597fb56Smrg      esac
44348c4a8e55Smrg      ;;
44350597fb56Smrg
44360597fb56Smrg    newsos6)
44370597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44380597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44398c4a8e55Smrg      ;;
44400597fb56Smrg
44410597fb56Smrg    *nto* | *qnx*)
44420597fb56Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
44430597fb56Smrg      # it will coredump.
44440597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
44458c4a8e55Smrg      ;;
4446bd23fbfaSmrg
44470597fb56Smrg    osf3* | osf4* | osf5*)
44480597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44490597fb56Smrg      # All OSF/1 code is PIC.
44500597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
44510597fb56Smrg      ;;
4452bd23fbfaSmrg
44530597fb56Smrg    rdos*)
44540597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4455bd23fbfaSmrg      ;;
44560597fb56Smrg
44570597fb56Smrg    solaris*)
44580597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44590597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44600597fb56Smrg      case $cc_basename in
44610597fb56Smrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
44620597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
44630597fb56Smrg      *)
44640597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
44650597fb56Smrg      esac
4466bd23fbfaSmrg      ;;
44670597fb56Smrg
44680597fb56Smrg    sunos4*)
44690597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
44700597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
44710597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4472bd23fbfaSmrg      ;;
4473bd23fbfaSmrg
44740597fb56Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
44750597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44760597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44770597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44780597fb56Smrg      ;;
4479706b6b52Smrg
44800597fb56Smrg    sysv4*MP*)
44810597fb56Smrg      if test -d /usr/nec ;then
44820597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
44830597fb56Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44840597fb56Smrg      fi
44850597fb56Smrg      ;;
4486b042e37fSmrg
44870597fb56Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
44880597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44890597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44900597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44910597fb56Smrg      ;;
4492b042e37fSmrg
44930597fb56Smrg    unicos*)
44940597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44950597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
44960597fb56Smrg      ;;
4497b042e37fSmrg
44980597fb56Smrg    uts4*)
44990597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
45000597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
45010597fb56Smrg      ;;
4502b042e37fSmrg
45030597fb56Smrg    *)
45040597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
45050597fb56Smrg      ;;
4506706b6b52Smrg    esac
4507706b6b52Smrg  fi
45080597fb56Smrg])
45090597fb56Smrgcase $host_os in
45100597fb56Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
45110597fb56Smrg  *djgpp*)
45120597fb56Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4513706b6b52Smrg    ;;
45140597fb56Smrg  *)
45150597fb56Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4516706b6b52Smrg    ;;
45170597fb56Smrgesac
4518706b6b52Smrg
45190597fb56SmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
45200597fb56Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
45210597fb56Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
45220597fb56Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
4523706b6b52Smrg
45240597fb56Smrg#
45250597fb56Smrg# Check to make sure the PIC flag actually works.
45260597fb56Smrg#
45270597fb56Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
45280597fb56Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
45290597fb56Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
45300597fb56Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
45310597fb56Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
45320597fb56Smrg     "" | " "*) ;;
45330597fb56Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
45340597fb56Smrg     esac],
45350597fb56Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
45360597fb56Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
45370597fb56Smrgfi
45380597fb56Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
45390597fb56Smrg	[Additional compiler flags for building library objects])
4540b042e37fSmrg
45410597fb56Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
45420597fb56Smrg	[How to pass a linker flag through the compiler])
45430597fb56Smrg#
45440597fb56Smrg# Check to make sure the static flag actually works.
45450597fb56Smrg#
45460597fb56Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
45470597fb56Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
45480597fb56Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
45490597fb56Smrg  $lt_tmp_static_flag,
45500597fb56Smrg  [],
45510597fb56Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
45520597fb56Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
45530597fb56Smrg	[Compiler flag to prevent dynamic linking])
45540597fb56Smrg])# _LT_COMPILER_PIC
45550597fb56Smrg
45560597fb56Smrg
45570597fb56Smrg# _LT_LINKER_SHLIBS([TAGNAME])
45580597fb56Smrg# ----------------------------
45590597fb56Smrg# See if the linker supports building shared libraries.
45600597fb56Smrgm4_defun([_LT_LINKER_SHLIBS],
45610597fb56Smrg[AC_REQUIRE([LT_PATH_LD])dnl
45620597fb56SmrgAC_REQUIRE([LT_PATH_NM])dnl
45630597fb56Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
45640597fb56Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
45650597fb56Smrgm4_require([_LT_DECL_EGREP])dnl
45660597fb56Smrgm4_require([_LT_DECL_SED])dnl
45670597fb56Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
45680597fb56Smrgm4_require([_LT_TAG_COMPILER])dnl
45690597fb56SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
45700597fb56Smrgm4_if([$1], [CXX], [
45710597fb56Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
45720597fb56Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
45730597fb56Smrg  case $host_os in
45740597fb56Smrg  aix[[4-9]]*)
45750597fb56Smrg    # If we're using GNU nm, then we don't want the "-C" option.
45760597fb56Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
45770597fb56Smrg    # Also, AIX nm treats weak defined symbols like other global defined
45780597fb56Smrg    # symbols, whereas GNU nm marks them as "W".
45790597fb56Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
45800597fb56Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4581706b6b52Smrg    else
45820597fb56Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
45838c4a8e55Smrg    fi
45848c4a8e55Smrg    ;;
45850597fb56Smrg  pw32*)
45860597fb56Smrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
45870597fb56Smrg    ;;
45880597fb56Smrg  cygwin* | mingw* | cegcc*)
45890597fb56Smrg    case $cc_basename in
45900597fb56Smrg    cl*)
45910597fb56Smrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
45920597fb56Smrg      ;;
45930597fb56Smrg    *)
45940597fb56Smrg      _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'
45950597fb56Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
45960597fb56Smrg      ;;
45970597fb56Smrg    esac
45988c4a8e55Smrg    ;;
4599706b6b52Smrg  *)
46000597fb56Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
46018c4a8e55Smrg    ;;
46028c4a8e55Smrg  esac
46030597fb56Smrg], [
46040597fb56Smrg  runpath_var=
46050597fb56Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
46060597fb56Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
46070597fb56Smrg  _LT_TAGVAR(archive_cmds, $1)=
46080597fb56Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
46090597fb56Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
46100597fb56Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
46110597fb56Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
46120597fb56Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
46130597fb56Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
46140597fb56Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
46150597fb56Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
46160597fb56Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
46170597fb56Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
46180597fb56Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
46190597fb56Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
46200597fb56Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
46210597fb56Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
46220597fb56Smrg  _LT_TAGVAR(module_cmds, $1)=
46230597fb56Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
46240597fb56Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
46250597fb56Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
46260597fb56Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
46270597fb56Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
46280597fb56Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
46290597fb56Smrg  # included in the symbol list
46300597fb56Smrg  _LT_TAGVAR(include_expsyms, $1)=
46310597fb56Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
46320597fb56Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
46330597fb56Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
46340597fb56Smrg  # as well as any symbol that contains `d'.
46350597fb56Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
46360597fb56Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
46370597fb56Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
46380597fb56Smrg  # the symbol is explicitly referenced.  Since portable code cannot
46390597fb56Smrg  # rely on this symbol name, it's probably fine to never include it in
46400597fb56Smrg  # preloaded symbol tables.
46410597fb56Smrg  # Exclude shared library initialization/finalization symbols.
46420597fb56Smrgdnl Note also adjust exclude_expsyms for C++ above.
46430597fb56Smrg  extract_expsyms_cmds=
4644b042e37fSmrg
4645706b6b52Smrg  case $host_os in
46460597fb56Smrg  cygwin* | mingw* | pw32* | cegcc*)
46470597fb56Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
46480597fb56Smrg    # When not using gcc, we currently assume that we are using
46490597fb56Smrg    # Microsoft Visual C++.
46500597fb56Smrg    if test "$GCC" != yes; then
46510597fb56Smrg      with_gnu_ld=no
46520597fb56Smrg    fi
4653706b6b52Smrg    ;;
46540597fb56Smrg  interix*)
46550597fb56Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
46560597fb56Smrg    with_gnu_ld=yes
46570597fb56Smrg    ;;
46580597fb56Smrg  openbsd*)
46590597fb56Smrg    with_gnu_ld=no
4660706b6b52Smrg    ;;
4661706b6b52Smrg  esac
4662b042e37fSmrg
46630597fb56Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
4664b042e37fSmrg
46650597fb56Smrg  # On some targets, GNU ld is compatible enough with the native linker
46660597fb56Smrg  # that we're better off using the native interface for both.
46670597fb56Smrg  lt_use_gnu_ld_interface=no
46680597fb56Smrg  if test "$with_gnu_ld" = yes; then
4669706b6b52Smrg    case $host_os in
46700597fb56Smrg      aix*)
46710597fb56Smrg	# The AIX port of GNU ld has always aspired to compatibility
46720597fb56Smrg	# with the native linker.  However, as the warning in the GNU ld
46730597fb56Smrg	# block says, versions before 2.19.5* couldn't really create working
46740597fb56Smrg	# shared libraries, regardless of the interface used.
46750597fb56Smrg	case `$LD -v 2>&1` in
46760597fb56Smrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
46770597fb56Smrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
46780597fb56Smrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
46790597fb56Smrg	  *)
46800597fb56Smrg	    lt_use_gnu_ld_interface=yes
46810597fb56Smrg	    ;;
46820597fb56Smrg	esac
4683706b6b52Smrg	;;
4684706b6b52Smrg      *)
46850597fb56Smrg	lt_use_gnu_ld_interface=yes
4686706b6b52Smrg	;;
46870597fb56Smrg    esac
4688706b6b52Smrg  fi
4689b042e37fSmrg
46900597fb56Smrg  if test "$lt_use_gnu_ld_interface" = yes; then
46910597fb56Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
46920597fb56Smrg    wlarc='${wl}'
4693b042e37fSmrg
46940597fb56Smrg    # Set some defaults for GNU ld with shared library support. These
46950597fb56Smrg    # are reset later if shared libraries are not supported. Putting them
46960597fb56Smrg    # here allows them to be overridden if necessary.
46970597fb56Smrg    runpath_var=LD_RUN_PATH
46980597fb56Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
46990597fb56Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
47000597fb56Smrg    # ancient GNU ld didn't support --whole-archive et. al.
47010597fb56Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
47020597fb56Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
47030597fb56Smrg    else
47040597fb56Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
47050597fb56Smrg    fi
47060597fb56Smrg    supports_anon_versioning=no
47070597fb56Smrg    case `$LD -v 2>&1` in
47080597fb56Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
47090597fb56Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
47100597fb56Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
47110597fb56Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
47120597fb56Smrg      *\ 2.11.*) ;; # other 2.11 versions
47130597fb56Smrg      *) supports_anon_versioning=yes ;;
47140597fb56Smrg    esac
4715b042e37fSmrg
47160597fb56Smrg    # See if GNU ld supports shared libraries.
47170597fb56Smrg    case $host_os in
47180597fb56Smrg    aix[[3-9]]*)
47190597fb56Smrg      # On AIX/PPC, the GNU linker is very broken
47200597fb56Smrg      if test "$host_cpu" != ia64; then
47210597fb56Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
47220597fb56Smrg	cat <<_LT_EOF 1>&2
4723706b6b52Smrg
47240597fb56Smrg*** Warning: the GNU linker, at least up to release 2.19, is reported
47250597fb56Smrg*** to be unable to reliably create shared libraries on AIX.
47260597fb56Smrg*** Therefore, libtool is disabling shared libraries support.  If you
47270597fb56Smrg*** really care for shared libraries, you may want to install binutils
47280597fb56Smrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
47290597fb56Smrg*** You will then need to restart the configuration process.
4730b042e37fSmrg
47310597fb56Smrg_LT_EOF
47320597fb56Smrg      fi
47330597fb56Smrg      ;;
4734b042e37fSmrg
47350597fb56Smrg    amigaos*)
47360597fb56Smrg      case $host_cpu in
47370597fb56Smrg      powerpc)
47380597fb56Smrg            # see comment about AmigaOS4 .so support
47390597fb56Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
47400597fb56Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
47410597fb56Smrg        ;;
47420597fb56Smrg      m68k)
47430597fb56Smrg            _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)'
47440597fb56Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
47450597fb56Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
47460597fb56Smrg        ;;
47470597fb56Smrg      esac
47488c4a8e55Smrg      ;;
47490597fb56Smrg
47500597fb56Smrg    beos*)
47510597fb56Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
47520597fb56Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
47530597fb56Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
47540597fb56Smrg	# support --undefined.  This deserves some investigation.  FIXME
47550597fb56Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
47560597fb56Smrg      else
47570597fb56Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
47580597fb56Smrg      fi
47598c4a8e55Smrg      ;;
47600597fb56Smrg
47610597fb56Smrg    cygwin* | mingw* | pw32* | cegcc*)
47620597fb56Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
47630597fb56Smrg      # as there is no search path for DLLs.
47640597fb56Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
47650597fb56Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
47660597fb56Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
47670597fb56Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
47680597fb56Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
47690597fb56Smrg      _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'
47700597fb56Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
47710597fb56Smrg
47720597fb56Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
47730597fb56Smrg        _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'
47740597fb56Smrg	# If the export-symbols file already is a .def file (1st line
47750597fb56Smrg	# is EXPORTS), use it as is; otherwise, prepend...
47760597fb56Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
47770597fb56Smrg	  cp $export_symbols $output_objdir/$soname.def;
47780597fb56Smrg	else
47790597fb56Smrg	  echo EXPORTS > $output_objdir/$soname.def;
47800597fb56Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
47810597fb56Smrg	fi~
47820597fb56Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
47830597fb56Smrg      else
47840597fb56Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
47850597fb56Smrg      fi
47860597fb56Smrg      ;;
47870597fb56Smrg
47880597fb56Smrg    haiku*)
47890597fb56Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
47900597fb56Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
47910597fb56Smrg      ;;
47920597fb56Smrg
47930597fb56Smrg    interix[[3-9]]*)
47940597fb56Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
47950597fb56Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
47960597fb56Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
47970597fb56Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
47980597fb56Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
47990597fb56Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
48000597fb56Smrg      # default) and relocated if they conflict, which is a slow very memory
48010597fb56Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
48020597fb56Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
48030597fb56Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
48040597fb56Smrg      _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'
48050597fb56Smrg      _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'
48060597fb56Smrg      ;;
48070597fb56Smrg
48080597fb56Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
48090597fb56Smrg      tmp_diet=no
48100597fb56Smrg      if test "$host_os" = linux-dietlibc; then
48110597fb56Smrg	case $cc_basename in
48120597fb56Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
48130597fb56Smrg	esac
48140597fb56Smrg      fi
48150597fb56Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
48160597fb56Smrg	 && test "$tmp_diet" = no
48170597fb56Smrg      then
48180597fb56Smrg	tmp_addflag=' $pic_flag'
48190597fb56Smrg	tmp_sharedflag='-shared'
48200597fb56Smrg	case $cc_basename,$host_cpu in
48210597fb56Smrg        pgcc*)				# Portland Group C compiler
48220597fb56Smrg	  _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'
48230597fb56Smrg	  tmp_addflag=' $pic_flag'
48240597fb56Smrg	  ;;
48250597fb56Smrg	pgf77* | pgf90* | pgf95* | pgfortran*)
48260597fb56Smrg					# Portland Group f77 and f90 compilers
48270597fb56Smrg	  _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'
48280597fb56Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
48290597fb56Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
48300597fb56Smrg	  tmp_addflag=' -i_dynamic' ;;
48310597fb56Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
48320597fb56Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
48330597fb56Smrg	ifc* | ifort*)			# Intel Fortran compiler
48340597fb56Smrg	  tmp_addflag=' -nofor_main' ;;
48350597fb56Smrg	lf95*)				# Lahey Fortran 8.1
48360597fb56Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
48370597fb56Smrg	  tmp_sharedflag='--shared' ;;
48380597fb56Smrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
48390597fb56Smrg	  tmp_sharedflag='-qmkshrobj'
48400597fb56Smrg	  tmp_addflag= ;;
48410597fb56Smrg	nvcc*)	# Cuda Compiler Driver 2.2
48420597fb56Smrg	  _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'
48430597fb56Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
48440597fb56Smrg	  ;;
48450597fb56Smrg	esac
48460597fb56Smrg	case `$CC -V 2>&1 | sed 5q` in
48470597fb56Smrg	*Sun\ C*)			# Sun C 5.9
48480597fb56Smrg	  _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'
48490597fb56Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
48500597fb56Smrg	  tmp_sharedflag='-G' ;;
48510597fb56Smrg	*Sun\ F*)			# Sun Fortran 8.3
48520597fb56Smrg	  tmp_sharedflag='-G' ;;
48530597fb56Smrg	esac
48540597fb56Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
48550597fb56Smrg
48560597fb56Smrg        if test "x$supports_anon_versioning" = xyes; then
48570597fb56Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
48580597fb56Smrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
48590597fb56Smrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
48600597fb56Smrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
48610597fb56Smrg        fi
48620597fb56Smrg
48630597fb56Smrg	case $cc_basename in
48640597fb56Smrg	xlf* | bgf* | bgxlf* | mpixlf*)
48650597fb56Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
48660597fb56Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
48670597fb56Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
48680597fb56Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
48690597fb56Smrg	  if test "x$supports_anon_versioning" = xyes; then
48700597fb56Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
48710597fb56Smrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
48720597fb56Smrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
48730597fb56Smrg	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
48740597fb56Smrg	  fi
48750597fb56Smrg	  ;;
48760597fb56Smrg	esac
48770597fb56Smrg      else
48780597fb56Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
48790597fb56Smrg      fi
4880706b6b52Smrg      ;;
4881b042e37fSmrg
48820597fb56Smrg    netbsd*)
48830597fb56Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
48840597fb56Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
48850597fb56Smrg	wlarc=
48860597fb56Smrg      else
48870597fb56Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
48880597fb56Smrg	_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'
48890597fb56Smrg      fi
48900597fb56Smrg      ;;
4891706b6b52Smrg
48920597fb56Smrg    solaris*)
48930597fb56Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
48940597fb56Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
48950597fb56Smrg	cat <<_LT_EOF 1>&2
4896b042e37fSmrg
48970597fb56Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
48980597fb56Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
48990597fb56Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
49000597fb56Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
49010597fb56Smrg*** your PATH or compiler configuration so that the native linker is
49020597fb56Smrg*** used, and then restart.
4903b042e37fSmrg
49040597fb56Smrg_LT_EOF
49050597fb56Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
49060597fb56Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
49070597fb56Smrg	_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'
49080597fb56Smrg      else
49090597fb56Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
49100597fb56Smrg      fi
49110597fb56Smrg      ;;
4912b042e37fSmrg
49130597fb56Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
49140597fb56Smrg      case `$LD -v 2>&1` in
49150597fb56Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
49160597fb56Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
49170597fb56Smrg	cat <<_LT_EOF 1>&2
4918b042e37fSmrg
49190597fb56Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
49200597fb56Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
49210597fb56Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
49220597fb56Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
49230597fb56Smrg*** your PATH or compiler configuration so that the native linker is
49240597fb56Smrg*** used, and then restart.
4925b042e37fSmrg
49260597fb56Smrg_LT_EOF
49270597fb56Smrg	;;
49280597fb56Smrg	*)
49290597fb56Smrg	  # For security reasons, it is highly recommended that you always
49300597fb56Smrg	  # use absolute paths for naming shared libraries, and exclude the
49310597fb56Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
49320597fb56Smrg	  # requires that you compile everything twice, which is a pain.
49330597fb56Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
49340597fb56Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
49350597fb56Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
49360597fb56Smrg	    _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'
49370597fb56Smrg	  else
49380597fb56Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
49390597fb56Smrg	  fi
49400597fb56Smrg	;;
49410597fb56Smrg      esac
49420597fb56Smrg      ;;
4943b042e37fSmrg
49440597fb56Smrg    sunos4*)
49450597fb56Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
49460597fb56Smrg      wlarc=
49470597fb56Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
49480597fb56Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
49490597fb56Smrg      ;;
4950706b6b52Smrg
49510597fb56Smrg    *)
49520597fb56Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
49530597fb56Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
49540597fb56Smrg	_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'
49550597fb56Smrg      else
49560597fb56Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
49570597fb56Smrg      fi
49580597fb56Smrg      ;;
49590597fb56Smrg    esac
4960706b6b52Smrg
49610597fb56Smrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
49620597fb56Smrg      runpath_var=
49630597fb56Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
49640597fb56Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
49650597fb56Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
49660597fb56Smrg    fi
49670597fb56Smrg  else
49680597fb56Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
49690597fb56Smrg    case $host_os in
49700597fb56Smrg    aix3*)
49710597fb56Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
49720597fb56Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
49730597fb56Smrg      _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'
49740597fb56Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
49750597fb56Smrg      # are no directories specified by -L.
49760597fb56Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
49770597fb56Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
49780597fb56Smrg	# Neither direct hardcoding nor static linking is supported with a
49790597fb56Smrg	# broken collect2.
49800597fb56Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
49810597fb56Smrg      fi
49820597fb56Smrg      ;;
4983706b6b52Smrg
49840597fb56Smrg    aix[[4-9]]*)
49850597fb56Smrg      if test "$host_cpu" = ia64; then
49860597fb56Smrg	# On IA64, the linker does run time linking by default, so we don't
49870597fb56Smrg	# have to do anything special.
49880597fb56Smrg	aix_use_runtimelinking=no
49890597fb56Smrg	exp_sym_flag='-Bexport'
49900597fb56Smrg	no_entry_flag=""
49910597fb56Smrg      else
49920597fb56Smrg	# If we're using GNU nm, then we don't want the "-C" option.
49930597fb56Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
49940597fb56Smrg	# Also, AIX nm treats weak defined symbols like other global
49950597fb56Smrg	# defined symbols, whereas GNU nm marks them as "W".
49960597fb56Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
49970597fb56Smrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
49980597fb56Smrg	else
49990597fb56Smrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
50000597fb56Smrg	fi
50010597fb56Smrg	aix_use_runtimelinking=no
5002706b6b52Smrg
50030597fb56Smrg	# Test if we are trying to use run time linking or normal
50040597fb56Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
50050597fb56Smrg	# need to do runtime linking.
50060597fb56Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
50070597fb56Smrg	  for ld_flag in $LDFLAGS; do
50080597fb56Smrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
50090597fb56Smrg	    aix_use_runtimelinking=yes
50100597fb56Smrg	    break
50110597fb56Smrg	  fi
50120597fb56Smrg	  done
50130597fb56Smrg	  ;;
50148c4a8e55Smrg	esac
5015b042e37fSmrg
50160597fb56Smrg	exp_sym_flag='-bexport'
50170597fb56Smrg	no_entry_flag='-bnoentry'
50180597fb56Smrg      fi
5019b042e37fSmrg
50200597fb56Smrg      # When large executables or shared objects are built, AIX ld can
50210597fb56Smrg      # have problems creating the table of contents.  If linking a library
50220597fb56Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
50230597fb56Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
50240597fb56Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5025b042e37fSmrg
50260597fb56Smrg      _LT_TAGVAR(archive_cmds, $1)=''
50270597fb56Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
50280597fb56Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
50290597fb56Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
50300597fb56Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
50310597fb56Smrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
5032b042e37fSmrg
50330597fb56Smrg      if test "$GCC" = yes; then
50340597fb56Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
50350597fb56Smrg	# We only want to do this on AIX 4.2 and lower, the check
50360597fb56Smrg	# below for broken collect2 doesn't work under 4.3+
50370597fb56Smrg	  collect2name=`${CC} -print-prog-name=collect2`
50380597fb56Smrg	  if test -f "$collect2name" &&
50390597fb56Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
50400597fb56Smrg	  then
50410597fb56Smrg	  # We have reworked collect2
50420597fb56Smrg	  :
50430597fb56Smrg	  else
50440597fb56Smrg	  # We have old collect2
50450597fb56Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
50460597fb56Smrg	  # It fails to find uninstalled libraries when the uninstalled
50470597fb56Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
50480597fb56Smrg	  # to unsupported forces relinking
50490597fb56Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
50500597fb56Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
50510597fb56Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
50520597fb56Smrg	  fi
50530597fb56Smrg	  ;;
50540597fb56Smrg	esac
50550597fb56Smrg	shared_flag='-shared'
50560597fb56Smrg	if test "$aix_use_runtimelinking" = yes; then
50570597fb56Smrg	  shared_flag="$shared_flag "'${wl}-G'
50580597fb56Smrg	fi
50590597fb56Smrg      else
50600597fb56Smrg	# not using gcc
50610597fb56Smrg	if test "$host_cpu" = ia64; then
50620597fb56Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
50630597fb56Smrg	# chokes on -Wl,-G. The following line is correct:
50640597fb56Smrg	  shared_flag='-G'
50650597fb56Smrg	else
50660597fb56Smrg	  if test "$aix_use_runtimelinking" = yes; then
50670597fb56Smrg	    shared_flag='${wl}-G'
50680597fb56Smrg	  else
50690597fb56Smrg	    shared_flag='${wl}-bM:SRE'
50700597fb56Smrg	  fi
50710597fb56Smrg	fi
50720597fb56Smrg      fi
5073b042e37fSmrg
50740597fb56Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
50750597fb56Smrg      # It seems that -bexpall does not export symbols beginning with
50760597fb56Smrg      # underscore (_), so it is better to generate a list of symbols to export.
50770597fb56Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
50780597fb56Smrg      if test "$aix_use_runtimelinking" = yes; then
50790597fb56Smrg	# Warning - without using the other runtime loading flags (-brtl),
50800597fb56Smrg	# -berok will link without error, but may produce a broken library.
50810597fb56Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
50820597fb56Smrg        # Determine the default libpath from the value encoded in an
50830597fb56Smrg        # empty executable.
50840597fb56Smrg        _LT_SYS_MODULE_PATH_AIX([$1])
50850597fb56Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
50860597fb56Smrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
50870597fb56Smrg      else
50880597fb56Smrg	if test "$host_cpu" = ia64; then
50890597fb56Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
50900597fb56Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
50910597fb56Smrg	  _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"
50920597fb56Smrg	else
50930597fb56Smrg	 # Determine the default libpath from the value encoded in an
50940597fb56Smrg	 # empty executable.
50950597fb56Smrg	 _LT_SYS_MODULE_PATH_AIX([$1])
50960597fb56Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
50970597fb56Smrg	  # Warning - without using the other run time loading flags,
50980597fb56Smrg	  # -berok will link without error, but may produce a broken library.
50990597fb56Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
51000597fb56Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
51010597fb56Smrg	  if test "$with_gnu_ld" = yes; then
51020597fb56Smrg	    # We only use this code for GNU lds that support --whole-archive.
51030597fb56Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
51040597fb56Smrg	  else
51050597fb56Smrg	    # Exported symbols can be pulled into shared objects from archives
51060597fb56Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
51070597fb56Smrg	  fi
51080597fb56Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
51090597fb56Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
51100597fb56Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
51110597fb56Smrg	fi
51120597fb56Smrg      fi
51130597fb56Smrg      ;;
5114b042e37fSmrg
51150597fb56Smrg    amigaos*)
51160597fb56Smrg      case $host_cpu in
51170597fb56Smrg      powerpc)
51180597fb56Smrg            # see comment about AmigaOS4 .so support
51190597fb56Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
51200597fb56Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
51210597fb56Smrg        ;;
51220597fb56Smrg      m68k)
51230597fb56Smrg            _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)'
51240597fb56Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
51250597fb56Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
51260597fb56Smrg        ;;
51270597fb56Smrg      esac
51280597fb56Smrg      ;;
5129b042e37fSmrg
51300597fb56Smrg    bsdi[[45]]*)
51310597fb56Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
51328c4a8e55Smrg      ;;
51330597fb56Smrg
51340597fb56Smrg    cygwin* | mingw* | pw32* | cegcc*)
51350597fb56Smrg      # When not using gcc, we currently assume that we are using
51360597fb56Smrg      # Microsoft Visual C++.
51370597fb56Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
51380597fb56Smrg      # no search path for DLLs.
51390597fb56Smrg      case $cc_basename in
51400597fb56Smrg      cl*)
51410597fb56Smrg	# Native MSVC
51420597fb56Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
51430597fb56Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
51440597fb56Smrg	_LT_TAGVAR(always_export_symbols, $1)=yes
51450597fb56Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
51460597fb56Smrg	# Tell ltmain to make .lib files, not .a files.
51470597fb56Smrg	libext=lib
51480597fb56Smrg	# Tell ltmain to make .dll files, not .so files.
51490597fb56Smrg	shrext_cmds=".dll"
51500597fb56Smrg	# FIXME: Setting linknames here is a bad hack.
51510597fb56Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
51520597fb56Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
51530597fb56Smrg	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
51540597fb56Smrg	  else
51550597fb56Smrg	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
51560597fb56Smrg	  fi~
51570597fb56Smrg	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
51580597fb56Smrg	  linknames='
51590597fb56Smrg	# The linker will not automatically build a static lib if we build a DLL.
51600597fb56Smrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
51610597fb56Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
51620597fb56Smrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
51630597fb56Smrg	_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'
51640597fb56Smrg	# Don't use ranlib
51650597fb56Smrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
51660597fb56Smrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
51670597fb56Smrg	  lt_tool_outputfile="@TOOL_OUTPUT@"~
51680597fb56Smrg	  case $lt_outputfile in
51690597fb56Smrg	    *.exe|*.EXE) ;;
51700597fb56Smrg	    *)
51710597fb56Smrg	      lt_outputfile="$lt_outputfile.exe"
51720597fb56Smrg	      lt_tool_outputfile="$lt_tool_outputfile.exe"
51730597fb56Smrg	      ;;
51740597fb56Smrg	  esac~
51750597fb56Smrg	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
51760597fb56Smrg	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
51770597fb56Smrg	    $RM "$lt_outputfile.manifest";
51780597fb56Smrg	  fi'
5179706b6b52Smrg	;;
5180706b6b52Smrg      *)
51810597fb56Smrg	# Assume MSVC wrapper
51820597fb56Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
51830597fb56Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
51840597fb56Smrg	# Tell ltmain to make .lib files, not .a files.
51850597fb56Smrg	libext=lib
51860597fb56Smrg	# Tell ltmain to make .dll files, not .so files.
51870597fb56Smrg	shrext_cmds=".dll"
51880597fb56Smrg	# FIXME: Setting linknames here is a bad hack.
51890597fb56Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
51900597fb56Smrg	# The linker will automatically build a .lib file if we build a DLL.
51910597fb56Smrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
51920597fb56Smrg	# FIXME: Should let the user specify the lib program.
51930597fb56Smrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
51940597fb56Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5195706b6b52Smrg	;;
5196706b6b52Smrg      esac
51970597fb56Smrg      ;;
5198b042e37fSmrg
51990597fb56Smrg    darwin* | rhapsody*)
52000597fb56Smrg      _LT_DARWIN_LINKER_FEATURES($1)
52010597fb56Smrg      ;;
5202b042e37fSmrg
52030597fb56Smrg    dgux*)
52040597fb56Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
52050597fb56Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
52060597fb56Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
52070597fb56Smrg      ;;
5208b042e37fSmrg
52090597fb56Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
52100597fb56Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
52110597fb56Smrg    # does not break anything, and helps significantly (at the cost of a little
52120597fb56Smrg    # extra space).
52130597fb56Smrg    freebsd2.2*)
52140597fb56Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
52150597fb56Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
52160597fb56Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
52170597fb56Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
52180597fb56Smrg      ;;
5219b042e37fSmrg
52200597fb56Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
52210597fb56Smrg    freebsd2.*)
52220597fb56Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
52230597fb56Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
52240597fb56Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
52250597fb56Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
52260597fb56Smrg      ;;
5227b042e37fSmrg
52280597fb56Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
52290597fb56Smrg    freebsd* | dragonfly*)
52300597fb56Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
52310597fb56Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
52320597fb56Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
52330597fb56Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
52340597fb56Smrg      ;;
5235b042e37fSmrg
52360597fb56Smrg    hpux9*)
52370597fb56Smrg      if test "$GCC" = yes; then
52380597fb56Smrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
52390597fb56Smrg      else
52400597fb56Smrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
52410597fb56Smrg      fi
52420597fb56Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
52430597fb56Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
52440597fb56Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5245b042e37fSmrg
52460597fb56Smrg      # hardcode_minus_L: Not really in the search PATH,
52470597fb56Smrg      # but as the default location of the library.
52480597fb56Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
52490597fb56Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
52500597fb56Smrg      ;;
5251b042e37fSmrg
52520597fb56Smrg    hpux10*)
52530597fb56Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
52540597fb56Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
52550597fb56Smrg      else
52560597fb56Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
52570597fb56Smrg      fi
52580597fb56Smrg      if test "$with_gnu_ld" = no; then
52590597fb56Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
52600597fb56Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
52610597fb56Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
52620597fb56Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
52630597fb56Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
52640597fb56Smrg	# hardcode_minus_L: Not really in the search PATH,
52650597fb56Smrg	# but as the default location of the library.
52660597fb56Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
52670597fb56Smrg      fi
52680597fb56Smrg      ;;
5269b042e37fSmrg
52700597fb56Smrg    hpux11*)
52710597fb56Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
52720597fb56Smrg	case $host_cpu in
52730597fb56Smrg	hppa*64*)
52740597fb56Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
52750597fb56Smrg	  ;;
52760597fb56Smrg	ia64*)
52770597fb56Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
52780597fb56Smrg	  ;;
52790597fb56Smrg	*)
52800597fb56Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
52810597fb56Smrg	  ;;
52820597fb56Smrg	esac
52830597fb56Smrg      else
52840597fb56Smrg	case $host_cpu in
52850597fb56Smrg	hppa*64*)
52860597fb56Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
52870597fb56Smrg	  ;;
52880597fb56Smrg	ia64*)
52890597fb56Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
52900597fb56Smrg	  ;;
52910597fb56Smrg	*)
52920597fb56Smrg	m4_if($1, [], [
52930597fb56Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
52940597fb56Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
52950597fb56Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
52960597fb56Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
52970597fb56Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
52980597fb56Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
52990597fb56Smrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
53000597fb56Smrg	  ;;
53010597fb56Smrg	esac
53020597fb56Smrg      fi
53030597fb56Smrg      if test "$with_gnu_ld" = no; then
53040597fb56Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
53050597fb56Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5306b042e37fSmrg
53070597fb56Smrg	case $host_cpu in
53080597fb56Smrg	hppa*64*|ia64*)
53090597fb56Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
53100597fb56Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
53110597fb56Smrg	  ;;
53120597fb56Smrg	*)
53130597fb56Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
53140597fb56Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
53150597fb56Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5316b042e37fSmrg
53170597fb56Smrg	  # hardcode_minus_L: Not really in the search PATH,
53180597fb56Smrg	  # but as the default location of the library.
53190597fb56Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
53200597fb56Smrg	  ;;
53210597fb56Smrg	esac
53220597fb56Smrg      fi
53230597fb56Smrg      ;;
5324b042e37fSmrg
53250597fb56Smrg    irix5* | irix6* | nonstopux*)
53260597fb56Smrg      if test "$GCC" = yes; then
53270597fb56Smrg	_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'
53280597fb56Smrg	# Try to use the -exported_symbol ld option, if it does not
53290597fb56Smrg	# work, assume that -exports_file does not work either and
53300597fb56Smrg	# implicitly export all symbols.
53310597fb56Smrg	# This should be the same for all languages, so no per-tag cache variable.
53320597fb56Smrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
53330597fb56Smrg	  [lt_cv_irix_exported_symbol],
53340597fb56Smrg	  [save_LDFLAGS="$LDFLAGS"
53350597fb56Smrg	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
53360597fb56Smrg	   AC_LINK_IFELSE(
53370597fb56Smrg	     [AC_LANG_SOURCE(
53380597fb56Smrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
53390597fb56Smrg			      [C++], [[int foo (void) { return 0; }]],
53400597fb56Smrg			      [Fortran 77], [[
53410597fb56Smrg      subroutine foo
53420597fb56Smrg      end]],
53430597fb56Smrg			      [Fortran], [[
53440597fb56Smrg      subroutine foo
53450597fb56Smrg      end]])])],
53460597fb56Smrg	      [lt_cv_irix_exported_symbol=yes],
53470597fb56Smrg	      [lt_cv_irix_exported_symbol=no])
53480597fb56Smrg           LDFLAGS="$save_LDFLAGS"])
53490597fb56Smrg	if test "$lt_cv_irix_exported_symbol" = yes; then
53500597fb56Smrg          _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'
53510597fb56Smrg	fi
53520597fb56Smrg      else
53530597fb56Smrg	_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'
53540597fb56Smrg	_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'
53550597fb56Smrg      fi
53560597fb56Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
53570597fb56Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
53580597fb56Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
53590597fb56Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
53600597fb56Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
53610597fb56Smrg      ;;
5362b042e37fSmrg
53630597fb56Smrg    netbsd*)
53640597fb56Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
53650597fb56Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
53660597fb56Smrg      else
53670597fb56Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
53680597fb56Smrg      fi
53690597fb56Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
53700597fb56Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
53710597fb56Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
53720597fb56Smrg      ;;
5373b042e37fSmrg
53740597fb56Smrg    newsos6)
53750597fb56Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
53760597fb56Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
53770597fb56Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
53780597fb56Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
53790597fb56Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
53808c4a8e55Smrg      ;;
5381b042e37fSmrg
53820597fb56Smrg    *nto* | *qnx*)
53830597fb56Smrg      ;;
5384b042e37fSmrg
53850597fb56Smrg    openbsd*)
53860597fb56Smrg      if test -f /usr/libexec/ld.so; then
53870597fb56Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
53880597fb56Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
53890597fb56Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
53900597fb56Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
53910597fb56Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
53920597fb56Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
53930597fb56Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
53940597fb56Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
53950597fb56Smrg	else
53960597fb56Smrg	  case $host_os in
53970597fb56Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
53980597fb56Smrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
53990597fb56Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
54000597fb56Smrg	     ;;
54010597fb56Smrg	   *)
54020597fb56Smrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
54030597fb56Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
54040597fb56Smrg	     ;;
54050597fb56Smrg	  esac
54060597fb56Smrg	fi
54070597fb56Smrg      else
54080597fb56Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
54090597fb56Smrg      fi
54100597fb56Smrg      ;;
5411b042e37fSmrg
54120597fb56Smrg    os2*)
54130597fb56Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
54140597fb56Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
54150597fb56Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
54160597fb56Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
54170597fb56Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
54180597fb56Smrg      ;;
5419b042e37fSmrg
54200597fb56Smrg    osf3*)
54210597fb56Smrg      if test "$GCC" = yes; then
54220597fb56Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
54230597fb56Smrg	_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'
54240597fb56Smrg      else
54250597fb56Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
54260597fb56Smrg	_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'
54270597fb56Smrg      fi
54280597fb56Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
54290597fb56Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
54300597fb56Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
54310597fb56Smrg      ;;
5432b042e37fSmrg
54330597fb56Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
54340597fb56Smrg      if test "$GCC" = yes; then
54350597fb56Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
54360597fb56Smrg	_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'
54370597fb56Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
54380597fb56Smrg      else
54390597fb56Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
54400597fb56Smrg	_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'
54410597fb56Smrg	_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~
54420597fb56Smrg	$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'
5443b042e37fSmrg
54440597fb56Smrg	# Both c and cxx compiler support -rpath directly
54450597fb56Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
54460597fb56Smrg      fi
54470597fb56Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
54480597fb56Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
54490597fb56Smrg      ;;
5450b042e37fSmrg
54510597fb56Smrg    solaris*)
54520597fb56Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
54530597fb56Smrg      if test "$GCC" = yes; then
54540597fb56Smrg	wlarc='${wl}'
54550597fb56Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
54560597fb56Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
54570597fb56Smrg	  $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'
54580597fb56Smrg      else
54590597fb56Smrg	case `$CC -V 2>&1` in
54600597fb56Smrg	*"Compilers 5.0"*)
54610597fb56Smrg	  wlarc=''
54620597fb56Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
54630597fb56Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
54640597fb56Smrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
54650597fb56Smrg	  ;;
54660597fb56Smrg	*)
54670597fb56Smrg	  wlarc='${wl}'
54680597fb56Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
54690597fb56Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
54700597fb56Smrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
54710597fb56Smrg	  ;;
54720597fb56Smrg	esac
54730597fb56Smrg      fi
54740597fb56Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
54750597fb56Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
54760597fb56Smrg      case $host_os in
54770597fb56Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
54780597fb56Smrg      *)
54790597fb56Smrg	# The compiler driver will combine and reorder linker options,
54800597fb56Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
54810597fb56Smrg	# but is careful enough not to reorder.
54820597fb56Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
54830597fb56Smrg	if test "$GCC" = yes; then
54840597fb56Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
54850597fb56Smrg	else
54860597fb56Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
54870597fb56Smrg	fi
54880597fb56Smrg	;;
54890597fb56Smrg      esac
54900597fb56Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
54910597fb56Smrg      ;;
5492b042e37fSmrg
54930597fb56Smrg    sunos4*)
54940597fb56Smrg      if test "x$host_vendor" = xsequent; then
54950597fb56Smrg	# Use $CC to link under sequent, because it throws in some extra .o
54960597fb56Smrg	# files that make .init and .fini sections work.
54970597fb56Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
54980597fb56Smrg      else
54990597fb56Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
55000597fb56Smrg      fi
55010597fb56Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
55020597fb56Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
55030597fb56Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
55040597fb56Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55050597fb56Smrg      ;;
55060597fb56Smrg
55070597fb56Smrg    sysv4)
55080597fb56Smrg      case $host_vendor in
55090597fb56Smrg	sni)
55100597fb56Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
55110597fb56Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
55120597fb56Smrg	;;
55130597fb56Smrg	siemens)
55140597fb56Smrg	  ## LD is ld it makes a PLAMLIB
55150597fb56Smrg	  ## CC just makes a GrossModule.
55160597fb56Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
55170597fb56Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
55180597fb56Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
55190597fb56Smrg        ;;
55200597fb56Smrg	motorola)
55210597fb56Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
55220597fb56Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
55230597fb56Smrg	;;
55240597fb56Smrg      esac
55250597fb56Smrg      runpath_var='LD_RUN_PATH'
55260597fb56Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55270597fb56Smrg      ;;
5528b042e37fSmrg
55290597fb56Smrg    sysv4.3*)
55300597fb56Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
55310597fb56Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55320597fb56Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
55330597fb56Smrg      ;;
5534b042e37fSmrg
55350597fb56Smrg    sysv4*MP*)
55360597fb56Smrg      if test -d /usr/nec; then
55370597fb56Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
55380597fb56Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55390597fb56Smrg	runpath_var=LD_RUN_PATH
55400597fb56Smrg	hardcode_runpath_var=yes
55410597fb56Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
55420597fb56Smrg      fi
55430597fb56Smrg      ;;
5544b042e37fSmrg
55450597fb56Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
55460597fb56Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
55470597fb56Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
55480597fb56Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55490597fb56Smrg      runpath_var='LD_RUN_PATH'
5550b042e37fSmrg
55510597fb56Smrg      if test "$GCC" = yes; then
55520597fb56Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55530597fb56Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55540597fb56Smrg      else
55550597fb56Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55560597fb56Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55570597fb56Smrg      fi
55580597fb56Smrg      ;;
5559b042e37fSmrg
55600597fb56Smrg    sysv5* | sco3.2v5* | sco5v6*)
55610597fb56Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
55620597fb56Smrg      # link with -lc, and that would cause any symbols used from libc to
55630597fb56Smrg      # always be unresolved, which means just about no library would
55640597fb56Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
55650597fb56Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
55660597fb56Smrg      # as -z defs.
55670597fb56Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
55680597fb56Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
55690597fb56Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
55700597fb56Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55710597fb56Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
55720597fb56Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
55730597fb56Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
55740597fb56Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
55750597fb56Smrg      runpath_var='LD_RUN_PATH'
5576b042e37fSmrg
55770597fb56Smrg      if test "$GCC" = yes; then
55780597fb56Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55790597fb56Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55800597fb56Smrg      else
55810597fb56Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55820597fb56Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
55830597fb56Smrg      fi
55840597fb56Smrg      ;;
5585706b6b52Smrg
55860597fb56Smrg    uts4*)
55870597fb56Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
55880597fb56Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
55890597fb56Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
55900597fb56Smrg      ;;
5591b042e37fSmrg
55920597fb56Smrg    *)
55930597fb56Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
55940597fb56Smrg      ;;
55950597fb56Smrg    esac
5596bd23fbfaSmrg
55970597fb56Smrg    if test x$host_vendor = xsni; then
55980597fb56Smrg      case $host in
55990597fb56Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
56000597fb56Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
56010597fb56Smrg	;;
56020597fb56Smrg      esac
5603bd23fbfaSmrg    fi
56040597fb56Smrg  fi
56050597fb56Smrg])
56060597fb56SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
56070597fb56Smrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
5608bd23fbfaSmrg
56090597fb56Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
5610b042e37fSmrg
56110597fb56Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
56120597fb56Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
56130597fb56Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
56140597fb56Smrg    [The commands to extract the exported symbol list from a shared archive])
5615b042e37fSmrg
56160597fb56Smrg#
56170597fb56Smrg# Do we need to explicitly link libc?
56180597fb56Smrg#
56190597fb56Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
56200597fb56Smrgx|xyes)
56210597fb56Smrg  # Assume -lc should be added
56220597fb56Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5623b042e37fSmrg
56240597fb56Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
56250597fb56Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
56260597fb56Smrg    *'~'*)
56270597fb56Smrg      # FIXME: we may have to deal with multi-command sequences.
5628706b6b52Smrg      ;;
56290597fb56Smrg    '$CC '*)
56300597fb56Smrg      # Test whether the compiler implicitly links with -lc since on some
56310597fb56Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
56320597fb56Smrg      # to ld, don't add -lc before -lgcc.
56330597fb56Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
56340597fb56Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
56350597fb56Smrg	[$RM conftest*
56360597fb56Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
56370597fb56Smrg
56380597fb56Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
56390597fb56Smrg	  soname=conftest
56400597fb56Smrg	  lib=conftest
56410597fb56Smrg	  libobjs=conftest.$ac_objext
56420597fb56Smrg	  deplibs=
56430597fb56Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
56440597fb56Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
56450597fb56Smrg	  compiler_flags=-v
56460597fb56Smrg	  linker_flags=-v
56470597fb56Smrg	  verstring=
56480597fb56Smrg	  output_objdir=.
56490597fb56Smrg	  libname=conftest
56500597fb56Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
56510597fb56Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
56520597fb56Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
56530597fb56Smrg	  then
56540597fb56Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
56550597fb56Smrg	  else
56560597fb56Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
56570597fb56Smrg	  fi
56580597fb56Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
56590597fb56Smrg	else
56600597fb56Smrg	  cat conftest.err 1>&5
56610597fb56Smrg	fi
56620597fb56Smrg	$RM conftest*
56630597fb56Smrg	])
56640597fb56Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
56658c4a8e55Smrg      ;;
56668c4a8e55Smrg    esac
56678c4a8e55Smrg  fi
56680597fb56Smrg  ;;
56690597fb56Smrgesac
5670b042e37fSmrg
56710597fb56Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
56720597fb56Smrg    [Whether or not to add -lc for building shared libraries])
56730597fb56Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
56740597fb56Smrg    [enable_shared_with_static_runtimes], [0],
56750597fb56Smrg    [Whether or not to disallow shared libs when runtime libs are static])
56760597fb56Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
56770597fb56Smrg    [Compiler flag to allow reflexive dlopens])
56780597fb56Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
56790597fb56Smrg    [Compiler flag to generate shared objects directly from archives])
56800597fb56Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
56810597fb56Smrg    [Whether the compiler copes with passing no objects directly])
56820597fb56Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
56830597fb56Smrg    [Create an old-style archive from a shared archive])
56840597fb56Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
56850597fb56Smrg    [Create a temporary old-style archive to link instead of a shared archive])
56860597fb56Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
56870597fb56Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
56880597fb56Smrg_LT_TAGDECL([], [module_cmds], [2],
56890597fb56Smrg    [Commands used to build a loadable module if different from building
56900597fb56Smrg    a shared archive.])
56910597fb56Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
56920597fb56Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
56930597fb56Smrg    [Whether we are building with GNU ld or not])
56940597fb56Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
56950597fb56Smrg    [Flag that allows shared libraries with undefined symbols to be built])
56960597fb56Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
56970597fb56Smrg    [Flag that enforces no undefined symbols])
56980597fb56Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
56990597fb56Smrg    [Flag to hardcode $libdir into a binary during linking.
57000597fb56Smrg    This must work even if $libdir does not exist])
57010597fb56Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
57020597fb56Smrg    [Whether we need a single "-rpath" flag with a separated argument])
57030597fb56Smrg_LT_TAGDECL([], [hardcode_direct], [0],
57040597fb56Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
57050597fb56Smrg    DIR into the resulting binary])
57060597fb56Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
57070597fb56Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
57080597fb56Smrg    DIR into the resulting binary and the resulting library dependency is
57090597fb56Smrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
57100597fb56Smrg    library is relocated])
57110597fb56Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
57120597fb56Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
57130597fb56Smrg    into the resulting binary])
57140597fb56Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
57150597fb56Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
57160597fb56Smrg    into the resulting binary])
57170597fb56Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
57180597fb56Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
57190597fb56Smrg    into the library and all subsequent libraries and executables linked
57200597fb56Smrg    against it])
57210597fb56Smrg_LT_TAGDECL([], [inherit_rpath], [0],
57220597fb56Smrg    [Set to yes if linker adds runtime paths of dependent libraries
57230597fb56Smrg    to runtime path list])
57240597fb56Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
57250597fb56Smrg    [Whether libtool must link a program against all its dependency libraries])
57260597fb56Smrg_LT_TAGDECL([], [always_export_symbols], [0],
57270597fb56Smrg    [Set to "yes" if exported symbols are required])
57280597fb56Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
57290597fb56Smrg    [The commands to list exported symbols])
57300597fb56Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
57310597fb56Smrg    [Symbols that should not be listed in the preloaded symbols])
57320597fb56Smrg_LT_TAGDECL([], [include_expsyms], [1],
57330597fb56Smrg    [Symbols that must always be exported])
57340597fb56Smrg_LT_TAGDECL([], [prelink_cmds], [2],
57350597fb56Smrg    [Commands necessary for linking programs (against libraries) with templates])
57360597fb56Smrg_LT_TAGDECL([], [postlink_cmds], [2],
57370597fb56Smrg    [Commands necessary for finishing linking programs])
57380597fb56Smrg_LT_TAGDECL([], [file_list_spec], [1],
57390597fb56Smrg    [Specify filename containing input files])
57400597fb56Smrgdnl FIXME: Not yet implemented
57410597fb56Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
57420597fb56Smrgdnl    [Compiler flag to generate thread safe objects])
57430597fb56Smrg])# _LT_LINKER_SHLIBS
5744b042e37fSmrg
5745b042e37fSmrg
57460597fb56Smrg# _LT_LANG_C_CONFIG([TAG])
57470597fb56Smrg# ------------------------
57480597fb56Smrg# Ensure that the configuration variables for a C compiler are suitably
57490597fb56Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
57500597fb56Smrg# the compiler configuration to `libtool'.
57510597fb56Smrgm4_defun([_LT_LANG_C_CONFIG],
57520597fb56Smrg[m4_require([_LT_DECL_EGREP])dnl
57530597fb56Smrglt_save_CC="$CC"
57540597fb56SmrgAC_LANG_PUSH(C)
5755bd23fbfaSmrg
57560597fb56Smrg# Source file extension for C test sources.
57570597fb56Smrgac_ext=c
5758bd23fbfaSmrg
57590597fb56Smrg# Object file extension for compiled C test sources.
57600597fb56Smrgobjext=o
57610597fb56Smrg_LT_TAGVAR(objext, $1)=$objext
5762bd23fbfaSmrg
57630597fb56Smrg# Code to be used in simple compile tests
57640597fb56Smrglt_simple_compile_test_code="int some_variable = 0;"
5765bd23fbfaSmrg
57660597fb56Smrg# Code to be used in simple link tests
57670597fb56Smrglt_simple_link_test_code='int main(){return(0);}'
5768bd23fbfaSmrg
57690597fb56Smrg_LT_TAG_COMPILER
57700597fb56Smrg# Save the default compiler, since it gets overwritten when the other
57710597fb56Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
57720597fb56Smrgcompiler_DEFAULT=$CC
5773b042e37fSmrg
57740597fb56Smrg# save warnings/boilerplate of simple test code
57750597fb56Smrg_LT_COMPILER_BOILERPLATE
57760597fb56Smrg_LT_LINKER_BOILERPLATE
5777b042e37fSmrg
57780597fb56Smrgif test -n "$compiler"; then
57790597fb56Smrg  _LT_COMPILER_NO_RTTI($1)
57800597fb56Smrg  _LT_COMPILER_PIC($1)
57810597fb56Smrg  _LT_COMPILER_C_O($1)
57820597fb56Smrg  _LT_COMPILER_FILE_LOCKS($1)
57830597fb56Smrg  _LT_LINKER_SHLIBS($1)
57840597fb56Smrg  _LT_SYS_DYNAMIC_LINKER($1)
57850597fb56Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
57860597fb56Smrg  LT_SYS_DLOPEN_SELF
57870597fb56Smrg  _LT_CMD_STRIPLIB
57888c4a8e55Smrg
57890597fb56Smrg  # Report which library types will actually be built
57900597fb56Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
57910597fb56Smrg  AC_MSG_RESULT([$can_build_shared])
57928c4a8e55Smrg
57930597fb56Smrg  AC_MSG_CHECKING([whether to build shared libraries])
57940597fb56Smrg  test "$can_build_shared" = "no" && enable_shared=no
57958c4a8e55Smrg
57960597fb56Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
57970597fb56Smrg  # are all built from PIC.
57980597fb56Smrg  case $host_os in
57990597fb56Smrg  aix3*)
58000597fb56Smrg    test "$enable_shared" = yes && enable_static=no
58010597fb56Smrg    if test -n "$RANLIB"; then
58020597fb56Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
58030597fb56Smrg      postinstall_cmds='$RANLIB $lib'
58040597fb56Smrg    fi
58050597fb56Smrg    ;;
5806b042e37fSmrg
58070597fb56Smrg  aix[[4-9]]*)
58080597fb56Smrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
58090597fb56Smrg      test "$enable_shared" = yes && enable_static=no
58100597fb56Smrg    fi
58110597fb56Smrg    ;;
58128c4a8e55Smrg  esac
58130597fb56Smrg  AC_MSG_RESULT([$enable_shared])
5814b042e37fSmrg
58150597fb56Smrg  AC_MSG_CHECKING([whether to build static libraries])
58160597fb56Smrg  # Make sure either enable_shared or enable_static is yes.
58170597fb56Smrg  test "$enable_shared" = yes || enable_static=yes
58180597fb56Smrg  AC_MSG_RESULT([$enable_static])
58190597fb56Smrg
58200597fb56Smrg  _LT_CONFIG($1)
58218c4a8e55Smrgfi
58220597fb56SmrgAC_LANG_POP
58230597fb56SmrgCC="$lt_save_CC"
58240597fb56Smrg])# _LT_LANG_C_CONFIG
5825b042e37fSmrg
5826b042e37fSmrg
58270597fb56Smrg# _LT_LANG_CXX_CONFIG([TAG])
58280597fb56Smrg# --------------------------
58290597fb56Smrg# Ensure that the configuration variables for a C++ compiler are suitably
58300597fb56Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
58310597fb56Smrg# the compiler configuration to `libtool'.
58320597fb56Smrgm4_defun([_LT_LANG_CXX_CONFIG],
58330597fb56Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5834706b6b52Smrgm4_require([_LT_DECL_EGREP])dnl
58350597fb56Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
58360597fb56Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
58370597fb56Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
58380597fb56Smrg    (test "X$CXX" != "Xg++"))) ; then
58390597fb56Smrg  AC_PROG_CXXCPP
58400597fb56Smrgelse
58410597fb56Smrg  _lt_caught_CXX_error=yes
58420597fb56Smrgfi
58438c4a8e55Smrg
58440597fb56SmrgAC_LANG_PUSH(C++)
58450597fb56Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
58460597fb56Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
58470597fb56Smrg_LT_TAGVAR(always_export_symbols, $1)=no
58480597fb56Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
58490597fb56Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
58500597fb56Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
58510597fb56Smrg_LT_TAGVAR(hardcode_direct, $1)=no
58520597fb56Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
58530597fb56Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
58540597fb56Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
58550597fb56Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
58560597fb56Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
58570597fb56Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
58580597fb56Smrg_LT_TAGVAR(inherit_rpath, $1)=no
58590597fb56Smrg_LT_TAGVAR(module_cmds, $1)=
58600597fb56Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
58610597fb56Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
58620597fb56Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
58630597fb56Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
58640597fb56Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
58650597fb56Smrg_LT_TAGVAR(no_undefined_flag, $1)=
58660597fb56Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
58670597fb56Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5868b042e37fSmrg
58690597fb56Smrg# Source file extension for C++ test sources.
58700597fb56Smrgac_ext=cpp
5871b042e37fSmrg
58720597fb56Smrg# Object file extension for compiled C++ test sources.
58730597fb56Smrgobjext=o
58740597fb56Smrg_LT_TAGVAR(objext, $1)=$objext
58758c4a8e55Smrg
58760597fb56Smrg# No sense in running all these tests if we already determined that
58770597fb56Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
58780597fb56Smrg# are currently assumed to apply to all compilers on this platform,
58790597fb56Smrg# and will be corrupted by setting them based on a non-working compiler.
58800597fb56Smrgif test "$_lt_caught_CXX_error" != yes; then
58810597fb56Smrg  # Code to be used in simple compile tests
58820597fb56Smrg  lt_simple_compile_test_code="int some_variable = 0;"
58838c4a8e55Smrg
58840597fb56Smrg  # Code to be used in simple link tests
58850597fb56Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
58868c4a8e55Smrg
58870597fb56Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
58880597fb56Smrg  _LT_TAG_COMPILER
58898c4a8e55Smrg
58900597fb56Smrg  # save warnings/boilerplate of simple test code
58910597fb56Smrg  _LT_COMPILER_BOILERPLATE
58920597fb56Smrg  _LT_LINKER_BOILERPLATE
58938c4a8e55Smrg
58940597fb56Smrg  # Allow CC to be a program name with arguments.
58950597fb56Smrg  lt_save_CC=$CC
58960597fb56Smrg  lt_save_CFLAGS=$CFLAGS
58970597fb56Smrg  lt_save_LD=$LD
58980597fb56Smrg  lt_save_GCC=$GCC
58990597fb56Smrg  GCC=$GXX
59000597fb56Smrg  lt_save_with_gnu_ld=$with_gnu_ld
59010597fb56Smrg  lt_save_path_LD=$lt_cv_path_LD
59020597fb56Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
59030597fb56Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
59048c4a8e55Smrg  else
59050597fb56Smrg    $as_unset lt_cv_prog_gnu_ld
59068c4a8e55Smrg  fi
59070597fb56Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
59080597fb56Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
59090597fb56Smrg  else
59100597fb56Smrg    $as_unset lt_cv_path_LD
59110597fb56Smrg  fi
59120597fb56Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
59130597fb56Smrg  CC=${CXX-"c++"}
59140597fb56Smrg  CFLAGS=$CXXFLAGS
59150597fb56Smrg  compiler=$CC
59160597fb56Smrg  _LT_TAGVAR(compiler, $1)=$CC
59170597fb56Smrg  _LT_CC_BASENAME([$compiler])
5918b042e37fSmrg
59190597fb56Smrg  if test -n "$compiler"; then
59200597fb56Smrg    # We don't want -fno-exception when compiling C++ code, so set the
59210597fb56Smrg    # no_builtin_flag separately
59220597fb56Smrg    if test "$GXX" = yes; then
59230597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
59240597fb56Smrg    else
59250597fb56Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
59260597fb56Smrg    fi
5927bd23fbfaSmrg
59280597fb56Smrg    if test "$GXX" = yes; then
59290597fb56Smrg      # Set up default GNU C++ configuration
5930b042e37fSmrg
59310597fb56Smrg      LT_PATH_LD
5932b042e37fSmrg
59330597fb56Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
59340597fb56Smrg      # archiving commands below assume that GNU ld is being used.
59350597fb56Smrg      if test "$with_gnu_ld" = yes; then
59360597fb56Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
59370597fb56Smrg        _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'
5938b042e37fSmrg
59390597fb56Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
59400597fb56Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5941b042e37fSmrg
59420597fb56Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
59430597fb56Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
59440597fb56Smrg        #     investigate it a little bit more. (MM)
59450597fb56Smrg        wlarc='${wl}'
5946b042e37fSmrg
59470597fb56Smrg        # ancient GNU ld didn't support --whole-archive et. al.
59480597fb56Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
59490597fb56Smrg	  $GREP 'no-whole-archive' > /dev/null; then
59500597fb56Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
59510597fb56Smrg        else
59520597fb56Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
59530597fb56Smrg        fi
59548c4a8e55Smrg      else
59550597fb56Smrg        with_gnu_ld=no
59560597fb56Smrg        wlarc=
59570597fb56Smrg
59580597fb56Smrg        # A generic and very simple default shared library creation
59590597fb56Smrg        # command for GNU C++ for the case where it uses the native
59600597fb56Smrg        # linker, instead of GNU ld.  If possible, this setting should
59610597fb56Smrg        # overridden to take advantage of the native linker features on
59620597fb56Smrg        # the platform it is being used on.
59630597fb56Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
59648c4a8e55Smrg      fi
59650597fb56Smrg
59660597fb56Smrg      # Commands to make compiler produce verbose output that lists
59670597fb56Smrg      # what "hidden" libraries, object files and flags are used when
59680597fb56Smrg      # linking a shared library.
59690597fb56Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
59700597fb56Smrg
59718c4a8e55Smrg    else
59720597fb56Smrg      GXX=no
59730597fb56Smrg      with_gnu_ld=no
59740597fb56Smrg      wlarc=
59758c4a8e55Smrg    fi
5976b042e37fSmrg
59770597fb56Smrg    # PORTME: fill in a description of your system's C++ link characteristics
59780597fb56Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
59790597fb56Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
59800597fb56Smrg    case $host_os in
59810597fb56Smrg      aix3*)
59820597fb56Smrg        # FIXME: insert proper C++ library support
59830597fb56Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
59840597fb56Smrg        ;;
59850597fb56Smrg      aix[[4-9]]*)
59860597fb56Smrg        if test "$host_cpu" = ia64; then
59870597fb56Smrg          # On IA64, the linker does run time linking by default, so we don't
59880597fb56Smrg          # have to do anything special.
59890597fb56Smrg          aix_use_runtimelinking=no
59900597fb56Smrg          exp_sym_flag='-Bexport'
59910597fb56Smrg          no_entry_flag=""
59920597fb56Smrg        else
59930597fb56Smrg          aix_use_runtimelinking=no
5994bd23fbfaSmrg
59950597fb56Smrg          # Test if we are trying to use run time linking or normal
59960597fb56Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
59970597fb56Smrg          # need to do runtime linking.
59980597fb56Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
59990597fb56Smrg	    for ld_flag in $LDFLAGS; do
60000597fb56Smrg	      case $ld_flag in
60010597fb56Smrg	      *-brtl*)
60020597fb56Smrg	        aix_use_runtimelinking=yes
60030597fb56Smrg	        break
60040597fb56Smrg	        ;;
60050597fb56Smrg	      esac
60060597fb56Smrg	    done
60070597fb56Smrg	    ;;
60080597fb56Smrg          esac
6009b042e37fSmrg
60100597fb56Smrg          exp_sym_flag='-bexport'
60110597fb56Smrg          no_entry_flag='-bnoentry'
60120597fb56Smrg        fi
60138c4a8e55Smrg
60140597fb56Smrg        # When large executables or shared objects are built, AIX ld can
60150597fb56Smrg        # have problems creating the table of contents.  If linking a library
60160597fb56Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
60170597fb56Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
60180597fb56Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
60198c4a8e55Smrg
60200597fb56Smrg        _LT_TAGVAR(archive_cmds, $1)=''
60210597fb56Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
60220597fb56Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
60230597fb56Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
60240597fb56Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
60250597fb56Smrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6026b042e37fSmrg
60270597fb56Smrg        if test "$GXX" = yes; then
60280597fb56Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
60290597fb56Smrg          # We only want to do this on AIX 4.2 and lower, the check
60300597fb56Smrg          # below for broken collect2 doesn't work under 4.3+
60310597fb56Smrg	  collect2name=`${CC} -print-prog-name=collect2`
60320597fb56Smrg	  if test -f "$collect2name" &&
60330597fb56Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
60340597fb56Smrg	  then
60350597fb56Smrg	    # We have reworked collect2
60360597fb56Smrg	    :
60370597fb56Smrg	  else
60380597fb56Smrg	    # We have old collect2
60390597fb56Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
60400597fb56Smrg	    # It fails to find uninstalled libraries when the uninstalled
60410597fb56Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
60420597fb56Smrg	    # to unsupported forces relinking
60430597fb56Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
60440597fb56Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
60450597fb56Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
60460597fb56Smrg	  fi
60470597fb56Smrg          esac
60480597fb56Smrg          shared_flag='-shared'
60490597fb56Smrg	  if test "$aix_use_runtimelinking" = yes; then
60500597fb56Smrg	    shared_flag="$shared_flag "'${wl}-G'
60510597fb56Smrg	  fi
60520597fb56Smrg        else
60530597fb56Smrg          # not using gcc
60540597fb56Smrg          if test "$host_cpu" = ia64; then
60550597fb56Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
60560597fb56Smrg	  # chokes on -Wl,-G. The following line is correct:
60570597fb56Smrg	  shared_flag='-G'
60580597fb56Smrg          else
60590597fb56Smrg	    if test "$aix_use_runtimelinking" = yes; then
60600597fb56Smrg	      shared_flag='${wl}-G'
60610597fb56Smrg	    else
60620597fb56Smrg	      shared_flag='${wl}-bM:SRE'
60630597fb56Smrg	    fi
60640597fb56Smrg          fi
60650597fb56Smrg        fi
60668c4a8e55Smrg
60670597fb56Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
60680597fb56Smrg        # It seems that -bexpall does not export symbols beginning with
60690597fb56Smrg        # underscore (_), so it is better to generate a list of symbols to
60700597fb56Smrg	# export.
60710597fb56Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
60720597fb56Smrg        if test "$aix_use_runtimelinking" = yes; then
60730597fb56Smrg          # Warning - without using the other runtime loading flags (-brtl),
60740597fb56Smrg          # -berok will link without error, but may produce a broken library.
60750597fb56Smrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
60760597fb56Smrg          # Determine the default libpath from the value encoded in an empty
60770597fb56Smrg          # executable.
60780597fb56Smrg          _LT_SYS_MODULE_PATH_AIX([$1])
60790597fb56Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
60800597fb56Smrg
60810597fb56Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
60820597fb56Smrg        else
60830597fb56Smrg          if test "$host_cpu" = ia64; then
60840597fb56Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
60850597fb56Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
60860597fb56Smrg	    _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"
60870597fb56Smrg          else
60880597fb56Smrg	    # Determine the default libpath from the value encoded in an
60890597fb56Smrg	    # empty executable.
60900597fb56Smrg	    _LT_SYS_MODULE_PATH_AIX([$1])
60910597fb56Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
60920597fb56Smrg	    # Warning - without using the other run time loading flags,
60930597fb56Smrg	    # -berok will link without error, but may produce a broken library.
60940597fb56Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
60950597fb56Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
60960597fb56Smrg	    if test "$with_gnu_ld" = yes; then
60970597fb56Smrg	      # We only use this code for GNU lds that support --whole-archive.
60980597fb56Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
60990597fb56Smrg	    else
61000597fb56Smrg	      # Exported symbols can be pulled into shared objects from archives
61010597fb56Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
61020597fb56Smrg	    fi
61030597fb56Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
61040597fb56Smrg	    # This is similar to how AIX traditionally builds its shared
61050597fb56Smrg	    # libraries.
61060597fb56Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
61070597fb56Smrg          fi
61080597fb56Smrg        fi
61098c4a8e55Smrg        ;;
6110b042e37fSmrg
61110597fb56Smrg      beos*)
61120597fb56Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
61130597fb56Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
61140597fb56Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
61150597fb56Smrg	  # support --undefined.  This deserves some investigation.  FIXME
61160597fb56Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
61178c4a8e55Smrg	else
61180597fb56Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
61198c4a8e55Smrg	fi
61208c4a8e55Smrg	;;
61210597fb56Smrg
61228c4a8e55Smrg      chorus*)
61230597fb56Smrg        case $cc_basename in
61240597fb56Smrg          *)
61250597fb56Smrg	  # FIXME: insert proper C++ library support
61260597fb56Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
61270597fb56Smrg	  ;;
61280597fb56Smrg        esac
61290597fb56Smrg        ;;
61300597fb56Smrg
61310597fb56Smrg      cygwin* | mingw* | pw32* | cegcc*)
61320597fb56Smrg	case $GXX,$cc_basename in
61330597fb56Smrg	,cl* | no,cl*)
61340597fb56Smrg	  # Native MSVC
61350597fb56Smrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
61360597fb56Smrg	  # no search path for DLLs.
61370597fb56Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
61380597fb56Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
61390597fb56Smrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
61400597fb56Smrg	  _LT_TAGVAR(file_list_spec, $1)='@'
61410597fb56Smrg	  # Tell ltmain to make .lib files, not .a files.
61420597fb56Smrg	  libext=lib
61430597fb56Smrg	  # Tell ltmain to make .dll files, not .so files.
61440597fb56Smrg	  shrext_cmds=".dll"
61450597fb56Smrg	  # FIXME: Setting linknames here is a bad hack.
61460597fb56Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
61470597fb56Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
61480597fb56Smrg	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
61490597fb56Smrg	    else
61500597fb56Smrg	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
61510597fb56Smrg	    fi~
61520597fb56Smrg	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
61530597fb56Smrg	    linknames='
61540597fb56Smrg	  # The linker will not automatically build a static lib if we build a DLL.
61550597fb56Smrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
61560597fb56Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
61570597fb56Smrg	  # Don't use ranlib
61580597fb56Smrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
61590597fb56Smrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
61600597fb56Smrg	    lt_tool_outputfile="@TOOL_OUTPUT@"~
61610597fb56Smrg	    case $lt_outputfile in
61620597fb56Smrg	      *.exe|*.EXE) ;;
61630597fb56Smrg	      *)
61640597fb56Smrg		lt_outputfile="$lt_outputfile.exe"
61650597fb56Smrg		lt_tool_outputfile="$lt_tool_outputfile.exe"
61660597fb56Smrg		;;
61670597fb56Smrg	    esac~
61680597fb56Smrg	    func_to_tool_file "$lt_outputfile"~
61690597fb56Smrg	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
61700597fb56Smrg	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
61710597fb56Smrg	      $RM "$lt_outputfile.manifest";
61720597fb56Smrg	    fi'
61730597fb56Smrg	  ;;
61740597fb56Smrg	*)
61750597fb56Smrg	  # g++
61760597fb56Smrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
61770597fb56Smrg	  # as there is no search path for DLLs.
61780597fb56Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
61790597fb56Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
61800597fb56Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
61810597fb56Smrg	  _LT_TAGVAR(always_export_symbols, $1)=no
61820597fb56Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
61830597fb56Smrg
61840597fb56Smrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
61850597fb56Smrg	    _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'
61860597fb56Smrg	    # If the export-symbols file already is a .def file (1st line
61870597fb56Smrg	    # is EXPORTS), use it as is; otherwise, prepend...
61880597fb56Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
61890597fb56Smrg	      cp $export_symbols $output_objdir/$soname.def;
61900597fb56Smrg	    else
61910597fb56Smrg	      echo EXPORTS > $output_objdir/$soname.def;
61920597fb56Smrg	      cat $export_symbols >> $output_objdir/$soname.def;
61930597fb56Smrg	    fi~
61940597fb56Smrg	    $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'
61950597fb56Smrg	  else
61960597fb56Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
61970597fb56Smrg	  fi
61988c4a8e55Smrg	  ;;
6199706b6b52Smrg	esac
62008c4a8e55Smrg	;;
62010597fb56Smrg      darwin* | rhapsody*)
62020597fb56Smrg        _LT_DARWIN_LINKER_FEATURES($1)
6203bd23fbfaSmrg	;;
62040597fb56Smrg
62058c4a8e55Smrg      dgux*)
62060597fb56Smrg        case $cc_basename in
62070597fb56Smrg          ec++*)
62080597fb56Smrg	    # FIXME: insert proper C++ library support
62090597fb56Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
62108c4a8e55Smrg	    ;;
62110597fb56Smrg          ghcx*)
62128c4a8e55Smrg	    # Green Hills C++ Compiler
62130597fb56Smrg	    # FIXME: insert proper C++ library support
62140597fb56Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
62158c4a8e55Smrg	    ;;
62160597fb56Smrg          *)
62170597fb56Smrg	    # FIXME: insert proper C++ library support
62180597fb56Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
62198c4a8e55Smrg	    ;;
62200597fb56Smrg        esac
62210597fb56Smrg        ;;
62220597fb56Smrg
62230597fb56Smrg      freebsd2.*)
62240597fb56Smrg        # C++ shared libraries reported to be fairly broken before
62250597fb56Smrg	# switch to ELF
62260597fb56Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
62270597fb56Smrg        ;;
62280597fb56Smrg
62290597fb56Smrg      freebsd-elf*)
62300597fb56Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
62310597fb56Smrg        ;;
62320597fb56Smrg
62338c4a8e55Smrg      freebsd* | dragonfly*)
62340597fb56Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
62350597fb56Smrg        # conventions
62360597fb56Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
62370597fb56Smrg        ;;
62380597fb56Smrg
62390597fb56Smrg      gnu*)
62400597fb56Smrg        ;;
62410597fb56Smrg
62420597fb56Smrg      haiku*)
62430597fb56Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
62440597fb56Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
62450597fb56Smrg        ;;
62460597fb56Smrg
62470597fb56Smrg      hpux9*)
62480597fb56Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
62490597fb56Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
62500597fb56Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
62510597fb56Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
62520597fb56Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
62530597fb56Smrg				             # but as the default
62540597fb56Smrg				             # location of the library.
62550597fb56Smrg
62560597fb56Smrg        case $cc_basename in
62570597fb56Smrg          CC*)
62580597fb56Smrg            # FIXME: insert proper C++ library support
62590597fb56Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
62600597fb56Smrg            ;;
62610597fb56Smrg          aCC*)
62620597fb56Smrg            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
62630597fb56Smrg            # Commands to make compiler produce verbose output that lists
62640597fb56Smrg            # what "hidden" libraries, object files and flags are used when
62650597fb56Smrg            # linking a shared library.
62660597fb56Smrg            #
62670597fb56Smrg            # There doesn't appear to be a way to prevent this compiler from
62680597fb56Smrg            # explicitly linking system object files so we need to strip them
62690597fb56Smrg            # from the output so that they don't get included in the library
62700597fb56Smrg            # dependencies.
62710597fb56Smrg            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"'
62720597fb56Smrg            ;;
62730597fb56Smrg          *)
62740597fb56Smrg            if test "$GXX" = yes; then
62750597fb56Smrg              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
62760597fb56Smrg            else
62770597fb56Smrg              # FIXME: insert proper C++ library support
62780597fb56Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
62790597fb56Smrg            fi
62800597fb56Smrg            ;;
62810597fb56Smrg        esac
62820597fb56Smrg        ;;
62830597fb56Smrg
62840597fb56Smrg      hpux10*|hpux11*)
62850597fb56Smrg        if test $with_gnu_ld = no; then
62860597fb56Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
62870597fb56Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
62880597fb56Smrg
62890597fb56Smrg          case $host_cpu in
62900597fb56Smrg            hppa*64*|ia64*)
62910597fb56Smrg              ;;
62920597fb56Smrg            *)
62930597fb56Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
62940597fb56Smrg              ;;
62950597fb56Smrg          esac
62960597fb56Smrg        fi
62970597fb56Smrg        case $host_cpu in
62980597fb56Smrg          hppa*64*|ia64*)
62990597fb56Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
63000597fb56Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
63010597fb56Smrg            ;;
63020597fb56Smrg          *)
63030597fb56Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
63040597fb56Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
63050597fb56Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
63060597fb56Smrg					         # but as the default
63070597fb56Smrg					         # location of the library.
63080597fb56Smrg            ;;
63090597fb56Smrg        esac
63100597fb56Smrg
63110597fb56Smrg        case $cc_basename in
63120597fb56Smrg          CC*)
63130597fb56Smrg	    # FIXME: insert proper C++ library support
63140597fb56Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
63158c4a8e55Smrg	    ;;
63160597fb56Smrg          aCC*)
63178c4a8e55Smrg	    case $host_cpu in
63180597fb56Smrg	      hppa*64*)
63190597fb56Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
63200597fb56Smrg	        ;;
63210597fb56Smrg	      ia64*)
63220597fb56Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
63230597fb56Smrg	        ;;
63240597fb56Smrg	      *)
63250597fb56Smrg	        _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'
63260597fb56Smrg	        ;;
63278c4a8e55Smrg	    esac
63280597fb56Smrg	    # Commands to make compiler produce verbose output that lists
63290597fb56Smrg	    # what "hidden" libraries, object files and flags are used when
63300597fb56Smrg	    # linking a shared library.
63310597fb56Smrg	    #
63320597fb56Smrg	    # There doesn't appear to be a way to prevent this compiler from
63330597fb56Smrg	    # explicitly linking system object files so we need to strip them
63340597fb56Smrg	    # from the output so that they don't get included in the library
63350597fb56Smrg	    # dependencies.
63360597fb56Smrg	    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"'
63378c4a8e55Smrg	    ;;
63380597fb56Smrg          *)
63390597fb56Smrg	    if test "$GXX" = yes; then
63400597fb56Smrg	      if test $with_gnu_ld = no; then
63410597fb56Smrg	        case $host_cpu in
63420597fb56Smrg	          hppa*64*)
63430597fb56Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
63440597fb56Smrg	            ;;
63450597fb56Smrg	          ia64*)
63460597fb56Smrg	            _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'
63470597fb56Smrg	            ;;
63480597fb56Smrg	          *)
63490597fb56Smrg	            _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'
63500597fb56Smrg	            ;;
63510597fb56Smrg	        esac
63520597fb56Smrg	      fi
63530597fb56Smrg	    else
63540597fb56Smrg	      # FIXME: insert proper C++ library support
63550597fb56Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
63560597fb56Smrg	    fi
63578c4a8e55Smrg	    ;;
63580597fb56Smrg        esac
63590597fb56Smrg        ;;
63600597fb56Smrg
63610597fb56Smrg      interix[[3-9]]*)
63620597fb56Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
63630597fb56Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
63640597fb56Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
63650597fb56Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
63660597fb56Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
63670597fb56Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
63680597fb56Smrg	# default) and relocated if they conflict, which is a slow very memory
63690597fb56Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
63700597fb56Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
63710597fb56Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
63720597fb56Smrg	_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'
63730597fb56Smrg	_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'
6374706b6b52Smrg	;;
63750597fb56Smrg      irix5* | irix6*)
63760597fb56Smrg        case $cc_basename in
63770597fb56Smrg          CC*)
63780597fb56Smrg	    # SGI C++
63790597fb56Smrg	    _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'
63800597fb56Smrg
63810597fb56Smrg	    # Archives containing C++ object files must be created using
63820597fb56Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
63830597fb56Smrg	    # necessary to make sure instantiated templates are included
63840597fb56Smrg	    # in the archive.
63850597fb56Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
63868c4a8e55Smrg	    ;;
63870597fb56Smrg          *)
63880597fb56Smrg	    if test "$GXX" = yes; then
63890597fb56Smrg	      if test "$with_gnu_ld" = no; then
63900597fb56Smrg	        _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'
63910597fb56Smrg	      else
63920597fb56Smrg	        _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'
63930597fb56Smrg	      fi
63940597fb56Smrg	    fi
63950597fb56Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
63968c4a8e55Smrg	    ;;
63970597fb56Smrg        esac
63980597fb56Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
63990597fb56Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
64000597fb56Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
64010597fb56Smrg        ;;
64020597fb56Smrg
6403706b6b52Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
64040597fb56Smrg        case $cc_basename in
64050597fb56Smrg          KCC*)
64060597fb56Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
64070597fb56Smrg
64080597fb56Smrg	    # KCC will only create a shared library if the output file
64090597fb56Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
64100597fb56Smrg	    # to its proper name (with version) after linking.
64110597fb56Smrg	    _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'
64120597fb56Smrg	    _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'
64130597fb56Smrg	    # Commands to make compiler produce verbose output that lists
64140597fb56Smrg	    # what "hidden" libraries, object files and flags are used when
64150597fb56Smrg	    # linking a shared library.
64160597fb56Smrg	    #
64170597fb56Smrg	    # There doesn't appear to be a way to prevent this compiler from
64180597fb56Smrg	    # explicitly linking system object files so we need to strip them
64190597fb56Smrg	    # from the output so that they don't get included in the library
64200597fb56Smrg	    # dependencies.
64210597fb56Smrg	    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"'
64220597fb56Smrg
64230597fb56Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
64240597fb56Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
64250597fb56Smrg
64260597fb56Smrg	    # Archives containing C++ object files must be created using
64270597fb56Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
64280597fb56Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
6429706b6b52Smrg	    ;;
64300597fb56Smrg	  icpc* | ecpc* )
64310597fb56Smrg	    # Intel C++
64320597fb56Smrg	    with_gnu_ld=yes
64330597fb56Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
64340597fb56Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
64350597fb56Smrg	    # earlier do not add the objects themselves.
64360597fb56Smrg	    case `$CC -V 2>&1` in
64370597fb56Smrg	      *"Version 7."*)
64380597fb56Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
64390597fb56Smrg		_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'
64400597fb56Smrg		;;
64410597fb56Smrg	      *)  # Version 8.0 or newer
64420597fb56Smrg	        tmp_idyn=
64430597fb56Smrg	        case $host_cpu in
64440597fb56Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
64450597fb56Smrg		esac
64460597fb56Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
64470597fb56Smrg		_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'
64480597fb56Smrg		;;
64490597fb56Smrg	    esac
64500597fb56Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
64510597fb56Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
64520597fb56Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
64530597fb56Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
64548c4a8e55Smrg	    ;;
64550597fb56Smrg          pgCC* | pgcpp*)
64560597fb56Smrg            # Portland Group C++ compiler
64570597fb56Smrg	    case `$CC -V` in
64580597fb56Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
64590597fb56Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
64600597fb56Smrg		rm -rf $tpldir~
64610597fb56Smrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
64620597fb56Smrg		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
64630597fb56Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
64640597fb56Smrg		rm -rf $tpldir~
64650597fb56Smrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
64660597fb56Smrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
64670597fb56Smrg		$RANLIB $oldlib'
64680597fb56Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
64690597fb56Smrg		rm -rf $tpldir~
64700597fb56Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
64710597fb56Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
64720597fb56Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
64730597fb56Smrg		rm -rf $tpldir~
64740597fb56Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
64750597fb56Smrg		$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'
64760597fb56Smrg	      ;;
64770597fb56Smrg	    *) # Version 6 and above use weak symbols
64780597fb56Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
64790597fb56Smrg	      _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'
64800597fb56Smrg	      ;;
64810597fb56Smrg	    esac
64820597fb56Smrg
64830597fb56Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
64840597fb56Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
64850597fb56Smrg	    _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'
64860597fb56Smrg            ;;
64878c4a8e55Smrg	  cxx*)
64888c4a8e55Smrg	    # Compaq C++
64890597fb56Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
64900597fb56Smrg	    _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'
64910597fb56Smrg
64920597fb56Smrg	    runpath_var=LD_RUN_PATH
64930597fb56Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
64940597fb56Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
64950597fb56Smrg
64960597fb56Smrg	    # Commands to make compiler produce verbose output that lists
64970597fb56Smrg	    # what "hidden" libraries, object files and flags are used when
64980597fb56Smrg	    # linking a shared library.
64990597fb56Smrg	    #
65000597fb56Smrg	    # There doesn't appear to be a way to prevent this compiler from
65010597fb56Smrg	    # explicitly linking system object files so we need to strip them
65020597fb56Smrg	    # from the output so that they don't get included in the library
65030597fb56Smrg	    # dependencies.
65040597fb56Smrg	    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'
65058c4a8e55Smrg	    ;;
65060597fb56Smrg	  xl* | mpixl* | bgxl*)
65070597fb56Smrg	    # IBM XL 8.0 on PPC, with GNU ld
65080597fb56Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
65090597fb56Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
65100597fb56Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
65110597fb56Smrg	    if test "x$supports_anon_versioning" = xyes; then
65120597fb56Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
65130597fb56Smrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
65140597fb56Smrg		echo "local: *; };" >> $output_objdir/$libname.ver~
65150597fb56Smrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
65160597fb56Smrg	    fi
65178c4a8e55Smrg	    ;;
65188c4a8e55Smrg	  *)
65198c4a8e55Smrg	    case `$CC -V 2>&1 | sed 5q` in
65208c4a8e55Smrg	    *Sun\ C*)
65218c4a8e55Smrg	      # Sun C++ 5.9
65220597fb56Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
65230597fb56Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
65240597fb56Smrg	      _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'
65250597fb56Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
65260597fb56Smrg	      _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'
65270597fb56Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
65280597fb56Smrg
65290597fb56Smrg	      # Not sure whether something based on
65300597fb56Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
65310597fb56Smrg	      # would be better.
65320597fb56Smrg	      output_verbose_link_cmd='func_echo_all'
65330597fb56Smrg
65340597fb56Smrg	      # Archives containing C++ object files must be created using
65350597fb56Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
65360597fb56Smrg	      # necessary to make sure instantiated templates are included
65370597fb56Smrg	      # in the archive.
65380597fb56Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
65398c4a8e55Smrg	      ;;
65408c4a8e55Smrg	    esac
65418c4a8e55Smrg	    ;;
65428c4a8e55Smrg	esac
65438c4a8e55Smrg	;;
65440597fb56Smrg
65458c4a8e55Smrg      lynxos*)
65460597fb56Smrg        # FIXME: insert proper C++ library support
65470597fb56Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
65488c4a8e55Smrg	;;
65490597fb56Smrg
65508c4a8e55Smrg      m88k*)
65510597fb56Smrg        # FIXME: insert proper C++ library support
65520597fb56Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
65538c4a8e55Smrg	;;
65540597fb56Smrg
65558c4a8e55Smrg      mvs*)
65560597fb56Smrg        case $cc_basename in
65570597fb56Smrg          cxx*)
65580597fb56Smrg	    # FIXME: insert proper C++ library support
65590597fb56Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
65608c4a8e55Smrg	    ;;
65618c4a8e55Smrg	  *)
65620597fb56Smrg	    # FIXME: insert proper C++ library support
65630597fb56Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
65648c4a8e55Smrg	    ;;
65658c4a8e55Smrg	esac
65668c4a8e55Smrg	;;
65670597fb56Smrg
65688c4a8e55Smrg      netbsd*)
65690597fb56Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
65700597fb56Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
65710597fb56Smrg	  wlarc=
65720597fb56Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
65730597fb56Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
65740597fb56Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65750597fb56Smrg	fi
65760597fb56Smrg	# Workaround some broken pre-1.5 toolchains
65770597fb56Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
65788c4a8e55Smrg	;;
65790597fb56Smrg
65800597fb56Smrg      *nto* | *qnx*)
65810597fb56Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
6582706b6b52Smrg	;;
65830597fb56Smrg
65840597fb56Smrg      openbsd2*)
65850597fb56Smrg        # C++ shared libraries are fairly broken
65860597fb56Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
6587706b6b52Smrg	;;
65880597fb56Smrg
65890597fb56Smrg      openbsd*)
65900597fb56Smrg	if test -f /usr/libexec/ld.so; then
65910597fb56Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
65920597fb56Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
65930597fb56Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
65940597fb56Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
65950597fb56Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
65960597fb56Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
65970597fb56Smrg	    _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'
65980597fb56Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
65990597fb56Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
66000597fb56Smrg	  fi
66010597fb56Smrg	  output_verbose_link_cmd=func_echo_all
66020597fb56Smrg	else
66030597fb56Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
66040597fb56Smrg	fi
6605706b6b52Smrg	;;
6606706b6b52Smrg
66070597fb56Smrg      osf3* | osf4* | osf5*)
66080597fb56Smrg        case $cc_basename in
66090597fb56Smrg          KCC*)
66100597fb56Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6611706b6b52Smrg
66120597fb56Smrg	    # KCC will only create a shared library if the output file
66130597fb56Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
66140597fb56Smrg	    # to its proper name (with version) after linking.
66150597fb56Smrg	    _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'
6616706b6b52Smrg
66170597fb56Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
66180597fb56Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
66190597fb56Smrg
66200597fb56Smrg	    # Archives containing C++ object files must be created using
66210597fb56Smrg	    # the KAI C++ compiler.
66220597fb56Smrg	    case $host in
66230597fb56Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
66240597fb56Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
66250597fb56Smrg	    esac
66260597fb56Smrg	    ;;
66270597fb56Smrg          RCC*)
66280597fb56Smrg	    # Rational C++ 2.4.1
66290597fb56Smrg	    # FIXME: insert proper C++ library support
66300597fb56Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
66310597fb56Smrg	    ;;
66320597fb56Smrg          cxx*)
66330597fb56Smrg	    case $host in
66340597fb56Smrg	      osf3*)
66350597fb56Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
66360597fb56Smrg	        _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'
66370597fb56Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
66380597fb56Smrg		;;
66390597fb56Smrg	      *)
66400597fb56Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
66410597fb56Smrg	        _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'
66420597fb56Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
66430597fb56Smrg	          echo "-hidden">> $lib.exp~
66440597fb56Smrg	          $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~
66450597fb56Smrg	          $RM $lib.exp'
66460597fb56Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
66470597fb56Smrg		;;
66480597fb56Smrg	    esac
6649706b6b52Smrg
66500597fb56Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6651706b6b52Smrg
66520597fb56Smrg	    # Commands to make compiler produce verbose output that lists
66530597fb56Smrg	    # what "hidden" libraries, object files and flags are used when
66540597fb56Smrg	    # linking a shared library.
66550597fb56Smrg	    #
66560597fb56Smrg	    # There doesn't appear to be a way to prevent this compiler from
66570597fb56Smrg	    # explicitly linking system object files so we need to strip them
66580597fb56Smrg	    # from the output so that they don't get included in the library
66590597fb56Smrg	    # dependencies.
66600597fb56Smrg	    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"'
66610597fb56Smrg	    ;;
66620597fb56Smrg	  *)
66630597fb56Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
66640597fb56Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
66650597fb56Smrg	      case $host in
66660597fb56Smrg	        osf3*)
66670597fb56Smrg	          _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'
66680597fb56Smrg		  ;;
66690597fb56Smrg	        *)
66700597fb56Smrg	          _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'
66710597fb56Smrg		  ;;
66720597fb56Smrg	      esac
6673706b6b52Smrg
66740597fb56Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
66750597fb56Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6676706b6b52Smrg
66770597fb56Smrg	      # Commands to make compiler produce verbose output that lists
66780597fb56Smrg	      # what "hidden" libraries, object files and flags are used when
66790597fb56Smrg	      # linking a shared library.
66800597fb56Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6681b042e37fSmrg
66820597fb56Smrg	    else
66830597fb56Smrg	      # FIXME: insert proper C++ library support
66840597fb56Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
66850597fb56Smrg	    fi
66860597fb56Smrg	    ;;
66870597fb56Smrg        esac
66880597fb56Smrg        ;;
66898c4a8e55Smrg
66900597fb56Smrg      psos*)
66910597fb56Smrg        # FIXME: insert proper C++ library support
66920597fb56Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
66930597fb56Smrg        ;;
6694b042e37fSmrg
66950597fb56Smrg      sunos4*)
66960597fb56Smrg        case $cc_basename in
66970597fb56Smrg          CC*)
66980597fb56Smrg	    # Sun C++ 4.x
66990597fb56Smrg	    # FIXME: insert proper C++ library support
67000597fb56Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67010597fb56Smrg	    ;;
67020597fb56Smrg          lcc*)
67030597fb56Smrg	    # Lucid
67040597fb56Smrg	    # FIXME: insert proper C++ library support
67050597fb56Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67060597fb56Smrg	    ;;
67070597fb56Smrg          *)
67080597fb56Smrg	    # FIXME: insert proper C++ library support
67090597fb56Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67100597fb56Smrg	    ;;
67110597fb56Smrg        esac
67120597fb56Smrg        ;;
6713b042e37fSmrg
67140597fb56Smrg      solaris*)
67150597fb56Smrg        case $cc_basename in
67160597fb56Smrg          CC* | sunCC*)
67170597fb56Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
67180597fb56Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
67190597fb56Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
67200597fb56Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
67210597fb56Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
67220597fb56Smrg	      $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'
6723b042e37fSmrg
67240597fb56Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
67250597fb56Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
67260597fb56Smrg	    case $host_os in
67270597fb56Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
67280597fb56Smrg	      *)
67290597fb56Smrg		# The compiler driver will combine and reorder linker options,
67300597fb56Smrg		# but understands `-z linker_flag'.
67310597fb56Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
67320597fb56Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
67330597fb56Smrg	        ;;
67340597fb56Smrg	    esac
67350597fb56Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
67368c4a8e55Smrg
67370597fb56Smrg	    output_verbose_link_cmd='func_echo_all'
67388c4a8e55Smrg
67390597fb56Smrg	    # Archives containing C++ object files must be created using
67400597fb56Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
67410597fb56Smrg	    # necessary to make sure instantiated templates are included
67420597fb56Smrg	    # in the archive.
67430597fb56Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
67440597fb56Smrg	    ;;
67450597fb56Smrg          gcx*)
67460597fb56Smrg	    # Green Hills C++ Compiler
67470597fb56Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
67488c4a8e55Smrg
67490597fb56Smrg	    # The C++ compiler must be used to create the archive.
67500597fb56Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
67510597fb56Smrg	    ;;
67520597fb56Smrg          *)
67530597fb56Smrg	    # GNU C++ compiler with Solaris linker
67540597fb56Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
67550597fb56Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
67560597fb56Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
67570597fb56Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
67580597fb56Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
67590597fb56Smrg		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6760b042e37fSmrg
67610597fb56Smrg	        # Commands to make compiler produce verbose output that lists
67620597fb56Smrg	        # what "hidden" libraries, object files and flags are used when
67630597fb56Smrg	        # linking a shared library.
67640597fb56Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
67650597fb56Smrg	      else
67660597fb56Smrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
67670597fb56Smrg	        # platform.
67680597fb56Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
67690597fb56Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
67700597fb56Smrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6771b042e37fSmrg
67720597fb56Smrg	        # Commands to make compiler produce verbose output that lists
67730597fb56Smrg	        # what "hidden" libraries, object files and flags are used when
67740597fb56Smrg	        # linking a shared library.
67750597fb56Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
67760597fb56Smrg	      fi
67770597fb56Smrg
67780597fb56Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
67790597fb56Smrg	      case $host_os in
67800597fb56Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
67810597fb56Smrg		*)
67820597fb56Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
67830597fb56Smrg		  ;;
67840597fb56Smrg	      esac
67850597fb56Smrg	    fi
67860597fb56Smrg	    ;;
67870597fb56Smrg        esac
6788706b6b52Smrg        ;;
67890597fb56Smrg
67900597fb56Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
67910597fb56Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
67920597fb56Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
67930597fb56Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
67940597fb56Smrg      runpath_var='LD_RUN_PATH'
67950597fb56Smrg
67960597fb56Smrg      case $cc_basename in
67970597fb56Smrg        CC*)
67980597fb56Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
67990597fb56Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68008c4a8e55Smrg	  ;;
68010597fb56Smrg	*)
68020597fb56Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68030597fb56Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68048c4a8e55Smrg	  ;;
68058c4a8e55Smrg      esac
68068c4a8e55Smrg      ;;
6807b042e37fSmrg
68080597fb56Smrg      sysv5* | sco3.2v5* | sco5v6*)
68090597fb56Smrg	# Note: We can NOT use -z defs as we might desire, because we do not
68100597fb56Smrg	# link with -lc, and that would cause any symbols used from libc to
68110597fb56Smrg	# always be unresolved, which means just about no library would
68120597fb56Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
68130597fb56Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
68140597fb56Smrg	# as -z defs.
68150597fb56Smrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
68160597fb56Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
68170597fb56Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
68180597fb56Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
68190597fb56Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
68200597fb56Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
68210597fb56Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
68220597fb56Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
68230597fb56Smrg	runpath_var='LD_RUN_PATH'
6824b042e37fSmrg
68250597fb56Smrg	case $cc_basename in
68260597fb56Smrg          CC*)
68270597fb56Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68280597fb56Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68290597fb56Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
68300597fb56Smrg	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
68310597fb56Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
68320597fb56Smrg	      '"$_LT_TAGVAR(reload_cmds, $1)"
68330597fb56Smrg	    ;;
68340597fb56Smrg	  *)
68350597fb56Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68360597fb56Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68370597fb56Smrg	    ;;
68380597fb56Smrg	esac
6839706b6b52Smrg      ;;
6840b042e37fSmrg
68410597fb56Smrg      tandem*)
68420597fb56Smrg        case $cc_basename in
68430597fb56Smrg          NCC*)
68440597fb56Smrg	    # NonStop-UX NCC 3.20
68450597fb56Smrg	    # FIXME: insert proper C++ library support
68460597fb56Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
68470597fb56Smrg	    ;;
68480597fb56Smrg          *)
68490597fb56Smrg	    # FIXME: insert proper C++ library support
68500597fb56Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
68510597fb56Smrg	    ;;
68520597fb56Smrg        esac
68530597fb56Smrg        ;;
68548c4a8e55Smrg
68550597fb56Smrg      vxworks*)
68560597fb56Smrg        # FIXME: insert proper C++ library support
68570597fb56Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
68580597fb56Smrg        ;;
68598c4a8e55Smrg
6860706b6b52Smrg      *)
68610597fb56Smrg        # FIXME: insert proper C++ library support
68620597fb56Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
68630597fb56Smrg        ;;
68640597fb56Smrg    esac
68650597fb56Smrg
68660597fb56Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
68670597fb56Smrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
68680597fb56Smrg
68690597fb56Smrg    _LT_TAGVAR(GCC, $1)="$GXX"
68700597fb56Smrg    _LT_TAGVAR(LD, $1)="$LD"
68710597fb56Smrg
68720597fb56Smrg    ## CAVEAT EMPTOR:
68730597fb56Smrg    ## There is no encapsulation within the following macros, do not change
68740597fb56Smrg    ## the running order or otherwise move them around unless you know exactly
68750597fb56Smrg    ## what you are doing...
68760597fb56Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
68770597fb56Smrg    _LT_COMPILER_PIC($1)
68780597fb56Smrg    _LT_COMPILER_C_O($1)
68790597fb56Smrg    _LT_COMPILER_FILE_LOCKS($1)
68800597fb56Smrg    _LT_LINKER_SHLIBS($1)
68810597fb56Smrg    _LT_SYS_DYNAMIC_LINKER($1)
68820597fb56Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
68830597fb56Smrg
68840597fb56Smrg    _LT_CONFIG($1)
68850597fb56Smrg  fi # test -n "$compiler"
68860597fb56Smrg
68870597fb56Smrg  CC=$lt_save_CC
68880597fb56Smrg  CFLAGS=$lt_save_CFLAGS
68890597fb56Smrg  LDCXX=$LD
68900597fb56Smrg  LD=$lt_save_LD
68910597fb56Smrg  GCC=$lt_save_GCC
68920597fb56Smrg  with_gnu_ld=$lt_save_with_gnu_ld
68930597fb56Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
68940597fb56Smrg  lt_cv_path_LD=$lt_save_path_LD
68950597fb56Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
68960597fb56Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
68970597fb56Smrgfi # test "$_lt_caught_CXX_error" != yes
68980597fb56Smrg
68990597fb56SmrgAC_LANG_POP
69000597fb56Smrg])# _LT_LANG_CXX_CONFIG
69010597fb56Smrg
69020597fb56Smrg
69030597fb56Smrg# _LT_FUNC_STRIPNAME_CNF
69040597fb56Smrg# ----------------------
69050597fb56Smrg# func_stripname_cnf prefix suffix name
69060597fb56Smrg# strip PREFIX and SUFFIX off of NAME.
69070597fb56Smrg# PREFIX and SUFFIX must not contain globbing or regex special
69080597fb56Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
69090597fb56Smrg# dot (in which case that matches only a dot).
69100597fb56Smrg#
69110597fb56Smrg# This function is identical to the (non-XSI) version of func_stripname,
69120597fb56Smrg# except this one can be used by m4 code that may be executed by configure,
69130597fb56Smrg# rather than the libtool script.
69140597fb56Smrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
69150597fb56SmrgAC_REQUIRE([_LT_DECL_SED])
69160597fb56SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
69170597fb56Smrgfunc_stripname_cnf ()
69180597fb56Smrg{
69190597fb56Smrg  case ${2} in
69200597fb56Smrg  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
69210597fb56Smrg  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
69220597fb56Smrg  esac
69230597fb56Smrg} # func_stripname_cnf
69240597fb56Smrg])# _LT_FUNC_STRIPNAME_CNF
69250597fb56Smrg
69260597fb56Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
69270597fb56Smrg# ---------------------------------
69280597fb56Smrg# Figure out "hidden" library dependencies from verbose
69290597fb56Smrg# compiler output when linking a shared library.
69300597fb56Smrg# Parse the compiler output and extract the necessary
69310597fb56Smrg# objects, libraries and library flags.
69320597fb56Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
69330597fb56Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
69340597fb56SmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
69350597fb56Smrg# Dependencies to place before and after the object being linked:
69360597fb56Smrg_LT_TAGVAR(predep_objects, $1)=
69370597fb56Smrg_LT_TAGVAR(postdep_objects, $1)=
69380597fb56Smrg_LT_TAGVAR(predeps, $1)=
69390597fb56Smrg_LT_TAGVAR(postdeps, $1)=
69400597fb56Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
69410597fb56Smrg
69420597fb56Smrgdnl we can't use the lt_simple_compile_test_code here,
69430597fb56Smrgdnl because it contains code intended for an executable,
69440597fb56Smrgdnl not a library.  It's possible we should let each
69450597fb56Smrgdnl tag define a new lt_????_link_test_code variable,
69460597fb56Smrgdnl but it's only used here...
69470597fb56Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
69480597fb56Smrgint a;
69490597fb56Smrgvoid foo (void) { a = 0; }
69500597fb56Smrg_LT_EOF
69510597fb56Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
69520597fb56Smrgclass Foo
69530597fb56Smrg{
69540597fb56Smrgpublic:
69550597fb56Smrg  Foo (void) { a = 0; }
69560597fb56Smrgprivate:
69570597fb56Smrg  int a;
69580597fb56Smrg};
69590597fb56Smrg_LT_EOF
69600597fb56Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
69610597fb56Smrg      subroutine foo
69620597fb56Smrg      implicit none
69630597fb56Smrg      integer*4 a
69640597fb56Smrg      a=0
69650597fb56Smrg      return
69660597fb56Smrg      end
69670597fb56Smrg_LT_EOF
69680597fb56Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
69690597fb56Smrg      subroutine foo
69700597fb56Smrg      implicit none
69710597fb56Smrg      integer a
69720597fb56Smrg      a=0
69730597fb56Smrg      return
69740597fb56Smrg      end
69750597fb56Smrg_LT_EOF
69760597fb56Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
69770597fb56Smrgpublic class foo {
69780597fb56Smrg  private int a;
69790597fb56Smrg  public void bar (void) {
69800597fb56Smrg    a = 0;
69810597fb56Smrg  }
69820597fb56Smrg};
69830597fb56Smrg_LT_EOF
69840597fb56Smrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
69850597fb56Smrgpackage foo
69860597fb56Smrgfunc foo() {
69870597fb56Smrg}
69880597fb56Smrg_LT_EOF
69890597fb56Smrg])
69900597fb56Smrg
69910597fb56Smrg_lt_libdeps_save_CFLAGS=$CFLAGS
69920597fb56Smrgcase "$CC $CFLAGS " in #(
69930597fb56Smrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
69940597fb56Smrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
69950597fb56Smrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
69960597fb56Smrgesac
69970597fb56Smrg
69980597fb56Smrgdnl Parse the compiler output and extract the necessary
69990597fb56Smrgdnl objects, libraries and library flags.
70000597fb56Smrgif AC_TRY_EVAL(ac_compile); then
70010597fb56Smrg  # Parse the compiler output and extract the necessary
70020597fb56Smrg  # objects, libraries and library flags.
70038c4a8e55Smrg
70040597fb56Smrg  # Sentinel used to keep track of whether or not we are before
70050597fb56Smrg  # the conftest object file.
70060597fb56Smrg  pre_test_object_deps_done=no
70078c4a8e55Smrg
70080597fb56Smrg  for p in `eval "$output_verbose_link_cmd"`; do
70090597fb56Smrg    case ${prev}${p} in
7010b042e37fSmrg
70110597fb56Smrg    -L* | -R* | -l*)
70120597fb56Smrg       # Some compilers place space between "-{L,R}" and the path.
70130597fb56Smrg       # Remove the space.
70140597fb56Smrg       if test $p = "-L" ||
70150597fb56Smrg          test $p = "-R"; then
70160597fb56Smrg	 prev=$p
70170597fb56Smrg	 continue
70180597fb56Smrg       fi
7019b042e37fSmrg
70200597fb56Smrg       # Expand the sysroot to ease extracting the directories later.
70210597fb56Smrg       if test -z "$prev"; then
70220597fb56Smrg         case $p in
70230597fb56Smrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
70240597fb56Smrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
70250597fb56Smrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
70260597fb56Smrg         esac
70270597fb56Smrg       fi
70280597fb56Smrg       case $p in
70290597fb56Smrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
70300597fb56Smrg       esac
70310597fb56Smrg       if test "$pre_test_object_deps_done" = no; then
70320597fb56Smrg	 case ${prev} in
70330597fb56Smrg	 -L | -R)
70340597fb56Smrg	   # Internal compiler library paths should come after those
70350597fb56Smrg	   # provided the user.  The postdeps already come after the
70360597fb56Smrg	   # user supplied libs so there is no need to process them.
70370597fb56Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
70380597fb56Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
70390597fb56Smrg	   else
70400597fb56Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
70410597fb56Smrg	   fi
70420597fb56Smrg	   ;;
70430597fb56Smrg	 # The "-l" case would never come before the object being
70440597fb56Smrg	 # linked, so don't bother handling this case.
70450597fb56Smrg	 esac
70460597fb56Smrg       else
70470597fb56Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
70480597fb56Smrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
70490597fb56Smrg	 else
70500597fb56Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
70510597fb56Smrg	 fi
70520597fb56Smrg       fi
70530597fb56Smrg       prev=
70540597fb56Smrg       ;;
7055b042e37fSmrg
70560597fb56Smrg    *.lto.$objext) ;; # Ignore GCC LTO objects
70570597fb56Smrg    *.$objext)
70580597fb56Smrg       # This assumes that the test object file only shows up
70590597fb56Smrg       # once in the compiler output.
70600597fb56Smrg       if test "$p" = "conftest.$objext"; then
70610597fb56Smrg	 pre_test_object_deps_done=yes
70620597fb56Smrg	 continue
70630597fb56Smrg       fi
7064b042e37fSmrg
70650597fb56Smrg       if test "$pre_test_object_deps_done" = no; then
70660597fb56Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
70670597fb56Smrg	   _LT_TAGVAR(predep_objects, $1)="$p"
70680597fb56Smrg	 else
70690597fb56Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
70700597fb56Smrg	 fi
70710597fb56Smrg       else
70720597fb56Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
70730597fb56Smrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
70740597fb56Smrg	 else
70750597fb56Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
70760597fb56Smrg	 fi
70770597fb56Smrg       fi
70780597fb56Smrg       ;;
7079b042e37fSmrg
70800597fb56Smrg    *) ;; # Ignore the rest.
7081bd23fbfaSmrg
70820597fb56Smrg    esac
70830597fb56Smrg  done
7084b042e37fSmrg
70850597fb56Smrg  # Clean up.
70860597fb56Smrg  rm -f a.out a.exe
70870597fb56Smrgelse
70880597fb56Smrg  echo "libtool.m4: error: problem compiling $1 test program"
7089706b6b52Smrgfi
7090b042e37fSmrg
70910597fb56Smrg$RM -f confest.$objext
70920597fb56SmrgCFLAGS=$_lt_libdeps_save_CFLAGS
7093b042e37fSmrg
70940597fb56Smrg# PORTME: override above test on systems where it is broken
70950597fb56Smrgm4_if([$1], [CXX],
70960597fb56Smrg[case $host_os in
70970597fb56Smrginterix[[3-9]]*)
70980597fb56Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
70990597fb56Smrg  # hack all around it, let's just trust "g++" to DTRT.
71000597fb56Smrg  _LT_TAGVAR(predep_objects,$1)=
71010597fb56Smrg  _LT_TAGVAR(postdep_objects,$1)=
71020597fb56Smrg  _LT_TAGVAR(postdeps,$1)=
71030597fb56Smrg  ;;
7104b042e37fSmrg
71050597fb56Smrglinux*)
71060597fb56Smrg  case `$CC -V 2>&1 | sed 5q` in
71070597fb56Smrg  *Sun\ C*)
71080597fb56Smrg    # Sun C++ 5.9
7109b042e37fSmrg
71100597fb56Smrg    # The more standards-conforming stlport4 library is
71110597fb56Smrg    # incompatible with the Cstd library. Avoid specifying
71120597fb56Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
71130597fb56Smrg    # -library=stlport4 depends on it.
71140597fb56Smrg    case " $CXX $CXXFLAGS " in
71150597fb56Smrg    *" -library=stlport4 "*)
71160597fb56Smrg      solaris_use_stlport4=yes
71170597fb56Smrg      ;;
71180597fb56Smrg    esac
71190597fb56Smrg
71200597fb56Smrg    if test "$solaris_use_stlport4" != yes; then
71210597fb56Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7122706b6b52Smrg    fi
7123706b6b52Smrg    ;;
71240597fb56Smrg  esac
71250597fb56Smrg  ;;
71260597fb56Smrg
71270597fb56Smrgsolaris*)
71280597fb56Smrg  case $cc_basename in
71290597fb56Smrg  CC* | sunCC*)
71300597fb56Smrg    # The more standards-conforming stlport4 library is
71310597fb56Smrg    # incompatible with the Cstd library. Avoid specifying
71320597fb56Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
71330597fb56Smrg    # -library=stlport4 depends on it.
71340597fb56Smrg    case " $CXX $CXXFLAGS " in
71350597fb56Smrg    *" -library=stlport4 "*)
71360597fb56Smrg      solaris_use_stlport4=yes
71370597fb56Smrg      ;;
71380597fb56Smrg    esac
71390597fb56Smrg
71400597fb56Smrg    # Adding this requires a known-good setup of shared libraries for
71410597fb56Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
71420597fb56Smrg    # archive will be linked into the output, leading to subtle bugs.
71430597fb56Smrg    if test "$solaris_use_stlport4" != yes; then
71440597fb56Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
71450597fb56Smrg    fi
7146706b6b52Smrg    ;;
7147706b6b52Smrg  esac
71480597fb56Smrg  ;;
71490597fb56Smrgesac
71500597fb56Smrg])
7151b042e37fSmrg
71520597fb56Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
71530597fb56Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
71540597fb56Smrgesac
71550597fb56Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
71560597fb56Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
71570597fb56Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
71580597fb56Smrgfi
71590597fb56Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
71600597fb56Smrg    [The directories searched by this compiler when creating a shared library])
71610597fb56Smrg_LT_TAGDECL([], [predep_objects], [1],
71620597fb56Smrg    [Dependencies to place before and after the objects being linked to
71630597fb56Smrg    create a shared library])
71640597fb56Smrg_LT_TAGDECL([], [postdep_objects], [1])
71650597fb56Smrg_LT_TAGDECL([], [predeps], [1])
71660597fb56Smrg_LT_TAGDECL([], [postdeps], [1])
71670597fb56Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
71680597fb56Smrg    [The library search path used internally by the compiler when linking
71690597fb56Smrg    a shared library])
71700597fb56Smrg])# _LT_SYS_HIDDEN_LIBDEPS
7171b042e37fSmrg
71720597fb56Smrg
71730597fb56Smrg# _LT_LANG_F77_CONFIG([TAG])
71740597fb56Smrg# --------------------------
71750597fb56Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
71760597fb56Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
71770597fb56Smrg# to write the compiler configuration to `libtool'.
71780597fb56Smrgm4_defun([_LT_LANG_F77_CONFIG],
71790597fb56Smrg[AC_LANG_PUSH(Fortran 77)
71800597fb56Smrgif test -z "$F77" || test "X$F77" = "Xno"; then
71810597fb56Smrg  _lt_disable_F77=yes
71820597fb56Smrgfi
71830597fb56Smrg
71840597fb56Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
71850597fb56Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
71860597fb56Smrg_LT_TAGVAR(always_export_symbols, $1)=no
71870597fb56Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
71880597fb56Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
71890597fb56Smrg_LT_TAGVAR(hardcode_direct, $1)=no
71900597fb56Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
71910597fb56Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
71920597fb56Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
71930597fb56Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
71940597fb56Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
71950597fb56Smrg_LT_TAGVAR(inherit_rpath, $1)=no
71960597fb56Smrg_LT_TAGVAR(module_cmds, $1)=
71970597fb56Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
71980597fb56Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
71990597fb56Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
72000597fb56Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
72010597fb56Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
72020597fb56Smrg_LT_TAGVAR(no_undefined_flag, $1)=
72030597fb56Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
72040597fb56Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
72050597fb56Smrg
72060597fb56Smrg# Source file extension for f77 test sources.
72070597fb56Smrgac_ext=f
72080597fb56Smrg
72090597fb56Smrg# Object file extension for compiled f77 test sources.
72100597fb56Smrgobjext=o
72110597fb56Smrg_LT_TAGVAR(objext, $1)=$objext
72120597fb56Smrg
72130597fb56Smrg# No sense in running all these tests if we already determined that
72140597fb56Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
72150597fb56Smrg# are currently assumed to apply to all compilers on this platform,
72160597fb56Smrg# and will be corrupted by setting them based on a non-working compiler.
72170597fb56Smrgif test "$_lt_disable_F77" != yes; then
72180597fb56Smrg  # Code to be used in simple compile tests
72190597fb56Smrg  lt_simple_compile_test_code="\
72200597fb56Smrg      subroutine t
72210597fb56Smrg      return
72220597fb56Smrg      end
72230597fb56Smrg"
72240597fb56Smrg
72250597fb56Smrg  # Code to be used in simple link tests
72260597fb56Smrg  lt_simple_link_test_code="\
72270597fb56Smrg      program t
72280597fb56Smrg      end
72290597fb56Smrg"
72300597fb56Smrg
72310597fb56Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
72320597fb56Smrg  _LT_TAG_COMPILER
72330597fb56Smrg
72340597fb56Smrg  # save warnings/boilerplate of simple test code
72350597fb56Smrg  _LT_COMPILER_BOILERPLATE
72360597fb56Smrg  _LT_LINKER_BOILERPLATE
72370597fb56Smrg
72380597fb56Smrg  # Allow CC to be a program name with arguments.
72390597fb56Smrg  lt_save_CC="$CC"
72400597fb56Smrg  lt_save_GCC=$GCC
72410597fb56Smrg  lt_save_CFLAGS=$CFLAGS
72420597fb56Smrg  CC=${F77-"f77"}
72430597fb56Smrg  CFLAGS=$FFLAGS
72440597fb56Smrg  compiler=$CC
72450597fb56Smrg  _LT_TAGVAR(compiler, $1)=$CC
72460597fb56Smrg  _LT_CC_BASENAME([$compiler])
72470597fb56Smrg  GCC=$G77
72480597fb56Smrg  if test -n "$compiler"; then
72490597fb56Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
72500597fb56Smrg    AC_MSG_RESULT([$can_build_shared])
72510597fb56Smrg
72520597fb56Smrg    AC_MSG_CHECKING([whether to build shared libraries])
72530597fb56Smrg    test "$can_build_shared" = "no" && enable_shared=no
72540597fb56Smrg
72550597fb56Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
72560597fb56Smrg    # are all built from PIC.
7257706b6b52Smrg    case $host_os in
72580597fb56Smrg      aix3*)
72590597fb56Smrg        test "$enable_shared" = yes && enable_static=no
72600597fb56Smrg        if test -n "$RANLIB"; then
72610597fb56Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
72620597fb56Smrg          postinstall_cmds='$RANLIB $lib'
72630597fb56Smrg        fi
72640597fb56Smrg        ;;
72650597fb56Smrg      aix[[4-9]]*)
72660597fb56Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
72670597fb56Smrg	  test "$enable_shared" = yes && enable_static=no
72680597fb56Smrg	fi
72690597fb56Smrg        ;;
72708c4a8e55Smrg    esac
72710597fb56Smrg    AC_MSG_RESULT([$enable_shared])
7272b042e37fSmrg
72730597fb56Smrg    AC_MSG_CHECKING([whether to build static libraries])
72740597fb56Smrg    # Make sure either enable_shared or enable_static is yes.
72750597fb56Smrg    test "$enable_shared" = yes || enable_static=yes
72760597fb56Smrg    AC_MSG_RESULT([$enable_static])
7277b042e37fSmrg
72780597fb56Smrg    _LT_TAGVAR(GCC, $1)="$G77"
72790597fb56Smrg    _LT_TAGVAR(LD, $1)="$LD"
7280b042e37fSmrg
72810597fb56Smrg    ## CAVEAT EMPTOR:
72820597fb56Smrg    ## There is no encapsulation within the following macros, do not change
72830597fb56Smrg    ## the running order or otherwise move them around unless you know exactly
72840597fb56Smrg    ## what you are doing...
72850597fb56Smrg    _LT_COMPILER_PIC($1)
72860597fb56Smrg    _LT_COMPILER_C_O($1)
72870597fb56Smrg    _LT_COMPILER_FILE_LOCKS($1)
72880597fb56Smrg    _LT_LINKER_SHLIBS($1)
72890597fb56Smrg    _LT_SYS_DYNAMIC_LINKER($1)
72900597fb56Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
72918c4a8e55Smrg
72920597fb56Smrg    _LT_CONFIG($1)
72930597fb56Smrg  fi # test -n "$compiler"
72940597fb56Smrg
72950597fb56Smrg  GCC=$lt_save_GCC
72960597fb56Smrg  CC="$lt_save_CC"
72970597fb56Smrg  CFLAGS="$lt_save_CFLAGS"
72980597fb56Smrgfi # test "$_lt_disable_F77" != yes
72990597fb56Smrg
73000597fb56SmrgAC_LANG_POP
73010597fb56Smrg])# _LT_LANG_F77_CONFIG
73020597fb56Smrg
73030597fb56Smrg
73040597fb56Smrg# _LT_LANG_FC_CONFIG([TAG])
73050597fb56Smrg# -------------------------
73060597fb56Smrg# Ensure that the configuration variables for a Fortran compiler are
73070597fb56Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
73080597fb56Smrg# to write the compiler configuration to `libtool'.
73090597fb56Smrgm4_defun([_LT_LANG_FC_CONFIG],
73100597fb56Smrg[AC_LANG_PUSH(Fortran)
73118c4a8e55Smrg
73120597fb56Smrgif test -z "$FC" || test "X$FC" = "Xno"; then
73130597fb56Smrg  _lt_disable_FC=yes
73140597fb56Smrgfi
73158c4a8e55Smrg
73160597fb56Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
73170597fb56Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
73180597fb56Smrg_LT_TAGVAR(always_export_symbols, $1)=no
73190597fb56Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
73200597fb56Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
73210597fb56Smrg_LT_TAGVAR(hardcode_direct, $1)=no
73220597fb56Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
73230597fb56Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
73240597fb56Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
73250597fb56Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
73260597fb56Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
73270597fb56Smrg_LT_TAGVAR(inherit_rpath, $1)=no
73280597fb56Smrg_LT_TAGVAR(module_cmds, $1)=
73290597fb56Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
73300597fb56Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
73310597fb56Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
73320597fb56Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
73330597fb56Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
73340597fb56Smrg_LT_TAGVAR(no_undefined_flag, $1)=
73350597fb56Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
73360597fb56Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
73378c4a8e55Smrg
73380597fb56Smrg# Source file extension for fc test sources.
73390597fb56Smrgac_ext=${ac_fc_srcext-f}
73408c4a8e55Smrg
73410597fb56Smrg# Object file extension for compiled fc test sources.
73420597fb56Smrgobjext=o
73430597fb56Smrg_LT_TAGVAR(objext, $1)=$objext
7344b042e37fSmrg
73450597fb56Smrg# No sense in running all these tests if we already determined that
73460597fb56Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
73470597fb56Smrg# are currently assumed to apply to all compilers on this platform,
73480597fb56Smrg# and will be corrupted by setting them based on a non-working compiler.
73490597fb56Smrgif test "$_lt_disable_FC" != yes; then
73500597fb56Smrg  # Code to be used in simple compile tests
73510597fb56Smrg  lt_simple_compile_test_code="\
73520597fb56Smrg      subroutine t
73530597fb56Smrg      return
73540597fb56Smrg      end
73550597fb56Smrg"
73568c4a8e55Smrg
73570597fb56Smrg  # Code to be used in simple link tests
73580597fb56Smrg  lt_simple_link_test_code="\
73590597fb56Smrg      program t
73600597fb56Smrg      end
73610597fb56Smrg"
73628c4a8e55Smrg
73630597fb56Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
73640597fb56Smrg  _LT_TAG_COMPILER
7365b042e37fSmrg
73660597fb56Smrg  # save warnings/boilerplate of simple test code
73670597fb56Smrg  _LT_COMPILER_BOILERPLATE
73680597fb56Smrg  _LT_LINKER_BOILERPLATE
7369b042e37fSmrg
73700597fb56Smrg  # Allow CC to be a program name with arguments.
73710597fb56Smrg  lt_save_CC="$CC"
73720597fb56Smrg  lt_save_GCC=$GCC
73730597fb56Smrg  lt_save_CFLAGS=$CFLAGS
73740597fb56Smrg  CC=${FC-"f95"}
73750597fb56Smrg  CFLAGS=$FCFLAGS
73760597fb56Smrg  compiler=$CC
73770597fb56Smrg  GCC=$ac_cv_fc_compiler_gnu
7378b042e37fSmrg
73790597fb56Smrg  _LT_TAGVAR(compiler, $1)=$CC
73800597fb56Smrg  _LT_CC_BASENAME([$compiler])
7381b042e37fSmrg
73820597fb56Smrg  if test -n "$compiler"; then
73830597fb56Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
73840597fb56Smrg    AC_MSG_RESULT([$can_build_shared])
7385b042e37fSmrg
73860597fb56Smrg    AC_MSG_CHECKING([whether to build shared libraries])
73870597fb56Smrg    test "$can_build_shared" = "no" && enable_shared=no
7388b042e37fSmrg
73890597fb56Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
73900597fb56Smrg    # are all built from PIC.
73910597fb56Smrg    case $host_os in
73920597fb56Smrg      aix3*)
73930597fb56Smrg        test "$enable_shared" = yes && enable_static=no
73940597fb56Smrg        if test -n "$RANLIB"; then
73950597fb56Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
73960597fb56Smrg          postinstall_cmds='$RANLIB $lib'
73970597fb56Smrg        fi
73980597fb56Smrg        ;;
73990597fb56Smrg      aix[[4-9]]*)
74000597fb56Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
74010597fb56Smrg	  test "$enable_shared" = yes && enable_static=no
74020597fb56Smrg	fi
74030597fb56Smrg        ;;
74040597fb56Smrg    esac
74050597fb56Smrg    AC_MSG_RESULT([$enable_shared])
74068c4a8e55Smrg
74070597fb56Smrg    AC_MSG_CHECKING([whether to build static libraries])
74080597fb56Smrg    # Make sure either enable_shared or enable_static is yes.
74090597fb56Smrg    test "$enable_shared" = yes || enable_static=yes
74100597fb56Smrg    AC_MSG_RESULT([$enable_static])
7411b042e37fSmrg
74120597fb56Smrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
74130597fb56Smrg    _LT_TAGVAR(LD, $1)="$LD"
7414b042e37fSmrg
74150597fb56Smrg    ## CAVEAT EMPTOR:
74160597fb56Smrg    ## There is no encapsulation within the following macros, do not change
74170597fb56Smrg    ## the running order or otherwise move them around unless you know exactly
74180597fb56Smrg    ## what you are doing...
74190597fb56Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
74200597fb56Smrg    _LT_COMPILER_PIC($1)
74210597fb56Smrg    _LT_COMPILER_C_O($1)
74220597fb56Smrg    _LT_COMPILER_FILE_LOCKS($1)
74230597fb56Smrg    _LT_LINKER_SHLIBS($1)
74240597fb56Smrg    _LT_SYS_DYNAMIC_LINKER($1)
74250597fb56Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7426b042e37fSmrg
74270597fb56Smrg    _LT_CONFIG($1)
74280597fb56Smrg  fi # test -n "$compiler"
7429b042e37fSmrg
74300597fb56Smrg  GCC=$lt_save_GCC
74310597fb56Smrg  CC=$lt_save_CC
74320597fb56Smrg  CFLAGS=$lt_save_CFLAGS
74330597fb56Smrgfi # test "$_lt_disable_FC" != yes
7434b042e37fSmrg
74350597fb56SmrgAC_LANG_POP
74360597fb56Smrg])# _LT_LANG_FC_CONFIG
7437b042e37fSmrg
7438706b6b52Smrg
74390597fb56Smrg# _LT_LANG_GCJ_CONFIG([TAG])
74400597fb56Smrg# --------------------------
74410597fb56Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
74420597fb56Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
74430597fb56Smrg# to write the compiler configuration to `libtool'.
74440597fb56Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
74450597fb56Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
74460597fb56SmrgAC_LANG_SAVE
74478c4a8e55Smrg
74480597fb56Smrg# Source file extension for Java test sources.
74490597fb56Smrgac_ext=java
74508c4a8e55Smrg
74510597fb56Smrg# Object file extension for compiled Java test sources.
74520597fb56Smrgobjext=o
74530597fb56Smrg_LT_TAGVAR(objext, $1)=$objext
74548c4a8e55Smrg
74550597fb56Smrg# Code to be used in simple compile tests
74560597fb56Smrglt_simple_compile_test_code="class foo {}"
74578c4a8e55Smrg
74580597fb56Smrg# Code to be used in simple link tests
74590597fb56Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
74608c4a8e55Smrg
74610597fb56Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
74620597fb56Smrg_LT_TAG_COMPILER
7463b042e37fSmrg
74640597fb56Smrg# save warnings/boilerplate of simple test code
74650597fb56Smrg_LT_COMPILER_BOILERPLATE
74660597fb56Smrg_LT_LINKER_BOILERPLATE
74678c4a8e55Smrg
74680597fb56Smrg# Allow CC to be a program name with arguments.
74690597fb56Smrglt_save_CC=$CC
74700597fb56Smrglt_save_CFLAGS=$CFLAGS
74710597fb56Smrglt_save_GCC=$GCC
74720597fb56SmrgGCC=yes
74730597fb56SmrgCC=${GCJ-"gcj"}
74740597fb56SmrgCFLAGS=$GCJFLAGS
74750597fb56Smrgcompiler=$CC
74760597fb56Smrg_LT_TAGVAR(compiler, $1)=$CC
74770597fb56Smrg_LT_TAGVAR(LD, $1)="$LD"
74780597fb56Smrg_LT_CC_BASENAME([$compiler])
74798c4a8e55Smrg
74800597fb56Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
74810597fb56Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7482b042e37fSmrg
74830597fb56Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
74840597fb56Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
74850597fb56Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7486b042e37fSmrg
74870597fb56Smrgif test -n "$compiler"; then
74880597fb56Smrg  _LT_COMPILER_NO_RTTI($1)
74890597fb56Smrg  _LT_COMPILER_PIC($1)
74900597fb56Smrg  _LT_COMPILER_C_O($1)
74910597fb56Smrg  _LT_COMPILER_FILE_LOCKS($1)
74920597fb56Smrg  _LT_LINKER_SHLIBS($1)
74930597fb56Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
7494b042e37fSmrg
74950597fb56Smrg  _LT_CONFIG($1)
74960597fb56Smrgfi
74978c4a8e55Smrg
74980597fb56SmrgAC_LANG_RESTORE
74998c4a8e55Smrg
75000597fb56SmrgGCC=$lt_save_GCC
75010597fb56SmrgCC=$lt_save_CC
75020597fb56SmrgCFLAGS=$lt_save_CFLAGS
75030597fb56Smrg])# _LT_LANG_GCJ_CONFIG
75048c4a8e55Smrg
75058c4a8e55Smrg
75060597fb56Smrg# _LT_LANG_GO_CONFIG([TAG])
75070597fb56Smrg# --------------------------
75080597fb56Smrg# Ensure that the configuration variables for the GNU Go compiler
75090597fb56Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
75100597fb56Smrg# to write the compiler configuration to `libtool'.
75110597fb56Smrgm4_defun([_LT_LANG_GO_CONFIG],
75120597fb56Smrg[AC_REQUIRE([LT_PROG_GO])dnl
75130597fb56SmrgAC_LANG_SAVE
7514706b6b52Smrg
75150597fb56Smrg# Source file extension for Go test sources.
75160597fb56Smrgac_ext=go
7517b042e37fSmrg
75180597fb56Smrg# Object file extension for compiled Go test sources.
75190597fb56Smrgobjext=o
75200597fb56Smrg_LT_TAGVAR(objext, $1)=$objext
75218c4a8e55Smrg
75220597fb56Smrg# Code to be used in simple compile tests
75230597fb56Smrglt_simple_compile_test_code="package main; func main() { }"
75248c4a8e55Smrg
75250597fb56Smrg# Code to be used in simple link tests
75260597fb56Smrglt_simple_link_test_code='package main; func main() { }'
75278c4a8e55Smrg
75280597fb56Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
75290597fb56Smrg_LT_TAG_COMPILER
75308c4a8e55Smrg
75310597fb56Smrg# save warnings/boilerplate of simple test code
75320597fb56Smrg_LT_COMPILER_BOILERPLATE
75330597fb56Smrg_LT_LINKER_BOILERPLATE
75348c4a8e55Smrg
75350597fb56Smrg# Allow CC to be a program name with arguments.
75360597fb56Smrglt_save_CC=$CC
75370597fb56Smrglt_save_CFLAGS=$CFLAGS
75380597fb56Smrglt_save_GCC=$GCC
75390597fb56SmrgGCC=yes
75400597fb56SmrgCC=${GOC-"gccgo"}
75410597fb56SmrgCFLAGS=$GOFLAGS
75420597fb56Smrgcompiler=$CC
75430597fb56Smrg_LT_TAGVAR(compiler, $1)=$CC
75440597fb56Smrg_LT_TAGVAR(LD, $1)="$LD"
75450597fb56Smrg_LT_CC_BASENAME([$compiler])
75468c4a8e55Smrg
75470597fb56Smrg# Go did not exist at the time GCC didn't implicitly link libc in.
75480597fb56Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
75498c4a8e55Smrg
75500597fb56Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
75510597fb56Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
75520597fb56Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7553706b6b52Smrg
75540597fb56Smrgif test -n "$compiler"; then
75550597fb56Smrg  _LT_COMPILER_NO_RTTI($1)
75560597fb56Smrg  _LT_COMPILER_PIC($1)
75570597fb56Smrg  _LT_COMPILER_C_O($1)
75580597fb56Smrg  _LT_COMPILER_FILE_LOCKS($1)
75590597fb56Smrg  _LT_LINKER_SHLIBS($1)
75600597fb56Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
7561706b6b52Smrg
75620597fb56Smrg  _LT_CONFIG($1)
75630597fb56Smrgfi
75648c4a8e55Smrg
75650597fb56SmrgAC_LANG_RESTORE
75668c4a8e55Smrg
75670597fb56SmrgGCC=$lt_save_GCC
75680597fb56SmrgCC=$lt_save_CC
75690597fb56SmrgCFLAGS=$lt_save_CFLAGS
75700597fb56Smrg])# _LT_LANG_GO_CONFIG
75718c4a8e55Smrg
75728c4a8e55Smrg
75730597fb56Smrg# _LT_LANG_RC_CONFIG([TAG])
75740597fb56Smrg# -------------------------
75750597fb56Smrg# Ensure that the configuration variables for the Windows resource compiler
75760597fb56Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
75770597fb56Smrg# to write the compiler configuration to `libtool'.
75780597fb56Smrgm4_defun([_LT_LANG_RC_CONFIG],
75790597fb56Smrg[AC_REQUIRE([LT_PROG_RC])dnl
75800597fb56SmrgAC_LANG_SAVE
75818c4a8e55Smrg
75820597fb56Smrg# Source file extension for RC test sources.
75830597fb56Smrgac_ext=rc
7584b042e37fSmrg
75850597fb56Smrg# Object file extension for compiled RC test sources.
75860597fb56Smrgobjext=o
75870597fb56Smrg_LT_TAGVAR(objext, $1)=$objext
7588b042e37fSmrg
75890597fb56Smrg# Code to be used in simple compile tests
75900597fb56Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
7591b042e37fSmrg
75920597fb56Smrg# Code to be used in simple link tests
75930597fb56Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
7594b042e37fSmrg
75950597fb56Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
75960597fb56Smrg_LT_TAG_COMPILER
75970597fb56Smrg
75980597fb56Smrg# save warnings/boilerplate of simple test code
75990597fb56Smrg_LT_COMPILER_BOILERPLATE
76000597fb56Smrg_LT_LINKER_BOILERPLATE
76010597fb56Smrg
76020597fb56Smrg# Allow CC to be a program name with arguments.
76030597fb56Smrglt_save_CC="$CC"
76040597fb56Smrglt_save_CFLAGS=$CFLAGS
76050597fb56Smrglt_save_GCC=$GCC
76060597fb56SmrgGCC=
76070597fb56SmrgCC=${RC-"windres"}
76080597fb56SmrgCFLAGS=
76090597fb56Smrgcompiler=$CC
76100597fb56Smrg_LT_TAGVAR(compiler, $1)=$CC
76110597fb56Smrg_LT_CC_BASENAME([$compiler])
76120597fb56Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
76130597fb56Smrg
76140597fb56Smrgif test -n "$compiler"; then
76150597fb56Smrg  :
76160597fb56Smrg  _LT_CONFIG($1)
76170597fb56Smrgfi
76180597fb56Smrg
76190597fb56SmrgGCC=$lt_save_GCC
76200597fb56SmrgAC_LANG_RESTORE
76210597fb56SmrgCC=$lt_save_CC
76220597fb56SmrgCFLAGS=$lt_save_CFLAGS
76230597fb56Smrg])# _LT_LANG_RC_CONFIG
76240597fb56Smrg
76250597fb56Smrg
76260597fb56Smrg# LT_PROG_GCJ
76270597fb56Smrg# -----------
76280597fb56SmrgAC_DEFUN([LT_PROG_GCJ],
76290597fb56Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
76300597fb56Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
76310597fb56Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
76320597fb56Smrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
76330597fb56Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
76340597fb56Smrg])
76350597fb56Smrg
76360597fb56Smrg# Old name:
76370597fb56SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
76380597fb56Smrgdnl aclocal-1.4 backwards compatibility:
76390597fb56Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
7640b042e37fSmrg
7641b042e37fSmrg
76420597fb56Smrg# LT_PROG_GO
76430597fb56Smrg# ----------
76440597fb56SmrgAC_DEFUN([LT_PROG_GO],
76450597fb56Smrg[AC_CHECK_TOOL(GOC, gccgo,)
76460597fb56Smrg])
7647b042e37fSmrg
7648b042e37fSmrg
76490597fb56Smrg# LT_PROG_RC
76500597fb56Smrg# ----------
76510597fb56SmrgAC_DEFUN([LT_PROG_RC],
76520597fb56Smrg[AC_CHECK_TOOL(RC, windres,)
76530597fb56Smrg])
7654b042e37fSmrg
76550597fb56Smrg# Old name:
76560597fb56SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
76570597fb56Smrgdnl aclocal-1.4 backwards compatibility:
76580597fb56Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
7659b042e37fSmrg
7660b042e37fSmrg
76610597fb56Smrg# _LT_DECL_EGREP
76620597fb56Smrg# --------------
76630597fb56Smrg# If we don't have a new enough Autoconf to choose the best grep
76640597fb56Smrg# available, choose the one first in the user's PATH.
76650597fb56Smrgm4_defun([_LT_DECL_EGREP],
76660597fb56Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
76670597fb56SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
76680597fb56Smrgtest -z "$GREP" && GREP=grep
76690597fb56Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
76700597fb56Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
76710597fb56Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
76720597fb56Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
76730597fb56SmrgAC_SUBST([GREP])
7674706b6b52Smrg])
7675b042e37fSmrg
7676b042e37fSmrg
76770597fb56Smrg# _LT_DECL_OBJDUMP
76780597fb56Smrg# --------------
76790597fb56Smrg# If we don't have a new enough Autoconf to choose the best objdump
76800597fb56Smrg# available, choose the one first in the user's PATH.
76810597fb56Smrgm4_defun([_LT_DECL_OBJDUMP],
76820597fb56Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
76830597fb56Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
76840597fb56Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
76850597fb56SmrgAC_SUBST([OBJDUMP])
76860597fb56Smrg])
7687b042e37fSmrg
76880597fb56Smrg# _LT_DECL_DLLTOOL
76890597fb56Smrg# ----------------
76900597fb56Smrg# Ensure DLLTOOL variable is set.
76910597fb56Smrgm4_defun([_LT_DECL_DLLTOOL],
76920597fb56Smrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
76930597fb56Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
76940597fb56Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
76950597fb56SmrgAC_SUBST([DLLTOOL])
76960597fb56Smrg])
7697b042e37fSmrg
76980597fb56Smrg# _LT_DECL_SED
76990597fb56Smrg# ------------
77000597fb56Smrg# Check for a fully-functional sed program, that truncates
77010597fb56Smrg# as few characters as possible.  Prefer GNU sed if found.
77020597fb56Smrgm4_defun([_LT_DECL_SED],
77030597fb56Smrg[AC_PROG_SED
77040597fb56Smrgtest -z "$SED" && SED=sed
77050597fb56SmrgXsed="$SED -e 1s/^X//"
77060597fb56Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
77070597fb56Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
77080597fb56Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
77090597fb56Smrg])# _LT_DECL_SED
7710706b6b52Smrg
77110597fb56Smrgm4_ifndef([AC_PROG_SED], [
77120597fb56Smrg# NOTE: This macro has been submitted for inclusion into   #
77130597fb56Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
77140597fb56Smrg#  a released version of Autoconf we should remove this    #
77150597fb56Smrg#  macro and use it instead.                               #
77160597fb56Smrg
77170597fb56Smrgm4_defun([AC_PROG_SED],
77180597fb56Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
77190597fb56SmrgAC_CACHE_VAL(lt_cv_path_SED,
77200597fb56Smrg[# Loop through the user's path and test for sed and gsed.
77210597fb56Smrg# Then use that list of sed's as ones to test for truncation.
77220597fb56Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
77230597fb56Smrgfor as_dir in $PATH
77240597fb56Smrgdo
77250597fb56Smrg  IFS=$as_save_IFS
77260597fb56Smrg  test -z "$as_dir" && as_dir=.
77270597fb56Smrg  for lt_ac_prog in sed gsed; do
77280597fb56Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
77290597fb56Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
77300597fb56Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
77310597fb56Smrg      fi
77320597fb56Smrg    done
77330597fb56Smrg  done
77340597fb56Smrgdone
77350597fb56SmrgIFS=$as_save_IFS
77360597fb56Smrglt_ac_max=0
77370597fb56Smrglt_ac_count=0
77380597fb56Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
77390597fb56Smrg# along with /bin/sed that truncates output.
77400597fb56Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
77410597fb56Smrg  test ! -f $lt_ac_sed && continue
77420597fb56Smrg  cat /dev/null > conftest.in
77430597fb56Smrg  lt_ac_count=0
77440597fb56Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
77450597fb56Smrg  # Check for GNU sed and select it if it is found.
77460597fb56Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
77470597fb56Smrg    lt_cv_path_SED=$lt_ac_sed
77480597fb56Smrg    break
7749706b6b52Smrg  fi
77500597fb56Smrg  while true; do
77510597fb56Smrg    cat conftest.in conftest.in >conftest.tmp
77520597fb56Smrg    mv conftest.tmp conftest.in
77530597fb56Smrg    cp conftest.in conftest.nl
77540597fb56Smrg    echo >>conftest.nl
77550597fb56Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
77560597fb56Smrg    cmp -s conftest.out conftest.nl || break
77570597fb56Smrg    # 10000 chars as input seems more than enough
77580597fb56Smrg    test $lt_ac_count -gt 10 && break
77590597fb56Smrg    lt_ac_count=`expr $lt_ac_count + 1`
77600597fb56Smrg    if test $lt_ac_count -gt $lt_ac_max; then
77610597fb56Smrg      lt_ac_max=$lt_ac_count
77620597fb56Smrg      lt_cv_path_SED=$lt_ac_sed
77630597fb56Smrg    fi
77640597fb56Smrg  done
77650597fb56Smrgdone
77660597fb56Smrg])
77670597fb56SmrgSED=$lt_cv_path_SED
77680597fb56SmrgAC_SUBST([SED])
77690597fb56SmrgAC_MSG_RESULT([$SED])
77700597fb56Smrg])#AC_PROG_SED
77710597fb56Smrg])#m4_ifndef
77720597fb56Smrg
77730597fb56Smrg# Old name:
77740597fb56SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
77750597fb56Smrgdnl aclocal-1.4 backwards compatibility:
77760597fb56Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
77770597fb56Smrg
77780597fb56Smrg
77790597fb56Smrg# _LT_CHECK_SHELL_FEATURES
77800597fb56Smrg# ------------------------
77810597fb56Smrg# Find out whether the shell is Bourne or XSI compatible,
77820597fb56Smrg# or has some other useful features.
77830597fb56Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
77840597fb56Smrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
77850597fb56Smrg# Try some XSI features
77860597fb56Smrgxsi_shell=no
77870597fb56Smrg( _lt_dummy="a/b/c"
77880597fb56Smrg  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
77890597fb56Smrg      = c,a/b,b/c, \
77900597fb56Smrg    && eval 'test $(( 1 + 1 )) -eq 2 \
77910597fb56Smrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
77920597fb56Smrg  && xsi_shell=yes
77930597fb56SmrgAC_MSG_RESULT([$xsi_shell])
77940597fb56Smrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
77950597fb56Smrg
77960597fb56SmrgAC_MSG_CHECKING([whether the shell understands "+="])
77970597fb56Smrglt_shell_append=no
77980597fb56Smrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
77990597fb56Smrg    >/dev/null 2>&1 \
78000597fb56Smrg  && lt_shell_append=yes
78010597fb56SmrgAC_MSG_RESULT([$lt_shell_append])
78020597fb56Smrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
78030597fb56Smrg
78040597fb56Smrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
78050597fb56Smrg  lt_unset=unset
78060597fb56Smrgelse
78070597fb56Smrg  lt_unset=false
78080597fb56Smrgfi
78090597fb56Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
78100597fb56Smrg
78110597fb56Smrg# test EBCDIC or ASCII
78120597fb56Smrgcase `echo X|tr X '\101'` in
78130597fb56Smrg A) # ASCII based system
78140597fb56Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
78150597fb56Smrg  lt_SP2NL='tr \040 \012'
78160597fb56Smrg  lt_NL2SP='tr \015\012 \040\040'
78170597fb56Smrg  ;;
78180597fb56Smrg *) # EBCDIC based system
78190597fb56Smrg  lt_SP2NL='tr \100 \n'
78200597fb56Smrg  lt_NL2SP='tr \r\n \100\100'
7821706b6b52Smrg  ;;
7822706b6b52Smrgesac
78230597fb56Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
78240597fb56Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
78250597fb56Smrg])# _LT_CHECK_SHELL_FEATURES
7826b042e37fSmrg
7827b042e37fSmrg
78280597fb56Smrg# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
78290597fb56Smrg# ------------------------------------------------------
78300597fb56Smrg# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
78310597fb56Smrg# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
78320597fb56Smrgm4_defun([_LT_PROG_FUNCTION_REPLACE],
78330597fb56Smrg[dnl {
78340597fb56Smrgsed -e '/^$1 ()$/,/^} # $1 /c\
78350597fb56Smrg$1 ()\
78360597fb56Smrg{\
78370597fb56Smrgm4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
78380597fb56Smrg} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
78390597fb56Smrg  && mv -f "$cfgfile.tmp" "$cfgfile" \
78400597fb56Smrg    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
78410597fb56Smrgtest 0 -eq $? || _lt_function_replace_fail=:
78420597fb56Smrg])
7843b042e37fSmrg
7844b042e37fSmrg
78450597fb56Smrg# _LT_PROG_REPLACE_SHELLFNS
78460597fb56Smrg# -------------------------
78470597fb56Smrg# Replace existing portable implementations of several shell functions with
78480597fb56Smrg# equivalent extended shell implementations where those features are available..
78490597fb56Smrgm4_defun([_LT_PROG_REPLACE_SHELLFNS],
78500597fb56Smrg[if test x"$xsi_shell" = xyes; then
78510597fb56Smrg  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
78520597fb56Smrg    case ${1} in
78530597fb56Smrg      */*) func_dirname_result="${1%/*}${2}" ;;
78540597fb56Smrg      *  ) func_dirname_result="${3}" ;;
78550597fb56Smrg    esac])
7856b042e37fSmrg
78570597fb56Smrg  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
78580597fb56Smrg    func_basename_result="${1##*/}"])
7859b042e37fSmrg
78600597fb56Smrg  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
78610597fb56Smrg    case ${1} in
78620597fb56Smrg      */*) func_dirname_result="${1%/*}${2}" ;;
78630597fb56Smrg      *  ) func_dirname_result="${3}" ;;
78640597fb56Smrg    esac
78650597fb56Smrg    func_basename_result="${1##*/}"])
7866b042e37fSmrg
78670597fb56Smrg  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
78680597fb56Smrg    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
78690597fb56Smrg    # positional parameters, so assign one to ordinary parameter first.
78700597fb56Smrg    func_stripname_result=${3}
78710597fb56Smrg    func_stripname_result=${func_stripname_result#"${1}"}
78720597fb56Smrg    func_stripname_result=${func_stripname_result%"${2}"}])
7873b042e37fSmrg
78740597fb56Smrg  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
78750597fb56Smrg    func_split_long_opt_name=${1%%=*}
78760597fb56Smrg    func_split_long_opt_arg=${1#*=}])
7877b042e37fSmrg
78780597fb56Smrg  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
78790597fb56Smrg    func_split_short_opt_arg=${1#??}
78800597fb56Smrg    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
7881b042e37fSmrg
78820597fb56Smrg  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
78830597fb56Smrg    case ${1} in
78840597fb56Smrg      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
78850597fb56Smrg      *)    func_lo2o_result=${1} ;;
78860597fb56Smrg    esac])
7887b042e37fSmrg
78880597fb56Smrg  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
7889b042e37fSmrg
78900597fb56Smrg  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
7891b042e37fSmrg
78920597fb56Smrg  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
78930597fb56Smrgfi
78940597fb56Smrg
78950597fb56Smrgif test x"$lt_shell_append" = xyes; then
78960597fb56Smrg  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
78970597fb56Smrg
78980597fb56Smrg  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
78990597fb56Smrg    func_quote_for_eval "${2}"
79000597fb56Smrgdnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
79010597fb56Smrg    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
79020597fb56Smrg
79030597fb56Smrg  # Save a `func_append' function call where possible by direct use of '+='
79040597fb56Smrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
79050597fb56Smrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
79060597fb56Smrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
79070597fb56Smrg  test 0 -eq $? || _lt_function_replace_fail=:
79080597fb56Smrgelse
79090597fb56Smrg  # Save a `func_append' function call even when '+=' is not available
79100597fb56Smrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
79110597fb56Smrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
79120597fb56Smrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
79130597fb56Smrg  test 0 -eq $? || _lt_function_replace_fail=:
79140597fb56Smrgfi
79150597fb56Smrg
79160597fb56Smrgif test x"$_lt_function_replace_fail" = x":"; then
79170597fb56Smrg  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
79180597fb56Smrgfi
79190597fb56Smrg])
79200597fb56Smrg
79210597fb56Smrg# _LT_PATH_CONVERSION_FUNCTIONS
79220597fb56Smrg# -----------------------------
79230597fb56Smrg# Determine which file name conversion functions should be used by
79240597fb56Smrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
79250597fb56Smrg# for certain cross-compile configurations and native mingw.
79260597fb56Smrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
79270597fb56Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
79280597fb56SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
79290597fb56SmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
79300597fb56SmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
79310597fb56Smrg[case $host in
79320597fb56Smrg  *-*-mingw* )
79330597fb56Smrg    case $build in
79340597fb56Smrg      *-*-mingw* ) # actually msys
79350597fb56Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
79360597fb56Smrg        ;;
79370597fb56Smrg      *-*-cygwin* )
79380597fb56Smrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
79390597fb56Smrg        ;;
79400597fb56Smrg      * ) # otherwise, assume *nix
79410597fb56Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
79420597fb56Smrg        ;;
79430597fb56Smrg    esac
79440597fb56Smrg    ;;
79450597fb56Smrg  *-*-cygwin* )
79460597fb56Smrg    case $build in
79470597fb56Smrg      *-*-mingw* ) # actually msys
79480597fb56Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
79490597fb56Smrg        ;;
79500597fb56Smrg      *-*-cygwin* )
79510597fb56Smrg        lt_cv_to_host_file_cmd=func_convert_file_noop
79520597fb56Smrg        ;;
79530597fb56Smrg      * ) # otherwise, assume *nix
79540597fb56Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
79550597fb56Smrg        ;;
79560597fb56Smrg    esac
7957706b6b52Smrg    ;;
79580597fb56Smrg  * ) # unhandled hosts (and "normal" native builds)
79590597fb56Smrg    lt_cv_to_host_file_cmd=func_convert_file_noop
7960706b6b52Smrg    ;;
79610597fb56Smrgesac
79620597fb56Smrg])
79630597fb56Smrgto_host_file_cmd=$lt_cv_to_host_file_cmd
79640597fb56SmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
79650597fb56Smrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
79660597fb56Smrg         [0], [convert $build file names to $host format])dnl
7967b042e37fSmrg
79680597fb56SmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
79690597fb56SmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
79700597fb56Smrg[#assume ordinary cross tools, or native build.
79710597fb56Smrglt_cv_to_tool_file_cmd=func_convert_file_noop
79720597fb56Smrgcase $host in
79730597fb56Smrg  *-*-mingw* )
79740597fb56Smrg    case $build in
79750597fb56Smrg      *-*-mingw* ) # actually msys
79760597fb56Smrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
79770597fb56Smrg        ;;
79780597fb56Smrg    esac
79790597fb56Smrg    ;;
79800597fb56Smrgesac
79810597fb56Smrg])
79820597fb56Smrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
79830597fb56SmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
79840597fb56Smrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
79850597fb56Smrg         [0], [convert $build files to toolchain format])dnl
79860597fb56Smrg])# _LT_PATH_CONVERSION_FUNCTIONS
7987b042e37fSmrg
79880597fb56Smrg# Helper functions for option handling.                    -*- Autoconf -*-
79890597fb56Smrg#
79900597fb56Smrg#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
79910597fb56Smrg#   Inc.
79920597fb56Smrg#   Written by Gary V. Vaughan, 2004
79930597fb56Smrg#
79940597fb56Smrg# This file is free software; the Free Software Foundation gives
79950597fb56Smrg# unlimited permission to copy and/or distribute it, with or without
79960597fb56Smrg# modifications, as long as this notice is preserved.
7997b042e37fSmrg
79980597fb56Smrg# serial 7 ltoptions.m4
79998c4a8e55Smrg
80000597fb56Smrg# This is to help aclocal find these macros, as it can't see m4_define.
80010597fb56SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
80028c4a8e55Smrg
8003b042e37fSmrg
80040597fb56Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
80050597fb56Smrg# ------------------------------------------
80060597fb56Smrgm4_define([_LT_MANGLE_OPTION],
80070597fb56Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
8008b042e37fSmrg
8009b042e37fSmrg
80100597fb56Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
80110597fb56Smrg# ---------------------------------------
80120597fb56Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
80130597fb56Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
80140597fb56Smrg# saved as a flag.
80150597fb56Smrgm4_define([_LT_SET_OPTION],
80160597fb56Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
80170597fb56Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
80180597fb56Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
80190597fb56Smrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
80200597fb56Smrg])
80218c4a8e55Smrg
80228c4a8e55Smrg
80230597fb56Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
80240597fb56Smrg# ------------------------------------------------------------
80250597fb56Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
80260597fb56Smrgm4_define([_LT_IF_OPTION],
80270597fb56Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
80288c4a8e55Smrg
8029b042e37fSmrg
80300597fb56Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
80310597fb56Smrg# -------------------------------------------------------
80320597fb56Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
80330597fb56Smrg# are set.
80340597fb56Smrgm4_define([_LT_UNLESS_OPTIONS],
80350597fb56Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
80360597fb56Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
80370597fb56Smrg		      [m4_define([$0_found])])])[]dnl
80380597fb56Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
80390597fb56Smrg])[]dnl
80400597fb56Smrg])
8041b042e37fSmrg
80428c4a8e55Smrg
80430597fb56Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
80440597fb56Smrg# ----------------------------------------
80450597fb56Smrg# OPTION-LIST is a space-separated list of Libtool options associated
80460597fb56Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
80470597fb56Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
80480597fb56Smrg# the unknown option and exit.
80490597fb56Smrgm4_defun([_LT_SET_OPTIONS],
80500597fb56Smrg[# Set options
80510597fb56Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
80520597fb56Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
8053b042e37fSmrg
80540597fb56Smrgm4_if([$1],[LT_INIT],[
80550597fb56Smrg  dnl
80560597fb56Smrg  dnl Simply set some default values (i.e off) if boolean options were not
80570597fb56Smrg  dnl specified:
80580597fb56Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
80590597fb56Smrg  ])
80600597fb56Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
80610597fb56Smrg  ])
80620597fb56Smrg  dnl
80630597fb56Smrg  dnl If no reference was made to various pairs of opposing options, then
80640597fb56Smrg  dnl we run the default mode handler for the pair.  For example, if neither
80650597fb56Smrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
80660597fb56Smrg  dnl archives by default:
80670597fb56Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
80680597fb56Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
80690597fb56Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
80700597fb56Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
80710597fb56Smrg  		   [_LT_ENABLE_FAST_INSTALL])
80720597fb56Smrg  ])
80730597fb56Smrg])# _LT_SET_OPTIONS
8074b042e37fSmrg
8075b042e37fSmrg
8076b042e37fSmrg
80770597fb56Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
80780597fb56Smrg# -----------------------------------------
80790597fb56Smrgm4_define([_LT_MANGLE_DEFUN],
80800597fb56Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
8081b042e37fSmrg
8082b042e37fSmrg
80830597fb56Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
80840597fb56Smrg# -----------------------------------------------
80850597fb56Smrgm4_define([LT_OPTION_DEFINE],
80860597fb56Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
80870597fb56Smrg])# LT_OPTION_DEFINE
8088b042e37fSmrg
8089706b6b52Smrg
80900597fb56Smrg# dlopen
80910597fb56Smrg# ------
80920597fb56SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
80930597fb56Smrg])
8094706b6b52Smrg
80950597fb56SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
80960597fb56Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
80970597fb56SmrgAC_DIAGNOSE([obsolete],
80980597fb56Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
80990597fb56Smrgput the `dlopen' option into LT_INIT's first parameter.])
81000597fb56Smrg])
8101706b6b52Smrg
81020597fb56Smrgdnl aclocal-1.4 backwards compatibility:
81030597fb56Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
8104706b6b52Smrg
8105b042e37fSmrg
81060597fb56Smrg# win32-dll
81070597fb56Smrg# ---------
81080597fb56Smrg# Declare package support for building win32 dll's.
81090597fb56SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
81100597fb56Smrg[enable_win32_dll=yes
81118c4a8e55Smrg
81120597fb56Smrgcase $host in
81130597fb56Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
81140597fb56Smrg  AC_CHECK_TOOL(AS, as, false)
81150597fb56Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
81160597fb56Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
81170597fb56Smrg  ;;
81180597fb56Smrgesac
81198c4a8e55Smrg
81200597fb56Smrgtest -z "$AS" && AS=as
81210597fb56Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
8122b042e37fSmrg
81230597fb56Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
81240597fb56Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
8125b042e37fSmrg
81260597fb56Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
81270597fb56Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
81280597fb56Smrg])# win32-dll
81298c4a8e55Smrg
81300597fb56SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
81310597fb56Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
81320597fb56Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
81330597fb56SmrgAC_DIAGNOSE([obsolete],
81340597fb56Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
81350597fb56Smrgput the `win32-dll' option into LT_INIT's first parameter.])
81360597fb56Smrg])
8137b042e37fSmrg
81380597fb56Smrgdnl aclocal-1.4 backwards compatibility:
81390597fb56Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
8140b042e37fSmrg
8141bd23fbfaSmrg
81420597fb56Smrg# _LT_ENABLE_SHARED([DEFAULT])
81430597fb56Smrg# ----------------------------
81440597fb56Smrg# implement the --enable-shared flag, and supports the `shared' and
81450597fb56Smrg# `disable-shared' LT_INIT options.
81460597fb56Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
81470597fb56Smrgm4_define([_LT_ENABLE_SHARED],
81480597fb56Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
81490597fb56SmrgAC_ARG_ENABLE([shared],
81500597fb56Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
81510597fb56Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
81520597fb56Smrg    [p=${PACKAGE-default}
81530597fb56Smrg    case $enableval in
81540597fb56Smrg    yes) enable_shared=yes ;;
81550597fb56Smrg    no) enable_shared=no ;;
81560597fb56Smrg    *)
81570597fb56Smrg      enable_shared=no
81580597fb56Smrg      # Look at the argument we got.  We use all the common list separators.
81590597fb56Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
81600597fb56Smrg      for pkg in $enableval; do
81610597fb56Smrg	IFS="$lt_save_ifs"
81620597fb56Smrg	if test "X$pkg" = "X$p"; then
81630597fb56Smrg	  enable_shared=yes
81640597fb56Smrg	fi
81650597fb56Smrg      done
81660597fb56Smrg      IFS="$lt_save_ifs"
81670597fb56Smrg      ;;
81680597fb56Smrg    esac],
81690597fb56Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
81700597fb56Smrg
81710597fb56Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
81720597fb56Smrg	[Whether or not to build shared libraries])
81730597fb56Smrg])# _LT_ENABLE_SHARED
8174b042e37fSmrg
81750597fb56SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
81760597fb56SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
8177b042e37fSmrg
81780597fb56Smrg# Old names:
81790597fb56SmrgAC_DEFUN([AC_ENABLE_SHARED],
81800597fb56Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
81810597fb56Smrg])
8182b042e37fSmrg
81830597fb56SmrgAC_DEFUN([AC_DISABLE_SHARED],
81840597fb56Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
81850597fb56Smrg])
8186b042e37fSmrg
81870597fb56SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
81880597fb56SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
8189b042e37fSmrg
81900597fb56Smrgdnl aclocal-1.4 backwards compatibility:
81910597fb56Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
81920597fb56Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
8193b042e37fSmrg
8194706b6b52Smrg
8195b042e37fSmrg
81960597fb56Smrg# _LT_ENABLE_STATIC([DEFAULT])
81970597fb56Smrg# ----------------------------
81980597fb56Smrg# implement the --enable-static flag, and support the `static' and
81990597fb56Smrg# `disable-static' LT_INIT options.
82000597fb56Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
82010597fb56Smrgm4_define([_LT_ENABLE_STATIC],
82020597fb56Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
82030597fb56SmrgAC_ARG_ENABLE([static],
82040597fb56Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
82050597fb56Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
82060597fb56Smrg    [p=${PACKAGE-default}
82070597fb56Smrg    case $enableval in
82080597fb56Smrg    yes) enable_static=yes ;;
82090597fb56Smrg    no) enable_static=no ;;
82100597fb56Smrg    *)
82110597fb56Smrg     enable_static=no
82120597fb56Smrg      # Look at the argument we got.  We use all the common list separators.
82130597fb56Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
82140597fb56Smrg      for pkg in $enableval; do
82150597fb56Smrg	IFS="$lt_save_ifs"
82160597fb56Smrg	if test "X$pkg" = "X$p"; then
82170597fb56Smrg	  enable_static=yes
82180597fb56Smrg	fi
82190597fb56Smrg      done
82200597fb56Smrg      IFS="$lt_save_ifs"
82210597fb56Smrg      ;;
82220597fb56Smrg    esac],
82230597fb56Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
8224b042e37fSmrg
82250597fb56Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
82260597fb56Smrg	[Whether or not to build static libraries])
82270597fb56Smrg])# _LT_ENABLE_STATIC
8228b042e37fSmrg
82290597fb56SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
82300597fb56SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
8231b042e37fSmrg
82320597fb56Smrg# Old names:
82330597fb56SmrgAC_DEFUN([AC_ENABLE_STATIC],
82340597fb56Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
82350597fb56Smrg])
8236b042e37fSmrg
82370597fb56SmrgAC_DEFUN([AC_DISABLE_STATIC],
82380597fb56Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
82390597fb56Smrg])
82400597fb56Smrg
82410597fb56SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
82420597fb56SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
8243b042e37fSmrg
82440597fb56Smrgdnl aclocal-1.4 backwards compatibility:
82450597fb56Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
82460597fb56Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
8247b042e37fSmrg
8248b042e37fSmrg
8249b042e37fSmrg
82500597fb56Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
82510597fb56Smrg# ----------------------------------
82520597fb56Smrg# implement the --enable-fast-install flag, and support the `fast-install'
82530597fb56Smrg# and `disable-fast-install' LT_INIT options.
82540597fb56Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
82550597fb56Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
82560597fb56Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
82570597fb56SmrgAC_ARG_ENABLE([fast-install],
82580597fb56Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
82590597fb56Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
82600597fb56Smrg    [p=${PACKAGE-default}
82610597fb56Smrg    case $enableval in
82620597fb56Smrg    yes) enable_fast_install=yes ;;
82630597fb56Smrg    no) enable_fast_install=no ;;
82640597fb56Smrg    *)
82650597fb56Smrg      enable_fast_install=no
82660597fb56Smrg      # Look at the argument we got.  We use all the common list separators.
82670597fb56Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
82680597fb56Smrg      for pkg in $enableval; do
82690597fb56Smrg	IFS="$lt_save_ifs"
82700597fb56Smrg	if test "X$pkg" = "X$p"; then
82710597fb56Smrg	  enable_fast_install=yes
82720597fb56Smrg	fi
82730597fb56Smrg      done
82740597fb56Smrg      IFS="$lt_save_ifs"
82750597fb56Smrg      ;;
82760597fb56Smrg    esac],
82770597fb56Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
8278706b6b52Smrg
82790597fb56Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
82800597fb56Smrg	 [Whether or not to optimize for fast installation])dnl
82810597fb56Smrg])# _LT_ENABLE_FAST_INSTALL
8282b042e37fSmrg
82830597fb56SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
82840597fb56SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
8285b042e37fSmrg
82860597fb56Smrg# Old names:
82870597fb56SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
82880597fb56Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
82890597fb56SmrgAC_DIAGNOSE([obsolete],
82900597fb56Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
82910597fb56Smrgthe `fast-install' option into LT_INIT's first parameter.])
82920597fb56Smrg])
82938c4a8e55Smrg
82940597fb56SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
82950597fb56Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
82960597fb56SmrgAC_DIAGNOSE([obsolete],
82970597fb56Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
82980597fb56Smrgthe `disable-fast-install' option into LT_INIT's first parameter.])
82990597fb56Smrg])
83008c4a8e55Smrg
83010597fb56Smrgdnl aclocal-1.4 backwards compatibility:
83020597fb56Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
83030597fb56Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
8304b042e37fSmrg
8305b042e37fSmrg
83060597fb56Smrg# _LT_WITH_PIC([MODE])
83070597fb56Smrg# --------------------
83080597fb56Smrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
83090597fb56Smrg# LT_INIT options.
83100597fb56Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
83110597fb56Smrgm4_define([_LT_WITH_PIC],
83120597fb56Smrg[AC_ARG_WITH([pic],
83130597fb56Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
83140597fb56Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
83150597fb56Smrg    [lt_p=${PACKAGE-default}
83160597fb56Smrg    case $withval in
83170597fb56Smrg    yes|no) pic_mode=$withval ;;
83180597fb56Smrg    *)
83190597fb56Smrg      pic_mode=default
83200597fb56Smrg      # Look at the argument we got.  We use all the common list separators.
83210597fb56Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
83220597fb56Smrg      for lt_pkg in $withval; do
83230597fb56Smrg	IFS="$lt_save_ifs"
83240597fb56Smrg	if test "X$lt_pkg" = "X$lt_p"; then
83250597fb56Smrg	  pic_mode=yes
83260597fb56Smrg	fi
83270597fb56Smrg      done
83280597fb56Smrg      IFS="$lt_save_ifs"
83290597fb56Smrg      ;;
83300597fb56Smrg    esac],
83310597fb56Smrg    [pic_mode=default])
83328c4a8e55Smrg
83330597fb56Smrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
8334b042e37fSmrg
83350597fb56Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
83360597fb56Smrg])# _LT_WITH_PIC
83370597fb56Smrg
83380597fb56SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
83390597fb56SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
83400597fb56Smrg
83410597fb56Smrg# Old name:
83420597fb56SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
83430597fb56Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
83440597fb56SmrgAC_DIAGNOSE([obsolete],
83450597fb56Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
83460597fb56Smrgput the `pic-only' option into LT_INIT's first parameter.])
83470597fb56Smrg])
8348b042e37fSmrg
83490597fb56Smrgdnl aclocal-1.4 backwards compatibility:
83500597fb56Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
8351b042e37fSmrg
8352b042e37fSmrg
83530597fb56Smrgm4_define([_LTDL_MODE], [])
83540597fb56SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
83550597fb56Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
83560597fb56SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
83570597fb56Smrg		 [m4_define([_LTDL_MODE], [recursive])])
83580597fb56SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
83590597fb56Smrg		 [m4_define([_LTDL_MODE], [subproject])])
8360b042e37fSmrg
83610597fb56Smrgm4_define([_LTDL_TYPE], [])
83620597fb56SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
83630597fb56Smrg		 [m4_define([_LTDL_TYPE], [installable])])
83640597fb56SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
83650597fb56Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
8366b042e37fSmrg
83670597fb56Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
83680597fb56Smrg#
83690597fb56Smrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
83700597fb56Smrg# Written by Gary V. Vaughan, 2004
83710597fb56Smrg#
83720597fb56Smrg# This file is free software; the Free Software Foundation gives
83730597fb56Smrg# unlimited permission to copy and/or distribute it, with or without
83740597fb56Smrg# modifications, as long as this notice is preserved.
8375b042e37fSmrg
83760597fb56Smrg# serial 6 ltsugar.m4
8377b042e37fSmrg
83780597fb56Smrg# This is to help aclocal find these macros, as it can't see m4_define.
83790597fb56SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
8380b042e37fSmrg
8381b042e37fSmrg
83820597fb56Smrg# lt_join(SEP, ARG1, [ARG2...])
83830597fb56Smrg# -----------------------------
83840597fb56Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
83850597fb56Smrg# associated separator.
83860597fb56Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
83870597fb56Smrg# versions in m4sugar had bugs.
83880597fb56Smrgm4_define([lt_join],
83890597fb56Smrg[m4_if([$#], [1], [],
83900597fb56Smrg       [$#], [2], [[$2]],
83910597fb56Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
83920597fb56Smrgm4_define([_lt_join],
83930597fb56Smrg[m4_if([$#$2], [2], [],
83940597fb56Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
8395b042e37fSmrg
8396b042e37fSmrg
83970597fb56Smrg# lt_car(LIST)
83980597fb56Smrg# lt_cdr(LIST)
83990597fb56Smrg# ------------
84000597fb56Smrg# Manipulate m4 lists.
84010597fb56Smrg# These macros are necessary as long as will still need to support
84020597fb56Smrg# Autoconf-2.59 which quotes differently.
84030597fb56Smrgm4_define([lt_car], [[$1]])
84040597fb56Smrgm4_define([lt_cdr],
84050597fb56Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
84060597fb56Smrg       [$#], 1, [],
84070597fb56Smrg       [m4_dquote(m4_shift($@))])])
84080597fb56Smrgm4_define([lt_unquote], $1)
8409b042e37fSmrg
8410b042e37fSmrg
84110597fb56Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
84120597fb56Smrg# ------------------------------------------
84130597fb56Smrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
84140597fb56Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
84150597fb56Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
84160597fb56Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
84170597fb56Smrg# than defined and empty).
84180597fb56Smrg#
84190597fb56Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
84200597fb56Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
84210597fb56Smrgm4_define([lt_append],
84220597fb56Smrg[m4_define([$1],
84230597fb56Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
8424b042e37fSmrg
8425b042e37fSmrg
8426b042e37fSmrg
84270597fb56Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
84280597fb56Smrg# ----------------------------------------------------------
84290597fb56Smrg# Produce a SEP delimited list of all paired combinations of elements of
84300597fb56Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
84310597fb56Smrg# has the form PREFIXmINFIXSUFFIXn.
84320597fb56Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
84330597fb56Smrgm4_define([lt_combine],
84340597fb56Smrg[m4_if(m4_eval([$# > 3]), [1],
84350597fb56Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
84360597fb56Smrg[[m4_foreach([_Lt_prefix], [$2],
84370597fb56Smrg	     [m4_foreach([_Lt_suffix],
84380597fb56Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
84390597fb56Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
8440b042e37fSmrg
8441b042e37fSmrg
84420597fb56Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
84430597fb56Smrg# -----------------------------------------------------------------------
84440597fb56Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
84450597fb56Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
84460597fb56Smrgm4_define([lt_if_append_uniq],
84470597fb56Smrg[m4_ifdef([$1],
84480597fb56Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
84490597fb56Smrg		 [lt_append([$1], [$2], [$3])$4],
84500597fb56Smrg		 [$5])],
84510597fb56Smrg	  [lt_append([$1], [$2], [$3])$4])])
8452b042e37fSmrg
8453b042e37fSmrg
84540597fb56Smrg# lt_dict_add(DICT, KEY, VALUE)
84550597fb56Smrg# -----------------------------
84560597fb56Smrgm4_define([lt_dict_add],
84570597fb56Smrg[m4_define([$1($2)], [$3])])
84580597fb56Smrg
8459b042e37fSmrg
84600597fb56Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
84610597fb56Smrg# --------------------------------------------
84620597fb56Smrgm4_define([lt_dict_add_subkey],
84630597fb56Smrg[m4_define([$1($2:$3)], [$4])])
84648c4a8e55Smrg
8465b042e37fSmrg
84660597fb56Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
84670597fb56Smrg# ----------------------------------
84680597fb56Smrgm4_define([lt_dict_fetch],
84690597fb56Smrg[m4_ifval([$3],
84700597fb56Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
84710597fb56Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
8472b042e37fSmrg
8473b042e37fSmrg
84740597fb56Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
84750597fb56Smrg# -----------------------------------------------------------------
84760597fb56Smrgm4_define([lt_if_dict_fetch],
84770597fb56Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
84780597fb56Smrg	[$5],
84790597fb56Smrg    [$6])])
8480b042e37fSmrg
8481b042e37fSmrg
84820597fb56Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
84830597fb56Smrg# --------------------------------------------------------------
84840597fb56Smrgm4_define([lt_dict_filter],
84850597fb56Smrg[m4_if([$5], [], [],
84860597fb56Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
84870597fb56Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
84880597fb56Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
84890597fb56Smrg])
8490b042e37fSmrg
84910597fb56Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
84920597fb56Smrg#
84930597fb56Smrg#   Copyright (C) 2004 Free Software Foundation, Inc.
84940597fb56Smrg#   Written by Scott James Remnant, 2004
84950597fb56Smrg#
84960597fb56Smrg# This file is free software; the Free Software Foundation gives
84970597fb56Smrg# unlimited permission to copy and/or distribute it, with or without
84980597fb56Smrg# modifications, as long as this notice is preserved.
8499b042e37fSmrg
85000597fb56Smrg# @configure_input@
8501b042e37fSmrg
85020597fb56Smrg# serial 3337 ltversion.m4
85030597fb56Smrg# This file is part of GNU Libtool
8504b042e37fSmrg
85050597fb56Smrgm4_define([LT_PACKAGE_VERSION], [2.4.2])
85060597fb56Smrgm4_define([LT_PACKAGE_REVISION], [1.3337])
8507b042e37fSmrg
85080597fb56SmrgAC_DEFUN([LTVERSION_VERSION],
85090597fb56Smrg[macro_version='2.4.2'
85100597fb56Smrgmacro_revision='1.3337'
85110597fb56Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
85120597fb56Smrg_LT_DECL(, macro_revision, 0)
85130597fb56Smrg])
85148c4a8e55Smrg
85150597fb56Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
85160597fb56Smrg#
85170597fb56Smrg#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
85180597fb56Smrg#   Written by Scott James Remnant, 2004.
85190597fb56Smrg#
85200597fb56Smrg# This file is free software; the Free Software Foundation gives
85210597fb56Smrg# unlimited permission to copy and/or distribute it, with or without
85220597fb56Smrg# modifications, as long as this notice is preserved.
85238c4a8e55Smrg
85240597fb56Smrg# serial 5 lt~obsolete.m4
85250597fb56Smrg
85260597fb56Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
85270597fb56Smrg#
85280597fb56Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
85290597fb56Smrg# which have later been changed to m4_define as they aren't part of the
85300597fb56Smrg# exported API, or moved to Autoconf or Automake where they belong.
85310597fb56Smrg#
85320597fb56Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
85330597fb56Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
85340597fb56Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
85350597fb56Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
85360597fb56Smrg# and doesn't know about Autoconf macros at all.)
85370597fb56Smrg#
85380597fb56Smrg# So we provide this file, which has a silly filename so it's always
85390597fb56Smrg# included after everything else.  This provides aclocal with the
85400597fb56Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
85410597fb56Smrg# because those macros already exist, or will be overwritten later.
85420597fb56Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
85430597fb56Smrg#
85440597fb56Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
85450597fb56Smrg# Yes, that means every name once taken will need to remain here until
85460597fb56Smrg# we give up compatibility with versions before 1.7, at which point
85470597fb56Smrg# we need to keep only those names which we still refer to.
85480597fb56Smrg
85490597fb56Smrg# This is to help aclocal find these macros, as it can't see m4_define.
85500597fb56SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
85510597fb56Smrg
85520597fb56Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
85530597fb56Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
85540597fb56Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
85550597fb56Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
85560597fb56Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
85570597fb56Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
85580597fb56Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
85590597fb56Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
85600597fb56Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
85610597fb56Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
85620597fb56Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
85630597fb56Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
85640597fb56Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
85650597fb56Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
85660597fb56Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
85670597fb56Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
85680597fb56Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
85690597fb56Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
85700597fb56Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
85710597fb56Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
85720597fb56Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
85730597fb56Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
85740597fb56Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
85750597fb56Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
85760597fb56Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
85770597fb56Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
85780597fb56Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
85790597fb56Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
85800597fb56Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
85810597fb56Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
85820597fb56Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
85830597fb56Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
85840597fb56Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
85850597fb56Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
85860597fb56Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
85870597fb56Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
85880597fb56Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
85890597fb56Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
85900597fb56Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
85910597fb56Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
85920597fb56Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
85930597fb56Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
85940597fb56Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
85950597fb56Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
85960597fb56Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
85970597fb56Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
85980597fb56Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
85990597fb56Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
86000597fb56Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
86010597fb56Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
86020597fb56Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
86030597fb56Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
86040597fb56Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
86050597fb56Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
86060597fb56Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
86070597fb56Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
86080597fb56Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
86090597fb56Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
86100597fb56Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
86110597fb56Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
86120597fb56Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
86138c4a8e55Smrg
86140597fb56Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
86150597fb56Smrg# serial 1 (pkg-config-0.24)
86160597fb56Smrg# 
86170597fb56Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
86180597fb56Smrg#
86190597fb56Smrg# This program is free software; you can redistribute it and/or modify
86200597fb56Smrg# it under the terms of the GNU General Public License as published by
86210597fb56Smrg# the Free Software Foundation; either version 2 of the License, or
86220597fb56Smrg# (at your option) any later version.
86230597fb56Smrg#
86240597fb56Smrg# This program is distributed in the hope that it will be useful, but
86250597fb56Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
86260597fb56Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
86270597fb56Smrg# General Public License for more details.
86280597fb56Smrg#
86290597fb56Smrg# You should have received a copy of the GNU General Public License
86300597fb56Smrg# along with this program; if not, write to the Free Software
86310597fb56Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
86320597fb56Smrg#
86330597fb56Smrg# As a special exception to the GNU General Public License, if you
86340597fb56Smrg# distribute this file as part of a program that contains a
86350597fb56Smrg# configuration script generated by Autoconf, you may include it under
86360597fb56Smrg# the same distribution terms that you use for the rest of that program.
86378c4a8e55Smrg
86380597fb56Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
86390597fb56Smrg# ----------------------------------
86400597fb56SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
86410597fb56Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
86420597fb56Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
86430597fb56SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
86440597fb56SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
86450597fb56SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
86468c4a8e55Smrg
86470597fb56Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
86480597fb56Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
86490597fb56Smrgfi
86500597fb56Smrgif test -n "$PKG_CONFIG"; then
86510597fb56Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
86520597fb56Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
86530597fb56Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
86540597fb56Smrg		AC_MSG_RESULT([yes])
86550597fb56Smrg	else
86560597fb56Smrg		AC_MSG_RESULT([no])
86570597fb56Smrg		PKG_CONFIG=""
86580597fb56Smrg	fi
86590597fb56Smrgfi[]dnl
86600597fb56Smrg])# PKG_PROG_PKG_CONFIG
86618c4a8e55Smrg
86620597fb56Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
8663bd23fbfaSmrg#
86640597fb56Smrg# Check to see whether a particular set of modules exists.  Similar
86650597fb56Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
86660597fb56Smrg#
86670597fb56Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
86680597fb56Smrg# only at the first occurence in configure.ac, so if the first place
86690597fb56Smrg# it's called might be skipped (such as if it is within an "if", you
86700597fb56Smrg# have to call PKG_CHECK_EXISTS manually
86710597fb56Smrg# --------------------------------------------------------------
86720597fb56SmrgAC_DEFUN([PKG_CHECK_EXISTS],
86730597fb56Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
86740597fb56Smrgif test -n "$PKG_CONFIG" && \
86750597fb56Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
86760597fb56Smrg  m4_default([$2], [:])
86770597fb56Smrgm4_ifvaln([$3], [else
86780597fb56Smrg  $3])dnl
86790597fb56Smrgfi])
8680bd23fbfaSmrg
86810597fb56Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
86820597fb56Smrg# ---------------------------------------------
86830597fb56Smrgm4_define([_PKG_CONFIG],
86840597fb56Smrg[if test -n "$$1"; then
86850597fb56Smrg    pkg_cv_[]$1="$$1"
86860597fb56Smrg elif test -n "$PKG_CONFIG"; then
86870597fb56Smrg    PKG_CHECK_EXISTS([$3],
86880597fb56Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
86890597fb56Smrg		     [pkg_failed=yes])
86900597fb56Smrg else
86910597fb56Smrg    pkg_failed=untried
86920597fb56Smrgfi[]dnl
86930597fb56Smrg])# _PKG_CONFIG
86948c4a8e55Smrg
86950597fb56Smrg# _PKG_SHORT_ERRORS_SUPPORTED
86960597fb56Smrg# -----------------------------
86970597fb56SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
86980597fb56Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
86990597fb56Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
87000597fb56Smrg        _pkg_short_errors_supported=yes
87010597fb56Smrgelse
87020597fb56Smrg        _pkg_short_errors_supported=no
87030597fb56Smrgfi[]dnl
87040597fb56Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
8705bd23fbfaSmrg
8706bd23fbfaSmrg
87070597fb56Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
87080597fb56Smrg# [ACTION-IF-NOT-FOUND])
87090597fb56Smrg#
87100597fb56Smrg#
87110597fb56Smrg# Note that if there is a possibility the first call to
87120597fb56Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
87130597fb56Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
87140597fb56Smrg#
87150597fb56Smrg#
87160597fb56Smrg# --------------------------------------------------------------
87170597fb56SmrgAC_DEFUN([PKG_CHECK_MODULES],
87180597fb56Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
87190597fb56SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
87200597fb56SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
87218c4a8e55Smrg
87220597fb56Smrgpkg_failed=no
87230597fb56SmrgAC_MSG_CHECKING([for $1])
8724b042e37fSmrg
87250597fb56Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
87260597fb56Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
8727b042e37fSmrg
87280597fb56Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
87290597fb56Smrgand $1[]_LIBS to avoid the need to call pkg-config.
87300597fb56SmrgSee the pkg-config man page for more details.])
8731b042e37fSmrg
87320597fb56Smrgif test $pkg_failed = yes; then
87330597fb56Smrg   	AC_MSG_RESULT([no])
87340597fb56Smrg        _PKG_SHORT_ERRORS_SUPPORTED
87350597fb56Smrg        if test $_pkg_short_errors_supported = yes; then
87360597fb56Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
87370597fb56Smrg        else 
87380597fb56Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
87390597fb56Smrg        fi
87400597fb56Smrg	# Put the nasty error message in config.log where it belongs
87410597fb56Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
8742b042e37fSmrg
87430597fb56Smrg	m4_default([$4], [AC_MSG_ERROR(
87440597fb56Smrg[Package requirements ($2) were not met:
8745b042e37fSmrg
87460597fb56Smrg$$1_PKG_ERRORS
8747b042e37fSmrg
87480597fb56SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
87490597fb56Smrginstalled software in a non-standard prefix.
8750b042e37fSmrg
87510597fb56Smrg_PKG_TEXT])
87520597fb56Smrg        ])
87530597fb56Smrgelif test $pkg_failed = untried; then
87540597fb56Smrg     	AC_MSG_RESULT([no])
87550597fb56Smrg	m4_default([$4], [AC_MSG_FAILURE(
87560597fb56Smrg[The pkg-config script could not be found or is too old.  Make sure it
87570597fb56Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
87580597fb56Smrgpath to pkg-config.
8759b042e37fSmrg
87600597fb56Smrg_PKG_TEXT
87610597fb56Smrg
87620597fb56SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])
87630597fb56Smrg        ])
8764706b6b52Smrgelse
87650597fb56Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
87660597fb56Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
87670597fb56Smrg        AC_MSG_RESULT([yes])
87680597fb56Smrg	$3
87690597fb56Smrgfi[]dnl
87700597fb56Smrg])# PKG_CHECK_MODULES
8771b042e37fSmrg
87720597fb56Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
87730597fb56Smrgdnl
87740597fb56Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
87750597fb56Smrgdnl 
87760597fb56Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
87770597fb56Smrgdnl copy of this software and associated documentation files (the "Software"),
87780597fb56Smrgdnl to deal in the Software without restriction, including without limitation
87790597fb56Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
87800597fb56Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
87810597fb56Smrgdnl Software is furnished to do so, subject to the following conditions:
87820597fb56Smrgdnl
87830597fb56Smrgdnl The above copyright notice and this permission notice (including the next
87840597fb56Smrgdnl paragraph) shall be included in all copies or substantial portions of the
87850597fb56Smrgdnl Software.
87860597fb56Smrgdnl
87870597fb56Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
87880597fb56Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
87890597fb56Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
87900597fb56Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
87910597fb56Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
87920597fb56Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
87930597fb56Smrgdnl DEALINGS IN THE SOFTWARE.
8794b042e37fSmrg
87950597fb56Smrg# XORG_MACROS_VERSION(required-version)
87960597fb56Smrg# -------------------------------------
87970597fb56Smrg# Minimum version: 1.1.0
87980597fb56Smrg#
87990597fb56Smrg# If you're using a macro added in Version 1.1 or newer, include this in
88000597fb56Smrg# your configure.ac with the minimum required version, such as:
88010597fb56Smrg# XORG_MACROS_VERSION(1.1)
88020597fb56Smrg#
88030597fb56Smrg# To ensure that this macro is defined, also add:
88040597fb56Smrg# m4_ifndef([XORG_MACROS_VERSION],
88050597fb56Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
88060597fb56Smrg#
88070597fb56Smrg#
88080597fb56Smrg# See the "minimum version" comment for each macro you use to see what 
88090597fb56Smrg# version you require.
88100597fb56Smrgm4_defun([XORG_MACROS_VERSION],[
88110597fb56Smrgm4_define([vers_have], [1.17])
88120597fb56Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
88130597fb56Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
88140597fb56Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
88150597fb56Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
88160597fb56Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
88170597fb56Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
88180597fb56Smrgm4_undefine([vers_have])
88190597fb56Smrgm4_undefine([maj_have])
88200597fb56Smrgm4_undefine([maj_needed])
88210597fb56Smrg]) # XORG_MACROS_VERSION
8822b042e37fSmrg
88230597fb56Smrg# XORG_PROG_RAWCPP()
88240597fb56Smrg# ------------------
88250597fb56Smrg# Minimum version: 1.0.0
88260597fb56Smrg#
88270597fb56Smrg# Find cpp program and necessary flags for use in pre-processing text files
88280597fb56Smrg# such as man pages and config files
88290597fb56SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
88300597fb56SmrgAC_REQUIRE([AC_PROG_CPP])
88310597fb56SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
88320597fb56Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
8833b042e37fSmrg
88340597fb56Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
88350597fb56Smrg# which is not the best choice for supporting other OS'es, but covers most
88360597fb56Smrg# of the ones we need for now.
88370597fb56SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
88380597fb56SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
88390597fb56Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
88400597fb56Smrg	AC_MSG_RESULT([no])
88410597fb56Smrgelse
88420597fb56Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
88430597fb56Smrg		RAWCPPFLAGS=-undef
88440597fb56Smrg		AC_MSG_RESULT([yes])
88450597fb56Smrg	# under Cygwin unix is still defined even with -undef
88460597fb56Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
88470597fb56Smrg		RAWCPPFLAGS="-undef -ansi"
88480597fb56Smrg		AC_MSG_RESULT([yes, with -ansi])
88490597fb56Smrg	else
88500597fb56Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
88510597fb56Smrg	fi
88520597fb56Smrgfi
88530597fb56Smrgrm -f conftest.$ac_ext
8854b042e37fSmrg
88550597fb56SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
88560597fb56SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
88570597fb56Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
88580597fb56Smrg	AC_MSG_RESULT([no])
88590597fb56Smrgelse
88600597fb56Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
88610597fb56Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
88620597fb56Smrg		AC_MSG_RESULT([yes])
88630597fb56Smrg	else
88640597fb56Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
88650597fb56Smrg	fi
88660597fb56Smrgfi
88670597fb56Smrgrm -f conftest.$ac_ext
88680597fb56SmrgAC_SUBST(RAWCPPFLAGS)
88690597fb56Smrg]) # XORG_PROG_RAWCPP
8870706b6b52Smrg
88710597fb56Smrg# XORG_MANPAGE_SECTIONS()
88720597fb56Smrg# -----------------------
88730597fb56Smrg# Minimum version: 1.0.0
88740597fb56Smrg#
88750597fb56Smrg# Determine which sections man pages go in for the different man page types
88760597fb56Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
88770597fb56Smrg# Not sure if there's any better way than just hardcoding by OS name.
88780597fb56Smrg# Override default settings by setting environment variables
88790597fb56Smrg# Added MAN_SUBSTS in version 1.8
88800597fb56Smrg# Added AC_PROG_SED in version 1.8
8881b042e37fSmrg
88820597fb56SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
88830597fb56SmrgAC_REQUIRE([AC_CANONICAL_HOST])
88840597fb56SmrgAC_REQUIRE([AC_PROG_SED])
8885b042e37fSmrg
88860597fb56Smrgif test x$APP_MAN_SUFFIX = x    ; then
88870597fb56Smrg    APP_MAN_SUFFIX=1
88880597fb56Smrgfi
88890597fb56Smrgif test x$APP_MAN_DIR = x    ; then
88900597fb56Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
8891706b6b52Smrgfi
8892b042e37fSmrg
88930597fb56Smrgif test x$LIB_MAN_SUFFIX = x    ; then
88940597fb56Smrg    LIB_MAN_SUFFIX=3
88950597fb56Smrgfi
88960597fb56Smrgif test x$LIB_MAN_DIR = x    ; then
88970597fb56Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
88980597fb56Smrgfi
88998c4a8e55Smrg
89000597fb56Smrgif test x$FILE_MAN_SUFFIX = x    ; then
89010597fb56Smrg    case $host_os in
89020597fb56Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
89030597fb56Smrg	*)		FILE_MAN_SUFFIX=5  ;;
89040597fb56Smrg    esac
89050597fb56Smrgfi
89060597fb56Smrgif test x$FILE_MAN_DIR = x    ; then
89070597fb56Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
89080597fb56Smrgfi
89090597fb56Smrg
89100597fb56Smrgif test x$MISC_MAN_SUFFIX = x    ; then
89110597fb56Smrg    case $host_os in
89120597fb56Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
89130597fb56Smrg	*)		MISC_MAN_SUFFIX=7  ;;
89140597fb56Smrg    esac
89150597fb56Smrgfi
89160597fb56Smrgif test x$MISC_MAN_DIR = x    ; then
89170597fb56Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
8918706b6b52Smrgfi
89198c4a8e55Smrg
89200597fb56Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
89210597fb56Smrg    case $host_os in
89220597fb56Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
89230597fb56Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
89240597fb56Smrg    esac
89250597fb56Smrgfi
89260597fb56Smrgif test x$DRIVER_MAN_DIR = x    ; then
89270597fb56Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
89280597fb56Smrgfi
89298c4a8e55Smrg
89300597fb56Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
89310597fb56Smrg    case $host_os in
89320597fb56Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
89330597fb56Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
89340597fb56Smrg    esac
89350597fb56Smrgfi
89360597fb56Smrgif test x$ADMIN_MAN_DIR = x    ; then
89370597fb56Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
89380597fb56Smrgfi
89398c4a8e55Smrg
89408c4a8e55Smrg
89410597fb56SmrgAC_SUBST([APP_MAN_SUFFIX])
89420597fb56SmrgAC_SUBST([LIB_MAN_SUFFIX])
89430597fb56SmrgAC_SUBST([FILE_MAN_SUFFIX])
89440597fb56SmrgAC_SUBST([MISC_MAN_SUFFIX])
89450597fb56SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
89460597fb56SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
89470597fb56SmrgAC_SUBST([APP_MAN_DIR])
89480597fb56SmrgAC_SUBST([LIB_MAN_DIR])
89490597fb56SmrgAC_SUBST([FILE_MAN_DIR])
89500597fb56SmrgAC_SUBST([MISC_MAN_DIR])
89510597fb56SmrgAC_SUBST([DRIVER_MAN_DIR])
89520597fb56SmrgAC_SUBST([ADMIN_MAN_DIR])
89538c4a8e55Smrg
89540597fb56SmrgXORG_MAN_PAGE="X Version 11"
89550597fb56SmrgAC_SUBST([XORG_MAN_PAGE])
89560597fb56SmrgMAN_SUBSTS="\
89570597fb56Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
89580597fb56Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
89590597fb56Smrg	-e 's|__xservername__|Xorg|g' \
89600597fb56Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
89610597fb56Smrg	-e 's|__projectroot__|\$(prefix)|g' \
89620597fb56Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
89630597fb56Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
89640597fb56Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
89650597fb56Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
89660597fb56Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
89670597fb56Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
89680597fb56Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
89690597fb56SmrgAC_SUBST([MAN_SUBSTS])
89708c4a8e55Smrg
89710597fb56Smrg]) # XORG_MANPAGE_SECTIONS
89728c4a8e55Smrg
89730597fb56Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
89740597fb56Smrg# ------------------------
89750597fb56Smrg# Minimum version: 1.7.0
89760597fb56Smrg#
89770597fb56Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
89780597fb56Smrg# provided by xorg-sgml-doctools, if installed.
89790597fb56SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
89800597fb56SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
89810597fb56SmrgXORG_SGML_PATH=
89820597fb56SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
89830597fb56Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
89840597fb56Smrg    [m4_ifval([$1],[:],
89850597fb56Smrg        [if test x"$cross_compiling" != x"yes" ; then
89860597fb56Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
89870597fb56Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
89880597fb56Smrg         fi])
89890597fb56Smrg    ])
89908c4a8e55Smrg
89910597fb56Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
89920597fb56Smrg# the path and the name of the doc stylesheet
89930597fb56Smrgif test "x$XORG_SGML_PATH" != "x" ; then
89940597fb56Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
89950597fb56Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
89960597fb56Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
89970597fb56Smrgelse
89980597fb56Smrg   AC_MSG_RESULT([no])
89990597fb56Smrgfi
90008c4a8e55Smrg
90010597fb56SmrgAC_SUBST(XORG_SGML_PATH)
90020597fb56SmrgAC_SUBST(STYLESHEET_SRCDIR)
90030597fb56SmrgAC_SUBST(XSL_STYLESHEET)
90040597fb56SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
90050597fb56Smrg]) # XORG_CHECK_SGML_DOCTOOLS
90068c4a8e55Smrg
90070597fb56Smrg# XORG_CHECK_LINUXDOC
90080597fb56Smrg# -------------------
90090597fb56Smrg# Minimum version: 1.0.0
90100597fb56Smrg#
90110597fb56Smrg# Defines the variable MAKE_TEXT if the necessary tools and
90120597fb56Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
90130597fb56Smrg# Whether or not the necessary tools and files are found can be checked
90140597fb56Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
90150597fb56SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
90160597fb56SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
90170597fb56SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
9018b042e37fSmrg
90190597fb56SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
9020b042e37fSmrg
90210597fb56SmrgAC_MSG_CHECKING([whether to build documentation])
9022b042e37fSmrg
90230597fb56Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
90240597fb56Smrg   BUILDDOC=yes
90250597fb56Smrgelse
90260597fb56Smrg   BUILDDOC=no
90270597fb56Smrgfi
9028b042e37fSmrg
90290597fb56SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
9030b042e37fSmrg
90310597fb56SmrgAC_MSG_RESULT([$BUILDDOC])
9032b042e37fSmrg
90330597fb56SmrgAC_MSG_CHECKING([whether to build pdf documentation])
9034b042e37fSmrg
90350597fb56Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
90360597fb56Smrg   BUILDPDFDOC=yes
90370597fb56Smrgelse
90380597fb56Smrg   BUILDPDFDOC=no
90390597fb56Smrgfi
9040b042e37fSmrg
90410597fb56SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9042b042e37fSmrg
90430597fb56SmrgAC_MSG_RESULT([$BUILDPDFDOC])
9044b042e37fSmrg
90450597fb56SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
90460597fb56SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
90470597fb56SmrgMAKE_PDF="$PS2PDF"
90480597fb56SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
90490597fb56Smrg
90500597fb56SmrgAC_SUBST(MAKE_TEXT)
90510597fb56SmrgAC_SUBST(MAKE_PS)
90520597fb56SmrgAC_SUBST(MAKE_PDF)
90530597fb56SmrgAC_SUBST(MAKE_HTML)
90540597fb56Smrg]) # XORG_CHECK_LINUXDOC
9055b042e37fSmrg
90560597fb56Smrg# XORG_CHECK_DOCBOOK
90570597fb56Smrg# -------------------
90580597fb56Smrg# Minimum version: 1.0.0
90590597fb56Smrg#
90600597fb56Smrg# Checks for the ability to build output formats from SGML DocBook source.
90610597fb56Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
90620597fb56Smrg# indicates whether the necessary tools and files are found and, if set,
90630597fb56Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
90640597fb56SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
90650597fb56SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9066b042e37fSmrg
90670597fb56SmrgBUILDTXTDOC=no
90680597fb56SmrgBUILDPDFDOC=no
90690597fb56SmrgBUILDPSDOC=no
90700597fb56SmrgBUILDHTMLDOC=no
9071b042e37fSmrg
90720597fb56SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
90730597fb56SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
90740597fb56SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
90750597fb56SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
9076b042e37fSmrg
90770597fb56SmrgAC_MSG_CHECKING([whether to build text documentation])
90780597fb56Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
90790597fb56Smrg   test x$BUILD_TXTDOC != xno; then
90800597fb56Smrg	BUILDTXTDOC=yes
90810597fb56Smrgfi
90820597fb56SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
90830597fb56SmrgAC_MSG_RESULT([$BUILDTXTDOC])
9084b042e37fSmrg
90850597fb56SmrgAC_MSG_CHECKING([whether to build PDF documentation])
90860597fb56Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
90870597fb56Smrg   test x$BUILD_PDFDOC != xno; then
90880597fb56Smrg	BUILDPDFDOC=yes
90890597fb56Smrgfi
90900597fb56SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
90910597fb56SmrgAC_MSG_RESULT([$BUILDPDFDOC])
9092b042e37fSmrg
90930597fb56SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
90940597fb56Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
90950597fb56Smrg   test x$BUILD_PSDOC != xno; then
90960597fb56Smrg	BUILDPSDOC=yes
90970597fb56Smrgfi
90980597fb56SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
90990597fb56SmrgAC_MSG_RESULT([$BUILDPSDOC])
91008c4a8e55Smrg
91010597fb56SmrgAC_MSG_CHECKING([whether to build HTML documentation])
91020597fb56Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
91030597fb56Smrg   test x$BUILD_HTMLDOC != xno; then
91040597fb56Smrg	BUILDHTMLDOC=yes
91050597fb56Smrgfi
91060597fb56SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
91070597fb56SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
91088c4a8e55Smrg
91090597fb56SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
91100597fb56SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
91110597fb56SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
91120597fb56SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
9113b042e37fSmrg
91140597fb56SmrgAC_SUBST(MAKE_TEXT)
91150597fb56SmrgAC_SUBST(MAKE_PS)
91160597fb56SmrgAC_SUBST(MAKE_PDF)
91170597fb56SmrgAC_SUBST(MAKE_HTML)
91180597fb56Smrg]) # XORG_CHECK_DOCBOOK
91198c4a8e55Smrg
91200597fb56Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
91210597fb56Smrg# ----------------
91220597fb56Smrg# Minimum version: 1.5.0
91230597fb56Smrg# Minimum version for optional DEFAULT argument: 1.11.0
91240597fb56Smrg#
91250597fb56Smrg# Documentation tools are not always available on all platforms and sometimes
91260597fb56Smrg# not at the appropriate level. This macro enables a module to test for the
91270597fb56Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
91280597fb56Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
91290597fb56Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
91300597fb56Smrg# --with-xmlto assumes 'auto'.
91310597fb56Smrg#
91320597fb56Smrg# Interface to module:
91330597fb56Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
91340597fb56Smrg# XMLTO:	returns the path of the xmlto program found
91350597fb56Smrg#		returns the path set by the user in the environment
91360597fb56Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
91370597fb56Smrg#		'no' user instructs the module not to use xmlto
91380597fb56Smrg#
91390597fb56Smrg# Added in version 1.10.0
91400597fb56Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
91410597fb56Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
91420597fb56Smrg#
91430597fb56Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
91440597fb56Smrg#
91450597fb56SmrgAC_DEFUN([XORG_WITH_XMLTO],[
91460597fb56SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
91470597fb56Smrgm4_define([_defopt], m4_default([$2], [auto]))
91480597fb56SmrgAC_ARG_WITH(xmlto,
91490597fb56Smrg	AS_HELP_STRING([--with-xmlto],
91500597fb56Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
91510597fb56Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
91520597fb56Smrgm4_undefine([_defopt])
9153706b6b52Smrg
91540597fb56Smrgif test "x$use_xmlto" = x"auto"; then
91550597fb56Smrg   AC_PATH_PROG([XMLTO], [xmlto])
91560597fb56Smrg   if test "x$XMLTO" = "x"; then
91570597fb56Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
91580597fb56Smrg	have_xmlto=no
91590597fb56Smrg   else
91600597fb56Smrg        have_xmlto=yes
91610597fb56Smrg   fi
91620597fb56Smrgelif test "x$use_xmlto" = x"yes" ; then
91630597fb56Smrg   AC_PATH_PROG([XMLTO], [xmlto])
91640597fb56Smrg   if test "x$XMLTO" = "x"; then
91650597fb56Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
91660597fb56Smrg   fi
91670597fb56Smrg   have_xmlto=yes
91680597fb56Smrgelif test "x$use_xmlto" = x"no" ; then
91690597fb56Smrg   if test "x$XMLTO" != "x"; then
91700597fb56Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
91710597fb56Smrg   fi
91720597fb56Smrg   have_xmlto=no
91730597fb56Smrgelse
91740597fb56Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
91750597fb56Smrgfi
91768c4a8e55Smrg
91770597fb56Smrg# Test for a minimum version of xmlto, if provided.
91780597fb56Smrgm4_ifval([$1],
91790597fb56Smrg[if test "$have_xmlto" = yes; then
91800597fb56Smrg    # scrape the xmlto version
91810597fb56Smrg    AC_MSG_CHECKING([the xmlto version])
91820597fb56Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
91830597fb56Smrg    AC_MSG_RESULT([$xmlto_version])
91840597fb56Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
91850597fb56Smrg        [if test "x$use_xmlto" = xauto; then
91860597fb56Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
91870597fb56Smrg            have_xmlto=no
91880597fb56Smrg        else
91890597fb56Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
91900597fb56Smrg        fi])
91910597fb56Smrgfi])
91920597fb56Smrg
91930597fb56Smrg# Test for the ability of xmlto to generate a text target
91940597fb56Smrghave_xmlto_text=no
91950597fb56Smrgcat > conftest.xml << "EOF"
91960597fb56SmrgEOF
91970597fb56SmrgAS_IF([test "$have_xmlto" = yes],
91980597fb56Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
91990597fb56Smrg             [have_xmlto_text=yes],
92000597fb56Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
92010597fb56Smrgrm -f conftest.xml
92020597fb56SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
92030597fb56SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
92040597fb56Smrg]) # XORG_WITH_XMLTO
92050597fb56Smrg
92060597fb56Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
92070597fb56Smrg# --------------------------------------------
92080597fb56Smrg# Minimum version: 1.12.0
92090597fb56Smrg# Minimum version for optional DEFAULT argument: 1.12.0
92100597fb56Smrg#
92110597fb56Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
92120597fb56Smrg# XML-based language used for the transformation of XML documents.
92130597fb56Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
92140597fb56Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
92150597fb56Smrg# The XSLT processor is often used as a standalone tool for transformations.
92160597fb56Smrg# It should not be assumed that this tool is used only to work with documnetation.
92170597fb56Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
92180597fb56Smrg#
92190597fb56Smrg# Interface to module:
92200597fb56Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
92210597fb56Smrg# XSLTPROC:	 returns the path of the xsltproc program found
92220597fb56Smrg#		 returns the path set by the user in the environment
92230597fb56Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
92240597fb56Smrg#		  'no' user instructs the module not to use xsltproc
92250597fb56Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
92260597fb56Smrg#
92270597fb56Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
92280597fb56Smrg#
92290597fb56SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
92300597fb56SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
92310597fb56Smrg# Preserves the interface, should it be implemented later
92320597fb56Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
92330597fb56Smrgm4_define([_defopt], m4_default([$2], [auto]))
92340597fb56SmrgAC_ARG_WITH(xsltproc,
92350597fb56Smrg	AS_HELP_STRING([--with-xsltproc],
92360597fb56Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
92370597fb56Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
92380597fb56Smrgm4_undefine([_defopt])
92390597fb56Smrg
92400597fb56Smrgif test "x$use_xsltproc" = x"auto"; then
92410597fb56Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
92420597fb56Smrg   if test "x$XSLTPROC" = "x"; then
92430597fb56Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
92440597fb56Smrg	have_xsltproc=no
92450597fb56Smrg   else
92460597fb56Smrg        have_xsltproc=yes
92470597fb56Smrg   fi
92480597fb56Smrgelif test "x$use_xsltproc" = x"yes" ; then
92490597fb56Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
92500597fb56Smrg   if test "x$XSLTPROC" = "x"; then
92510597fb56Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
92520597fb56Smrg   fi
92530597fb56Smrg   have_xsltproc=yes
92540597fb56Smrgelif test "x$use_xsltproc" = x"no" ; then
92550597fb56Smrg   if test "x$XSLTPROC" != "x"; then
92560597fb56Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
92570597fb56Smrg   fi
92580597fb56Smrg   have_xsltproc=no
92590597fb56Smrgelse
92600597fb56Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
92610597fb56Smrgfi
92628c4a8e55Smrg
92630597fb56SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
92640597fb56Smrg]) # XORG_WITH_XSLTPROC
92658c4a8e55Smrg
92660597fb56Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
92670597fb56Smrg# ----------------------------------------
92680597fb56Smrg# Minimum version: 1.15.0
92690597fb56Smrg#
92700597fb56Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
92710597fb56Smrg# scanning arbitrary text files, extracting information from those text files,
92720597fb56Smrg# and printing reports based on that information.
92730597fb56Smrg#
92740597fb56Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
92750597fb56Smrg#
92760597fb56Smrg# Interface to module:
92770597fb56Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
92780597fb56Smrg# PERL:	     returns the path of the perl program found
92790597fb56Smrg#	     returns the path set by the user in the environment
92800597fb56Smrg# --with-perl: 'yes' user instructs the module to use perl
92810597fb56Smrg#	       'no' user instructs the module not to use perl
92820597fb56Smrg# have_perl: returns yes if perl found in PATH or no
92830597fb56Smrg#
92840597fb56Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
92850597fb56Smrg#
92860597fb56SmrgAC_DEFUN([XORG_WITH_PERL],[
92870597fb56SmrgAC_ARG_VAR([PERL], [Path to perl command])
92880597fb56Smrg# Preserves the interface, should it be implemented later
92890597fb56Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
92900597fb56Smrgm4_define([_defopt], m4_default([$2], [auto]))
92910597fb56SmrgAC_ARG_WITH(perl,
92920597fb56Smrg	AS_HELP_STRING([--with-perl],
92930597fb56Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
92940597fb56Smrg	   [use_perl=$withval], [use_perl=]_defopt)
92950597fb56Smrgm4_undefine([_defopt])
92968c4a8e55Smrg
92970597fb56Smrgif test "x$use_perl" = x"auto"; then
92980597fb56Smrg   AC_PATH_PROG([PERL], [perl])
92990597fb56Smrg   if test "x$PERL" = "x"; then
93000597fb56Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
93010597fb56Smrg	have_perl=no
93020597fb56Smrg   else
93030597fb56Smrg        have_perl=yes
93040597fb56Smrg   fi
93050597fb56Smrgelif test "x$use_perl" = x"yes" ; then
93060597fb56Smrg   AC_PATH_PROG([PERL], [perl])
93070597fb56Smrg   if test "x$PERL" = "x"; then
93080597fb56Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
93090597fb56Smrg   fi
93100597fb56Smrg   have_perl=yes
93110597fb56Smrgelif test "x$use_perl" = x"no" ; then
93120597fb56Smrg   if test "x$PERL" != "x"; then
93130597fb56Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
93140597fb56Smrg   fi
93150597fb56Smrg   have_perl=no
93160597fb56Smrgelse
93170597fb56Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
93180597fb56Smrgfi
93198c4a8e55Smrg
93200597fb56SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
93210597fb56Smrg]) # XORG_WITH_PERL
93228c4a8e55Smrg
93230597fb56Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
93240597fb56Smrg# ----------------
93250597fb56Smrg# Minimum version: 1.5.0
93260597fb56Smrg# Minimum version for optional DEFAULT argument: 1.11.0
93270597fb56Smrg#
93280597fb56Smrg# Documentation tools are not always available on all platforms and sometimes
93290597fb56Smrg# not at the appropriate level. This macro enables a module to test for the
93300597fb56Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
93310597fb56Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
93320597fb56Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
93330597fb56Smrg# --with-asciidoc assumes 'auto'.
93340597fb56Smrg#
93350597fb56Smrg# Interface to module:
93360597fb56Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
93370597fb56Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
93380597fb56Smrg#		 returns the path set by the user in the environment
93390597fb56Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
93400597fb56Smrg#		  'no' user instructs the module not to use asciidoc
93410597fb56Smrg#
93420597fb56Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
93430597fb56Smrg#
93440597fb56SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
93450597fb56SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
93460597fb56Smrgm4_define([_defopt], m4_default([$2], [auto]))
93470597fb56SmrgAC_ARG_WITH(asciidoc,
93480597fb56Smrg	AS_HELP_STRING([--with-asciidoc],
93490597fb56Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
93500597fb56Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
93510597fb56Smrgm4_undefine([_defopt])
93528c4a8e55Smrg
93530597fb56Smrgif test "x$use_asciidoc" = x"auto"; then
93540597fb56Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
93550597fb56Smrg   if test "x$ASCIIDOC" = "x"; then
93560597fb56Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
93570597fb56Smrg	have_asciidoc=no
93580597fb56Smrg   else
93590597fb56Smrg        have_asciidoc=yes
93600597fb56Smrg   fi
93610597fb56Smrgelif test "x$use_asciidoc" = x"yes" ; then
93620597fb56Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
93630597fb56Smrg   if test "x$ASCIIDOC" = "x"; then
93640597fb56Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
93650597fb56Smrg   fi
93660597fb56Smrg   have_asciidoc=yes
93670597fb56Smrgelif test "x$use_asciidoc" = x"no" ; then
93680597fb56Smrg   if test "x$ASCIIDOC" != "x"; then
93690597fb56Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
93700597fb56Smrg   fi
93710597fb56Smrg   have_asciidoc=no
93720597fb56Smrgelse
93730597fb56Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
93740597fb56Smrgfi
93750597fb56Smrgm4_ifval([$1],
93760597fb56Smrg[if test "$have_asciidoc" = yes; then
93770597fb56Smrg    # scrape the asciidoc version
93780597fb56Smrg    AC_MSG_CHECKING([the asciidoc version])
93790597fb56Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
93800597fb56Smrg    AC_MSG_RESULT([$asciidoc_version])
93810597fb56Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
93820597fb56Smrg        [if test "x$use_asciidoc" = xauto; then
93830597fb56Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
93840597fb56Smrg            have_asciidoc=no
93850597fb56Smrg        else
93860597fb56Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
93870597fb56Smrg        fi])
93880597fb56Smrgfi])
93890597fb56SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
93900597fb56Smrg]) # XORG_WITH_ASCIIDOC
93918c4a8e55Smrg
93920597fb56Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
93930597fb56Smrg# --------------------------------
93940597fb56Smrg# Minimum version: 1.5.0
93950597fb56Smrg# Minimum version for optional DEFAULT argument: 1.11.0
93960597fb56Smrg#
93970597fb56Smrg# Documentation tools are not always available on all platforms and sometimes
93980597fb56Smrg# not at the appropriate level. This macro enables a module to test for the
93990597fb56Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
94000597fb56Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
94010597fb56Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
94020597fb56Smrg# --with-doxygen assumes 'auto'.
94030597fb56Smrg#
94040597fb56Smrg# Interface to module:
94050597fb56Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
94060597fb56Smrg# DOXYGEN:	 returns the path of the doxygen program found
94070597fb56Smrg#		 returns the path set by the user in the environment
94080597fb56Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
94090597fb56Smrg#		  'no' user instructs the module not to use doxygen
94100597fb56Smrg#
94110597fb56Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
94120597fb56Smrg#
94130597fb56SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
94140597fb56SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
94150597fb56Smrgm4_define([_defopt], m4_default([$2], [auto]))
94160597fb56SmrgAC_ARG_WITH(doxygen,
94170597fb56Smrg	AS_HELP_STRING([--with-doxygen],
94180597fb56Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
94190597fb56Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
94200597fb56Smrgm4_undefine([_defopt])
94218c4a8e55Smrg
94220597fb56Smrgif test "x$use_doxygen" = x"auto"; then
94230597fb56Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
94240597fb56Smrg   if test "x$DOXYGEN" = "x"; then
94250597fb56Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
94260597fb56Smrg	have_doxygen=no
94270597fb56Smrg   else
94280597fb56Smrg        have_doxygen=yes
94290597fb56Smrg   fi
94300597fb56Smrgelif test "x$use_doxygen" = x"yes" ; then
94310597fb56Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
94320597fb56Smrg   if test "x$DOXYGEN" = "x"; then
94330597fb56Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
94340597fb56Smrg   fi
94350597fb56Smrg   have_doxygen=yes
94360597fb56Smrgelif test "x$use_doxygen" = x"no" ; then
94370597fb56Smrg   if test "x$DOXYGEN" != "x"; then
94380597fb56Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
94390597fb56Smrg   fi
94400597fb56Smrg   have_doxygen=no
94410597fb56Smrgelse
94420597fb56Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
94430597fb56Smrgfi
94440597fb56Smrgm4_ifval([$1],
94450597fb56Smrg[if test "$have_doxygen" = yes; then
94460597fb56Smrg    # scrape the doxygen version
94470597fb56Smrg    AC_MSG_CHECKING([the doxygen version])
94480597fb56Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
94490597fb56Smrg    AC_MSG_RESULT([$doxygen_version])
94500597fb56Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
94510597fb56Smrg        [if test "x$use_doxygen" = xauto; then
94520597fb56Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
94530597fb56Smrg            have_doxygen=no
94540597fb56Smrg        else
94550597fb56Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
94560597fb56Smrg        fi])
94570597fb56Smrgfi])
94580597fb56SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
94590597fb56Smrg]) # XORG_WITH_DOXYGEN
94608c4a8e55Smrg
94610597fb56Smrg# XORG_WITH_GROFF([DEFAULT])
94620597fb56Smrg# ----------------
94630597fb56Smrg# Minimum version: 1.6.0
94640597fb56Smrg# Minimum version for optional DEFAULT argument: 1.11.0
94650597fb56Smrg#
94660597fb56Smrg# Documentation tools are not always available on all platforms and sometimes
94670597fb56Smrg# not at the appropriate level. This macro enables a module to test for the
94680597fb56Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
94690597fb56Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
94700597fb56Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
94710597fb56Smrg# --with-groff assumes 'auto'.
94720597fb56Smrg#
94730597fb56Smrg# Interface to module:
94740597fb56Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
94750597fb56Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
94760597fb56Smrg# HAVE_GROFF_MS: the -ms macros package
94770597fb56Smrg# GROFF:	 returns the path of the groff program found
94780597fb56Smrg#		 returns the path set by the user in the environment
94790597fb56Smrg# --with-groff:	 'yes' user instructs the module to use groff
94800597fb56Smrg#		 'no' user instructs the module not to use groff
94810597fb56Smrg#
94820597fb56Smrg# Added in version 1.9.0:
94830597fb56Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
94840597fb56Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
94850597fb56Smrg#		   psselect from the psutils package.
94860597fb56Smrg#		   the ghostcript package. Refer to the grohtml man pages
94870597fb56Smrg#
94880597fb56Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
94890597fb56Smrg#
94900597fb56Smrg# OS and distros often splits groff in a basic and full package, the former
94910597fb56Smrg# having the groff program and the later having devices, fonts and macros
94920597fb56Smrg# Checking for the groff executable is not enough.
94930597fb56Smrg#
94940597fb56Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
94950597fb56Smrg# unset HAVE_GROFF or GROFF env variables.
94960597fb56Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
94970597fb56Smrg#
94980597fb56SmrgAC_DEFUN([XORG_WITH_GROFF],[
94990597fb56SmrgAC_ARG_VAR([GROFF], [Path to groff command])
95000597fb56Smrgm4_define([_defopt], m4_default([$1], [auto]))
95010597fb56SmrgAC_ARG_WITH(groff,
95020597fb56Smrg	AS_HELP_STRING([--with-groff],
95030597fb56Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
95040597fb56Smrg	   [use_groff=$withval], [use_groff=]_defopt)
95050597fb56Smrgm4_undefine([_defopt])
95068c4a8e55Smrg
95070597fb56Smrgif test "x$use_groff" = x"auto"; then
95080597fb56Smrg   AC_PATH_PROG([GROFF], [groff])
95090597fb56Smrg   if test "x$GROFF" = "x"; then
95100597fb56Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
95110597fb56Smrg	have_groff=no
95120597fb56Smrg   else
95130597fb56Smrg        have_groff=yes
95140597fb56Smrg   fi
95150597fb56Smrgelif test "x$use_groff" = x"yes" ; then
95160597fb56Smrg   AC_PATH_PROG([GROFF], [groff])
95170597fb56Smrg   if test "x$GROFF" = "x"; then
95180597fb56Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
95190597fb56Smrg   fi
95200597fb56Smrg   have_groff=yes
95210597fb56Smrgelif test "x$use_groff" = x"no" ; then
95220597fb56Smrg   if test "x$GROFF" != "x"; then
95230597fb56Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
95240597fb56Smrg   fi
95250597fb56Smrg   have_groff=no
95260597fb56Smrgelse
95270597fb56Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
95280597fb56Smrgfi
95298c4a8e55Smrg
95300597fb56Smrg# We have groff, test for the presence of the macro packages
95310597fb56Smrgif test "x$have_groff" = x"yes"; then
95320597fb56Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
95330597fb56Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
95340597fb56Smrg        groff_ms_works=yes
95350597fb56Smrg    else
95360597fb56Smrg        groff_ms_works=no
95370597fb56Smrg    fi
95380597fb56Smrg    AC_MSG_RESULT([$groff_ms_works])
95390597fb56Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
95400597fb56Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
95410597fb56Smrg        groff_mm_works=yes
95420597fb56Smrg    else
95430597fb56Smrg        groff_mm_works=no
95440597fb56Smrg    fi
95450597fb56Smrg    AC_MSG_RESULT([$groff_mm_works])
95460597fb56Smrgfi
95478c4a8e55Smrg
95480597fb56Smrg# We have groff, test for HTML dependencies, one command per package
95490597fb56Smrgif test "x$have_groff" = x"yes"; then
95500597fb56Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
95510597fb56Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
95520597fb56Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
95530597fb56Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
95540597fb56Smrg      have_groff_html=yes
95550597fb56Smrg   else
95560597fb56Smrg      have_groff_html=no
95570597fb56Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
95580597fb56Smrg   fi
95590597fb56Smrgfi
95608c4a8e55Smrg
95610597fb56Smrg# Set Automake conditionals for Makefiles
95620597fb56SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
95630597fb56SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
95640597fb56SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
95650597fb56SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
95660597fb56Smrg]) # XORG_WITH_GROFF
95678c4a8e55Smrg
95680597fb56Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
95690597fb56Smrg# ---------------------------------------
95700597fb56Smrg# Minimum version: 1.6.0
95710597fb56Smrg# Minimum version for optional DEFAULT argument: 1.11.0
95720597fb56Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
95730597fb56Smrg#
95740597fb56Smrg# Documentation tools are not always available on all platforms and sometimes
95750597fb56Smrg# not at the appropriate level. This macro enables a module to test for the
95760597fb56Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
95770597fb56Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
95780597fb56Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
95790597fb56Smrg# --with-fop assumes 'auto'.
95800597fb56Smrg#
95810597fb56Smrg# Interface to module:
95820597fb56Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
95830597fb56Smrg# FOP:	 	returns the path of the fop program found
95840597fb56Smrg#		returns the path set by the user in the environment
95850597fb56Smrg# --with-fop: 	'yes' user instructs the module to use fop
95860597fb56Smrg#		'no' user instructs the module not to use fop
95870597fb56Smrg#
95880597fb56Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
95890597fb56Smrg#
95900597fb56SmrgAC_DEFUN([XORG_WITH_FOP],[
95910597fb56SmrgAC_ARG_VAR([FOP], [Path to fop command])
95920597fb56Smrgm4_define([_defopt], m4_default([$2], [auto]))
95930597fb56SmrgAC_ARG_WITH(fop,
95940597fb56Smrg	AS_HELP_STRING([--with-fop],
95950597fb56Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
95960597fb56Smrg	   [use_fop=$withval], [use_fop=]_defopt)
95970597fb56Smrgm4_undefine([_defopt])
95988c4a8e55Smrg
95990597fb56Smrgif test "x$use_fop" = x"auto"; then
96000597fb56Smrg   AC_PATH_PROG([FOP], [fop])
96010597fb56Smrg   if test "x$FOP" = "x"; then
96020597fb56Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
96030597fb56Smrg	have_fop=no
96040597fb56Smrg   else
96050597fb56Smrg        have_fop=yes
96060597fb56Smrg   fi
96070597fb56Smrgelif test "x$use_fop" = x"yes" ; then
96080597fb56Smrg   AC_PATH_PROG([FOP], [fop])
96090597fb56Smrg   if test "x$FOP" = "x"; then
96100597fb56Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
96110597fb56Smrg   fi
96120597fb56Smrg   have_fop=yes
96130597fb56Smrgelif test "x$use_fop" = x"no" ; then
96140597fb56Smrg   if test "x$FOP" != "x"; then
96150597fb56Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
96160597fb56Smrg   fi
96170597fb56Smrg   have_fop=no
96180597fb56Smrgelse
96190597fb56Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
96200597fb56Smrgfi
96218c4a8e55Smrg
96220597fb56Smrg# Test for a minimum version of fop, if provided.
96230597fb56Smrgm4_ifval([$1],
96240597fb56Smrg[if test "$have_fop" = yes; then
96250597fb56Smrg    # scrape the fop version
96260597fb56Smrg    AC_MSG_CHECKING([for fop minimum version])
96270597fb56Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
96280597fb56Smrg    AC_MSG_RESULT([$fop_version])
96290597fb56Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
96300597fb56Smrg        [if test "x$use_fop" = xauto; then
96310597fb56Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
96320597fb56Smrg            have_fop=no
96330597fb56Smrg        else
96340597fb56Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
96350597fb56Smrg        fi])
96360597fb56Smrgfi])
96370597fb56SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
96380597fb56Smrg]) # XORG_WITH_FOP
96398c4a8e55Smrg
96400597fb56Smrg# XORG_WITH_PS2PDF([DEFAULT])
96410597fb56Smrg# ----------------
96420597fb56Smrg# Minimum version: 1.6.0
96430597fb56Smrg# Minimum version for optional DEFAULT argument: 1.11.0
96440597fb56Smrg#
96450597fb56Smrg# Documentation tools are not always available on all platforms and sometimes
96460597fb56Smrg# not at the appropriate level. This macro enables a module to test for the
96470597fb56Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
96480597fb56Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
96490597fb56Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
96500597fb56Smrg# --with-ps2pdf assumes 'auto'.
96510597fb56Smrg#
96520597fb56Smrg# Interface to module:
96530597fb56Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
96540597fb56Smrg# PS2PDF:	returns the path of the ps2pdf program found
96550597fb56Smrg#		returns the path set by the user in the environment
96560597fb56Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
96570597fb56Smrg#		 'no' user instructs the module not to use ps2pdf
96580597fb56Smrg#
96590597fb56Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
96600597fb56Smrg#
96610597fb56SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
96620597fb56SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
96630597fb56Smrgm4_define([_defopt], m4_default([$1], [auto]))
96640597fb56SmrgAC_ARG_WITH(ps2pdf,
96650597fb56Smrg	AS_HELP_STRING([--with-ps2pdf],
96660597fb56Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
96670597fb56Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
96680597fb56Smrgm4_undefine([_defopt])
96698c4a8e55Smrg
96700597fb56Smrgif test "x$use_ps2pdf" = x"auto"; then
96710597fb56Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
96720597fb56Smrg   if test "x$PS2PDF" = "x"; then
96730597fb56Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
96740597fb56Smrg	have_ps2pdf=no
96750597fb56Smrg   else
96760597fb56Smrg        have_ps2pdf=yes
96770597fb56Smrg   fi
96780597fb56Smrgelif test "x$use_ps2pdf" = x"yes" ; then
96790597fb56Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
96800597fb56Smrg   if test "x$PS2PDF" = "x"; then
96810597fb56Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
96820597fb56Smrg   fi
96830597fb56Smrg   have_ps2pdf=yes
96840597fb56Smrgelif test "x$use_ps2pdf" = x"no" ; then
96850597fb56Smrg   if test "x$PS2PDF" != "x"; then
96860597fb56Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
96870597fb56Smrg   fi
96880597fb56Smrg   have_ps2pdf=no
96890597fb56Smrgelse
96900597fb56Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
9691706b6b52Smrgfi
96920597fb56SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
96930597fb56Smrg]) # XORG_WITH_PS2PDF
96940597fb56Smrg
96950597fb56Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
96960597fb56Smrg# ----------------
96970597fb56Smrg# Minimum version: 1.6.0
96980597fb56Smrg#
96990597fb56Smrg# Documentation tools are not always available on all platforms and sometimes
97000597fb56Smrg# not at the appropriate level. This macro enables a builder to skip all
97010597fb56Smrg# documentation targets except traditional man pages.
97020597fb56Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
97030597fb56Smrg# maximum flexibilty in controlling documentation building.
97040597fb56Smrg# Refer to:
97050597fb56Smrg# XORG_WITH_XMLTO         --with-xmlto
97060597fb56Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
97070597fb56Smrg# XORG_WITH_DOXYGEN       --with-doxygen
97080597fb56Smrg# XORG_WITH_FOP           --with-fop
97090597fb56Smrg# XORG_WITH_GROFF         --with-groff
97100597fb56Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
97110597fb56Smrg#
97120597fb56Smrg# Interface to module:
97130597fb56Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
97140597fb56Smrg# --enable-docs: 'yes' user instructs the module to generate docs
97150597fb56Smrg#		 'no' user instructs the module not to generate docs
97160597fb56Smrg# parm1:	specify the default value, yes or no.
97170597fb56Smrg#
97180597fb56SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
97190597fb56Smrgm4_define([docs_default], m4_default([$1], [yes]))
97200597fb56SmrgAC_ARG_ENABLE(docs,
97210597fb56Smrg	AS_HELP_STRING([--enable-docs],
97220597fb56Smrg	   [Enable building the documentation (default: ]docs_default[)]),
97230597fb56Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
97240597fb56Smrgm4_undefine([docs_default])
97250597fb56SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
97260597fb56SmrgAC_MSG_CHECKING([whether to build documentation])
97270597fb56SmrgAC_MSG_RESULT([$build_docs])
97280597fb56Smrg]) # XORG_ENABLE_DOCS
97298c4a8e55Smrg
97300597fb56Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
97310597fb56Smrg# ----------------
97320597fb56Smrg# Minimum version: 1.6.0
97330597fb56Smrg#
97340597fb56Smrg# This macro enables a builder to skip all developer documentation.
97350597fb56Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
97360597fb56Smrg# maximum flexibilty in controlling documentation building.
97370597fb56Smrg# Refer to:
97380597fb56Smrg# XORG_WITH_XMLTO         --with-xmlto
97390597fb56Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
97400597fb56Smrg# XORG_WITH_DOXYGEN       --with-doxygen
97410597fb56Smrg# XORG_WITH_FOP           --with-fop
97420597fb56Smrg# XORG_WITH_GROFF         --with-groff
97430597fb56Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
97440597fb56Smrg#
97450597fb56Smrg# Interface to module:
97460597fb56Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
97470597fb56Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
97480597fb56Smrg#			'no' user instructs the module not to generate developer docs
97490597fb56Smrg# parm1:		specify the default value, yes or no.
97500597fb56Smrg#
97510597fb56SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
97520597fb56Smrgm4_define([devel_default], m4_default([$1], [yes]))
97530597fb56SmrgAC_ARG_ENABLE(devel-docs,
97540597fb56Smrg	AS_HELP_STRING([--enable-devel-docs],
97550597fb56Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
97560597fb56Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
97570597fb56Smrgm4_undefine([devel_default])
97580597fb56SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
97590597fb56SmrgAC_MSG_CHECKING([whether to build developer documentation])
97600597fb56SmrgAC_MSG_RESULT([$build_devel_docs])
97610597fb56Smrg]) # XORG_ENABLE_DEVEL_DOCS
97628c4a8e55Smrg
97630597fb56Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
97640597fb56Smrg# ----------------
97650597fb56Smrg# Minimum version: 1.6.0
97660597fb56Smrg#
97670597fb56Smrg# This macro enables a builder to skip all functional specification targets.
97680597fb56Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
97690597fb56Smrg# maximum flexibilty in controlling documentation building.
97700597fb56Smrg# Refer to:
97710597fb56Smrg# XORG_WITH_XMLTO         --with-xmlto
97720597fb56Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
97730597fb56Smrg# XORG_WITH_DOXYGEN       --with-doxygen
97740597fb56Smrg# XORG_WITH_FOP           --with-fop
97750597fb56Smrg# XORG_WITH_GROFF         --with-groff
97760597fb56Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
97770597fb56Smrg#
97780597fb56Smrg# Interface to module:
97790597fb56Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
97800597fb56Smrg# --enable-specs:	'yes' user instructs the module to generate specs
97810597fb56Smrg#			'no' user instructs the module not to generate specs
97820597fb56Smrg# parm1:		specify the default value, yes or no.
97830597fb56Smrg#
97840597fb56SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
97850597fb56Smrgm4_define([spec_default], m4_default([$1], [yes]))
97860597fb56SmrgAC_ARG_ENABLE(specs,
97870597fb56Smrg	AS_HELP_STRING([--enable-specs],
97880597fb56Smrg	   [Enable building the specs (default: ]spec_default[)]),
97890597fb56Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
97900597fb56Smrgm4_undefine([spec_default])
97910597fb56SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
97920597fb56SmrgAC_MSG_CHECKING([whether to build functional specifications])
97930597fb56SmrgAC_MSG_RESULT([$build_specs])
97940597fb56Smrg]) # XORG_ENABLE_SPECS
97958c4a8e55Smrg
97960597fb56Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
97970597fb56Smrg# ----------------------------------------------
97980597fb56Smrg# Minimum version: 1.13.0
97990597fb56Smrg#
98000597fb56Smrg# This macro enables a builder to enable/disable unit testing
98010597fb56Smrg# It makes no assumption about the test cases implementation
98020597fb56Smrg# Test cases may or may not use Automake "Support for test suites"
98030597fb56Smrg# They may or may not use the software utility library GLib
98040597fb56Smrg#
98050597fb56Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
98060597fb56Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
98070597fb56Smrg# The variable enable_unit_tests is used by other macros in this file.
98080597fb56Smrg#
98090597fb56Smrg# Interface to module:
98100597fb56Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
98110597fb56Smrg# enable_unit_tests:    used in configure.ac for additional configuration
98120597fb56Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
98130597fb56Smrg#			'no' user instructs the module not to build tests
98140597fb56Smrg# parm1:		specify the default value, yes or no.
98150597fb56Smrg#
98160597fb56SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
98170597fb56SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
98180597fb56SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
98190597fb56SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
98200597fb56Smrgm4_define([_defopt], m4_default([$1], [auto]))
98210597fb56SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
98220597fb56Smrg	[Enable building unit test cases (default: ]_defopt[)]),
98230597fb56Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
98240597fb56Smrgm4_undefine([_defopt])
98250597fb56SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
98260597fb56SmrgAC_MSG_CHECKING([whether to build unit test cases])
98270597fb56SmrgAC_MSG_RESULT([$enable_unit_tests])
98280597fb56Smrg]) # XORG_ENABLE_UNIT_TESTS
98298c4a8e55Smrg
98300597fb56Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
98310597fb56Smrg# ------------------------------------------------------
98320597fb56Smrg# Minimum version: 1.17.0
98330597fb56Smrg#
98340597fb56Smrg# This macro enables a builder to enable/disable integration testing
98350597fb56Smrg# It makes no assumption about the test cases' implementation
98360597fb56Smrg# Test cases may or may not use Automake "Support for test suites"
98370597fb56Smrg#
98380597fb56Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
98390597fb56Smrg# usually requires less dependencies and may be built and run under less
98400597fb56Smrg# stringent environments than integration tests.
98410597fb56Smrg#
98420597fb56Smrg# Interface to module:
98430597fb56Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
98440597fb56Smrg# enable_integration_tests:   used in configure.ac for additional configuration
98450597fb56Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
98460597fb56Smrg#                             'no' user instructs the module not to build tests
98470597fb56Smrg# parm1:                      specify the default value, yes or no.
98480597fb56Smrg#
98490597fb56SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
98500597fb56SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
98510597fb56Smrgm4_define([_defopt], m4_default([$1], [auto]))
98520597fb56SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
98530597fb56Smrg	[Enable building integration test cases (default: ]_defopt[)]),
98540597fb56Smrg	[enable_integration_tests=$enableval],
98550597fb56Smrg	[enable_integration_tests=]_defopt)
98560597fb56Smrgm4_undefine([_defopt])
98570597fb56SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
98580597fb56Smrg	[test "x$enable_integration_tests" != xno])
98590597fb56SmrgAC_MSG_CHECKING([whether to build unit test cases])
98600597fb56SmrgAC_MSG_RESULT([$enable_integration_tests])
98610597fb56Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
98628c4a8e55Smrg
98630597fb56Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
98640597fb56Smrg# ----------------------------------------
98650597fb56Smrg# Minimum version: 1.13.0
98660597fb56Smrg#
98670597fb56Smrg# GLib is a library which provides advanced data structures and functions.
98680597fb56Smrg# This macro enables a module to test for the presence of Glib.
98690597fb56Smrg#
98700597fb56Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
98710597fb56Smrg# Otherwise the value of $enable_unit_tests is blank.
98720597fb56Smrg#
98730597fb56Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
98740597fb56Smrg# test support usually requires less dependencies and may be built and run under
98750597fb56Smrg# less stringent environments than integration tests.
98760597fb56Smrg#
98770597fb56Smrg# Interface to module:
98780597fb56Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
98790597fb56Smrg# with_glib: used in configure.ac to know if GLib has been found
98800597fb56Smrg# --with-glib:	'yes' user instructs the module to use glib
98810597fb56Smrg#		'no' user instructs the module not to use glib
98820597fb56Smrg#
98830597fb56SmrgAC_DEFUN([XORG_WITH_GLIB],[
98840597fb56SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
98850597fb56Smrgm4_define([_defopt], m4_default([$2], [auto]))
98860597fb56SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
98870597fb56Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
98880597fb56Smrg	[with_glib=$withval], [with_glib=]_defopt)
98890597fb56Smrgm4_undefine([_defopt])
98908c4a8e55Smrg
98910597fb56Smrghave_glib=no
98920597fb56Smrg# Do not probe GLib if user explicitly disabled unit testing
98930597fb56Smrgif test "x$enable_unit_tests" != x"no"; then
98940597fb56Smrg  # Do not probe GLib if user explicitly disabled it
98950597fb56Smrg  if test "x$with_glib" != x"no"; then
98960597fb56Smrg    m4_ifval(
98970597fb56Smrg      [$1],
98980597fb56Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
98990597fb56Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
99000597fb56Smrg    )
99010597fb56Smrg  fi
99020597fb56Smrgfi
99038c4a8e55Smrg
99040597fb56Smrg# Not having GLib when unit testing has been explicitly requested is an error
99050597fb56Smrgif test "x$enable_unit_tests" = x"yes"; then
99060597fb56Smrg  if test "x$have_glib" = x"no"; then
99070597fb56Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
99080597fb56Smrg  fi
99090597fb56Smrgfi
99108c4a8e55Smrg
99110597fb56Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
99120597fb56Smrgif test "x$enable_unit_tests" = x"no"; then
99130597fb56Smrg  if test "x$with_glib" = x"yes"; then
99140597fb56Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
99150597fb56Smrg  fi
99160597fb56Smrgfi
99178c4a8e55Smrg
99180597fb56Smrg# Not having GLib when it has been explicitly requested is an error
99190597fb56Smrgif test "x$with_glib" = x"yes"; then
99200597fb56Smrg  if test "x$have_glib" = x"no"; then
99210597fb56Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
99220597fb56Smrg  fi
99230597fb56Smrgfi
9924706b6b52Smrg
99250597fb56SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
99260597fb56Smrg]) # XORG_WITH_GLIB
9927706b6b52Smrg
99280597fb56Smrg# XORG_LD_WRAP([required|optional])
99290597fb56Smrg# ---------------------------------
99300597fb56Smrg# Minimum version: 1.13.0
99310597fb56Smrg#
99320597fb56Smrg# Check if linker supports -wrap, passed via compiler flags
99330597fb56Smrg#
99340597fb56Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
99350597fb56Smrg# Otherwise the value of $enable_unit_tests is blank.
99360597fb56Smrg#
99370597fb56Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
99380597fb56Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
99390597fb56Smrg# available, an argument of "optional" allows use when some unit tests require
99400597fb56Smrg# ld -wrap and others do not.
99410597fb56Smrg#
99420597fb56SmrgAC_DEFUN([XORG_LD_WRAP],[
99430597fb56SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
99440597fb56Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
99450597fb56Smrg                      void __wrap_exit(int status) { return; }],
99460597fb56Smrg                     [exit(0);])])
99470597fb56Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
99480597fb56Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
99490597fb56Smrg  if test "x$have_ld_wrap" = x"no"; then
99500597fb56Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
99510597fb56Smrg  fi
99520597fb56Smrgfi
99530597fb56SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
99540597fb56Smrg#
99550597fb56Smrg]) # XORG_LD_WRAP
99568c4a8e55Smrg
99570597fb56Smrg# XORG_CHECK_LINKER_FLAGS
99580597fb56Smrg# -----------------------
99590597fb56Smrg# SYNOPSIS
99600597fb56Smrg#
99610597fb56Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
99620597fb56Smrg#
99630597fb56Smrg# DESCRIPTION
99640597fb56Smrg#
99650597fb56Smrg#   Check whether the given linker FLAGS work with the current language's
99660597fb56Smrg#   linker, or whether they give an error.
99670597fb56Smrg#
99680597fb56Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
99690597fb56Smrg#   success/failure.
99700597fb56Smrg#
99710597fb56Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
99720597fb56Smrg#
99730597fb56Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
99740597fb56Smrg#
99750597fb56Smrg# LICENSE
99760597fb56Smrg#
99770597fb56Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
99780597fb56Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
99790597fb56Smrg#   Copyright (c) 2009 Matteo Frigo
99800597fb56Smrg#
99810597fb56Smrg#   This program is free software: you can redistribute it and/or modify it
99820597fb56Smrg#   under the terms of the GNU General Public License as published by the
99830597fb56Smrg#   Free Software Foundation, either version 3 of the License, or (at your
99840597fb56Smrg#   option) any later version.
99850597fb56Smrg#
99860597fb56Smrg#   This program is distributed in the hope that it will be useful, but
99870597fb56Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
99880597fb56Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
99890597fb56Smrg#   Public License for more details.
99900597fb56Smrg#
99910597fb56Smrg#   You should have received a copy of the GNU General Public License along
99920597fb56Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
99930597fb56Smrg#
99940597fb56Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
99950597fb56Smrg#   gives unlimited permission to copy, distribute and modify the configure
99960597fb56Smrg#   scripts that are the output of Autoconf when processing the Macro. You
99970597fb56Smrg#   need not follow the terms of the GNU General Public License when using
99980597fb56Smrg#   or distributing such scripts, even though portions of the text of the
99990597fb56Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
100000597fb56Smrg#   all other use of the material that constitutes the Autoconf Macro.
100010597fb56Smrg#
100020597fb56Smrg#   This special exception to the GPL applies to versions of the Autoconf
100030597fb56Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
100040597fb56Smrg#   modified version of the Autoconf Macro, you may extend this special
100050597fb56Smrg#   exception to the GPL to apply to your modified version as well.#
100060597fb56SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
100070597fb56Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
100080597fb56Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
100090597fb56SmrgAS_LITERAL_IF([$1],
100100597fb56Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
100110597fb56Smrg      ax_save_FLAGS=$LDFLAGS
100120597fb56Smrg      LDFLAGS="$1"
100130597fb56Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
100140597fb56Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
100150597fb56Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
100160597fb56Smrg      LDFLAGS=$ax_save_FLAGS])],
100170597fb56Smrg  [ax_save_FLAGS=$LDFLAGS
100180597fb56Smrg   LDFLAGS="$1"
100190597fb56Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
100200597fb56Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
100210597fb56Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
100220597fb56Smrg   LDFLAGS=$ax_save_FLAGS])
100230597fb56Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
100240597fb56SmrgAC_MSG_RESULT($xorg_check_linker_flags)
100250597fb56Smrgif test "x$xorg_check_linker_flags" = xyes; then
100260597fb56Smrg	m4_default([$2], :)
100270597fb56Smrgelse
100280597fb56Smrg	m4_default([$3], :)
10029706b6b52Smrgfi
100300597fb56Smrg]) # XORG_CHECK_LINKER_FLAGS
100318c4a8e55Smrg
100320597fb56Smrg# XORG_MEMORY_CHECK_FLAGS
100330597fb56Smrg# -----------------------
100340597fb56Smrg# Minimum version: 1.16.0
100350597fb56Smrg#
100360597fb56Smrg# This macro attempts to find appropriate memory checking functionality
100370597fb56Smrg# for various platforms which unit testing code may use to catch various
100380597fb56Smrg# forms of memory allocation and access errors in testing.
100390597fb56Smrg#
100400597fb56Smrg# Interface to module:
100410597fb56Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
100420597fb56Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
100430597fb56Smrg#
100440597fb56Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
100450597fb56Smrg#
100460597fb56SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
100478c4a8e55Smrg
100480597fb56SmrgAC_REQUIRE([AC_CANONICAL_HOST])
100490597fb56SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
100500597fb56Smrg           [Environment variables to enable memory checking in tests])
100518c4a8e55Smrg
100520597fb56Smrg# Check for different types of support on different platforms
100530597fb56Smrgcase $host_os in
100540597fb56Smrg    solaris*)
100550597fb56Smrg        AC_CHECK_LIB([umem], [umem_alloc],
100560597fb56Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
100570597fb56Smrg        ;;
100580597fb56Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
100590597fb56Smrg        # both directly and inverted, so should not be 0 or 255.
100600597fb56Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
100610597fb56Smrg        ;;
100620597fb56Smrg    darwin*)
100630597fb56Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
100640597fb56Smrg        ;;
100650597fb56Smrg    *bsd*)
100660597fb56Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
100670597fb56Smrg        ;;
100680597fb56Smrgesac
100698c4a8e55Smrg
100700597fb56Smrg# User supplied flags override default flags
100710597fb56Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
100720597fb56Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
100730597fb56Smrgfi
100748c4a8e55Smrg
100750597fb56SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
100760597fb56Smrg]) # XORG_WITH_LINT
100778c4a8e55Smrg
100780597fb56Smrg# XORG_CHECK_MALLOC_ZERO
100790597fb56Smrg# ----------------------
100800597fb56Smrg# Minimum version: 1.0.0
100810597fb56Smrg#
100820597fb56Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
100830597fb56Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
100840597fb56Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
100850597fb56SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
100860597fb56SmrgAC_ARG_ENABLE(malloc0returnsnull,
100870597fb56Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
100880597fb56Smrg		       [malloc(0) returns NULL (default: auto)]),
100890597fb56Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
100900597fb56Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
100918c4a8e55Smrg
100920597fb56SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
100930597fb56Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
100940597fb56Smrg	AC_RUN_IFELSE([AC_LANG_PROGRAM([
100950597fb56Smrg#include <stdlib.h>
100960597fb56Smrg],[
100970597fb56Smrg    char *m0, *r0, *c0, *p;
100980597fb56Smrg    m0 = malloc(0);
100990597fb56Smrg    p = malloc(10);
101000597fb56Smrg    r0 = realloc(p,0);
101010597fb56Smrg    c0 = calloc(0,10);
101020597fb56Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
101030597fb56Smrg])],
101040597fb56Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
101050597fb56Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
101060597fb56Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
101070597fb56Smrgfi
101080597fb56SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
101098c4a8e55Smrg
101100597fb56Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
101110597fb56Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
101120597fb56Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
101130597fb56Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
101140597fb56Smrgelse
101150597fb56Smrg	MALLOC_ZERO_CFLAGS=""
101160597fb56Smrg	XMALLOC_ZERO_CFLAGS=""
101170597fb56Smrg	XTMALLOC_ZERO_CFLAGS=""
101180597fb56Smrgfi
101198c4a8e55Smrg
101200597fb56SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
101210597fb56SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
101220597fb56SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
101230597fb56Smrg]) # XORG_CHECK_MALLOC_ZERO
101248c4a8e55Smrg
101250597fb56Smrg# XORG_WITH_LINT()
10126bd23fbfaSmrg# ----------------
101270597fb56Smrg# Minimum version: 1.1.0
101280597fb56Smrg#
101290597fb56Smrg# This macro enables the use of a tool that flags some suspicious and
101300597fb56Smrg# non-portable constructs (likely to be bugs) in C language source code.
101310597fb56Smrg# It will attempt to locate the tool and use appropriate options.
101320597fb56Smrg# There are various lint type tools on different platforms.
101330597fb56Smrg#
101340597fb56Smrg# Interface to module:
101350597fb56Smrg# LINT:		returns the path to the tool found on the platform
101360597fb56Smrg#		or the value set to LINT on the configure cmd line
101370597fb56Smrg#		also an Automake conditional
101380597fb56Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
101390597fb56Smrg#
101400597fb56Smrg# --with-lint:	'yes' user instructs the module to use lint
101410597fb56Smrg#		'no' user instructs the module not to use lint (default)
101420597fb56Smrg#
101430597fb56Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
101440597fb56Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
101450597fb56Smrg#
101460597fb56SmrgAC_DEFUN([XORG_WITH_LINT],[
101478c4a8e55Smrg
101480597fb56SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
101490597fb56SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
101500597fb56SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
101510597fb56Smrg		[Use a lint-style source code checker (default: disabled)])],
101520597fb56Smrg		[use_lint=$withval], [use_lint=no])
101538c4a8e55Smrg
101540597fb56Smrg# Obtain platform specific info like program name and options
101550597fb56Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
101560597fb56Smrgcase $host_os in
101570597fb56Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
101580597fb56Smrg	lint_name=splint
101590597fb56Smrg	lint_options="-badflag"
101600597fb56Smrg	;;
101610597fb56Smrg  *freebsd* | *netbsd*)
101620597fb56Smrg	lint_name=lint
101630597fb56Smrg	lint_options="-u -b"
101640597fb56Smrg	;;
101650597fb56Smrg  *solaris*)
101660597fb56Smrg	lint_name=lint
101670597fb56Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
101680597fb56Smrg	;;
101690597fb56Smrgesac
101708c4a8e55Smrg
101710597fb56Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
101720597fb56Smrgif test "x$use_lint" = x"yes" ; then
101730597fb56Smrg   AC_PATH_PROG([LINT], [$lint_name])
101740597fb56Smrg   if test "x$LINT" = "x"; then
101750597fb56Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
101760597fb56Smrg   fi
101770597fb56Smrgelif test "x$use_lint" = x"no" ; then
101780597fb56Smrg   if test "x$LINT" != "x"; then
101790597fb56Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
101800597fb56Smrg   fi
10181706b6b52Smrgelse
101820597fb56Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
10183706b6b52Smrgfi
101848c4a8e55Smrg
101850597fb56Smrg# User supplied flags override default flags
101860597fb56Smrgif test "x$LINT_FLAGS" != "x"; then
101870597fb56Smrg   lint_options=$LINT_FLAGS
101880597fb56Smrgfi
101898c4a8e55Smrg
101900597fb56SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
101910597fb56SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
101928c4a8e55Smrg
101930597fb56Smrg]) # XORG_WITH_LINT
101948c4a8e55Smrg
101950597fb56Smrg# XORG_LINT_LIBRARY(LIBNAME)
101960597fb56Smrg# --------------------------
101970597fb56Smrg# Minimum version: 1.1.0
101980597fb56Smrg#
101990597fb56Smrg# Sets up flags for building lint libraries for checking programs that call
102000597fb56Smrg# functions in the library.
102010597fb56Smrg#
102020597fb56Smrg# Interface to module:
102030597fb56Smrg# LINTLIB		- Automake variable with the name of lint library file to make
102040597fb56Smrg# MAKE_LINT_LIB		- Automake conditional
102050597fb56Smrg#
102060597fb56Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
102070597fb56Smrg#			  - 'no' user instructs the module not to create a lint library (default)
102088c4a8e55Smrg
102090597fb56SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
102100597fb56SmrgAC_REQUIRE([XORG_WITH_LINT])
102110597fb56SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
102120597fb56Smrg	[Create lint library (default: disabled)])],
102130597fb56Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
10214bd23fbfaSmrg
102150597fb56Smrgif test "x$make_lint_lib" = x"yes" ; then
102160597fb56Smrg   LINTLIB=llib-l$1.ln
102170597fb56Smrg   if test "x$LINT" = "x"; then
102180597fb56Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
102190597fb56Smrg   fi
102200597fb56Smrgelif test "x$make_lint_lib" != x"no" ; then
102210597fb56Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
102220597fb56Smrgfi
10223bd23fbfaSmrg
102240597fb56SmrgAC_SUBST(LINTLIB)
102250597fb56SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
102268c4a8e55Smrg
102270597fb56Smrg]) # XORG_LINT_LIBRARY
102288c4a8e55Smrg
102290597fb56Smrg# XORG_COMPILER_BRAND
102300597fb56Smrg# -------------------
102310597fb56Smrg# Minimum version: 1.14.0
102320597fb56Smrg#
102330597fb56Smrg# Checks for various brands of compilers and sets flags as appropriate:
102340597fb56Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
102350597fb56Smrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
102360597fb56Smrg#   clang compiler - sets CLANGCC to "yes"
102370597fb56Smrg#   Intel compiler - sets INTELCC to "yes"
102380597fb56Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
102390597fb56Smrg#
102400597fb56SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
102410597fb56SmrgAC_LANG_CASE(
102420597fb56Smrg	[C], [
102430597fb56Smrg		AC_REQUIRE([AC_PROG_CC_C99])
102440597fb56Smrg	],
102450597fb56Smrg	[C++], [
102460597fb56Smrg		AC_REQUIRE([AC_PROG_CXX])
102470597fb56Smrg	]
102480597fb56Smrg)
102490597fb56SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
102500597fb56SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
102510597fb56SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
102520597fb56Smrg]) # XORG_COMPILER_BRAND
102538c4a8e55Smrg
102540597fb56Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
102550597fb56Smrg# ---------------
102560597fb56Smrg# Minimum version: 1.16.0
102570597fb56Smrg#
102580597fb56Smrg# Test if the compiler works when passed the given flag as a command line argument.
102590597fb56Smrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
102600597fb56Smrg# next flag in the list until there are no more options.
102610597fb56Smrg#
102620597fb56Smrg# Note that this does not guarantee that the compiler supports the flag as some
102630597fb56Smrg# compilers will simply ignore arguments that they do not understand, but we do
102640597fb56Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
102650597fb56Smrg# -Werror=unused-command-line-argument
102660597fb56Smrg#
102670597fb56SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
102680597fb56Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
102690597fb56Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
102700597fb56Smrg
102710597fb56SmrgAC_LANG_COMPILER_REQUIRE
102720597fb56Smrg
102730597fb56SmrgAC_LANG_CASE(
102740597fb56Smrg	[C], [
102750597fb56Smrg		AC_REQUIRE([AC_PROG_CC_C99])
102760597fb56Smrg		define([PREFIX], [C])
102770597fb56Smrg		define([CACHE_PREFIX], [cc])
102780597fb56Smrg		define([COMPILER], [$CC])
102790597fb56Smrg	],
102800597fb56Smrg	[C++], [
102810597fb56Smrg		define([PREFIX], [CXX])
102820597fb56Smrg		define([CACHE_PREFIX], [cxx])
102830597fb56Smrg		define([COMPILER], [$CXX])
102840597fb56Smrg	]
102850597fb56Smrg)
102868c4a8e55Smrg
102870597fb56Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
102880597fb56Smrg
102890597fb56Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
102900597fb56Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
102910597fb56Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
102920597fb56Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
102930597fb56Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
102940597fb56Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
102950597fb56Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
102960597fb56Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
102970597fb56Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
102980597fb56Smrgfi
102998c4a8e55Smrg
103000597fb56Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
103010597fb56Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
103020597fb56Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
103030597fb56Smrg	fi
103040597fb56Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
103050597fb56Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
103060597fb56Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
103070597fb56Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
103080597fb56Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
103090597fb56Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
103100597fb56Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
103110597fb56Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
103120597fb56Smrgfi
10313706b6b52Smrg
103140597fb56Smrgfound="no"
103150597fb56Smrgm4_foreach([flag], m4_cdr($@), [
103160597fb56Smrg	if test $found = "no" ; then
103170597fb56Smrg		if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
103180597fb56Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
103190597fb56Smrg		fi
103200597fb56Smrg
103210597fb56Smrg		if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
103220597fb56Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
103230597fb56Smrg		fi
103240597fb56Smrg
103250597fb56Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
103260597fb56Smrg
103270597fb56Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
103280597fb56Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
103290597fb56Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
103300597fb56Smrg		AC_CACHE_VAL($cacheid,
103310597fb56Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
103320597fb56Smrg					     [eval $cacheid=yes],
103330597fb56Smrg					     [eval $cacheid=no])])
103340597fb56Smrg
103350597fb56Smrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
103360597fb56Smrg
103370597fb56Smrg		eval supported=\$$cacheid
103380597fb56Smrg		AC_MSG_RESULT([$supported])
103390597fb56Smrg		if test "$supported" = "yes" ; then
103400597fb56Smrg			$1="$$1 ]flag["
103410597fb56Smrg			found="yes"
103420597fb56Smrg		fi
103430597fb56Smrg	fi
103440597fb56Smrg])
103450597fb56Smrg]) # XORG_TESTSET_CFLAG
103468c4a8e55Smrg
103470597fb56Smrg# XORG_COMPILER_FLAGS
103480597fb56Smrg# ---------------
103490597fb56Smrg# Minimum version: 1.16.0
103500597fb56Smrg#
103510597fb56Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
103520597fb56Smrg# arguments supported by the selected compiler which do NOT alter the generated
103530597fb56Smrg# code.  These arguments will cause the compiler to print various warnings
103540597fb56Smrg# during compilation AND turn a conservative set of warnings into errors.
103550597fb56Smrg#
103560597fb56Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
103570597fb56Smrg# future versions of util-macros as options are added to new compilers.
103580597fb56Smrg#
103590597fb56SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
103600597fb56SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
103618c4a8e55Smrg
103620597fb56SmrgAC_ARG_ENABLE(selective-werror,
103630597fb56Smrg              AS_HELP_STRING([--disable-selective-werror],
103640597fb56Smrg                             [Turn off selective compiler errors. (default: enabled)]),
103650597fb56Smrg              [SELECTIVE_WERROR=$enableval],
103660597fb56Smrg              [SELECTIVE_WERROR=yes])
103670597fb56Smrg
103680597fb56SmrgAC_LANG_CASE(
103690597fb56Smrg        [C], [
103700597fb56Smrg                define([PREFIX], [C])
103710597fb56Smrg        ],
103720597fb56Smrg        [C++], [
103730597fb56Smrg                define([PREFIX], [CXX])
103740597fb56Smrg        ]
103750597fb56Smrg)
103760597fb56Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
103770597fb56Smrgif test "x$SUNCC" = "xyes"; then
103780597fb56Smrg    [BASE_]PREFIX[FLAGS]="-v"
103790597fb56Smrgelse
103800597fb56Smrg    [BASE_]PREFIX[FLAGS]=""
103810597fb56Smrgfi
103828c4a8e55Smrg
103830597fb56Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
103840597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
103850597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
103860597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
103870597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
103880597fb56Smrg
103890597fb56SmrgAC_LANG_CASE(
103900597fb56Smrg	[C], [
103910597fb56Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
103920597fb56Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
103930597fb56Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
103940597fb56Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
103950597fb56Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
103960597fb56Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
103970597fb56Smrg	]
103980597fb56Smrg)
103998c4a8e55Smrg
104000597fb56Smrg# This chunk adds additional warnings that could catch undesired effects.
104010597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
104020597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
104030597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
104040597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
104050597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
104060597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
104070597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
104080597fb56Smrg
104090597fb56Smrg# These are currently disabled because they are noisy.  They will be enabled
104100597fb56Smrg# in the future once the codebase is sufficiently modernized to silence
104110597fb56Smrg# them.  For now, I don't want them to drown out the other warnings.
104120597fb56Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
104130597fb56Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
104140597fb56Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
104150597fb56Smrg
104160597fb56Smrg# Turn some warnings into errors, so we don't accidently get successful builds
104170597fb56Smrg# when there are problems that should be fixed.
104180597fb56Smrg
104190597fb56Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
104200597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
104210597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
104220597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
104230597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
104240597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
104250597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
104260597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
104270597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
104280597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
104290597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
104300597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
104310597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
104320597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
10433bd23fbfaSmrgelse
104340597fb56SmrgAC_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])
104350597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
104360597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
104370597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
104380597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
104390597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
104400597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
104410597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
104420597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
104430597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
104440597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
104450597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
104460597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
104470597fb56SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
10448bd23fbfaSmrgfi
104498c4a8e55Smrg
104500597fb56SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
104510597fb56Smrg]) # XORG_COMPILER_FLAGS
104520597fb56Smrg
104530597fb56Smrg# XORG_CWARNFLAGS
104540597fb56Smrg# ---------------
104550597fb56Smrg# Minimum version: 1.2.0
104560597fb56Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
104570597fb56Smrg#
104580597fb56Smrg# Defines CWARNFLAGS to enable C compiler warnings.
104590597fb56Smrg#
104600597fb56Smrg# This function is deprecated because it defines -fno-strict-aliasing
104610597fb56Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
104620597fb56Smrg# is needed, then it should be added explicitly in the module when
104630597fb56Smrg# it is updated to use BASE_CFLAGS.
104640597fb56Smrg#
104650597fb56SmrgAC_DEFUN([XORG_CWARNFLAGS], [
104660597fb56SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
104670597fb56SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
104680597fb56SmrgAC_LANG_CASE(
104690597fb56Smrg	[C], [
104700597fb56Smrg		CWARNFLAGS="$BASE_CFLAGS"
104710597fb56Smrg		if  test "x$GCC" = xyes ; then
104720597fb56Smrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
104730597fb56Smrg		fi
104740597fb56Smrg		AC_SUBST(CWARNFLAGS)
104750597fb56Smrg	]
104760597fb56Smrg)
104770597fb56Smrg]) # XORG_CWARNFLAGS
104780597fb56Smrg
104790597fb56Smrg# XORG_STRICT_OPTION
104800597fb56Smrg# -----------------------
104810597fb56Smrg# Minimum version: 1.3.0
104820597fb56Smrg#
104830597fb56Smrg# Add configure option to enable strict compilation flags, such as treating
104840597fb56Smrg# warnings as fatal errors.
104850597fb56Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
104860597fb56Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
104870597fb56Smrg#
104880597fb56Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
104890597fb56Smrg# when strict compilation is unconditionally desired.
104900597fb56SmrgAC_DEFUN([XORG_STRICT_OPTION], [
104910597fb56SmrgAC_REQUIRE([XORG_CWARNFLAGS])
104920597fb56SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
104930597fb56Smrg
104940597fb56SmrgAC_ARG_ENABLE(strict-compilation,
104950597fb56Smrg			  AS_HELP_STRING([--enable-strict-compilation],
104960597fb56Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
104970597fb56Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
104980597fb56Smrg
104990597fb56SmrgAC_LANG_CASE(
105000597fb56Smrg        [C], [
105010597fb56Smrg                define([PREFIX], [C])
105020597fb56Smrg        ],
105030597fb56Smrg        [C++], [
105040597fb56Smrg                define([PREFIX], [CXX])
105050597fb56Smrg        ]
105060597fb56Smrg)
105070597fb56Smrg
105080597fb56Smrg[STRICT_]PREFIX[FLAGS]=""
105090597fb56SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
105100597fb56SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
105110597fb56Smrg
105120597fb56Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
105130597fb56Smrg# activate it with -Werror, so we add it here explicitly.
105140597fb56SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
105150597fb56Smrg
105160597fb56Smrgif test "x$STRICT_COMPILE" = "xyes"; then
105170597fb56Smrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
105180597fb56Smrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
10519bd23fbfaSmrgfi
105200597fb56SmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
105210597fb56SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
105220597fb56SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
105230597fb56Smrg]) # XORG_STRICT_OPTION
105248c4a8e55Smrg
105250597fb56Smrg# XORG_DEFAULT_OPTIONS
105260597fb56Smrg# --------------------
105270597fb56Smrg# Minimum version: 1.3.0
105280597fb56Smrg#
105290597fb56Smrg# Defines default options for X.Org modules.
105300597fb56Smrg#
105310597fb56SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
105320597fb56SmrgAC_REQUIRE([AC_PROG_INSTALL])
105330597fb56SmrgXORG_COMPILER_FLAGS
105340597fb56SmrgXORG_CWARNFLAGS
105350597fb56SmrgXORG_STRICT_OPTION
105360597fb56SmrgXORG_RELEASE_VERSION
105370597fb56SmrgXORG_CHANGELOG
105380597fb56SmrgXORG_INSTALL
105390597fb56SmrgXORG_MANPAGE_SECTIONS
105400597fb56Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
105410597fb56Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
105420597fb56Smrg]) # XORG_DEFAULT_OPTIONS
10543bd23fbfaSmrg
105440597fb56Smrg# XORG_INSTALL()
105450597fb56Smrg# ----------------
105460597fb56Smrg# Minimum version: 1.4.0
105470597fb56Smrg#
105480597fb56Smrg# Defines the variable INSTALL_CMD as the command to copy
105490597fb56Smrg# INSTALL from $prefix/share/util-macros.
105500597fb56Smrg#
105510597fb56SmrgAC_DEFUN([XORG_INSTALL], [
105520597fb56SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
105530597fb56Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
105540597fb56SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
105550597fb56Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
105560597fb56Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
105570597fb56Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
105580597fb56SmrgAC_SUBST([INSTALL_CMD])
105590597fb56Smrg]) # XORG_INSTALL
105600597fb56Smrgdnl Copyright 2005 Red Hat, Inc
105610597fb56Smrgdnl
105620597fb56Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
105630597fb56Smrgdnl documentation for any purpose is hereby granted without fee, provided that
105640597fb56Smrgdnl the above copyright notice appear in all copies and that both that
105650597fb56Smrgdnl copyright notice and this permission notice appear in supporting
105660597fb56Smrgdnl documentation.
105670597fb56Smrgdnl
105680597fb56Smrgdnl The above copyright notice and this permission notice shall be included
105690597fb56Smrgdnl in all copies or substantial portions of the Software.
105700597fb56Smrgdnl
105710597fb56Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
105720597fb56Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
105730597fb56Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
105740597fb56Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
105750597fb56Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
105760597fb56Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
105770597fb56Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
105780597fb56Smrgdnl
105790597fb56Smrgdnl Except as contained in this notice, the name of the copyright holders shall
105800597fb56Smrgdnl not be used in advertising or otherwise to promote the sale, use or
105810597fb56Smrgdnl other dealings in this Software without prior written authorization
105820597fb56Smrgdnl from the copyright holders.
105830597fb56Smrgdnl
105840597fb56Smrg
105850597fb56Smrg# XORG_RELEASE_VERSION
105860597fb56Smrg# --------------------
105870597fb56Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
105880597fb56Smrg 
105890597fb56SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
105900597fb56Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
105910597fb56Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
105920597fb56Smrg		[Major version of this package])
105930597fb56Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
105940597fb56Smrg	if test "x$PVM" = "x"; then
105950597fb56Smrg		PVM="0"
105960597fb56Smrg	fi
105970597fb56Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
105980597fb56Smrg		[$PVM],
105990597fb56Smrg		[Minor version of this package])
106000597fb56Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
106010597fb56Smrg	if test "x$PVP" = "x"; then
106020597fb56Smrg		PVP="0"
106030597fb56Smrg	fi
106040597fb56Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
106050597fb56Smrg		[$PVP],
106060597fb56Smrg		[Patch version of this package])
10607706b6b52Smrg])
106088c4a8e55Smrg
106090597fb56Smrg# XORG_CHANGELOG()
106100597fb56Smrg# ----------------
106110597fb56Smrg# Minimum version: 1.2.0
106128c4a8e55Smrg#
106130597fb56Smrg# Defines the variable CHANGELOG_CMD as the command to generate
106140597fb56Smrg# ChangeLog from git.
10615706b6b52Smrg#
106160597fb56Smrg#
106170597fb56SmrgAC_DEFUN([XORG_CHANGELOG], [
106180597fb56SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
106190597fb56Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
106200597fb56Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
106210597fb56Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
106220597fb56SmrgAC_SUBST([CHANGELOG_CMD])
106230597fb56Smrg]) # XORG_CHANGELOG
106248c4a8e55Smrg
106250597fb56Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
106260597fb56Smrg# Foundation, Inc.
106270597fb56Smrg#
106280597fb56Smrg# This file is free software; the Free Software Foundation
106290597fb56Smrg# gives unlimited permission to copy and/or distribute it,
106300597fb56Smrg# with or without modifications, as long as this notice is preserved.
106318c4a8e55Smrg
106320597fb56Smrg# serial 1
106338c4a8e55Smrg
106340597fb56Smrg# AM_AUTOMAKE_VERSION(VERSION)
106350597fb56Smrg# ----------------------------
106360597fb56Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
106370597fb56Smrg# generated from the m4 files accompanying Automake X.Y.
106380597fb56Smrg# (This private macro should not be called outside this file.)
106390597fb56SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
106400597fb56Smrg[am__api_version='1.11'
106410597fb56Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
106420597fb56Smrgdnl require some minimum version.  Point them to the right macro.
106430597fb56Smrgm4_if([$1], [1.11.3], [],
106440597fb56Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
106450597fb56Smrg])
106468c4a8e55Smrg
106470597fb56Smrg# _AM_AUTOCONF_VERSION(VERSION)
106480597fb56Smrg# -----------------------------
106490597fb56Smrg# aclocal traces this macro to find the Autoconf version.
106500597fb56Smrg# This is a private macro too.  Using m4_define simplifies
106510597fb56Smrg# the logic in aclocal, which can simply ignore this definition.
106520597fb56Smrgm4_define([_AM_AUTOCONF_VERSION], [])
106538c4a8e55Smrg
106540597fb56Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
106550597fb56Smrg# -------------------------------
106560597fb56Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
106570597fb56Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
106580597fb56SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
106590597fb56Smrg[AM_AUTOMAKE_VERSION([1.11.3])dnl
106600597fb56Smrgm4_ifndef([AC_AUTOCONF_VERSION],
106610597fb56Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
106620597fb56Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
106638c4a8e55Smrg
106640597fb56Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
106658c4a8e55Smrg
106660597fb56Smrg# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
106670597fb56Smrg#
106680597fb56Smrg# This file is free software; the Free Software Foundation
106690597fb56Smrg# gives unlimited permission to copy and/or distribute it,
106700597fb56Smrg# with or without modifications, as long as this notice is preserved.
106718c4a8e55Smrg
106720597fb56Smrg# serial 1
106738c4a8e55Smrg
106740597fb56Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
106750597fb56Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
106760597fb56Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
106770597fb56Smrg#
106780597fb56Smrg# Of course, Automake must honor this variable whenever it calls a
106790597fb56Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
106800597fb56Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
106810597fb56Smrg# depending on how configure is run.  This is pretty annoying, since
106820597fb56Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
106830597fb56Smrg# source directory, any form will work fine, but in subdirectories a
106840597fb56Smrg# relative path needs to be adjusted first.
106850597fb56Smrg#
106860597fb56Smrg# $ac_aux_dir/missing
106870597fb56Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
106880597fb56Smrg# $top_srcdir/$ac_aux_dir/missing
106890597fb56Smrg#    fails if $ac_aux_dir is absolute,
106900597fb56Smrg#    fails when called from a subdirectory in a VPATH build with
106910597fb56Smrg#          a relative $ac_aux_dir
106920597fb56Smrg#
106930597fb56Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
106940597fb56Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
106950597fb56Smrg# harmless because $srcdir is `.', but things will broke when you
106960597fb56Smrg# start a VPATH build or use an absolute $srcdir.
106970597fb56Smrg#
106980597fb56Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
106990597fb56Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
107000597fb56Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
107010597fb56Smrg# and then we would define $MISSING as
107020597fb56Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
107030597fb56Smrg# This will work as long as MISSING is not called from configure, because
107040597fb56Smrg# unfortunately $(top_srcdir) has no meaning in configure.
107050597fb56Smrg# However there are other variables, like CC, which are often used in
107060597fb56Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
107070597fb56Smrg#
107080597fb56Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
107090597fb56Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
107100597fb56Smrg# configured tree to be moved without reconfiguration.
107118c4a8e55Smrg
107120597fb56SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
107130597fb56Smrg[dnl Rely on autoconf to set up CDPATH properly.
107140597fb56SmrgAC_PREREQ([2.50])dnl
107150597fb56Smrg# expand $ac_aux_dir to an absolute path
107160597fb56Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
107178c4a8e55Smrg])
107188c4a8e55Smrg
107190597fb56Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
107208c4a8e55Smrg
107210597fb56Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
107220597fb56Smrg# Free Software Foundation, Inc.
107230597fb56Smrg#
107240597fb56Smrg# This file is free software; the Free Software Foundation
107250597fb56Smrg# gives unlimited permission to copy and/or distribute it,
107260597fb56Smrg# with or without modifications, as long as this notice is preserved.
107278c4a8e55Smrg
107280597fb56Smrg# serial 9
107298c4a8e55Smrg
107300597fb56Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
107310597fb56Smrg# -------------------------------------
107320597fb56Smrg# Define a conditional.
107330597fb56SmrgAC_DEFUN([AM_CONDITIONAL],
107340597fb56Smrg[AC_PREREQ(2.52)dnl
107350597fb56Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
107360597fb56Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
107370597fb56SmrgAC_SUBST([$1_TRUE])dnl
107380597fb56SmrgAC_SUBST([$1_FALSE])dnl
107390597fb56Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
107400597fb56Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
107410597fb56Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
107420597fb56Smrgif $2; then
107430597fb56Smrg  $1_TRUE=
107440597fb56Smrg  $1_FALSE='#'
107450597fb56Smrgelse
107460597fb56Smrg  $1_TRUE='#'
107470597fb56Smrg  $1_FALSE=
107480597fb56Smrgfi
107490597fb56SmrgAC_CONFIG_COMMANDS_PRE(
107500597fb56Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
107510597fb56Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
107520597fb56SmrgUsually this means the macro was only invoked conditionally.]])
107530597fb56Smrgfi])])
107548c4a8e55Smrg
107550597fb56Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
107560597fb56Smrg# 2010, 2011 Free Software Foundation, Inc.
107570597fb56Smrg#
107580597fb56Smrg# This file is free software; the Free Software Foundation
107590597fb56Smrg# gives unlimited permission to copy and/or distribute it,
107600597fb56Smrg# with or without modifications, as long as this notice is preserved.
107618c4a8e55Smrg
107620597fb56Smrg# serial 12
107638c4a8e55Smrg
107640597fb56Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
107650597fb56Smrg# written in clear, in which case automake, when reading aclocal.m4,
107660597fb56Smrg# will think it sees a *use*, and therefore will trigger all it's
107670597fb56Smrg# C support machinery.  Also note that it means that autoscan, seeing
107680597fb56Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
107698c4a8e55Smrg
107708c4a8e55Smrg
107710597fb56Smrg# _AM_DEPENDENCIES(NAME)
107720597fb56Smrg# ----------------------
107730597fb56Smrg# See how the compiler implements dependency checking.
107740597fb56Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
107750597fb56Smrg# We try a few techniques and use that to set a single cache variable.
107760597fb56Smrg#
107770597fb56Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
107780597fb56Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
107790597fb56Smrg# dependency, and given that the user is not expected to run this macro,
107800597fb56Smrg# just rely on AC_PROG_CC.
107810597fb56SmrgAC_DEFUN([_AM_DEPENDENCIES],
107820597fb56Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
107830597fb56SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
107840597fb56SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
107850597fb56SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
107868c4a8e55Smrg
107870597fb56Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
107880597fb56Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
107890597fb56Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
107900597fb56Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
107910597fb56Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
107920597fb56Smrg                   [depcc="$$1"   am_compiler_list=])
107938c4a8e55Smrg
107940597fb56SmrgAC_CACHE_CHECK([dependency style of $depcc],
107950597fb56Smrg               [am_cv_$1_dependencies_compiler_type],
107960597fb56Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
107970597fb56Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
107980597fb56Smrg  # making bogus files that we don't know about and never remove.  For
107990597fb56Smrg  # instance it was reported that on HP-UX the gcc test will end up
108000597fb56Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
108010597fb56Smrg  # in D'.
108020597fb56Smrg  rm -rf conftest.dir
108030597fb56Smrg  mkdir conftest.dir
108040597fb56Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
108050597fb56Smrg  # using a relative directory.
108060597fb56Smrg  cp "$am_depcomp" conftest.dir
108070597fb56Smrg  cd conftest.dir
108080597fb56Smrg  # We will build objects and dependencies in a subdirectory because
108090597fb56Smrg  # it helps to detect inapplicable dependency modes.  For instance
108100597fb56Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
108110597fb56Smrg  # side effect of compilation, but ICC will put the dependencies in
108120597fb56Smrg  # the current directory while Tru64 will put them in the object
108130597fb56Smrg  # directory.
108140597fb56Smrg  mkdir sub
108158c4a8e55Smrg
108160597fb56Smrg  am_cv_$1_dependencies_compiler_type=none
108170597fb56Smrg  if test "$am_compiler_list" = ""; then
108180597fb56Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
108190597fb56Smrg  fi
108200597fb56Smrg  am__universal=false
108210597fb56Smrg  m4_case([$1], [CC],
108220597fb56Smrg    [case " $depcc " in #(
108230597fb56Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
108240597fb56Smrg     esac],
108250597fb56Smrg    [CXX],
108260597fb56Smrg    [case " $depcc " in #(
108270597fb56Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
108280597fb56Smrg     esac])
108298c4a8e55Smrg
108300597fb56Smrg  for depmode in $am_compiler_list; do
108310597fb56Smrg    # Setup a source with many dependencies, because some compilers
108320597fb56Smrg    # like to wrap large dependency lists on column 80 (with \), and
108330597fb56Smrg    # we should not choose a depcomp mode which is confused by this.
108340597fb56Smrg    #
108350597fb56Smrg    # We need to recreate these files for each test, as the compiler may
108360597fb56Smrg    # overwrite some of them when testing with obscure command lines.
108370597fb56Smrg    # This happens at least with the AIX C compiler.
108380597fb56Smrg    : > sub/conftest.c
108390597fb56Smrg    for i in 1 2 3 4 5 6; do
108400597fb56Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
108410597fb56Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
108420597fb56Smrg      # Solaris 8's {/usr,}/bin/sh.
108430597fb56Smrg      touch sub/conftst$i.h
108440597fb56Smrg    done
108450597fb56Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
108468c4a8e55Smrg
108470597fb56Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
108480597fb56Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
108490597fb56Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
108500597fb56Smrg    # versions had trouble with output in subdirs
108510597fb56Smrg    am__obj=sub/conftest.${OBJEXT-o}
108520597fb56Smrg    am__minus_obj="-o $am__obj"
108530597fb56Smrg    case $depmode in
108540597fb56Smrg    gcc)
108550597fb56Smrg      # This depmode causes a compiler race in universal mode.
108560597fb56Smrg      test "$am__universal" = false || continue
108570597fb56Smrg      ;;
108580597fb56Smrg    nosideeffect)
108590597fb56Smrg      # after this tag, mechanisms are not by side-effect, so they'll
108600597fb56Smrg      # only be used when explicitly requested
108610597fb56Smrg      if test "x$enable_dependency_tracking" = xyes; then
108620597fb56Smrg	continue
108630597fb56Smrg      else
108640597fb56Smrg	break
108650597fb56Smrg      fi
108660597fb56Smrg      ;;
108670597fb56Smrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
108680597fb56Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
108690597fb56Smrg      # not run yet.  These depmodes are late enough in the game, and
108700597fb56Smrg      # so weak that their functioning should not be impacted.
108710597fb56Smrg      am__obj=conftest.${OBJEXT-o}
108720597fb56Smrg      am__minus_obj=
108730597fb56Smrg      ;;
108740597fb56Smrg    none) break ;;
108750597fb56Smrg    esac
108760597fb56Smrg    if depmode=$depmode \
108770597fb56Smrg       source=sub/conftest.c object=$am__obj \
108780597fb56Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
108790597fb56Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
108800597fb56Smrg         >/dev/null 2>conftest.err &&
108810597fb56Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
108820597fb56Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
108830597fb56Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
108840597fb56Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
108850597fb56Smrg      # icc doesn't choke on unknown options, it will just issue warnings
108860597fb56Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
108870597fb56Smrg      # that says an option was ignored or not supported.
108880597fb56Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
108890597fb56Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
108900597fb56Smrg      # The diagnosis changed in icc 8.0:
108910597fb56Smrg      #   icc: Command line remark: option '-MP' not supported
108920597fb56Smrg      if (grep 'ignoring option' conftest.err ||
108930597fb56Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
108940597fb56Smrg        am_cv_$1_dependencies_compiler_type=$depmode
108950597fb56Smrg        break
108960597fb56Smrg      fi
108970597fb56Smrg    fi
108980597fb56Smrg  done
108998c4a8e55Smrg
109000597fb56Smrg  cd ..
109010597fb56Smrg  rm -rf conftest.dir
109020597fb56Smrgelse
109030597fb56Smrg  am_cv_$1_dependencies_compiler_type=none
109040597fb56Smrgfi
109050597fb56Smrg])
109060597fb56SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
109070597fb56SmrgAM_CONDITIONAL([am__fastdep$1], [
109080597fb56Smrg  test "x$enable_dependency_tracking" != xno \
109090597fb56Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
109100597fb56Smrg])
109118c4a8e55Smrg
109128c4a8e55Smrg
109130597fb56Smrg# AM_SET_DEPDIR
109140597fb56Smrg# -------------
109150597fb56Smrg# Choose a directory name for dependency files.
109160597fb56Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
109170597fb56SmrgAC_DEFUN([AM_SET_DEPDIR],
109180597fb56Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
109190597fb56SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
109200597fb56Smrg])
109218c4a8e55Smrg
109228c4a8e55Smrg
109230597fb56Smrg# AM_DEP_TRACK
109240597fb56Smrg# ------------
109250597fb56SmrgAC_DEFUN([AM_DEP_TRACK],
109260597fb56Smrg[AC_ARG_ENABLE(dependency-tracking,
109270597fb56Smrg[  --disable-dependency-tracking  speeds up one-time build
109280597fb56Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
109290597fb56Smrgif test "x$enable_dependency_tracking" != xno; then
109300597fb56Smrg  am_depcomp="$ac_aux_dir/depcomp"
109310597fb56Smrg  AMDEPBACKSLASH='\'
109320597fb56Smrg  am__nodep='_no'
109330597fb56Smrgfi
109340597fb56SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
109350597fb56SmrgAC_SUBST([AMDEPBACKSLASH])dnl
109360597fb56Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
109370597fb56SmrgAC_SUBST([am__nodep])dnl
109380597fb56Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl
10939706b6b52Smrg])
109408c4a8e55Smrg
109410597fb56Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
109428c4a8e55Smrg
109430597fb56Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
109440597fb56Smrg# Free Software Foundation, Inc.
109450597fb56Smrg#
109460597fb56Smrg# This file is free software; the Free Software Foundation
109470597fb56Smrg# gives unlimited permission to copy and/or distribute it,
109480597fb56Smrg# with or without modifications, as long as this notice is preserved.
10949b042e37fSmrg
109500597fb56Smrg#serial 5
10951706b6b52Smrg
109520597fb56Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
109530597fb56Smrg# ------------------------------
109540597fb56SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
109550597fb56Smrg[{
109560597fb56Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
109570597fb56Smrg  # are listed without --file.  Let's play safe and only enable the eval
109580597fb56Smrg  # if we detect the quoting.
109590597fb56Smrg  case $CONFIG_FILES in
109600597fb56Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
109610597fb56Smrg  *)   set x $CONFIG_FILES ;;
109620597fb56Smrg  esac
109630597fb56Smrg  shift
109640597fb56Smrg  for mf
109650597fb56Smrg  do
109660597fb56Smrg    # Strip MF so we end up with the name of the file.
109670597fb56Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
109680597fb56Smrg    # Check whether this is an Automake generated Makefile or not.
109690597fb56Smrg    # We used to match only the files named `Makefile.in', but
109700597fb56Smrg    # some people rename them; so instead we look at the file content.
109710597fb56Smrg    # Grep'ing the first line is not enough: some people post-process
109720597fb56Smrg    # each Makefile.in and add a new line on top of each file to say so.
109730597fb56Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
109740597fb56Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
109750597fb56Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
109760597fb56Smrg      dirpart=`AS_DIRNAME("$mf")`
109770597fb56Smrg    else
109780597fb56Smrg      continue
109790597fb56Smrg    fi
109800597fb56Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
109810597fb56Smrg    # from the Makefile without running `make'.
109820597fb56Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
109830597fb56Smrg    test -z "$DEPDIR" && continue
109840597fb56Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
109850597fb56Smrg    test -z "am__include" && continue
109860597fb56Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
109870597fb56Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
109880597fb56Smrg    U=`sed -n 's/^U = //p' < "$mf"`
109890597fb56Smrg    # Find all dependency output files, they are included files with
109900597fb56Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
109910597fb56Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
109920597fb56Smrg    # expansion.
109930597fb56Smrg    for file in `sed -n "
109940597fb56Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
109950597fb56Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
109960597fb56Smrg      # Make sure the directory exists.
109970597fb56Smrg      test -f "$dirpart/$file" && continue
109980597fb56Smrg      fdir=`AS_DIRNAME(["$file"])`
109990597fb56Smrg      AS_MKDIR_P([$dirpart/$fdir])
110000597fb56Smrg      # echo "creating $dirpart/$file"
110010597fb56Smrg      echo '# dummy' > "$dirpart/$file"
110020597fb56Smrg    done
110030597fb56Smrg  done
110040597fb56Smrg}
110050597fb56Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
110068c4a8e55Smrg
110078c4a8e55Smrg
110080597fb56Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
110090597fb56Smrg# -----------------------------
110100597fb56Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
110110597fb56Smrg#
110120597fb56Smrg# This code is only required when automatic dependency tracking
110130597fb56Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
110140597fb56Smrg# need in order to bootstrap the dependency handling code.
110150597fb56SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
110160597fb56Smrg[AC_CONFIG_COMMANDS([depfiles],
110170597fb56Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
110180597fb56Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
11019706b6b52Smrg])
110208c4a8e55Smrg
110210597fb56Smrg# Do all the work for Automake.                             -*- Autoconf -*-
110228c4a8e55Smrg
110230597fb56Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
110240597fb56Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
110250597fb56Smrg#
110260597fb56Smrg# This file is free software; the Free Software Foundation
110270597fb56Smrg# gives unlimited permission to copy and/or distribute it,
110280597fb56Smrg# with or without modifications, as long as this notice is preserved.
110298c4a8e55Smrg
110300597fb56Smrg# serial 16
110310597fb56Smrg
110320597fb56Smrg# This macro actually does too much.  Some checks are only needed if
110330597fb56Smrg# your package does certain things.  But this isn't really a big deal.
110340597fb56Smrg
110350597fb56Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
110360597fb56Smrg# AM_INIT_AUTOMAKE([OPTIONS])
110370597fb56Smrg# -----------------------------------------------
110380597fb56Smrg# The call with PACKAGE and VERSION arguments is the old style
110390597fb56Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
110400597fb56Smrg# and VERSION should now be passed to AC_INIT and removed from
110410597fb56Smrg# the call to AM_INIT_AUTOMAKE.
110420597fb56Smrg# We support both call styles for the transition.  After
110430597fb56Smrg# the next Automake release, Autoconf can make the AC_INIT
110440597fb56Smrg# arguments mandatory, and then we can depend on a new Autoconf
110450597fb56Smrg# release and drop the old call support.
110460597fb56SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
110470597fb56Smrg[AC_PREREQ([2.62])dnl
110480597fb56Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
110490597fb56Smrgdnl the ones we care about.
110500597fb56Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
110510597fb56SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
110520597fb56SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
110530597fb56Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
110540597fb56Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
110550597fb56Smrg  # is not polluted with repeated "-I."
110560597fb56Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
110570597fb56Smrg  # test to see if srcdir already configured
110580597fb56Smrg  if test -f $srcdir/config.status; then
110590597fb56Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
110600597fb56Smrg  fi
110610597fb56Smrgfi
110628c4a8e55Smrg
110630597fb56Smrg# test whether we have cygpath
110640597fb56Smrgif test -z "$CYGPATH_W"; then
110650597fb56Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
110660597fb56Smrg    CYGPATH_W='cygpath -w'
110670597fb56Smrg  else
110680597fb56Smrg    CYGPATH_W=echo
110690597fb56Smrg  fi
110700597fb56Smrgfi
110710597fb56SmrgAC_SUBST([CYGPATH_W])
110728c4a8e55Smrg
110730597fb56Smrg# Define the identity of the package.
110740597fb56Smrgdnl Distinguish between old-style and new-style calls.
110750597fb56Smrgm4_ifval([$2],
110760597fb56Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
110770597fb56Smrg AC_SUBST([PACKAGE], [$1])dnl
110780597fb56Smrg AC_SUBST([VERSION], [$2])],
110790597fb56Smrg[_AM_SET_OPTIONS([$1])dnl
110800597fb56Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
110810597fb56Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
110820597fb56Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
110830597fb56Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
110840597fb56Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
11085706b6b52Smrg
110860597fb56Smrg_AM_IF_OPTION([no-define],,
110870597fb56Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
110880597fb56Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
110898c4a8e55Smrg
110900597fb56Smrg# Some tools Automake needs.
110910597fb56SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
110920597fb56SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
110930597fb56SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
110940597fb56SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
110950597fb56SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
110960597fb56SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
110970597fb56SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
110980597fb56SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
110990597fb56SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
111000597fb56SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
111010597fb56Smrg# We need awk for the "check" target.  The system "awk" is bad on
111020597fb56Smrg# some platforms.
111030597fb56SmrgAC_REQUIRE([AC_PROG_AWK])dnl
111040597fb56SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
111050597fb56SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
111060597fb56Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
111070597fb56Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
111080597fb56Smrg			     [_AM_PROG_TAR([v7])])])
111090597fb56Smrg_AM_IF_OPTION([no-dependencies],,
111100597fb56Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
111110597fb56Smrg		  [_AM_DEPENDENCIES(CC)],
111120597fb56Smrg		  [define([AC_PROG_CC],
111130597fb56Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
111140597fb56SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
111150597fb56Smrg		  [_AM_DEPENDENCIES(CXX)],
111160597fb56Smrg		  [define([AC_PROG_CXX],
111170597fb56Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
111180597fb56SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
111190597fb56Smrg		  [_AM_DEPENDENCIES(OBJC)],
111200597fb56Smrg		  [define([AC_PROG_OBJC],
111210597fb56Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
111220597fb56Smrg])
111230597fb56Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
111240597fb56Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
111250597fb56Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
111260597fb56Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
111270597fb56SmrgAC_CONFIG_COMMANDS_PRE(dnl
111280597fb56Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
111290597fb56Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
111300597fb56Smrg])
111318c4a8e55Smrg
111320597fb56Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
111330597fb56Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
111340597fb56Smrgdnl mangled by Autoconf and run in a shell conditional statement.
111350597fb56Smrgm4_define([_AC_COMPILER_EXEEXT],
111360597fb56Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
111378c4a8e55Smrg
111388c4a8e55Smrg
111390597fb56Smrg# When config.status generates a header, we must update the stamp-h file.
111400597fb56Smrg# This file resides in the same directory as the config header
111410597fb56Smrg# that is generated.  The stamp files are numbered to have different names.
111428c4a8e55Smrg
111430597fb56Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
111440597fb56Smrg# loop where config.status creates the headers, so we can generate
111450597fb56Smrg# our stamp files there.
111460597fb56SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
111470597fb56Smrg[# Compute $1's index in $config_headers.
111480597fb56Smrg_am_arg=$1
111490597fb56Smrg_am_stamp_count=1
111500597fb56Smrgfor _am_header in $config_headers :; do
111510597fb56Smrg  case $_am_header in
111520597fb56Smrg    $_am_arg | $_am_arg:* )
111530597fb56Smrg      break ;;
111540597fb56Smrg    * )
111550597fb56Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
111560597fb56Smrg  esac
111570597fb56Smrgdone
111580597fb56Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
111598c4a8e55Smrg
111600597fb56Smrg# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
111610597fb56Smrg# Inc.
111620597fb56Smrg#
111630597fb56Smrg# This file is free software; the Free Software Foundation
111640597fb56Smrg# gives unlimited permission to copy and/or distribute it,
111650597fb56Smrg# with or without modifications, as long as this notice is preserved.
111668c4a8e55Smrg
111670597fb56Smrg# serial 1
111688c4a8e55Smrg
111690597fb56Smrg# AM_PROG_INSTALL_SH
111700597fb56Smrg# ------------------
111710597fb56Smrg# Define $install_sh.
111720597fb56SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
111730597fb56Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
111740597fb56Smrgif test x"${install_sh}" != xset; then
111750597fb56Smrg  case $am_aux_dir in
111760597fb56Smrg  *\ * | *\	*)
111770597fb56Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
111780597fb56Smrg  *)
111790597fb56Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
111800597fb56Smrg  esac
111810597fb56Smrgfi
111820597fb56SmrgAC_SUBST(install_sh)])
111838c4a8e55Smrg
111840597fb56Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
111850597fb56Smrg#
111860597fb56Smrg# This file is free software; the Free Software Foundation
111870597fb56Smrg# gives unlimited permission to copy and/or distribute it,
111880597fb56Smrg# with or without modifications, as long as this notice is preserved.
11189706b6b52Smrg
111900597fb56Smrg# serial 2
111918c4a8e55Smrg
111920597fb56Smrg# Check whether the underlying file-system supports filenames
111930597fb56Smrg# with a leading dot.  For instance MS-DOS doesn't.
111940597fb56SmrgAC_DEFUN([AM_SET_LEADING_DOT],
111950597fb56Smrg[rm -rf .tst 2>/dev/null
111960597fb56Smrgmkdir .tst 2>/dev/null
111970597fb56Smrgif test -d .tst; then
111980597fb56Smrg  am__leading_dot=.
111990597fb56Smrgelse
112000597fb56Smrg  am__leading_dot=_
112010597fb56Smrgfi
112020597fb56Smrgrmdir .tst 2>/dev/null
112030597fb56SmrgAC_SUBST([am__leading_dot])])
112048c4a8e55Smrg
112050597fb56Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
112060597fb56Smrg# From Jim Meyering
112078c4a8e55Smrg
112080597fb56Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
112090597fb56Smrg# 2011 Free Software Foundation, Inc.
112100597fb56Smrg#
112110597fb56Smrg# This file is free software; the Free Software Foundation
112120597fb56Smrg# gives unlimited permission to copy and/or distribute it,
112130597fb56Smrg# with or without modifications, as long as this notice is preserved.
112148c4a8e55Smrg
112150597fb56Smrg# serial 5
112168c4a8e55Smrg
112170597fb56Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
112180597fb56Smrg# ----------------------------------
112190597fb56Smrg# Control maintainer-specific portions of Makefiles.
112200597fb56Smrg# Default is to disable them, unless `enable' is passed literally.
112210597fb56Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
112220597fb56Smrg# can override the default with the --enable/--disable switch.
112230597fb56SmrgAC_DEFUN([AM_MAINTAINER_MODE],
112240597fb56Smrg[m4_case(m4_default([$1], [disable]),
112250597fb56Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
112260597fb56Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
112270597fb56Smrg       [m4_define([am_maintainer_other], [enable])
112280597fb56Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
112290597fb56SmrgAC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
112300597fb56Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
112310597fb56Smrg  AC_ARG_ENABLE([maintainer-mode],
112320597fb56Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
112330597fb56Smrg			  (and sometimes confusing) to the casual installer],
112340597fb56Smrg      [USE_MAINTAINER_MODE=$enableval],
112350597fb56Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
112360597fb56Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
112370597fb56Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
112380597fb56Smrg  MAINT=$MAINTAINER_MODE_TRUE
112390597fb56Smrg  AC_SUBST([MAINT])dnl
112400597fb56Smrg]
112410597fb56Smrg)
112428c4a8e55Smrg
112430597fb56SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
112448c4a8e55Smrg
112450597fb56Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
112468c4a8e55Smrg
112470597fb56Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
112480597fb56Smrg#
112490597fb56Smrg# This file is free software; the Free Software Foundation
112500597fb56Smrg# gives unlimited permission to copy and/or distribute it,
112510597fb56Smrg# with or without modifications, as long as this notice is preserved.
112528c4a8e55Smrg
112530597fb56Smrg# serial 4
112548c4a8e55Smrg
112550597fb56Smrg# AM_MAKE_INCLUDE()
112560597fb56Smrg# -----------------
112570597fb56Smrg# Check to see how make treats includes.
112580597fb56SmrgAC_DEFUN([AM_MAKE_INCLUDE],
112590597fb56Smrg[am_make=${MAKE-make}
112600597fb56Smrgcat > confinc << 'END'
112610597fb56Smrgam__doit:
112620597fb56Smrg	@echo this is the am__doit target
112630597fb56Smrg.PHONY: am__doit
112640597fb56SmrgEND
112650597fb56Smrg# If we don't find an include directive, just comment out the code.
112660597fb56SmrgAC_MSG_CHECKING([for style of include used by $am_make])
112670597fb56Smrgam__include="#"
112680597fb56Smrgam__quote=
112690597fb56Smrg_am_result=none
112700597fb56Smrg# First try GNU make style include.
112710597fb56Smrgecho "include confinc" > confmf
112720597fb56Smrg# Ignore all kinds of additional output from `make'.
112730597fb56Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
112740597fb56Smrg*the\ am__doit\ target*)
112750597fb56Smrg  am__include=include
112760597fb56Smrg  am__quote=
112770597fb56Smrg  _am_result=GNU
112780597fb56Smrg  ;;
112790597fb56Smrgesac
112800597fb56Smrg# Now try BSD make style include.
112810597fb56Smrgif test "$am__include" = "#"; then
112820597fb56Smrg   echo '.include "confinc"' > confmf
112830597fb56Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
112840597fb56Smrg   *the\ am__doit\ target*)
112850597fb56Smrg     am__include=.include
112860597fb56Smrg     am__quote="\""
112870597fb56Smrg     _am_result=BSD
112880597fb56Smrg     ;;
112890597fb56Smrg   esac
112900597fb56Smrgfi
112910597fb56SmrgAC_SUBST([am__include])
112920597fb56SmrgAC_SUBST([am__quote])
112930597fb56SmrgAC_MSG_RESULT([$_am_result])
112940597fb56Smrgrm -f confinc confmf
11295706b6b52Smrg])
112968c4a8e55Smrg
112970597fb56Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
112988c4a8e55Smrg
112990597fb56Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
113000597fb56Smrg# Free Software Foundation, Inc.
11301706b6b52Smrg#
113020597fb56Smrg# This file is free software; the Free Software Foundation
113030597fb56Smrg# gives unlimited permission to copy and/or distribute it,
113040597fb56Smrg# with or without modifications, as long as this notice is preserved.
113058c4a8e55Smrg
113060597fb56Smrg# serial 6
113078c4a8e55Smrg
113080597fb56Smrg# AM_MISSING_PROG(NAME, PROGRAM)
113090597fb56Smrg# ------------------------------
113100597fb56SmrgAC_DEFUN([AM_MISSING_PROG],
113110597fb56Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
113120597fb56Smrg$1=${$1-"${am_missing_run}$2"}
113130597fb56SmrgAC_SUBST($1)])
11314b042e37fSmrg
11315b042e37fSmrg
113160597fb56Smrg# AM_MISSING_HAS_RUN
113170597fb56Smrg# ------------------
113180597fb56Smrg# Define MISSING if not defined so far and test if it supports --run.
113190597fb56Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
113200597fb56SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
113210597fb56Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
113220597fb56SmrgAC_REQUIRE_AUX_FILE([missing])dnl
113230597fb56Smrgif test x"${MISSING+set}" != xset; then
113240597fb56Smrg  case $am_aux_dir in
113250597fb56Smrg  *\ * | *\	*)
113260597fb56Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
113270597fb56Smrg  *)
113280597fb56Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
113290597fb56Smrg  esac
113300597fb56Smrgfi
113310597fb56Smrg# Use eval to expand $SHELL
113320597fb56Smrgif eval "$MISSING --run true"; then
113330597fb56Smrg  am_missing_run="$MISSING --run "
113340597fb56Smrgelse
113350597fb56Smrg  am_missing_run=
113360597fb56Smrg  AC_MSG_WARN([`missing' script is too old or missing])
113370597fb56Smrgfi
113380597fb56Smrg])
113390597fb56Smrg
113400597fb56Smrg# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
113410597fb56Smrg# Inc.
113420597fb56Smrg#
113430597fb56Smrg# This file is free software; the Free Software Foundation
113440597fb56Smrg# gives unlimited permission to copy and/or distribute it,
113450597fb56Smrg# with or without modifications, as long as this notice is preserved.
113468c4a8e55Smrg
113470597fb56Smrg# serial 1
113488c4a8e55Smrg
113490597fb56Smrg# AM_PROG_MKDIR_P
113500597fb56Smrg# ---------------
113510597fb56Smrg# Check for `mkdir -p'.
113520597fb56SmrgAC_DEFUN([AM_PROG_MKDIR_P],
113530597fb56Smrg[AC_PREREQ([2.60])dnl
113540597fb56SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
113550597fb56Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
113560597fb56Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
113570597fb56Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
113580597fb56Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
113590597fb56Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
113600597fb56Smrgdnl adjustment using top_builddir (which is defined more often than
113610597fb56Smrgdnl MKDIR_P).
113620597fb56SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
113630597fb56Smrgcase $mkdir_p in
113640597fb56Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
113650597fb56Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
113660597fb56Smrgesac
113670597fb56Smrg])
113688c4a8e55Smrg
113690597fb56Smrg# Helper functions for option handling.                     -*- Autoconf -*-
113708c4a8e55Smrg
113710597fb56Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
113720597fb56Smrg# Foundation, Inc.
113738c4a8e55Smrg#
113740597fb56Smrg# This file is free software; the Free Software Foundation
113750597fb56Smrg# gives unlimited permission to copy and/or distribute it,
113760597fb56Smrg# with or without modifications, as long as this notice is preserved.
113778c4a8e55Smrg
113780597fb56Smrg# serial 5
113798c4a8e55Smrg
113800597fb56Smrg# _AM_MANGLE_OPTION(NAME)
113810597fb56Smrg# -----------------------
113820597fb56SmrgAC_DEFUN([_AM_MANGLE_OPTION],
113830597fb56Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
113848c4a8e55Smrg
113850597fb56Smrg# _AM_SET_OPTION(NAME)
113860597fb56Smrg# --------------------
113870597fb56Smrg# Set option NAME.  Presently that only means defining a flag for this option.
113880597fb56SmrgAC_DEFUN([_AM_SET_OPTION],
113890597fb56Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
11390706b6b52Smrg
113910597fb56Smrg# _AM_SET_OPTIONS(OPTIONS)
113920597fb56Smrg# ------------------------
113930597fb56Smrg# OPTIONS is a space-separated list of Automake options.
113940597fb56SmrgAC_DEFUN([_AM_SET_OPTIONS],
113950597fb56Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
11396706b6b52Smrg
113970597fb56Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
113980597fb56Smrg# -------------------------------------------
113990597fb56Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
114000597fb56SmrgAC_DEFUN([_AM_IF_OPTION],
114010597fb56Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
11402706b6b52Smrg
114030597fb56Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
11404706b6b52Smrg
114050597fb56Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
114060597fb56Smrg# Free Software Foundation, Inc.
114070597fb56Smrg#
114080597fb56Smrg# This file is free software; the Free Software Foundation
114090597fb56Smrg# gives unlimited permission to copy and/or distribute it,
114100597fb56Smrg# with or without modifications, as long as this notice is preserved.
114118c4a8e55Smrg
114120597fb56Smrg# serial 5
114138c4a8e55Smrg
114140597fb56Smrg# AM_SANITY_CHECK
114150597fb56Smrg# ---------------
114160597fb56SmrgAC_DEFUN([AM_SANITY_CHECK],
114170597fb56Smrg[AC_MSG_CHECKING([whether build environment is sane])
114180597fb56Smrg# Just in case
114190597fb56Smrgsleep 1
114200597fb56Smrgecho timestamp > conftest.file
114210597fb56Smrg# Reject unsafe characters in $srcdir or the absolute working directory
114220597fb56Smrg# name.  Accept space and tab only in the latter.
114230597fb56Smrgam_lf='
114240597fb56Smrg'
114250597fb56Smrgcase `pwd` in
114260597fb56Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
114270597fb56Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
114280597fb56Smrgesac
114290597fb56Smrgcase $srcdir in
114300597fb56Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
114310597fb56Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
114320597fb56Smrgesac
114338c4a8e55Smrg
114340597fb56Smrg# Do `set' in a subshell so we don't clobber the current shell's
114350597fb56Smrg# arguments.  Must try -L first in case configure is actually a
114360597fb56Smrg# symlink; some systems play weird games with the mod time of symlinks
114370597fb56Smrg# (eg FreeBSD returns the mod time of the symlink's containing
114380597fb56Smrg# directory).
114390597fb56Smrgif (
114400597fb56Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
114410597fb56Smrg   if test "$[*]" = "X"; then
114420597fb56Smrg      # -L didn't work.
114430597fb56Smrg      set X `ls -t "$srcdir/configure" conftest.file`
114440597fb56Smrg   fi
114450597fb56Smrg   rm -f conftest.file
114460597fb56Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
114470597fb56Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
114488c4a8e55Smrg
114490597fb56Smrg      # If neither matched, then we have a broken ls.  This can happen
114500597fb56Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
114510597fb56Smrg      # broken ls alias from the environment.  This has actually
114520597fb56Smrg      # happened.  Such a system could not be considered "sane".
114530597fb56Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
114540597fb56Smrgalias in your environment])
114550597fb56Smrg   fi
114568c4a8e55Smrg
114570597fb56Smrg   test "$[2]" = conftest.file
114580597fb56Smrg   )
114590597fb56Smrgthen
114600597fb56Smrg   # Ok.
114610597fb56Smrg   :
114620597fb56Smrgelse
114630597fb56Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
114640597fb56SmrgCheck your system clock])
114650597fb56Smrgfi
114660597fb56SmrgAC_MSG_RESULT(yes)])
11467706b6b52Smrg
114680597fb56Smrg# Copyright (C) 2009, 2011  Free Software Foundation, Inc.
114690597fb56Smrg#
114700597fb56Smrg# This file is free software; the Free Software Foundation
114710597fb56Smrg# gives unlimited permission to copy and/or distribute it,
114720597fb56Smrg# with or without modifications, as long as this notice is preserved.
11473706b6b52Smrg
114740597fb56Smrg# serial 2
11475706b6b52Smrg
114760597fb56Smrg# AM_SILENT_RULES([DEFAULT])
114770597fb56Smrg# --------------------------
114780597fb56Smrg# Enable less verbose build rules; with the default set to DEFAULT
114790597fb56Smrg# (`yes' being less verbose, `no' or empty being verbose).
114800597fb56SmrgAC_DEFUN([AM_SILENT_RULES],
114810597fb56Smrg[AC_ARG_ENABLE([silent-rules],
114820597fb56Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
114830597fb56Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
114840597fb56Smrgcase $enable_silent_rules in
114850597fb56Smrgyes) AM_DEFAULT_VERBOSITY=0;;
114860597fb56Smrgno)  AM_DEFAULT_VERBOSITY=1;;
114870597fb56Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
114880597fb56Smrgesac
114890597fb56Smrgdnl
114900597fb56Smrgdnl A few `make' implementations (e.g., NonStop OS and NextStep)
114910597fb56Smrgdnl do not support nested variable expansions.
114920597fb56Smrgdnl See automake bug#9928 and bug#10237.
114930597fb56Smrgam_make=${MAKE-make}
114940597fb56SmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
114950597fb56Smrg   [am_cv_make_support_nested_variables],
114960597fb56Smrg   [if AS_ECHO([['TRUE=$(BAR$(V))
114970597fb56SmrgBAR0=false
114980597fb56SmrgBAR1=true
114990597fb56SmrgV=1
115000597fb56Smrgam__doit:
115010597fb56Smrg	@$(TRUE)
115020597fb56Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
115030597fb56Smrg  am_cv_make_support_nested_variables=yes
115040597fb56Smrgelse
115050597fb56Smrg  am_cv_make_support_nested_variables=no
115060597fb56Smrgfi])
115070597fb56Smrgif test $am_cv_make_support_nested_variables = yes; then
115080597fb56Smrg  dnl Using `$V' instead of `$(V)' breaks IRIX make.
115090597fb56Smrg  AM_V='$(V)'
115100597fb56Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
115110597fb56Smrgelse
115120597fb56Smrg  AM_V=$AM_DEFAULT_VERBOSITY
115130597fb56Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
115140597fb56Smrgfi
115150597fb56SmrgAC_SUBST([AM_V])dnl
115160597fb56SmrgAM_SUBST_NOTMAKE([AM_V])dnl
115170597fb56SmrgAC_SUBST([AM_DEFAULT_V])dnl
115180597fb56SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
115190597fb56SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
115200597fb56SmrgAM_BACKSLASH='\'
115210597fb56SmrgAC_SUBST([AM_BACKSLASH])dnl
115220597fb56Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
11523706b6b52Smrg])
11524706b6b52Smrg
115250597fb56Smrg# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
115268c4a8e55Smrg#
115270597fb56Smrg# This file is free software; the Free Software Foundation
115280597fb56Smrg# gives unlimited permission to copy and/or distribute it,
115290597fb56Smrg# with or without modifications, as long as this notice is preserved.
115300597fb56Smrg
115310597fb56Smrg# serial 1
115320597fb56Smrg
115330597fb56Smrg# AM_PROG_INSTALL_STRIP
115340597fb56Smrg# ---------------------
115350597fb56Smrg# One issue with vendor `install' (even GNU) is that you can't
115360597fb56Smrg# specify the program used to strip binaries.  This is especially
115370597fb56Smrg# annoying in cross-compiling environments, where the build's strip
115380597fb56Smrg# is unlikely to handle the host's binaries.
115390597fb56Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
115400597fb56Smrg# always use install-sh in `make install-strip', and initialize
115410597fb56Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
115420597fb56SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
115430597fb56Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
115440597fb56Smrg# Installed binaries are usually stripped using `strip' when the user
115450597fb56Smrg# run `make install-strip'.  However `strip' might not be the right
115460597fb56Smrg# tool to use in cross-compilation environments, therefore Automake
115470597fb56Smrg# will honor the `STRIP' environment variable to overrule this program.
115480597fb56Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
115490597fb56Smrgif test "$cross_compiling" != no; then
115500597fb56Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
115510597fb56Smrgfi
115520597fb56SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
115530597fb56SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
115540597fb56Smrg
115550597fb56Smrg# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
115568c4a8e55Smrg#
115570597fb56Smrg# This file is free software; the Free Software Foundation
115580597fb56Smrg# gives unlimited permission to copy and/or distribute it,
115590597fb56Smrg# with or without modifications, as long as this notice is preserved.
115608c4a8e55Smrg
115610597fb56Smrg# serial 3
115628c4a8e55Smrg
115630597fb56Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
115640597fb56Smrg# ---------------------------
115650597fb56Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
115660597fb56Smrg# This macro is traced by Automake.
115670597fb56SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
115688c4a8e55Smrg
115690597fb56Smrg# AM_SUBST_NOTMAKE(VARIABLE)
115700597fb56Smrg# --------------------------
115710597fb56Smrg# Public sister of _AM_SUBST_NOTMAKE.
115720597fb56SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
11573706b6b52Smrg
115740597fb56Smrg# Check how to create a tarball.                            -*- Autoconf -*-
11575706b6b52Smrg
115760597fb56Smrg# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
115778c4a8e55Smrg#
115780597fb56Smrg# This file is free software; the Free Software Foundation
115790597fb56Smrg# gives unlimited permission to copy and/or distribute it,
115800597fb56Smrg# with or without modifications, as long as this notice is preserved.
115818c4a8e55Smrg
115820597fb56Smrg# serial 2
115838c4a8e55Smrg
115840597fb56Smrg# _AM_PROG_TAR(FORMAT)
115850597fb56Smrg# --------------------
115860597fb56Smrg# Check how to create a tarball in format FORMAT.
115870597fb56Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
115888c4a8e55Smrg#
115890597fb56Smrg# Substitute a variable $(am__tar) that is a command
115900597fb56Smrg# writing to stdout a FORMAT-tarball containing the directory
115910597fb56Smrg# $tardir.
115920597fb56Smrg#     tardir=directory && $(am__tar) > result.tar
11593706b6b52Smrg#
115940597fb56Smrg# Substitute a variable $(am__untar) that extract such
115950597fb56Smrg# a tarball read from stdin.
115960597fb56Smrg#     $(am__untar) < result.tar
115970597fb56SmrgAC_DEFUN([_AM_PROG_TAR],
115980597fb56Smrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
115990597fb56Smrg# in the wild :-(  We should find a proper way to deprecate it ...
116000597fb56SmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
116010597fb56Smrgm4_if([$1], [v7],
116020597fb56Smrg     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
116030597fb56Smrg     [m4_case([$1], [ustar],, [pax],,
116040597fb56Smrg              [m4_fatal([Unknown tar format])])
116050597fb56SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
116060597fb56Smrg# Loop over all known methods to create a tar archive until one works.
116070597fb56Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
116080597fb56Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
116090597fb56Smrg# Do not fold the above two line into one, because Tru64 sh and
116100597fb56Smrg# Solaris sh will not grok spaces in the rhs of `-'.
116110597fb56Smrgfor _am_tool in $_am_tools
116120597fb56Smrgdo
116130597fb56Smrg  case $_am_tool in
116140597fb56Smrg  gnutar)
116150597fb56Smrg    for _am_tar in tar gnutar gtar;
116160597fb56Smrg    do
116170597fb56Smrg      AM_RUN_LOG([$_am_tar --version]) && break
116180597fb56Smrg    done
116190597fb56Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
116200597fb56Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
116210597fb56Smrg    am__untar="$_am_tar -xf -"
116220597fb56Smrg    ;;
116230597fb56Smrg  plaintar)
116240597fb56Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
116250597fb56Smrg    # ustar tarball either.
116260597fb56Smrg    (tar --version) >/dev/null 2>&1 && continue
116270597fb56Smrg    am__tar='tar chf - "$$tardir"'
116280597fb56Smrg    am__tar_='tar chf - "$tardir"'
116290597fb56Smrg    am__untar='tar xf -'
116300597fb56Smrg    ;;
116310597fb56Smrg  pax)
116320597fb56Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
116330597fb56Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
116340597fb56Smrg    am__untar='pax -r'
116350597fb56Smrg    ;;
116360597fb56Smrg  cpio)
116370597fb56Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
116380597fb56Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
116390597fb56Smrg    am__untar='cpio -i -H $1 -d'
116400597fb56Smrg    ;;
116410597fb56Smrg  none)
116420597fb56Smrg    am__tar=false
116430597fb56Smrg    am__tar_=false
116440597fb56Smrg    am__untar=false
116450597fb56Smrg    ;;
116460597fb56Smrg  esac
11647706b6b52Smrg
116480597fb56Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
116490597fb56Smrg  # and am__untar set.
116500597fb56Smrg  test -n "${am_cv_prog_tar_$1}" && break
11651706b6b52Smrg
116520597fb56Smrg  # tar/untar a dummy directory, and stop if the command works
116530597fb56Smrg  rm -rf conftest.dir
116540597fb56Smrg  mkdir conftest.dir
116550597fb56Smrg  echo GrepMe > conftest.dir/file
116560597fb56Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
116570597fb56Smrg  rm -rf conftest.dir
116580597fb56Smrg  if test -s conftest.tar; then
116590597fb56Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
116600597fb56Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
116610597fb56Smrg  fi
116620597fb56Smrgdone
116630597fb56Smrgrm -rf conftest.dir
116640597fb56Smrg
116650597fb56SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
116660597fb56SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
116670597fb56SmrgAC_SUBST([am__tar])
116680597fb56SmrgAC_SUBST([am__untar])
116690597fb56Smrg]) # _AM_PROG_TAR
11670b042e37fSmrg
11671