aclocal.m4 revision b789ec8a
13e256790Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2c43cc173Smrg
3c43cc173Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4c27c18e8Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5c43cc173Smrg# This file is free software; the Free Software Foundation
6c43cc173Smrg# gives unlimited permission to copy and/or distribute it,
7c43cc173Smrg# with or without modifications, as long as this notice is preserved.
8c43cc173Smrg
9c43cc173Smrg# This program is distributed in the hope that it will be useful,
10c43cc173Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11c43cc173Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12c43cc173Smrg# PARTICULAR PURPOSE.
13c43cc173Smrg
1421e67964Smrgm4_ifndef([AC_AUTOCONF_VERSION],
1521e67964Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16b789ec8aSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
17b789ec8aSmrg[m4_warning([this file was generated for autoconf 2.68.
1821e67964SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
1921e67964SmrgIf you have problems, you may need to regenerate the build system entirely.
2021e67964SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21c43cc173Smrg
2221e67964Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
23c27c18e8Smrg#
24c27c18e8Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
2537eb1ca1Smrg#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
2637eb1ca1Smrg#                 Inc.
27c27c18e8Smrg#   Written by Gordon Matzigkeit, 1996
28c27c18e8Smrg#
29c27c18e8Smrg# This file is free software; the Free Software Foundation gives
30c27c18e8Smrg# unlimited permission to copy and/or distribute it, with or without
31c27c18e8Smrg# modifications, as long as this notice is preserved.
32c27c18e8Smrg
33c27c18e8Smrgm4_define([_LT_COPYING], [dnl
34c27c18e8Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
3537eb1ca1Smrg#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
3637eb1ca1Smrg#                 Inc.
37c27c18e8Smrg#   Written by Gordon Matzigkeit, 1996
38c27c18e8Smrg#
39c27c18e8Smrg#   This file is part of GNU Libtool.
40c27c18e8Smrg#
41c27c18e8Smrg# GNU Libtool is free software; you can redistribute it and/or
42c27c18e8Smrg# modify it under the terms of the GNU General Public License as
43c27c18e8Smrg# published by the Free Software Foundation; either version 2 of
44c27c18e8Smrg# the License, or (at your option) any later version.
45c27c18e8Smrg#
46c27c18e8Smrg# As a special exception to the GNU General Public License,
47c27c18e8Smrg# if you distribute this file as part of a program or library that
48c27c18e8Smrg# is built using GNU Libtool, you may include this file under the
49c27c18e8Smrg# same distribution terms that you use for the rest of that program.
50c27c18e8Smrg#
51c27c18e8Smrg# GNU Libtool is distributed in the hope that it will be useful,
52c27c18e8Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
53c27c18e8Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
54c27c18e8Smrg# GNU General Public License for more details.
55c27c18e8Smrg#
56c27c18e8Smrg# You should have received a copy of the GNU General Public License
57c27c18e8Smrg# along with GNU Libtool; see the file COPYING.  If not, a copy
58c27c18e8Smrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
59c27c18e8Smrg# obtained by writing to the Free Software Foundation, Inc.,
60c27c18e8Smrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
61c27c18e8Smrg])
62c43cc173Smrg
6337eb1ca1Smrg# serial 57 LT_INIT
64c43cc173Smrg
65c43cc173Smrg
66c27c18e8Smrg# LT_PREREQ(VERSION)
67c27c18e8Smrg# ------------------
68c27c18e8Smrg# Complain and exit if this libtool version is less that VERSION.
69c27c18e8Smrgm4_defun([LT_PREREQ],
70c27c18e8Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
71c27c18e8Smrg       [m4_default([$3],
72c27c18e8Smrg		   [m4_fatal([Libtool version $1 or higher is required],
73c27c18e8Smrg		             63)])],
74c27c18e8Smrg       [$2])])
75c43cc173Smrg
76c43cc173Smrg
77c27c18e8Smrg# _LT_CHECK_BUILDDIR
78c27c18e8Smrg# ------------------
79c27c18e8Smrg# Complain if the absolute build directory name contains unusual characters
80c27c18e8Smrgm4_defun([_LT_CHECK_BUILDDIR],
81c27c18e8Smrg[case `pwd` in
82c27c18e8Smrg  *\ * | *\	*)
83c27c18e8Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
84c27c18e8Smrgesac
85c27c18e8Smrg])
86c27c18e8Smrg
87c27c18e8Smrg
88c27c18e8Smrg# LT_INIT([OPTIONS])
89c27c18e8Smrg# ------------------
90c27c18e8SmrgAC_DEFUN([LT_INIT],
91c27c18e8Smrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
9237eb1ca1SmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
93c27c18e8SmrgAC_BEFORE([$0], [LT_LANG])dnl
94c27c18e8SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
95c27c18e8SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
96c27c18e8Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
97c27c18e8Smrg
98c27c18e8Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
99c27c18e8Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
100c27c18e8Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
101c27c18e8Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
102c27c18e8Smrgdnl unless we require an AC_DEFUNed macro:
103c27c18e8SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
104c27c18e8SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
105c27c18e8SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
106c27c18e8SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
107c27c18e8Smrgm4_require([_LT_PROG_LTMAIN])dnl
108c27c18e8Smrg
10937eb1ca1Smrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
11037eb1ca1Smrg
111c27c18e8Smrgdnl Parse OPTIONS
112c27c18e8Smrg_LT_SET_OPTIONS([$0], [$1])
113c43cc173Smrg
11421e67964Smrg# This can be used to rebuild libtool when needed
115c27c18e8SmrgLIBTOOL_DEPS="$ltmain"
116c43cc173Smrg
11721e67964Smrg# Always use our own libtool.
11821e67964SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
11921e67964SmrgAC_SUBST(LIBTOOL)dnl
120c43cc173Smrg
121c27c18e8Smrg_LT_SETUP
122c43cc173Smrg
123c27c18e8Smrg# Only expand once:
124c27c18e8Smrgm4_define([LT_INIT])
125c27c18e8Smrg])# LT_INIT
126c43cc173Smrg
127c27c18e8Smrg# Old names:
128c27c18e8SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
129c27c18e8SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
130c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
131c27c18e8Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
132c27c18e8Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
133c27c18e8Smrg
134c27c18e8Smrg
135c27c18e8Smrg# _LT_CC_BASENAME(CC)
136c27c18e8Smrg# -------------------
137c27c18e8Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
138c27c18e8Smrgm4_defun([_LT_CC_BASENAME],
139c27c18e8Smrg[for cc_temp in $1""; do
140c27c18e8Smrg  case $cc_temp in
141c27c18e8Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
142c27c18e8Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
143c27c18e8Smrg    \-*) ;;
144c27c18e8Smrg    *) break;;
145c27c18e8Smrg  esac
146c27c18e8Smrgdone
14737eb1ca1Smrgcc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
148c27c18e8Smrg])
149c27c18e8Smrg
150c27c18e8Smrg
151c27c18e8Smrg# _LT_FILEUTILS_DEFAULTS
152c27c18e8Smrg# ----------------------
153c27c18e8Smrg# It is okay to use these file commands and assume they have been set
154c27c18e8Smrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
155c27c18e8Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
156c27c18e8Smrg[: ${CP="cp -f"}
157c27c18e8Smrg: ${MV="mv -f"}
158c27c18e8Smrg: ${RM="rm -f"}
159c27c18e8Smrg])# _LT_FILEUTILS_DEFAULTS
160c27c18e8Smrg
161c27c18e8Smrg
162c27c18e8Smrg# _LT_SETUP
163c27c18e8Smrg# ---------
164c27c18e8Smrgm4_defun([_LT_SETUP],
165c27c18e8Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
16621e67964SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
16737eb1ca1SmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
16837eb1ca1SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
16937eb1ca1Smrg
170c27c18e8Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
171c27c18e8Smrg_LT_DECL([], [host], [0])dnl
172c27c18e8Smrg_LT_DECL([], [host_os], [0])dnl
173c27c18e8Smrgdnl
174c27c18e8Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
175c27c18e8Smrg_LT_DECL([], [build], [0])dnl
176c27c18e8Smrg_LT_DECL([], [build_os], [0])dnl
177c27c18e8Smrgdnl
17821e67964SmrgAC_REQUIRE([AC_PROG_CC])dnl
179c27c18e8SmrgAC_REQUIRE([LT_PATH_LD])dnl
180c27c18e8SmrgAC_REQUIRE([LT_PATH_NM])dnl
181c27c18e8Smrgdnl
18221e67964SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
183c27c18e8Smrgtest -z "$LN_S" && LN_S="ln -s"
184c27c18e8Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
185c27c18e8Smrgdnl
186c27c18e8SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
187c27c18e8Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
188c27c18e8Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
18921e67964Smrgdnl
190c27c18e8Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
191c27c18e8Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
192b789ec8aSmrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
193c27c18e8Smrgm4_require([_LT_CMD_RELOAD])dnl
194c27c18e8Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
195b789ec8aSmrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
196c27c18e8Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
197c27c18e8Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
198b789ec8aSmrgm4_require([_LT_WITH_SYSROOT])dnl
199c27c18e8Smrg
200c27c18e8Smrg_LT_CONFIG_LIBTOOL_INIT([
201c27c18e8Smrg# See if we are running on zsh, and set the options which allow our
202c27c18e8Smrg# commands through without removal of \ escapes INIT.
203c27c18e8Smrgif test -n "\${ZSH_VERSION+set}" ; then
204c27c18e8Smrg   setopt NO_GLOB_SUBST
205c27c18e8Smrgfi
206c27c18e8Smrg])
207c27c18e8Smrgif test -n "${ZSH_VERSION+set}" ; then
208c27c18e8Smrg   setopt NO_GLOB_SUBST
209c27c18e8Smrgfi
210c27c18e8Smrg
211c27c18e8Smrg_LT_CHECK_OBJDIR
212c43cc173Smrg
213c27c18e8Smrgm4_require([_LT_TAG_COMPILER])dnl
214c43cc173Smrg
21521e67964Smrgcase $host_os in
21621e67964Smrgaix3*)
21721e67964Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
21821e67964Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
21921e67964Smrg  # vanish in a puff of smoke.
22021e67964Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
22121e67964Smrg    COLLECT_NAMES=
22221e67964Smrg    export COLLECT_NAMES
22321e67964Smrg  fi
22421e67964Smrg  ;;
22521e67964Smrgesac
226c43cc173Smrg
22721e67964Smrg# Global variables:
228c27c18e8Smrgofile=libtool
22921e67964Smrgcan_build_shared=yes
230c43cc173Smrg
23121e67964Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
23221e67964Smrg# which needs '.lib').
23321e67964Smrglibext=a
234c43cc173Smrg
235c27c18e8Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
236c43cc173Smrg
23721e67964Smrgold_CC="$CC"
23821e67964Smrgold_CFLAGS="$CFLAGS"
239c43cc173Smrg
24021e67964Smrg# Set sane defaults for various variables
24121e67964Smrgtest -z "$CC" && CC=cc
24221e67964Smrgtest -z "$LTCC" && LTCC=$CC
24321e67964Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
24421e67964Smrgtest -z "$LD" && LD=ld
24521e67964Smrgtest -z "$ac_objext" && ac_objext=o
246c43cc173Smrg
24721e67964Smrg_LT_CC_BASENAME([$compiler])
248c43cc173Smrg
24921e67964Smrg# Only perform the check for file, if the check method requires it
250c27c18e8Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
25121e67964Smrgcase $deplibs_check_method in
25221e67964Smrgfile_magic*)
25321e67964Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
254c27c18e8Smrg    _LT_PATH_MAGIC
25521e67964Smrg  fi
25621e67964Smrg  ;;
25721e67964Smrgesac
258c43cc173Smrg
259c27c18e8Smrg# Use C for the default configuration in the libtool script
260c27c18e8SmrgLT_SUPPORTED_TAG([CC])
261c27c18e8Smrg_LT_LANG_C_CONFIG
262c27c18e8Smrg_LT_LANG_DEFAULT_CONFIG
263c27c18e8Smrg_LT_CONFIG_COMMANDS
264c27c18e8Smrg])# _LT_SETUP
265c43cc173Smrg
266c43cc173Smrg
26737eb1ca1Smrg# _LT_PREPARE_SED_QUOTE_VARS
26837eb1ca1Smrg# --------------------------
26937eb1ca1Smrg# Define a few sed substitution that help us do robust quoting.
27037eb1ca1Smrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
27137eb1ca1Smrg[# Backslashify metacharacters that are still active within
27237eb1ca1Smrg# double-quoted strings.
27337eb1ca1Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
27437eb1ca1Smrg
27537eb1ca1Smrg# Same as above, but do not quote variable references.
27637eb1ca1Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
27737eb1ca1Smrg
27837eb1ca1Smrg# Sed substitution to delay expansion of an escaped shell variable in a
27937eb1ca1Smrg# double_quote_subst'ed string.
28037eb1ca1Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
28137eb1ca1Smrg
28237eb1ca1Smrg# Sed substitution to delay expansion of an escaped single quote.
28337eb1ca1Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
28437eb1ca1Smrg
28537eb1ca1Smrg# Sed substitution to avoid accidental globbing in evaled expressions
28637eb1ca1Smrgno_glob_subst='s/\*/\\\*/g'
28737eb1ca1Smrg])
28837eb1ca1Smrg
289c27c18e8Smrg# _LT_PROG_LTMAIN
290c27c18e8Smrg# ---------------
291c27c18e8Smrg# Note that this code is called both from `configure', and `config.status'
292c27c18e8Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
293c27c18e8Smrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
294c27c18e8Smrg# so we pass a copy along to make sure it has a sensible value anyway.
295c27c18e8Smrgm4_defun([_LT_PROG_LTMAIN],
296c27c18e8Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
297c27c18e8Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
298c27c18e8Smrgltmain="$ac_aux_dir/ltmain.sh"
299c27c18e8Smrg])# _LT_PROG_LTMAIN
300c43cc173Smrg
301c43cc173Smrg
302c27c18e8Smrg
303c27c18e8Smrg# So that we can recreate a full libtool script including additional
304c27c18e8Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
305c27c18e8Smrg# in macros and then make a single call at the end using the `libtool'
306c27c18e8Smrg# label.
307c27c18e8Smrg
308c27c18e8Smrg
309c27c18e8Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
310c27c18e8Smrg# ----------------------------------------
311c27c18e8Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
312c27c18e8Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
313c27c18e8Smrg[m4_ifval([$1],
314c27c18e8Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
315c27c18e8Smrg                     [$1
316c27c18e8Smrg])])])
317c27c18e8Smrg
318c27c18e8Smrg# Initialize.
319c27c18e8Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
320c27c18e8Smrg
321c27c18e8Smrg
322c27c18e8Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
323c27c18e8Smrg# ------------------------------
324c27c18e8Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
325c27c18e8Smrgm4_define([_LT_CONFIG_LIBTOOL],
326c27c18e8Smrg[m4_ifval([$1],
327c27c18e8Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
328c27c18e8Smrg                     [$1
329c27c18e8Smrg])])])
330c27c18e8Smrg
331c27c18e8Smrg# Initialize.
332c27c18e8Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
333c27c18e8Smrg
334c27c18e8Smrg
335c27c18e8Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
336c27c18e8Smrg# -----------------------------------------------------
337c27c18e8Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
338c27c18e8Smrg[_LT_CONFIG_LIBTOOL([$1])
339c27c18e8Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
340c27c18e8Smrg])
341c27c18e8Smrg
342c27c18e8Smrg
343c27c18e8Smrg# _LT_FORMAT_COMMENT([COMMENT])
344c27c18e8Smrg# -----------------------------
345c27c18e8Smrg# Add leading comment marks to the start of each line, and a trailing
346c27c18e8Smrg# full-stop to the whole comment if one is not present already.
347c27c18e8Smrgm4_define([_LT_FORMAT_COMMENT],
348c27c18e8Smrg[m4_ifval([$1], [
349c27c18e8Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
350c27c18e8Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
351c27c18e8Smrg)])
352c27c18e8Smrg
353c27c18e8Smrg
354c27c18e8Smrg
355c27c18e8Smrg
356c27c18e8Smrg
357c27c18e8Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
358c27c18e8Smrg# -------------------------------------------------------------------
359c27c18e8Smrg# CONFIGNAME is the name given to the value in the libtool script.
360c27c18e8Smrg# VARNAME is the (base) name used in the configure script.
361c27c18e8Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
362c27c18e8Smrg# VARNAME.  Any other value will be used directly.
363c27c18e8Smrgm4_define([_LT_DECL],
364c27c18e8Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
365c27c18e8Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
366c27c18e8Smrg	[m4_ifval([$1], [$1], [$2])])
367c27c18e8Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
368c27c18e8Smrg    m4_ifval([$4],
369c27c18e8Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
370c27c18e8Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
371c27c18e8Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
372c27c18e8Smrg])
373c27c18e8Smrg
374c27c18e8Smrg
375c27c18e8Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
376c27c18e8Smrg# --------------------------------------------------------
377c27c18e8Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
378c27c18e8Smrg
379c27c18e8Smrg
380c27c18e8Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
381c27c18e8Smrg# ------------------------------------------------
382c27c18e8Smrgm4_define([lt_decl_tag_varnames],
383c27c18e8Smrg[_lt_decl_filter([tagged?], [yes], $@)])
384c27c18e8Smrg
385c27c18e8Smrg
386c27c18e8Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
387c27c18e8Smrg# ---------------------------------------------------------
388c27c18e8Smrgm4_define([_lt_decl_filter],
389c27c18e8Smrg[m4_case([$#],
390c27c18e8Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
391c27c18e8Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
392c27c18e8Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
393c27c18e8Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
394c27c18e8Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
395c27c18e8Smrg])
396c27c18e8Smrg
397c27c18e8Smrg
398c27c18e8Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
399c27c18e8Smrg# --------------------------------------------------
400c27c18e8Smrgm4_define([lt_decl_quote_varnames],
401c27c18e8Smrg[_lt_decl_filter([value], [1], $@)])
402c27c18e8Smrg
403c27c18e8Smrg
404c27c18e8Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
405c27c18e8Smrg# ---------------------------------------------------
406c27c18e8Smrgm4_define([lt_decl_dquote_varnames],
407c27c18e8Smrg[_lt_decl_filter([value], [2], $@)])
408c27c18e8Smrg
409c27c18e8Smrg
410c27c18e8Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
411c27c18e8Smrg# ---------------------------------------------------
412c27c18e8Smrgm4_define([lt_decl_varnames_tagged],
413c27c18e8Smrg[m4_assert([$# <= 2])dnl
414c27c18e8Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
415c27c18e8Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
416c27c18e8Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
417c27c18e8Smrgm4_define([_lt_decl_varnames_tagged],
418c27c18e8Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
419c27c18e8Smrg
420c27c18e8Smrg
421c27c18e8Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
422c27c18e8Smrg# ------------------------------------------------
423c27c18e8Smrgm4_define([lt_decl_all_varnames],
424c27c18e8Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
425c27c18e8Smrg     m4_if([$2], [],
426c27c18e8Smrg	   m4_quote(lt_decl_varnames),
427c27c18e8Smrg	m4_quote(m4_shift($@))))[]dnl
428c27c18e8Smrg])
429c27c18e8Smrgm4_define([_lt_decl_all_varnames],
430c27c18e8Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
431c27c18e8Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
432c27c18e8Smrg])
433c27c18e8Smrg
434c27c18e8Smrg
435c27c18e8Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
436c27c18e8Smrg# ------------------------------------
437c27c18e8Smrg# Quote a variable value, and forward it to `config.status' so that its
438c27c18e8Smrg# declaration there will have the same value as in `configure'.  VARNAME
439c27c18e8Smrg# must have a single quote delimited value for this to work.
440c27c18e8Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
44137eb1ca1Smrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
442c27c18e8Smrg
443c27c18e8Smrg
444c27c18e8Smrg# _LT_CONFIG_STATUS_DECLARATIONS
445c27c18e8Smrg# ------------------------------
446c27c18e8Smrg# We delimit libtool config variables with single quotes, so when
447c27c18e8Smrg# we write them to config.status, we have to be sure to quote all
448c27c18e8Smrg# embedded single quotes properly.  In configure, this macro expands
449c27c18e8Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
450c27c18e8Smrg#
45137eb1ca1Smrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
452c27c18e8Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
453c27c18e8Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
454c27c18e8Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
455c43cc173Smrg
456c43cc173Smrg
457c27c18e8Smrg# _LT_LIBTOOL_TAGS
458c27c18e8Smrg# ----------------
459c27c18e8Smrg# Output comment and list of tags supported by the script
460c27c18e8Smrgm4_defun([_LT_LIBTOOL_TAGS],
461c27c18e8Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
462c27c18e8Smrgavailable_tags="_LT_TAGS"dnl
463c27c18e8Smrg])
464c27c18e8Smrg
465c27c18e8Smrg
466c27c18e8Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
467c27c18e8Smrg# -----------------------------------
468c27c18e8Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
469c27c18e8Smrg# expand to a commented shell variable setting:
470c27c18e8Smrg#
471c27c18e8Smrg#    # Some comment about what VAR is for.
472c27c18e8Smrg#    visible_name=$lt_internal_name
473c27c18e8Smrgm4_define([_LT_LIBTOOL_DECLARE],
474c27c18e8Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
475c27c18e8Smrg					   [description])))[]dnl
476c27c18e8Smrgm4_pushdef([_libtool_name],
477c27c18e8Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
478c27c18e8Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
479c27c18e8Smrg    [0], [_libtool_name=[$]$1],
480c27c18e8Smrg    [1], [_libtool_name=$lt_[]$1],
481c27c18e8Smrg    [2], [_libtool_name=$lt_[]$1],
482c27c18e8Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
483c27c18e8Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
484c27c18e8Smrg])
485c27c18e8Smrg
486c27c18e8Smrg
487c27c18e8Smrg# _LT_LIBTOOL_CONFIG_VARS
488c27c18e8Smrg# -----------------------
489c27c18e8Smrg# Produce commented declarations of non-tagged libtool config variables
490c27c18e8Smrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
491c27c18e8Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
492c27c18e8Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
493c27c18e8Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
494c27c18e8Smrg[m4_foreach([_lt_var],
495c27c18e8Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
496c27c18e8Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
497c27c18e8Smrg
498c27c18e8Smrg
499c27c18e8Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
500c27c18e8Smrg# -------------------------
501c27c18e8Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
502c27c18e8Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
503c27c18e8Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
504c27c18e8Smrg
505c27c18e8Smrg
506c27c18e8Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
507c27c18e8Smrg# ------------------------------
508c27c18e8Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
509c27c18e8Smrg
510c27c18e8Smrg
511c27c18e8Smrg# _LT_CONFIG_COMMANDS
51221e67964Smrg# -------------------
513c27c18e8Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
514c27c18e8Smrg# variables for single and double quote escaping we saved from calls
515c27c18e8Smrg# to _LT_DECL, we can put quote escaped variables declarations
516c27c18e8Smrg# into `config.status', and then the shell code to quote escape them in
517c27c18e8Smrg# for loops in `config.status'.  Finally, any additional code accumulated
518c27c18e8Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
519c27c18e8Smrgm4_defun([_LT_CONFIG_COMMANDS],
520c27c18e8Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
521c27c18e8Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
522c27c18e8Smrg	dnl instead of duplicating it all over again into config.status,
523c27c18e8Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
524c27c18e8Smrg	dnl needs to know what name is stored there:
525c27c18e8Smrg        [AC_CONFIG_COMMANDS([libtool],
526c27c18e8Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
527c27c18e8Smrg    dnl If the libtool generation code is destined for config.status,
528c27c18e8Smrg    dnl expand the accumulated commands and init code now:
529c27c18e8Smrg    [AC_CONFIG_COMMANDS([libtool],
530c27c18e8Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
531c27c18e8Smrg])#_LT_CONFIG_COMMANDS
532c27c18e8Smrg
533c27c18e8Smrg
534c27c18e8Smrg# Initialize.
535c27c18e8Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
536c27c18e8Smrg[
537c27c18e8Smrg
538c27c18e8Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
539c27c18e8Smrg# if CDPATH is set.
540c27c18e8Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
541c27c18e8Smrg
542c27c18e8Smrgsed_quote_subst='$sed_quote_subst'
543c27c18e8Smrgdouble_quote_subst='$double_quote_subst'
544c27c18e8Smrgdelay_variable_subst='$delay_variable_subst'
545c27c18e8Smrg_LT_CONFIG_STATUS_DECLARATIONS
546c27c18e8SmrgLTCC='$LTCC'
547c27c18e8SmrgLTCFLAGS='$LTCFLAGS'
548c27c18e8Smrgcompiler='$compiler_DEFAULT'
549c27c18e8Smrg
55037eb1ca1Smrg# A function that is used when there is no print builtin or printf.
55137eb1ca1Smrgfunc_fallback_echo ()
55237eb1ca1Smrg{
55337eb1ca1Smrg  eval 'cat <<_LTECHO_EOF
55437eb1ca1Smrg\$[]1
55537eb1ca1Smrg_LTECHO_EOF'
55637eb1ca1Smrg}
55737eb1ca1Smrg
558c27c18e8Smrg# Quote evaled strings.
559c27c18e8Smrgfor var in lt_decl_all_varnames([[ \
560c27c18e8Smrg]], lt_decl_quote_varnames); do
56137eb1ca1Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
562c27c18e8Smrg    *[[\\\\\\\`\\"\\\$]]*)
56337eb1ca1Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
564c27c18e8Smrg      ;;
565c27c18e8Smrg    *)
566c27c18e8Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
567c27c18e8Smrg      ;;
568c27c18e8Smrg    esac
569c27c18e8Smrgdone
570c27c18e8Smrg
571c27c18e8Smrg# Double-quote double-evaled strings.
572c27c18e8Smrgfor var in lt_decl_all_varnames([[ \
573c27c18e8Smrg]], lt_decl_dquote_varnames); do
57437eb1ca1Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
575c27c18e8Smrg    *[[\\\\\\\`\\"\\\$]]*)
57637eb1ca1Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
577c27c18e8Smrg      ;;
578c27c18e8Smrg    *)
579c27c18e8Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
580c27c18e8Smrg      ;;
581c27c18e8Smrg    esac
582c27c18e8Smrgdone
583c27c18e8Smrg
584c27c18e8Smrg_LT_OUTPUT_LIBTOOL_INIT
585c27c18e8Smrg])
586c27c18e8Smrg
58737eb1ca1Smrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
58837eb1ca1Smrg# ------------------------------------
58937eb1ca1Smrg# Generate a child script FILE with all initialization necessary to
59037eb1ca1Smrg# reuse the environment learned by the parent script, and make the
59137eb1ca1Smrg# file executable.  If COMMENT is supplied, it is inserted after the
59237eb1ca1Smrg# `#!' sequence but before initialization text begins.  After this
59337eb1ca1Smrg# macro, additional text can be appended to FILE to form the body of
59437eb1ca1Smrg# the child script.  The macro ends with non-zero status if the
59537eb1ca1Smrg# file could not be fully written (such as if the disk is full).
59637eb1ca1Smrgm4_ifdef([AS_INIT_GENERATED],
59737eb1ca1Smrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
59837eb1ca1Smrg[m4_defun([_LT_GENERATED_FILE_INIT],
59937eb1ca1Smrg[m4_require([AS_PREPARE])]dnl
60037eb1ca1Smrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
60137eb1ca1Smrg[lt_write_fail=0
60237eb1ca1Smrgcat >$1 <<_ASEOF || lt_write_fail=1
60337eb1ca1Smrg#! $SHELL
60437eb1ca1Smrg# Generated by $as_me.
60537eb1ca1Smrg$2
60637eb1ca1SmrgSHELL=\${CONFIG_SHELL-$SHELL}
60737eb1ca1Smrgexport SHELL
60837eb1ca1Smrg_ASEOF
60937eb1ca1Smrgcat >>$1 <<\_ASEOF || lt_write_fail=1
61037eb1ca1SmrgAS_SHELL_SANITIZE
61137eb1ca1Smrg_AS_PREPARE
61237eb1ca1Smrgexec AS_MESSAGE_FD>&1
61337eb1ca1Smrg_ASEOF
61437eb1ca1Smrgtest $lt_write_fail = 0 && chmod +x $1[]dnl
61537eb1ca1Smrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
616c27c18e8Smrg
617c27c18e8Smrg# LT_OUTPUT
618c27c18e8Smrg# ---------
619c27c18e8Smrg# This macro allows early generation of the libtool script (before
620c27c18e8Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
621c27c18e8Smrg# tests.
622c27c18e8SmrgAC_DEFUN([LT_OUTPUT],
623c27c18e8Smrg[: ${CONFIG_LT=./config.lt}
624c27c18e8SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
62537eb1ca1Smrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
62637eb1ca1Smrg[# Run this file to recreate a libtool stub with the current configuration.])
627c27c18e8Smrg
628c27c18e8Smrgcat >>"$CONFIG_LT" <<\_LTEOF
62937eb1ca1Smrglt_cl_silent=false
630c27c18e8Smrgexec AS_MESSAGE_LOG_FD>>config.log
631c27c18e8Smrg{
632c27c18e8Smrg  echo
633c27c18e8Smrg  AS_BOX([Running $as_me.])
634c27c18e8Smrg} >&AS_MESSAGE_LOG_FD
635c27c18e8Smrg
636c27c18e8Smrglt_cl_help="\
637c27c18e8Smrg\`$as_me' creates a local libtool stub from the current configuration,
638c27c18e8Smrgfor use in further configure time tests before the real libtool is
639c27c18e8Smrggenerated.
640c27c18e8Smrg
641c27c18e8SmrgUsage: $[0] [[OPTIONS]]
642c27c18e8Smrg
643c27c18e8Smrg  -h, --help      print this help, then exit
644c27c18e8Smrg  -V, --version   print version number, then exit
645c27c18e8Smrg  -q, --quiet     do not print progress messages
646c27c18e8Smrg  -d, --debug     don't remove temporary files
647c27c18e8Smrg
648c27c18e8SmrgReport bugs to <bug-libtool@gnu.org>."
649c27c18e8Smrg
650c27c18e8Smrglt_cl_version="\
651c27c18e8Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
652c27c18e8Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
653c27c18e8Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
654c27c18e8Smrg
65537eb1ca1SmrgCopyright (C) 2010 Free Software Foundation, Inc.
656c27c18e8SmrgThis config.lt script is free software; the Free Software Foundation
657c27c18e8Smrggives unlimited permision to copy, distribute and modify it."
658c27c18e8Smrg
659c27c18e8Smrgwhile test $[#] != 0
660c27c18e8Smrgdo
661c27c18e8Smrg  case $[1] in
662c27c18e8Smrg    --version | --v* | -V )
663c27c18e8Smrg      echo "$lt_cl_version"; exit 0 ;;
664c27c18e8Smrg    --help | --h* | -h )
665c27c18e8Smrg      echo "$lt_cl_help"; exit 0 ;;
666c27c18e8Smrg    --debug | --d* | -d )
667c27c18e8Smrg      debug=: ;;
668c27c18e8Smrg    --quiet | --q* | --silent | --s* | -q )
669c27c18e8Smrg      lt_cl_silent=: ;;
670c27c18e8Smrg
671c27c18e8Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
672c27c18e8SmrgTry \`$[0] --help' for more information.]) ;;
673c27c18e8Smrg
674c27c18e8Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
675c27c18e8SmrgTry \`$[0] --help' for more information.]) ;;
676c27c18e8Smrg  esac
677c27c18e8Smrg  shift
678c27c18e8Smrgdone
679c27c18e8Smrg
680c27c18e8Smrgif $lt_cl_silent; then
681c27c18e8Smrg  exec AS_MESSAGE_FD>/dev/null
682c27c18e8Smrgfi
683c27c18e8Smrg_LTEOF
684c27c18e8Smrg
685c27c18e8Smrgcat >>"$CONFIG_LT" <<_LTEOF
686c27c18e8Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
687c27c18e8Smrg_LTEOF
688c27c18e8Smrg
689c27c18e8Smrgcat >>"$CONFIG_LT" <<\_LTEOF
690c27c18e8SmrgAC_MSG_NOTICE([creating $ofile])
691c27c18e8Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
692c27c18e8SmrgAS_EXIT(0)
693c27c18e8Smrg_LTEOF
694c27c18e8Smrgchmod +x "$CONFIG_LT"
695c27c18e8Smrg
696c27c18e8Smrg# configure is writing to config.log, but config.lt does its own redirection,
697c27c18e8Smrg# appending to config.log, which fails on DOS, as config.log is still kept
698c27c18e8Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
699c27c18e8Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
70037eb1ca1Smrglt_cl_success=:
70137eb1ca1Smrgtest "$silent" = yes &&
70237eb1ca1Smrg  lt_config_lt_args="$lt_config_lt_args --quiet"
70337eb1ca1Smrgexec AS_MESSAGE_LOG_FD>/dev/null
70437eb1ca1Smrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
70537eb1ca1Smrgexec AS_MESSAGE_LOG_FD>>config.log
70637eb1ca1Smrg$lt_cl_success || AS_EXIT(1)
707c27c18e8Smrg])# LT_OUTPUT
708c27c18e8Smrg
709c27c18e8Smrg
710c27c18e8Smrg# _LT_CONFIG(TAG)
711c27c18e8Smrg# ---------------
712c27c18e8Smrg# If TAG is the built-in tag, create an initial libtool script with a
713c27c18e8Smrg# default configuration from the untagged config vars.  Otherwise add code
714c27c18e8Smrg# to config.status for appending the configuration named by TAG from the
715c27c18e8Smrg# matching tagged config vars.
716c27c18e8Smrgm4_defun([_LT_CONFIG],
717c27c18e8Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
718c27c18e8Smrg_LT_CONFIG_SAVE_COMMANDS([
719c27c18e8Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
720c27c18e8Smrg  m4_if(_LT_TAG, [C], [
721c27c18e8Smrg    # See if we are running on zsh, and set the options which allow our
722c27c18e8Smrg    # commands through without removal of \ escapes.
723c27c18e8Smrg    if test -n "${ZSH_VERSION+set}" ; then
724c27c18e8Smrg      setopt NO_GLOB_SUBST
725c27c18e8Smrg    fi
726c27c18e8Smrg
727c27c18e8Smrg    cfgfile="${ofile}T"
728c27c18e8Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
729c27c18e8Smrg    $RM "$cfgfile"
730c27c18e8Smrg
731c27c18e8Smrg    cat <<_LT_EOF >> "$cfgfile"
732c27c18e8Smrg#! $SHELL
733c27c18e8Smrg
734c27c18e8Smrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
735c27c18e8Smrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
736c27c18e8Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
737c27c18e8Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
738c27c18e8Smrg#
739c27c18e8Smrg_LT_COPYING
740c27c18e8Smrg_LT_LIBTOOL_TAGS
741c27c18e8Smrg
742c27c18e8Smrg# ### BEGIN LIBTOOL CONFIG
743c27c18e8Smrg_LT_LIBTOOL_CONFIG_VARS
744c27c18e8Smrg_LT_LIBTOOL_TAG_VARS
745c27c18e8Smrg# ### END LIBTOOL CONFIG
746c27c18e8Smrg
747c27c18e8Smrg_LT_EOF
748c27c18e8Smrg
749c27c18e8Smrg  case $host_os in
750c27c18e8Smrg  aix3*)
751c27c18e8Smrg    cat <<\_LT_EOF >> "$cfgfile"
752c27c18e8Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
753c27c18e8Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
754c27c18e8Smrg# vanish in a puff of smoke.
755c27c18e8Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
756c27c18e8Smrg  COLLECT_NAMES=
757c27c18e8Smrg  export COLLECT_NAMES
758c27c18e8Smrgfi
759c27c18e8Smrg_LT_EOF
760c27c18e8Smrg    ;;
761c27c18e8Smrg  esac
762c27c18e8Smrg
763c27c18e8Smrg  _LT_PROG_LTMAIN
764c27c18e8Smrg
765c27c18e8Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
766c27c18e8Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
767c27c18e8Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
768c27c18e8Smrg  # is reportedly fixed, but why not run on old versions too?
769b789ec8aSmrg  sed '$q' "$ltmain" >> "$cfgfile" \
770b789ec8aSmrg     || (rm -f "$cfgfile"; exit 1)
771c27c18e8Smrg
772b789ec8aSmrg  _LT_PROG_REPLACE_SHELLFNS
773c27c18e8Smrg
774b789ec8aSmrg   mv -f "$cfgfile" "$ofile" ||
775c27c18e8Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
776c27c18e8Smrg  chmod +x "$ofile"
777c27c18e8Smrg],
778c27c18e8Smrg[cat <<_LT_EOF >> "$ofile"
779c27c18e8Smrg
780c27c18e8Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
781c27c18e8Smrgdnl in a comment (ie after a #).
782c27c18e8Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
783c27c18e8Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
784c27c18e8Smrg# ### END LIBTOOL TAG CONFIG: $1
785c27c18e8Smrg_LT_EOF
786c27c18e8Smrg])dnl /m4_if
787c27c18e8Smrg],
788c27c18e8Smrg[m4_if([$1], [], [
789c27c18e8Smrg    PACKAGE='$PACKAGE'
790c27c18e8Smrg    VERSION='$VERSION'
791c27c18e8Smrg    TIMESTAMP='$TIMESTAMP'
792c27c18e8Smrg    RM='$RM'
793c27c18e8Smrg    ofile='$ofile'], [])
794c27c18e8Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
795c27c18e8Smrg])# _LT_CONFIG
796c27c18e8Smrg
797c27c18e8Smrg
798c27c18e8Smrg# LT_SUPPORTED_TAG(TAG)
799c27c18e8Smrg# ---------------------
800c27c18e8Smrg# Trace this macro to discover what tags are supported by the libtool
801c27c18e8Smrg# --tag option, using:
802c27c18e8Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
803c27c18e8SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
804c27c18e8Smrg
805c27c18e8Smrg
806c27c18e8Smrg# C support is built-in for now
807c27c18e8Smrgm4_define([_LT_LANG_C_enabled], [])
808c27c18e8Smrgm4_define([_LT_TAGS], [])
809c27c18e8Smrg
810c27c18e8Smrg
811c27c18e8Smrg# LT_LANG(LANG)
812c27c18e8Smrg# -------------
813c27c18e8Smrg# Enable libtool support for the given language if not already enabled.
814c27c18e8SmrgAC_DEFUN([LT_LANG],
815c27c18e8Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
816c27c18e8Smrgm4_case([$1],
817c27c18e8Smrg  [C],			[_LT_LANG(C)],
818c27c18e8Smrg  [C++],		[_LT_LANG(CXX)],
819c27c18e8Smrg  [Java],		[_LT_LANG(GCJ)],
820c27c18e8Smrg  [Fortran 77],		[_LT_LANG(F77)],
821c27c18e8Smrg  [Fortran],		[_LT_LANG(FC)],
822c27c18e8Smrg  [Windows Resource],	[_LT_LANG(RC)],
823c27c18e8Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
824c27c18e8Smrg    [_LT_LANG($1)],
825c27c18e8Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
826c27c18e8Smrg])# LT_LANG
827c27c18e8Smrg
828c27c18e8Smrg
829c27c18e8Smrg# _LT_LANG(LANGNAME)
830c27c18e8Smrg# ------------------
831c27c18e8Smrgm4_defun([_LT_LANG],
832c27c18e8Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
833c27c18e8Smrg  [LT_SUPPORTED_TAG([$1])dnl
834c27c18e8Smrg  m4_append([_LT_TAGS], [$1 ])dnl
835c27c18e8Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
836c27c18e8Smrg  _LT_LANG_$1_CONFIG($1)])dnl
837c27c18e8Smrg])# _LT_LANG
838c27c18e8Smrg
839c27c18e8Smrg
840c27c18e8Smrg# _LT_LANG_DEFAULT_CONFIG
841c27c18e8Smrg# -----------------------
842c27c18e8Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
843c27c18e8Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
844c27c18e8Smrg  [LT_LANG(CXX)],
845c27c18e8Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
846c27c18e8Smrg
847c27c18e8SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
848c27c18e8Smrg  [LT_LANG(F77)],
849c27c18e8Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
850c27c18e8Smrg
851c27c18e8SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
852c27c18e8Smrg  [LT_LANG(FC)],
853c27c18e8Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
854c27c18e8Smrg
855c27c18e8Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
856c27c18e8Smrgdnl pulling things in needlessly.
857c27c18e8SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
858c27c18e8Smrg  [LT_LANG(GCJ)],
859c27c18e8Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
860c27c18e8Smrg    [LT_LANG(GCJ)],
861c27c18e8Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
862c27c18e8Smrg      [LT_LANG(GCJ)],
863c27c18e8Smrg      [m4_ifdef([AC_PROG_GCJ],
864c27c18e8Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
865c27c18e8Smrg       m4_ifdef([A][M_PROG_GCJ],
866c27c18e8Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
867c27c18e8Smrg       m4_ifdef([LT_PROG_GCJ],
868c27c18e8Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
869c27c18e8Smrg
870c27c18e8SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
871c27c18e8Smrg  [LT_LANG(RC)],
872c27c18e8Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
873c27c18e8Smrg])# _LT_LANG_DEFAULT_CONFIG
874c27c18e8Smrg
875c27c18e8Smrg# Obsolete macros:
876c27c18e8SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
877c27c18e8SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
878c27c18e8SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
879c27c18e8SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
88037eb1ca1SmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
881c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
882c27c18e8Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
883c27c18e8Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
884c27c18e8Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
885c27c18e8Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
88637eb1ca1Smrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
887c27c18e8Smrg
888c27c18e8Smrg
889c27c18e8Smrg# _LT_TAG_COMPILER
890c27c18e8Smrg# ----------------
891c27c18e8Smrgm4_defun([_LT_TAG_COMPILER],
89221e67964Smrg[AC_REQUIRE([AC_PROG_CC])dnl
893c43cc173Smrg
894c27c18e8Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
895c27c18e8Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
896c27c18e8Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
897c27c18e8Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
898c27c18e8Smrg
89921e67964Smrg# If no C compiler was specified, use CC.
90021e67964SmrgLTCC=${LTCC-"$CC"}
901c43cc173Smrg
90221e67964Smrg# If no C compiler flags were specified, use CFLAGS.
90321e67964SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
904c43cc173Smrg
90521e67964Smrg# Allow CC to be a program name with arguments.
90621e67964Smrgcompiler=$CC
907c27c18e8Smrg])# _LT_TAG_COMPILER
908c43cc173Smrg
909c43cc173Smrg
91021e67964Smrg# _LT_COMPILER_BOILERPLATE
91121e67964Smrg# ------------------------
91221e67964Smrg# Check for compiler boilerplate output or warnings with
91321e67964Smrg# the simple compiler test code.
914c27c18e8Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
915c27c18e8Smrg[m4_require([_LT_DECL_SED])dnl
91621e67964Smrgac_outfile=conftest.$ac_objext
91721e67964Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
91821e67964Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
91921e67964Smrg_lt_compiler_boilerplate=`cat conftest.err`
920c27c18e8Smrg$RM conftest*
92121e67964Smrg])# _LT_COMPILER_BOILERPLATE
922c43cc173Smrg
923c43cc173Smrg
92421e67964Smrg# _LT_LINKER_BOILERPLATE
92521e67964Smrg# ----------------------
92621e67964Smrg# Check for linker boilerplate output or warnings with
92721e67964Smrg# the simple link test code.
928c27c18e8Smrgm4_defun([_LT_LINKER_BOILERPLATE],
929c27c18e8Smrg[m4_require([_LT_DECL_SED])dnl
93021e67964Smrgac_outfile=conftest.$ac_objext
93121e67964Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
93221e67964Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
93321e67964Smrg_lt_linker_boilerplate=`cat conftest.err`
934c27c18e8Smrg$RM -r conftest*
93521e67964Smrg])# _LT_LINKER_BOILERPLATE
936c43cc173Smrg
93721e67964Smrg# _LT_REQUIRED_DARWIN_CHECKS
938c27c18e8Smrg# -------------------------
939c27c18e8Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
94021e67964Smrg  case $host_os in
94121e67964Smrg    rhapsody* | darwin*)
94221e67964Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
94321e67964Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
944c27c18e8Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
945c27c18e8Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
946c27c18e8Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
947c27c18e8Smrg    _LT_DECL([], [DSYMUTIL], [1],
948c27c18e8Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
949c27c18e8Smrg    _LT_DECL([], [NMEDIT], [1],
950c27c18e8Smrg      [Tool to change global to local symbols on Mac OS X])
951c27c18e8Smrg    _LT_DECL([], [LIPO], [1],
952c27c18e8Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
953c27c18e8Smrg    _LT_DECL([], [OTOOL], [1],
954c27c18e8Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
955c27c18e8Smrg    _LT_DECL([], [OTOOL64], [1],
956c27c18e8Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
95721e67964Smrg
95821e67964Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
95921e67964Smrg      [lt_cv_apple_cc_single_mod=no
96021e67964Smrg      if test -z "${LT_MULTI_MODULE}"; then
961c27c18e8Smrg	# By default we will add the -single_module flag. You can override
962c27c18e8Smrg	# by either setting the environment variable LT_MULTI_MODULE
963c27c18e8Smrg	# non-empty at configure time, or by adding -multi_module to the
964c27c18e8Smrg	# link flags.
965c27c18e8Smrg	rm -rf libconftest.dylib*
966c27c18e8Smrg	echo "int foo(void){return 1;}" > conftest.c
967c27c18e8Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
968c27c18e8Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
969c27c18e8Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
970c27c18e8Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
971c27c18e8Smrg        _lt_result=$?
972c27c18e8Smrg	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
973c27c18e8Smrg	  lt_cv_apple_cc_single_mod=yes
974c27c18e8Smrg	else
975c27c18e8Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
976c27c18e8Smrg	fi
977c27c18e8Smrg	rm -rf libconftest.dylib*
978c27c18e8Smrg	rm -f conftest.*
97921e67964Smrg      fi])
98021e67964Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
98121e67964Smrg      [lt_cv_ld_exported_symbols_list],
98221e67964Smrg      [lt_cv_ld_exported_symbols_list=no
98321e67964Smrg      save_LDFLAGS=$LDFLAGS
98421e67964Smrg      echo "_main" > conftest.sym
98521e67964Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
98621e67964Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
987c27c18e8Smrg	[lt_cv_ld_exported_symbols_list=yes],
988c27c18e8Smrg	[lt_cv_ld_exported_symbols_list=no])
989c27c18e8Smrg	LDFLAGS="$save_LDFLAGS"
99021e67964Smrg    ])
99137eb1ca1Smrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
99237eb1ca1Smrg      [lt_cv_ld_force_load=no
99337eb1ca1Smrg      cat > conftest.c << _LT_EOF
99437eb1ca1Smrgint forced_loaded() { return 2;}
99537eb1ca1Smrg_LT_EOF
99637eb1ca1Smrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
99737eb1ca1Smrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
99837eb1ca1Smrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
99937eb1ca1Smrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
100037eb1ca1Smrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
100137eb1ca1Smrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
100237eb1ca1Smrg      cat > conftest.c << _LT_EOF
100337eb1ca1Smrgint main() { return 0;}
100437eb1ca1Smrg_LT_EOF
100537eb1ca1Smrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
100637eb1ca1Smrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
100737eb1ca1Smrg      _lt_result=$?
100837eb1ca1Smrg      if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
100937eb1ca1Smrg	lt_cv_ld_force_load=yes
101037eb1ca1Smrg      else
101137eb1ca1Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
101237eb1ca1Smrg      fi
101337eb1ca1Smrg        rm -f conftest.err libconftest.a conftest conftest.c
101437eb1ca1Smrg        rm -rf conftest.dSYM
101537eb1ca1Smrg    ])
101621e67964Smrg    case $host_os in
1017c27c18e8Smrg    rhapsody* | darwin1.[[012]])
101821e67964Smrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
101921e67964Smrg    darwin1.*)
1020c27c18e8Smrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
1021c27c18e8Smrg    darwin*) # darwin 5.x on
102221e67964Smrg      # if running on 10.5 or later, the deployment target defaults
102321e67964Smrg      # to the OS version, if on x86, and 10.4, the deployment
102421e67964Smrg      # target defaults to 10.4. Don't you love it?
102521e67964Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
1026c27c18e8Smrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
1027c27c18e8Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
1028c27c18e8Smrg	10.[[012]]*)
1029c27c18e8Smrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
1030c27c18e8Smrg	10.*)
1031c27c18e8Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
103221e67964Smrg      esac
103321e67964Smrg    ;;
103421e67964Smrg  esac
103521e67964Smrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
103621e67964Smrg      _lt_dar_single_mod='$single_module'
103721e67964Smrg    fi
103821e67964Smrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
103921e67964Smrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
104021e67964Smrg    else
1041c27c18e8Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
104221e67964Smrg    fi
104337eb1ca1Smrg    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
1044c27c18e8Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
104521e67964Smrg    else
104621e67964Smrg      _lt_dsymutil=
104721e67964Smrg    fi
104821e67964Smrg    ;;
104921e67964Smrg  esac
105021e67964Smrg])
1051c43cc173Smrg
1052c27c18e8Smrg
1053c27c18e8Smrg# _LT_DARWIN_LINKER_FEATURES
1054c27c18e8Smrg# --------------------------
1055c27c18e8Smrg# Checks for linker and compiler features on darwin
1056c27c18e8Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
1057c27c18e8Smrg[
1058c27c18e8Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1059c27c18e8Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1060c27c18e8Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
1061c27c18e8Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
1062c27c18e8Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
106337eb1ca1Smrg  if test "$lt_cv_ld_force_load" = "yes"; then
106437eb1ca1Smrg    _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\"`'
106537eb1ca1Smrg  else
106637eb1ca1Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
106737eb1ca1Smrg  fi
1068c27c18e8Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
1069c27c18e8Smrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
1070c27c18e8Smrg  case $cc_basename in
1071c27c18e8Smrg     ifort*) _lt_dar_can_shared=yes ;;
1072c27c18e8Smrg     *) _lt_dar_can_shared=$GCC ;;
1073c27c18e8Smrg  esac
1074c27c18e8Smrg  if test "$_lt_dar_can_shared" = "yes"; then
107537eb1ca1Smrg    output_verbose_link_cmd=func_echo_all
1076c27c18e8Smrg    _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}"
1077c27c18e8Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
1078c27c18e8Smrg    _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}"
1079c27c18e8Smrg    _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}"
1080c27c18e8Smrg    m4_if([$1], [CXX],
1081c27c18e8Smrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
1082c27c18e8Smrg      _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}"
1083c27c18e8Smrg      _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}"
1084c27c18e8Smrg    fi
1085c27c18e8Smrg],[])
1086c27c18e8Smrg  else
1087c27c18e8Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
1088c27c18e8Smrg  fi
1089c27c18e8Smrg])
1090c27c18e8Smrg
1091b789ec8aSmrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
1092b789ec8aSmrg# ----------------------------------
109321e67964Smrg# Links a minimal program and checks the executable
109421e67964Smrg# for the system default hardcoded library path. In most cases,
109521e67964Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
109621e67964Smrg# the location of the communication and MPI libs are included too.
109721e67964Smrg# If we don't find anything, use the default library path according
109821e67964Smrg# to the aix ld manual.
1099b789ec8aSmrg# Store the results from the different compilers for each TAGNAME.
1100b789ec8aSmrg# Allow to override them for all tags through lt_cv_aix_libpath.
1101c27c18e8Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
1102c27c18e8Smrg[m4_require([_LT_DECL_SED])dnl
1103b789ec8aSmrgif test "${lt_cv_aix_libpath+set}" = set; then
1104b789ec8aSmrg  aix_libpath=$lt_cv_aix_libpath
1105b789ec8aSmrgelse
1106b789ec8aSmrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
1107b789ec8aSmrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
1108b789ec8aSmrg  lt_aix_libpath_sed='[
1109b789ec8aSmrg      /Import File Strings/,/^$/ {
1110b789ec8aSmrg	  /^0/ {
1111b789ec8aSmrg	      s/^0  *\([^ ]*\) *$/\1/
1112b789ec8aSmrg	      p
1113b789ec8aSmrg	  }
1114b789ec8aSmrg      }]'
1115b789ec8aSmrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1116b789ec8aSmrg  # Check for a 64-bit object if we didn't find anything.
1117b789ec8aSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1118b789ec8aSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1119b789ec8aSmrg  fi],[])
1120b789ec8aSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1121b789ec8aSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
1122b789ec8aSmrg  fi
1123b789ec8aSmrg  ])
1124b789ec8aSmrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
1125b789ec8aSmrgfi
1126c27c18e8Smrg])# _LT_SYS_MODULE_PATH_AIX
1127c43cc173Smrg
1128c43cc173Smrg
1129c27c18e8Smrg# _LT_SHELL_INIT(ARG)
1130c27c18e8Smrg# -------------------
1131c27c18e8Smrgm4_define([_LT_SHELL_INIT],
113237eb1ca1Smrg[m4_divert_text([M4SH-INIT], [$1
113337eb1ca1Smrg])])# _LT_SHELL_INIT
113437eb1ca1Smrg
1135c43cc173Smrg
1136c43cc173Smrg
1137c27c18e8Smrg# _LT_PROG_ECHO_BACKSLASH
1138c27c18e8Smrg# -----------------------
113937eb1ca1Smrg# Find how we can fake an echo command that does not interpret backslash.
114037eb1ca1Smrg# In particular, with Autoconf 2.60 or later we add some code to the start
114137eb1ca1Smrg# of the generated configure script which will find a shell with a builtin
114237eb1ca1Smrg# printf (which we can use as an echo command).
1143c27c18e8Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
114437eb1ca1Smrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
114537eb1ca1SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
114637eb1ca1SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
114737eb1ca1Smrg
114837eb1ca1SmrgAC_MSG_CHECKING([how to print strings])
114937eb1ca1Smrg# Test print first, because it will be a builtin if present.
1150b789ec8aSmrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
115137eb1ca1Smrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
115237eb1ca1Smrg  ECHO='print -r --'
115337eb1ca1Smrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
115437eb1ca1Smrg  ECHO='printf %s\n'
1155c43cc173Smrgelse
115637eb1ca1Smrg  # Use this function as a fallback that always works.
115737eb1ca1Smrg  func_fallback_echo ()
115837eb1ca1Smrg  {
115937eb1ca1Smrg    eval 'cat <<_LTECHO_EOF
116037eb1ca1Smrg$[]1
116137eb1ca1Smrg_LTECHO_EOF'
116237eb1ca1Smrg  }
116337eb1ca1Smrg  ECHO='func_fallback_echo'
116421e67964Smrgfi
1165c43cc173Smrg
116637eb1ca1Smrg# func_echo_all arg...
116737eb1ca1Smrg# Invoke $ECHO with all args, space-separated.
116837eb1ca1Smrgfunc_echo_all ()
116937eb1ca1Smrg{
117037eb1ca1Smrg    $ECHO "$*" 
117137eb1ca1Smrg}
1172c43cc173Smrg
117337eb1ca1Smrgcase "$ECHO" in
117437eb1ca1Smrg  printf*) AC_MSG_RESULT([printf]) ;;
117537eb1ca1Smrg  print*) AC_MSG_RESULT([print -r]) ;;
117637eb1ca1Smrg  *) AC_MSG_RESULT([cat]) ;;
117737eb1ca1Smrgesac
1178c43cc173Smrg
117937eb1ca1Smrgm4_ifdef([_AS_DETECT_SUGGESTED],
118037eb1ca1Smrg[_AS_DETECT_SUGGESTED([
118137eb1ca1Smrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
118237eb1ca1Smrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
118337eb1ca1Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
118437eb1ca1Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
118537eb1ca1Smrg    PATH=/empty FPATH=/empty; export PATH FPATH
118637eb1ca1Smrg    test "X`printf %s $ECHO`" = "X$ECHO" \
118737eb1ca1Smrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
1188c43cc173Smrg
1189c27c18e8Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
119037eb1ca1Smrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
1191c27c18e8Smrg])# _LT_PROG_ECHO_BACKSLASH
1192c43cc173Smrg
1193c43cc173Smrg
1194b789ec8aSmrg# _LT_WITH_SYSROOT
1195b789ec8aSmrg# ----------------
1196b789ec8aSmrgAC_DEFUN([_LT_WITH_SYSROOT],
1197b789ec8aSmrg[AC_MSG_CHECKING([for sysroot])
1198b789ec8aSmrgAC_ARG_WITH([sysroot],
1199b789ec8aSmrg[  --with-sysroot[=DIR] Search for dependent libraries within DIR
1200b789ec8aSmrg                        (or the compiler's sysroot if not specified).],
1201b789ec8aSmrg[], [with_sysroot=no])
1202b789ec8aSmrg
1203b789ec8aSmrgdnl lt_sysroot will always be passed unquoted.  We quote it here
1204b789ec8aSmrgdnl in case the user passed a directory name.
1205b789ec8aSmrglt_sysroot=
1206b789ec8aSmrgcase ${with_sysroot} in #(
1207b789ec8aSmrg yes)
1208b789ec8aSmrg   if test "$GCC" = yes; then
1209b789ec8aSmrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
1210b789ec8aSmrg   fi
1211b789ec8aSmrg   ;; #(
1212b789ec8aSmrg /*)
1213b789ec8aSmrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
1214b789ec8aSmrg   ;; #(
1215b789ec8aSmrg no|'')
1216b789ec8aSmrg   ;; #(
1217b789ec8aSmrg *)
1218b789ec8aSmrg   AC_MSG_RESULT([${with_sysroot}])
1219b789ec8aSmrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
1220b789ec8aSmrg   ;;
1221b789ec8aSmrgesac
1222b789ec8aSmrg
1223b789ec8aSmrg AC_MSG_RESULT([${lt_sysroot:-no}])
1224b789ec8aSmrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
1225b789ec8aSmrg[dependent libraries, and in which our libraries should be installed.])])
1226b789ec8aSmrg
1227c27c18e8Smrg# _LT_ENABLE_LOCK
1228c27c18e8Smrg# ---------------
1229c27c18e8Smrgm4_defun([_LT_ENABLE_LOCK],
123021e67964Smrg[AC_ARG_ENABLE([libtool-lock],
1231c27c18e8Smrg  [AS_HELP_STRING([--disable-libtool-lock],
1232c27c18e8Smrg    [avoid locking (might break parallel builds)])])
123321e67964Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1234c43cc173Smrg
123521e67964Smrg# Some flags need to be propagated to the compiler or linker for good
123621e67964Smrg# libtool support.
123721e67964Smrgcase $host in
123821e67964Smrgia64-*-hpux*)
123921e67964Smrg  # Find out which ABI we are using.
124021e67964Smrg  echo 'int i;' > conftest.$ac_ext
124121e67964Smrg  if AC_TRY_EVAL(ac_compile); then
124221e67964Smrg    case `/usr/bin/file conftest.$ac_objext` in
1243c27c18e8Smrg      *ELF-32*)
1244c27c18e8Smrg	HPUX_IA64_MODE="32"
1245c27c18e8Smrg	;;
1246c27c18e8Smrg      *ELF-64*)
1247c27c18e8Smrg	HPUX_IA64_MODE="64"
1248c27c18e8Smrg	;;
124921e67964Smrg    esac
125021e67964Smrg  fi
125121e67964Smrg  rm -rf conftest*
125221e67964Smrg  ;;
125321e67964Smrg*-*-irix6*)
125421e67964Smrg  # Find out which ABI we are using.
125537eb1ca1Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
125621e67964Smrg  if AC_TRY_EVAL(ac_compile); then
1257c27c18e8Smrg    if test "$lt_cv_prog_gnu_ld" = yes; then
1258c27c18e8Smrg      case `/usr/bin/file conftest.$ac_objext` in
1259c27c18e8Smrg	*32-bit*)
1260c27c18e8Smrg	  LD="${LD-ld} -melf32bsmip"
1261c27c18e8Smrg	  ;;
1262c27c18e8Smrg	*N32*)
1263c27c18e8Smrg	  LD="${LD-ld} -melf32bmipn32"
1264c27c18e8Smrg	  ;;
1265c27c18e8Smrg	*64-bit*)
1266c27c18e8Smrg	  LD="${LD-ld} -melf64bmip"
1267c27c18e8Smrg	;;
1268c27c18e8Smrg      esac
1269c27c18e8Smrg    else
1270c27c18e8Smrg      case `/usr/bin/file conftest.$ac_objext` in
1271c27c18e8Smrg	*32-bit*)
1272c27c18e8Smrg	  LD="${LD-ld} -32"
1273c27c18e8Smrg	  ;;
1274c27c18e8Smrg	*N32*)
1275c27c18e8Smrg	  LD="${LD-ld} -n32"
1276c27c18e8Smrg	  ;;
1277c27c18e8Smrg	*64-bit*)
1278c27c18e8Smrg	  LD="${LD-ld} -64"
1279c27c18e8Smrg	  ;;
1280c27c18e8Smrg      esac
1281c27c18e8Smrg    fi
128221e67964Smrg  fi
128321e67964Smrg  rm -rf conftest*
128421e67964Smrg  ;;
1285c43cc173Smrg
128621e67964Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
1287c27c18e8Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
128821e67964Smrg  # Find out which ABI we are using.
128921e67964Smrg  echo 'int i;' > conftest.$ac_ext
129021e67964Smrg  if AC_TRY_EVAL(ac_compile); then
129121e67964Smrg    case `/usr/bin/file conftest.o` in
1292c27c18e8Smrg      *32-bit*)
1293c27c18e8Smrg	case $host in
1294c27c18e8Smrg	  x86_64-*kfreebsd*-gnu)
1295c27c18e8Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
1296c27c18e8Smrg	    ;;
1297c27c18e8Smrg	  x86_64-*linux*)
1298c27c18e8Smrg	    LD="${LD-ld} -m elf_i386"
1299c27c18e8Smrg	    ;;
1300c27c18e8Smrg	  ppc64-*linux*|powerpc64-*linux*)
1301c27c18e8Smrg	    LD="${LD-ld} -m elf32ppclinux"
1302c27c18e8Smrg	    ;;
1303c27c18e8Smrg	  s390x-*linux*)
1304c27c18e8Smrg	    LD="${LD-ld} -m elf_s390"
1305c27c18e8Smrg	    ;;
1306c27c18e8Smrg	  sparc64-*linux*)
1307c27c18e8Smrg	    LD="${LD-ld} -m elf32_sparc"
1308c27c18e8Smrg	    ;;
1309c27c18e8Smrg	esac
1310c27c18e8Smrg	;;
1311c27c18e8Smrg      *64-bit*)
1312c27c18e8Smrg	case $host in
1313c27c18e8Smrg	  x86_64-*kfreebsd*-gnu)
1314c27c18e8Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
1315c27c18e8Smrg	    ;;
1316c27c18e8Smrg	  x86_64-*linux*)
1317c27c18e8Smrg	    LD="${LD-ld} -m elf_x86_64"
1318c27c18e8Smrg	    ;;
1319c27c18e8Smrg	  ppc*-*linux*|powerpc*-*linux*)
1320c27c18e8Smrg	    LD="${LD-ld} -m elf64ppc"
1321c27c18e8Smrg	    ;;
1322c27c18e8Smrg	  s390*-*linux*|s390*-*tpf*)
1323c27c18e8Smrg	    LD="${LD-ld} -m elf64_s390"
1324c27c18e8Smrg	    ;;
1325c27c18e8Smrg	  sparc*-*linux*)
1326c27c18e8Smrg	    LD="${LD-ld} -m elf64_sparc"
1327c27c18e8Smrg	    ;;
1328c27c18e8Smrg	esac
1329c27c18e8Smrg	;;
133021e67964Smrg    esac
133121e67964Smrg  fi
133221e67964Smrg  rm -rf conftest*
133321e67964Smrg  ;;
1334c43cc173Smrg
133521e67964Smrg*-*-sco3.2v5*)
133621e67964Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
133721e67964Smrg  SAVE_CFLAGS="$CFLAGS"
133821e67964Smrg  CFLAGS="$CFLAGS -belf"
133921e67964Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
134021e67964Smrg    [AC_LANG_PUSH(C)
1341c27c18e8Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
134221e67964Smrg     AC_LANG_POP])
134321e67964Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
134421e67964Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
134521e67964Smrg    CFLAGS="$SAVE_CFLAGS"
134621e67964Smrg  fi
134721e67964Smrg  ;;
134821e67964Smrgsparc*-*solaris*)
134921e67964Smrg  # Find out which ABI we are using.
135021e67964Smrg  echo 'int i;' > conftest.$ac_ext
135121e67964Smrg  if AC_TRY_EVAL(ac_compile); then
135221e67964Smrg    case `/usr/bin/file conftest.o` in
135321e67964Smrg    *64-bit*)
135421e67964Smrg      case $lt_cv_prog_gnu_ld in
135521e67964Smrg      yes*) LD="${LD-ld} -m elf64_sparc" ;;
135621e67964Smrg      *)
1357c27c18e8Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
135821e67964Smrg	  LD="${LD-ld} -64"
135921e67964Smrg	fi
136021e67964Smrg	;;
136121e67964Smrg      esac
136221e67964Smrg      ;;
136321e67964Smrg    esac
136421e67964Smrg  fi
136521e67964Smrg  rm -rf conftest*
136621e67964Smrg  ;;
136721e67964Smrgesac
1368c43cc173Smrg
136921e67964Smrgneed_locks="$enable_libtool_lock"
1370c27c18e8Smrg])# _LT_ENABLE_LOCK
1371c27c18e8Smrg
1372c27c18e8Smrg
1373b789ec8aSmrg# _LT_PROG_AR
1374b789ec8aSmrg# -----------
1375b789ec8aSmrgm4_defun([_LT_PROG_AR],
1376b789ec8aSmrg[AC_CHECK_TOOLS(AR, [ar], false)
1377b789ec8aSmrg: ${AR=ar}
1378b789ec8aSmrg: ${AR_FLAGS=cru}
1379b789ec8aSmrg_LT_DECL([], [AR], [1], [The archiver])
1380b789ec8aSmrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
1381b789ec8aSmrg
1382b789ec8aSmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
1383b789ec8aSmrg  [lt_cv_ar_at_file=no
1384b789ec8aSmrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
1385b789ec8aSmrg     [echo conftest.$ac_objext > conftest.lst
1386b789ec8aSmrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
1387b789ec8aSmrg      AC_TRY_EVAL([lt_ar_try])
1388b789ec8aSmrg      if test "$ac_status" -eq 0; then
1389b789ec8aSmrg	# Ensure the archiver fails upon bogus file names.
1390b789ec8aSmrg	rm -f conftest.$ac_objext libconftest.a
1391b789ec8aSmrg	AC_TRY_EVAL([lt_ar_try])
1392b789ec8aSmrg	if test "$ac_status" -ne 0; then
1393b789ec8aSmrg          lt_cv_ar_at_file=@
1394b789ec8aSmrg        fi
1395b789ec8aSmrg      fi
1396b789ec8aSmrg      rm -f conftest.* libconftest.a
1397b789ec8aSmrg     ])
1398b789ec8aSmrg  ])
1399b789ec8aSmrg
1400b789ec8aSmrgif test "x$lt_cv_ar_at_file" = xno; then
1401b789ec8aSmrg  archiver_list_spec=
1402b789ec8aSmrgelse
1403b789ec8aSmrg  archiver_list_spec=$lt_cv_ar_at_file
1404b789ec8aSmrgfi
1405b789ec8aSmrg_LT_DECL([], [archiver_list_spec], [1],
1406b789ec8aSmrg  [How to feed a file listing to the archiver])
1407b789ec8aSmrg])# _LT_PROG_AR
1408b789ec8aSmrg
1409b789ec8aSmrg
1410c27c18e8Smrg# _LT_CMD_OLD_ARCHIVE
1411c27c18e8Smrg# -------------------
1412c27c18e8Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
1413b789ec8aSmrg[_LT_PROG_AR
1414c27c18e8Smrg
1415c27c18e8SmrgAC_CHECK_TOOL(STRIP, strip, :)
1416c27c18e8Smrgtest -z "$STRIP" && STRIP=:
1417c27c18e8Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1418c27c18e8Smrg
1419c27c18e8SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
1420c27c18e8Smrgtest -z "$RANLIB" && RANLIB=:
1421c27c18e8Smrg_LT_DECL([], [RANLIB], [1],
1422c27c18e8Smrg    [Commands used to install an old-style archive])
1423c27c18e8Smrg
1424c27c18e8Smrg# Determine commands to create old-style static archives.
1425c27c18e8Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1426c27c18e8Smrgold_postinstall_cmds='chmod 644 $oldlib'
1427c27c18e8Smrgold_postuninstall_cmds=
1428c43cc173Smrg
1429c27c18e8Smrgif test -n "$RANLIB"; then
1430c27c18e8Smrg  case $host_os in
1431c27c18e8Smrg  openbsd*)
1432c27c18e8Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
1433c27c18e8Smrg    ;;
1434c27c18e8Smrg  *)
1435c27c18e8Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
1436c27c18e8Smrg    ;;
1437c27c18e8Smrg  esac
1438c27c18e8Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1439c27c18e8Smrgfi
144037eb1ca1Smrg
144137eb1ca1Smrgcase $host_os in
144237eb1ca1Smrg  darwin*)
144337eb1ca1Smrg    lock_old_archive_extraction=yes ;;
144437eb1ca1Smrg  *)
144537eb1ca1Smrg    lock_old_archive_extraction=no ;;
144637eb1ca1Smrgesac
1447c27c18e8Smrg_LT_DECL([], [old_postinstall_cmds], [2])
1448c27c18e8Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
1449c27c18e8Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
1450c27c18e8Smrg    [Commands used to build an old-style archive])
145137eb1ca1Smrg_LT_DECL([], [lock_old_archive_extraction], [0],
145237eb1ca1Smrg    [Whether to use a lock for old archive extraction])
1453c27c18e8Smrg])# _LT_CMD_OLD_ARCHIVE
1454c43cc173Smrg
1455c43cc173Smrg
1456c27c18e8Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
145721e67964Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
145821e67964Smrg# ----------------------------------------------------------------
145921e67964Smrg# Check whether the given compiler option works
1460c27c18e8SmrgAC_DEFUN([_LT_COMPILER_OPTION],
1461c27c18e8Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1462c27c18e8Smrgm4_require([_LT_DECL_SED])dnl
146321e67964SmrgAC_CACHE_CHECK([$1], [$2],
146421e67964Smrg  [$2=no
1465c27c18e8Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
146621e67964Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
146721e67964Smrg   lt_compiler_flag="$3"
146821e67964Smrg   # Insert the option either (1) after the last *FLAGS variable, or
146921e67964Smrg   # (2) before a word containing "conftest.", or (3) at the end.
147021e67964Smrg   # Note that $ac_compile itself does not contain backslashes and begins
147121e67964Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
147221e67964Smrg   # The option is referenced via a variable to avoid confusing sed.
147321e67964Smrg   lt_compile=`echo "$ac_compile" | $SED \
147421e67964Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
147521e67964Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
147621e67964Smrg   -e 's:$: $lt_compiler_flag:'`
147737eb1ca1Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
147821e67964Smrg   (eval "$lt_compile" 2>conftest.err)
147921e67964Smrg   ac_status=$?
148021e67964Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
148137eb1ca1Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
148221e67964Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
148321e67964Smrg     # The compiler can only warn and ignore the option if not recognized
148421e67964Smrg     # So say no if there are warnings other than the usual output.
148537eb1ca1Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
148621e67964Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
148721e67964Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
148821e67964Smrg       $2=yes
148921e67964Smrg     fi
149021e67964Smrg   fi
1491c27c18e8Smrg   $RM conftest*
149221e67964Smrg])
1493c43cc173Smrg
149421e67964Smrgif test x"[$]$2" = xyes; then
1495c27c18e8Smrg    m4_if([$5], , :, [$5])
149621e67964Smrgelse
1497c27c18e8Smrg    m4_if([$6], , :, [$6])
149821e67964Smrgfi
1499c27c18e8Smrg])# _LT_COMPILER_OPTION
1500c43cc173Smrg
1501c27c18e8Smrg# Old name:
1502c27c18e8SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1503c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
1504c27c18e8Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1505c43cc173Smrg
1506c27c18e8Smrg
1507c27c18e8Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1508c27c18e8Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
1509c27c18e8Smrg# ----------------------------------------------------
1510c27c18e8Smrg# Check whether the given linker option works
1511c27c18e8SmrgAC_DEFUN([_LT_LINKER_OPTION],
1512c27c18e8Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1513c27c18e8Smrgm4_require([_LT_DECL_SED])dnl
151421e67964SmrgAC_CACHE_CHECK([$1], [$2],
151521e67964Smrg  [$2=no
151621e67964Smrg   save_LDFLAGS="$LDFLAGS"
151721e67964Smrg   LDFLAGS="$LDFLAGS $3"
151821e67964Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
151921e67964Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
152021e67964Smrg     # The linker can only warn and ignore the option if not recognized
152121e67964Smrg     # So say no if there are warnings
152221e67964Smrg     if test -s conftest.err; then
152321e67964Smrg       # Append any errors to the config.log.
152421e67964Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
152537eb1ca1Smrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
152621e67964Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
152721e67964Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
152821e67964Smrg         $2=yes
152921e67964Smrg       fi
153021e67964Smrg     else
153121e67964Smrg       $2=yes
153221e67964Smrg     fi
153321e67964Smrg   fi
1534c27c18e8Smrg   $RM -r conftest*
153521e67964Smrg   LDFLAGS="$save_LDFLAGS"
153621e67964Smrg])
1537c43cc173Smrg
153821e67964Smrgif test x"[$]$2" = xyes; then
1539c27c18e8Smrg    m4_if([$4], , :, [$4])
1540c43cc173Smrgelse
1541c27c18e8Smrg    m4_if([$5], , :, [$5])
1542c43cc173Smrgfi
1543c27c18e8Smrg])# _LT_LINKER_OPTION
1544c43cc173Smrg
1545c27c18e8Smrg# Old name:
1546c27c18e8SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1547c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
1548c27c18e8Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1549c43cc173Smrg
1550c27c18e8Smrg
1551c27c18e8Smrg# LT_CMD_MAX_LEN
1552c27c18e8Smrg#---------------
1553c27c18e8SmrgAC_DEFUN([LT_CMD_MAX_LEN],
1554c27c18e8Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1555c27c18e8Smrg# find the maximum length of command line arguments
155621e67964SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
155721e67964SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
155821e67964Smrg  i=0
155921e67964Smrg  teststring="ABCD"
1560c43cc173Smrg
156121e67964Smrg  case $build_os in
156221e67964Smrg  msdosdjgpp*)
156321e67964Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
156421e67964Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
156521e67964Smrg    # during glob expansion).  Even if it were fixed, the result of this
156621e67964Smrg    # check would be larger than it should be.
156721e67964Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
156821e67964Smrg    ;;
1569c43cc173Smrg
157021e67964Smrg  gnu*)
157121e67964Smrg    # Under GNU Hurd, this test is not required because there is
157221e67964Smrg    # no limit to the length of command line arguments.
157321e67964Smrg    # Libtool will interpret -1 as no limit whatsoever
157421e67964Smrg    lt_cv_sys_max_cmd_len=-1;
157521e67964Smrg    ;;
1576c43cc173Smrg
1577c27c18e8Smrg  cygwin* | mingw* | cegcc*)
157821e67964Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
157921e67964Smrg    # about 5 minutes as the teststring grows exponentially.
158021e67964Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
158121e67964Smrg    # you end up with a "frozen" computer, even though with patience
158221e67964Smrg    # the test eventually succeeds (with a max line length of 256k).
158321e67964Smrg    # Instead, let's just punt: use the minimum linelength reported by
158421e67964Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
158521e67964Smrg    lt_cv_sys_max_cmd_len=8192;
158621e67964Smrg    ;;
1587c43cc173Smrg
158837eb1ca1Smrg  mint*)
158937eb1ca1Smrg    # On MiNT this can take a long time and run out of memory.
159037eb1ca1Smrg    lt_cv_sys_max_cmd_len=8192;
159137eb1ca1Smrg    ;;
159237eb1ca1Smrg
159321e67964Smrg  amigaos*)
159421e67964Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
159521e67964Smrg    # So we just punt and use a minimum line length of 8192.
159621e67964Smrg    lt_cv_sys_max_cmd_len=8192;
159721e67964Smrg    ;;
1598c43cc173Smrg
159921e67964Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
160021e67964Smrg    # This has been around since 386BSD, at least.  Likely further.
160121e67964Smrg    if test -x /sbin/sysctl; then
160221e67964Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
160321e67964Smrg    elif test -x /usr/sbin/sysctl; then
160421e67964Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
160521e67964Smrg    else
160621e67964Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
160721e67964Smrg    fi
160821e67964Smrg    # And add a safety zone
160921e67964Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
161021e67964Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
161121e67964Smrg    ;;
1612c43cc173Smrg
161321e67964Smrg  interix*)
161421e67964Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
161521e67964Smrg    lt_cv_sys_max_cmd_len=196608
161621e67964Smrg    ;;
1617c43cc173Smrg
161821e67964Smrg  osf*)
161921e67964Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
162021e67964Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
162121e67964Smrg    # nice to cause kernel panics so lets avoid the loop below.
162221e67964Smrg    # First set a reasonable default.
162321e67964Smrg    lt_cv_sys_max_cmd_len=16384
162421e67964Smrg    #
162521e67964Smrg    if test -x /sbin/sysconfig; then
162621e67964Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
162721e67964Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
162821e67964Smrg      esac
162921e67964Smrg    fi
163021e67964Smrg    ;;
163121e67964Smrg  sco3.2v5*)
163221e67964Smrg    lt_cv_sys_max_cmd_len=102400
163321e67964Smrg    ;;
163421e67964Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
163521e67964Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
163621e67964Smrg    if test -n "$kargmax"; then
1637c27c18e8Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
163821e67964Smrg    else
163921e67964Smrg      lt_cv_sys_max_cmd_len=32768
164021e67964Smrg    fi
164121e67964Smrg    ;;
164221e67964Smrg  *)
164321e67964Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
164421e67964Smrg    if test -n "$lt_cv_sys_max_cmd_len"; then
164521e67964Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
164621e67964Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
164721e67964Smrg    else
1648c27c18e8Smrg      # Make teststring a little bigger before we do anything with it.
1649c27c18e8Smrg      # a 1K string should be a reasonable start.
1650c27c18e8Smrg      for i in 1 2 3 4 5 6 7 8 ; do
1651c27c18e8Smrg        teststring=$teststring$teststring
1652c27c18e8Smrg      done
165321e67964Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1654c27c18e8Smrg      # If test is not a shell built-in, we'll probably end up computing a
1655c27c18e8Smrg      # maximum length that is only half of the actual maximum length, but
1656c27c18e8Smrg      # we can't tell.
165737eb1ca1Smrg      while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
165837eb1ca1Smrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
165921e67964Smrg	      test $i != 17 # 1/2 MB should be enough
166021e67964Smrg      do
166121e67964Smrg        i=`expr $i + 1`
166221e67964Smrg        teststring=$teststring$teststring
166321e67964Smrg      done
1664c27c18e8Smrg      # Only check the string length outside the loop.
1665c27c18e8Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
166621e67964Smrg      teststring=
1667c27c18e8Smrg      # Add a significant safety factor because C++ compilers can tack on
1668c27c18e8Smrg      # massive amounts of additional arguments before passing them to the
1669c27c18e8Smrg      # linker.  It appears as though 1/2 is a usable value.
167021e67964Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
167121e67964Smrg    fi
167221e67964Smrg    ;;
167321e67964Smrg  esac
167421e67964Smrg])
167521e67964Smrgif test -n $lt_cv_sys_max_cmd_len ; then
167621e67964Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
167721e67964Smrgelse
167821e67964Smrg  AC_MSG_RESULT(none)
167921e67964Smrgfi
1680c27c18e8Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
1681c27c18e8Smrg_LT_DECL([], [max_cmd_len], [0],
1682c27c18e8Smrg    [What is the maximum length of a command?])
1683c27c18e8Smrg])# LT_CMD_MAX_LEN
1684c43cc173Smrg
1685c27c18e8Smrg# Old name:
1686c27c18e8SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1687c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
1688c27c18e8Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1689c43cc173Smrg
1690c27c18e8Smrg
1691c27c18e8Smrg# _LT_HEADER_DLFCN
1692c27c18e8Smrg# ----------------
1693c27c18e8Smrgm4_defun([_LT_HEADER_DLFCN],
1694c27c18e8Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1695c27c18e8Smrg])# _LT_HEADER_DLFCN
1696c43cc173Smrg
1697c43cc173Smrg
1698c27c18e8Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1699c27c18e8Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1700c27c18e8Smrg# ----------------------------------------------------------------
1701c27c18e8Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
1702c27c18e8Smrg[m4_require([_LT_HEADER_DLFCN])dnl
170321e67964Smrgif test "$cross_compiling" = yes; then :
170421e67964Smrg  [$4]
170521e67964Smrgelse
170621e67964Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
170721e67964Smrg  lt_status=$lt_dlunknown
1708c27c18e8Smrg  cat > conftest.$ac_ext <<_LT_EOF
170937eb1ca1Smrg[#line $LINENO "configure"
171021e67964Smrg#include "confdefs.h"
1711c43cc173Smrg
171221e67964Smrg#if HAVE_DLFCN_H
171321e67964Smrg#include <dlfcn.h>
171421e67964Smrg#endif
1715c43cc173Smrg
171621e67964Smrg#include <stdio.h>
1717c43cc173Smrg
171821e67964Smrg#ifdef RTLD_GLOBAL
171921e67964Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
172021e67964Smrg#else
172121e67964Smrg#  ifdef DL_GLOBAL
172221e67964Smrg#    define LT_DLGLOBAL		DL_GLOBAL
172321e67964Smrg#  else
172421e67964Smrg#    define LT_DLGLOBAL		0
172521e67964Smrg#  endif
172621e67964Smrg#endif
1727c43cc173Smrg
172821e67964Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
172921e67964Smrg   find out it does not work in some platform. */
173021e67964Smrg#ifndef LT_DLLAZY_OR_NOW
173121e67964Smrg#  ifdef RTLD_LAZY
173221e67964Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
173321e67964Smrg#  else
173421e67964Smrg#    ifdef DL_LAZY
173521e67964Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
173621e67964Smrg#    else
173721e67964Smrg#      ifdef RTLD_NOW
173821e67964Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
173921e67964Smrg#      else
174021e67964Smrg#        ifdef DL_NOW
174121e67964Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
174221e67964Smrg#        else
174321e67964Smrg#          define LT_DLLAZY_OR_NOW	0
174421e67964Smrg#        endif
174521e67964Smrg#      endif
174621e67964Smrg#    endif
174721e67964Smrg#  endif
174821e67964Smrg#endif
174921e67964Smrg
175037eb1ca1Smrg/* When -fvisbility=hidden is used, assume the code has been annotated
175137eb1ca1Smrg   correspondingly for the symbols needed.  */
175237eb1ca1Smrg#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1753b789ec8aSmrgint fnord () __attribute__((visibility("default")));
175437eb1ca1Smrg#endif
175537eb1ca1Smrg
1756b789ec8aSmrgint fnord () { return 42; }
175721e67964Smrgint main ()
175821e67964Smrg{
175921e67964Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
176021e67964Smrg  int status = $lt_dlunknown;
176121e67964Smrg
176221e67964Smrg  if (self)
176321e67964Smrg    {
176421e67964Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
176537eb1ca1Smrg      else
176637eb1ca1Smrg        {
176737eb1ca1Smrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
176837eb1ca1Smrg          else puts (dlerror ());
176937eb1ca1Smrg	}
177021e67964Smrg      /* dlclose (self); */
177121e67964Smrg    }
1772c43cc173Smrg  else
177321e67964Smrg    puts (dlerror ());
177421e67964Smrg
1775c27c18e8Smrg  return status;
177621e67964Smrg}]
1777c27c18e8Smrg_LT_EOF
177821e67964Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
177921e67964Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
178021e67964Smrg    lt_status=$?
178121e67964Smrg    case x$lt_status in
178221e67964Smrg      x$lt_dlno_uscore) $1 ;;
178321e67964Smrg      x$lt_dlneed_uscore) $2 ;;
178421e67964Smrg      x$lt_dlunknown|x*) $3 ;;
178521e67964Smrg    esac
178621e67964Smrg  else :
178721e67964Smrg    # compilation failed
178821e67964Smrg    $3
1789c43cc173Smrg  fi
1790c43cc173Smrgfi
179121e67964Smrgrm -fr conftest*
1792c27c18e8Smrg])# _LT_TRY_DLOPEN_SELF
1793c43cc173Smrg
1794c43cc173Smrg
1795c27c18e8Smrg# LT_SYS_DLOPEN_SELF
1796c27c18e8Smrg# ------------------
1797c27c18e8SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
1798c27c18e8Smrg[m4_require([_LT_HEADER_DLFCN])dnl
179921e67964Smrgif test "x$enable_dlopen" != xyes; then
180021e67964Smrg  enable_dlopen=unknown
180121e67964Smrg  enable_dlopen_self=unknown
180221e67964Smrg  enable_dlopen_self_static=unknown
180321e67964Smrgelse
180421e67964Smrg  lt_cv_dlopen=no
180521e67964Smrg  lt_cv_dlopen_libs=
1806c43cc173Smrg
180721e67964Smrg  case $host_os in
180821e67964Smrg  beos*)
180921e67964Smrg    lt_cv_dlopen="load_add_on"
181021e67964Smrg    lt_cv_dlopen_libs=
181121e67964Smrg    lt_cv_dlopen_self=yes
181221e67964Smrg    ;;
1813c43cc173Smrg
1814c27c18e8Smrg  mingw* | pw32* | cegcc*)
181521e67964Smrg    lt_cv_dlopen="LoadLibrary"
181621e67964Smrg    lt_cv_dlopen_libs=
1817c27c18e8Smrg    ;;
1818c43cc173Smrg
181921e67964Smrg  cygwin*)
182021e67964Smrg    lt_cv_dlopen="dlopen"
182121e67964Smrg    lt_cv_dlopen_libs=
1822c27c18e8Smrg    ;;
1823c43cc173Smrg
182421e67964Smrg  darwin*)
182521e67964Smrg  # if libdl is installed we need to link against it
182621e67964Smrg    AC_CHECK_LIB([dl], [dlopen],
182721e67964Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
182821e67964Smrg    lt_cv_dlopen="dyld"
182921e67964Smrg    lt_cv_dlopen_libs=
183021e67964Smrg    lt_cv_dlopen_self=yes
183121e67964Smrg    ])
1832c27c18e8Smrg    ;;
183321e67964Smrg
183421e67964Smrg  *)
183521e67964Smrg    AC_CHECK_FUNC([shl_load],
183621e67964Smrg	  [lt_cv_dlopen="shl_load"],
183721e67964Smrg      [AC_CHECK_LIB([dld], [shl_load],
183821e67964Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
183921e67964Smrg	[AC_CHECK_FUNC([dlopen],
184021e67964Smrg	      [lt_cv_dlopen="dlopen"],
184121e67964Smrg	  [AC_CHECK_LIB([dl], [dlopen],
184221e67964Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
184321e67964Smrg	    [AC_CHECK_LIB([svld], [dlopen],
184421e67964Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
184521e67964Smrg	      [AC_CHECK_LIB([dld], [dld_link],
184621e67964Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
184721e67964Smrg	      ])
184821e67964Smrg	    ])
184921e67964Smrg	  ])
185021e67964Smrg	])
185121e67964Smrg      ])
185221e67964Smrg    ;;
1853c43cc173Smrg  esac
1854c43cc173Smrg
185521e67964Smrg  if test "x$lt_cv_dlopen" != xno; then
185621e67964Smrg    enable_dlopen=yes
185721e67964Smrg  else
185821e67964Smrg    enable_dlopen=no
185921e67964Smrg  fi
1860c43cc173Smrg
186121e67964Smrg  case $lt_cv_dlopen in
186221e67964Smrg  dlopen)
186321e67964Smrg    save_CPPFLAGS="$CPPFLAGS"
186421e67964Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1865c43cc173Smrg
186621e67964Smrg    save_LDFLAGS="$LDFLAGS"
186721e67964Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1868c43cc173Smrg
186921e67964Smrg    save_LIBS="$LIBS"
187021e67964Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
1871c43cc173Smrg
187221e67964Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
187321e67964Smrg	  lt_cv_dlopen_self, [dnl
1874c27c18e8Smrg	  _LT_TRY_DLOPEN_SELF(
187521e67964Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
187621e67964Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
187721e67964Smrg    ])
1878c43cc173Smrg
187921e67964Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
188021e67964Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
188121e67964Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1882c27c18e8Smrg	  lt_cv_dlopen_self_static, [dnl
1883c27c18e8Smrg	  _LT_TRY_DLOPEN_SELF(
188421e67964Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
188521e67964Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
188621e67964Smrg      ])
188721e67964Smrg    fi
1888c43cc173Smrg
188921e67964Smrg    CPPFLAGS="$save_CPPFLAGS"
189021e67964Smrg    LDFLAGS="$save_LDFLAGS"
189121e67964Smrg    LIBS="$save_LIBS"
189221e67964Smrg    ;;
189321e67964Smrg  esac
1894c43cc173Smrg
189521e67964Smrg  case $lt_cv_dlopen_self in
189621e67964Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
189721e67964Smrg  *) enable_dlopen_self=unknown ;;
189821e67964Smrg  esac
1899c43cc173Smrg
190021e67964Smrg  case $lt_cv_dlopen_self_static in
190121e67964Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
190221e67964Smrg  *) enable_dlopen_self_static=unknown ;;
190321e67964Smrg  esac
190421e67964Smrgfi
1905c27c18e8Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
1906c27c18e8Smrg	 [Whether dlopen is supported])
1907c27c18e8Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
1908c27c18e8Smrg	 [Whether dlopen of programs is supported])
1909c27c18e8Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
1910c27c18e8Smrg	 [Whether dlopen of statically linked programs is supported])
1911c27c18e8Smrg])# LT_SYS_DLOPEN_SELF
1912c43cc173Smrg
1913c27c18e8Smrg# Old name:
1914c27c18e8SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
1915c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
1916c27c18e8Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1917c43cc173Smrg
1918c27c18e8Smrg
1919c27c18e8Smrg# _LT_COMPILER_C_O([TAGNAME])
1920c27c18e8Smrg# ---------------------------
1921c27c18e8Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
1922c27c18e8Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
1923c27c18e8Smrgm4_defun([_LT_COMPILER_C_O],
1924c27c18e8Smrg[m4_require([_LT_DECL_SED])dnl
1925c27c18e8Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
1926c27c18e8Smrgm4_require([_LT_TAG_COMPILER])dnl
192721e67964SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1928c27c18e8Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1929c27c18e8Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
1930c27c18e8Smrg   $RM -r conftest 2>/dev/null
193121e67964Smrg   mkdir conftest
193221e67964Smrg   cd conftest
193321e67964Smrg   mkdir out
193421e67964Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1935c43cc173Smrg
193621e67964Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
193721e67964Smrg   # Insert the option either (1) after the last *FLAGS variable, or
193821e67964Smrg   # (2) before a word containing "conftest.", or (3) at the end.
193921e67964Smrg   # Note that $ac_compile itself does not contain backslashes and begins
194021e67964Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
194121e67964Smrg   lt_compile=`echo "$ac_compile" | $SED \
194221e67964Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
194321e67964Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
194421e67964Smrg   -e 's:$: $lt_compiler_flag:'`
194537eb1ca1Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
194621e67964Smrg   (eval "$lt_compile" 2>out/conftest.err)
194721e67964Smrg   ac_status=$?
194821e67964Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
194937eb1ca1Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
195021e67964Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
195121e67964Smrg   then
195221e67964Smrg     # The compiler can only warn and ignore the option if not recognized
195321e67964Smrg     # So say no if there are warnings
195437eb1ca1Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
195521e67964Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
195621e67964Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
1957c27c18e8Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
195821e67964Smrg     fi
195921e67964Smrg   fi
196021e67964Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
1961c27c18e8Smrg   $RM conftest*
196221e67964Smrg   # SGI C++ compiler will create directory out/ii_files/ for
196321e67964Smrg   # template instantiation
1964c27c18e8Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
1965c27c18e8Smrg   $RM out/* && rmdir out
196621e67964Smrg   cd ..
1967c27c18e8Smrg   $RM -r conftest
1968c27c18e8Smrg   $RM conftest*
196921e67964Smrg])
1970c27c18e8Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
1971c27c18e8Smrg	[Does compiler simultaneously support -c and -o options?])
1972c27c18e8Smrg])# _LT_COMPILER_C_O
1973c43cc173Smrg
1974c43cc173Smrg
1975c27c18e8Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
1976c27c18e8Smrg# ----------------------------------
197721e67964Smrg# Check to see if we can do hard links to lock some files if needed
1978c27c18e8Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
1979c27c18e8Smrg[m4_require([_LT_ENABLE_LOCK])dnl
1980c27c18e8Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
1981c27c18e8Smrg_LT_COMPILER_C_O([$1])
1982c43cc173Smrg
198321e67964Smrghard_links="nottested"
1984c27c18e8Smrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
198521e67964Smrg  # do not overwrite the value of need_locks provided by the user
198621e67964Smrg  AC_MSG_CHECKING([if we can lock with hard links])
198721e67964Smrg  hard_links=yes
1988c27c18e8Smrg  $RM conftest*
198921e67964Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
199021e67964Smrg  touch conftest.a
199121e67964Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
199221e67964Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
199321e67964Smrg  AC_MSG_RESULT([$hard_links])
199421e67964Smrg  if test "$hard_links" = no; then
199521e67964Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
199621e67964Smrg    need_locks=warn
199721e67964Smrg  fi
199821e67964Smrgelse
199921e67964Smrg  need_locks=no
200021e67964Smrgfi
2001c27c18e8Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
2002c27c18e8Smrg])# _LT_COMPILER_FILE_LOCKS
2003c43cc173Smrg
2004c43cc173Smrg
2005c27c18e8Smrg# _LT_CHECK_OBJDIR
2006c27c18e8Smrg# ----------------
2007c27c18e8Smrgm4_defun([_LT_CHECK_OBJDIR],
200821e67964Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
200921e67964Smrg[rm -f .libs 2>/dev/null
201021e67964Smrgmkdir .libs 2>/dev/null
201121e67964Smrgif test -d .libs; then
201221e67964Smrg  lt_cv_objdir=.libs
201321e67964Smrgelse
201421e67964Smrg  # MS-DOS does not allow filenames that begin with a dot.
201521e67964Smrg  lt_cv_objdir=_libs
201621e67964Smrgfi
201721e67964Smrgrmdir .libs 2>/dev/null])
201821e67964Smrgobjdir=$lt_cv_objdir
2019c27c18e8Smrg_LT_DECL([], [objdir], [0],
2020c27c18e8Smrg         [The name of the directory that contains temporary libtool files])dnl
2021c27c18e8Smrgm4_pattern_allow([LT_OBJDIR])dnl
2022c27c18e8SmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
2023c27c18e8Smrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
2024c27c18e8Smrg])# _LT_CHECK_OBJDIR
2025c43cc173Smrg
2026c43cc173Smrg
2027c27c18e8Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
2028c27c18e8Smrg# --------------------------------------
202921e67964Smrg# Check hardcoding attributes.
2030c27c18e8Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
203121e67964Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
2032c27c18e8Smrg_LT_TAGVAR(hardcode_action, $1)=
2033c27c18e8Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
2034c27c18e8Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
2035c27c18e8Smrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
2036c43cc173Smrg
2037c27c18e8Smrg  # We can hardcode non-existent directories.
2038c27c18e8Smrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
203921e67964Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
204021e67964Smrg     # have to relink, otherwise we might link with an installed library
204121e67964Smrg     # when we should be linking with a yet-to-be-installed one
2042c27c18e8Smrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
2043c27c18e8Smrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
204421e67964Smrg    # Linking always hardcodes the temporary library directory.
2045c27c18e8Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
204621e67964Smrg  else
204721e67964Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
2048c27c18e8Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
2049c43cc173Smrg  fi
205021e67964Smrgelse
205121e67964Smrg  # We cannot hardcode anything, or else we can only hardcode existing
205221e67964Smrg  # directories.
2053c27c18e8Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
205421e67964Smrgfi
2055c27c18e8SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2056c43cc173Smrg
2057c27c18e8Smrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
2058c27c18e8Smrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
205921e67964Smrg  # Fast installation is not supported
206021e67964Smrg  enable_fast_install=no
206121e67964Smrgelif test "$shlibpath_overrides_runpath" = yes ||
206221e67964Smrg     test "$enable_shared" = no; then
206321e67964Smrg  # Fast installation is not necessary
206421e67964Smrg  enable_fast_install=needless
206521e67964Smrgfi
2066c27c18e8Smrg_LT_TAGDECL([], [hardcode_action], [0],
2067c27c18e8Smrg    [How to hardcode a shared library path into an executable])
2068c27c18e8Smrg])# _LT_LINKER_HARDCODE_LIBPATH
2069c43cc173Smrg
2070c43cc173Smrg
2071c27c18e8Smrg# _LT_CMD_STRIPLIB
2072c27c18e8Smrg# ----------------
2073c27c18e8Smrgm4_defun([_LT_CMD_STRIPLIB],
2074c27c18e8Smrg[m4_require([_LT_DECL_EGREP])
2075c27c18e8Smrgstriplib=
207621e67964Smrgold_striplib=
207721e67964SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
2078c27c18e8Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
207921e67964Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
208021e67964Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
208121e67964Smrg  AC_MSG_RESULT([yes])
208221e67964Smrgelse
208321e67964Smrg# FIXME - insert some real tests, host_os isn't really good enough
2084c43cc173Smrg  case $host_os in
2085c27c18e8Smrg  darwin*)
2086c27c18e8Smrg    if test -n "$STRIP" ; then
2087c27c18e8Smrg      striplib="$STRIP -x"
2088c27c18e8Smrg      old_striplib="$STRIP -S"
2089c27c18e8Smrg      AC_MSG_RESULT([yes])
2090c27c18e8Smrg    else
2091c27c18e8Smrg      AC_MSG_RESULT([no])
2092c27c18e8Smrg    fi
2093c27c18e8Smrg    ;;
2094c27c18e8Smrg  *)
2095c27c18e8Smrg    AC_MSG_RESULT([no])
2096c43cc173Smrg    ;;
2097c43cc173Smrg  esac
2098c43cc173Smrgfi
2099c27c18e8Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2100c27c18e8Smrg_LT_DECL([], [striplib], [1])
2101c27c18e8Smrg])# _LT_CMD_STRIPLIB
2102c43cc173Smrg
2103c43cc173Smrg
2104c27c18e8Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
210521e67964Smrg# -----------------------------
210621e67964Smrg# PORTME Fill in your ld.so characteristics
2107c27c18e8Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
2108c27c18e8Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2109c27c18e8Smrgm4_require([_LT_DECL_EGREP])dnl
2110c27c18e8Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2111c27c18e8Smrgm4_require([_LT_DECL_OBJDUMP])dnl
2112c27c18e8Smrgm4_require([_LT_DECL_SED])dnl
211337eb1ca1Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
211421e67964SmrgAC_MSG_CHECKING([dynamic linker characteristics])
2115c27c18e8Smrgm4_if([$1],
2116c27c18e8Smrg	[], [
211721e67964Smrgif test "$GCC" = yes; then
211821e67964Smrg  case $host_os in
211921e67964Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
212021e67964Smrg    *) lt_awk_arg="/^libraries:/" ;;
212121e67964Smrg  esac
212237eb1ca1Smrg  case $host_os in
212337eb1ca1Smrg    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
212437eb1ca1Smrg    *) lt_sed_strip_eq="s,=/,/,g" ;;
212537eb1ca1Smrg  esac
212637eb1ca1Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
212737eb1ca1Smrg  case $lt_search_path_spec in
212837eb1ca1Smrg  *\;*)
212921e67964Smrg    # if the path contains ";" then we assume it to be the separator
213021e67964Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
213121e67964Smrg    # assumed that no part of a normal pathname contains ";" but that should
213221e67964Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
213337eb1ca1Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
213437eb1ca1Smrg    ;;
213537eb1ca1Smrg  *)
213637eb1ca1Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
213737eb1ca1Smrg    ;;
213837eb1ca1Smrg  esac
213921e67964Smrg  # Ok, now we have the path, separated by spaces, we can step through it
214021e67964Smrg  # and add multilib dir if necessary.
214121e67964Smrg  lt_tmp_lt_search_path_spec=
214221e67964Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
214321e67964Smrg  for lt_sys_path in $lt_search_path_spec; do
214421e67964Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
214521e67964Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
214621e67964Smrg    else
214721e67964Smrg      test -d "$lt_sys_path" && \
214821e67964Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
214921e67964Smrg    fi
215021e67964Smrg  done
215137eb1ca1Smrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
215221e67964SmrgBEGIN {RS=" "; FS="/|\n";} {
215321e67964Smrg  lt_foo="";
215421e67964Smrg  lt_count=0;
215521e67964Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
215621e67964Smrg    if ($lt_i != "" && $lt_i != ".") {
215721e67964Smrg      if ($lt_i == "..") {
215821e67964Smrg        lt_count++;
215921e67964Smrg      } else {
216021e67964Smrg        if (lt_count == 0) {
216121e67964Smrg          lt_foo="/" $lt_i lt_foo;
216221e67964Smrg        } else {
216321e67964Smrg          lt_count--;
216421e67964Smrg        }
216521e67964Smrg      }
216621e67964Smrg    }
216721e67964Smrg  }
216821e67964Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
216921e67964Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
217021e67964Smrg}'`
217137eb1ca1Smrg  # AWK program above erroneously prepends '/' to C:/dos/paths
217237eb1ca1Smrg  # for these hosts.
217337eb1ca1Smrg  case $host_os in
217437eb1ca1Smrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
217537eb1ca1Smrg      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
217637eb1ca1Smrg  esac
217737eb1ca1Smrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
217821e67964Smrgelse
217921e67964Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
218021e67964Smrgfi])
2181c27c18e8Smrglibrary_names_spec=
2182c27c18e8Smrglibname_spec='lib$name'
2183c27c18e8Smrgsoname_spec=
2184c27c18e8Smrgshrext_cmds=".so"
2185c27c18e8Smrgpostinstall_cmds=
2186c27c18e8Smrgpostuninstall_cmds=
2187c27c18e8Smrgfinish_cmds=
2188c27c18e8Smrgfinish_eval=
2189c27c18e8Smrgshlibpath_var=
2190c27c18e8Smrgshlibpath_overrides_runpath=unknown
2191c27c18e8Smrgversion_type=none
2192c27c18e8Smrgdynamic_linker="$host_os ld.so"
2193c27c18e8Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
219421e67964Smrgneed_lib_prefix=unknown
219521e67964Smrghardcode_into_libs=no
2196c43cc173Smrg
219721e67964Smrg# when you set need_version to no, make sure it does not cause -set_version
219821e67964Smrg# flags to be left without arguments
219921e67964Smrgneed_version=unknown
2200c43cc173Smrg
220121e67964Smrgcase $host_os in
220221e67964Smrgaix3*)
220321e67964Smrg  version_type=linux
220421e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
220521e67964Smrg  shlibpath_var=LIBPATH
2206c43cc173Smrg
220721e67964Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
220821e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
220921e67964Smrg  ;;
2210c43cc173Smrg
221121e67964Smrgaix[[4-9]]*)
221221e67964Smrg  version_type=linux
221321e67964Smrg  need_lib_prefix=no
221421e67964Smrg  need_version=no
221521e67964Smrg  hardcode_into_libs=yes
221621e67964Smrg  if test "$host_cpu" = ia64; then
221721e67964Smrg    # AIX 5 supports IA64
221821e67964Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
221921e67964Smrg    shlibpath_var=LD_LIBRARY_PATH
222021e67964Smrg  else
222121e67964Smrg    # With GCC up to 2.95.x, collect2 would create an import file
222221e67964Smrg    # for dependence libraries.  The import file would start with
222321e67964Smrg    # the line `#! .'.  This would cause the generated library to
222421e67964Smrg    # depend on `.', always an invalid library.  This was fixed in
222521e67964Smrg    # development snapshots of GCC prior to 3.0.
222621e67964Smrg    case $host_os in
222721e67964Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
222821e67964Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
222921e67964Smrg	   echo ' yes '
2230c27c18e8Smrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
223121e67964Smrg	:
223221e67964Smrg      else
223321e67964Smrg	can_build_shared=no
223421e67964Smrg      fi
223521e67964Smrg      ;;
223621e67964Smrg    esac
223721e67964Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
223821e67964Smrg    # soname into executable. Probably we can add versioning support to
223921e67964Smrg    # collect2, so additional links can be useful in future.
224021e67964Smrg    if test "$aix_use_runtimelinking" = yes; then
224121e67964Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
224221e67964Smrg      # instead of lib<name>.a to let people know that these are not
224321e67964Smrg      # typical AIX shared libraries.
224421e67964Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
224521e67964Smrg    else
224621e67964Smrg      # We preserve .a as extension for shared libraries through AIX4.2
224721e67964Smrg      # and later when we are not doing run time linking.
224821e67964Smrg      library_names_spec='${libname}${release}.a $libname.a'
224921e67964Smrg      soname_spec='${libname}${release}${shared_ext}$major'
225021e67964Smrg    fi
225121e67964Smrg    shlibpath_var=LIBPATH
225221e67964Smrg  fi
225321e67964Smrg  ;;
2254c43cc173Smrg
225521e67964Smrgamigaos*)
2256c27c18e8Smrg  case $host_cpu in
2257c27c18e8Smrg  powerpc)
2258c27c18e8Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
2259c27c18e8Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2260c27c18e8Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2261c27c18e8Smrg    ;;
2262c27c18e8Smrg  m68k)
2263c27c18e8Smrg    library_names_spec='$libname.ixlibrary $libname.a'
2264c27c18e8Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
226537eb1ca1Smrg    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'
2266c27c18e8Smrg    ;;
2267c27c18e8Smrg  esac
226821e67964Smrg  ;;
2269c43cc173Smrg
227021e67964Smrgbeos*)
227121e67964Smrg  library_names_spec='${libname}${shared_ext}'
227221e67964Smrg  dynamic_linker="$host_os ld.so"
227321e67964Smrg  shlibpath_var=LIBRARY_PATH
227421e67964Smrg  ;;
2275c43cc173Smrg
227621e67964Smrgbsdi[[45]]*)
227721e67964Smrg  version_type=linux
227821e67964Smrg  need_version=no
227921e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
228021e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
228121e67964Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
228221e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
228321e67964Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
228421e67964Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
228521e67964Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
228621e67964Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
228721e67964Smrg  # libtool to hard-code these into programs
228821e67964Smrg  ;;
2289c43cc173Smrg
2290c27c18e8Smrgcygwin* | mingw* | pw32* | cegcc*)
229121e67964Smrg  version_type=windows
229221e67964Smrg  shrext_cmds=".dll"
229321e67964Smrg  need_version=no
229421e67964Smrg  need_lib_prefix=no
2295c43cc173Smrg
2296b789ec8aSmrg  case $GCC,$cc_basename in
2297b789ec8aSmrg  yes,*)
2298b789ec8aSmrg    # gcc
229921e67964Smrg    library_names_spec='$libname.dll.a'
230021e67964Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
230121e67964Smrg    postinstall_cmds='base_file=`basename \${file}`~
2302c27c18e8Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
230321e67964Smrg      dldir=$destdir/`dirname \$dlpath`~
230421e67964Smrg      test -d \$dldir || mkdir -p \$dldir~
230521e67964Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
2306c27c18e8Smrg      chmod a+x \$dldir/$dlname~
2307c27c18e8Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2308c27c18e8Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2309c27c18e8Smrg      fi'
231021e67964Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
231121e67964Smrg      dlpath=$dir/\$dldll~
2312c27c18e8Smrg       $RM \$dlpath'
231321e67964Smrg    shlibpath_overrides_runpath=yes
2314c43cc173Smrg
231521e67964Smrg    case $host_os in
231621e67964Smrg    cygwin*)
231721e67964Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
231821e67964Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
231937eb1ca1Smrgm4_if([$1], [],[
232037eb1ca1Smrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
232121e67964Smrg      ;;
2322c27c18e8Smrg    mingw* | cegcc*)
232321e67964Smrg      # MinGW DLLs use traditional 'lib' prefix
232421e67964Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
232521e67964Smrg      ;;
232621e67964Smrg    pw32*)
232721e67964Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
232821e67964Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
232921e67964Smrg      ;;
233021e67964Smrg    esac
2331b789ec8aSmrg    dynamic_linker='Win32 ld.exe'
2332b789ec8aSmrg    ;;
2333b789ec8aSmrg
2334b789ec8aSmrg  *,cl*)
2335b789ec8aSmrg    # Native MSVC
2336b789ec8aSmrg    libname_spec='$name'
2337b789ec8aSmrg    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2338b789ec8aSmrg    library_names_spec='${libname}.dll.lib'
2339b789ec8aSmrg
2340b789ec8aSmrg    case $build_os in
2341b789ec8aSmrg    mingw*)
2342b789ec8aSmrg      sys_lib_search_path_spec=
2343b789ec8aSmrg      lt_save_ifs=$IFS
2344b789ec8aSmrg      IFS=';'
2345b789ec8aSmrg      for lt_path in $LIB
2346b789ec8aSmrg      do
2347b789ec8aSmrg        IFS=$lt_save_ifs
2348b789ec8aSmrg        # Let DOS variable expansion print the short 8.3 style file name.
2349b789ec8aSmrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
2350b789ec8aSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
2351b789ec8aSmrg      done
2352b789ec8aSmrg      IFS=$lt_save_ifs
2353b789ec8aSmrg      # Convert to MSYS style.
2354b789ec8aSmrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
2355b789ec8aSmrg      ;;
2356b789ec8aSmrg    cygwin*)
2357b789ec8aSmrg      # Convert to unix form, then to dos form, then back to unix form
2358b789ec8aSmrg      # but this time dos style (no spaces!) so that the unix form looks
2359b789ec8aSmrg      # like /cygdrive/c/PROGRA~1:/cygdr...
2360b789ec8aSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
2361b789ec8aSmrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
2362b789ec8aSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2363b789ec8aSmrg      ;;
2364b789ec8aSmrg    *)
2365b789ec8aSmrg      sys_lib_search_path_spec="$LIB"
2366b789ec8aSmrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2367b789ec8aSmrg        # It is most probably a Windows format PATH.
2368b789ec8aSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2369b789ec8aSmrg      else
2370b789ec8aSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2371b789ec8aSmrg      fi
2372b789ec8aSmrg      # FIXME: find the short name or the path components, as spaces are
2373b789ec8aSmrg      # common. (e.g. "Program Files" -> "PROGRA~1")
2374b789ec8aSmrg      ;;
2375b789ec8aSmrg    esac
2376b789ec8aSmrg
2377b789ec8aSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2378b789ec8aSmrg    postinstall_cmds='base_file=`basename \${file}`~
2379b789ec8aSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2380b789ec8aSmrg      dldir=$destdir/`dirname \$dlpath`~
2381b789ec8aSmrg      test -d \$dldir || mkdir -p \$dldir~
2382b789ec8aSmrg      $install_prog $dir/$dlname \$dldir/$dlname'
2383b789ec8aSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2384b789ec8aSmrg      dlpath=$dir/\$dldll~
2385b789ec8aSmrg       $RM \$dlpath'
2386b789ec8aSmrg    shlibpath_overrides_runpath=yes
2387b789ec8aSmrg    dynamic_linker='Win32 link.exe'
238821e67964Smrg    ;;
2389c43cc173Smrg
239021e67964Smrg  *)
2391b789ec8aSmrg    # Assume MSVC wrapper
239221e67964Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
2393b789ec8aSmrg    dynamic_linker='Win32 ld.exe'
239421e67964Smrg    ;;
239521e67964Smrg  esac
239621e67964Smrg  # FIXME: first we should search . and the directory the executable is in
239721e67964Smrg  shlibpath_var=PATH
2398c43cc173Smrg  ;;
2399c43cc173Smrg
240021e67964Smrgdarwin* | rhapsody*)
240121e67964Smrg  dynamic_linker="$host_os dyld"
240221e67964Smrg  version_type=darwin
240321e67964Smrg  need_lib_prefix=no
240421e67964Smrg  need_version=no
2405c27c18e8Smrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
240621e67964Smrg  soname_spec='${libname}${release}${major}$shared_ext'
240721e67964Smrg  shlibpath_overrides_runpath=yes
240821e67964Smrg  shlibpath_var=DYLD_LIBRARY_PATH
240921e67964Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2410c27c18e8Smrgm4_if([$1], [],[
2411c27c18e8Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
241221e67964Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
241321e67964Smrg  ;;
2414c43cc173Smrg
241521e67964Smrgdgux*)
241621e67964Smrg  version_type=linux
241721e67964Smrg  need_lib_prefix=no
241821e67964Smrg  need_version=no
241921e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
242021e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
242121e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
242221e67964Smrg  ;;
2423c43cc173Smrg
242421e67964Smrgfreebsd1*)
242521e67964Smrg  dynamic_linker=no
242621e67964Smrg  ;;
2427c43cc173Smrg
242821e67964Smrgfreebsd* | dragonfly*)
242921e67964Smrg  # DragonFly does not have aout.  When/if they implement a new
243021e67964Smrg  # versioning mechanism, adjust this.
243121e67964Smrg  if test -x /usr/bin/objformat; then
243221e67964Smrg    objformat=`/usr/bin/objformat`
243321e67964Smrg  else
243421e67964Smrg    case $host_os in
243521e67964Smrg    freebsd[[123]]*) objformat=aout ;;
243621e67964Smrg    *) objformat=elf ;;
243721e67964Smrg    esac
243821e67964Smrg  fi
243921e67964Smrg  version_type=freebsd-$objformat
244021e67964Smrg  case $version_type in
244121e67964Smrg    freebsd-elf*)
244221e67964Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
244321e67964Smrg      need_version=no
244421e67964Smrg      need_lib_prefix=no
244521e67964Smrg      ;;
244621e67964Smrg    freebsd-*)
244721e67964Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
244821e67964Smrg      need_version=yes
244921e67964Smrg      ;;
245021e67964Smrg  esac
245121e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
245221e67964Smrg  case $host_os in
245321e67964Smrg  freebsd2*)
245421e67964Smrg    shlibpath_overrides_runpath=yes
245521e67964Smrg    ;;
245621e67964Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
245721e67964Smrg    shlibpath_overrides_runpath=yes
245821e67964Smrg    hardcode_into_libs=yes
245921e67964Smrg    ;;
246021e67964Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
246121e67964Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
246221e67964Smrg    shlibpath_overrides_runpath=no
246321e67964Smrg    hardcode_into_libs=yes
246421e67964Smrg    ;;
246521e67964Smrg  *) # from 4.6 on, and DragonFly
246621e67964Smrg    shlibpath_overrides_runpath=yes
246721e67964Smrg    hardcode_into_libs=yes
246821e67964Smrg    ;;
246921e67964Smrg  esac
247021e67964Smrg  ;;
2471c43cc173Smrg
247221e67964Smrggnu*)
247321e67964Smrg  version_type=linux
247421e67964Smrg  need_lib_prefix=no
247521e67964Smrg  need_version=no
247621e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
247721e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
247821e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
247921e67964Smrg  hardcode_into_libs=yes
248021e67964Smrg  ;;
248121e67964Smrg
248237eb1ca1Smrghaiku*)
248337eb1ca1Smrg  version_type=linux
248437eb1ca1Smrg  need_lib_prefix=no
248537eb1ca1Smrg  need_version=no
248637eb1ca1Smrg  dynamic_linker="$host_os runtime_loader"
248737eb1ca1Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
248837eb1ca1Smrg  soname_spec='${libname}${release}${shared_ext}$major'
248937eb1ca1Smrg  shlibpath_var=LIBRARY_PATH
249037eb1ca1Smrg  shlibpath_overrides_runpath=yes
249137eb1ca1Smrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
249237eb1ca1Smrg  hardcode_into_libs=yes
249337eb1ca1Smrg  ;;
249437eb1ca1Smrg
249521e67964Smrghpux9* | hpux10* | hpux11*)
249621e67964Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
249721e67964Smrg  # link against other versions.
249821e67964Smrg  version_type=sunos
249921e67964Smrg  need_lib_prefix=no
250021e67964Smrg  need_version=no
250121e67964Smrg  case $host_cpu in
250221e67964Smrg  ia64*)
250321e67964Smrg    shrext_cmds='.so'
250421e67964Smrg    hardcode_into_libs=yes
250521e67964Smrg    dynamic_linker="$host_os dld.so"
250621e67964Smrg    shlibpath_var=LD_LIBRARY_PATH
250721e67964Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
250821e67964Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
250921e67964Smrg    soname_spec='${libname}${release}${shared_ext}$major'
251021e67964Smrg    if test "X$HPUX_IA64_MODE" = X32; then
251121e67964Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2512c43cc173Smrg    else
251321e67964Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
251421e67964Smrg    fi
251521e67964Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
251621e67964Smrg    ;;
2517c27c18e8Smrg  hppa*64*)
2518c27c18e8Smrg    shrext_cmds='.sl'
2519c27c18e8Smrg    hardcode_into_libs=yes
2520c27c18e8Smrg    dynamic_linker="$host_os dld.sl"
2521c27c18e8Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2522c27c18e8Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2523c27c18e8Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2524c27c18e8Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2525c27c18e8Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2526c27c18e8Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2527c27c18e8Smrg    ;;
2528c27c18e8Smrg  *)
252921e67964Smrg    shrext_cmds='.sl'
253021e67964Smrg    dynamic_linker="$host_os dld.sl"
253121e67964Smrg    shlibpath_var=SHLIB_PATH
253221e67964Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
253321e67964Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
253421e67964Smrg    soname_spec='${libname}${release}${shared_ext}$major'
253521e67964Smrg    ;;
253621e67964Smrg  esac
253737eb1ca1Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
253821e67964Smrg  postinstall_cmds='chmod 555 $lib'
253937eb1ca1Smrg  # or fails outright, so override atomically:
254037eb1ca1Smrg  install_override_mode=555
254121e67964Smrg  ;;
2542c43cc173Smrg
254321e67964Smrginterix[[3-9]]*)
254421e67964Smrg  version_type=linux
254521e67964Smrg  need_lib_prefix=no
254621e67964Smrg  need_version=no
254721e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
254821e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
254921e67964Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
255021e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
255121e67964Smrg  shlibpath_overrides_runpath=no
255221e67964Smrg  hardcode_into_libs=yes
255321e67964Smrg  ;;
2554c43cc173Smrg
255521e67964Smrgirix5* | irix6* | nonstopux*)
255621e67964Smrg  case $host_os in
255721e67964Smrg    nonstopux*) version_type=nonstopux ;;
255821e67964Smrg    *)
255921e67964Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
256021e67964Smrg		version_type=linux
2561c43cc173Smrg	else
256221e67964Smrg		version_type=irix
256321e67964Smrg	fi ;;
256421e67964Smrg  esac
256521e67964Smrg  need_lib_prefix=no
256621e67964Smrg  need_version=no
256721e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
256821e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
256921e67964Smrg  case $host_os in
257021e67964Smrg  irix5* | nonstopux*)
257121e67964Smrg    libsuff= shlibsuff=
257221e67964Smrg    ;;
257321e67964Smrg  *)
257421e67964Smrg    case $LD in # libtool.m4 will add one of these switches to LD
257521e67964Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
257621e67964Smrg      libsuff= shlibsuff= libmagic=32-bit;;
257721e67964Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
257821e67964Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
257921e67964Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
258021e67964Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
258121e67964Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
258221e67964Smrg    esac
258321e67964Smrg    ;;
258421e67964Smrg  esac
258521e67964Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
258621e67964Smrg  shlibpath_overrides_runpath=no
258721e67964Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
258821e67964Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
258921e67964Smrg  hardcode_into_libs=yes
259021e67964Smrg  ;;
2591c43cc173Smrg
259221e67964Smrg# No shared lib support for Linux oldld, aout, or coff.
259321e67964Smrglinux*oldld* | linux*aout* | linux*coff*)
259421e67964Smrg  dynamic_linker=no
259521e67964Smrg  ;;
2596c43cc173Smrg
259721e67964Smrg# This must be Linux ELF.
259837eb1ca1Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
259921e67964Smrg  version_type=linux
260021e67964Smrg  need_lib_prefix=no
260121e67964Smrg  need_version=no
260221e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
260321e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
260421e67964Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
260521e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
260621e67964Smrg  shlibpath_overrides_runpath=no
260737eb1ca1Smrg
2608c27c18e8Smrg  # Some binutils ld are patched to set DT_RUNPATH
260937eb1ca1Smrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
261037eb1ca1Smrg    [lt_cv_shlibpath_overrides_runpath=no
261137eb1ca1Smrg    save_LDFLAGS=$LDFLAGS
261237eb1ca1Smrg    save_libdir=$libdir
261337eb1ca1Smrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
261437eb1ca1Smrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
261537eb1ca1Smrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
261637eb1ca1Smrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
261737eb1ca1Smrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
261837eb1ca1Smrg    LDFLAGS=$save_LDFLAGS
261937eb1ca1Smrg    libdir=$save_libdir
262037eb1ca1Smrg    ])
262137eb1ca1Smrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
2622c27c18e8Smrg
262321e67964Smrg  # This implies no fast_install, which is unacceptable.
262421e67964Smrg  # Some rework will be needed to allow for fast_install
262521e67964Smrg  # before this can be enabled.
262621e67964Smrg  hardcode_into_libs=yes
2627c27c18e8Smrg
2628c27c18e8Smrg  # Add ABI-specific directories to the system library path.
2629c27c18e8Smrg  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
2630c43cc173Smrg
263121e67964Smrg  # Append ld.so.conf contents to the search path
263221e67964Smrg  if test -f /etc/ld.so.conf; then
263337eb1ca1Smrg    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' ' '`
263421e67964Smrg    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
263537eb1ca1Smrg
263621e67964Smrg  fi
2637c43cc173Smrg
263821e67964Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
263921e67964Smrg  # powerpc, because MkLinux only supported shared libraries with the
264021e67964Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
264121e67964Smrg  # most powerpc-linux boxes support dynamic linking these days and
264221e67964Smrg  # people can always --disable-shared, the test was removed, and we
264321e67964Smrg  # assume the GNU/Linux dynamic linker is in use.
264421e67964Smrg  dynamic_linker='GNU/Linux ld.so'
264521e67964Smrg  ;;
2646c43cc173Smrg
264721e67964Smrgnetbsd*)
264821e67964Smrg  version_type=sunos
264921e67964Smrg  need_lib_prefix=no
265021e67964Smrg  need_version=no
2651c27c18e8Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
265221e67964Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
265321e67964Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
265421e67964Smrg    dynamic_linker='NetBSD (a.out) ld.so'
265521e67964Smrg  else
265621e67964Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
265721e67964Smrg    soname_spec='${libname}${release}${shared_ext}$major'
265821e67964Smrg    dynamic_linker='NetBSD ld.elf_so'
2659c43cc173Smrg  fi
266021e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
266121e67964Smrg  shlibpath_overrides_runpath=yes
266221e67964Smrg  hardcode_into_libs=yes
2663c43cc173Smrg  ;;
2664c43cc173Smrg
266521e67964Smrgnewsos6)
266621e67964Smrg  version_type=linux
266721e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
266821e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
266921e67964Smrg  shlibpath_overrides_runpath=yes
2670c43cc173Smrg  ;;
2671c43cc173Smrg
2672c27c18e8Smrg*nto* | *qnx*)
2673c27c18e8Smrg  version_type=qnx
267421e67964Smrg  need_lib_prefix=no
267521e67964Smrg  need_version=no
267621e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
267721e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
267821e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
2679c27c18e8Smrg  shlibpath_overrides_runpath=no
2680c27c18e8Smrg  hardcode_into_libs=yes
2681c27c18e8Smrg  dynamic_linker='ldqnx.so'
2682c43cc173Smrg  ;;
268321e67964Smrg
268421e67964Smrgopenbsd*)
268521e67964Smrg  version_type=sunos
268621e67964Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
268721e67964Smrg  need_lib_prefix=no
268821e67964Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
268921e67964Smrg  case $host_os in
2690c27c18e8Smrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
2691c27c18e8Smrg    *)				need_version=no  ;;
269221e67964Smrg  esac
269321e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
269421e67964Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
269521e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
2696c27c18e8Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
269721e67964Smrg    case $host_os in
269821e67964Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
269921e67964Smrg	shlibpath_overrides_runpath=no
270021e67964Smrg	;;
270121e67964Smrg      *)
270221e67964Smrg	shlibpath_overrides_runpath=yes
270321e67964Smrg	;;
2704c43cc173Smrg      esac
270521e67964Smrg  else
270621e67964Smrg    shlibpath_overrides_runpath=yes
2707c43cc173Smrg  fi
2708c43cc173Smrg  ;;
2709c43cc173Smrg
271021e67964Smrgos2*)
271121e67964Smrg  libname_spec='$name'
271221e67964Smrg  shrext_cmds=".dll"
271321e67964Smrg  need_lib_prefix=no
271421e67964Smrg  library_names_spec='$libname${shared_ext} $libname.a'
271521e67964Smrg  dynamic_linker='OS/2 ld.exe'
271621e67964Smrg  shlibpath_var=LIBPATH
2717c43cc173Smrg  ;;
2718c43cc173Smrg
271921e67964Smrgosf3* | osf4* | osf5*)
272021e67964Smrg  version_type=osf
272121e67964Smrg  need_lib_prefix=no
272221e67964Smrg  need_version=no
272321e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
272421e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
272521e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
272621e67964Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
272721e67964Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
272821e67964Smrg  ;;
2729c43cc173Smrg
273021e67964Smrgrdos*)
273121e67964Smrg  dynamic_linker=no
273221e67964Smrg  ;;
2733c43cc173Smrg
273421e67964Smrgsolaris*)
273521e67964Smrg  version_type=linux
273621e67964Smrg  need_lib_prefix=no
273721e67964Smrg  need_version=no
273821e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
273921e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
274021e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
274121e67964Smrg  shlibpath_overrides_runpath=yes
274221e67964Smrg  hardcode_into_libs=yes
274321e67964Smrg  # ldd complains unless libraries are executable
274421e67964Smrg  postinstall_cmds='chmod +x $lib'
274521e67964Smrg  ;;
2746c43cc173Smrg
274721e67964Smrgsunos4*)
274821e67964Smrg  version_type=sunos
274921e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
275021e67964Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
275121e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
275221e67964Smrg  shlibpath_overrides_runpath=yes
275321e67964Smrg  if test "$with_gnu_ld" = yes; then
275421e67964Smrg    need_lib_prefix=no
275521e67964Smrg  fi
275621e67964Smrg  need_version=yes
275721e67964Smrg  ;;
2758c43cc173Smrg
275921e67964Smrgsysv4 | sysv4.3*)
276021e67964Smrg  version_type=linux
276121e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
276221e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
276321e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
276421e67964Smrg  case $host_vendor in
276521e67964Smrg    sni)
276621e67964Smrg      shlibpath_overrides_runpath=no
276721e67964Smrg      need_lib_prefix=no
276821e67964Smrg      runpath_var=LD_RUN_PATH
276921e67964Smrg      ;;
277021e67964Smrg    siemens)
277121e67964Smrg      need_lib_prefix=no
277221e67964Smrg      ;;
277321e67964Smrg    motorola)
277421e67964Smrg      need_lib_prefix=no
277521e67964Smrg      need_version=no
277621e67964Smrg      shlibpath_overrides_runpath=no
277721e67964Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
277821e67964Smrg      ;;
277921e67964Smrg  esac
278021e67964Smrg  ;;
2781c43cc173Smrg
278221e67964Smrgsysv4*MP*)
278321e67964Smrg  if test -d /usr/nec ;then
278421e67964Smrg    version_type=linux
278521e67964Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
278621e67964Smrg    soname_spec='$libname${shared_ext}.$major'
278721e67964Smrg    shlibpath_var=LD_LIBRARY_PATH
278821e67964Smrg  fi
278921e67964Smrg  ;;
2790c43cc173Smrg
279121e67964Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
279221e67964Smrg  version_type=freebsd-elf
279321e67964Smrg  need_lib_prefix=no
279421e67964Smrg  need_version=no
279521e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
279621e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
279721e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
2798c27c18e8Smrg  shlibpath_overrides_runpath=yes
279921e67964Smrg  hardcode_into_libs=yes
280021e67964Smrg  if test "$with_gnu_ld" = yes; then
280121e67964Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
280221e67964Smrg  else
280321e67964Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
280421e67964Smrg    case $host_os in
280521e67964Smrg      sco3.2v5*)
280621e67964Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
280721e67964Smrg	;;
280821e67964Smrg    esac
280921e67964Smrg  fi
281021e67964Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
281121e67964Smrg  ;;
2812c43cc173Smrg
2813c27c18e8Smrgtpf*)
2814c27c18e8Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
2815c27c18e8Smrg  version_type=linux
2816c27c18e8Smrg  need_lib_prefix=no
2817c27c18e8Smrg  need_version=no
2818c27c18e8Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2819c27c18e8Smrg  shlibpath_var=LD_LIBRARY_PATH
2820c27c18e8Smrg  shlibpath_overrides_runpath=no
2821c27c18e8Smrg  hardcode_into_libs=yes
2822c27c18e8Smrg  ;;
2823c27c18e8Smrg
282421e67964Smrguts4*)
282521e67964Smrg  version_type=linux
282621e67964Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
282721e67964Smrg  soname_spec='${libname}${release}${shared_ext}$major'
282821e67964Smrg  shlibpath_var=LD_LIBRARY_PATH
282921e67964Smrg  ;;
2830c43cc173Smrg
283121e67964Smrg*)
283221e67964Smrg  dynamic_linker=no
283321e67964Smrg  ;;
283421e67964Smrgesac
283521e67964SmrgAC_MSG_RESULT([$dynamic_linker])
283621e67964Smrgtest "$dynamic_linker" = no && can_build_shared=no
2837c43cc173Smrg
283821e67964Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
283921e67964Smrgif test "$GCC" = yes; then
284021e67964Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
284121e67964Smrgfi
2842c43cc173Smrg
2843c27c18e8Smrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
2844c27c18e8Smrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
2845c27c18e8Smrgfi
2846c27c18e8Smrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
2847c27c18e8Smrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
2848c27c18e8Smrgfi
2849c43cc173Smrg
2850c27c18e8Smrg_LT_DECL([], [variables_saved_for_relink], [1],
2851c27c18e8Smrg    [Variables whose values should be saved in libtool wrapper scripts and
2852c27c18e8Smrg    restored at link time])
2853c27c18e8Smrg_LT_DECL([], [need_lib_prefix], [0],
2854c27c18e8Smrg    [Do we need the "lib" prefix for modules?])
2855c27c18e8Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
2856c27c18e8Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
2857c27c18e8Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
2858c27c18e8Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
2859c27c18e8Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
2860c27c18e8Smrg    [Is shlibpath searched before the hard-coded library search path?])
2861c27c18e8Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
2862c27c18e8Smrg_LT_DECL([], [library_names_spec], [1],
2863c27c18e8Smrg    [[List of archive names.  First name is the real one, the rest are links.
2864c27c18e8Smrg    The last name is the one that the linker finds with -lNAME]])
2865c27c18e8Smrg_LT_DECL([], [soname_spec], [1],
2866c27c18e8Smrg    [[The coded name of the library, if different from the real name]])
286737eb1ca1Smrg_LT_DECL([], [install_override_mode], [1],
286837eb1ca1Smrg    [Permission mode override for installation of shared libraries])
2869c27c18e8Smrg_LT_DECL([], [postinstall_cmds], [2],
2870c27c18e8Smrg    [Command to use after installation of a shared archive])
2871c27c18e8Smrg_LT_DECL([], [postuninstall_cmds], [2],
2872c27c18e8Smrg    [Command to use after uninstallation of a shared archive])
2873c27c18e8Smrg_LT_DECL([], [finish_cmds], [2],
2874c27c18e8Smrg    [Commands used to finish a libtool library installation in a directory])
2875c27c18e8Smrg_LT_DECL([], [finish_eval], [1],
2876c27c18e8Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
2877c27c18e8Smrg    not shown]])
2878c27c18e8Smrg_LT_DECL([], [hardcode_into_libs], [0],
2879c27c18e8Smrg    [Whether we should hardcode library paths into libraries])
2880c27c18e8Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
2881c27c18e8Smrg    [Compile-time system search path for libraries])
2882c27c18e8Smrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
2883c27c18e8Smrg    [Run-time system search path for libraries])
2884c27c18e8Smrg])# _LT_SYS_DYNAMIC_LINKER
2885c27c18e8Smrg
2886c27c18e8Smrg
2887c27c18e8Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
288821e67964Smrg# --------------------------
288921e67964Smrg# find a file program which can recognize shared library
2890c27c18e8SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
2891c27c18e8Smrg[m4_require([_LT_DECL_EGREP])dnl
289221e67964SmrgAC_MSG_CHECKING([for $1])
289321e67964SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
289421e67964Smrg[case $MAGIC_CMD in
289521e67964Smrg[[\\/*] |  ?:[\\/]*])
289621e67964Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
289721e67964Smrg  ;;
289821e67964Smrg*)
289921e67964Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
290021e67964Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
290121e67964Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
290221e67964Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
290321e67964Smrgdnl not every word.  This closes a longstanding sh security hole.
2904c27c18e8Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
290521e67964Smrg  for ac_dir in $ac_dummy; do
290621e67964Smrg    IFS="$lt_save_ifs"
290721e67964Smrg    test -z "$ac_dir" && ac_dir=.
290821e67964Smrg    if test -f $ac_dir/$1; then
290921e67964Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
291021e67964Smrg      if test -n "$file_magic_test_file"; then
291121e67964Smrg	case $deplibs_check_method in
291221e67964Smrg	"file_magic "*)
291321e67964Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
291421e67964Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
291521e67964Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
291621e67964Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
291721e67964Smrg	    :
291821e67964Smrg	  else
2919c27c18e8Smrg	    cat <<_LT_EOF 1>&2
2920c43cc173Smrg
292121e67964Smrg*** Warning: the command libtool uses to detect shared libraries,
292221e67964Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
292321e67964Smrg*** The result is that libtool may fail to recognize shared libraries
292421e67964Smrg*** as such.  This will affect the creation of libtool libraries that
292521e67964Smrg*** depend on shared libraries, but programs linked with such libtool
292621e67964Smrg*** libraries will work regardless of this problem.  Nevertheless, you
292721e67964Smrg*** may want to report the problem to your system manager and/or to
292821e67964Smrg*** bug-libtool@gnu.org
2929c43cc173Smrg
2930c27c18e8Smrg_LT_EOF
293121e67964Smrg	  fi ;;
293221e67964Smrg	esac
293321e67964Smrg      fi
293421e67964Smrg      break
293521e67964Smrg    fi
293621e67964Smrg  done
293721e67964Smrg  IFS="$lt_save_ifs"
293821e67964Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
293921e67964Smrg  ;;
294021e67964Smrgesac])
294121e67964SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
294221e67964Smrgif test -n "$MAGIC_CMD"; then
294321e67964Smrg  AC_MSG_RESULT($MAGIC_CMD)
2944c43cc173Smrgelse
294521e67964Smrg  AC_MSG_RESULT(no)
2946c43cc173Smrgfi
2947c27c18e8Smrg_LT_DECL([], [MAGIC_CMD], [0],
2948c27c18e8Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
2949c27c18e8Smrg])# _LT_PATH_TOOL_PREFIX
2950c43cc173Smrg
2951c27c18e8Smrg# Old name:
2952c27c18e8SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
2953c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
2954c27c18e8Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
2955c43cc173Smrg
2956c27c18e8Smrg
2957c27c18e8Smrg# _LT_PATH_MAGIC
2958c27c18e8Smrg# --------------
295921e67964Smrg# find a file program which can recognize a shared library
2960c27c18e8Smrgm4_defun([_LT_PATH_MAGIC],
2961c27c18e8Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
296221e67964Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
296321e67964Smrg  if test -n "$ac_tool_prefix"; then
2964c27c18e8Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
2965c43cc173Smrg  else
296621e67964Smrg    MAGIC_CMD=:
2967c43cc173Smrg  fi
2968c43cc173Smrgfi
2969c27c18e8Smrg])# _LT_PATH_MAGIC
2970c43cc173Smrg
2971c43cc173Smrg
2972c27c18e8Smrg# LT_PATH_LD
297321e67964Smrg# ----------
297421e67964Smrg# find the pathname to the GNU or non-GNU linker
2975c27c18e8SmrgAC_DEFUN([LT_PATH_LD],
2976c27c18e8Smrg[AC_REQUIRE([AC_PROG_CC])dnl
297721e67964SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
297821e67964SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
2979c27c18e8Smrgm4_require([_LT_DECL_SED])dnl
2980c27c18e8Smrgm4_require([_LT_DECL_EGREP])dnl
298137eb1ca1Smrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
2982c27c18e8Smrg
2983c27c18e8SmrgAC_ARG_WITH([gnu-ld],
2984c27c18e8Smrg    [AS_HELP_STRING([--with-gnu-ld],
2985c27c18e8Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
2986c27c18e8Smrg    [test "$withval" = no || with_gnu_ld=yes],
2987c27c18e8Smrg    [with_gnu_ld=no])dnl
2988c27c18e8Smrg
298921e67964Smrgac_prog=ld
299021e67964Smrgif test "$GCC" = yes; then
299121e67964Smrg  # Check if gcc -print-prog-name=ld gives a path.
299221e67964Smrg  AC_MSG_CHECKING([for ld used by $CC])
299321e67964Smrg  case $host in
299421e67964Smrg  *-*-mingw*)
299521e67964Smrg    # gcc leaves a trailing carriage return which upsets mingw
299621e67964Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
299721e67964Smrg  *)
299821e67964Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
299921e67964Smrg  esac
300021e67964Smrg  case $ac_prog in
300121e67964Smrg    # Accept absolute paths.
300221e67964Smrg    [[\\/]]* | ?:[[\\/]]*)
300321e67964Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
300421e67964Smrg      # Canonicalize the pathname of ld
3005c27c18e8Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
3006c27c18e8Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
3007c27c18e8Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
300821e67964Smrg      done
300921e67964Smrg      test -z "$LD" && LD="$ac_prog"
301021e67964Smrg      ;;
301121e67964Smrg  "")
301221e67964Smrg    # If it fails, then pretend we aren't using GCC.
301321e67964Smrg    ac_prog=ld
301421e67964Smrg    ;;
301521e67964Smrg  *)
301621e67964Smrg    # If it is relative, then search for the first ld in PATH.
301721e67964Smrg    with_gnu_ld=unknown
3018c43cc173Smrg    ;;
3019c43cc173Smrg  esac
302021e67964Smrgelif test "$with_gnu_ld" = yes; then
302121e67964Smrg  AC_MSG_CHECKING([for GNU ld])
302221e67964Smrgelse
302321e67964Smrg  AC_MSG_CHECKING([for non-GNU ld])
3024c43cc173Smrgfi
302521e67964SmrgAC_CACHE_VAL(lt_cv_path_LD,
302621e67964Smrg[if test -z "$LD"; then
302721e67964Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
302821e67964Smrg  for ac_dir in $PATH; do
302921e67964Smrg    IFS="$lt_save_ifs"
303021e67964Smrg    test -z "$ac_dir" && ac_dir=.
303121e67964Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
303221e67964Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
303321e67964Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
303421e67964Smrg      # but apparently some variants of GNU ld only accept -v.
303521e67964Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
303621e67964Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
303721e67964Smrg      *GNU* | *'with BFD'*)
303821e67964Smrg	test "$with_gnu_ld" != no && break
303921e67964Smrg	;;
304021e67964Smrg      *)
304121e67964Smrg	test "$with_gnu_ld" != yes && break
304221e67964Smrg	;;
304321e67964Smrg      esac
304421e67964Smrg    fi
304521e67964Smrg  done
304621e67964Smrg  IFS="$lt_save_ifs"
3047c43cc173Smrgelse
304821e67964Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
304921e67964Smrgfi])
305021e67964SmrgLD="$lt_cv_path_LD"
305121e67964Smrgif test -n "$LD"; then
305221e67964Smrg  AC_MSG_RESULT($LD)
305321e67964Smrgelse
305421e67964Smrg  AC_MSG_RESULT(no)
3055c43cc173Smrgfi
305621e67964Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3057c27c18e8Smrg_LT_PATH_LD_GNU
3058c27c18e8SmrgAC_SUBST([LD])
3059c43cc173Smrg
3060c27c18e8Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
3061c27c18e8Smrg])# LT_PATH_LD
3062c43cc173Smrg
3063c27c18e8Smrg# Old names:
3064c27c18e8SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
3065c27c18e8SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
3066c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
3067c27c18e8Smrgdnl AC_DEFUN([AM_PROG_LD], [])
3068c27c18e8Smrgdnl AC_DEFUN([AC_PROG_LD], [])
3069c27c18e8Smrg
3070c27c18e8Smrg
3071c27c18e8Smrg# _LT_PATH_LD_GNU
3072c27c18e8Smrg#- --------------
3073c27c18e8Smrgm4_defun([_LT_PATH_LD_GNU],
3074c27c18e8Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
307521e67964Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
307621e67964Smrgcase `$LD -v 2>&1 </dev/null` in
307721e67964Smrg*GNU* | *'with BFD'*)
307821e67964Smrg  lt_cv_prog_gnu_ld=yes
307921e67964Smrg  ;;
308021e67964Smrg*)
308121e67964Smrg  lt_cv_prog_gnu_ld=no
3082c43cc173Smrg  ;;
308321e67964Smrgesac])
308421e67964Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
3085c27c18e8Smrg])# _LT_PATH_LD_GNU
3086c43cc173Smrg
308721e67964Smrg
3088c27c18e8Smrg# _LT_CMD_RELOAD
3089c27c18e8Smrg# --------------
309021e67964Smrg# find reload flag for linker
309121e67964Smrg#   -- PORTME Some linkers may need a different reload flag.
3092c27c18e8Smrgm4_defun([_LT_CMD_RELOAD],
309321e67964Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
309421e67964Smrg  lt_cv_ld_reload_flag,
309521e67964Smrg  [lt_cv_ld_reload_flag='-r'])
309621e67964Smrgreload_flag=$lt_cv_ld_reload_flag
309721e67964Smrgcase $reload_flag in
309821e67964Smrg"" | " "*) ;;
309921e67964Smrg*) reload_flag=" $reload_flag" ;;
310021e67964Smrgesac
310121e67964Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
310221e67964Smrgcase $host_os in
3103b789ec8aSmrg  cygwin* | mingw* | pw32* | cegcc*)
3104b789ec8aSmrg    if test "$GCC" != yes; then
3105b789ec8aSmrg      reload_cmds=false
3106b789ec8aSmrg    fi
3107b789ec8aSmrg    ;;
310821e67964Smrg  darwin*)
310921e67964Smrg    if test "$GCC" = yes; then
311021e67964Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
3111c43cc173Smrg    else
311221e67964Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
3113c43cc173Smrg    fi
311421e67964Smrg    ;;
311521e67964Smrgesac
311637eb1ca1Smrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
311737eb1ca1Smrg_LT_TAGDECL([], [reload_cmds], [2])dnl
3118c27c18e8Smrg])# _LT_CMD_RELOAD
3119c43cc173Smrg
312021e67964Smrg
3121c27c18e8Smrg# _LT_CHECK_MAGIC_METHOD
3122c27c18e8Smrg# ----------------------
312321e67964Smrg# how to check for library dependencies
312421e67964Smrg#  -- PORTME fill in with the dynamic library characteristics
3125c27c18e8Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
3126c27c18e8Smrg[m4_require([_LT_DECL_EGREP])
3127c27c18e8Smrgm4_require([_LT_DECL_OBJDUMP])
3128c27c18e8SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
312921e67964Smrglt_cv_deplibs_check_method,
313021e67964Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
313121e67964Smrglt_cv_file_magic_test_file=
313221e67964Smrglt_cv_deplibs_check_method='unknown'
313321e67964Smrg# Need to set the preceding variable on all platforms that support
313421e67964Smrg# interlibrary dependencies.
313521e67964Smrg# 'none' -- dependencies not supported.
313621e67964Smrg# `unknown' -- same as none, but documents that we really don't know.
313721e67964Smrg# 'pass_all' -- all dependencies passed with no checks.
313821e67964Smrg# 'test_compile' -- check by making test program.
313921e67964Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
314021e67964Smrg# which responds to the $file_magic_cmd with a given extended regex.
314121e67964Smrg# If you have `file' or equivalent on your system and you're not sure
314221e67964Smrg# whether `pass_all' will *always* work, you probably want this one.
314321e67964Smrg
314421e67964Smrgcase $host_os in
314521e67964Smrgaix[[4-9]]*)
314621e67964Smrg  lt_cv_deplibs_check_method=pass_all
3147c43cc173Smrg  ;;
3148c43cc173Smrg
3149c43cc173Smrgbeos*)
315021e67964Smrg  lt_cv_deplibs_check_method=pass_all
3151c43cc173Smrg  ;;
3152c43cc173Smrg
3153c43cc173Smrgbsdi[[45]]*)
315421e67964Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
315521e67964Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
315621e67964Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
3157c43cc173Smrg  ;;
3158c43cc173Smrg
315921e67964Smrgcygwin*)
316021e67964Smrg  # func_win32_libid is a shell function defined in ltmain.sh
316121e67964Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
316221e67964Smrg  lt_cv_file_magic_cmd='func_win32_libid'
316321e67964Smrg  ;;
3164c43cc173Smrg
316521e67964Smrgmingw* | pw32*)
316621e67964Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
316721e67964Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
316821e67964Smrg  # unless we find 'file', for example because we are cross-compiling.
316937eb1ca1Smrg  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
317037eb1ca1Smrg  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
317121e67964Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
317221e67964Smrg    lt_cv_file_magic_cmd='func_win32_libid'
317321e67964Smrg  else
317437eb1ca1Smrg    # Keep this pattern in sync with the one in func_win32_libid.
317537eb1ca1Smrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
317621e67964Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
317721e67964Smrg  fi
317821e67964Smrg  ;;
3179c43cc173Smrg
318037eb1ca1Smrgcegcc*)
3181c27c18e8Smrg  # use the weaker test based on 'objdump'. See mingw*.
3182c27c18e8Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3183c27c18e8Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
3184c27c18e8Smrg  ;;
3185c27c18e8Smrg
318621e67964Smrgdarwin* | rhapsody*)
318721e67964Smrg  lt_cv_deplibs_check_method=pass_all
318821e67964Smrg  ;;
318921e67964Smrg
319021e67964Smrgfreebsd* | dragonfly*)
3191c27c18e8Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
319221e67964Smrg    case $host_cpu in
319321e67964Smrg    i*86 )
319421e67964Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
319521e67964Smrg      # Let's accept both of them until this is cleared up.
319621e67964Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
319721e67964Smrg      lt_cv_file_magic_cmd=/usr/bin/file
319821e67964Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3199c43cc173Smrg      ;;
3200c43cc173Smrg    esac
320121e67964Smrg  else
320221e67964Smrg    lt_cv_deplibs_check_method=pass_all
320321e67964Smrg  fi
320421e67964Smrg  ;;
320521e67964Smrg
320621e67964Smrggnu*)
320721e67964Smrg  lt_cv_deplibs_check_method=pass_all
320821e67964Smrg  ;;
3209c43cc173Smrg
321037eb1ca1Smrghaiku*)
321137eb1ca1Smrg  lt_cv_deplibs_check_method=pass_all
321237eb1ca1Smrg  ;;
321337eb1ca1Smrg
321421e67964Smrghpux10.20* | hpux11*)
321521e67964Smrg  lt_cv_file_magic_cmd=/usr/bin/file
321621e67964Smrg  case $host_cpu in
321721e67964Smrg  ia64*)
321821e67964Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
321921e67964Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
322021e67964Smrg    ;;
322121e67964Smrg  hppa*64*)
322237eb1ca1Smrg    [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]']
322321e67964Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
322421e67964Smrg    ;;
3225c43cc173Smrg  *)
322637eb1ca1Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
322721e67964Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3228c43cc173Smrg    ;;
3229c43cc173Smrg  esac
3230c43cc173Smrg  ;;
3231c43cc173Smrg
323221e67964Smrginterix[[3-9]]*)
323321e67964Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
323421e67964Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3235c43cc173Smrg  ;;
3236c43cc173Smrg
323721e67964Smrgirix5* | irix6* | nonstopux*)
323821e67964Smrg  case $LD in
323921e67964Smrg  *-32|*"-32 ") libmagic=32-bit;;
324021e67964Smrg  *-n32|*"-n32 ") libmagic=N32;;
324121e67964Smrg  *-64|*"-64 ") libmagic=64-bit;;
324221e67964Smrg  *) libmagic=never-match;;
324321e67964Smrg  esac
324421e67964Smrg  lt_cv_deplibs_check_method=pass_all
3245c43cc173Smrg  ;;
3246c43cc173Smrg
324721e67964Smrg# This must be Linux ELF.
324837eb1ca1Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
324921e67964Smrg  lt_cv_deplibs_check_method=pass_all
3250c43cc173Smrg  ;;
3251c43cc173Smrg
325221e67964Smrgnetbsd*)
3253c27c18e8Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
325421e67964Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
325521e67964Smrg  else
325621e67964Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
325721e67964Smrg  fi
3258c43cc173Smrg  ;;
3259c43cc173Smrg
326021e67964Smrgnewos6*)
326121e67964Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
326221e67964Smrg  lt_cv_file_magic_cmd=/usr/bin/file
326321e67964Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
326421e67964Smrg  ;;
326521e67964Smrg
3266c27c18e8Smrg*nto* | *qnx*)
3267c27c18e8Smrg  lt_cv_deplibs_check_method=pass_all
326821e67964Smrg  ;;
326921e67964Smrg
327021e67964Smrgopenbsd*)
3271c27c18e8Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
327221e67964Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3273c43cc173Smrg  else
327421e67964Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3275c43cc173Smrg  fi
327621e67964Smrg  ;;
327721e67964Smrg
327821e67964Smrgosf3* | osf4* | osf5*)
327921e67964Smrg  lt_cv_deplibs_check_method=pass_all
328021e67964Smrg  ;;
328121e67964Smrg
328221e67964Smrgrdos*)
328321e67964Smrg  lt_cv_deplibs_check_method=pass_all
328421e67964Smrg  ;;
328521e67964Smrg
328621e67964Smrgsolaris*)
328721e67964Smrg  lt_cv_deplibs_check_method=pass_all
328821e67964Smrg  ;;
328921e67964Smrg
3290c27c18e8Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3291c27c18e8Smrg  lt_cv_deplibs_check_method=pass_all
3292c27c18e8Smrg  ;;
3293c27c18e8Smrg
329421e67964Smrgsysv4 | sysv4.3*)
329521e67964Smrg  case $host_vendor in
329621e67964Smrg  motorola)
329721e67964Smrg    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]]'
329821e67964Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3299c43cc173Smrg    ;;
330021e67964Smrg  ncr)
330121e67964Smrg    lt_cv_deplibs_check_method=pass_all
3302c43cc173Smrg    ;;
330321e67964Smrg  sequent)
330421e67964Smrg    lt_cv_file_magic_cmd='/bin/file'
330521e67964Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3306c43cc173Smrg    ;;
330721e67964Smrg  sni)
330821e67964Smrg    lt_cv_file_magic_cmd='/bin/file'
330921e67964Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
331021e67964Smrg    lt_cv_file_magic_test_file=/lib/libc.so
331121e67964Smrg    ;;
331221e67964Smrg  siemens)
331321e67964Smrg    lt_cv_deplibs_check_method=pass_all
331421e67964Smrg    ;;
331521e67964Smrg  pc)
331621e67964Smrg    lt_cv_deplibs_check_method=pass_all
3317c43cc173Smrg    ;;
3318c43cc173Smrg  esac
3319c43cc173Smrg  ;;
3320c43cc173Smrg
3321c27c18e8Smrgtpf*)
332221e67964Smrg  lt_cv_deplibs_check_method=pass_all
3323c43cc173Smrg  ;;
332421e67964Smrgesac
332521e67964Smrg])
3326b789ec8aSmrg
3327b789ec8aSmrgfile_magic_glob=
3328b789ec8aSmrgwant_nocaseglob=no
3329b789ec8aSmrgif test "$build" = "$host"; then
3330b789ec8aSmrg  case $host_os in
3331b789ec8aSmrg  mingw* | pw32*)
3332b789ec8aSmrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
3333b789ec8aSmrg      want_nocaseglob=yes
3334b789ec8aSmrg    else
3335b789ec8aSmrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
3336b789ec8aSmrg    fi
3337b789ec8aSmrg    ;;
3338b789ec8aSmrg  esac
3339b789ec8aSmrgfi
3340b789ec8aSmrg
334121e67964Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
334221e67964Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
334321e67964Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
3344c43cc173Smrg
3345c27c18e8Smrg_LT_DECL([], [deplibs_check_method], [1],
3346c27c18e8Smrg    [Method to check whether dependent libraries are shared objects])
3347c27c18e8Smrg_LT_DECL([], [file_magic_cmd], [1],
3348b789ec8aSmrg    [Command to use when deplibs_check_method = "file_magic"])
3349b789ec8aSmrg_LT_DECL([], [file_magic_glob], [1],
3350b789ec8aSmrg    [How to find potential files when deplibs_check_method = "file_magic"])
3351b789ec8aSmrg_LT_DECL([], [want_nocaseglob], [1],
3352b789ec8aSmrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
3353c27c18e8Smrg])# _LT_CHECK_MAGIC_METHOD
3354c43cc173Smrg
3355c27c18e8Smrg
3356c27c18e8Smrg# LT_PATH_NM
335721e67964Smrg# ----------
3358c27c18e8Smrg# find the pathname to a BSD- or MS-compatible name lister
3359c27c18e8SmrgAC_DEFUN([LT_PATH_NM],
3360c27c18e8Smrg[AC_REQUIRE([AC_PROG_CC])dnl
3361c27c18e8SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
336221e67964Smrg[if test -n "$NM"; then
336321e67964Smrg  # Let the user override the test.
336421e67964Smrg  lt_cv_path_NM="$NM"
336521e67964Smrgelse
336621e67964Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
336721e67964Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
336821e67964Smrg    lt_nm_to_check="$lt_nm_to_check nm"
3369c43cc173Smrg  fi
337021e67964Smrg  for lt_tmp_nm in $lt_nm_to_check; do
337121e67964Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
337221e67964Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
337321e67964Smrg      IFS="$lt_save_ifs"
337421e67964Smrg      test -z "$ac_dir" && ac_dir=.
337521e67964Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
337621e67964Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
337721e67964Smrg	# Check to see if the nm accepts a BSD-compat flag.
337821e67964Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
337921e67964Smrg	#   nm: unknown option "B" ignored
338021e67964Smrg	# Tru64's nm complains that /dev/null is an invalid object file
338121e67964Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
338221e67964Smrg	*/dev/null* | *'Invalid file or object type'*)
338321e67964Smrg	  lt_cv_path_NM="$tmp_nm -B"
338421e67964Smrg	  break
338521e67964Smrg	  ;;
338621e67964Smrg	*)
338721e67964Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
338821e67964Smrg	  */dev/null*)
338921e67964Smrg	    lt_cv_path_NM="$tmp_nm -p"
339021e67964Smrg	    break
339121e67964Smrg	    ;;
339221e67964Smrg	  *)
339321e67964Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
339421e67964Smrg	    continue # so that we can try to find one that supports BSD flags
339521e67964Smrg	    ;;
339621e67964Smrg	  esac
339721e67964Smrg	  ;;
339821e67964Smrg	esac
339921e67964Smrg      fi
340021e67964Smrg    done
340121e67964Smrg    IFS="$lt_save_ifs"
340221e67964Smrg  done
3403c27c18e8Smrg  : ${lt_cv_path_NM=no}
340421e67964Smrgfi])
3405c27c18e8Smrgif test "$lt_cv_path_NM" != "no"; then
3406c27c18e8Smrg  NM="$lt_cv_path_NM"
3407c27c18e8Smrgelse
3408c27c18e8Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
340937eb1ca1Smrg  if test -n "$DUMPBIN"; then :
341037eb1ca1Smrg    # Let the user override the test.
341137eb1ca1Smrg  else
341237eb1ca1Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
341337eb1ca1Smrg    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
341437eb1ca1Smrg    *COFF*)
341537eb1ca1Smrg      DUMPBIN="$DUMPBIN -symbols"
341637eb1ca1Smrg      ;;
341737eb1ca1Smrg    *)
341837eb1ca1Smrg      DUMPBIN=:
341937eb1ca1Smrg      ;;
342037eb1ca1Smrg    esac
342137eb1ca1Smrg  fi
3422c27c18e8Smrg  AC_SUBST([DUMPBIN])
3423c27c18e8Smrg  if test "$DUMPBIN" != ":"; then
3424c27c18e8Smrg    NM="$DUMPBIN"
3425c27c18e8Smrg  fi
3426c27c18e8Smrgfi
3427c27c18e8Smrgtest -z "$NM" && NM=nm
3428c27c18e8SmrgAC_SUBST([NM])
3429c27c18e8Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3430c27c18e8Smrg
3431c27c18e8SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3432c27c18e8Smrg  [lt_cv_nm_interface="BSD nm"
3433c27c18e8Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
343437eb1ca1Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3435c27c18e8Smrg  (eval "$ac_compile" 2>conftest.err)
3436c27c18e8Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
343737eb1ca1Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3438c27c18e8Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3439c27c18e8Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
344037eb1ca1Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
3441c27c18e8Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
3442c27c18e8Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3443c27c18e8Smrg    lt_cv_nm_interface="MS dumpbin"
3444c27c18e8Smrg  fi
3445c27c18e8Smrg  rm -f conftest*])
3446c27c18e8Smrg])# LT_PATH_NM
3447c43cc173Smrg
3448c27c18e8Smrg# Old names:
3449c27c18e8SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3450c27c18e8SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3451c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
3452c27c18e8Smrgdnl AC_DEFUN([AM_PROG_NM], [])
3453c27c18e8Smrgdnl AC_DEFUN([AC_PROG_NM], [])
3454c43cc173Smrg
3455b789ec8aSmrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3456b789ec8aSmrg# --------------------------------
3457b789ec8aSmrg# how to determine the name of the shared library
3458b789ec8aSmrg# associated with a specific link library.
3459b789ec8aSmrg#  -- PORTME fill in with the dynamic library characteristics
3460b789ec8aSmrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
3461b789ec8aSmrg[m4_require([_LT_DECL_EGREP])
3462b789ec8aSmrgm4_require([_LT_DECL_OBJDUMP])
3463b789ec8aSmrgm4_require([_LT_DECL_DLLTOOL])
3464b789ec8aSmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
3465b789ec8aSmrglt_cv_sharedlib_from_linklib_cmd,
3466b789ec8aSmrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
3467b789ec8aSmrg
3468b789ec8aSmrgcase $host_os in
3469b789ec8aSmrgcygwin* | mingw* | pw32* | cegcc*)
3470b789ec8aSmrg  # two different shell functions defined in ltmain.sh
3471b789ec8aSmrg  # decide which to use based on capabilities of $DLLTOOL
3472b789ec8aSmrg  case `$DLLTOOL --help 2>&1` in
3473b789ec8aSmrg  *--identify-strict*)
3474b789ec8aSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
3475b789ec8aSmrg    ;;
3476b789ec8aSmrg  *)
3477b789ec8aSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
3478b789ec8aSmrg    ;;
3479b789ec8aSmrg  esac
3480b789ec8aSmrg  ;;
3481b789ec8aSmrg*)
3482b789ec8aSmrg  # fallback: assume linklib IS sharedlib
3483b789ec8aSmrg  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
3484b789ec8aSmrg  ;;
3485b789ec8aSmrgesac
3486b789ec8aSmrg])
3487b789ec8aSmrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
3488b789ec8aSmrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3489b789ec8aSmrg
3490b789ec8aSmrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
3491b789ec8aSmrg    [Command to associate shared and link libraries])
3492b789ec8aSmrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3493b789ec8aSmrg
3494b789ec8aSmrg
3495b789ec8aSmrg# _LT_PATH_MANIFEST_TOOL
3496b789ec8aSmrg# ----------------------
3497b789ec8aSmrg# locate the manifest tool
3498b789ec8aSmrgm4_defun([_LT_PATH_MANIFEST_TOOL],
3499b789ec8aSmrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
3500b789ec8aSmrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
3501b789ec8aSmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
3502b789ec8aSmrg  [lt_cv_path_mainfest_tool=no
3503b789ec8aSmrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
3504b789ec8aSmrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
3505b789ec8aSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3506b789ec8aSmrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
3507b789ec8aSmrg    lt_cv_path_mainfest_tool=yes
3508b789ec8aSmrg  fi
3509b789ec8aSmrg  rm -f conftest*])
3510b789ec8aSmrgif test "x$lt_cv_path_mainfest_tool" != xyes; then
3511b789ec8aSmrg  MANIFEST_TOOL=:
3512b789ec8aSmrgfi
3513b789ec8aSmrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
3514b789ec8aSmrg])# _LT_PATH_MANIFEST_TOOL
3515b789ec8aSmrg
3516c27c18e8Smrg
3517c27c18e8Smrg# LT_LIB_M
3518c27c18e8Smrg# --------
351921e67964Smrg# check for math library
3520c27c18e8SmrgAC_DEFUN([LT_LIB_M],
352121e67964Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
352221e67964SmrgLIBM=
352321e67964Smrgcase $host in
352437eb1ca1Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
352521e67964Smrg  # These system don't have libm, or don't need it
3526c43cc173Smrg  ;;
352721e67964Smrg*-ncr-sysv4.3*)
352821e67964Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
352921e67964Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3530c43cc173Smrg  ;;
353121e67964Smrg*)
353221e67964Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
3533c43cc173Smrg  ;;
353421e67964Smrgesac
3535c27c18e8SmrgAC_SUBST([LIBM])
3536c27c18e8Smrg])# LT_LIB_M
3537c43cc173Smrg
3538c27c18e8Smrg# Old name:
3539c27c18e8SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3540c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
3541c27c18e8Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3542c43cc173Smrg
354321e67964Smrg
3544c27c18e8Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
3545c27c18e8Smrg# -------------------------------
3546c27c18e8Smrgm4_defun([_LT_COMPILER_NO_RTTI],
3547c27c18e8Smrg[m4_require([_LT_TAG_COMPILER])dnl
354821e67964Smrg
3549c27c18e8Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3550c43cc173Smrg
3551c27c18e8Smrgif test "$GCC" = yes; then
355237eb1ca1Smrg  case $cc_basename in
355337eb1ca1Smrg  nvcc*)
355437eb1ca1Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
355537eb1ca1Smrg  *)
355637eb1ca1Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
355737eb1ca1Smrg  esac
3558c43cc173Smrg
3559c27c18e8Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3560c27c18e8Smrg    lt_cv_prog_compiler_rtti_exceptions,
3561c27c18e8Smrg    [-fno-rtti -fno-exceptions], [],
3562c27c18e8Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3563c27c18e8Smrgfi
3564c27c18e8Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3565c27c18e8Smrg	[Compiler flag to turn off builtin functions])
3566c27c18e8Smrg])# _LT_COMPILER_NO_RTTI
3567c43cc173Smrg
3568c43cc173Smrg
3569c27c18e8Smrg# _LT_CMD_GLOBAL_SYMBOLS
3570c27c18e8Smrg# ----------------------
3571c27c18e8Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3572c27c18e8Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3573c27c18e8SmrgAC_REQUIRE([AC_PROG_CC])dnl
357437eb1ca1SmrgAC_REQUIRE([AC_PROG_AWK])dnl
3575c27c18e8SmrgAC_REQUIRE([LT_PATH_NM])dnl
3576c27c18e8SmrgAC_REQUIRE([LT_PATH_LD])dnl
3577c27c18e8Smrgm4_require([_LT_DECL_SED])dnl
3578c27c18e8Smrgm4_require([_LT_DECL_EGREP])dnl
3579c27c18e8Smrgm4_require([_LT_TAG_COMPILER])dnl
3580c43cc173Smrg
3581c27c18e8Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
3582c27c18e8SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
3583c27c18e8SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
358421e67964Smrg[
3585c27c18e8Smrg# These are sane defaults that work on at least a few old systems.
3586c27c18e8Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3587c43cc173Smrg
3588c27c18e8Smrg# Character class describing NM global symbol codes.
3589c27c18e8Smrgsymcode='[[BCDEGRST]]'
3590c43cc173Smrg
3591c27c18e8Smrg# Regexp to match symbols that can be accessed directly from C.
3592c27c18e8Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3593c43cc173Smrg
3594c27c18e8Smrg# Define system-specific variables.
3595c27c18e8Smrgcase $host_os in
3596c27c18e8Smrgaix*)
3597c27c18e8Smrg  symcode='[[BCDT]]'
3598c27c18e8Smrg  ;;
3599c27c18e8Smrgcygwin* | mingw* | pw32* | cegcc*)
3600c27c18e8Smrg  symcode='[[ABCDGISTW]]'
3601c27c18e8Smrg  ;;
3602c27c18e8Smrghpux*)
3603c27c18e8Smrg  if test "$host_cpu" = ia64; then
3604c27c18e8Smrg    symcode='[[ABCDEGRST]]'
3605c27c18e8Smrg  fi
3606c27c18e8Smrg  ;;
3607c27c18e8Smrgirix* | nonstopux*)
3608c27c18e8Smrg  symcode='[[BCDEGRST]]'
3609c27c18e8Smrg  ;;
3610c27c18e8Smrgosf*)
3611c27c18e8Smrg  symcode='[[BCDEGQRST]]'
3612c27c18e8Smrg  ;;
3613c27c18e8Smrgsolaris*)
3614c27c18e8Smrg  symcode='[[BDRT]]'
3615c27c18e8Smrg  ;;
3616c27c18e8Smrgsco3.2v5*)
3617c27c18e8Smrg  symcode='[[DT]]'
3618c27c18e8Smrg  ;;
3619c27c18e8Smrgsysv4.2uw2*)
3620c27c18e8Smrg  symcode='[[DT]]'
3621c27c18e8Smrg  ;;
3622c27c18e8Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
3623c27c18e8Smrg  symcode='[[ABDT]]'
3624c27c18e8Smrg  ;;
3625c27c18e8Smrgsysv4)
3626c27c18e8Smrg  symcode='[[DFNSTU]]'
3627c27c18e8Smrg  ;;
3628c27c18e8Smrgesac
3629c43cc173Smrg
3630c27c18e8Smrg# If we're using GNU nm, then use its standard symbol codes.
3631c27c18e8Smrgcase `$NM -V 2>&1` in
3632c27c18e8Smrg*GNU* | *'with BFD'*)
3633c27c18e8Smrg  symcode='[[ABCDGIRSTW]]' ;;
3634c27c18e8Smrgesac
3635c43cc173Smrg
3636c27c18e8Smrg# Transform an extracted symbol line into a proper C declaration.
3637c27c18e8Smrg# Some systems (esp. on ia64) link data and code symbols differently,
3638c27c18e8Smrg# so use this general approach.
3639c27c18e8Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3640c43cc173Smrg
3641c27c18e8Smrg# Transform an extracted symbol line into symbol name and symbol address
3642b789ec8aSmrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
3643b789ec8aSmrglt_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'"
3644c43cc173Smrg
3645c27c18e8Smrg# Handle CRLF in mingw tool chain
3646c27c18e8Smrgopt_cr=
3647c27c18e8Smrgcase $build_os in
3648c27c18e8Smrgmingw*)
3649c27c18e8Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
3650c27c18e8Smrg  ;;
3651c27c18e8Smrgesac
3652c43cc173Smrg
3653c27c18e8Smrg# Try without a prefix underscore, then with it.
3654c27c18e8Smrgfor ac_symprfx in "" "_"; do
3655c43cc173Smrg
3656c27c18e8Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
3657c27c18e8Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
3658c43cc173Smrg
3659c27c18e8Smrg  # Write the raw and C identifiers.
3660c27c18e8Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3661c27c18e8Smrg    # Fake it for dumpbin and say T for any non-static function
3662c27c18e8Smrg    # and D for any global variable.
3663c27c18e8Smrg    # Also find C++ and __fastcall symbols from MSVC++,
3664c27c18e8Smrg    # which start with @ or ?.
3665c27c18e8Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
3666c27c18e8Smrg"     {last_section=section; section=\$ 3};"\
3667c27c18e8Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
3668c27c18e8Smrg"     \$ 0!~/External *\|/{next};"\
3669c27c18e8Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
3670c27c18e8Smrg"     {if(hide[section]) next};"\
3671c27c18e8Smrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
3672c27c18e8Smrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
3673c27c18e8Smrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
3674c27c18e8Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
3675c27c18e8Smrg"     ' prfx=^$ac_symprfx]"
3676c27c18e8Smrg  else
3677c27c18e8Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
367821e67964Smrg  fi
3679b789ec8aSmrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
3680c43cc173Smrg
3681c27c18e8Smrg  # Check to see that the pipe works correctly.
3682c27c18e8Smrg  pipe_works=no
3683c43cc173Smrg
3684c27c18e8Smrg  rm -f conftest*
3685c27c18e8Smrg  cat > conftest.$ac_ext <<_LT_EOF
3686c27c18e8Smrg#ifdef __cplusplus
3687c27c18e8Smrgextern "C" {
3688c27c18e8Smrg#endif
3689c27c18e8Smrgchar nm_test_var;
3690c27c18e8Smrgvoid nm_test_func(void);
3691c27c18e8Smrgvoid nm_test_func(void){}
3692c27c18e8Smrg#ifdef __cplusplus
3693c27c18e8Smrg}
3694c27c18e8Smrg#endif
3695c27c18e8Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
3696c27c18e8Smrg_LT_EOF
3697c43cc173Smrg
3698c27c18e8Smrg  if AC_TRY_EVAL(ac_compile); then
3699c27c18e8Smrg    # Now try to grab the symbols.
3700c27c18e8Smrg    nlist=conftest.nm
370137eb1ca1Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
3702c27c18e8Smrg      # Try sorting and uniquifying the output.
3703c27c18e8Smrg      if sort "$nlist" | uniq > "$nlist"T; then
3704c27c18e8Smrg	mv -f "$nlist"T "$nlist"
3705c27c18e8Smrg      else
3706c27c18e8Smrg	rm -f "$nlist"T
3707c27c18e8Smrg      fi
3708c43cc173Smrg
3709c27c18e8Smrg      # Make sure that we snagged all the symbols we need.
3710c27c18e8Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
3711c27c18e8Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
3712c27c18e8Smrg	  cat <<_LT_EOF > conftest.$ac_ext
3713b789ec8aSmrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
3714b789ec8aSmrg#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3715b789ec8aSmrg/* DATA imports from DLLs on WIN32 con't be const, because runtime
3716b789ec8aSmrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
3717b789ec8aSmrg# define LT@&t@_DLSYM_CONST
3718b789ec8aSmrg#elif defined(__osf__)
3719b789ec8aSmrg/* This system does not cope well with relocations in const data.  */
3720b789ec8aSmrg# define LT@&t@_DLSYM_CONST
3721b789ec8aSmrg#else
3722b789ec8aSmrg# define LT@&t@_DLSYM_CONST const
3723b789ec8aSmrg#endif
3724b789ec8aSmrg
3725c27c18e8Smrg#ifdef __cplusplus
3726c27c18e8Smrgextern "C" {
3727c27c18e8Smrg#endif
3728c43cc173Smrg
3729c27c18e8Smrg_LT_EOF
3730c27c18e8Smrg	  # Now generate the symbol file.
3731c27c18e8Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
3732c43cc173Smrg
3733c27c18e8Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
3734c43cc173Smrg
3735c27c18e8Smrg/* The mapping between symbol names and symbols.  */
3736b789ec8aSmrgLT@&t@_DLSYM_CONST struct {
3737c27c18e8Smrg  const char *name;
3738c27c18e8Smrg  void       *address;
3739c27c18e8Smrg}
3740c27c18e8Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
3741c27c18e8Smrg{
3742c27c18e8Smrg  { "@PROGRAM@", (void *) 0 },
3743c27c18e8Smrg_LT_EOF
3744c27c18e8Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
3745c27c18e8Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
3746c27c18e8Smrg  {0, (void *) 0}
3747c27c18e8Smrg};
3748c43cc173Smrg
3749c27c18e8Smrg/* This works around a problem in FreeBSD linker */
3750c27c18e8Smrg#ifdef FREEBSD_WORKAROUND
3751c27c18e8Smrgstatic const void *lt_preloaded_setup() {
3752c27c18e8Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
3753c27c18e8Smrg}
3754c27c18e8Smrg#endif
3755c43cc173Smrg
3756c27c18e8Smrg#ifdef __cplusplus
3757c27c18e8Smrg}
3758c27c18e8Smrg#endif
3759c27c18e8Smrg_LT_EOF
3760c27c18e8Smrg	  # Now try linking the two files.
3761c27c18e8Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
3762b789ec8aSmrg	  lt_globsym_save_LIBS=$LIBS
3763b789ec8aSmrg	  lt_globsym_save_CFLAGS=$CFLAGS
3764c27c18e8Smrg	  LIBS="conftstm.$ac_objext"
3765c27c18e8Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
3766c27c18e8Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
3767c27c18e8Smrg	    pipe_works=yes
3768c27c18e8Smrg	  fi
3769b789ec8aSmrg	  LIBS=$lt_globsym_save_LIBS
3770b789ec8aSmrg	  CFLAGS=$lt_globsym_save_CFLAGS
3771c27c18e8Smrg	else
3772c27c18e8Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
3773c27c18e8Smrg	fi
3774c27c18e8Smrg      else
3775c27c18e8Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
3776c27c18e8Smrg      fi
377721e67964Smrg    else
3778c27c18e8Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
3779c43cc173Smrg    fi
3780c43cc173Smrg  else
3781c27c18e8Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
3782c27c18e8Smrg    cat conftest.$ac_ext >&5
3783c43cc173Smrg  fi
3784c27c18e8Smrg  rm -rf conftest* conftst*
3785c43cc173Smrg
3786c27c18e8Smrg  # Do not use the global_symbol_pipe unless it works.
3787c27c18e8Smrg  if test "$pipe_works" = yes; then
3788c27c18e8Smrg    break
3789c27c18e8Smrg  else
3790c27c18e8Smrg    lt_cv_sys_global_symbol_pipe=
3791c27c18e8Smrg  fi
3792c27c18e8Smrgdone
3793c27c18e8Smrg])
3794c27c18e8Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
3795c27c18e8Smrg  lt_cv_sys_global_symbol_to_cdecl=
3796c27c18e8Smrgfi
3797c27c18e8Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
3798c27c18e8Smrg  AC_MSG_RESULT(failed)
3799c43cc173Smrgelse
3800c27c18e8Smrg  AC_MSG_RESULT(ok)
3801c43cc173Smrgfi
3802c43cc173Smrg
3803b789ec8aSmrg# Response file support.
3804b789ec8aSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
3805b789ec8aSmrg  nm_file_list_spec='@'
3806b789ec8aSmrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
3807b789ec8aSmrg  nm_file_list_spec='@'
3808b789ec8aSmrgfi
3809b789ec8aSmrg
3810c27c18e8Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
3811c27c18e8Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
3812c27c18e8Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
3813c27c18e8Smrg    [Transform the output of nm in a proper C declaration])
3814c27c18e8Smrg_LT_DECL([global_symbol_to_c_name_address],
3815c27c18e8Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
3816c27c18e8Smrg    [Transform the output of nm in a C name address pair])
3817c27c18e8Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
3818c27c18e8Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
3819c27c18e8Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
3820b789ec8aSmrg_LT_DECL([], [nm_file_list_spec], [1],
3821b789ec8aSmrg    [Specify filename containing input files for $NM])
3822c27c18e8Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
3823c43cc173Smrg
3824c43cc173Smrg
3825c27c18e8Smrg# _LT_COMPILER_PIC([TAGNAME])
3826c27c18e8Smrg# ---------------------------
3827c27c18e8Smrgm4_defun([_LT_COMPILER_PIC],
3828c27c18e8Smrg[m4_require([_LT_TAG_COMPILER])dnl
3829c27c18e8Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
3830c27c18e8Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
3831c27c18e8Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
3832c43cc173Smrg
3833c27c18e8Smrgm4_if([$1], [CXX], [
3834c27c18e8Smrg  # C++ specific cases for pic, static, wl, etc.
3835c27c18e8Smrg  if test "$GXX" = yes; then
3836c27c18e8Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3837c27c18e8Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3838c43cc173Smrg
3839c27c18e8Smrg    case $host_os in
3840c27c18e8Smrg    aix*)
3841c27c18e8Smrg      # All AIX code is PIC.
384221e67964Smrg      if test "$host_cpu" = ia64; then
3843c27c18e8Smrg	# AIX 5 now supports IA64 processor
3844c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
384521e67964Smrg      fi
384621e67964Smrg      ;;
3847c43cc173Smrg
3848c27c18e8Smrg    amigaos*)
384921e67964Smrg      case $host_cpu in
3850c27c18e8Smrg      powerpc)
3851c27c18e8Smrg            # see comment about AmigaOS4 .so support
3852c27c18e8Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3853c27c18e8Smrg        ;;
3854c27c18e8Smrg      m68k)
3855c27c18e8Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
3856c27c18e8Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
3857c27c18e8Smrg            # like `-m68040'.
3858c27c18e8Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
385921e67964Smrg        ;;
386021e67964Smrg      esac
386121e67964Smrg      ;;
3862c43cc173Smrg
3863c27c18e8Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3864c27c18e8Smrg      # PIC is the default for these OSes.
3865c27c18e8Smrg      ;;
3866c27c18e8Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
3867c27c18e8Smrg      # This hack is so that the source file can tell whether it is being
3868c27c18e8Smrg      # built for inclusion in a dll (and should export symbols for example).
3869c27c18e8Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
3870c27c18e8Smrg      # (--disable-auto-import) libraries
3871c27c18e8Smrg      m4_if([$1], [GCJ], [],
3872c27c18e8Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3873c27c18e8Smrg      ;;
3874c27c18e8Smrg    darwin* | rhapsody*)
3875c27c18e8Smrg      # PIC is the default on this platform
3876c27c18e8Smrg      # Common symbols not allowed in MH_DYLIB files
3877c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3878c27c18e8Smrg      ;;
3879c27c18e8Smrg    *djgpp*)
3880c27c18e8Smrg      # DJGPP does not support shared libraries at all
3881c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3882c27c18e8Smrg      ;;
388337eb1ca1Smrg    haiku*)
388437eb1ca1Smrg      # PIC is the default for Haiku.
388537eb1ca1Smrg      # The "-static" flag exists, but is broken.
388637eb1ca1Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
388737eb1ca1Smrg      ;;
3888c27c18e8Smrg    interix[[3-9]]*)
3889c27c18e8Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3890c27c18e8Smrg      # Instead, we relocate shared libraries at runtime.
3891c27c18e8Smrg      ;;
3892c27c18e8Smrg    sysv4*MP*)
3893c27c18e8Smrg      if test -d /usr/nec; then
3894c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3895c27c18e8Smrg      fi
3896c27c18e8Smrg      ;;
3897c27c18e8Smrg    hpux*)
3898c27c18e8Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3899c27c18e8Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
3900c27c18e8Smrg      # sets the default TLS model and affects inlining.
3901c27c18e8Smrg      case $host_cpu in
3902c27c18e8Smrg      hppa*64*)
390321e67964Smrg	;;
390421e67964Smrg      *)
3905c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
390621e67964Smrg	;;
3907c27c18e8Smrg      esac
3908c27c18e8Smrg      ;;
3909c27c18e8Smrg    *qnx* | *nto*)
3910c27c18e8Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
3911c27c18e8Smrg      # it will coredump.
3912c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3913c27c18e8Smrg      ;;
3914c27c18e8Smrg    *)
3915c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3916c27c18e8Smrg      ;;
391721e67964Smrg    esac
3918c27c18e8Smrg  else
3919c27c18e8Smrg    case $host_os in
3920c27c18e8Smrg      aix[[4-9]]*)
3921c27c18e8Smrg	# All AIX code is PIC.
3922c27c18e8Smrg	if test "$host_cpu" = ia64; then
3923c27c18e8Smrg	  # AIX 5 now supports IA64 processor
3924c27c18e8Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3925c27c18e8Smrg	else
3926c27c18e8Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3927c27c18e8Smrg	fi
392821e67964Smrg	;;
3929c27c18e8Smrg      chorus*)
3930c27c18e8Smrg	case $cc_basename in
3931c27c18e8Smrg	cxch68*)
3932c27c18e8Smrg	  # Green Hills C++ Compiler
3933c27c18e8Smrg	  # _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"
393421e67964Smrg	  ;;
393521e67964Smrg	esac
393621e67964Smrg	;;
3937b789ec8aSmrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
3938b789ec8aSmrg	# This hack is so that the source file can tell whether it is being
3939b789ec8aSmrg	# built for inclusion in a dll (and should export symbols for example).
3940b789ec8aSmrg	m4_if([$1], [GCJ], [],
3941b789ec8aSmrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3942b789ec8aSmrg	;;
3943c27c18e8Smrg      dgux*)
3944c27c18e8Smrg	case $cc_basename in
3945c27c18e8Smrg	  ec++*)
3946c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3947c27c18e8Smrg	    ;;
3948c27c18e8Smrg	  ghcx*)
3949c27c18e8Smrg	    # Green Hills C++ Compiler
3950c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3951c27c18e8Smrg	    ;;
3952c27c18e8Smrg	  *)
3953c27c18e8Smrg	    ;;
395421e67964Smrg	esac
395521e67964Smrg	;;
3956c27c18e8Smrg      freebsd* | dragonfly*)
3957c27c18e8Smrg	# FreeBSD uses GNU C++
395821e67964Smrg	;;
3959c27c18e8Smrg      hpux9* | hpux10* | hpux11*)
3960c27c18e8Smrg	case $cc_basename in
3961c27c18e8Smrg	  CC*)
3962c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3963c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3964c27c18e8Smrg	    if test "$host_cpu" != ia64; then
3965c27c18e8Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3966c27c18e8Smrg	    fi
3967c27c18e8Smrg	    ;;
3968c27c18e8Smrg	  aCC*)
3969c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3970c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3971c27c18e8Smrg	    case $host_cpu in
3972c27c18e8Smrg	    hppa*64*|ia64*)
3973c27c18e8Smrg	      # +Z the default
3974c27c18e8Smrg	      ;;
3975c27c18e8Smrg	    *)
3976c27c18e8Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3977c27c18e8Smrg	      ;;
3978c27c18e8Smrg	    esac
3979c27c18e8Smrg	    ;;
3980c27c18e8Smrg	  *)
3981c27c18e8Smrg	    ;;
3982c27c18e8Smrg	esac
398321e67964Smrg	;;
3984c27c18e8Smrg      interix*)
3985c27c18e8Smrg	# This is c89, which is MS Visual C++ (no shared libs)
3986c27c18e8Smrg	# Anyone wants to do a port?
398721e67964Smrg	;;
3988c27c18e8Smrg      irix5* | irix6* | nonstopux*)
3989c27c18e8Smrg	case $cc_basename in
3990c27c18e8Smrg	  CC*)
3991c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3992c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3993c27c18e8Smrg	    # CC pic flag -KPIC is the default.
3994c27c18e8Smrg	    ;;
3995c27c18e8Smrg	  *)
3996c27c18e8Smrg	    ;;
3997c27c18e8Smrg	esac
399821e67964Smrg	;;
399937eb1ca1Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
4000c27c18e8Smrg	case $cc_basename in
4001c27c18e8Smrg	  KCC*)
4002c27c18e8Smrg	    # KAI C++ Compiler
4003c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4004c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4005c27c18e8Smrg	    ;;
4006c27c18e8Smrg	  ecpc* )
4007c27c18e8Smrg	    # old Intel C++ for x86_64 which still supported -KPIC.
4008c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4009c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4010c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4011c27c18e8Smrg	    ;;
4012c27c18e8Smrg	  icpc* )
4013c27c18e8Smrg	    # Intel C++, used to be incompatible with GCC.
4014c27c18e8Smrg	    # ICC 10 doesn't accept -KPIC any more.
4015c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4016c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4017c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4018c27c18e8Smrg	    ;;
4019c27c18e8Smrg	  pgCC* | pgcpp*)
4020c27c18e8Smrg	    # Portland Group C++ compiler
4021c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4022c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4023c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4024c27c18e8Smrg	    ;;
4025c27c18e8Smrg	  cxx*)
4026c27c18e8Smrg	    # Compaq C++
4027c27c18e8Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
4028c27c18e8Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
4029c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4030c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4031c27c18e8Smrg	    ;;
403237eb1ca1Smrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
403337eb1ca1Smrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
4034c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4035c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4036c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4037c27c18e8Smrg	    ;;
4038c27c18e8Smrg	  *)
4039c27c18e8Smrg	    case `$CC -V 2>&1 | sed 5q` in
4040c27c18e8Smrg	    *Sun\ C*)
4041c27c18e8Smrg	      # Sun C++ 5.9
4042c27c18e8Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4043c27c18e8Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4044c27c18e8Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4045c27c18e8Smrg	      ;;
4046c27c18e8Smrg	    esac
4047c27c18e8Smrg	    ;;
4048c27c18e8Smrg	esac
404921e67964Smrg	;;
4050c27c18e8Smrg      lynxos*)
405121e67964Smrg	;;
4052c27c18e8Smrg      m88k*)
405321e67964Smrg	;;
4054c27c18e8Smrg      mvs*)
4055c27c18e8Smrg	case $cc_basename in
4056c27c18e8Smrg	  cxx*)
4057c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
4058c27c18e8Smrg	    ;;
4059c27c18e8Smrg	  *)
4060c27c18e8Smrg	    ;;
4061c27c18e8Smrg	esac
406221e67964Smrg	;;
4063c27c18e8Smrg      netbsd*)
406421e67964Smrg	;;
4065c27c18e8Smrg      *qnx* | *nto*)
4066c27c18e8Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
4067c27c18e8Smrg        # it will coredump.
4068c27c18e8Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4069c27c18e8Smrg        ;;
4070c27c18e8Smrg      osf3* | osf4* | osf5*)
4071c27c18e8Smrg	case $cc_basename in
4072c27c18e8Smrg	  KCC*)
4073c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4074c27c18e8Smrg	    ;;
4075c27c18e8Smrg	  RCC*)
4076c27c18e8Smrg	    # Rational C++ 2.4.1
4077c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4078c27c18e8Smrg	    ;;
4079c27c18e8Smrg	  cxx*)
4080c27c18e8Smrg	    # Digital/Compaq C++
4081c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4082c27c18e8Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
4083c27c18e8Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
4084c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4085c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4086c27c18e8Smrg	    ;;
4087c27c18e8Smrg	  *)
4088c27c18e8Smrg	    ;;
4089c27c18e8Smrg	esac
409021e67964Smrg	;;
4091c27c18e8Smrg      psos*)
409221e67964Smrg	;;
4093c27c18e8Smrg      solaris*)
4094c27c18e8Smrg	case $cc_basename in
409537eb1ca1Smrg	  CC* | sunCC*)
4096c27c18e8Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
4097c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4098c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4099c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4100c27c18e8Smrg	    ;;
4101c27c18e8Smrg	  gcx*)
4102c27c18e8Smrg	    # Green Hills C++ Compiler
4103c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4104c27c18e8Smrg	    ;;
4105c27c18e8Smrg	  *)
4106c27c18e8Smrg	    ;;
4107c27c18e8Smrg	esac
410821e67964Smrg	;;
4109c27c18e8Smrg      sunos4*)
4110c27c18e8Smrg	case $cc_basename in
4111c27c18e8Smrg	  CC*)
4112c27c18e8Smrg	    # Sun C++ 4.x
4113c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4114c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4115c27c18e8Smrg	    ;;
4116c27c18e8Smrg	  lcc*)
4117c27c18e8Smrg	    # Lucid
4118c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4119c27c18e8Smrg	    ;;
412021e67964Smrg	  *)
412121e67964Smrg	    ;;
412221e67964Smrg	esac
412321e67964Smrg	;;
4124c27c18e8Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4125c27c18e8Smrg	case $cc_basename in
4126c27c18e8Smrg	  CC*)
4127c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4128c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4129c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4130c27c18e8Smrg	    ;;
4131c27c18e8Smrg	esac
413221e67964Smrg	;;
4133c27c18e8Smrg      tandem*)
4134c27c18e8Smrg	case $cc_basename in
4135c27c18e8Smrg	  NCC*)
4136c27c18e8Smrg	    # NonStop-UX NCC 3.20
4137c27c18e8Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4138c27c18e8Smrg	    ;;
413921e67964Smrg	  *)
414021e67964Smrg	    ;;
4141c27c18e8Smrg	esac
414221e67964Smrg	;;
4143c27c18e8Smrg      vxworks*)
414421e67964Smrg	;;
414521e67964Smrg      *)
4146c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
414721e67964Smrg	;;
414821e67964Smrg    esac
4149c27c18e8Smrg  fi
4150c27c18e8Smrg],
4151c27c18e8Smrg[
4152c27c18e8Smrg  if test "$GCC" = yes; then
4153c27c18e8Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4154c27c18e8Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4155c27c18e8Smrg
4156c27c18e8Smrg    case $host_os in
4157c27c18e8Smrg      aix*)
4158c27c18e8Smrg      # All AIX code is PIC.
4159c27c18e8Smrg      if test "$host_cpu" = ia64; then
4160c27c18e8Smrg	# AIX 5 now supports IA64 processor
4161c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4162c27c18e8Smrg      fi
4163c27c18e8Smrg      ;;
4164c27c18e8Smrg
4165c27c18e8Smrg    amigaos*)
4166c27c18e8Smrg      case $host_cpu in
4167c27c18e8Smrg      powerpc)
4168c27c18e8Smrg            # see comment about AmigaOS4 .so support
4169c27c18e8Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4170c27c18e8Smrg        ;;
4171c27c18e8Smrg      m68k)
4172c27c18e8Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
4173c27c18e8Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
4174c27c18e8Smrg            # like `-m68040'.
4175c27c18e8Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4176c27c18e8Smrg        ;;
4177c27c18e8Smrg      esac
4178c27c18e8Smrg      ;;
4179c27c18e8Smrg
4180c27c18e8Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4181c27c18e8Smrg      # PIC is the default for these OSes.
4182c27c18e8Smrg      ;;
4183c27c18e8Smrg
4184c27c18e8Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
4185c27c18e8Smrg      # This hack is so that the source file can tell whether it is being
4186c27c18e8Smrg      # built for inclusion in a dll (and should export symbols for example).
4187c27c18e8Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4188c27c18e8Smrg      # (--disable-auto-import) libraries
4189c27c18e8Smrg      m4_if([$1], [GCJ], [],
4190c27c18e8Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4191c27c18e8Smrg      ;;
4192c27c18e8Smrg
4193c27c18e8Smrg    darwin* | rhapsody*)
4194c27c18e8Smrg      # PIC is the default on this platform
4195c27c18e8Smrg      # Common symbols not allowed in MH_DYLIB files
4196c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4197c27c18e8Smrg      ;;
4198c27c18e8Smrg
419937eb1ca1Smrg    haiku*)
420037eb1ca1Smrg      # PIC is the default for Haiku.
420137eb1ca1Smrg      # The "-static" flag exists, but is broken.
420237eb1ca1Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
420337eb1ca1Smrg      ;;
420437eb1ca1Smrg
4205c27c18e8Smrg    hpux*)
4206c27c18e8Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4207c27c18e8Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4208c27c18e8Smrg      # sets the default TLS model and affects inlining.
4209c27c18e8Smrg      case $host_cpu in
4210c27c18e8Smrg      hppa*64*)
4211c27c18e8Smrg	# +Z the default
421221e67964Smrg	;;
421321e67964Smrg      *)
4214c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
421521e67964Smrg	;;
4216c27c18e8Smrg      esac
4217c27c18e8Smrg      ;;
4218c27c18e8Smrg
4219c27c18e8Smrg    interix[[3-9]]*)
4220c27c18e8Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4221c27c18e8Smrg      # Instead, we relocate shared libraries at runtime.
4222c27c18e8Smrg      ;;
4223c27c18e8Smrg
4224c27c18e8Smrg    msdosdjgpp*)
4225c27c18e8Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
4226c27c18e8Smrg      # on systems that don't support them.
4227c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4228c27c18e8Smrg      enable_shared=no
4229c27c18e8Smrg      ;;
4230c27c18e8Smrg
4231c27c18e8Smrg    *nto* | *qnx*)
4232c27c18e8Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4233c27c18e8Smrg      # it will coredump.
4234c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4235c27c18e8Smrg      ;;
4236c27c18e8Smrg
4237c27c18e8Smrg    sysv4*MP*)
4238c27c18e8Smrg      if test -d /usr/nec; then
4239c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4240c27c18e8Smrg      fi
4241c27c18e8Smrg      ;;
4242c27c18e8Smrg
4243c27c18e8Smrg    *)
4244c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4245c27c18e8Smrg      ;;
424621e67964Smrg    esac
424737eb1ca1Smrg
424837eb1ca1Smrg    case $cc_basename in
424937eb1ca1Smrg    nvcc*) # Cuda Compiler Driver 2.2
425037eb1ca1Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
425137eb1ca1Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
425237eb1ca1Smrg      ;;
425337eb1ca1Smrg    esac
4254c27c18e8Smrg  else
4255c27c18e8Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
4256c27c18e8Smrg    case $host_os in
4257c27c18e8Smrg    aix*)
4258c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4259c27c18e8Smrg      if test "$host_cpu" = ia64; then
4260c27c18e8Smrg	# AIX 5 now supports IA64 processor
4261c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4262c27c18e8Smrg      else
4263c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4264c27c18e8Smrg      fi
4265c27c18e8Smrg      ;;
4266c27c18e8Smrg
4267c27c18e8Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
4268c27c18e8Smrg      # This hack is so that the source file can tell whether it is being
4269c27c18e8Smrg      # built for inclusion in a dll (and should export symbols for example).
4270c27c18e8Smrg      m4_if([$1], [GCJ], [],
4271c27c18e8Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4272c27c18e8Smrg      ;;
4273c27c18e8Smrg
4274c27c18e8Smrg    hpux9* | hpux10* | hpux11*)
4275c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4276c27c18e8Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
4277c27c18e8Smrg      # not for PA HP-UX.
4278c27c18e8Smrg      case $host_cpu in
4279c27c18e8Smrg      hppa*64*|ia64*)
4280c27c18e8Smrg	# +Z the default
428121e67964Smrg	;;
428221e67964Smrg      *)
4283c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
428421e67964Smrg	;;
4285c27c18e8Smrg      esac
4286c27c18e8Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
4287c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4288c27c18e8Smrg      ;;
4289c43cc173Smrg
4290c27c18e8Smrg    irix5* | irix6* | nonstopux*)
4291c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4292c27c18e8Smrg      # PIC (with -KPIC) is the default.
4293c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4294c27c18e8Smrg      ;;
4295c43cc173Smrg
429637eb1ca1Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu)
4297c27c18e8Smrg      case $cc_basename in
4298c27c18e8Smrg      # old Intel for x86_64 which still supported -KPIC.
4299c27c18e8Smrg      ecc*)
4300c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4301c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4302c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4303c27c18e8Smrg        ;;
4304c27c18e8Smrg      # icc used to be incompatible with GCC.
4305c27c18e8Smrg      # ICC 10 doesn't accept -KPIC any more.
4306c27c18e8Smrg      icc* | ifort*)
4307c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4308c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4309c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4310c27c18e8Smrg        ;;
4311c27c18e8Smrg      # Lahey Fortran 8.1.
4312c27c18e8Smrg      lf95*)
4313c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4314c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4315c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4316c27c18e8Smrg	;;
4317b789ec8aSmrg      nagfor*)
4318b789ec8aSmrg	# NAG Fortran compiler
4319b789ec8aSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4320b789ec8aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4321b789ec8aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4322b789ec8aSmrg	;;
432337eb1ca1Smrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
4324c27c18e8Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
4325c27c18e8Smrg	# which looks to be a dead project)
4326c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4327c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4328c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4329c27c18e8Smrg        ;;
4330c27c18e8Smrg      ccc*)
4331c27c18e8Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4332c27c18e8Smrg        # All Alpha code is PIC.
4333c27c18e8Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4334c27c18e8Smrg        ;;
433537eb1ca1Smrg      xl* | bgxl* | bgf* | mpixl*)
433637eb1ca1Smrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
4337c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4338c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4339c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4340c27c18e8Smrg	;;
4341c27c18e8Smrg      *)
4342c27c18e8Smrg	case `$CC -V 2>&1 | sed 5q` in
434337eb1ca1Smrg	*Sun\ F* | *Sun*Fortran*)
434437eb1ca1Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
4345c27c18e8Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4346c27c18e8Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
434737eb1ca1Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4348c27c18e8Smrg	  ;;
434937eb1ca1Smrg	*Sun\ C*)
435037eb1ca1Smrg	  # Sun C 5.9
4351c27c18e8Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4352c27c18e8Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
435337eb1ca1Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4354c27c18e8Smrg	  ;;
4355c27c18e8Smrg	esac
4356c27c18e8Smrg	;;
4357c27c18e8Smrg      esac
4358c27c18e8Smrg      ;;
4359c43cc173Smrg
4360c27c18e8Smrg    newsos6)
4361c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4362c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4363c27c18e8Smrg      ;;
4364c43cc173Smrg
4365c27c18e8Smrg    *nto* | *qnx*)
4366c27c18e8Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4367c27c18e8Smrg      # it will coredump.
4368c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4369c27c18e8Smrg      ;;
4370c43cc173Smrg
4371c27c18e8Smrg    osf3* | osf4* | osf5*)
4372c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4373c27c18e8Smrg      # All OSF/1 code is PIC.
4374c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4375c27c18e8Smrg      ;;
4376c43cc173Smrg
4377c27c18e8Smrg    rdos*)
4378c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4379c27c18e8Smrg      ;;
438021e67964Smrg
4381c27c18e8Smrg    solaris*)
4382c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4383c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4384c27c18e8Smrg      case $cc_basename in
438537eb1ca1Smrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
4386c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4387c27c18e8Smrg      *)
4388c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4389c27c18e8Smrg      esac
4390c27c18e8Smrg      ;;
439121e67964Smrg
4392c27c18e8Smrg    sunos4*)
4393c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4394c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4395c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4396c27c18e8Smrg      ;;
439721e67964Smrg
4398c27c18e8Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
4399c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4400c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4401c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4402c27c18e8Smrg      ;;
440321e67964Smrg
4404c27c18e8Smrg    sysv4*MP*)
4405c27c18e8Smrg      if test -d /usr/nec ;then
4406c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4407c27c18e8Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4408c27c18e8Smrg      fi
4409c27c18e8Smrg      ;;
441021e67964Smrg
4411c27c18e8Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4412c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4413c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4414c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4415c27c18e8Smrg      ;;
441621e67964Smrg
4417c27c18e8Smrg    unicos*)
4418c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4419c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4420c27c18e8Smrg      ;;
4421c43cc173Smrg
4422c27c18e8Smrg    uts4*)
4423c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4424c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4425c27c18e8Smrg      ;;
4426c43cc173Smrg
4427c27c18e8Smrg    *)
4428c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4429c27c18e8Smrg      ;;
4430c27c18e8Smrg    esac
4431c27c18e8Smrg  fi
4432c27c18e8Smrg])
4433c27c18e8Smrgcase $host_os in
4434c27c18e8Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
4435c27c18e8Smrg  *djgpp*)
4436c27c18e8Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4437c27c18e8Smrg    ;;
4438c27c18e8Smrg  *)
4439c27c18e8Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4440c27c18e8Smrg    ;;
4441c27c18e8Smrgesac
4442b789ec8aSmrg
4443b789ec8aSmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
4444b789ec8aSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
4445b789ec8aSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4446b789ec8aSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
444721e67964Smrg
4448c27c18e8Smrg#
4449c27c18e8Smrg# Check to make sure the PIC flag actually works.
4450c27c18e8Smrg#
4451c27c18e8Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4452c27c18e8Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4453c27c18e8Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4454c27c18e8Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4455c27c18e8Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4456c27c18e8Smrg     "" | " "*) ;;
4457c27c18e8Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4458c27c18e8Smrg     esac],
4459c27c18e8Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4460c27c18e8Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4461c27c18e8Smrgfi
4462c27c18e8Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4463c27c18e8Smrg	[Additional compiler flags for building library objects])
446421e67964Smrg
4465b789ec8aSmrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4466b789ec8aSmrg	[How to pass a linker flag through the compiler])
4467c27c18e8Smrg#
4468c27c18e8Smrg# Check to make sure the static flag actually works.
4469c27c18e8Smrg#
4470c27c18e8Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4471c27c18e8Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4472c27c18e8Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4473c27c18e8Smrg  $lt_tmp_static_flag,
4474c27c18e8Smrg  [],
4475c27c18e8Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4476c27c18e8Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4477c27c18e8Smrg	[Compiler flag to prevent dynamic linking])
4478c27c18e8Smrg])# _LT_COMPILER_PIC
447921e67964Smrg
4480c27c18e8Smrg
4481c27c18e8Smrg# _LT_LINKER_SHLIBS([TAGNAME])
4482c27c18e8Smrg# ----------------------------
4483c27c18e8Smrg# See if the linker supports building shared libraries.
4484c27c18e8Smrgm4_defun([_LT_LINKER_SHLIBS],
4485c27c18e8Smrg[AC_REQUIRE([LT_PATH_LD])dnl
4486c27c18e8SmrgAC_REQUIRE([LT_PATH_NM])dnl
4487b789ec8aSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
4488c27c18e8Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4489c27c18e8Smrgm4_require([_LT_DECL_EGREP])dnl
4490c27c18e8Smrgm4_require([_LT_DECL_SED])dnl
4491c27c18e8Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4492c27c18e8Smrgm4_require([_LT_TAG_COMPILER])dnl
4493c27c18e8SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4494c27c18e8Smrgm4_if([$1], [CXX], [
4495c27c18e8Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4496b789ec8aSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4497c27c18e8Smrg  case $host_os in
4498c27c18e8Smrg  aix[[4-9]]*)
4499c27c18e8Smrg    # If we're using GNU nm, then we don't want the "-C" option.
4500c27c18e8Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
450137eb1ca1Smrg    # Also, AIX nm treats weak defined symbols like other global defined
450237eb1ca1Smrg    # symbols, whereas GNU nm marks them as "W".
4503c27c18e8Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
450437eb1ca1Smrg      _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'
4505c27c18e8Smrg    else
4506c27c18e8Smrg      _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'
450721e67964Smrg    fi
4508c43cc173Smrg    ;;
4509c27c18e8Smrg  pw32*)
4510c27c18e8Smrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
4511b789ec8aSmrg    ;;
4512c27c18e8Smrg  cygwin* | mingw* | cegcc*)
4513b789ec8aSmrg    case $cc_basename in
4514b789ec8aSmrg    cl*) ;;
4515b789ec8aSmrg    *)
4516b789ec8aSmrg      _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'
4517b789ec8aSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4518b789ec8aSmrg      ;;
4519b789ec8aSmrg    esac
4520b789ec8aSmrg    ;;
4521c27c18e8Smrg  *)
4522c27c18e8Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4523b789ec8aSmrg    ;;
4524c27c18e8Smrg  esac
4525c27c18e8Smrg], [
4526c27c18e8Smrg  runpath_var=
4527c27c18e8Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
4528c27c18e8Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
4529c27c18e8Smrg  _LT_TAGVAR(archive_cmds, $1)=
4530c27c18e8Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
4531c27c18e8Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
4532c27c18e8Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4533c27c18e8Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4534c27c18e8Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4535c27c18e8Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
4536c27c18e8Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
4537c27c18e8Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4538c27c18e8Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4539c27c18e8Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
4540c27c18e8Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4541c27c18e8Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
4542c27c18e8Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4543c27c18e8Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
4544c27c18e8Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
4545c27c18e8Smrg  _LT_TAGVAR(module_cmds, $1)=
4546c27c18e8Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
4547c27c18e8Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4548c27c18e8Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4549c27c18e8Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
4550c27c18e8Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4551c27c18e8Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
4552c27c18e8Smrg  # included in the symbol list
4553c27c18e8Smrg  _LT_TAGVAR(include_expsyms, $1)=
4554c27c18e8Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
4555c27c18e8Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
4556c27c18e8Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
4557c27c18e8Smrg  # as well as any symbol that contains `d'.
4558c27c18e8Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4559c27c18e8Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
4560c27c18e8Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
4561c27c18e8Smrg  # the symbol is explicitly referenced.  Since portable code cannot
4562c27c18e8Smrg  # rely on this symbol name, it's probably fine to never include it in
4563c27c18e8Smrg  # preloaded symbol tables.
4564c27c18e8Smrg  # Exclude shared library initialization/finalization symbols.
4565c27c18e8Smrgdnl Note also adjust exclude_expsyms for C++ above.
4566c27c18e8Smrg  extract_expsyms_cmds=
4567c43cc173Smrg
4568c27c18e8Smrg  case $host_os in
4569c27c18e8Smrg  cygwin* | mingw* | pw32* | cegcc*)
4570c27c18e8Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
4571c27c18e8Smrg    # When not using gcc, we currently assume that we are using
4572c27c18e8Smrg    # Microsoft Visual C++.
4573c27c18e8Smrg    if test "$GCC" != yes; then
4574c27c18e8Smrg      with_gnu_ld=no
4575c43cc173Smrg    fi
457621e67964Smrg    ;;
4577c27c18e8Smrg  interix*)
4578c27c18e8Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
4579c27c18e8Smrg    with_gnu_ld=yes
4580c27c18e8Smrg    ;;
4581c27c18e8Smrg  openbsd*)
4582c27c18e8Smrg    with_gnu_ld=no
4583c27c18e8Smrg    ;;
458421e67964Smrg  esac
4585c43cc173Smrg
4586c27c18e8Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
458737eb1ca1Smrg
458837eb1ca1Smrg  # On some targets, GNU ld is compatible enough with the native linker
458937eb1ca1Smrg  # that we're better off using the native interface for both.
459037eb1ca1Smrg  lt_use_gnu_ld_interface=no
4591c27c18e8Smrg  if test "$with_gnu_ld" = yes; then
459237eb1ca1Smrg    case $host_os in
459337eb1ca1Smrg      aix*)
459437eb1ca1Smrg	# The AIX port of GNU ld has always aspired to compatibility
459537eb1ca1Smrg	# with the native linker.  However, as the warning in the GNU ld
459637eb1ca1Smrg	# block says, versions before 2.19.5* couldn't really create working
459737eb1ca1Smrg	# shared libraries, regardless of the interface used.
459837eb1ca1Smrg	case `$LD -v 2>&1` in
459937eb1ca1Smrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
460037eb1ca1Smrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
460137eb1ca1Smrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
460237eb1ca1Smrg	  *)
460337eb1ca1Smrg	    lt_use_gnu_ld_interface=yes
460437eb1ca1Smrg	    ;;
460537eb1ca1Smrg	esac
460637eb1ca1Smrg	;;
460737eb1ca1Smrg      *)
460837eb1ca1Smrg	lt_use_gnu_ld_interface=yes
460937eb1ca1Smrg	;;
461037eb1ca1Smrg    esac
461137eb1ca1Smrg  fi
461237eb1ca1Smrg
461337eb1ca1Smrg  if test "$lt_use_gnu_ld_interface" = yes; then
4614c27c18e8Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
4615c27c18e8Smrg    wlarc='${wl}'
4616c43cc173Smrg
4617c27c18e8Smrg    # Set some defaults for GNU ld with shared library support. These
4618c27c18e8Smrg    # are reset later if shared libraries are not supported. Putting them
4619c27c18e8Smrg    # here allows them to be overridden if necessary.
4620c27c18e8Smrg    runpath_var=LD_RUN_PATH
4621c27c18e8Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4622c27c18e8Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
4623c27c18e8Smrg    # ancient GNU ld didn't support --whole-archive et. al.
4624c27c18e8Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
4625c27c18e8Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
4626c27c18e8Smrg    else
4627c27c18e8Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4628c27c18e8Smrg    fi
4629c27c18e8Smrg    supports_anon_versioning=no
4630c27c18e8Smrg    case `$LD -v 2>&1` in
463137eb1ca1Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
4632c27c18e8Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
4633c27c18e8Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
4634c27c18e8Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
4635c27c18e8Smrg      *\ 2.11.*) ;; # other 2.11 versions
4636c27c18e8Smrg      *) supports_anon_versioning=yes ;;
4637c27c18e8Smrg    esac
4638c43cc173Smrg
4639c27c18e8Smrg    # See if GNU ld supports shared libraries.
4640c27c18e8Smrg    case $host_os in
4641c27c18e8Smrg    aix[[3-9]]*)
4642c27c18e8Smrg      # On AIX/PPC, the GNU linker is very broken
4643c27c18e8Smrg      if test "$host_cpu" != ia64; then
4644c27c18e8Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4645c27c18e8Smrg	cat <<_LT_EOF 1>&2
4646c43cc173Smrg
464737eb1ca1Smrg*** Warning: the GNU linker, at least up to release 2.19, is reported
4648c27c18e8Smrg*** to be unable to reliably create shared libraries on AIX.
4649c27c18e8Smrg*** Therefore, libtool is disabling shared libraries support.  If you
465037eb1ca1Smrg*** really care for shared libraries, you may want to install binutils
465137eb1ca1Smrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
465237eb1ca1Smrg*** You will then need to restart the configuration process.
4653c43cc173Smrg
4654c27c18e8Smrg_LT_EOF
4655c27c18e8Smrg      fi
4656c27c18e8Smrg      ;;
4657c43cc173Smrg
4658c27c18e8Smrg    amigaos*)
4659c27c18e8Smrg      case $host_cpu in
4660c27c18e8Smrg      powerpc)
4661c27c18e8Smrg            # see comment about AmigaOS4 .so support
4662c27c18e8Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4663c27c18e8Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
4664c27c18e8Smrg        ;;
4665c27c18e8Smrg      m68k)
4666c27c18e8Smrg            _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)'
4667c27c18e8Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4668c27c18e8Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
4669c27c18e8Smrg        ;;
4670c27c18e8Smrg      esac
4671c27c18e8Smrg      ;;
4672c43cc173Smrg
4673c27c18e8Smrg    beos*)
4674c27c18e8Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4675c27c18e8Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4676c27c18e8Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
4677c27c18e8Smrg	# support --undefined.  This deserves some investigation.  FIXME
4678c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4679c27c18e8Smrg      else
4680c27c18e8Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4681c27c18e8Smrg      fi
4682c27c18e8Smrg      ;;
468321e67964Smrg
4684c27c18e8Smrg    cygwin* | mingw* | pw32* | cegcc*)
4685c27c18e8Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
4686c27c18e8Smrg      # as there is no search path for DLLs.
4687c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
468837eb1ca1Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
4689c27c18e8Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4690c27c18e8Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
4691c27c18e8Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4692b789ec8aSmrg      _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'
4693b789ec8aSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4694c27c18e8Smrg
4695c27c18e8Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
4696c27c18e8Smrg        _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'
4697c27c18e8Smrg	# If the export-symbols file already is a .def file (1st line
4698c27c18e8Smrg	# is EXPORTS), use it as is; otherwise, prepend...
4699c27c18e8Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
4700c27c18e8Smrg	  cp $export_symbols $output_objdir/$soname.def;
4701c27c18e8Smrg	else
4702c27c18e8Smrg	  echo EXPORTS > $output_objdir/$soname.def;
4703c27c18e8Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
4704c27c18e8Smrg	fi~
4705c27c18e8Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4706c27c18e8Smrg      else
4707c27c18e8Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4708c27c18e8Smrg      fi
4709c27c18e8Smrg      ;;
471021e67964Smrg
471137eb1ca1Smrg    haiku*)
471237eb1ca1Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
471337eb1ca1Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
471437eb1ca1Smrg      ;;
471537eb1ca1Smrg
4716c27c18e8Smrg    interix[[3-9]]*)
4717c27c18e8Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
4718c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4719c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4720c27c18e8Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4721c27c18e8Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
4722c27c18e8Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
4723c27c18e8Smrg      # default) and relocated if they conflict, which is a slow very memory
4724c27c18e8Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
4725c27c18e8Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
4726c27c18e8Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
4727c27c18e8Smrg      _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'
4728c27c18e8Smrg      _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'
4729c27c18e8Smrg      ;;
473021e67964Smrg
473137eb1ca1Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
4732c27c18e8Smrg      tmp_diet=no
4733c27c18e8Smrg      if test "$host_os" = linux-dietlibc; then
4734c27c18e8Smrg	case $cc_basename in
4735c27c18e8Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
4736c27c18e8Smrg	esac
4737c27c18e8Smrg      fi
4738c27c18e8Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
4739c27c18e8Smrg	 && test "$tmp_diet" = no
4740c27c18e8Smrg      then
4741b789ec8aSmrg	tmp_addflag=' $pic_flag'
4742c27c18e8Smrg	tmp_sharedflag='-shared'
4743c27c18e8Smrg	case $cc_basename,$host_cpu in
4744c27c18e8Smrg        pgcc*)				# Portland Group C compiler
474537eb1ca1Smrg	  _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'
4746c27c18e8Smrg	  tmp_addflag=' $pic_flag'
4747c27c18e8Smrg	  ;;
474837eb1ca1Smrg	pgf77* | pgf90* | pgf95* | pgfortran*)
474937eb1ca1Smrg					# Portland Group f77 and f90 compilers
475037eb1ca1Smrg	  _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'
4751c27c18e8Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
4752c27c18e8Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
4753c27c18e8Smrg	  tmp_addflag=' -i_dynamic' ;;
4754c27c18e8Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
4755c27c18e8Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
4756c27c18e8Smrg	ifc* | ifort*)			# Intel Fortran compiler
4757c27c18e8Smrg	  tmp_addflag=' -nofor_main' ;;
4758c27c18e8Smrg	lf95*)				# Lahey Fortran 8.1
4759c27c18e8Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4760c27c18e8Smrg	  tmp_sharedflag='--shared' ;;
476137eb1ca1Smrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
4762c27c18e8Smrg	  tmp_sharedflag='-qmkshrobj'
4763c27c18e8Smrg	  tmp_addflag= ;;
476437eb1ca1Smrg	nvcc*)	# Cuda Compiler Driver 2.2
476537eb1ca1Smrg	  _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'
476637eb1ca1Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
476737eb1ca1Smrg	  ;;
4768c27c18e8Smrg	esac
4769c27c18e8Smrg	case `$CC -V 2>&1 | sed 5q` in
4770c27c18e8Smrg	*Sun\ C*)			# Sun C 5.9
477137eb1ca1Smrg	  _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'
4772c27c18e8Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
4773c27c18e8Smrg	  tmp_sharedflag='-G' ;;
4774c27c18e8Smrg	*Sun\ F*)			# Sun Fortran 8.3
4775c27c18e8Smrg	  tmp_sharedflag='-G' ;;
4776c27c18e8Smrg	esac
4777c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4778c43cc173Smrg
4779c27c18e8Smrg        if test "x$supports_anon_versioning" = xyes; then
4780c27c18e8Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4781c27c18e8Smrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4782c27c18e8Smrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
4783c27c18e8Smrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
4784c27c18e8Smrg        fi
4785c43cc173Smrg
4786c27c18e8Smrg	case $cc_basename in
478737eb1ca1Smrg	xlf* | bgf* | bgxlf* | mpixlf*)
4788c27c18e8Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
4789c27c18e8Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
4790c27c18e8Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4791c27c18e8Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
479237eb1ca1Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
4793c27c18e8Smrg	  if test "x$supports_anon_versioning" = xyes; then
4794c27c18e8Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4795c27c18e8Smrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4796c27c18e8Smrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
479737eb1ca1Smrg	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
4798c27c18e8Smrg	  fi
4799c27c18e8Smrg	  ;;
4800c27c18e8Smrg	esac
4801c27c18e8Smrg      else
4802c27c18e8Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
4803c27c18e8Smrg      fi
4804c27c18e8Smrg      ;;
4805c43cc173Smrg
4806c27c18e8Smrg    netbsd*)
4807c27c18e8Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4808c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
4809c27c18e8Smrg	wlarc=
4810c27c18e8Smrg      else
4811b789ec8aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4812b789ec8aSmrg	_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'
4813c27c18e8Smrg      fi
4814c27c18e8Smrg      ;;
4815c43cc173Smrg
4816c27c18e8Smrg    solaris*)
4817c27c18e8Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
4818c27c18e8Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4819c27c18e8Smrg	cat <<_LT_EOF 1>&2
4820c43cc173Smrg
4821c27c18e8Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
4822c27c18e8Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
4823c27c18e8Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
4824c27c18e8Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
4825c27c18e8Smrg*** your PATH or compiler configuration so that the native linker is
4826c27c18e8Smrg*** used, and then restart.
4827c43cc173Smrg
4828c27c18e8Smrg_LT_EOF
4829c27c18e8Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4830b789ec8aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4831b789ec8aSmrg	_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'
4832c27c18e8Smrg      else
4833c27c18e8Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4834c27c18e8Smrg      fi
4835c27c18e8Smrg      ;;
4836c43cc173Smrg
4837c27c18e8Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
4838c27c18e8Smrg      case `$LD -v 2>&1` in
4839c27c18e8Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
4840c27c18e8Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4841c27c18e8Smrg	cat <<_LT_EOF 1>&2
4842c43cc173Smrg
4843c27c18e8Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
4844c27c18e8Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
4845c27c18e8Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
4846c27c18e8Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
4847c27c18e8Smrg*** your PATH or compiler configuration so that the native linker is
4848c27c18e8Smrg*** used, and then restart.
4849c43cc173Smrg
4850c27c18e8Smrg_LT_EOF
4851c27c18e8Smrg	;;
4852c27c18e8Smrg	*)
4853c27c18e8Smrg	  # For security reasons, it is highly recommended that you always
4854c27c18e8Smrg	  # use absolute paths for naming shared libraries, and exclude the
4855c27c18e8Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
4856c27c18e8Smrg	  # requires that you compile everything twice, which is a pain.
4857c27c18e8Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4858c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4859c27c18e8Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4860c27c18e8Smrg	    _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'
4861c27c18e8Smrg	  else
4862c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
4863c27c18e8Smrg	  fi
4864c27c18e8Smrg	;;
4865c27c18e8Smrg      esac
4866c27c18e8Smrg      ;;
4867c43cc173Smrg
4868c27c18e8Smrg    sunos4*)
4869c27c18e8Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4870c27c18e8Smrg      wlarc=
4871c27c18e8Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4872c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4873c27c18e8Smrg      ;;
4874c43cc173Smrg
4875c27c18e8Smrg    *)
4876c27c18e8Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4877b789ec8aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4878b789ec8aSmrg	_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'
4879c27c18e8Smrg      else
4880c27c18e8Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4881c27c18e8Smrg      fi
4882c27c18e8Smrg      ;;
4883c27c18e8Smrg    esac
4884c43cc173Smrg
4885c27c18e8Smrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
4886c27c18e8Smrg      runpath_var=
4887c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4888c27c18e8Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4889c27c18e8Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4890c27c18e8Smrg    fi
4891c27c18e8Smrg  else
4892c27c18e8Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
4893c27c18e8Smrg    case $host_os in
4894c27c18e8Smrg    aix3*)
4895c27c18e8Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4896c27c18e8Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
4897c27c18e8Smrg      _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'
4898c27c18e8Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
4899c27c18e8Smrg      # are no directories specified by -L.
4900c27c18e8Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4901c27c18e8Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
4902c27c18e8Smrg	# Neither direct hardcoding nor static linking is supported with a
4903c27c18e8Smrg	# broken collect2.
4904c27c18e8Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
4905c27c18e8Smrg      fi
4906c27c18e8Smrg      ;;
4907c43cc173Smrg
4908c27c18e8Smrg    aix[[4-9]]*)
4909c27c18e8Smrg      if test "$host_cpu" = ia64; then
4910c27c18e8Smrg	# On IA64, the linker does run time linking by default, so we don't
4911c27c18e8Smrg	# have to do anything special.
4912c27c18e8Smrg	aix_use_runtimelinking=no
4913c27c18e8Smrg	exp_sym_flag='-Bexport'
4914c27c18e8Smrg	no_entry_flag=""
4915c27c18e8Smrg      else
4916c27c18e8Smrg	# If we're using GNU nm, then we don't want the "-C" option.
4917c27c18e8Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
491837eb1ca1Smrg	# Also, AIX nm treats weak defined symbols like other global
491937eb1ca1Smrg	# defined symbols, whereas GNU nm marks them as "W".
4920c27c18e8Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
492137eb1ca1Smrg	  _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'
4922c27c18e8Smrg	else
4923c27c18e8Smrg	  _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'
4924c27c18e8Smrg	fi
4925c27c18e8Smrg	aix_use_runtimelinking=no
4926c43cc173Smrg
4927c27c18e8Smrg	# Test if we are trying to use run time linking or normal
4928c27c18e8Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
4929c27c18e8Smrg	# need to do runtime linking.
4930c27c18e8Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
4931c27c18e8Smrg	  for ld_flag in $LDFLAGS; do
4932c27c18e8Smrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
4933c27c18e8Smrg	    aix_use_runtimelinking=yes
4934c27c18e8Smrg	    break
4935c27c18e8Smrg	  fi
4936c27c18e8Smrg	  done
4937c27c18e8Smrg	  ;;
4938c27c18e8Smrg	esac
4939c43cc173Smrg
4940c27c18e8Smrg	exp_sym_flag='-bexport'
4941c27c18e8Smrg	no_entry_flag='-bnoentry'
4942c27c18e8Smrg      fi
4943c27c18e8Smrg
4944c27c18e8Smrg      # When large executables or shared objects are built, AIX ld can
4945c27c18e8Smrg      # have problems creating the table of contents.  If linking a library
4946c27c18e8Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
4947c27c18e8Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
4948c27c18e8Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
4949c43cc173Smrg
4950c27c18e8Smrg      _LT_TAGVAR(archive_cmds, $1)=''
4951c27c18e8Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4952c27c18e8Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4953c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
4954c27c18e8Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
4955c27c18e8Smrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
4956c43cc173Smrg
4957c27c18e8Smrg      if test "$GCC" = yes; then
4958c27c18e8Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
4959c27c18e8Smrg	# We only want to do this on AIX 4.2 and lower, the check
4960c27c18e8Smrg	# below for broken collect2 doesn't work under 4.3+
4961c27c18e8Smrg	  collect2name=`${CC} -print-prog-name=collect2`
4962c27c18e8Smrg	  if test -f "$collect2name" &&
4963c27c18e8Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
4964c27c18e8Smrg	  then
4965c27c18e8Smrg	  # We have reworked collect2
4966c27c18e8Smrg	  :
4967c27c18e8Smrg	  else
4968c27c18e8Smrg	  # We have old collect2
4969c27c18e8Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
4970c27c18e8Smrg	  # It fails to find uninstalled libraries when the uninstalled
4971c27c18e8Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
4972c27c18e8Smrg	  # to unsupported forces relinking
4973c27c18e8Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
4974c27c18e8Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4975c27c18e8Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4976c27c18e8Smrg	  fi
4977c27c18e8Smrg	  ;;
4978c27c18e8Smrg	esac
4979c27c18e8Smrg	shared_flag='-shared'
4980c27c18e8Smrg	if test "$aix_use_runtimelinking" = yes; then
4981c27c18e8Smrg	  shared_flag="$shared_flag "'${wl}-G'
4982c27c18e8Smrg	fi
4983c27c18e8Smrg      else
4984c27c18e8Smrg	# not using gcc
4985c27c18e8Smrg	if test "$host_cpu" = ia64; then
4986c27c18e8Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
4987c27c18e8Smrg	# chokes on -Wl,-G. The following line is correct:
4988c27c18e8Smrg	  shared_flag='-G'
4989c27c18e8Smrg	else
4990c27c18e8Smrg	  if test "$aix_use_runtimelinking" = yes; then
4991c27c18e8Smrg	    shared_flag='${wl}-G'
4992c27c18e8Smrg	  else
4993c27c18e8Smrg	    shared_flag='${wl}-bM:SRE'
4994c27c18e8Smrg	  fi
4995c27c18e8Smrg	fi
4996c27c18e8Smrg      fi
4997c43cc173Smrg
4998c27c18e8Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
4999c27c18e8Smrg      # It seems that -bexpall does not export symbols beginning with
5000c27c18e8Smrg      # underscore (_), so it is better to generate a list of symbols to export.
5001c27c18e8Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
5002c27c18e8Smrg      if test "$aix_use_runtimelinking" = yes; then
5003c27c18e8Smrg	# Warning - without using the other runtime loading flags (-brtl),
5004c27c18e8Smrg	# -berok will link without error, but may produce a broken library.
5005c27c18e8Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5006c27c18e8Smrg        # Determine the default libpath from the value encoded in an
5007c27c18e8Smrg        # empty executable.
5008b789ec8aSmrg        _LT_SYS_MODULE_PATH_AIX([$1])
5009c27c18e8Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
501037eb1ca1Smrg        _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"
5011c27c18e8Smrg      else
5012c27c18e8Smrg	if test "$host_cpu" = ia64; then
5013c27c18e8Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
5014c27c18e8Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5015c27c18e8Smrg	  _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"
5016c27c18e8Smrg	else
5017c27c18e8Smrg	 # Determine the default libpath from the value encoded in an
5018c27c18e8Smrg	 # empty executable.
5019b789ec8aSmrg	 _LT_SYS_MODULE_PATH_AIX([$1])
5020c27c18e8Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5021c27c18e8Smrg	  # Warning - without using the other run time loading flags,
5022c27c18e8Smrg	  # -berok will link without error, but may produce a broken library.
5023c27c18e8Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5024c27c18e8Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
502537eb1ca1Smrg	  if test "$with_gnu_ld" = yes; then
502637eb1ca1Smrg	    # We only use this code for GNU lds that support --whole-archive.
502737eb1ca1Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
502837eb1ca1Smrg	  else
502937eb1ca1Smrg	    # Exported symbols can be pulled into shared objects from archives
503037eb1ca1Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
503137eb1ca1Smrg	  fi
5032c27c18e8Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5033c27c18e8Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
5034c27c18e8Smrg	  _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'
5035c27c18e8Smrg	fi
5036c27c18e8Smrg      fi
5037c27c18e8Smrg      ;;
5038c43cc173Smrg
5039c27c18e8Smrg    amigaos*)
5040c27c18e8Smrg      case $host_cpu in
5041c27c18e8Smrg      powerpc)
5042c27c18e8Smrg            # see comment about AmigaOS4 .so support
5043c27c18e8Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5044c27c18e8Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5045c27c18e8Smrg        ;;
5046c27c18e8Smrg      m68k)
5047c27c18e8Smrg            _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)'
5048c27c18e8Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5049c27c18e8Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5050c27c18e8Smrg        ;;
5051c27c18e8Smrg      esac
5052c27c18e8Smrg      ;;
5053c43cc173Smrg
5054c27c18e8Smrg    bsdi[[45]]*)
5055c27c18e8Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
5056c27c18e8Smrg      ;;
5057c43cc173Smrg
5058c27c18e8Smrg    cygwin* | mingw* | pw32* | cegcc*)
5059c27c18e8Smrg      # When not using gcc, we currently assume that we are using
5060c27c18e8Smrg      # Microsoft Visual C++.
5061c27c18e8Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
5062c27c18e8Smrg      # no search path for DLLs.
5063b789ec8aSmrg      case $cc_basename in
5064b789ec8aSmrg      cl*)
5065b789ec8aSmrg	# Native MSVC
5066b789ec8aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5067b789ec8aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5068b789ec8aSmrg	_LT_TAGVAR(always_export_symbols, $1)=yes
5069b789ec8aSmrg	_LT_TAGVAR(file_list_spec, $1)='@'
5070b789ec8aSmrg	# Tell ltmain to make .lib files, not .a files.
5071b789ec8aSmrg	libext=lib
5072b789ec8aSmrg	# Tell ltmain to make .dll files, not .so files.
5073b789ec8aSmrg	shrext_cmds=".dll"
5074b789ec8aSmrg	# FIXME: Setting linknames here is a bad hack.
5075b789ec8aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
5076b789ec8aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5077b789ec8aSmrg	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
5078b789ec8aSmrg	  else
5079b789ec8aSmrg	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
5080b789ec8aSmrg	  fi~
5081b789ec8aSmrg	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5082b789ec8aSmrg	  linknames='
5083b789ec8aSmrg	# The linker will not automatically build a static lib if we build a DLL.
5084b789ec8aSmrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5085b789ec8aSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5086b789ec8aSmrg	_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'
5087b789ec8aSmrg	# Don't use ranlib
5088b789ec8aSmrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
5089b789ec8aSmrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
5090b789ec8aSmrg	  lt_tool_outputfile="@TOOL_OUTPUT@"~
5091b789ec8aSmrg	  case $lt_outputfile in
5092b789ec8aSmrg	    *.exe|*.EXE) ;;
5093b789ec8aSmrg	    *)
5094b789ec8aSmrg	      lt_outputfile="$lt_outputfile.exe"
5095b789ec8aSmrg	      lt_tool_outputfile="$lt_tool_outputfile.exe"
5096b789ec8aSmrg	      ;;
5097b789ec8aSmrg	  esac~
5098b789ec8aSmrg	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
5099b789ec8aSmrg	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5100b789ec8aSmrg	    $RM "$lt_outputfile.manifest";
5101b789ec8aSmrg	  fi'
5102b789ec8aSmrg	;;
5103b789ec8aSmrg      *)
5104b789ec8aSmrg	# Assume MSVC wrapper
5105b789ec8aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5106b789ec8aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5107b789ec8aSmrg	# Tell ltmain to make .lib files, not .a files.
5108b789ec8aSmrg	libext=lib
5109b789ec8aSmrg	# Tell ltmain to make .dll files, not .so files.
5110b789ec8aSmrg	shrext_cmds=".dll"
5111b789ec8aSmrg	# FIXME: Setting linknames here is a bad hack.
5112b789ec8aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
5113b789ec8aSmrg	# The linker will automatically build a .lib file if we build a DLL.
5114b789ec8aSmrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5115b789ec8aSmrg	# FIXME: Should let the user specify the lib program.
5116b789ec8aSmrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
5117b789ec8aSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5118b789ec8aSmrg	;;
5119b789ec8aSmrg      esac
5120c27c18e8Smrg      ;;
5121c43cc173Smrg
5122c27c18e8Smrg    darwin* | rhapsody*)
5123c27c18e8Smrg      _LT_DARWIN_LINKER_FEATURES($1)
5124c27c18e8Smrg      ;;
5125c43cc173Smrg
5126c27c18e8Smrg    dgux*)
5127c27c18e8Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5128c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5129c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5130c27c18e8Smrg      ;;
5131c43cc173Smrg
5132c27c18e8Smrg    freebsd1*)
5133c27c18e8Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
5134c27c18e8Smrg      ;;
5135c43cc173Smrg
5136c27c18e8Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5137c27c18e8Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
5138c27c18e8Smrg    # does not break anything, and helps significantly (at the cost of a little
5139c27c18e8Smrg    # extra space).
5140c27c18e8Smrg    freebsd2.2*)
5141c27c18e8Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5142c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5143c27c18e8Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5144c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5145c27c18e8Smrg      ;;
5146c43cc173Smrg
5147c27c18e8Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5148c27c18e8Smrg    freebsd2*)
5149c27c18e8Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5150c27c18e8Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5151c27c18e8Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5152c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5153c27c18e8Smrg      ;;
5154c43cc173Smrg
5155c27c18e8Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5156c27c18e8Smrg    freebsd* | dragonfly*)
5157b789ec8aSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5158c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5159c27c18e8Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5160c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5161c27c18e8Smrg      ;;
5162c43cc173Smrg
5163c27c18e8Smrg    hpux9*)
5164c27c18e8Smrg      if test "$GCC" = yes; then
5165b789ec8aSmrg	_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'
5166c27c18e8Smrg      else
5167c27c18e8Smrg	_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'
5168c27c18e8Smrg      fi
5169c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5170c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5171c27c18e8Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5172c43cc173Smrg
5173c27c18e8Smrg      # hardcode_minus_L: Not really in the search PATH,
5174c27c18e8Smrg      # but as the default location of the library.
5175c27c18e8Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5176c27c18e8Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5177c27c18e8Smrg      ;;
5178c43cc173Smrg
5179c27c18e8Smrg    hpux10*)
518037eb1ca1Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
5181b789ec8aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5182c27c18e8Smrg      else
5183c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
5184c27c18e8Smrg      fi
5185c27c18e8Smrg      if test "$with_gnu_ld" = no; then
5186c27c18e8Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5187c27c18e8Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
5188c27c18e8Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5189c27c18e8Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
5190c27c18e8Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5191c27c18e8Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5192c27c18e8Smrg	# hardcode_minus_L: Not really in the search PATH,
5193c27c18e8Smrg	# but as the default location of the library.
5194c27c18e8Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
5195c27c18e8Smrg      fi
5196c27c18e8Smrg      ;;
5197c43cc173Smrg
5198c27c18e8Smrg    hpux11*)
519937eb1ca1Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
5200c27c18e8Smrg	case $host_cpu in
5201c27c18e8Smrg	hppa*64*)
5202c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5203c27c18e8Smrg	  ;;
5204c27c18e8Smrg	ia64*)
5205b789ec8aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5206c27c18e8Smrg	  ;;
5207c27c18e8Smrg	*)
5208b789ec8aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5209c27c18e8Smrg	  ;;
5210c27c18e8Smrg	esac
5211c27c18e8Smrg      else
5212c27c18e8Smrg	case $host_cpu in
5213c27c18e8Smrg	hppa*64*)
5214c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5215c27c18e8Smrg	  ;;
5216c27c18e8Smrg	ia64*)
5217c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5218c27c18e8Smrg	  ;;
5219c27c18e8Smrg	*)
522037eb1ca1Smrg	m4_if($1, [], [
522137eb1ca1Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
522237eb1ca1Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
522337eb1ca1Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
522437eb1ca1Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
522537eb1ca1Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
522637eb1ca1Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
522737eb1ca1Smrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
5228c27c18e8Smrg	  ;;
5229c27c18e8Smrg	esac
5230c27c18e8Smrg      fi
5231c27c18e8Smrg      if test "$with_gnu_ld" = no; then
5232c27c18e8Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5233c27c18e8Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5234c43cc173Smrg
5235c27c18e8Smrg	case $host_cpu in
5236c27c18e8Smrg	hppa*64*|ia64*)
5237c27c18e8Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
5238c27c18e8Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5239c27c18e8Smrg	  ;;
5240c27c18e8Smrg	*)
5241c27c18e8Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
5242c27c18e8Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5243c27c18e8Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5244c27c18e8Smrg
5245c27c18e8Smrg	  # hardcode_minus_L: Not really in the search PATH,
5246c27c18e8Smrg	  # but as the default location of the library.
5247c27c18e8Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5248c27c18e8Smrg	  ;;
5249c27c18e8Smrg	esac
5250c27c18e8Smrg      fi
525121e67964Smrg      ;;
5252c27c18e8Smrg
5253c27c18e8Smrg    irix5* | irix6* | nonstopux*)
5254c27c18e8Smrg      if test "$GCC" = yes; then
5255b789ec8aSmrg	_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'
5256c27c18e8Smrg	# Try to use the -exported_symbol ld option, if it does not
5257c27c18e8Smrg	# work, assume that -exports_file does not work either and
5258c27c18e8Smrg	# implicitly export all symbols.
5259b789ec8aSmrg	# This should be the same for all languages, so no per-tag cache variable.
5260b789ec8aSmrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
5261b789ec8aSmrg	  [lt_cv_irix_exported_symbol],
5262b789ec8aSmrg	  [save_LDFLAGS="$LDFLAGS"
5263b789ec8aSmrg	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
5264b789ec8aSmrg	   AC_LINK_IFELSE(
5265b789ec8aSmrg	     [AC_LANG_SOURCE(
5266b789ec8aSmrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
5267b789ec8aSmrg			      [C++], [[int foo (void) { return 0; }]],
5268b789ec8aSmrg			      [Fortran 77], [[
5269b789ec8aSmrg      subroutine foo
5270b789ec8aSmrg      end]],
5271b789ec8aSmrg			      [Fortran], [[
5272b789ec8aSmrg      subroutine foo
5273b789ec8aSmrg      end]])])],
5274b789ec8aSmrg	      [lt_cv_irix_exported_symbol=yes],
5275b789ec8aSmrg	      [lt_cv_irix_exported_symbol=no])
5276b789ec8aSmrg           LDFLAGS="$save_LDFLAGS"])
5277b789ec8aSmrg	if test "$lt_cv_irix_exported_symbol" = yes; then
5278b789ec8aSmrg          _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'
5279b789ec8aSmrg	fi
5280c27c18e8Smrg      else
528137eb1ca1Smrg	_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'
528237eb1ca1Smrg	_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'
5283c27c18e8Smrg      fi
5284c27c18e8Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5285c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5286c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5287c27c18e8Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
5288c27c18e8Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
528921e67964Smrg      ;;
529021e67964Smrg
5291c27c18e8Smrg    netbsd*)
5292c27c18e8Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5293c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
5294c27c18e8Smrg      else
5295c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
5296c27c18e8Smrg      fi
5297c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5298c27c18e8Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5299c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5300c27c18e8Smrg      ;;
5301c43cc173Smrg
5302c27c18e8Smrg    newsos6)
5303c27c18e8Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5304c27c18e8Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5305c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5306c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5307c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5308c27c18e8Smrg      ;;
5309c43cc173Smrg
5310c27c18e8Smrg    *nto* | *qnx*)
5311c27c18e8Smrg      ;;
5312c43cc173Smrg
5313c27c18e8Smrg    openbsd*)
5314c27c18e8Smrg      if test -f /usr/libexec/ld.so; then
5315c27c18e8Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
5316c27c18e8Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5317c27c18e8Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5318c27c18e8Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5319c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5320c27c18e8Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
5321c27c18e8Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5322c27c18e8Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5323c27c18e8Smrg	else
5324c27c18e8Smrg	  case $host_os in
5325c27c18e8Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
5326c27c18e8Smrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5327c27c18e8Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5328c27c18e8Smrg	     ;;
5329c27c18e8Smrg	   *)
5330c27c18e8Smrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5331c27c18e8Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5332c27c18e8Smrg	     ;;
5333c27c18e8Smrg	  esac
5334c27c18e8Smrg	fi
5335c27c18e8Smrg      else
5336c27c18e8Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
5337c27c18e8Smrg      fi
5338c27c18e8Smrg      ;;
5339c43cc173Smrg
5340c27c18e8Smrg    os2*)
5341c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5342c27c18e8Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5343c27c18e8Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
534437eb1ca1Smrg      _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'
5345c27c18e8Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
5346c27c18e8Smrg      ;;
5347c43cc173Smrg
5348c27c18e8Smrg    osf3*)
5349c27c18e8Smrg      if test "$GCC" = yes; then
5350c27c18e8Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
535137eb1ca1Smrg	_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'
5352c27c18e8Smrg      else
5353c27c18e8Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
535437eb1ca1Smrg	_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'
5355c27c18e8Smrg      fi
5356c27c18e8Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5357c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5358c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5359c27c18e8Smrg      ;;
5360c43cc173Smrg
5361c27c18e8Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
5362c27c18e8Smrg      if test "$GCC" = yes; then
5363c27c18e8Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5364b789ec8aSmrg	_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'
5365c27c18e8Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5366c27c18e8Smrg      else
5367c27c18e8Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
536837eb1ca1Smrg	_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'
5369c27c18e8Smrg	_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~
537037eb1ca1Smrg	$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'
5371c43cc173Smrg
5372c27c18e8Smrg	# Both c and cxx compiler support -rpath directly
5373c27c18e8Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5374c27c18e8Smrg      fi
5375c27c18e8Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5376c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5377c27c18e8Smrg      ;;
5378c43cc173Smrg
5379c27c18e8Smrg    solaris*)
5380c27c18e8Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
5381c27c18e8Smrg      if test "$GCC" = yes; then
5382c27c18e8Smrg	wlarc='${wl}'
5383b789ec8aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5384c27c18e8Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5385b789ec8aSmrg	  $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'
5386c27c18e8Smrg      else
5387c27c18e8Smrg	case `$CC -V 2>&1` in
5388c27c18e8Smrg	*"Compilers 5.0"*)
5389c27c18e8Smrg	  wlarc=''
5390c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
5391c27c18e8Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5392c27c18e8Smrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
5393c27c18e8Smrg	  ;;
5394c27c18e8Smrg	*)
5395c27c18e8Smrg	  wlarc='${wl}'
5396c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
5397c27c18e8Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5398c27c18e8Smrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5399c27c18e8Smrg	  ;;
5400c27c18e8Smrg	esac
5401c27c18e8Smrg      fi
5402c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5403c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5404c27c18e8Smrg      case $host_os in
5405c27c18e8Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
5406c27c18e8Smrg      *)
5407c27c18e8Smrg	# The compiler driver will combine and reorder linker options,
5408c27c18e8Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
5409c27c18e8Smrg	# but is careful enough not to reorder.
5410c27c18e8Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
5411c27c18e8Smrg	if test "$GCC" = yes; then
5412c27c18e8Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
5413c27c18e8Smrg	else
5414c27c18e8Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
5415c27c18e8Smrg	fi
5416c27c18e8Smrg	;;
5417c27c18e8Smrg      esac
5418c27c18e8Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5419c27c18e8Smrg      ;;
5420c43cc173Smrg
5421c27c18e8Smrg    sunos4*)
5422c27c18e8Smrg      if test "x$host_vendor" = xsequent; then
5423c27c18e8Smrg	# Use $CC to link under sequent, because it throws in some extra .o
5424c27c18e8Smrg	# files that make .init and .fini sections work.
5425c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5426c27c18e8Smrg      else
5427c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5428c27c18e8Smrg      fi
5429c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5430c27c18e8Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5431c27c18e8Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5432c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5433c27c18e8Smrg      ;;
5434c43cc173Smrg
5435c27c18e8Smrg    sysv4)
5436c27c18e8Smrg      case $host_vendor in
5437c27c18e8Smrg	sni)
5438c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5439c27c18e8Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5440c27c18e8Smrg	;;
5441c27c18e8Smrg	siemens)
5442c27c18e8Smrg	  ## LD is ld it makes a PLAMLIB
5443c27c18e8Smrg	  ## CC just makes a GrossModule.
5444c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5445c27c18e8Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5446c27c18e8Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
5447c27c18e8Smrg        ;;
5448c27c18e8Smrg	motorola)
5449c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5450c27c18e8Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
5451c27c18e8Smrg	;;
5452c27c18e8Smrg      esac
5453c27c18e8Smrg      runpath_var='LD_RUN_PATH'
5454c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5455c27c18e8Smrg      ;;
5456c43cc173Smrg
5457c27c18e8Smrg    sysv4.3*)
5458c27c18e8Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5459c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5460c27c18e8Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
5461c27c18e8Smrg      ;;
5462c43cc173Smrg
5463c27c18e8Smrg    sysv4*MP*)
5464c27c18e8Smrg      if test -d /usr/nec; then
5465c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5466c27c18e8Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5467c27c18e8Smrg	runpath_var=LD_RUN_PATH
5468c27c18e8Smrg	hardcode_runpath_var=yes
5469c27c18e8Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
5470c27c18e8Smrg      fi
5471c27c18e8Smrg      ;;
5472c43cc173Smrg
5473c27c18e8Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
5474c27c18e8Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5475c27c18e8Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5476c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5477c27c18e8Smrg      runpath_var='LD_RUN_PATH'
5478c43cc173Smrg
5479c27c18e8Smrg      if test "$GCC" = yes; then
5480c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5481c27c18e8Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5482c27c18e8Smrg      else
5483c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5484c27c18e8Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5485c27c18e8Smrg      fi
5486c27c18e8Smrg      ;;
5487c43cc173Smrg
5488c27c18e8Smrg    sysv5* | sco3.2v5* | sco5v6*)
5489c27c18e8Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
5490c27c18e8Smrg      # link with -lc, and that would cause any symbols used from libc to
5491c27c18e8Smrg      # always be unresolved, which means just about no library would
5492c27c18e8Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
5493c27c18e8Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
5494c27c18e8Smrg      # as -z defs.
5495c27c18e8Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5496c27c18e8Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
5497c27c18e8Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5498c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5499c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
5500c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5501c27c18e8Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5502c27c18e8Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
5503c27c18e8Smrg      runpath_var='LD_RUN_PATH'
5504c43cc173Smrg
5505c27c18e8Smrg      if test "$GCC" = yes; then
5506c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5507c27c18e8Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5508c27c18e8Smrg      else
5509c27c18e8Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5510c27c18e8Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5511c27c18e8Smrg      fi
5512c27c18e8Smrg      ;;
5513c43cc173Smrg
5514c27c18e8Smrg    uts4*)
5515c27c18e8Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5516c27c18e8Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5517c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5518c27c18e8Smrg      ;;
5519c43cc173Smrg
5520c27c18e8Smrg    *)
5521c27c18e8Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
5522c27c18e8Smrg      ;;
5523c27c18e8Smrg    esac
5524c43cc173Smrg
5525c27c18e8Smrg    if test x$host_vendor = xsni; then
5526c27c18e8Smrg      case $host in
5527c27c18e8Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5528c27c18e8Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
5529c27c18e8Smrg	;;
5530c27c18e8Smrg      esac
5531c27c18e8Smrg    fi
5532c27c18e8Smrg  fi
5533c27c18e8Smrg])
5534c27c18e8SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
5535c27c18e8Smrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
5536c43cc173Smrg
5537c27c18e8Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
5538c43cc173Smrg
5539c27c18e8Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
5540c27c18e8Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
5541c27c18e8Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
5542c27c18e8Smrg    [The commands to extract the exported symbol list from a shared archive])
5543c43cc173Smrg
5544c27c18e8Smrg#
5545c27c18e8Smrg# Do we need to explicitly link libc?
5546c27c18e8Smrg#
5547c27c18e8Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
5548c27c18e8Smrgx|xyes)
5549c27c18e8Smrg  # Assume -lc should be added
5550c27c18e8Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5551c43cc173Smrg
5552c27c18e8Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
5553c27c18e8Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
5554c27c18e8Smrg    *'~'*)
5555c27c18e8Smrg      # FIXME: we may have to deal with multi-command sequences.
5556c27c18e8Smrg      ;;
5557c27c18e8Smrg    '$CC '*)
5558c27c18e8Smrg      # Test whether the compiler implicitly links with -lc since on some
5559c27c18e8Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
5560c27c18e8Smrg      # to ld, don't add -lc before -lgcc.
556137eb1ca1Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
556237eb1ca1Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
556337eb1ca1Smrg	[$RM conftest*
556437eb1ca1Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
556537eb1ca1Smrg
556637eb1ca1Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
556737eb1ca1Smrg	  soname=conftest
556837eb1ca1Smrg	  lib=conftest
556937eb1ca1Smrg	  libobjs=conftest.$ac_objext
557037eb1ca1Smrg	  deplibs=
557137eb1ca1Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
557237eb1ca1Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
557337eb1ca1Smrg	  compiler_flags=-v
557437eb1ca1Smrg	  linker_flags=-v
557537eb1ca1Smrg	  verstring=
557637eb1ca1Smrg	  output_objdir=.
557737eb1ca1Smrg	  libname=conftest
557837eb1ca1Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
557937eb1ca1Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
558037eb1ca1Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
558137eb1ca1Smrg	  then
558237eb1ca1Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
558337eb1ca1Smrg	  else
558437eb1ca1Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
558537eb1ca1Smrg	  fi
558637eb1ca1Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
558737eb1ca1Smrg	else
558837eb1ca1Smrg	  cat conftest.err 1>&5
558937eb1ca1Smrg	fi
559037eb1ca1Smrg	$RM conftest*
559137eb1ca1Smrg	])
559237eb1ca1Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
5593c27c18e8Smrg      ;;
5594c27c18e8Smrg    esac
5595c27c18e8Smrg  fi
5596c27c18e8Smrg  ;;
5597c27c18e8Smrgesac
5598c43cc173Smrg
5599c27c18e8Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
5600c27c18e8Smrg    [Whether or not to add -lc for building shared libraries])
5601c27c18e8Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
5602c27c18e8Smrg    [enable_shared_with_static_runtimes], [0],
5603c27c18e8Smrg    [Whether or not to disallow shared libs when runtime libs are static])
5604c27c18e8Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
5605c27c18e8Smrg    [Compiler flag to allow reflexive dlopens])
5606c27c18e8Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
5607c27c18e8Smrg    [Compiler flag to generate shared objects directly from archives])
5608c27c18e8Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
5609c27c18e8Smrg    [Whether the compiler copes with passing no objects directly])
5610c27c18e8Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
5611c27c18e8Smrg    [Create an old-style archive from a shared archive])
5612c27c18e8Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
5613c27c18e8Smrg    [Create a temporary old-style archive to link instead of a shared archive])
5614c27c18e8Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
5615c27c18e8Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
5616c27c18e8Smrg_LT_TAGDECL([], [module_cmds], [2],
5617c27c18e8Smrg    [Commands used to build a loadable module if different from building
5618c27c18e8Smrg    a shared archive.])
5619c27c18e8Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
5620c27c18e8Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
5621c27c18e8Smrg    [Whether we are building with GNU ld or not])
5622c27c18e8Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
5623c27c18e8Smrg    [Flag that allows shared libraries with undefined symbols to be built])
5624c27c18e8Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
5625c27c18e8Smrg    [Flag that enforces no undefined symbols])
5626c27c18e8Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
5627c27c18e8Smrg    [Flag to hardcode $libdir into a binary during linking.
5628c27c18e8Smrg    This must work even if $libdir does not exist])
5629c27c18e8Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
5630c27c18e8Smrg    [[If ld is used when linking, flag to hardcode $libdir into a binary
5631c27c18e8Smrg    during linking.  This must work even if $libdir does not exist]])
5632c27c18e8Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
5633c27c18e8Smrg    [Whether we need a single "-rpath" flag with a separated argument])
5634c27c18e8Smrg_LT_TAGDECL([], [hardcode_direct], [0],
5635c27c18e8Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5636c27c18e8Smrg    DIR into the resulting binary])
5637c27c18e8Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
5638c27c18e8Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5639c27c18e8Smrg    DIR into the resulting binary and the resulting library dependency is
5640c27c18e8Smrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
5641c27c18e8Smrg    library is relocated])
5642c27c18e8Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
5643c27c18e8Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
5644c27c18e8Smrg    into the resulting binary])
5645c27c18e8Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
5646c27c18e8Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
5647c27c18e8Smrg    into the resulting binary])
5648c27c18e8Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
5649c27c18e8Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
5650c27c18e8Smrg    into the library and all subsequent libraries and executables linked
5651c27c18e8Smrg    against it])
5652c27c18e8Smrg_LT_TAGDECL([], [inherit_rpath], [0],
5653c27c18e8Smrg    [Set to yes if linker adds runtime paths of dependent libraries
5654c27c18e8Smrg    to runtime path list])
5655c27c18e8Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
5656c27c18e8Smrg    [Whether libtool must link a program against all its dependency libraries])
5657c27c18e8Smrg_LT_TAGDECL([], [always_export_symbols], [0],
5658c27c18e8Smrg    [Set to "yes" if exported symbols are required])
5659c27c18e8Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
5660c27c18e8Smrg    [The commands to list exported symbols])
5661c27c18e8Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
5662c27c18e8Smrg    [Symbols that should not be listed in the preloaded symbols])
5663c27c18e8Smrg_LT_TAGDECL([], [include_expsyms], [1],
5664c27c18e8Smrg    [Symbols that must always be exported])
5665c27c18e8Smrg_LT_TAGDECL([], [prelink_cmds], [2],
5666c27c18e8Smrg    [Commands necessary for linking programs (against libraries) with templates])
5667b789ec8aSmrg_LT_TAGDECL([], [postlink_cmds], [2],
5668b789ec8aSmrg    [Commands necessary for finishing linking programs])
5669c27c18e8Smrg_LT_TAGDECL([], [file_list_spec], [1],
5670c27c18e8Smrg    [Specify filename containing input files])
5671c27c18e8Smrgdnl FIXME: Not yet implemented
5672c27c18e8Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
5673c27c18e8Smrgdnl    [Compiler flag to generate thread safe objects])
5674c27c18e8Smrg])# _LT_LINKER_SHLIBS
5675c27c18e8Smrg
5676c27c18e8Smrg
5677c27c18e8Smrg# _LT_LANG_C_CONFIG([TAG])
5678c27c18e8Smrg# ------------------------
5679c27c18e8Smrg# Ensure that the configuration variables for a C compiler are suitably
5680c27c18e8Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
5681c27c18e8Smrg# the compiler configuration to `libtool'.
5682c27c18e8Smrgm4_defun([_LT_LANG_C_CONFIG],
5683c27c18e8Smrg[m4_require([_LT_DECL_EGREP])dnl
5684c27c18e8Smrglt_save_CC="$CC"
5685c27c18e8SmrgAC_LANG_PUSH(C)
5686c43cc173Smrg
5687c27c18e8Smrg# Source file extension for C test sources.
5688c27c18e8Smrgac_ext=c
5689c43cc173Smrg
5690c27c18e8Smrg# Object file extension for compiled C test sources.
5691c27c18e8Smrgobjext=o
5692c27c18e8Smrg_LT_TAGVAR(objext, $1)=$objext
5693c43cc173Smrg
5694c27c18e8Smrg# Code to be used in simple compile tests
5695c27c18e8Smrglt_simple_compile_test_code="int some_variable = 0;"
5696c43cc173Smrg
5697c27c18e8Smrg# Code to be used in simple link tests
5698c27c18e8Smrglt_simple_link_test_code='int main(){return(0);}'
5699c43cc173Smrg
5700c27c18e8Smrg_LT_TAG_COMPILER
5701c27c18e8Smrg# Save the default compiler, since it gets overwritten when the other
5702c27c18e8Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
5703c27c18e8Smrgcompiler_DEFAULT=$CC
5704c43cc173Smrg
5705c27c18e8Smrg# save warnings/boilerplate of simple test code
5706c27c18e8Smrg_LT_COMPILER_BOILERPLATE
5707c27c18e8Smrg_LT_LINKER_BOILERPLATE
5708c43cc173Smrg
5709c27c18e8Smrgif test -n "$compiler"; then
5710c27c18e8Smrg  _LT_COMPILER_NO_RTTI($1)
5711c27c18e8Smrg  _LT_COMPILER_PIC($1)
5712c27c18e8Smrg  _LT_COMPILER_C_O($1)
5713c27c18e8Smrg  _LT_COMPILER_FILE_LOCKS($1)
5714c27c18e8Smrg  _LT_LINKER_SHLIBS($1)
5715c27c18e8Smrg  _LT_SYS_DYNAMIC_LINKER($1)
5716c27c18e8Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
5717c27c18e8Smrg  LT_SYS_DLOPEN_SELF
5718c27c18e8Smrg  _LT_CMD_STRIPLIB
5719c27c18e8Smrg
5720c27c18e8Smrg  # Report which library types will actually be built
5721c27c18e8Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
5722c27c18e8Smrg  AC_MSG_RESULT([$can_build_shared])
5723c27c18e8Smrg
5724c27c18e8Smrg  AC_MSG_CHECKING([whether to build shared libraries])
5725c27c18e8Smrg  test "$can_build_shared" = "no" && enable_shared=no
5726c27c18e8Smrg
5727c27c18e8Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
5728c27c18e8Smrg  # are all built from PIC.
5729c27c18e8Smrg  case $host_os in
5730c27c18e8Smrg  aix3*)
5731c27c18e8Smrg    test "$enable_shared" = yes && enable_static=no
5732c27c18e8Smrg    if test -n "$RANLIB"; then
5733c27c18e8Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
5734c27c18e8Smrg      postinstall_cmds='$RANLIB $lib'
5735c27c18e8Smrg    fi
5736c27c18e8Smrg    ;;
5737c43cc173Smrg
5738c27c18e8Smrg  aix[[4-9]]*)
5739c27c18e8Smrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
5740c27c18e8Smrg      test "$enable_shared" = yes && enable_static=no
5741c27c18e8Smrg    fi
5742c27c18e8Smrg    ;;
5743c27c18e8Smrg  esac
5744c27c18e8Smrg  AC_MSG_RESULT([$enable_shared])
5745c43cc173Smrg
5746c27c18e8Smrg  AC_MSG_CHECKING([whether to build static libraries])
5747c27c18e8Smrg  # Make sure either enable_shared or enable_static is yes.
5748c27c18e8Smrg  test "$enable_shared" = yes || enable_static=yes
5749c27c18e8Smrg  AC_MSG_RESULT([$enable_static])
5750c43cc173Smrg
5751c27c18e8Smrg  _LT_CONFIG($1)
5752c27c18e8Smrgfi
5753c27c18e8SmrgAC_LANG_POP
5754c27c18e8SmrgCC="$lt_save_CC"
5755c27c18e8Smrg])# _LT_LANG_C_CONFIG
5756c43cc173Smrg
5757c43cc173Smrg
5758c27c18e8Smrg# _LT_LANG_CXX_CONFIG([TAG])
5759c27c18e8Smrg# --------------------------
5760c27c18e8Smrg# Ensure that the configuration variables for a C++ compiler are suitably
5761c27c18e8Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
5762c27c18e8Smrg# the compiler configuration to `libtool'.
5763c27c18e8Smrgm4_defun([_LT_LANG_CXX_CONFIG],
576437eb1ca1Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5765c27c18e8Smrgm4_require([_LT_DECL_EGREP])dnl
5766b789ec8aSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
576737eb1ca1Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
576837eb1ca1Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
576937eb1ca1Smrg    (test "X$CXX" != "Xg++"))) ; then
577037eb1ca1Smrg  AC_PROG_CXXCPP
577137eb1ca1Smrgelse
577237eb1ca1Smrg  _lt_caught_CXX_error=yes
577337eb1ca1Smrgfi
5774c27c18e8Smrg
5775c27c18e8SmrgAC_LANG_PUSH(C++)
5776c27c18e8Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
5777c27c18e8Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
5778c27c18e8Smrg_LT_TAGVAR(always_export_symbols, $1)=no
5779c27c18e8Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
5780c27c18e8Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
5781c27c18e8Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
5782c27c18e8Smrg_LT_TAGVAR(hardcode_direct, $1)=no
5783c27c18e8Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5784c27c18e8Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5785c27c18e8Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
5786c27c18e8Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
5787c27c18e8Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
5788c27c18e8Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5789c27c18e8Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
5790c27c18e8Smrg_LT_TAGVAR(inherit_rpath, $1)=no
5791c27c18e8Smrg_LT_TAGVAR(module_cmds, $1)=
5792c27c18e8Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
5793c27c18e8Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
5794c27c18e8Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
579537eb1ca1Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
579637eb1ca1Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
5797c27c18e8Smrg_LT_TAGVAR(no_undefined_flag, $1)=
5798c27c18e8Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
5799c27c18e8Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5800c43cc173Smrg
5801c27c18e8Smrg# Source file extension for C++ test sources.
5802c27c18e8Smrgac_ext=cpp
5803c43cc173Smrg
5804c27c18e8Smrg# Object file extension for compiled C++ test sources.
5805c27c18e8Smrgobjext=o
5806c27c18e8Smrg_LT_TAGVAR(objext, $1)=$objext
5807c27c18e8Smrg
5808c27c18e8Smrg# No sense in running all these tests if we already determined that
5809c27c18e8Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
5810c27c18e8Smrg# are currently assumed to apply to all compilers on this platform,
5811c27c18e8Smrg# and will be corrupted by setting them based on a non-working compiler.
5812c27c18e8Smrgif test "$_lt_caught_CXX_error" != yes; then
5813c27c18e8Smrg  # Code to be used in simple compile tests
5814c27c18e8Smrg  lt_simple_compile_test_code="int some_variable = 0;"
5815c27c18e8Smrg
5816c27c18e8Smrg  # Code to be used in simple link tests
5817c27c18e8Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
5818c27c18e8Smrg
5819c27c18e8Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
5820c27c18e8Smrg  _LT_TAG_COMPILER
5821c27c18e8Smrg
5822c27c18e8Smrg  # save warnings/boilerplate of simple test code
5823c27c18e8Smrg  _LT_COMPILER_BOILERPLATE
5824c27c18e8Smrg  _LT_LINKER_BOILERPLATE
5825c27c18e8Smrg
5826c27c18e8Smrg  # Allow CC to be a program name with arguments.
5827c27c18e8Smrg  lt_save_CC=$CC
5828b789ec8aSmrg  lt_save_CFLAGS=$CFLAGS
5829c27c18e8Smrg  lt_save_LD=$LD
5830c27c18e8Smrg  lt_save_GCC=$GCC
5831c27c18e8Smrg  GCC=$GXX
5832c27c18e8Smrg  lt_save_with_gnu_ld=$with_gnu_ld
5833c27c18e8Smrg  lt_save_path_LD=$lt_cv_path_LD
5834c27c18e8Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
5835c27c18e8Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
5836c27c18e8Smrg  else
5837c27c18e8Smrg    $as_unset lt_cv_prog_gnu_ld
5838c27c18e8Smrg  fi
5839c27c18e8Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
5840c27c18e8Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
5841c27c18e8Smrg  else
5842c27c18e8Smrg    $as_unset lt_cv_path_LD
5843c27c18e8Smrg  fi
5844c27c18e8Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
5845c27c18e8Smrg  CC=${CXX-"c++"}
5846b789ec8aSmrg  CFLAGS=$CXXFLAGS
5847c27c18e8Smrg  compiler=$CC
5848c27c18e8Smrg  _LT_TAGVAR(compiler, $1)=$CC
5849c27c18e8Smrg  _LT_CC_BASENAME([$compiler])
5850c43cc173Smrg
5851c27c18e8Smrg  if test -n "$compiler"; then
5852c27c18e8Smrg    # We don't want -fno-exception when compiling C++ code, so set the
5853c27c18e8Smrg    # no_builtin_flag separately
5854c27c18e8Smrg    if test "$GXX" = yes; then
5855c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
5856c27c18e8Smrg    else
5857c27c18e8Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
5858c27c18e8Smrg    fi
5859c43cc173Smrg
5860c27c18e8Smrg    if test "$GXX" = yes; then
5861c27c18e8Smrg      # Set up default GNU C++ configuration
5862c43cc173Smrg
5863c27c18e8Smrg      LT_PATH_LD
5864c43cc173Smrg
5865c27c18e8Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
5866c27c18e8Smrg      # archiving commands below assume that GNU ld is being used.
5867c27c18e8Smrg      if test "$with_gnu_ld" = yes; then
5868b789ec8aSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5869b789ec8aSmrg        _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'
5870c43cc173Smrg
5871c27c18e8Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5872c27c18e8Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5873c43cc173Smrg
5874c27c18e8Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
5875c27c18e8Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
5876c27c18e8Smrg        #     investigate it a little bit more. (MM)
5877c27c18e8Smrg        wlarc='${wl}'
5878c43cc173Smrg
5879c27c18e8Smrg        # ancient GNU ld didn't support --whole-archive et. al.
5880c27c18e8Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
5881c27c18e8Smrg	  $GREP 'no-whole-archive' > /dev/null; then
5882c27c18e8Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5883c27c18e8Smrg        else
5884c27c18e8Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
5885c27c18e8Smrg        fi
5886c27c18e8Smrg      else
5887c27c18e8Smrg        with_gnu_ld=no
5888c27c18e8Smrg        wlarc=
5889c27c18e8Smrg
5890c27c18e8Smrg        # A generic and very simple default shared library creation
5891c27c18e8Smrg        # command for GNU C++ for the case where it uses the native
5892c27c18e8Smrg        # linker, instead of GNU ld.  If possible, this setting should
5893c27c18e8Smrg        # overridden to take advantage of the native linker features on
5894c27c18e8Smrg        # the platform it is being used on.
5895c27c18e8Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
5896c27c18e8Smrg      fi
5897c43cc173Smrg
5898c27c18e8Smrg      # Commands to make compiler produce verbose output that lists
5899c27c18e8Smrg      # what "hidden" libraries, object files and flags are used when
5900c27c18e8Smrg      # linking a shared library.
590137eb1ca1Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
5902c43cc173Smrg
5903c27c18e8Smrg    else
5904c27c18e8Smrg      GXX=no
5905c27c18e8Smrg      with_gnu_ld=no
5906c27c18e8Smrg      wlarc=
5907c27c18e8Smrg    fi
5908c43cc173Smrg
5909c27c18e8Smrg    # PORTME: fill in a description of your system's C++ link characteristics
5910c27c18e8Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5911c27c18e8Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
5912c27c18e8Smrg    case $host_os in
5913c27c18e8Smrg      aix3*)
5914c27c18e8Smrg        # FIXME: insert proper C++ library support
5915c27c18e8Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
5916c27c18e8Smrg        ;;
5917c27c18e8Smrg      aix[[4-9]]*)
5918c27c18e8Smrg        if test "$host_cpu" = ia64; then
5919c27c18e8Smrg          # On IA64, the linker does run time linking by default, so we don't
5920c27c18e8Smrg          # have to do anything special.
5921c27c18e8Smrg          aix_use_runtimelinking=no
5922c27c18e8Smrg          exp_sym_flag='-Bexport'
5923c27c18e8Smrg          no_entry_flag=""
5924c27c18e8Smrg        else
5925c27c18e8Smrg          aix_use_runtimelinking=no
5926c27c18e8Smrg
5927c27c18e8Smrg          # Test if we are trying to use run time linking or normal
5928c27c18e8Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5929c27c18e8Smrg          # need to do runtime linking.
5930c27c18e8Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5931c27c18e8Smrg	    for ld_flag in $LDFLAGS; do
5932c27c18e8Smrg	      case $ld_flag in
5933c27c18e8Smrg	      *-brtl*)
5934c27c18e8Smrg	        aix_use_runtimelinking=yes
5935c27c18e8Smrg	        break
5936c27c18e8Smrg	        ;;
5937c27c18e8Smrg	      esac
5938c27c18e8Smrg	    done
5939c27c18e8Smrg	    ;;
5940c27c18e8Smrg          esac
5941c43cc173Smrg
5942c27c18e8Smrg          exp_sym_flag='-bexport'
5943c27c18e8Smrg          no_entry_flag='-bnoentry'
5944c27c18e8Smrg        fi
5945c43cc173Smrg
5946c27c18e8Smrg        # When large executables or shared objects are built, AIX ld can
5947c27c18e8Smrg        # have problems creating the table of contents.  If linking a library
5948c27c18e8Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
5949c27c18e8Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5950c27c18e8Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5951c27c18e8Smrg
5952c27c18e8Smrg        _LT_TAGVAR(archive_cmds, $1)=''
5953c27c18e8Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
5954c27c18e8Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5955c27c18e8Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5956c27c18e8Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
5957c27c18e8Smrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
5958c27c18e8Smrg
5959c27c18e8Smrg        if test "$GXX" = yes; then
5960c27c18e8Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
5961c27c18e8Smrg          # We only want to do this on AIX 4.2 and lower, the check
5962c27c18e8Smrg          # below for broken collect2 doesn't work under 4.3+
5963c27c18e8Smrg	  collect2name=`${CC} -print-prog-name=collect2`
5964c27c18e8Smrg	  if test -f "$collect2name" &&
5965c27c18e8Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5966c27c18e8Smrg	  then
5967c27c18e8Smrg	    # We have reworked collect2
5968c27c18e8Smrg	    :
5969c27c18e8Smrg	  else
5970c27c18e8Smrg	    # We have old collect2
5971c27c18e8Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
5972c27c18e8Smrg	    # It fails to find uninstalled libraries when the uninstalled
5973c27c18e8Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
5974c27c18e8Smrg	    # to unsupported forces relinking
5975c27c18e8Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
5976c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5977c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
5978c27c18e8Smrg	  fi
5979c27c18e8Smrg          esac
5980c27c18e8Smrg          shared_flag='-shared'
5981c27c18e8Smrg	  if test "$aix_use_runtimelinking" = yes; then
5982c27c18e8Smrg	    shared_flag="$shared_flag "'${wl}-G'
5983c27c18e8Smrg	  fi
5984c27c18e8Smrg        else
5985c27c18e8Smrg          # not using gcc
5986c27c18e8Smrg          if test "$host_cpu" = ia64; then
5987c27c18e8Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5988c27c18e8Smrg	  # chokes on -Wl,-G. The following line is correct:
5989c27c18e8Smrg	  shared_flag='-G'
5990c27c18e8Smrg          else
5991c27c18e8Smrg	    if test "$aix_use_runtimelinking" = yes; then
5992c27c18e8Smrg	      shared_flag='${wl}-G'
5993c27c18e8Smrg	    else
5994c27c18e8Smrg	      shared_flag='${wl}-bM:SRE'
5995c27c18e8Smrg	    fi
5996c27c18e8Smrg          fi
5997c27c18e8Smrg        fi
5998c43cc173Smrg
5999c27c18e8Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
6000c27c18e8Smrg        # It seems that -bexpall does not export symbols beginning with
6001c27c18e8Smrg        # underscore (_), so it is better to generate a list of symbols to
6002c27c18e8Smrg	# export.
6003c27c18e8Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
6004c27c18e8Smrg        if test "$aix_use_runtimelinking" = yes; then
6005c27c18e8Smrg          # Warning - without using the other runtime loading flags (-brtl),
6006c27c18e8Smrg          # -berok will link without error, but may produce a broken library.
6007c27c18e8Smrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
6008c27c18e8Smrg          # Determine the default libpath from the value encoded in an empty
6009c27c18e8Smrg          # executable.
6010b789ec8aSmrg          _LT_SYS_MODULE_PATH_AIX([$1])
6011c27c18e8Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6012c27c18e8Smrg
601337eb1ca1Smrg          _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"
6014c27c18e8Smrg        else
6015c27c18e8Smrg          if test "$host_cpu" = ia64; then
6016c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6017c27c18e8Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6018c27c18e8Smrg	    _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"
6019c27c18e8Smrg          else
6020c27c18e8Smrg	    # Determine the default libpath from the value encoded in an
6021c27c18e8Smrg	    # empty executable.
6022b789ec8aSmrg	    _LT_SYS_MODULE_PATH_AIX([$1])
6023c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6024c27c18e8Smrg	    # Warning - without using the other run time loading flags,
6025c27c18e8Smrg	    # -berok will link without error, but may produce a broken library.
6026c27c18e8Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6027c27c18e8Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
602837eb1ca1Smrg	    if test "$with_gnu_ld" = yes; then
602937eb1ca1Smrg	      # We only use this code for GNU lds that support --whole-archive.
603037eb1ca1Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
603137eb1ca1Smrg	    else
603237eb1ca1Smrg	      # Exported symbols can be pulled into shared objects from archives
603337eb1ca1Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
603437eb1ca1Smrg	    fi
6035c27c18e8Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6036c27c18e8Smrg	    # This is similar to how AIX traditionally builds its shared
6037c27c18e8Smrg	    # libraries.
6038c27c18e8Smrg	    _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'
6039c27c18e8Smrg          fi
6040c27c18e8Smrg        fi
6041c27c18e8Smrg        ;;
6042c43cc173Smrg
6043c27c18e8Smrg      beos*)
6044c27c18e8Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6045c27c18e8Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6046c27c18e8Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
6047c27c18e8Smrg	  # support --undefined.  This deserves some investigation.  FIXME
6048c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6049c27c18e8Smrg	else
6050c27c18e8Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6051c27c18e8Smrg	fi
6052c27c18e8Smrg	;;
6053c43cc173Smrg
6054c27c18e8Smrg      chorus*)
6055c27c18e8Smrg        case $cc_basename in
6056c27c18e8Smrg          *)
6057c27c18e8Smrg	  # FIXME: insert proper C++ library support
6058c27c18e8Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6059c27c18e8Smrg	  ;;
6060c27c18e8Smrg        esac
6061c27c18e8Smrg        ;;
6062c43cc173Smrg
6063c27c18e8Smrg      cygwin* | mingw* | pw32* | cegcc*)
6064b789ec8aSmrg	case $GXX,$cc_basename in
6065b789ec8aSmrg	,cl* | no,cl*)
6066b789ec8aSmrg	  # Native MSVC
6067b789ec8aSmrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
6068b789ec8aSmrg	  # no search path for DLLs.
6069b789ec8aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6070b789ec8aSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6071b789ec8aSmrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
6072b789ec8aSmrg	  _LT_TAGVAR(file_list_spec, $1)='@'
6073b789ec8aSmrg	  # Tell ltmain to make .lib files, not .a files.
6074b789ec8aSmrg	  libext=lib
6075b789ec8aSmrg	  # Tell ltmain to make .dll files, not .so files.
6076b789ec8aSmrg	  shrext_cmds=".dll"
6077b789ec8aSmrg	  # FIXME: Setting linknames here is a bad hack.
6078b789ec8aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
6079b789ec8aSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6080b789ec8aSmrg	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
6081b789ec8aSmrg	    else
6082b789ec8aSmrg	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
6083b789ec8aSmrg	    fi~
6084b789ec8aSmrg	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6085b789ec8aSmrg	    linknames='
6086b789ec8aSmrg	  # The linker will not automatically build a static lib if we build a DLL.
6087b789ec8aSmrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6088b789ec8aSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6089b789ec8aSmrg	  # Don't use ranlib
6090b789ec8aSmrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6091b789ec8aSmrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6092b789ec8aSmrg	    lt_tool_outputfile="@TOOL_OUTPUT@"~
6093b789ec8aSmrg	    case $lt_outputfile in
6094b789ec8aSmrg	      *.exe|*.EXE) ;;
6095b789ec8aSmrg	      *)
6096b789ec8aSmrg		lt_outputfile="$lt_outputfile.exe"
6097b789ec8aSmrg		lt_tool_outputfile="$lt_tool_outputfile.exe"
6098b789ec8aSmrg		;;
6099b789ec8aSmrg	    esac~
6100b789ec8aSmrg	    func_to_tool_file "$lt_outputfile"~
6101b789ec8aSmrg	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
6102b789ec8aSmrg	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6103b789ec8aSmrg	      $RM "$lt_outputfile.manifest";
6104b789ec8aSmrg	    fi'
6105b789ec8aSmrg	  ;;
6106b789ec8aSmrg	*)
6107b789ec8aSmrg	  # g++
6108b789ec8aSmrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6109b789ec8aSmrg	  # as there is no search path for DLLs.
6110b789ec8aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6111b789ec8aSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
6112b789ec8aSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6113b789ec8aSmrg	  _LT_TAGVAR(always_export_symbols, $1)=no
6114b789ec8aSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6115b789ec8aSmrg
6116b789ec8aSmrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6117b789ec8aSmrg	    _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'
6118b789ec8aSmrg	    # If the export-symbols file already is a .def file (1st line
6119b789ec8aSmrg	    # is EXPORTS), use it as is; otherwise, prepend...
6120b789ec8aSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6121b789ec8aSmrg	      cp $export_symbols $output_objdir/$soname.def;
6122b789ec8aSmrg	    else
6123b789ec8aSmrg	      echo EXPORTS > $output_objdir/$soname.def;
6124b789ec8aSmrg	      cat $export_symbols >> $output_objdir/$soname.def;
6125b789ec8aSmrg	    fi~
6126b789ec8aSmrg	    $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'
6127b789ec8aSmrg	  else
6128b789ec8aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6129b789ec8aSmrg	  fi
6130b789ec8aSmrg	  ;;
6131b789ec8aSmrg	esac
6132b789ec8aSmrg	;;
6133c27c18e8Smrg      darwin* | rhapsody*)
6134c27c18e8Smrg        _LT_DARWIN_LINKER_FEATURES($1)
6135c27c18e8Smrg	;;
6136c43cc173Smrg
6137c27c18e8Smrg      dgux*)
6138c27c18e8Smrg        case $cc_basename in
6139c27c18e8Smrg          ec++*)
6140c27c18e8Smrg	    # FIXME: insert proper C++ library support
6141c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6142c27c18e8Smrg	    ;;
6143c27c18e8Smrg          ghcx*)
6144c27c18e8Smrg	    # Green Hills C++ Compiler
6145c27c18e8Smrg	    # FIXME: insert proper C++ library support
6146c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6147c27c18e8Smrg	    ;;
6148c27c18e8Smrg          *)
6149c27c18e8Smrg	    # FIXME: insert proper C++ library support
6150c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6151c27c18e8Smrg	    ;;
6152c27c18e8Smrg        esac
6153c27c18e8Smrg        ;;
6154c27c18e8Smrg
6155c27c18e8Smrg      freebsd[[12]]*)
6156c27c18e8Smrg        # C++ shared libraries reported to be fairly broken before
6157c27c18e8Smrg	# switch to ELF
6158c27c18e8Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6159c27c18e8Smrg        ;;
6160c43cc173Smrg
6161c27c18e8Smrg      freebsd-elf*)
6162c27c18e8Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6163c27c18e8Smrg        ;;
6164c43cc173Smrg
6165c27c18e8Smrg      freebsd* | dragonfly*)
6166c27c18e8Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
6167c27c18e8Smrg        # conventions
6168c27c18e8Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
6169c27c18e8Smrg        ;;
6170c43cc173Smrg
6171c27c18e8Smrg      gnu*)
6172c27c18e8Smrg        ;;
6173c43cc173Smrg
617437eb1ca1Smrg      haiku*)
617537eb1ca1Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
617637eb1ca1Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
617737eb1ca1Smrg        ;;
617837eb1ca1Smrg
6179c27c18e8Smrg      hpux9*)
6180c27c18e8Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6181c27c18e8Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6182c27c18e8Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6183c27c18e8Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
6184c27c18e8Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6185c27c18e8Smrg				             # but as the default
6186c27c18e8Smrg				             # location of the library.
6187c27c18e8Smrg
6188c27c18e8Smrg        case $cc_basename in
6189c27c18e8Smrg          CC*)
6190c27c18e8Smrg            # FIXME: insert proper C++ library support
6191c27c18e8Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
6192c27c18e8Smrg            ;;
6193c27c18e8Smrg          aCC*)
6194c27c18e8Smrg            _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'
6195c27c18e8Smrg            # Commands to make compiler produce verbose output that lists
6196c27c18e8Smrg            # what "hidden" libraries, object files and flags are used when
6197c27c18e8Smrg            # linking a shared library.
6198c27c18e8Smrg            #
6199c27c18e8Smrg            # There doesn't appear to be a way to prevent this compiler from
6200c27c18e8Smrg            # explicitly linking system object files so we need to strip them
6201c27c18e8Smrg            # from the output so that they don't get included in the library
6202c27c18e8Smrg            # dependencies.
620337eb1ca1Smrg            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"'
6204c27c18e8Smrg            ;;
6205c27c18e8Smrg          *)
6206c27c18e8Smrg            if test "$GXX" = yes; then
6207b789ec8aSmrg              _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'
6208c27c18e8Smrg            else
6209c27c18e8Smrg              # FIXME: insert proper C++ library support
6210c27c18e8Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
6211c27c18e8Smrg            fi
6212c27c18e8Smrg            ;;
6213c27c18e8Smrg        esac
6214c27c18e8Smrg        ;;
6215c43cc173Smrg
6216c27c18e8Smrg      hpux10*|hpux11*)
6217c27c18e8Smrg        if test $with_gnu_ld = no; then
6218c27c18e8Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6219c27c18e8Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6220c27c18e8Smrg
6221c27c18e8Smrg          case $host_cpu in
6222c27c18e8Smrg            hppa*64*|ia64*)
6223c27c18e8Smrg              ;;
6224c27c18e8Smrg            *)
6225c27c18e8Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6226c27c18e8Smrg              ;;
6227c27c18e8Smrg          esac
6228c27c18e8Smrg        fi
6229c27c18e8Smrg        case $host_cpu in
6230c27c18e8Smrg          hppa*64*|ia64*)
6231c27c18e8Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
6232c27c18e8Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6233c27c18e8Smrg            ;;
6234c27c18e8Smrg          *)
6235c27c18e8Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
6236c27c18e8Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6237c27c18e8Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6238c27c18e8Smrg					         # but as the default
6239c27c18e8Smrg					         # location of the library.
6240c27c18e8Smrg            ;;
6241c27c18e8Smrg        esac
6242c27c18e8Smrg
6243c27c18e8Smrg        case $cc_basename in
6244c27c18e8Smrg          CC*)
6245c27c18e8Smrg	    # FIXME: insert proper C++ library support
6246c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6247c27c18e8Smrg	    ;;
6248c27c18e8Smrg          aCC*)
6249c27c18e8Smrg	    case $host_cpu in
6250c27c18e8Smrg	      hppa*64*)
6251c27c18e8Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6252c27c18e8Smrg	        ;;
6253c27c18e8Smrg	      ia64*)
6254c27c18e8Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6255c27c18e8Smrg	        ;;
6256c27c18e8Smrg	      *)
6257c27c18e8Smrg	        _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'
6258c27c18e8Smrg	        ;;
6259c27c18e8Smrg	    esac
6260c27c18e8Smrg	    # Commands to make compiler produce verbose output that lists
6261c27c18e8Smrg	    # what "hidden" libraries, object files and flags are used when
6262c27c18e8Smrg	    # linking a shared library.
6263c27c18e8Smrg	    #
6264c27c18e8Smrg	    # There doesn't appear to be a way to prevent this compiler from
6265c27c18e8Smrg	    # explicitly linking system object files so we need to strip them
6266c27c18e8Smrg	    # from the output so that they don't get included in the library
6267c27c18e8Smrg	    # dependencies.
626837eb1ca1Smrg	    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"'
6269c27c18e8Smrg	    ;;
6270c27c18e8Smrg          *)
6271c27c18e8Smrg	    if test "$GXX" = yes; then
6272c27c18e8Smrg	      if test $with_gnu_ld = no; then
6273c27c18e8Smrg	        case $host_cpu in
6274c27c18e8Smrg	          hppa*64*)
6275c27c18e8Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6276c27c18e8Smrg	            ;;
6277c27c18e8Smrg	          ia64*)
6278b789ec8aSmrg	            _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'
6279c27c18e8Smrg	            ;;
6280c27c18e8Smrg	          *)
6281b789ec8aSmrg	            _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'
6282c27c18e8Smrg	            ;;
6283c27c18e8Smrg	        esac
6284c27c18e8Smrg	      fi
6285c27c18e8Smrg	    else
6286c27c18e8Smrg	      # FIXME: insert proper C++ library support
6287c27c18e8Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
6288c27c18e8Smrg	    fi
6289c27c18e8Smrg	    ;;
6290c27c18e8Smrg        esac
6291c27c18e8Smrg        ;;
6292c43cc173Smrg
6293c27c18e8Smrg      interix[[3-9]]*)
6294c27c18e8Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
6295c27c18e8Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6296c27c18e8Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6297c27c18e8Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6298c27c18e8Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
6299c27c18e8Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
6300c27c18e8Smrg	# default) and relocated if they conflict, which is a slow very memory
6301c27c18e8Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
6302c27c18e8Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
6303c27c18e8Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
6304c27c18e8Smrg	_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'
6305c27c18e8Smrg	_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'
6306c27c18e8Smrg	;;
6307c27c18e8Smrg      irix5* | irix6*)
6308c27c18e8Smrg        case $cc_basename in
6309c27c18e8Smrg          CC*)
6310c27c18e8Smrg	    # SGI C++
631137eb1ca1Smrg	    _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'
6312c27c18e8Smrg
6313c27c18e8Smrg	    # Archives containing C++ object files must be created using
6314c27c18e8Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
6315c27c18e8Smrg	    # necessary to make sure instantiated templates are included
6316c27c18e8Smrg	    # in the archive.
6317c27c18e8Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
6318c27c18e8Smrg	    ;;
6319c27c18e8Smrg          *)
6320c27c18e8Smrg	    if test "$GXX" = yes; then
6321c27c18e8Smrg	      if test "$with_gnu_ld" = no; then
6322b789ec8aSmrg	        _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'
6323c27c18e8Smrg	      else
6324b789ec8aSmrg	        _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'
6325c27c18e8Smrg	      fi
6326c27c18e8Smrg	    fi
6327c27c18e8Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6328c27c18e8Smrg	    ;;
6329c27c18e8Smrg        esac
6330c27c18e8Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6331c27c18e8Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6332c27c18e8Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
6333c27c18e8Smrg        ;;
6334c43cc173Smrg
633537eb1ca1Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
6336c27c18e8Smrg        case $cc_basename in
6337c27c18e8Smrg          KCC*)
6338c27c18e8Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6339c27c18e8Smrg
6340c27c18e8Smrg	    # KCC will only create a shared library if the output file
6341c27c18e8Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6342c27c18e8Smrg	    # to its proper name (with version) after linking.
6343c27c18e8Smrg	    _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'
6344c27c18e8Smrg	    _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'
6345c27c18e8Smrg	    # Commands to make compiler produce verbose output that lists
6346c27c18e8Smrg	    # what "hidden" libraries, object files and flags are used when
6347c27c18e8Smrg	    # linking a shared library.
6348c27c18e8Smrg	    #
6349c27c18e8Smrg	    # There doesn't appear to be a way to prevent this compiler from
6350c27c18e8Smrg	    # explicitly linking system object files so we need to strip them
6351c27c18e8Smrg	    # from the output so that they don't get included in the library
6352c27c18e8Smrg	    # dependencies.
635337eb1ca1Smrg	    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"'
6354c27c18e8Smrg
6355c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6356c27c18e8Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6357c27c18e8Smrg
6358c27c18e8Smrg	    # Archives containing C++ object files must be created using
6359c27c18e8Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
6360c27c18e8Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
6361c27c18e8Smrg	    ;;
6362c27c18e8Smrg	  icpc* | ecpc* )
6363c27c18e8Smrg	    # Intel C++
6364c27c18e8Smrg	    with_gnu_ld=yes
6365c27c18e8Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
6366c27c18e8Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
6367c27c18e8Smrg	    # earlier do not add the objects themselves.
6368c27c18e8Smrg	    case `$CC -V 2>&1` in
6369c27c18e8Smrg	      *"Version 7."*)
6370c27c18e8Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6371c27c18e8Smrg		_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'
6372c27c18e8Smrg		;;
6373c27c18e8Smrg	      *)  # Version 8.0 or newer
6374c27c18e8Smrg	        tmp_idyn=
6375c27c18e8Smrg	        case $host_cpu in
6376c27c18e8Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
6377c27c18e8Smrg		esac
6378c27c18e8Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6379c27c18e8Smrg		_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'
6380c27c18e8Smrg		;;
6381c27c18e8Smrg	    esac
6382c27c18e8Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6383c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6384c27c18e8Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6385c27c18e8Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6386c27c18e8Smrg	    ;;
6387c27c18e8Smrg          pgCC* | pgcpp*)
6388c27c18e8Smrg            # Portland Group C++ compiler
6389c27c18e8Smrg	    case `$CC -V` in
639037eb1ca1Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
6391c27c18e8Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
6392c27c18e8Smrg		rm -rf $tpldir~
6393c27c18e8Smrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
639437eb1ca1Smrg		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
6395c27c18e8Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
6396c27c18e8Smrg		rm -rf $tpldir~
6397c27c18e8Smrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
639837eb1ca1Smrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
6399c27c18e8Smrg		$RANLIB $oldlib'
6400c27c18e8Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
6401c27c18e8Smrg		rm -rf $tpldir~
6402c27c18e8Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
640337eb1ca1Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
6404c27c18e8Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
6405c27c18e8Smrg		rm -rf $tpldir~
6406c27c18e8Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
640737eb1ca1Smrg		$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'
6408c27c18e8Smrg	      ;;
640937eb1ca1Smrg	    *) # Version 6 and above use weak symbols
6410c27c18e8Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
6411c27c18e8Smrg	      _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'
6412c27c18e8Smrg	      ;;
6413c27c18e8Smrg	    esac
6414c43cc173Smrg
6415c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
6416c27c18e8Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
641737eb1ca1Smrg	    _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'
6418c27c18e8Smrg            ;;
6419c27c18e8Smrg	  cxx*)
6420c27c18e8Smrg	    # Compaq C++
6421c27c18e8Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6422c27c18e8Smrg	    _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'
6423c43cc173Smrg
6424c27c18e8Smrg	    runpath_var=LD_RUN_PATH
6425c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6426c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
642721e67964Smrg
6428c27c18e8Smrg	    # Commands to make compiler produce verbose output that lists
6429c27c18e8Smrg	    # what "hidden" libraries, object files and flags are used when
6430c27c18e8Smrg	    # linking a shared library.
6431c27c18e8Smrg	    #
6432c27c18e8Smrg	    # There doesn't appear to be a way to prevent this compiler from
6433c27c18e8Smrg	    # explicitly linking system object files so we need to strip them
6434c27c18e8Smrg	    # from the output so that they don't get included in the library
6435c27c18e8Smrg	    # dependencies.
643637eb1ca1Smrg	    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'
6437c27c18e8Smrg	    ;;
643837eb1ca1Smrg	  xl* | mpixl* | bgxl*)
6439c27c18e8Smrg	    # IBM XL 8.0 on PPC, with GNU ld
6440c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6441c27c18e8Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6442c27c18e8Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6443c27c18e8Smrg	    if test "x$supports_anon_versioning" = xyes; then
6444c27c18e8Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
6445c27c18e8Smrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
6446c27c18e8Smrg		echo "local: *; };" >> $output_objdir/$libname.ver~
6447c27c18e8Smrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
6448c27c18e8Smrg	    fi
6449c27c18e8Smrg	    ;;
6450c27c18e8Smrg	  *)
6451c27c18e8Smrg	    case `$CC -V 2>&1 | sed 5q` in
6452c27c18e8Smrg	    *Sun\ C*)
6453c27c18e8Smrg	      # Sun C++ 5.9
6454c27c18e8Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6455c27c18e8Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6456c27c18e8Smrg	      _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'
6457c27c18e8Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
645837eb1ca1Smrg	      _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'
6459c27c18e8Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
6460c27c18e8Smrg
6461c27c18e8Smrg	      # Not sure whether something based on
6462c27c18e8Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
6463c27c18e8Smrg	      # would be better.
646437eb1ca1Smrg	      output_verbose_link_cmd='func_echo_all'
6465c27c18e8Smrg
6466c27c18e8Smrg	      # Archives containing C++ object files must be created using
6467c27c18e8Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
6468c27c18e8Smrg	      # necessary to make sure instantiated templates are included
6469c27c18e8Smrg	      # in the archive.
6470c27c18e8Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6471c27c18e8Smrg	      ;;
6472c27c18e8Smrg	    esac
6473c27c18e8Smrg	    ;;
6474c27c18e8Smrg	esac
6475c27c18e8Smrg	;;
6476c43cc173Smrg
6477c27c18e8Smrg      lynxos*)
6478c27c18e8Smrg        # FIXME: insert proper C++ library support
6479c27c18e8Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
6480c27c18e8Smrg	;;
6481c43cc173Smrg
6482c27c18e8Smrg      m88k*)
6483c27c18e8Smrg        # FIXME: insert proper C++ library support
6484c27c18e8Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6485c27c18e8Smrg	;;
6486c43cc173Smrg
6487c27c18e8Smrg      mvs*)
6488c27c18e8Smrg        case $cc_basename in
6489c27c18e8Smrg          cxx*)
6490c27c18e8Smrg	    # FIXME: insert proper C++ library support
6491c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6492c27c18e8Smrg	    ;;
6493c27c18e8Smrg	  *)
6494c27c18e8Smrg	    # FIXME: insert proper C++ library support
6495c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6496c27c18e8Smrg	    ;;
6497c27c18e8Smrg	esac
6498c27c18e8Smrg	;;
6499c43cc173Smrg
6500c27c18e8Smrg      netbsd*)
6501c27c18e8Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6502c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
6503c27c18e8Smrg	  wlarc=
6504c27c18e8Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6505c27c18e8Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
6506c27c18e8Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6507c27c18e8Smrg	fi
6508c27c18e8Smrg	# Workaround some broken pre-1.5 toolchains
6509c27c18e8Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
6510c27c18e8Smrg	;;
6511c43cc173Smrg
6512c27c18e8Smrg      *nto* | *qnx*)
6513c27c18e8Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
6514c27c18e8Smrg	;;
6515c43cc173Smrg
6516c27c18e8Smrg      openbsd2*)
6517c27c18e8Smrg        # C++ shared libraries are fairly broken
6518c27c18e8Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
6519c27c18e8Smrg	;;
6520c43cc173Smrg
6521c27c18e8Smrg      openbsd*)
6522c27c18e8Smrg	if test -f /usr/libexec/ld.so; then
6523c27c18e8Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
6524c27c18e8Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6525c27c18e8Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6526c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6527c27c18e8Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6528c27c18e8Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6529c27c18e8Smrg	    _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'
6530c27c18e8Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6531c27c18e8Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6532c27c18e8Smrg	  fi
653337eb1ca1Smrg	  output_verbose_link_cmd=func_echo_all
6534c27c18e8Smrg	else
6535c27c18e8Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6536c27c18e8Smrg	fi
6537c27c18e8Smrg	;;
6538c43cc173Smrg
6539c27c18e8Smrg      osf3* | osf4* | osf5*)
6540c27c18e8Smrg        case $cc_basename in
6541c27c18e8Smrg          KCC*)
6542c27c18e8Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6543c27c18e8Smrg
6544c27c18e8Smrg	    # KCC will only create a shared library if the output file
6545c27c18e8Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6546c27c18e8Smrg	    # to its proper name (with version) after linking.
6547c27c18e8Smrg	    _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'
6548c27c18e8Smrg
6549c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6550c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6551c27c18e8Smrg
6552c27c18e8Smrg	    # Archives containing C++ object files must be created using
6553c27c18e8Smrg	    # the KAI C++ compiler.
6554c27c18e8Smrg	    case $host in
6555c27c18e8Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
6556c27c18e8Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
6557c27c18e8Smrg	    esac
6558c27c18e8Smrg	    ;;
6559c27c18e8Smrg          RCC*)
6560c27c18e8Smrg	    # Rational C++ 2.4.1
6561c27c18e8Smrg	    # FIXME: insert proper C++ library support
6562c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6563c27c18e8Smrg	    ;;
6564c27c18e8Smrg          cxx*)
6565c27c18e8Smrg	    case $host in
6566c27c18e8Smrg	      osf3*)
6567c27c18e8Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
656837eb1ca1Smrg	        _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'
6569c27c18e8Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6570c27c18e8Smrg		;;
6571c27c18e8Smrg	      *)
6572c27c18e8Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
657337eb1ca1Smrg	        _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'
6574c27c18e8Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
6575c27c18e8Smrg	          echo "-hidden">> $lib.exp~
657637eb1ca1Smrg	          $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~
6577c27c18e8Smrg	          $RM $lib.exp'
6578c27c18e8Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6579c27c18e8Smrg		;;
6580c27c18e8Smrg	    esac
6581c43cc173Smrg
6582c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6583c43cc173Smrg
6584c27c18e8Smrg	    # Commands to make compiler produce verbose output that lists
6585c27c18e8Smrg	    # what "hidden" libraries, object files and flags are used when
6586c27c18e8Smrg	    # linking a shared library.
6587c27c18e8Smrg	    #
6588c27c18e8Smrg	    # There doesn't appear to be a way to prevent this compiler from
6589c27c18e8Smrg	    # explicitly linking system object files so we need to strip them
6590c27c18e8Smrg	    # from the output so that they don't get included in the library
6591c27c18e8Smrg	    # dependencies.
659237eb1ca1Smrg	    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"'
6593c27c18e8Smrg	    ;;
6594c27c18e8Smrg	  *)
6595c27c18e8Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6596c27c18e8Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6597c27c18e8Smrg	      case $host in
6598c27c18e8Smrg	        osf3*)
659937eb1ca1Smrg	          _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'
6600c27c18e8Smrg		  ;;
6601c27c18e8Smrg	        *)
6602b789ec8aSmrg	          _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'
6603c27c18e8Smrg		  ;;
6604c27c18e8Smrg	      esac
6605c27c18e8Smrg
6606c27c18e8Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6607c27c18e8Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6608c27c18e8Smrg
6609c27c18e8Smrg	      # Commands to make compiler produce verbose output that lists
6610c27c18e8Smrg	      # what "hidden" libraries, object files and flags are used when
6611c27c18e8Smrg	      # linking a shared library.
661237eb1ca1Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6613c27c18e8Smrg
6614c27c18e8Smrg	    else
6615c27c18e8Smrg	      # FIXME: insert proper C++ library support
6616c27c18e8Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
6617c27c18e8Smrg	    fi
6618c27c18e8Smrg	    ;;
6619c27c18e8Smrg        esac
6620c27c18e8Smrg        ;;
6621c43cc173Smrg
6622c27c18e8Smrg      psos*)
6623c27c18e8Smrg        # FIXME: insert proper C++ library support
6624c27c18e8Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6625c27c18e8Smrg        ;;
6626c43cc173Smrg
6627c27c18e8Smrg      sunos4*)
6628c27c18e8Smrg        case $cc_basename in
6629c27c18e8Smrg          CC*)
6630c27c18e8Smrg	    # Sun C++ 4.x
6631c27c18e8Smrg	    # FIXME: insert proper C++ library support
6632c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6633c27c18e8Smrg	    ;;
6634c27c18e8Smrg          lcc*)
6635c27c18e8Smrg	    # Lucid
6636c27c18e8Smrg	    # FIXME: insert proper C++ library support
6637c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6638c27c18e8Smrg	    ;;
6639c27c18e8Smrg          *)
6640c27c18e8Smrg	    # FIXME: insert proper C++ library support
6641c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6642c27c18e8Smrg	    ;;
6643c27c18e8Smrg        esac
6644c27c18e8Smrg        ;;
6645c43cc173Smrg
6646c27c18e8Smrg      solaris*)
6647c27c18e8Smrg        case $cc_basename in
664837eb1ca1Smrg          CC* | sunCC*)
6649c27c18e8Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
6650c27c18e8Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
6651c27c18e8Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6652c27c18e8Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6653c27c18e8Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6654c27c18e8Smrg	      $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'
6655c27c18e8Smrg
6656c27c18e8Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6657c27c18e8Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6658c27c18e8Smrg	    case $host_os in
6659c27c18e8Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6660c27c18e8Smrg	      *)
6661c27c18e8Smrg		# The compiler driver will combine and reorder linker options,
6662c27c18e8Smrg		# but understands `-z linker_flag'.
6663c27c18e8Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
6664c27c18e8Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6665c27c18e8Smrg	        ;;
6666c27c18e8Smrg	    esac
6667c27c18e8Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6668c43cc173Smrg
666937eb1ca1Smrg	    output_verbose_link_cmd='func_echo_all'
6670c43cc173Smrg
6671c27c18e8Smrg	    # Archives containing C++ object files must be created using
6672c27c18e8Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
6673c27c18e8Smrg	    # necessary to make sure instantiated templates are included
6674c27c18e8Smrg	    # in the archive.
6675c27c18e8Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6676c27c18e8Smrg	    ;;
6677c27c18e8Smrg          gcx*)
6678c27c18e8Smrg	    # Green Hills C++ Compiler
6679c27c18e8Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6680c43cc173Smrg
6681c27c18e8Smrg	    # The C++ compiler must be used to create the archive.
6682c27c18e8Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
6683c27c18e8Smrg	    ;;
6684c27c18e8Smrg          *)
6685c27c18e8Smrg	    # GNU C++ compiler with Solaris linker
6686c27c18e8Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6687c27c18e8Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
6688c27c18e8Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
6689b789ec8aSmrg	        _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'
6690c27c18e8Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6691b789ec8aSmrg		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6692c27c18e8Smrg
6693c27c18e8Smrg	        # Commands to make compiler produce verbose output that lists
6694c27c18e8Smrg	        # what "hidden" libraries, object files and flags are used when
6695c27c18e8Smrg	        # linking a shared library.
669637eb1ca1Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6697c27c18e8Smrg	      else
6698c27c18e8Smrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
6699c27c18e8Smrg	        # platform.
6700c27c18e8Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6701c27c18e8Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6702c27c18e8Smrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6703c27c18e8Smrg
6704c27c18e8Smrg	        # Commands to make compiler produce verbose output that lists
6705c27c18e8Smrg	        # what "hidden" libraries, object files and flags are used when
6706c27c18e8Smrg	        # linking a shared library.
670737eb1ca1Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6708c27c18e8Smrg	      fi
6709c27c18e8Smrg
6710c27c18e8Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
6711c27c18e8Smrg	      case $host_os in
6712c27c18e8Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6713c27c18e8Smrg		*)
6714c27c18e8Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6715c27c18e8Smrg		  ;;
6716c27c18e8Smrg	      esac
6717c27c18e8Smrg	    fi
6718c27c18e8Smrg	    ;;
6719c27c18e8Smrg        esac
6720c27c18e8Smrg        ;;
6721c43cc173Smrg
6722c27c18e8Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6723c27c18e8Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6724c27c18e8Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6725c27c18e8Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6726c27c18e8Smrg      runpath_var='LD_RUN_PATH'
6727c43cc173Smrg
6728c27c18e8Smrg      case $cc_basename in
6729c27c18e8Smrg        CC*)
6730c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6731c27c18e8Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6732c27c18e8Smrg	  ;;
6733c27c18e8Smrg	*)
6734c27c18e8Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6735c27c18e8Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6736c27c18e8Smrg	  ;;
6737c27c18e8Smrg      esac
6738c27c18e8Smrg      ;;
6739c43cc173Smrg
6740c27c18e8Smrg      sysv5* | sco3.2v5* | sco5v6*)
6741c27c18e8Smrg	# Note: We can NOT use -z defs as we might desire, because we do not
6742c27c18e8Smrg	# link with -lc, and that would cause any symbols used from libc to
6743c27c18e8Smrg	# always be unresolved, which means just about no library would
6744c27c18e8Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
6745c27c18e8Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
6746c27c18e8Smrg	# as -z defs.
6747c27c18e8Smrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6748c27c18e8Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6749c27c18e8Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6750c27c18e8Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6751c27c18e8Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6752c27c18e8Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6753c27c18e8Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
6754c27c18e8Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6755c27c18e8Smrg	runpath_var='LD_RUN_PATH'
6756c43cc173Smrg
6757c27c18e8Smrg	case $cc_basename in
6758c27c18e8Smrg          CC*)
6759c27c18e8Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6760c27c18e8Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
676137eb1ca1Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
676237eb1ca1Smrg	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
676337eb1ca1Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
676437eb1ca1Smrg	      '"$_LT_TAGVAR(reload_cmds, $1)"
6765c27c18e8Smrg	    ;;
6766c27c18e8Smrg	  *)
6767c27c18e8Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6768c27c18e8Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6769c27c18e8Smrg	    ;;
6770c27c18e8Smrg	esac
6771c27c18e8Smrg      ;;
6772c43cc173Smrg
6773c27c18e8Smrg      tandem*)
6774c27c18e8Smrg        case $cc_basename in
6775c27c18e8Smrg          NCC*)
6776c27c18e8Smrg	    # NonStop-UX NCC 3.20
6777c27c18e8Smrg	    # FIXME: insert proper C++ library support
6778c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6779c27c18e8Smrg	    ;;
6780c27c18e8Smrg          *)
6781c27c18e8Smrg	    # FIXME: insert proper C++ library support
6782c27c18e8Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6783c27c18e8Smrg	    ;;
6784c27c18e8Smrg        esac
6785c27c18e8Smrg        ;;
6786c43cc173Smrg
6787c27c18e8Smrg      vxworks*)
6788c27c18e8Smrg        # FIXME: insert proper C++ library support
6789c27c18e8Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6790c27c18e8Smrg        ;;
6791c43cc173Smrg
6792c27c18e8Smrg      *)
6793c27c18e8Smrg        # FIXME: insert proper C++ library support
6794c27c18e8Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6795c27c18e8Smrg        ;;
6796c27c18e8Smrg    esac
6797c43cc173Smrg
6798c27c18e8Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6799c27c18e8Smrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6800c27c18e8Smrg
6801c27c18e8Smrg    _LT_TAGVAR(GCC, $1)="$GXX"
6802c27c18e8Smrg    _LT_TAGVAR(LD, $1)="$LD"
6803c27c18e8Smrg
6804c27c18e8Smrg    ## CAVEAT EMPTOR:
6805c27c18e8Smrg    ## There is no encapsulation within the following macros, do not change
6806c27c18e8Smrg    ## the running order or otherwise move them around unless you know exactly
6807c27c18e8Smrg    ## what you are doing...
6808c27c18e8Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
6809c27c18e8Smrg    _LT_COMPILER_PIC($1)
6810c27c18e8Smrg    _LT_COMPILER_C_O($1)
6811c27c18e8Smrg    _LT_COMPILER_FILE_LOCKS($1)
6812c27c18e8Smrg    _LT_LINKER_SHLIBS($1)
6813c27c18e8Smrg    _LT_SYS_DYNAMIC_LINKER($1)
6814c27c18e8Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
6815c27c18e8Smrg
6816c27c18e8Smrg    _LT_CONFIG($1)
6817c27c18e8Smrg  fi # test -n "$compiler"
6818c27c18e8Smrg
6819c27c18e8Smrg  CC=$lt_save_CC
6820b789ec8aSmrg  CFLAGS=$lt_save_CFLAGS
6821c27c18e8Smrg  LDCXX=$LD
6822c27c18e8Smrg  LD=$lt_save_LD
6823c27c18e8Smrg  GCC=$lt_save_GCC
6824c27c18e8Smrg  with_gnu_ld=$lt_save_with_gnu_ld
6825c27c18e8Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
6826c27c18e8Smrg  lt_cv_path_LD=$lt_save_path_LD
6827c27c18e8Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
6828c27c18e8Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
6829c27c18e8Smrgfi # test "$_lt_caught_CXX_error" != yes
6830c43cc173Smrg
6831c27c18e8SmrgAC_LANG_POP
6832c27c18e8Smrg])# _LT_LANG_CXX_CONFIG
6833c43cc173Smrg
6834c43cc173Smrg
6835b789ec8aSmrg# _LT_FUNC_STRIPNAME_CNF
6836b789ec8aSmrg# ----------------------
6837b789ec8aSmrg# func_stripname_cnf prefix suffix name
6838b789ec8aSmrg# strip PREFIX and SUFFIX off of NAME.
6839b789ec8aSmrg# PREFIX and SUFFIX must not contain globbing or regex special
6840b789ec8aSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
6841b789ec8aSmrg# dot (in which case that matches only a dot).
6842b789ec8aSmrg#
6843b789ec8aSmrg# This function is identical to the (non-XSI) version of func_stripname,
6844b789ec8aSmrg# except this one can be used by m4 code that may be executed by configure,
6845b789ec8aSmrg# rather than the libtool script.
6846b789ec8aSmrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
6847b789ec8aSmrgAC_REQUIRE([_LT_DECL_SED])
6848b789ec8aSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
6849b789ec8aSmrgfunc_stripname_cnf ()
6850b789ec8aSmrg{
6851b789ec8aSmrg  case ${2} in
6852b789ec8aSmrg  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
6853b789ec8aSmrg  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
6854b789ec8aSmrg  esac
6855b789ec8aSmrg} # func_stripname_cnf
6856b789ec8aSmrg])# _LT_FUNC_STRIPNAME_CNF
6857b789ec8aSmrg
6858c27c18e8Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
6859c27c18e8Smrg# ---------------------------------
6860c27c18e8Smrg# Figure out "hidden" library dependencies from verbose
6861c27c18e8Smrg# compiler output when linking a shared library.
6862c27c18e8Smrg# Parse the compiler output and extract the necessary
6863c27c18e8Smrg# objects, libraries and library flags.
6864c27c18e8Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
6865c27c18e8Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6866b789ec8aSmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
6867c27c18e8Smrg# Dependencies to place before and after the object being linked:
6868c27c18e8Smrg_LT_TAGVAR(predep_objects, $1)=
6869c27c18e8Smrg_LT_TAGVAR(postdep_objects, $1)=
6870c27c18e8Smrg_LT_TAGVAR(predeps, $1)=
6871c27c18e8Smrg_LT_TAGVAR(postdeps, $1)=
6872c27c18e8Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
6873c43cc173Smrg
6874c27c18e8Smrgdnl we can't use the lt_simple_compile_test_code here,
6875c27c18e8Smrgdnl because it contains code intended for an executable,
6876c27c18e8Smrgdnl not a library.  It's possible we should let each
6877c27c18e8Smrgdnl tag define a new lt_????_link_test_code variable,
6878c27c18e8Smrgdnl but it's only used here...
6879c27c18e8Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
6880c27c18e8Smrgint a;
6881c27c18e8Smrgvoid foo (void) { a = 0; }
6882c27c18e8Smrg_LT_EOF
6883c27c18e8Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
6884c27c18e8Smrgclass Foo
6885c27c18e8Smrg{
6886c27c18e8Smrgpublic:
6887c27c18e8Smrg  Foo (void) { a = 0; }
6888c27c18e8Smrgprivate:
6889c27c18e8Smrg  int a;
6890c27c18e8Smrg};
6891c27c18e8Smrg_LT_EOF
6892c27c18e8Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
6893c27c18e8Smrg      subroutine foo
6894c27c18e8Smrg      implicit none
6895c27c18e8Smrg      integer*4 a
6896c27c18e8Smrg      a=0
6897c27c18e8Smrg      return
6898c27c18e8Smrg      end
6899c27c18e8Smrg_LT_EOF
6900c27c18e8Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
6901c27c18e8Smrg      subroutine foo
6902c27c18e8Smrg      implicit none
6903c27c18e8Smrg      integer a
6904c27c18e8Smrg      a=0
6905c27c18e8Smrg      return
6906c27c18e8Smrg      end
6907c27c18e8Smrg_LT_EOF
6908c27c18e8Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
6909c27c18e8Smrgpublic class foo {
6910c27c18e8Smrg  private int a;
6911c27c18e8Smrg  public void bar (void) {
6912c27c18e8Smrg    a = 0;
6913c27c18e8Smrg  }
6914c27c18e8Smrg};
6915c27c18e8Smrg_LT_EOF
6916c27c18e8Smrg])
6917b789ec8aSmrg
6918b789ec8aSmrg_lt_libdeps_save_CFLAGS=$CFLAGS
6919b789ec8aSmrgcase "$CC $CFLAGS " in #(
6920b789ec8aSmrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
6921b789ec8aSmrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
6922b789ec8aSmrgesac
6923b789ec8aSmrg
6924c27c18e8Smrgdnl Parse the compiler output and extract the necessary
6925c27c18e8Smrgdnl objects, libraries and library flags.
6926c27c18e8Smrgif AC_TRY_EVAL(ac_compile); then
6927c27c18e8Smrg  # Parse the compiler output and extract the necessary
6928c27c18e8Smrg  # objects, libraries and library flags.
6929c43cc173Smrg
6930c27c18e8Smrg  # Sentinel used to keep track of whether or not we are before
6931c27c18e8Smrg  # the conftest object file.
6932c27c18e8Smrg  pre_test_object_deps_done=no
6933c43cc173Smrg
6934c27c18e8Smrg  for p in `eval "$output_verbose_link_cmd"`; do
6935b789ec8aSmrg    case ${prev}${p} in
6936c43cc173Smrg
6937c27c18e8Smrg    -L* | -R* | -l*)
6938c27c18e8Smrg       # Some compilers place space between "-{L,R}" and the path.
6939c27c18e8Smrg       # Remove the space.
6940c27c18e8Smrg       if test $p = "-L" ||
6941c27c18e8Smrg          test $p = "-R"; then
6942c27c18e8Smrg	 prev=$p
6943c27c18e8Smrg	 continue
6944c27c18e8Smrg       fi
6945c43cc173Smrg
6946b789ec8aSmrg       # Expand the sysroot to ease extracting the directories later.
6947b789ec8aSmrg       if test -z "$prev"; then
6948b789ec8aSmrg         case $p in
6949b789ec8aSmrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
6950b789ec8aSmrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
6951b789ec8aSmrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
6952b789ec8aSmrg         esac
6953b789ec8aSmrg       fi
6954b789ec8aSmrg       case $p in
6955b789ec8aSmrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
6956b789ec8aSmrg       esac
6957c27c18e8Smrg       if test "$pre_test_object_deps_done" = no; then
6958b789ec8aSmrg	 case ${prev} in
6959b789ec8aSmrg	 -L | -R)
6960c27c18e8Smrg	   # Internal compiler library paths should come after those
6961c27c18e8Smrg	   # provided the user.  The postdeps already come after the
6962c27c18e8Smrg	   # user supplied libs so there is no need to process them.
6963c27c18e8Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
6964c27c18e8Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
6965c27c18e8Smrg	   else
6966c27c18e8Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
6967c27c18e8Smrg	   fi
6968c27c18e8Smrg	   ;;
6969c27c18e8Smrg	 # The "-l" case would never come before the object being
6970c27c18e8Smrg	 # linked, so don't bother handling this case.
6971c27c18e8Smrg	 esac
6972c27c18e8Smrg       else
6973c27c18e8Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
6974c27c18e8Smrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
6975c27c18e8Smrg	 else
6976c27c18e8Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
6977c27c18e8Smrg	 fi
6978c27c18e8Smrg       fi
6979b789ec8aSmrg       prev=
6980c27c18e8Smrg       ;;
6981c43cc173Smrg
6982b789ec8aSmrg    *.lto.$objext) ;; # Ignore GCC LTO objects
6983c27c18e8Smrg    *.$objext)
6984c27c18e8Smrg       # This assumes that the test object file only shows up
6985c27c18e8Smrg       # once in the compiler output.
6986c27c18e8Smrg       if test "$p" = "conftest.$objext"; then
6987c27c18e8Smrg	 pre_test_object_deps_done=yes
6988c27c18e8Smrg	 continue
6989c27c18e8Smrg       fi
6990c43cc173Smrg
6991c27c18e8Smrg       if test "$pre_test_object_deps_done" = no; then
6992c27c18e8Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
6993c27c18e8Smrg	   _LT_TAGVAR(predep_objects, $1)="$p"
6994c27c18e8Smrg	 else
6995c27c18e8Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
6996c27c18e8Smrg	 fi
6997c27c18e8Smrg       else
6998c27c18e8Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
6999c27c18e8Smrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
7000c27c18e8Smrg	 else
7001c27c18e8Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
7002c27c18e8Smrg	 fi
7003c27c18e8Smrg       fi
7004c27c18e8Smrg       ;;
7005c43cc173Smrg
7006c27c18e8Smrg    *) ;; # Ignore the rest.
7007c43cc173Smrg
7008c27c18e8Smrg    esac
7009c27c18e8Smrg  done
7010c43cc173Smrg
7011c27c18e8Smrg  # Clean up.
7012c27c18e8Smrg  rm -f a.out a.exe
7013c43cc173Smrgelse
7014c27c18e8Smrg  echo "libtool.m4: error: problem compiling $1 test program"
7015c43cc173Smrgfi
7016c43cc173Smrg
7017c27c18e8Smrg$RM -f confest.$objext
7018b789ec8aSmrgCFLAGS=$_lt_libdeps_save_CFLAGS
7019c43cc173Smrg
7020c27c18e8Smrg# PORTME: override above test on systems where it is broken
7021c27c18e8Smrgm4_if([$1], [CXX],
7022c27c18e8Smrg[case $host_os in
7023c27c18e8Smrginterix[[3-9]]*)
7024c27c18e8Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
7025c27c18e8Smrg  # hack all around it, let's just trust "g++" to DTRT.
7026c27c18e8Smrg  _LT_TAGVAR(predep_objects,$1)=
7027c27c18e8Smrg  _LT_TAGVAR(postdep_objects,$1)=
7028c27c18e8Smrg  _LT_TAGVAR(postdeps,$1)=
7029c27c18e8Smrg  ;;
7030c43cc173Smrg
7031c27c18e8Smrglinux*)
7032c27c18e8Smrg  case `$CC -V 2>&1 | sed 5q` in
7033c27c18e8Smrg  *Sun\ C*)
7034c27c18e8Smrg    # Sun C++ 5.9
7035c43cc173Smrg
7036c27c18e8Smrg    # The more standards-conforming stlport4 library is
7037c27c18e8Smrg    # incompatible with the Cstd library. Avoid specifying
7038c27c18e8Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
7039c27c18e8Smrg    # -library=stlport4 depends on it.
7040c27c18e8Smrg    case " $CXX $CXXFLAGS " in
7041c27c18e8Smrg    *" -library=stlport4 "*)
7042c27c18e8Smrg      solaris_use_stlport4=yes
7043c27c18e8Smrg      ;;
7044c27c18e8Smrg    esac
7045c43cc173Smrg
7046c27c18e8Smrg    if test "$solaris_use_stlport4" != yes; then
7047c27c18e8Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7048c27c18e8Smrg    fi
7049c27c18e8Smrg    ;;
7050c27c18e8Smrg  esac
7051c27c18e8Smrg  ;;
7052c27c18e8Smrg
7053c27c18e8Smrgsolaris*)
7054c27c18e8Smrg  case $cc_basename in
705537eb1ca1Smrg  CC* | sunCC*)
7056c27c18e8Smrg    # The more standards-conforming stlport4 library is
7057c27c18e8Smrg    # incompatible with the Cstd library. Avoid specifying
7058c27c18e8Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
7059c27c18e8Smrg    # -library=stlport4 depends on it.
7060c27c18e8Smrg    case " $CXX $CXXFLAGS " in
7061c27c18e8Smrg    *" -library=stlport4 "*)
7062c27c18e8Smrg      solaris_use_stlport4=yes
7063c27c18e8Smrg      ;;
7064c27c18e8Smrg    esac
7065c43cc173Smrg
7066c27c18e8Smrg    # Adding this requires a known-good setup of shared libraries for
7067c27c18e8Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
7068c27c18e8Smrg    # archive will be linked into the output, leading to subtle bugs.
7069c27c18e8Smrg    if test "$solaris_use_stlport4" != yes; then
7070c27c18e8Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7071c27c18e8Smrg    fi
7072c27c18e8Smrg    ;;
7073c27c18e8Smrg  esac
7074c27c18e8Smrg  ;;
7075c27c18e8Smrgesac
7076c27c18e8Smrg])
7077c43cc173Smrg
7078c27c18e8Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
7079c27c18e8Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
7080c27c18e8Smrgesac
7081c27c18e8Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
7082c27c18e8Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
7083c27c18e8Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
7084c27c18e8Smrgfi
7085c27c18e8Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
7086c27c18e8Smrg    [The directories searched by this compiler when creating a shared library])
7087c27c18e8Smrg_LT_TAGDECL([], [predep_objects], [1],
7088c27c18e8Smrg    [Dependencies to place before and after the objects being linked to
7089c27c18e8Smrg    create a shared library])
7090c27c18e8Smrg_LT_TAGDECL([], [postdep_objects], [1])
7091c27c18e8Smrg_LT_TAGDECL([], [predeps], [1])
7092c27c18e8Smrg_LT_TAGDECL([], [postdeps], [1])
7093c27c18e8Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
7094c27c18e8Smrg    [The library search path used internally by the compiler when linking
7095c27c18e8Smrg    a shared library])
7096c27c18e8Smrg])# _LT_SYS_HIDDEN_LIBDEPS
7097c27c18e8Smrg
7098c27c18e8Smrg
7099c27c18e8Smrg# _LT_LANG_F77_CONFIG([TAG])
7100c27c18e8Smrg# --------------------------
7101c27c18e8Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
7102c27c18e8Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7103c27c18e8Smrg# to write the compiler configuration to `libtool'.
7104c27c18e8Smrgm4_defun([_LT_LANG_F77_CONFIG],
710537eb1ca1Smrg[AC_LANG_PUSH(Fortran 77)
710637eb1ca1Smrgif test -z "$F77" || test "X$F77" = "Xno"; then
710737eb1ca1Smrg  _lt_disable_F77=yes
710837eb1ca1Smrgfi
7109c43cc173Smrg
7110c27c18e8Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7111c27c18e8Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
7112c27c18e8Smrg_LT_TAGVAR(always_export_symbols, $1)=no
7113c27c18e8Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
7114c27c18e8Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7115c27c18e8Smrg_LT_TAGVAR(hardcode_direct, $1)=no
7116c27c18e8Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7117c27c18e8Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7118c27c18e8Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
7119c27c18e8Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
7120c27c18e8Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
7121c27c18e8Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
7122c27c18e8Smrg_LT_TAGVAR(inherit_rpath, $1)=no
7123c27c18e8Smrg_LT_TAGVAR(module_cmds, $1)=
7124c27c18e8Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
7125c27c18e8Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
7126c27c18e8Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
712737eb1ca1Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
712837eb1ca1Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7129c27c18e8Smrg_LT_TAGVAR(no_undefined_flag, $1)=
7130c27c18e8Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
7131c27c18e8Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7132c43cc173Smrg
7133c27c18e8Smrg# Source file extension for f77 test sources.
7134c27c18e8Smrgac_ext=f
7135c43cc173Smrg
7136c27c18e8Smrg# Object file extension for compiled f77 test sources.
7137c27c18e8Smrgobjext=o
7138c27c18e8Smrg_LT_TAGVAR(objext, $1)=$objext
7139c27c18e8Smrg
7140c27c18e8Smrg# No sense in running all these tests if we already determined that
7141c27c18e8Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
7142c27c18e8Smrg# are currently assumed to apply to all compilers on this platform,
7143c27c18e8Smrg# and will be corrupted by setting them based on a non-working compiler.
7144c27c18e8Smrgif test "$_lt_disable_F77" != yes; then
7145c27c18e8Smrg  # Code to be used in simple compile tests
7146c27c18e8Smrg  lt_simple_compile_test_code="\
7147c27c18e8Smrg      subroutine t
7148c27c18e8Smrg      return
7149c27c18e8Smrg      end
7150c27c18e8Smrg"
7151c43cc173Smrg
7152c27c18e8Smrg  # Code to be used in simple link tests
7153c27c18e8Smrg  lt_simple_link_test_code="\
7154c27c18e8Smrg      program t
7155c27c18e8Smrg      end
7156c27c18e8Smrg"
7157c43cc173Smrg
7158c27c18e8Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7159c27c18e8Smrg  _LT_TAG_COMPILER
7160c43cc173Smrg
7161c27c18e8Smrg  # save warnings/boilerplate of simple test code
7162c27c18e8Smrg  _LT_COMPILER_BOILERPLATE
7163c27c18e8Smrg  _LT_LINKER_BOILERPLATE
7164c43cc173Smrg
7165c27c18e8Smrg  # Allow CC to be a program name with arguments.
7166c27c18e8Smrg  lt_save_CC="$CC"
7167c27c18e8Smrg  lt_save_GCC=$GCC
7168b789ec8aSmrg  lt_save_CFLAGS=$CFLAGS
7169c27c18e8Smrg  CC=${F77-"f77"}
7170b789ec8aSmrg  CFLAGS=$FFLAGS
7171c27c18e8Smrg  compiler=$CC
7172c27c18e8Smrg  _LT_TAGVAR(compiler, $1)=$CC
7173c27c18e8Smrg  _LT_CC_BASENAME([$compiler])
7174c27c18e8Smrg  GCC=$G77
7175c27c18e8Smrg  if test -n "$compiler"; then
7176c27c18e8Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
7177c27c18e8Smrg    AC_MSG_RESULT([$can_build_shared])
7178c43cc173Smrg
7179c27c18e8Smrg    AC_MSG_CHECKING([whether to build shared libraries])
7180c27c18e8Smrg    test "$can_build_shared" = "no" && enable_shared=no
7181c43cc173Smrg
7182c27c18e8Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
7183c27c18e8Smrg    # are all built from PIC.
7184c27c18e8Smrg    case $host_os in
7185c27c18e8Smrg      aix3*)
7186c27c18e8Smrg        test "$enable_shared" = yes && enable_static=no
7187c27c18e8Smrg        if test -n "$RANLIB"; then
7188c27c18e8Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7189c27c18e8Smrg          postinstall_cmds='$RANLIB $lib'
7190c27c18e8Smrg        fi
7191c27c18e8Smrg        ;;
7192c27c18e8Smrg      aix[[4-9]]*)
7193c27c18e8Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7194c27c18e8Smrg	  test "$enable_shared" = yes && enable_static=no
7195c27c18e8Smrg	fi
7196c27c18e8Smrg        ;;
7197c27c18e8Smrg    esac
7198c27c18e8Smrg    AC_MSG_RESULT([$enable_shared])
7199c27c18e8Smrg
7200c27c18e8Smrg    AC_MSG_CHECKING([whether to build static libraries])
7201c27c18e8Smrg    # Make sure either enable_shared or enable_static is yes.
7202c27c18e8Smrg    test "$enable_shared" = yes || enable_static=yes
7203c27c18e8Smrg    AC_MSG_RESULT([$enable_static])
7204c27c18e8Smrg
7205c27c18e8Smrg    _LT_TAGVAR(GCC, $1)="$G77"
7206c27c18e8Smrg    _LT_TAGVAR(LD, $1)="$LD"
7207c27c18e8Smrg
7208c27c18e8Smrg    ## CAVEAT EMPTOR:
7209c27c18e8Smrg    ## There is no encapsulation within the following macros, do not change
7210c27c18e8Smrg    ## the running order or otherwise move them around unless you know exactly
7211c27c18e8Smrg    ## what you are doing...
7212c27c18e8Smrg    _LT_COMPILER_PIC($1)
7213c27c18e8Smrg    _LT_COMPILER_C_O($1)
7214c27c18e8Smrg    _LT_COMPILER_FILE_LOCKS($1)
7215c27c18e8Smrg    _LT_LINKER_SHLIBS($1)
7216c27c18e8Smrg    _LT_SYS_DYNAMIC_LINKER($1)
7217c27c18e8Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7218c27c18e8Smrg
7219c27c18e8Smrg    _LT_CONFIG($1)
7220c27c18e8Smrg  fi # test -n "$compiler"
7221c27c18e8Smrg
7222c27c18e8Smrg  GCC=$lt_save_GCC
7223c27c18e8Smrg  CC="$lt_save_CC"
7224b789ec8aSmrg  CFLAGS="$lt_save_CFLAGS"
7225c27c18e8Smrgfi # test "$_lt_disable_F77" != yes
7226c43cc173Smrg
7227c27c18e8SmrgAC_LANG_POP
7228c27c18e8Smrg])# _LT_LANG_F77_CONFIG
7229c43cc173Smrg
7230c43cc173Smrg
7231c27c18e8Smrg# _LT_LANG_FC_CONFIG([TAG])
7232c27c18e8Smrg# -------------------------
7233c27c18e8Smrg# Ensure that the configuration variables for a Fortran compiler are
7234c27c18e8Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7235c27c18e8Smrg# to write the compiler configuration to `libtool'.
7236c27c18e8Smrgm4_defun([_LT_LANG_FC_CONFIG],
723737eb1ca1Smrg[AC_LANG_PUSH(Fortran)
723837eb1ca1Smrg
723937eb1ca1Smrgif test -z "$FC" || test "X$FC" = "Xno"; then
724037eb1ca1Smrg  _lt_disable_FC=yes
724137eb1ca1Smrgfi
7242c27c18e8Smrg
7243c27c18e8Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7244c27c18e8Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
7245c27c18e8Smrg_LT_TAGVAR(always_export_symbols, $1)=no
7246c27c18e8Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
7247c27c18e8Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7248c27c18e8Smrg_LT_TAGVAR(hardcode_direct, $1)=no
7249c27c18e8Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7250c27c18e8Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7251c27c18e8Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
7252c27c18e8Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
7253c27c18e8Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
7254c27c18e8Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
7255c27c18e8Smrg_LT_TAGVAR(inherit_rpath, $1)=no
7256c27c18e8Smrg_LT_TAGVAR(module_cmds, $1)=
7257c27c18e8Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
7258c27c18e8Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
7259c27c18e8Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
726037eb1ca1Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
726137eb1ca1Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7262c27c18e8Smrg_LT_TAGVAR(no_undefined_flag, $1)=
7263c27c18e8Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
7264c27c18e8Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7265c27c18e8Smrg
7266c27c18e8Smrg# Source file extension for fc test sources.
7267c27c18e8Smrgac_ext=${ac_fc_srcext-f}
7268c27c18e8Smrg
7269c27c18e8Smrg# Object file extension for compiled fc test sources.
7270c27c18e8Smrgobjext=o
7271c27c18e8Smrg_LT_TAGVAR(objext, $1)=$objext
7272c27c18e8Smrg
7273c27c18e8Smrg# No sense in running all these tests if we already determined that
7274c27c18e8Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
7275c27c18e8Smrg# are currently assumed to apply to all compilers on this platform,
7276c27c18e8Smrg# and will be corrupted by setting them based on a non-working compiler.
7277c27c18e8Smrgif test "$_lt_disable_FC" != yes; then
7278c27c18e8Smrg  # Code to be used in simple compile tests
7279c27c18e8Smrg  lt_simple_compile_test_code="\
7280c27c18e8Smrg      subroutine t
7281c27c18e8Smrg      return
7282c27c18e8Smrg      end
7283c27c18e8Smrg"
7284c43cc173Smrg
7285c27c18e8Smrg  # Code to be used in simple link tests
7286c27c18e8Smrg  lt_simple_link_test_code="\
7287c27c18e8Smrg      program t
7288c27c18e8Smrg      end
7289c27c18e8Smrg"
7290c43cc173Smrg
7291c27c18e8Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7292c27c18e8Smrg  _LT_TAG_COMPILER
7293c43cc173Smrg
7294c27c18e8Smrg  # save warnings/boilerplate of simple test code
7295c27c18e8Smrg  _LT_COMPILER_BOILERPLATE
7296c27c18e8Smrg  _LT_LINKER_BOILERPLATE
7297c43cc173Smrg
7298c27c18e8Smrg  # Allow CC to be a program name with arguments.
7299c27c18e8Smrg  lt_save_CC="$CC"
7300c27c18e8Smrg  lt_save_GCC=$GCC
7301b789ec8aSmrg  lt_save_CFLAGS=$CFLAGS
7302c27c18e8Smrg  CC=${FC-"f95"}
7303b789ec8aSmrg  CFLAGS=$FCFLAGS
7304c27c18e8Smrg  compiler=$CC
7305c27c18e8Smrg  GCC=$ac_cv_fc_compiler_gnu
7306c43cc173Smrg
7307c27c18e8Smrg  _LT_TAGVAR(compiler, $1)=$CC
7308c27c18e8Smrg  _LT_CC_BASENAME([$compiler])
7309c27c18e8Smrg
7310c27c18e8Smrg  if test -n "$compiler"; then
7311c27c18e8Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
7312c27c18e8Smrg    AC_MSG_RESULT([$can_build_shared])
7313c27c18e8Smrg
7314c27c18e8Smrg    AC_MSG_CHECKING([whether to build shared libraries])
7315c27c18e8Smrg    test "$can_build_shared" = "no" && enable_shared=no
7316c27c18e8Smrg
7317c27c18e8Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
7318c27c18e8Smrg    # are all built from PIC.
7319c43cc173Smrg    case $host_os in
7320c27c18e8Smrg      aix3*)
7321c27c18e8Smrg        test "$enable_shared" = yes && enable_static=no
7322c27c18e8Smrg        if test -n "$RANLIB"; then
7323c27c18e8Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7324c27c18e8Smrg          postinstall_cmds='$RANLIB $lib'
7325c27c18e8Smrg        fi
7326c27c18e8Smrg        ;;
732721e67964Smrg      aix[[4-9]]*)
7328c27c18e8Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7329c27c18e8Smrg	  test "$enable_shared" = yes && enable_static=no
7330c43cc173Smrg	fi
7331c27c18e8Smrg        ;;
7332c43cc173Smrg    esac
7333c27c18e8Smrg    AC_MSG_RESULT([$enable_shared])
7334c27c18e8Smrg
7335c27c18e8Smrg    AC_MSG_CHECKING([whether to build static libraries])
7336c27c18e8Smrg    # Make sure either enable_shared or enable_static is yes.
7337c27c18e8Smrg    test "$enable_shared" = yes || enable_static=yes
7338c27c18e8Smrg    AC_MSG_RESULT([$enable_static])
7339c27c18e8Smrg
7340c27c18e8Smrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
7341c27c18e8Smrg    _LT_TAGVAR(LD, $1)="$LD"
7342c27c18e8Smrg
7343c27c18e8Smrg    ## CAVEAT EMPTOR:
7344c27c18e8Smrg    ## There is no encapsulation within the following macros, do not change
7345c27c18e8Smrg    ## the running order or otherwise move them around unless you know exactly
7346c27c18e8Smrg    ## what you are doing...
7347c27c18e8Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
7348c27c18e8Smrg    _LT_COMPILER_PIC($1)
7349c27c18e8Smrg    _LT_COMPILER_C_O($1)
7350c27c18e8Smrg    _LT_COMPILER_FILE_LOCKS($1)
7351c27c18e8Smrg    _LT_LINKER_SHLIBS($1)
7352c27c18e8Smrg    _LT_SYS_DYNAMIC_LINKER($1)
7353c27c18e8Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7354c27c18e8Smrg
7355c27c18e8Smrg    _LT_CONFIG($1)
7356c27c18e8Smrg  fi # test -n "$compiler"
7357c27c18e8Smrg
7358c27c18e8Smrg  GCC=$lt_save_GCC
7359b789ec8aSmrg  CC=$lt_save_CC
7360b789ec8aSmrg  CFLAGS=$lt_save_CFLAGS
7361c27c18e8Smrgfi # test "$_lt_disable_FC" != yes
736221e67964Smrg
7363c27c18e8SmrgAC_LANG_POP
7364c27c18e8Smrg])# _LT_LANG_FC_CONFIG
736521e67964Smrg
736621e67964Smrg
7367c27c18e8Smrg# _LT_LANG_GCJ_CONFIG([TAG])
7368c27c18e8Smrg# --------------------------
7369c27c18e8Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
7370c27c18e8Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7371c27c18e8Smrg# to write the compiler configuration to `libtool'.
7372c27c18e8Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
7373c27c18e8Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
7374c27c18e8SmrgAC_LANG_SAVE
737521e67964Smrg
7376c27c18e8Smrg# Source file extension for Java test sources.
7377c27c18e8Smrgac_ext=java
7378c27c18e8Smrg
7379c27c18e8Smrg# Object file extension for compiled Java test sources.
7380c27c18e8Smrgobjext=o
7381c27c18e8Smrg_LT_TAGVAR(objext, $1)=$objext
7382c27c18e8Smrg
7383c27c18e8Smrg# Code to be used in simple compile tests
7384c27c18e8Smrglt_simple_compile_test_code="class foo {}"
7385c27c18e8Smrg
7386c27c18e8Smrg# Code to be used in simple link tests
7387c27c18e8Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
7388c27c18e8Smrg
7389c27c18e8Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7390c27c18e8Smrg_LT_TAG_COMPILER
7391c27c18e8Smrg
7392c27c18e8Smrg# save warnings/boilerplate of simple test code
7393c27c18e8Smrg_LT_COMPILER_BOILERPLATE
7394c27c18e8Smrg_LT_LINKER_BOILERPLATE
7395c27c18e8Smrg
7396c27c18e8Smrg# Allow CC to be a program name with arguments.
7397b789ec8aSmrglt_save_CC=$CC
7398b789ec8aSmrglt_save_CFLAGS=$CFLAGS
7399c27c18e8Smrglt_save_GCC=$GCC
7400c27c18e8SmrgGCC=yes
7401c27c18e8SmrgCC=${GCJ-"gcj"}
7402b789ec8aSmrgCFLAGS=$GCJFLAGS
7403c27c18e8Smrgcompiler=$CC
7404c27c18e8Smrg_LT_TAGVAR(compiler, $1)=$CC
7405c27c18e8Smrg_LT_TAGVAR(LD, $1)="$LD"
7406c27c18e8Smrg_LT_CC_BASENAME([$compiler])
7407c27c18e8Smrg
7408c27c18e8Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
7409c27c18e8Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7410c27c18e8Smrg
7411c27c18e8Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
741237eb1ca1Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
741337eb1ca1Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7414c27c18e8Smrg
7415c27c18e8Smrgif test -n "$compiler"; then
7416c27c18e8Smrg  _LT_COMPILER_NO_RTTI($1)
7417c27c18e8Smrg  _LT_COMPILER_PIC($1)
7418c27c18e8Smrg  _LT_COMPILER_C_O($1)
7419c27c18e8Smrg  _LT_COMPILER_FILE_LOCKS($1)
7420c27c18e8Smrg  _LT_LINKER_SHLIBS($1)
7421c27c18e8Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
7422c27c18e8Smrg
7423c27c18e8Smrg  _LT_CONFIG($1)
7424c27c18e8Smrgfi
7425c27c18e8Smrg
7426c27c18e8SmrgAC_LANG_RESTORE
7427c27c18e8Smrg
7428c27c18e8SmrgGCC=$lt_save_GCC
7429b789ec8aSmrgCC=$lt_save_CC
7430b789ec8aSmrgCFLAGS=$lt_save_CFLAGS
7431c27c18e8Smrg])# _LT_LANG_GCJ_CONFIG
7432c27c18e8Smrg
7433c27c18e8Smrg
7434c27c18e8Smrg# _LT_LANG_RC_CONFIG([TAG])
7435c27c18e8Smrg# -------------------------
7436c27c18e8Smrg# Ensure that the configuration variables for the Windows resource compiler
7437c27c18e8Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7438c27c18e8Smrg# to write the compiler configuration to `libtool'.
7439c27c18e8Smrgm4_defun([_LT_LANG_RC_CONFIG],
7440c27c18e8Smrg[AC_REQUIRE([LT_PROG_RC])dnl
7441c27c18e8SmrgAC_LANG_SAVE
7442c27c18e8Smrg
7443c27c18e8Smrg# Source file extension for RC test sources.
7444c27c18e8Smrgac_ext=rc
744521e67964Smrg
7446c27c18e8Smrg# Object file extension for compiled RC test sources.
7447c27c18e8Smrgobjext=o
7448c27c18e8Smrg_LT_TAGVAR(objext, $1)=$objext
744921e67964Smrg
7450c27c18e8Smrg# Code to be used in simple compile tests
7451c27c18e8Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
745221e67964Smrg
7453c27c18e8Smrg# Code to be used in simple link tests
7454c27c18e8Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
745521e67964Smrg
7456c27c18e8Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7457c27c18e8Smrg_LT_TAG_COMPILER
745821e67964Smrg
7459c27c18e8Smrg# save warnings/boilerplate of simple test code
7460c27c18e8Smrg_LT_COMPILER_BOILERPLATE
7461c27c18e8Smrg_LT_LINKER_BOILERPLATE
746221e67964Smrg
7463c27c18e8Smrg# Allow CC to be a program name with arguments.
7464c27c18e8Smrglt_save_CC="$CC"
7465b789ec8aSmrglt_save_CFLAGS=$CFLAGS
7466c27c18e8Smrglt_save_GCC=$GCC
7467c27c18e8SmrgGCC=
7468c27c18e8SmrgCC=${RC-"windres"}
7469b789ec8aSmrgCFLAGS=
7470c27c18e8Smrgcompiler=$CC
7471c27c18e8Smrg_LT_TAGVAR(compiler, $1)=$CC
7472c27c18e8Smrg_LT_CC_BASENAME([$compiler])
7473c27c18e8Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
747421e67964Smrg
7475c27c18e8Smrgif test -n "$compiler"; then
7476c27c18e8Smrg  :
7477c27c18e8Smrg  _LT_CONFIG($1)
7478c27c18e8Smrgfi
747921e67964Smrg
7480c27c18e8SmrgGCC=$lt_save_GCC
7481c27c18e8SmrgAC_LANG_RESTORE
7482b789ec8aSmrgCC=$lt_save_CC
7483b789ec8aSmrgCFLAGS=$lt_save_CFLAGS
7484c27c18e8Smrg])# _LT_LANG_RC_CONFIG
748521e67964Smrg
748621e67964Smrg
7487c27c18e8Smrg# LT_PROG_GCJ
7488c27c18e8Smrg# -----------
7489c27c18e8SmrgAC_DEFUN([LT_PROG_GCJ],
7490c27c18e8Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
7491c27c18e8Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
7492c27c18e8Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
7493c27c18e8Smrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
7494c27c18e8Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
7495c27c18e8Smrg])
749621e67964Smrg
7497c27c18e8Smrg# Old name:
7498c27c18e8SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
7499c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
7500c27c18e8Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
750121e67964Smrg
750221e67964Smrg
7503c27c18e8Smrg# LT_PROG_RC
7504c27c18e8Smrg# ----------
7505c27c18e8SmrgAC_DEFUN([LT_PROG_RC],
7506c27c18e8Smrg[AC_CHECK_TOOL(RC, windres,)
7507c27c18e8Smrg])
750821e67964Smrg
7509c27c18e8Smrg# Old name:
7510c27c18e8SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
7511c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
7512c27c18e8Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
751321e67964Smrg
751421e67964Smrg
7515c27c18e8Smrg# _LT_DECL_EGREP
7516c27c18e8Smrg# --------------
7517c27c18e8Smrg# If we don't have a new enough Autoconf to choose the best grep
7518c27c18e8Smrg# available, choose the one first in the user's PATH.
7519c27c18e8Smrgm4_defun([_LT_DECL_EGREP],
7520c27c18e8Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
7521c27c18e8SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
7522c27c18e8Smrgtest -z "$GREP" && GREP=grep
7523c27c18e8Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
7524c27c18e8Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
7525c27c18e8Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
7526c27c18e8Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
7527c27c18e8SmrgAC_SUBST([GREP])
7528c27c18e8Smrg])
752921e67964Smrg
753021e67964Smrg
7531c27c18e8Smrg# _LT_DECL_OBJDUMP
7532c27c18e8Smrg# --------------
7533c27c18e8Smrg# If we don't have a new enough Autoconf to choose the best objdump
7534c27c18e8Smrg# available, choose the one first in the user's PATH.
7535c27c18e8Smrgm4_defun([_LT_DECL_OBJDUMP],
7536c27c18e8Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
7537c27c18e8Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
7538c27c18e8Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
7539c27c18e8SmrgAC_SUBST([OBJDUMP])
7540c27c18e8Smrg])
754121e67964Smrg
7542b789ec8aSmrg# _LT_DECL_DLLTOOL
7543b789ec8aSmrg# ----------------
7544b789ec8aSmrg# Ensure DLLTOOL variable is set.
7545b789ec8aSmrgm4_defun([_LT_DECL_DLLTOOL],
7546b789ec8aSmrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
7547b789ec8aSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
7548b789ec8aSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
7549b789ec8aSmrgAC_SUBST([DLLTOOL])
7550b789ec8aSmrg])
755121e67964Smrg
7552c27c18e8Smrg# _LT_DECL_SED
7553c27c18e8Smrg# ------------
7554c27c18e8Smrg# Check for a fully-functional sed program, that truncates
7555c27c18e8Smrg# as few characters as possible.  Prefer GNU sed if found.
7556c27c18e8Smrgm4_defun([_LT_DECL_SED],
7557c27c18e8Smrg[AC_PROG_SED
7558c27c18e8Smrgtest -z "$SED" && SED=sed
7559c27c18e8SmrgXsed="$SED -e 1s/^X//"
7560c27c18e8Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
7561c27c18e8Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
7562c27c18e8Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
7563c27c18e8Smrg])# _LT_DECL_SED
756421e67964Smrg
7565c27c18e8Smrgm4_ifndef([AC_PROG_SED], [
7566c27c18e8Smrg# NOTE: This macro has been submitted for inclusion into   #
7567c27c18e8Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
7568c27c18e8Smrg#  a released version of Autoconf we should remove this    #
7569c27c18e8Smrg#  macro and use it instead.                               #
7570c27c18e8Smrg
7571c27c18e8Smrgm4_defun([AC_PROG_SED],
7572c27c18e8Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
7573c27c18e8SmrgAC_CACHE_VAL(lt_cv_path_SED,
7574c27c18e8Smrg[# Loop through the user's path and test for sed and gsed.
7575c27c18e8Smrg# Then use that list of sed's as ones to test for truncation.
7576c27c18e8Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7577c27c18e8Smrgfor as_dir in $PATH
7578c27c18e8Smrgdo
7579c27c18e8Smrg  IFS=$as_save_IFS
7580c27c18e8Smrg  test -z "$as_dir" && as_dir=.
7581c27c18e8Smrg  for lt_ac_prog in sed gsed; do
7582c27c18e8Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
7583c27c18e8Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
7584c27c18e8Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
7585c27c18e8Smrg      fi
7586c27c18e8Smrg    done
7587c27c18e8Smrg  done
7588c27c18e8Smrgdone
7589c27c18e8SmrgIFS=$as_save_IFS
7590c27c18e8Smrglt_ac_max=0
7591c27c18e8Smrglt_ac_count=0
7592c27c18e8Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
7593c27c18e8Smrg# along with /bin/sed that truncates output.
7594c27c18e8Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
7595c27c18e8Smrg  test ! -f $lt_ac_sed && continue
7596c27c18e8Smrg  cat /dev/null > conftest.in
7597c27c18e8Smrg  lt_ac_count=0
7598c27c18e8Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
7599c27c18e8Smrg  # Check for GNU sed and select it if it is found.
7600c27c18e8Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
7601c27c18e8Smrg    lt_cv_path_SED=$lt_ac_sed
7602c27c18e8Smrg    break
760321e67964Smrg  fi
7604c27c18e8Smrg  while true; do
7605c27c18e8Smrg    cat conftest.in conftest.in >conftest.tmp
7606c27c18e8Smrg    mv conftest.tmp conftest.in
7607c27c18e8Smrg    cp conftest.in conftest.nl
7608c27c18e8Smrg    echo >>conftest.nl
7609c27c18e8Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
7610c27c18e8Smrg    cmp -s conftest.out conftest.nl || break
7611c27c18e8Smrg    # 10000 chars as input seems more than enough
7612c27c18e8Smrg    test $lt_ac_count -gt 10 && break
7613c27c18e8Smrg    lt_ac_count=`expr $lt_ac_count + 1`
7614c27c18e8Smrg    if test $lt_ac_count -gt $lt_ac_max; then
7615c27c18e8Smrg      lt_ac_max=$lt_ac_count
7616c27c18e8Smrg      lt_cv_path_SED=$lt_ac_sed
7617c27c18e8Smrg    fi
7618c27c18e8Smrg  done
7619c27c18e8Smrgdone
762021e67964Smrg])
7621c27c18e8SmrgSED=$lt_cv_path_SED
7622c27c18e8SmrgAC_SUBST([SED])
7623c27c18e8SmrgAC_MSG_RESULT([$SED])
7624c27c18e8Smrg])#AC_PROG_SED
7625c27c18e8Smrg])#m4_ifndef
762621e67964Smrg
7627c27c18e8Smrg# Old name:
7628c27c18e8SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
7629c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
7630c27c18e8Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
7631c27c18e8Smrg
7632c27c18e8Smrg
7633c27c18e8Smrg# _LT_CHECK_SHELL_FEATURES
7634c27c18e8Smrg# ------------------------
7635c27c18e8Smrg# Find out whether the shell is Bourne or XSI compatible,
7636c27c18e8Smrg# or has some other useful features.
7637c27c18e8Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
7638c27c18e8Smrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
7639c27c18e8Smrg# Try some XSI features
7640c27c18e8Smrgxsi_shell=no
7641c27c18e8Smrg( _lt_dummy="a/b/c"
7642b789ec8aSmrg  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
7643b789ec8aSmrg      = c,a/b,b/c, \
7644c27c18e8Smrg    && eval 'test $(( 1 + 1 )) -eq 2 \
7645c27c18e8Smrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
7646c27c18e8Smrg  && xsi_shell=yes
7647c27c18e8SmrgAC_MSG_RESULT([$xsi_shell])
7648c27c18e8Smrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
7649c27c18e8Smrg
7650c27c18e8SmrgAC_MSG_CHECKING([whether the shell understands "+="])
7651c27c18e8Smrglt_shell_append=no
7652c27c18e8Smrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
7653c27c18e8Smrg    >/dev/null 2>&1 \
7654c27c18e8Smrg  && lt_shell_append=yes
7655c27c18e8SmrgAC_MSG_RESULT([$lt_shell_append])
7656c27c18e8Smrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
7657c27c18e8Smrg
7658c27c18e8Smrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
7659c27c18e8Smrg  lt_unset=unset
7660c27c18e8Smrgelse
7661c27c18e8Smrg  lt_unset=false
766221e67964Smrgfi
7663c27c18e8Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
7664c27c18e8Smrg
7665c27c18e8Smrg# test EBCDIC or ASCII
7666c27c18e8Smrgcase `echo X|tr X '\101'` in
7667c27c18e8Smrg A) # ASCII based system
7668c27c18e8Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
7669c27c18e8Smrg  lt_SP2NL='tr \040 \012'
7670c27c18e8Smrg  lt_NL2SP='tr \015\012 \040\040'
7671c27c18e8Smrg  ;;
7672c27c18e8Smrg *) # EBCDIC based system
7673c27c18e8Smrg  lt_SP2NL='tr \100 \n'
7674c27c18e8Smrg  lt_NL2SP='tr \r\n \100\100'
7675c27c18e8Smrg  ;;
767621e67964Smrgesac
7677c27c18e8Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
7678c27c18e8Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
7679c27c18e8Smrg])# _LT_CHECK_SHELL_FEATURES
768021e67964Smrg
768121e67964Smrg
7682b789ec8aSmrg# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
7683b789ec8aSmrg# ------------------------------------------------------
7684b789ec8aSmrg# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
7685b789ec8aSmrg# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
7686b789ec8aSmrgm4_defun([_LT_PROG_FUNCTION_REPLACE],
7687b789ec8aSmrg[dnl {
7688b789ec8aSmrgsed -e '/^$1 ()$/,/^} # $1 /c\
7689b789ec8aSmrg$1 ()\
7690b789ec8aSmrg{\
7691b789ec8aSmrgm4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
7692b789ec8aSmrg} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
7693b789ec8aSmrg  && mv -f "$cfgfile.tmp" "$cfgfile" \
7694b789ec8aSmrg    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7695b789ec8aSmrgtest 0 -eq $? || _lt_function_replace_fail=:
7696b789ec8aSmrg])
769721e67964Smrg
7698c27c18e8Smrg
7699b789ec8aSmrg# _LT_PROG_REPLACE_SHELLFNS
7700b789ec8aSmrg# -------------------------
7701b789ec8aSmrg# Replace existing portable implementations of several shell functions with
7702b789ec8aSmrg# equivalent extended shell implementations where those features are available..
7703b789ec8aSmrgm4_defun([_LT_PROG_REPLACE_SHELLFNS],
7704b789ec8aSmrg[if test x"$xsi_shell" = xyes; then
7705b789ec8aSmrg  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
7706b789ec8aSmrg    case ${1} in
7707b789ec8aSmrg      */*) func_dirname_result="${1%/*}${2}" ;;
7708b789ec8aSmrg      *  ) func_dirname_result="${3}" ;;
7709b789ec8aSmrg    esac])
7710b789ec8aSmrg
7711b789ec8aSmrg  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
7712b789ec8aSmrg    func_basename_result="${1##*/}"])
7713b789ec8aSmrg
7714b789ec8aSmrg  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
7715b789ec8aSmrg    case ${1} in
7716b789ec8aSmrg      */*) func_dirname_result="${1%/*}${2}" ;;
7717b789ec8aSmrg      *  ) func_dirname_result="${3}" ;;
7718b789ec8aSmrg    esac
7719b789ec8aSmrg    func_basename_result="${1##*/}"])
7720c27c18e8Smrg
7721b789ec8aSmrg  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
7722b789ec8aSmrg    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
7723b789ec8aSmrg    # positional parameters, so assign one to ordinary parameter first.
7724b789ec8aSmrg    func_stripname_result=${3}
7725b789ec8aSmrg    func_stripname_result=${func_stripname_result#"${1}"}
7726b789ec8aSmrg    func_stripname_result=${func_stripname_result%"${2}"}])
7727c27c18e8Smrg
7728b789ec8aSmrg  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
7729b789ec8aSmrg    func_split_long_opt_name=${1%%=*}
7730b789ec8aSmrg    func_split_long_opt_arg=${1#*=}])
7731c27c18e8Smrg
7732b789ec8aSmrg  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
7733b789ec8aSmrg    func_split_short_opt_arg=${1#??}
7734b789ec8aSmrg    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
7735c27c18e8Smrg
7736b789ec8aSmrg  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
7737b789ec8aSmrg    case ${1} in
7738b789ec8aSmrg      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
7739b789ec8aSmrg      *)    func_lo2o_result=${1} ;;
7740b789ec8aSmrg    esac])
7741c27c18e8Smrg
7742b789ec8aSmrg  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
7743c27c18e8Smrg
7744b789ec8aSmrg  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
7745c27c18e8Smrg
7746b789ec8aSmrg  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
7747b789ec8aSmrgfi
7748c27c18e8Smrg
7749b789ec8aSmrgif test x"$lt_shell_append" = xyes; then
7750b789ec8aSmrg  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
7751c27c18e8Smrg
7752b789ec8aSmrg  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
7753b789ec8aSmrg    func_quote_for_eval "${2}"
7754b789ec8aSmrgdnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
7755b789ec8aSmrg    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
7756c27c18e8Smrg
7757b789ec8aSmrg  # Save a `func_append' function call where possible by direct use of '+='
7758b789ec8aSmrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
7759b789ec8aSmrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
7760b789ec8aSmrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7761b789ec8aSmrg  test 0 -eq $? || _lt_function_replace_fail=:
7762b789ec8aSmrgelse
7763b789ec8aSmrg  # Save a `func_append' function call even when '+=' is not available
7764b789ec8aSmrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
7765b789ec8aSmrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
7766b789ec8aSmrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7767b789ec8aSmrg  test 0 -eq $? || _lt_function_replace_fail=:
7768b789ec8aSmrgfi
7769c27c18e8Smrg
7770b789ec8aSmrgif test x"$_lt_function_replace_fail" = x":"; then
7771b789ec8aSmrg  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
7772b789ec8aSmrgfi
7773b789ec8aSmrg])
777421e67964Smrg
7775b789ec8aSmrg# _LT_PATH_CONVERSION_FUNCTIONS
7776b789ec8aSmrg# -----------------------------
7777b789ec8aSmrg# Determine which file name conversion functions should be used by
7778b789ec8aSmrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
7779b789ec8aSmrg# for certain cross-compile configurations and native mingw.
7780b789ec8aSmrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
7781b789ec8aSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7782b789ec8aSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
7783b789ec8aSmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
7784b789ec8aSmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
7785b789ec8aSmrg[case $host in
7786b789ec8aSmrg  *-*-mingw* )
7787b789ec8aSmrg    case $build in
7788b789ec8aSmrg      *-*-mingw* ) # actually msys
7789b789ec8aSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
7790b789ec8aSmrg        ;;
7791b789ec8aSmrg      *-*-cygwin* )
7792b789ec8aSmrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
7793b789ec8aSmrg        ;;
7794b789ec8aSmrg      * ) # otherwise, assume *nix
7795b789ec8aSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
7796b789ec8aSmrg        ;;
7797b789ec8aSmrg    esac
7798b789ec8aSmrg    ;;
7799b789ec8aSmrg  *-*-cygwin* )
7800b789ec8aSmrg    case $build in
7801b789ec8aSmrg      *-*-mingw* ) # actually msys
7802b789ec8aSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
7803b789ec8aSmrg        ;;
7804b789ec8aSmrg      *-*-cygwin* )
7805b789ec8aSmrg        lt_cv_to_host_file_cmd=func_convert_file_noop
7806b789ec8aSmrg        ;;
7807b789ec8aSmrg      * ) # otherwise, assume *nix
7808b789ec8aSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
7809b789ec8aSmrg        ;;
7810b789ec8aSmrg    esac
7811b789ec8aSmrg    ;;
7812b789ec8aSmrg  * ) # unhandled hosts (and "normal" native builds)
7813b789ec8aSmrg    lt_cv_to_host_file_cmd=func_convert_file_noop
7814b789ec8aSmrg    ;;
7815b789ec8aSmrgesac
7816b789ec8aSmrg])
7817b789ec8aSmrgto_host_file_cmd=$lt_cv_to_host_file_cmd
7818b789ec8aSmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
7819b789ec8aSmrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
7820b789ec8aSmrg         [0], [convert $build file names to $host format])dnl
7821b789ec8aSmrg
7822b789ec8aSmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
7823b789ec8aSmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
7824b789ec8aSmrg[#assume ordinary cross tools, or native build.
7825b789ec8aSmrglt_cv_to_tool_file_cmd=func_convert_file_noop
7826b789ec8aSmrgcase $host in
7827b789ec8aSmrg  *-*-mingw* )
7828b789ec8aSmrg    case $build in
7829b789ec8aSmrg      *-*-mingw* ) # actually msys
7830b789ec8aSmrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
7831b789ec8aSmrg        ;;
7832b789ec8aSmrg    esac
7833b789ec8aSmrg    ;;
7834b789ec8aSmrgesac
7835b789ec8aSmrg])
7836b789ec8aSmrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
7837b789ec8aSmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
7838b789ec8aSmrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
7839b789ec8aSmrg         [0], [convert $build files to toolchain format])dnl
7840b789ec8aSmrg])# _LT_PATH_CONVERSION_FUNCTIONS
784121e67964Smrg
7842b789ec8aSmrg# Helper functions for option handling.                    -*- Autoconf -*-
7843b789ec8aSmrg#
7844b789ec8aSmrg#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
7845b789ec8aSmrg#   Inc.
7846b789ec8aSmrg#   Written by Gary V. Vaughan, 2004
7847b789ec8aSmrg#
7848b789ec8aSmrg# This file is free software; the Free Software Foundation gives
7849b789ec8aSmrg# unlimited permission to copy and/or distribute it, with or without
7850b789ec8aSmrg# modifications, as long as this notice is preserved.
785121e67964Smrg
7852b789ec8aSmrg# serial 7 ltoptions.m4
785321e67964Smrg
7854b789ec8aSmrg# This is to help aclocal find these macros, as it can't see m4_define.
7855b789ec8aSmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
785621e67964Smrg
785721e67964Smrg
7858c27c18e8Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
7859c27c18e8Smrg# ------------------------------------------
7860c27c18e8Smrgm4_define([_LT_MANGLE_OPTION],
7861c27c18e8Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
786221e67964Smrg
786321e67964Smrg
7864c27c18e8Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
7865c27c18e8Smrg# ---------------------------------------
7866c27c18e8Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
7867c27c18e8Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
7868c27c18e8Smrg# saved as a flag.
7869c27c18e8Smrgm4_define([_LT_SET_OPTION],
7870c27c18e8Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
7871c27c18e8Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
7872c27c18e8Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
7873c27c18e8Smrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
7874c27c18e8Smrg])
787521e67964Smrg
787621e67964Smrg
7877c27c18e8Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
7878c27c18e8Smrg# ------------------------------------------------------------
7879c27c18e8Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7880c27c18e8Smrgm4_define([_LT_IF_OPTION],
7881c27c18e8Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
7882c27c18e8Smrg
7883c27c18e8Smrg
7884c27c18e8Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
7885c27c18e8Smrg# -------------------------------------------------------
7886c27c18e8Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
7887c27c18e8Smrg# are set.
7888c27c18e8Smrgm4_define([_LT_UNLESS_OPTIONS],
7889c27c18e8Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
7890c27c18e8Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
7891c27c18e8Smrg		      [m4_define([$0_found])])])[]dnl
7892c27c18e8Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
7893c27c18e8Smrg])[]dnl
7894c27c18e8Smrg])
789521e67964Smrg
789621e67964Smrg
7897c27c18e8Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
7898c27c18e8Smrg# ----------------------------------------
7899c27c18e8Smrg# OPTION-LIST is a space-separated list of Libtool options associated
7900c27c18e8Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
7901c27c18e8Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
7902c27c18e8Smrg# the unknown option and exit.
7903c27c18e8Smrgm4_defun([_LT_SET_OPTIONS],
7904c27c18e8Smrg[# Set options
7905c27c18e8Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
7906c27c18e8Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
7907c27c18e8Smrg
7908c27c18e8Smrgm4_if([$1],[LT_INIT],[
7909c27c18e8Smrg  dnl
7910c27c18e8Smrg  dnl Simply set some default values (i.e off) if boolean options were not
7911c27c18e8Smrg  dnl specified:
7912c27c18e8Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
7913c27c18e8Smrg  ])
7914c27c18e8Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
7915c27c18e8Smrg  ])
7916c27c18e8Smrg  dnl
7917c27c18e8Smrg  dnl If no reference was made to various pairs of opposing options, then
7918c27c18e8Smrg  dnl we run the default mode handler for the pair.  For example, if neither
7919c27c18e8Smrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
7920c27c18e8Smrg  dnl archives by default:
7921c27c18e8Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
7922c27c18e8Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
7923c27c18e8Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
7924c27c18e8Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
7925c27c18e8Smrg  		   [_LT_ENABLE_FAST_INSTALL])
7926c27c18e8Smrg  ])
7927c27c18e8Smrg])# _LT_SET_OPTIONS
792821e67964Smrg
792921e67964Smrg
793021e67964Smrg
7931c27c18e8Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
7932c27c18e8Smrg# -----------------------------------------
7933c27c18e8Smrgm4_define([_LT_MANGLE_DEFUN],
7934c27c18e8Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
7935c27c18e8Smrg
7936c27c18e8Smrg
7937c27c18e8Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
7938c27c18e8Smrg# -----------------------------------------------
7939c27c18e8Smrgm4_define([LT_OPTION_DEFINE],
7940c27c18e8Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
7941c27c18e8Smrg])# LT_OPTION_DEFINE
7942c27c18e8Smrg
794321e67964Smrg
7944c27c18e8Smrg# dlopen
7945c27c18e8Smrg# ------
7946c27c18e8SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
7947c27c18e8Smrg])
794821e67964Smrg
7949c27c18e8SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
7950c27c18e8Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
7951c27c18e8SmrgAC_DIAGNOSE([obsolete],
7952c27c18e8Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
7953c27c18e8Smrgput the `dlopen' option into LT_INIT's first parameter.])
7954c27c18e8Smrg])
795521e67964Smrg
7956c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
7957c27c18e8Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
795821e67964Smrg
795921e67964Smrg
7960c27c18e8Smrg# win32-dll
7961c27c18e8Smrg# ---------
7962c27c18e8Smrg# Declare package support for building win32 dll's.
7963c27c18e8SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
7964c27c18e8Smrg[enable_win32_dll=yes
796521e67964Smrg
7966c27c18e8Smrgcase $host in
796737eb1ca1Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
7968c27c18e8Smrg  AC_CHECK_TOOL(AS, as, false)
7969c27c18e8Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
7970c27c18e8Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
7971c27c18e8Smrg  ;;
7972c27c18e8Smrgesac
797321e67964Smrg
7974c27c18e8Smrgtest -z "$AS" && AS=as
797537eb1ca1Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
797621e67964Smrg
7977c27c18e8Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
797837eb1ca1Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
797921e67964Smrg
7980c27c18e8Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
798137eb1ca1Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
7982c27c18e8Smrg])# win32-dll
798321e67964Smrg
7984c27c18e8SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
7985c27c18e8Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7986c27c18e8Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
7987c27c18e8SmrgAC_DIAGNOSE([obsolete],
7988c27c18e8Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
7989c27c18e8Smrgput the `win32-dll' option into LT_INIT's first parameter.])
7990c27c18e8Smrg])
799121e67964Smrg
7992c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
7993c27c18e8Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
799421e67964Smrg
7995c27c18e8Smrg
7996c27c18e8Smrg# _LT_ENABLE_SHARED([DEFAULT])
7997c27c18e8Smrg# ----------------------------
7998c27c18e8Smrg# implement the --enable-shared flag, and supports the `shared' and
7999c27c18e8Smrg# `disable-shared' LT_INIT options.
8000c27c18e8Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
8001c27c18e8Smrgm4_define([_LT_ENABLE_SHARED],
8002c27c18e8Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
8003c27c18e8SmrgAC_ARG_ENABLE([shared],
8004c27c18e8Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
8005c27c18e8Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
8006c27c18e8Smrg    [p=${PACKAGE-default}
8007c27c18e8Smrg    case $enableval in
8008c27c18e8Smrg    yes) enable_shared=yes ;;
8009c27c18e8Smrg    no) enable_shared=no ;;
8010c27c18e8Smrg    *)
8011c27c18e8Smrg      enable_shared=no
8012c27c18e8Smrg      # Look at the argument we got.  We use all the common list separators.
8013c27c18e8Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8014c27c18e8Smrg      for pkg in $enableval; do
8015c27c18e8Smrg	IFS="$lt_save_ifs"
8016c27c18e8Smrg	if test "X$pkg" = "X$p"; then
8017c27c18e8Smrg	  enable_shared=yes
8018c27c18e8Smrg	fi
8019c27c18e8Smrg      done
8020c27c18e8Smrg      IFS="$lt_save_ifs"
802121e67964Smrg      ;;
8022c27c18e8Smrg    esac],
8023c27c18e8Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
802421e67964Smrg
8025c27c18e8Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
8026c27c18e8Smrg	[Whether or not to build shared libraries])
8027c27c18e8Smrg])# _LT_ENABLE_SHARED
802821e67964Smrg
8029c27c18e8SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
8030c27c18e8SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
803121e67964Smrg
8032c27c18e8Smrg# Old names:
8033c27c18e8SmrgAC_DEFUN([AC_ENABLE_SHARED],
8034c27c18e8Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
8035c27c18e8Smrg])
8036c27c18e8Smrg
8037c27c18e8SmrgAC_DEFUN([AC_DISABLE_SHARED],
8038c27c18e8Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
8039c27c18e8Smrg])
804021e67964Smrg
8041c27c18e8SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
8042c27c18e8SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
804321e67964Smrg
8044c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
8045c27c18e8Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
8046c27c18e8Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
804721e67964Smrg
804821e67964Smrg
804921e67964Smrg
8050c27c18e8Smrg# _LT_ENABLE_STATIC([DEFAULT])
8051c27c18e8Smrg# ----------------------------
8052c27c18e8Smrg# implement the --enable-static flag, and support the `static' and
8053c27c18e8Smrg# `disable-static' LT_INIT options.
8054c27c18e8Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
8055c27c18e8Smrgm4_define([_LT_ENABLE_STATIC],
8056c27c18e8Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
8057c27c18e8SmrgAC_ARG_ENABLE([static],
8058c27c18e8Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
8059c27c18e8Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
8060c27c18e8Smrg    [p=${PACKAGE-default}
8061c27c18e8Smrg    case $enableval in
8062c27c18e8Smrg    yes) enable_static=yes ;;
8063c27c18e8Smrg    no) enable_static=no ;;
8064c27c18e8Smrg    *)
8065c27c18e8Smrg     enable_static=no
8066c27c18e8Smrg      # Look at the argument we got.  We use all the common list separators.
8067c27c18e8Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8068c27c18e8Smrg      for pkg in $enableval; do
8069c27c18e8Smrg	IFS="$lt_save_ifs"
8070c27c18e8Smrg	if test "X$pkg" = "X$p"; then
8071c27c18e8Smrg	  enable_static=yes
8072c27c18e8Smrg	fi
8073c27c18e8Smrg      done
8074c27c18e8Smrg      IFS="$lt_save_ifs"
807521e67964Smrg      ;;
8076c27c18e8Smrg    esac],
8077c27c18e8Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
807821e67964Smrg
8079c27c18e8Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
8080c27c18e8Smrg	[Whether or not to build static libraries])
8081c27c18e8Smrg])# _LT_ENABLE_STATIC
808221e67964Smrg
8083c27c18e8SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
8084c27c18e8SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
808521e67964Smrg
8086c27c18e8Smrg# Old names:
8087c27c18e8SmrgAC_DEFUN([AC_ENABLE_STATIC],
8088c27c18e8Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
8089c27c18e8Smrg])
809021e67964Smrg
8091c27c18e8SmrgAC_DEFUN([AC_DISABLE_STATIC],
8092c27c18e8Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
8093c27c18e8Smrg])
809421e67964Smrg
8095c27c18e8SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
8096c27c18e8SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
809721e67964Smrg
8098c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
8099c27c18e8Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
8100c27c18e8Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
810121e67964Smrg
810221e67964Smrg
810321e67964Smrg
8104c27c18e8Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
8105c27c18e8Smrg# ----------------------------------
8106c27c18e8Smrg# implement the --enable-fast-install flag, and support the `fast-install'
8107c27c18e8Smrg# and `disable-fast-install' LT_INIT options.
8108c27c18e8Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
8109c27c18e8Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
8110c27c18e8Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
8111c27c18e8SmrgAC_ARG_ENABLE([fast-install],
8112c27c18e8Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
8113c27c18e8Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
8114c27c18e8Smrg    [p=${PACKAGE-default}
8115c27c18e8Smrg    case $enableval in
8116c27c18e8Smrg    yes) enable_fast_install=yes ;;
8117c27c18e8Smrg    no) enable_fast_install=no ;;
8118c27c18e8Smrg    *)
8119c27c18e8Smrg      enable_fast_install=no
8120c27c18e8Smrg      # Look at the argument we got.  We use all the common list separators.
8121c27c18e8Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8122c27c18e8Smrg      for pkg in $enableval; do
8123c27c18e8Smrg	IFS="$lt_save_ifs"
8124c27c18e8Smrg	if test "X$pkg" = "X$p"; then
8125c27c18e8Smrg	  enable_fast_install=yes
812621e67964Smrg	fi
8127c27c18e8Smrg      done
8128c27c18e8Smrg      IFS="$lt_save_ifs"
812921e67964Smrg      ;;
8130c27c18e8Smrg    esac],
8131c27c18e8Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
813221e67964Smrg
8133c27c18e8Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
8134c27c18e8Smrg	 [Whether or not to optimize for fast installation])dnl
8135c27c18e8Smrg])# _LT_ENABLE_FAST_INSTALL
813621e67964Smrg
8137c27c18e8SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
8138c27c18e8SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
813921e67964Smrg
8140c27c18e8Smrg# Old names:
8141c27c18e8SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
8142c27c18e8Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
8143c27c18e8SmrgAC_DIAGNOSE([obsolete],
8144c27c18e8Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8145c27c18e8Smrgthe `fast-install' option into LT_INIT's first parameter.])
8146c27c18e8Smrg])
814721e67964Smrg
8148c27c18e8SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
8149c27c18e8Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
8150c27c18e8SmrgAC_DIAGNOSE([obsolete],
8151c27c18e8Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8152c27c18e8Smrgthe `disable-fast-install' option into LT_INIT's first parameter.])
8153c27c18e8Smrg])
815421e67964Smrg
8155c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
8156c27c18e8Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
8157c27c18e8Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
815821e67964Smrg
815921e67964Smrg
8160c27c18e8Smrg# _LT_WITH_PIC([MODE])
8161c27c18e8Smrg# --------------------
8162c27c18e8Smrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
8163c27c18e8Smrg# LT_INIT options.
8164c27c18e8Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
8165c27c18e8Smrgm4_define([_LT_WITH_PIC],
8166c27c18e8Smrg[AC_ARG_WITH([pic],
8167c27c18e8Smrg    [AS_HELP_STRING([--with-pic],
8168c27c18e8Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
8169c27c18e8Smrg    [pic_mode="$withval"],
8170c27c18e8Smrg    [pic_mode=default])
817121e67964Smrg
8172c27c18e8Smrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
817321e67964Smrg
8174c27c18e8Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
8175c27c18e8Smrg])# _LT_WITH_PIC
817621e67964Smrg
8177c27c18e8SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
8178c27c18e8SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
8179c27c18e8Smrg
8180c27c18e8Smrg# Old name:
8181c27c18e8SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
8182c27c18e8Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
8183c27c18e8SmrgAC_DIAGNOSE([obsolete],
8184c27c18e8Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8185c27c18e8Smrgput the `pic-only' option into LT_INIT's first parameter.])
818621e67964Smrg])
818721e67964Smrg
8188c27c18e8Smrgdnl aclocal-1.4 backwards compatibility:
8189c27c18e8Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
819021e67964Smrg
819121e67964Smrg
8192c27c18e8Smrgm4_define([_LTDL_MODE], [])
8193c27c18e8SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
8194c27c18e8Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
8195c27c18e8SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
8196c27c18e8Smrg		 [m4_define([_LTDL_MODE], [recursive])])
8197c27c18e8SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
8198c27c18e8Smrg		 [m4_define([_LTDL_MODE], [subproject])])
819921e67964Smrg
8200c27c18e8Smrgm4_define([_LTDL_TYPE], [])
8201c27c18e8SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
8202c27c18e8Smrg		 [m4_define([_LTDL_TYPE], [installable])])
8203c27c18e8SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
8204c27c18e8Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
820521e67964Smrg
8206c27c18e8Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
820721e67964Smrg#
8208c27c18e8Smrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
8209c27c18e8Smrg# Written by Gary V. Vaughan, 2004
821021e67964Smrg#
8211c27c18e8Smrg# This file is free software; the Free Software Foundation gives
8212c27c18e8Smrg# unlimited permission to copy and/or distribute it, with or without
8213c27c18e8Smrg# modifications, as long as this notice is preserved.
8214c27c18e8Smrg
8215c27c18e8Smrg# serial 6 ltsugar.m4
8216c27c18e8Smrg
8217c27c18e8Smrg# This is to help aclocal find these macros, as it can't see m4_define.
8218c27c18e8SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
8219c27c18e8Smrg
8220c27c18e8Smrg
8221c27c18e8Smrg# lt_join(SEP, ARG1, [ARG2...])
8222c27c18e8Smrg# -----------------------------
8223c27c18e8Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
8224c27c18e8Smrg# associated separator.
8225c27c18e8Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
8226c27c18e8Smrg# versions in m4sugar had bugs.
8227c27c18e8Smrgm4_define([lt_join],
8228c27c18e8Smrg[m4_if([$#], [1], [],
8229c27c18e8Smrg       [$#], [2], [[$2]],
8230c27c18e8Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
8231c27c18e8Smrgm4_define([_lt_join],
8232c27c18e8Smrg[m4_if([$#$2], [2], [],
8233c27c18e8Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
8234c27c18e8Smrg
8235c27c18e8Smrg
8236c27c18e8Smrg# lt_car(LIST)
8237c27c18e8Smrg# lt_cdr(LIST)
8238c27c18e8Smrg# ------------
8239c27c18e8Smrg# Manipulate m4 lists.
8240c27c18e8Smrg# These macros are necessary as long as will still need to support
8241c27c18e8Smrg# Autoconf-2.59 which quotes differently.
8242c27c18e8Smrgm4_define([lt_car], [[$1]])
8243c27c18e8Smrgm4_define([lt_cdr],
8244c27c18e8Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
8245c27c18e8Smrg       [$#], 1, [],
8246c27c18e8Smrg       [m4_dquote(m4_shift($@))])])
8247c27c18e8Smrgm4_define([lt_unquote], $1)
8248c27c18e8Smrg
8249c27c18e8Smrg
8250c27c18e8Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
8251c27c18e8Smrg# ------------------------------------------
8252c27c18e8Smrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
8253c27c18e8Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
8254c27c18e8Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
8255c27c18e8Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
8256c27c18e8Smrg# than defined and empty).
825721e67964Smrg#
8258c27c18e8Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
8259c27c18e8Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
8260c27c18e8Smrgm4_define([lt_append],
8261c27c18e8Smrg[m4_define([$1],
8262c27c18e8Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
8263c27c18e8Smrg
8264c27c18e8Smrg
8265c27c18e8Smrg
8266c27c18e8Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
8267c27c18e8Smrg# ----------------------------------------------------------
8268c27c18e8Smrg# Produce a SEP delimited list of all paired combinations of elements of
8269c27c18e8Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
8270c27c18e8Smrg# has the form PREFIXmINFIXSUFFIXn.
8271c27c18e8Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
8272c27c18e8Smrgm4_define([lt_combine],
8273c27c18e8Smrg[m4_if(m4_eval([$# > 3]), [1],
8274c27c18e8Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
8275c27c18e8Smrg[[m4_foreach([_Lt_prefix], [$2],
8276c27c18e8Smrg	     [m4_foreach([_Lt_suffix],
8277c27c18e8Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
8278c27c18e8Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
8279c27c18e8Smrg
8280c27c18e8Smrg
8281c27c18e8Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
8282c27c18e8Smrg# -----------------------------------------------------------------------
8283c27c18e8Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
8284c27c18e8Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
8285c27c18e8Smrgm4_define([lt_if_append_uniq],
8286c27c18e8Smrg[m4_ifdef([$1],
8287c27c18e8Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
8288c27c18e8Smrg		 [lt_append([$1], [$2], [$3])$4],
8289c27c18e8Smrg		 [$5])],
8290c27c18e8Smrg	  [lt_append([$1], [$2], [$3])$4])])
8291c27c18e8Smrg
8292c27c18e8Smrg
8293c27c18e8Smrg# lt_dict_add(DICT, KEY, VALUE)
8294c27c18e8Smrg# -----------------------------
8295c27c18e8Smrgm4_define([lt_dict_add],
8296c27c18e8Smrg[m4_define([$1($2)], [$3])])
829721e67964Smrg
829821e67964Smrg
8299c27c18e8Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
8300c27c18e8Smrg# --------------------------------------------
8301c27c18e8Smrgm4_define([lt_dict_add_subkey],
8302c27c18e8Smrg[m4_define([$1($2:$3)], [$4])])
8303c27c18e8Smrg
830421e67964Smrg
8305c27c18e8Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
8306c27c18e8Smrg# ----------------------------------
8307c27c18e8Smrgm4_define([lt_dict_fetch],
8308c27c18e8Smrg[m4_ifval([$3],
8309c27c18e8Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
8310c27c18e8Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
831121e67964Smrg
831221e67964Smrg
8313c27c18e8Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
8314c27c18e8Smrg# -----------------------------------------------------------------
8315c27c18e8Smrgm4_define([lt_if_dict_fetch],
8316c27c18e8Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
8317c27c18e8Smrg	[$5],
8318c27c18e8Smrg    [$6])])
831921e67964Smrg
832021e67964Smrg
8321c27c18e8Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
8322c27c18e8Smrg# --------------------------------------------------------------
8323c27c18e8Smrgm4_define([lt_dict_filter],
8324c27c18e8Smrg[m4_if([$5], [], [],
8325c27c18e8Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
8326c27c18e8Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
8327c27c18e8Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
832821e67964Smrg])
832921e67964Smrg
8330c27c18e8Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
8331c27c18e8Smrg#
8332c27c18e8Smrg#   Copyright (C) 2004 Free Software Foundation, Inc.
8333c27c18e8Smrg#   Written by Scott James Remnant, 2004
8334c27c18e8Smrg#
8335c27c18e8Smrg# This file is free software; the Free Software Foundation gives
8336c27c18e8Smrg# unlimited permission to copy and/or distribute it, with or without
8337c27c18e8Smrg# modifications, as long as this notice is preserved.
833821e67964Smrg
8339b789ec8aSmrg# @configure_input@
834021e67964Smrg
8341b789ec8aSmrg# serial 3293 ltversion.m4
8342c27c18e8Smrg# This file is part of GNU Libtool
834321e67964Smrg
8344b789ec8aSmrgm4_define([LT_PACKAGE_VERSION], [2.4])
8345b789ec8aSmrgm4_define([LT_PACKAGE_REVISION], [1.3293])
834621e67964Smrg
8347c27c18e8SmrgAC_DEFUN([LTVERSION_VERSION],
8348b789ec8aSmrg[macro_version='2.4'
8349b789ec8aSmrgmacro_revision='1.3293'
8350c27c18e8Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
8351c27c18e8Smrg_LT_DECL(, macro_revision, 0)
835221e67964Smrg])
8353c43cc173Smrg
8354c27c18e8Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
8355c27c18e8Smrg#
835637eb1ca1Smrg#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
8357c27c18e8Smrg#   Written by Scott James Remnant, 2004.
8358c27c18e8Smrg#
8359c27c18e8Smrg# This file is free software; the Free Software Foundation gives
8360c27c18e8Smrg# unlimited permission to copy and/or distribute it, with or without
8361c27c18e8Smrg# modifications, as long as this notice is preserved.
8362c27c18e8Smrg
836337eb1ca1Smrg# serial 5 lt~obsolete.m4
8364c27c18e8Smrg
8365c27c18e8Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
8366c27c18e8Smrg#
8367c27c18e8Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
8368c27c18e8Smrg# which have later been changed to m4_define as they aren't part of the
8369c27c18e8Smrg# exported API, or moved to Autoconf or Automake where they belong.
8370c27c18e8Smrg#
8371c27c18e8Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
8372c27c18e8Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
8373c27c18e8Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
8374c27c18e8Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
8375c27c18e8Smrg# and doesn't know about Autoconf macros at all.)
8376c27c18e8Smrg#
8377c27c18e8Smrg# So we provide this file, which has a silly filename so it's always
8378c27c18e8Smrg# included after everything else.  This provides aclocal with the
8379c27c18e8Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
8380c27c18e8Smrg# because those macros already exist, or will be overwritten later.
8381c27c18e8Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
8382c27c18e8Smrg#
8383c27c18e8Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
8384c27c18e8Smrg# Yes, that means every name once taken will need to remain here until
8385c27c18e8Smrg# we give up compatibility with versions before 1.7, at which point
8386c27c18e8Smrg# we need to keep only those names which we still refer to.
8387c27c18e8Smrg
8388c27c18e8Smrg# This is to help aclocal find these macros, as it can't see m4_define.
8389c27c18e8SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
8390c27c18e8Smrg
8391c27c18e8Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
8392c27c18e8Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
8393c27c18e8Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
8394c27c18e8Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
8395c27c18e8Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
8396c27c18e8Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
8397c27c18e8Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
8398c27c18e8Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
8399c27c18e8Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
8400c27c18e8Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
8401c27c18e8Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
8402c27c18e8Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
8403c27c18e8Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
8404c27c18e8Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
8405c27c18e8Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
8406c27c18e8Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
8407c27c18e8Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
8408c27c18e8Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
8409c27c18e8Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
8410c27c18e8Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
8411c27c18e8Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
8412c27c18e8Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
8413c27c18e8Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
8414c27c18e8Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
8415c27c18e8Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
8416c27c18e8Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
8417c27c18e8Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
8418c27c18e8Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
8419c27c18e8Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
8420c27c18e8Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
8421c27c18e8Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
8422c27c18e8Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
8423c27c18e8Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
8424c27c18e8Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
8425c27c18e8Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
8426c27c18e8Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
8427c27c18e8Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
8428c27c18e8Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
8429c27c18e8Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
8430c27c18e8Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
8431c27c18e8Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
8432c27c18e8Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
8433c27c18e8Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
8434c27c18e8Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
8435c27c18e8Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
8436c27c18e8Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
8437c27c18e8Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
8438c27c18e8Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
8439c27c18e8Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
8440c27c18e8Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
8441c27c18e8Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
8442c27c18e8Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
8443c27c18e8Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
8444c27c18e8Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
844537eb1ca1Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
844637eb1ca1Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
844737eb1ca1Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
844837eb1ca1Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
844937eb1ca1Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
845037eb1ca1Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
845137eb1ca1Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
8452c27c18e8Smrg
845321e67964Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
845437eb1ca1Smrg# serial 1 (pkg-config-0.24)
845521e67964Smrg# 
845621e67964Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
845721e67964Smrg#
845821e67964Smrg# This program is free software; you can redistribute it and/or modify
845921e67964Smrg# it under the terms of the GNU General Public License as published by
846021e67964Smrg# the Free Software Foundation; either version 2 of the License, or
846121e67964Smrg# (at your option) any later version.
846221e67964Smrg#
846321e67964Smrg# This program is distributed in the hope that it will be useful, but
846421e67964Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
846521e67964Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
846621e67964Smrg# General Public License for more details.
846721e67964Smrg#
846821e67964Smrg# You should have received a copy of the GNU General Public License
846921e67964Smrg# along with this program; if not, write to the Free Software
847021e67964Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
847121e67964Smrg#
847221e67964Smrg# As a special exception to the GNU General Public License, if you
847321e67964Smrg# distribute this file as part of a program that contains a
847421e67964Smrg# configuration script generated by Autoconf, you may include it under
847521e67964Smrg# the same distribution terms that you use for the rest of that program.
8476c43cc173Smrg
847721e67964Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
847821e67964Smrg# ----------------------------------
847921e67964SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
848021e67964Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
848121e67964Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
848237eb1ca1SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
848337eb1ca1SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
848437eb1ca1SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
848537eb1ca1Smrg
848621e67964Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
848721e67964Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
848821e67964Smrgfi
848921e67964Smrgif test -n "$PKG_CONFIG"; then
849021e67964Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
849121e67964Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
849221e67964Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
849321e67964Smrg		AC_MSG_RESULT([yes])
849421e67964Smrg	else
849521e67964Smrg		AC_MSG_RESULT([no])
849621e67964Smrg		PKG_CONFIG=""
849721e67964Smrg	fi
849821e67964Smrgfi[]dnl
849921e67964Smrg])# PKG_PROG_PKG_CONFIG
8500c43cc173Smrg
850121e67964Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
850221e67964Smrg#
850321e67964Smrg# Check to see whether a particular set of modules exists.  Similar
850421e67964Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
850521e67964Smrg#
850637eb1ca1Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
850737eb1ca1Smrg# only at the first occurence in configure.ac, so if the first place
850837eb1ca1Smrg# it's called might be skipped (such as if it is within an "if", you
850937eb1ca1Smrg# have to call PKG_CHECK_EXISTS manually
851021e67964Smrg# --------------------------------------------------------------
851121e67964SmrgAC_DEFUN([PKG_CHECK_EXISTS],
851221e67964Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
851321e67964Smrgif test -n "$PKG_CONFIG" && \
851421e67964Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
851537eb1ca1Smrg  m4_default([$2], [:])
851621e67964Smrgm4_ifvaln([$3], [else
851721e67964Smrg  $3])dnl
851821e67964Smrgfi])
8519c43cc173Smrg
852021e67964Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
852121e67964Smrg# ---------------------------------------------
852221e67964Smrgm4_define([_PKG_CONFIG],
852321e67964Smrg[if test -n "$$1"; then
852421e67964Smrg    pkg_cv_[]$1="$$1"
852521e67964Smrg elif test -n "$PKG_CONFIG"; then
852621e67964Smrg    PKG_CHECK_EXISTS([$3],
852721e67964Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
852821e67964Smrg		     [pkg_failed=yes])
852921e67964Smrg else
853021e67964Smrg    pkg_failed=untried
853121e67964Smrgfi[]dnl
853221e67964Smrg])# _PKG_CONFIG
8533c43cc173Smrg
853421e67964Smrg# _PKG_SHORT_ERRORS_SUPPORTED
853521e67964Smrg# -----------------------------
853621e67964SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
853721e67964Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
853821e67964Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
853921e67964Smrg        _pkg_short_errors_supported=yes
854021e67964Smrgelse
854121e67964Smrg        _pkg_short_errors_supported=no
854221e67964Smrgfi[]dnl
854321e67964Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
8544c43cc173Smrg
8545c43cc173Smrg
854621e67964Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
854721e67964Smrg# [ACTION-IF-NOT-FOUND])
854821e67964Smrg#
854921e67964Smrg#
855021e67964Smrg# Note that if there is a possibility the first call to
855121e67964Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
855221e67964Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
855321e67964Smrg#
855421e67964Smrg#
855521e67964Smrg# --------------------------------------------------------------
855621e67964SmrgAC_DEFUN([PKG_CHECK_MODULES],
855721e67964Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
855821e67964SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
855921e67964SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
8560c43cc173Smrg
856121e67964Smrgpkg_failed=no
856221e67964SmrgAC_MSG_CHECKING([for $1])
8563c43cc173Smrg
856421e67964Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
856521e67964Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
8566c43cc173Smrg
856721e67964Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
856821e67964Smrgand $1[]_LIBS to avoid the need to call pkg-config.
856921e67964SmrgSee the pkg-config man page for more details.])
8570c43cc173Smrg
857121e67964Smrgif test $pkg_failed = yes; then
857237eb1ca1Smrg   	AC_MSG_RESULT([no])
857321e67964Smrg        _PKG_SHORT_ERRORS_SUPPORTED
857421e67964Smrg        if test $_pkg_short_errors_supported = yes; then
857521e67964Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
857621e67964Smrg        else 
857721e67964Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
857821e67964Smrg        fi
857921e67964Smrg	# Put the nasty error message in config.log where it belongs
858021e67964Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
8581c43cc173Smrg
858237eb1ca1Smrg	m4_default([$4], [AC_MSG_ERROR(
858321e67964Smrg[Package requirements ($2) were not met:
8584c43cc173Smrg
858521e67964Smrg$$1_PKG_ERRORS
8586c43cc173Smrg
858721e67964SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
858821e67964Smrginstalled software in a non-standard prefix.
8589c43cc173Smrg
859037eb1ca1Smrg_PKG_TEXT])
859137eb1ca1Smrg        ])
859221e67964Smrgelif test $pkg_failed = untried; then
859337eb1ca1Smrg     	AC_MSG_RESULT([no])
859437eb1ca1Smrg	m4_default([$4], [AC_MSG_FAILURE(
859521e67964Smrg[The pkg-config script could not be found or is too old.  Make sure it
859621e67964Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
859721e67964Smrgpath to pkg-config.
8598c43cc173Smrg
859921e67964Smrg_PKG_TEXT
8600c43cc173Smrg
860137eb1ca1SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])
860237eb1ca1Smrg        ])
860321e67964Smrgelse
860421e67964Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
860521e67964Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
860621e67964Smrg        AC_MSG_RESULT([yes])
860737eb1ca1Smrg	$3
860821e67964Smrgfi[]dnl
860921e67964Smrg])# PKG_CHECK_MODULES
8610c43cc173Smrg
8611b789ec8aSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
8612b789ec8aSmrgdnl
8613b789ec8aSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
8614b789ec8aSmrgdnl 
8615b789ec8aSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
8616b789ec8aSmrgdnl copy of this software and associated documentation files (the "Software"),
8617b789ec8aSmrgdnl to deal in the Software without restriction, including without limitation
8618b789ec8aSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
8619b789ec8aSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
8620b789ec8aSmrgdnl Software is furnished to do so, subject to the following conditions:
8621b789ec8aSmrgdnl
8622b789ec8aSmrgdnl The above copyright notice and this permission notice (including the next
8623b789ec8aSmrgdnl paragraph) shall be included in all copies or substantial portions of the
8624b789ec8aSmrgdnl Software.
8625b789ec8aSmrgdnl
8626b789ec8aSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
8627b789ec8aSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
8628b789ec8aSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
8629b789ec8aSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
8630b789ec8aSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
8631b789ec8aSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
8632b789ec8aSmrgdnl DEALINGS IN THE SOFTWARE.
863389069ce9Smrg
8634b789ec8aSmrg# XORG_MACROS_VERSION(required-version)
8635b789ec8aSmrg# -------------------------------------
8636b789ec8aSmrg# Minimum version: 1.1.0
863721e67964Smrg#
8638b789ec8aSmrg# If you're using a macro added in Version 1.1 or newer, include this in
8639b789ec8aSmrg# your configure.ac with the minimum required version, such as:
8640b789ec8aSmrg# XORG_MACROS_VERSION(1.1)
864121e67964Smrg#
8642b789ec8aSmrg# To ensure that this macro is defined, also add:
8643b789ec8aSmrg# m4_ifndef([XORG_MACROS_VERSION],
8644b789ec8aSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
864521e67964Smrg#
864689069ce9Smrg#
8647b789ec8aSmrg# See the "minimum version" comment for each macro you use to see what 
8648b789ec8aSmrg# version you require.
8649b789ec8aSmrgm4_defun([XORG_MACROS_VERSION],[
8650b789ec8aSmrgm4_define([vers_have], [1.13.0])
8651b789ec8aSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
8652b789ec8aSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
8653b789ec8aSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
8654b789ec8aSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
8655b789ec8aSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
8656b789ec8aSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
8657b789ec8aSmrgm4_undefine([vers_have])
8658b789ec8aSmrgm4_undefine([maj_have])
8659b789ec8aSmrgm4_undefine([maj_needed])
8660b789ec8aSmrg]) # XORG_MACROS_VERSION
8661c43cc173Smrg
8662b789ec8aSmrg# XORG_PROG_RAWCPP()
8663b789ec8aSmrg# ------------------
8664b789ec8aSmrg# Minimum version: 1.0.0
866521e67964Smrg#
8666b789ec8aSmrg# Find cpp program and necessary flags for use in pre-processing text files
8667b789ec8aSmrg# such as man pages and config files
8668b789ec8aSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
8669b789ec8aSmrgAC_REQUIRE([AC_PROG_CPP])
8670b789ec8aSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
8671b789ec8aSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
8672c43cc173Smrg
8673b789ec8aSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
8674b789ec8aSmrg# which is not the best choice for supporting other OS'es, but covers most
8675b789ec8aSmrg# of the ones we need for now.
8676b789ec8aSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
8677b789ec8aSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
8678b789ec8aSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
8679b789ec8aSmrg	AC_MSG_RESULT([no])
8680b789ec8aSmrgelse
8681b789ec8aSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
8682b789ec8aSmrg		RAWCPPFLAGS=-undef
8683b789ec8aSmrg		AC_MSG_RESULT([yes])
8684b789ec8aSmrg	# under Cygwin unix is still defined even with -undef
8685b789ec8aSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
8686b789ec8aSmrg		RAWCPPFLAGS="-undef -ansi"
8687b789ec8aSmrg		AC_MSG_RESULT([yes, with -ansi])
8688b789ec8aSmrg	else
8689b789ec8aSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
8690b789ec8aSmrg	fi
8691b789ec8aSmrgfi
8692b789ec8aSmrgrm -f conftest.$ac_ext
8693c43cc173Smrg
8694b789ec8aSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
8695b789ec8aSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
8696b789ec8aSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
8697b789ec8aSmrg	AC_MSG_RESULT([no])
869889069ce9Smrgelse
8699b789ec8aSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
8700b789ec8aSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
8701b789ec8aSmrg		AC_MSG_RESULT([yes])
8702b789ec8aSmrg	else
8703b789ec8aSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
8704b789ec8aSmrg	fi
870537eb1ca1Smrgfi
8706b789ec8aSmrgrm -f conftest.$ac_ext
8707b789ec8aSmrgAC_SUBST(RAWCPPFLAGS)
8708b789ec8aSmrg]) # XORG_PROG_RAWCPP
8709c43cc173Smrg
8710b789ec8aSmrg# XORG_MANPAGE_SECTIONS()
8711b789ec8aSmrg# -----------------------
8712b789ec8aSmrg# Minimum version: 1.0.0
871389069ce9Smrg#
8714b789ec8aSmrg# Determine which sections man pages go in for the different man page types
8715b789ec8aSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
8716b789ec8aSmrg# Not sure if there's any better way than just hardcoding by OS name.
8717b789ec8aSmrg# Override default settings by setting environment variables
8718b789ec8aSmrg# Added MAN_SUBSTS in version 1.8
8719b789ec8aSmrg# Added AC_PROG_SED in version 1.8
8720c27c18e8Smrg
8721b789ec8aSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
8722b789ec8aSmrgAC_REQUIRE([AC_CANONICAL_HOST])
8723b789ec8aSmrgAC_REQUIRE([AC_PROG_SED])
872421e67964Smrg
8725b789ec8aSmrgif test x$APP_MAN_SUFFIX = x    ; then
8726b789ec8aSmrg    APP_MAN_SUFFIX=1
8727b789ec8aSmrgfi
8728b789ec8aSmrgif test x$APP_MAN_DIR = x    ; then
8729b789ec8aSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
8730b789ec8aSmrgfi
873121e67964Smrg
8732b789ec8aSmrgif test x$LIB_MAN_SUFFIX = x    ; then
8733b789ec8aSmrg    LIB_MAN_SUFFIX=3
8734b789ec8aSmrgfi
8735b789ec8aSmrgif test x$LIB_MAN_DIR = x    ; then
8736b789ec8aSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
8737b789ec8aSmrgfi
873821e67964Smrg
8739b789ec8aSmrgif test x$FILE_MAN_SUFFIX = x    ; then
8740b789ec8aSmrg    case $host_os in
8741b789ec8aSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
8742b789ec8aSmrg	*)		FILE_MAN_SUFFIX=5  ;;
8743b789ec8aSmrg    esac
8744b789ec8aSmrgfi
8745b789ec8aSmrgif test x$FILE_MAN_DIR = x    ; then
8746b789ec8aSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
8747b789ec8aSmrgfi
8748c43cc173Smrg
8749b789ec8aSmrgif test x$MISC_MAN_SUFFIX = x    ; then
8750b789ec8aSmrg    case $host_os in
8751b789ec8aSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
8752b789ec8aSmrg	*)		MISC_MAN_SUFFIX=7  ;;
875389069ce9Smrg    esac
8754b789ec8aSmrgfi
8755b789ec8aSmrgif test x$MISC_MAN_DIR = x    ; then
8756b789ec8aSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
8757b789ec8aSmrgfi
8758c43cc173Smrg
8759b789ec8aSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
8760b789ec8aSmrg    case $host_os in
8761b789ec8aSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
8762b789ec8aSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
8763b789ec8aSmrg    esac
8764b789ec8aSmrgfi
8765b789ec8aSmrgif test x$DRIVER_MAN_DIR = x    ; then
8766b789ec8aSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
876737eb1ca1Smrgfi
8768c43cc173Smrg
8769b789ec8aSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
8770b789ec8aSmrg    case $host_os in
8771b789ec8aSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
8772b789ec8aSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
8773b789ec8aSmrg    esac
8774b789ec8aSmrgfi
8775b789ec8aSmrgif test x$ADMIN_MAN_DIR = x    ; then
8776b789ec8aSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
8777b789ec8aSmrgfi
8778c43cc173Smrg
8779c43cc173Smrg
8780b789ec8aSmrgAC_SUBST([APP_MAN_SUFFIX])
8781b789ec8aSmrgAC_SUBST([LIB_MAN_SUFFIX])
8782b789ec8aSmrgAC_SUBST([FILE_MAN_SUFFIX])
8783b789ec8aSmrgAC_SUBST([MISC_MAN_SUFFIX])
8784b789ec8aSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
8785b789ec8aSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
8786b789ec8aSmrgAC_SUBST([APP_MAN_DIR])
8787b789ec8aSmrgAC_SUBST([LIB_MAN_DIR])
8788b789ec8aSmrgAC_SUBST([FILE_MAN_DIR])
8789b789ec8aSmrgAC_SUBST([MISC_MAN_DIR])
8790b789ec8aSmrgAC_SUBST([DRIVER_MAN_DIR])
8791b789ec8aSmrgAC_SUBST([ADMIN_MAN_DIR])
8792c43cc173Smrg
8793b789ec8aSmrgXORG_MAN_PAGE="X Version 11"
8794b789ec8aSmrgAC_SUBST([XORG_MAN_PAGE])
8795b789ec8aSmrgMAN_SUBSTS="\
8796b789ec8aSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
8797b789ec8aSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
8798b789ec8aSmrg	-e 's|__xservername__|Xorg|g' \
8799b789ec8aSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
8800b789ec8aSmrg	-e 's|__projectroot__|\$(prefix)|g' \
8801b789ec8aSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
8802b789ec8aSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
8803b789ec8aSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
8804b789ec8aSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
8805b789ec8aSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
8806b789ec8aSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
8807b789ec8aSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
8808b789ec8aSmrgAC_SUBST([MAN_SUBSTS])
8809c43cc173Smrg
8810b789ec8aSmrg]) # XORG_MANPAGE_SECTIONS
8811c43cc173Smrg
8812b789ec8aSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
8813b789ec8aSmrg# ------------------------
8814b789ec8aSmrg# Minimum version: 1.7.0
881589069ce9Smrg#
8816b789ec8aSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
8817b789ec8aSmrg# provided by xorg-sgml-doctools, if installed.
8818b789ec8aSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
8819b789ec8aSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
8820b789ec8aSmrgXORG_SGML_PATH=
8821b789ec8aSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
8822b789ec8aSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
8823b789ec8aSmrg    [m4_ifval([$1],[:],
8824b789ec8aSmrg        [if test x"$cross_compiling" != x"yes" ; then
8825b789ec8aSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
8826b789ec8aSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
8827b789ec8aSmrg         fi])
8828b789ec8aSmrg    ])
8829c43cc173Smrg
8830b789ec8aSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
8831b789ec8aSmrg# the path and the name of the doc stylesheet
8832b789ec8aSmrgif test "x$XORG_SGML_PATH" != "x" ; then
8833b789ec8aSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
8834b789ec8aSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
8835b789ec8aSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
8836b789ec8aSmrgelse
8837b789ec8aSmrg   AC_MSG_RESULT([no])
8838b789ec8aSmrgfi
8839c43cc173Smrg
8840b789ec8aSmrgAC_SUBST(XORG_SGML_PATH)
8841b789ec8aSmrgAC_SUBST(STYLESHEET_SRCDIR)
8842b789ec8aSmrgAC_SUBST(XSL_STYLESHEET)
8843b789ec8aSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
8844b789ec8aSmrg]) # XORG_CHECK_SGML_DOCTOOLS
8845c43cc173Smrg
8846b789ec8aSmrg# XORG_CHECK_LINUXDOC
8847b789ec8aSmrg# -------------------
8848b789ec8aSmrg# Minimum version: 1.0.0
884989069ce9Smrg#
8850b789ec8aSmrg# Defines the variable MAKE_TEXT if the necessary tools and
8851b789ec8aSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
8852b789ec8aSmrg# Whether or not the necessary tools and files are found can be checked
8853b789ec8aSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
8854b789ec8aSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
8855b789ec8aSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
8856b789ec8aSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
8857c43cc173Smrg
8858b789ec8aSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
8859c27c18e8Smrg
8860b789ec8aSmrgAC_MSG_CHECKING([whether to build documentation])
886189069ce9Smrg
8862b789ec8aSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
8863b789ec8aSmrg   BUILDDOC=yes
8864b789ec8aSmrgelse
8865b789ec8aSmrg   BUILDDOC=no
8866b789ec8aSmrgfi
886789069ce9Smrg
8868b789ec8aSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
8869c43cc173Smrg
8870b789ec8aSmrgAC_MSG_RESULT([$BUILDDOC])
8871c43cc173Smrg
8872b789ec8aSmrgAC_MSG_CHECKING([whether to build pdf documentation])
8873c43cc173Smrg
8874b789ec8aSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
8875b789ec8aSmrg   BUILDPDFDOC=yes
8876b789ec8aSmrgelse
8877b789ec8aSmrg   BUILDPDFDOC=no
8878c27c18e8Smrgfi
8879c43cc173Smrg
8880b789ec8aSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
8881c43cc173Smrg
8882b789ec8aSmrgAC_MSG_RESULT([$BUILDPDFDOC])
8883c43cc173Smrg
8884b789ec8aSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
8885b789ec8aSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
8886b789ec8aSmrgMAKE_PDF="$PS2PDF"
8887b789ec8aSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
8888c43cc173Smrg
8889b789ec8aSmrgAC_SUBST(MAKE_TEXT)
8890b789ec8aSmrgAC_SUBST(MAKE_PS)
8891b789ec8aSmrgAC_SUBST(MAKE_PDF)
8892b789ec8aSmrgAC_SUBST(MAKE_HTML)
8893b789ec8aSmrg]) # XORG_CHECK_LINUXDOC
8894c43cc173Smrg
8895b789ec8aSmrg# XORG_CHECK_DOCBOOK
8896b789ec8aSmrg# -------------------
8897b789ec8aSmrg# Minimum version: 1.0.0
8898b789ec8aSmrg#
8899b789ec8aSmrg# Checks for the ability to build output formats from SGML DocBook source.
8900b789ec8aSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
8901b789ec8aSmrg# indicates whether the necessary tools and files are found and, if set,
8902b789ec8aSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
8903b789ec8aSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
8904b789ec8aSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
8905c43cc173Smrg
8906b789ec8aSmrgBUILDTXTDOC=no
8907b789ec8aSmrgBUILDPDFDOC=no
8908b789ec8aSmrgBUILDPSDOC=no
8909b789ec8aSmrgBUILDHTMLDOC=no
8910c43cc173Smrg
8911b789ec8aSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
8912b789ec8aSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
8913b789ec8aSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
8914b789ec8aSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
8915c43cc173Smrg
8916b789ec8aSmrgAC_MSG_CHECKING([whether to build text documentation])
8917b789ec8aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
8918b789ec8aSmrg   test x$BUILD_TXTDOC != xno; then
8919b789ec8aSmrg	BUILDTXTDOC=yes
892037eb1ca1Smrgfi
8921b789ec8aSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
8922b789ec8aSmrgAC_MSG_RESULT([$BUILDTXTDOC])
8923c43cc173Smrg
8924b789ec8aSmrgAC_MSG_CHECKING([whether to build PDF documentation])
8925b789ec8aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
8926b789ec8aSmrg   test x$BUILD_PDFDOC != xno; then
8927b789ec8aSmrg	BUILDPDFDOC=yes
8928b789ec8aSmrgfi
8929b789ec8aSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
8930b789ec8aSmrgAC_MSG_RESULT([$BUILDPDFDOC])
8931c27c18e8Smrg
8932b789ec8aSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
8933b789ec8aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
8934b789ec8aSmrg   test x$BUILD_PSDOC != xno; then
8935b789ec8aSmrg	BUILDPSDOC=yes
8936b789ec8aSmrgfi
8937b789ec8aSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
8938b789ec8aSmrgAC_MSG_RESULT([$BUILDPSDOC])
893989069ce9Smrg
8940b789ec8aSmrgAC_MSG_CHECKING([whether to build HTML documentation])
8941b789ec8aSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
8942b789ec8aSmrg   test x$BUILD_HTMLDOC != xno; then
8943b789ec8aSmrg	BUILDHTMLDOC=yes
894421e67964Smrgfi
8945b789ec8aSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
8946b789ec8aSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
8947c43cc173Smrg
8948b789ec8aSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
8949b789ec8aSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
8950b789ec8aSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
8951b789ec8aSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
895289069ce9Smrg
8953b789ec8aSmrgAC_SUBST(MAKE_TEXT)
8954b789ec8aSmrgAC_SUBST(MAKE_PS)
8955b789ec8aSmrgAC_SUBST(MAKE_PDF)
8956b789ec8aSmrgAC_SUBST(MAKE_HTML)
8957b789ec8aSmrg]) # XORG_CHECK_DOCBOOK
8958c43cc173Smrg
8959b789ec8aSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
8960b789ec8aSmrg# ----------------
8961b789ec8aSmrg# Minimum version: 1.5.0
8962b789ec8aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
8963b789ec8aSmrg#
8964b789ec8aSmrg# Documentation tools are not always available on all platforms and sometimes
8965b789ec8aSmrg# not at the appropriate level. This macro enables a module to test for the
8966b789ec8aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
8967b789ec8aSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
8968b789ec8aSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
8969b789ec8aSmrg# --with-xmlto assumes 'auto'.
8970b789ec8aSmrg#
8971b789ec8aSmrg# Interface to module:
8972b789ec8aSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
8973b789ec8aSmrg# XMLTO:	returns the path of the xmlto program found
8974b789ec8aSmrg#		returns the path set by the user in the environment
8975b789ec8aSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
8976b789ec8aSmrg#		'no' user instructs the module not to use xmlto
8977b789ec8aSmrg#
8978b789ec8aSmrg# Added in version 1.10.0
8979b789ec8aSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
8980b789ec8aSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
8981b789ec8aSmrg#
8982b789ec8aSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
8983b789ec8aSmrg#
8984b789ec8aSmrgAC_DEFUN([XORG_WITH_XMLTO],[
8985b789ec8aSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
8986b789ec8aSmrgm4_define([_defopt], m4_default([$2], [auto]))
8987b789ec8aSmrgAC_ARG_WITH(xmlto,
8988b789ec8aSmrg	AS_HELP_STRING([--with-xmlto],
8989b789ec8aSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
8990b789ec8aSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
8991b789ec8aSmrgm4_undefine([_defopt])
8992c27c18e8Smrg
8993b789ec8aSmrgif test "x$use_xmlto" = x"auto"; then
8994b789ec8aSmrg   AC_PATH_PROG([XMLTO], [xmlto])
8995b789ec8aSmrg   if test "x$XMLTO" = "x"; then
8996b789ec8aSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
8997b789ec8aSmrg	have_xmlto=no
8998b789ec8aSmrg   else
8999b789ec8aSmrg        have_xmlto=yes
9000b789ec8aSmrg   fi
9001b789ec8aSmrgelif test "x$use_xmlto" = x"yes" ; then
9002b789ec8aSmrg   AC_PATH_PROG([XMLTO], [xmlto])
9003b789ec8aSmrg   if test "x$XMLTO" = "x"; then
9004b789ec8aSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
9005b789ec8aSmrg   fi
9006b789ec8aSmrg   have_xmlto=yes
9007b789ec8aSmrgelif test "x$use_xmlto" = x"no" ; then
9008b789ec8aSmrg   if test "x$XMLTO" != "x"; then
9009b789ec8aSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
9010b789ec8aSmrg   fi
9011b789ec8aSmrg   have_xmlto=no
9012b789ec8aSmrgelse
9013b789ec8aSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
9014b789ec8aSmrgfi
9015c43cc173Smrg
9016b789ec8aSmrg# Test for a minimum version of xmlto, if provided.
9017b789ec8aSmrgm4_ifval([$1],
9018b789ec8aSmrg[if test "$have_xmlto" = yes; then
9019b789ec8aSmrg    # scrape the xmlto version
9020b789ec8aSmrg    AC_MSG_CHECKING([the xmlto version])
9021b789ec8aSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
9022b789ec8aSmrg    AC_MSG_RESULT([$xmlto_version])
9023b789ec8aSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
9024b789ec8aSmrg        [if test "x$use_xmlto" = xauto; then
9025b789ec8aSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
9026b789ec8aSmrg            have_xmlto=no
9027b789ec8aSmrg        else
9028b789ec8aSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
9029b789ec8aSmrg        fi])
9030b789ec8aSmrgfi])
9031c27c18e8Smrg
9032b789ec8aSmrg# Test for the ability of xmlto to generate a text target
9033b789ec8aSmrghave_xmlto_text=no
9034b789ec8aSmrgcat > conftest.xml << "EOF"
9035b789ec8aSmrgEOF
9036b789ec8aSmrgAS_IF([test "$have_xmlto" = yes],
9037b789ec8aSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
9038b789ec8aSmrg             [have_xmlto_text=yes],
9039b789ec8aSmrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
9040b789ec8aSmrgrm -f conftest.xml
9041b789ec8aSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
9042b789ec8aSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
9043b789ec8aSmrg]) # XORG_WITH_XMLTO
9044c43cc173Smrg
9045b789ec8aSmrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
9046b789ec8aSmrg# --------------------------------------------
9047b789ec8aSmrg# Minimum version: 1.12.0
9048b789ec8aSmrg# Minimum version for optional DEFAULT argument: 1.12.0
904937eb1ca1Smrg#
9050b789ec8aSmrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
9051b789ec8aSmrg# XML-based language used for the transformation of XML documents.
9052b789ec8aSmrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
9053b789ec8aSmrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
9054b789ec8aSmrg# The XSLT processor is often used as a standalone tool for transformations.
9055b789ec8aSmrg# It should not be assumed that this tool is used only to work with documnetation.
9056b789ec8aSmrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
9057b789ec8aSmrg#
9058b789ec8aSmrg# Interface to module:
9059b789ec8aSmrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
9060b789ec8aSmrg# XSLTPROC:	 returns the path of the xsltproc program found
9061b789ec8aSmrg#		 returns the path set by the user in the environment
9062b789ec8aSmrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
9063b789ec8aSmrg#		  'no' user instructs the module not to use xsltproc
9064b789ec8aSmrg# have_xsltproc: returns yes if xsltproc found in PATH or no
9065b789ec8aSmrg#
9066b789ec8aSmrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
9067b789ec8aSmrg#
9068b789ec8aSmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
9069b789ec8aSmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
9070b789ec8aSmrgm4_define([_defopt], m4_default([$2], [auto]))
9071b789ec8aSmrgAC_ARG_WITH(xsltproc,
9072b789ec8aSmrg	AS_HELP_STRING([--with-xsltproc],
9073b789ec8aSmrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
9074b789ec8aSmrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
9075b789ec8aSmrgm4_undefine([_defopt])
9076b789ec8aSmrg
9077b789ec8aSmrgif test "x$use_xsltproc" = x"auto"; then
9078b789ec8aSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
9079b789ec8aSmrg   if test "x$XSLTPROC" = "x"; then
9080b789ec8aSmrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
9081b789ec8aSmrg	have_xsltproc=no
9082b789ec8aSmrg   else
9083b789ec8aSmrg        have_xsltproc=yes
9084b789ec8aSmrg   fi
9085b789ec8aSmrgelif test "x$use_xsltproc" = x"yes" ; then
9086b789ec8aSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
9087b789ec8aSmrg   if test "x$XSLTPROC" = "x"; then
9088b789ec8aSmrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
9089b789ec8aSmrg   fi
9090b789ec8aSmrg   have_xsltproc=yes
9091b789ec8aSmrgelif test "x$use_xsltproc" = x"no" ; then
9092b789ec8aSmrg   if test "x$XSLTPROC" != "x"; then
9093b789ec8aSmrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
9094b789ec8aSmrg   fi
9095b789ec8aSmrg   have_xsltproc=no
9096b789ec8aSmrgelse
9097b789ec8aSmrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
9098b789ec8aSmrgfi
909989069ce9Smrg
9100b789ec8aSmrg# Checking for minimum version is not implemented
9101b789ec8aSmrg# but we want to keep the interface consistent with other commands
9102b789ec8aSmrgm4_ifval([$1],[AC_MSG_WARN(Checking for MIN-VERSION is not implemented.)])
910389069ce9Smrg
9104b789ec8aSmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
9105b789ec8aSmrg]) # XORG_WITH_XSLTPROC
910689069ce9Smrg
910789069ce9Smrg
9108b789ec8aSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
9109b789ec8aSmrg# ----------------
9110b789ec8aSmrg# Minimum version: 1.5.0
9111b789ec8aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
911237eb1ca1Smrg#
9113b789ec8aSmrg# Documentation tools are not always available on all platforms and sometimes
9114b789ec8aSmrg# not at the appropriate level. This macro enables a module to test for the
9115b789ec8aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
9116b789ec8aSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
9117b789ec8aSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
9118b789ec8aSmrg# --with-asciidoc assumes 'auto'.
9119b789ec8aSmrg#
9120b789ec8aSmrg# Interface to module:
9121b789ec8aSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
9122b789ec8aSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
9123b789ec8aSmrg#		 returns the path set by the user in the environment
9124b789ec8aSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
9125b789ec8aSmrg#		  'no' user instructs the module not to use asciidoc
9126b789ec8aSmrg#
9127b789ec8aSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
9128b789ec8aSmrg#
9129b789ec8aSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
9130b789ec8aSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
9131b789ec8aSmrgm4_define([_defopt], m4_default([$2], [auto]))
9132b789ec8aSmrgAC_ARG_WITH(asciidoc,
9133b789ec8aSmrg	AS_HELP_STRING([--with-asciidoc],
9134b789ec8aSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
9135b789ec8aSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
9136b789ec8aSmrgm4_undefine([_defopt])
913789069ce9Smrg
9138b789ec8aSmrgif test "x$use_asciidoc" = x"auto"; then
9139b789ec8aSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
9140b789ec8aSmrg   if test "x$ASCIIDOC" = "x"; then
9141b789ec8aSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
9142b789ec8aSmrg	have_asciidoc=no
9143b789ec8aSmrg   else
9144b789ec8aSmrg        have_asciidoc=yes
9145b789ec8aSmrg   fi
9146b789ec8aSmrgelif test "x$use_asciidoc" = x"yes" ; then
9147b789ec8aSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
9148b789ec8aSmrg   if test "x$ASCIIDOC" = "x"; then
9149b789ec8aSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
9150b789ec8aSmrg   fi
9151b789ec8aSmrg   have_asciidoc=yes
9152b789ec8aSmrgelif test "x$use_asciidoc" = x"no" ; then
9153b789ec8aSmrg   if test "x$ASCIIDOC" != "x"; then
9154b789ec8aSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
9155b789ec8aSmrg   fi
9156b789ec8aSmrg   have_asciidoc=no
915737eb1ca1Smrgelse
9158b789ec8aSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
915937eb1ca1Smrgfi
9160b789ec8aSmrgm4_ifval([$1],
9161b789ec8aSmrg[if test "$have_asciidoc" = yes; then
9162b789ec8aSmrg    # scrape the asciidoc version
9163b789ec8aSmrg    AC_MSG_CHECKING([the asciidoc version])
9164b789ec8aSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
9165b789ec8aSmrg    AC_MSG_RESULT([$asciidoc_version])
9166b789ec8aSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
9167b789ec8aSmrg        [if test "x$use_asciidoc" = xauto; then
9168b789ec8aSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
9169b789ec8aSmrg            have_asciidoc=no
9170b789ec8aSmrg        else
9171b789ec8aSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
9172b789ec8aSmrg        fi])
9173b789ec8aSmrgfi])
9174b789ec8aSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
9175b789ec8aSmrg]) # XORG_WITH_ASCIIDOC
9176c43cc173Smrg
9177b789ec8aSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
9178b789ec8aSmrg# --------------------------------
9179b789ec8aSmrg# Minimum version: 1.5.0
9180b789ec8aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
9181c43cc173Smrg#
9182b789ec8aSmrg# Documentation tools are not always available on all platforms and sometimes
9183b789ec8aSmrg# not at the appropriate level. This macro enables a module to test for the
9184b789ec8aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
9185b789ec8aSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
9186b789ec8aSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
9187b789ec8aSmrg# --with-doxygen assumes 'auto'.
918837eb1ca1Smrg#
9189b789ec8aSmrg# Interface to module:
9190b789ec8aSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
9191b789ec8aSmrg# DOXYGEN:	 returns the path of the doxygen program found
9192b789ec8aSmrg#		 returns the path set by the user in the environment
9193b789ec8aSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
9194b789ec8aSmrg#		  'no' user instructs the module not to use doxygen
919537eb1ca1Smrg#
9196b789ec8aSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
9197b789ec8aSmrg#
9198b789ec8aSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
9199b789ec8aSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
9200b789ec8aSmrgm4_define([_defopt], m4_default([$2], [auto]))
9201b789ec8aSmrgAC_ARG_WITH(doxygen,
9202b789ec8aSmrg	AS_HELP_STRING([--with-doxygen],
9203b789ec8aSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
9204b789ec8aSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
9205b789ec8aSmrgm4_undefine([_defopt])
920689069ce9Smrg
9207b789ec8aSmrgif test "x$use_doxygen" = x"auto"; then
9208b789ec8aSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
9209b789ec8aSmrg   if test "x$DOXYGEN" = "x"; then
9210b789ec8aSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
9211b789ec8aSmrg	have_doxygen=no
9212b789ec8aSmrg   else
9213b789ec8aSmrg        have_doxygen=yes
921437eb1ca1Smrg   fi
9215b789ec8aSmrgelif test "x$use_doxygen" = x"yes" ; then
9216b789ec8aSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
9217b789ec8aSmrg   if test "x$DOXYGEN" = "x"; then
9218b789ec8aSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
921937eb1ca1Smrg   fi
9220b789ec8aSmrg   have_doxygen=yes
9221b789ec8aSmrgelif test "x$use_doxygen" = x"no" ; then
9222b789ec8aSmrg   if test "x$DOXYGEN" != "x"; then
9223b789ec8aSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
9224b789ec8aSmrg   fi
9225b789ec8aSmrg   have_doxygen=no
922637eb1ca1Smrgelse
9227b789ec8aSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
922837eb1ca1Smrgfi
9229b789ec8aSmrgm4_ifval([$1],
9230b789ec8aSmrg[if test "$have_doxygen" = yes; then
9231b789ec8aSmrg    # scrape the doxygen version
9232b789ec8aSmrg    AC_MSG_CHECKING([the doxygen version])
9233b789ec8aSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
9234b789ec8aSmrg    AC_MSG_RESULT([$doxygen_version])
9235b789ec8aSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
9236b789ec8aSmrg        [if test "x$use_doxygen" = xauto; then
9237b789ec8aSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
9238b789ec8aSmrg            have_doxygen=no
9239b789ec8aSmrg        else
9240b789ec8aSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
9241b789ec8aSmrg        fi])
9242b789ec8aSmrgfi])
9243b789ec8aSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
9244b789ec8aSmrg]) # XORG_WITH_DOXYGEN
9245c43cc173Smrg
9246b789ec8aSmrg# XORG_WITH_GROFF([DEFAULT])
9247b789ec8aSmrg# ----------------
9248b789ec8aSmrg# Minimum version: 1.6.0
9249b789ec8aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
925037eb1ca1Smrg#
9251b789ec8aSmrg# Documentation tools are not always available on all platforms and sometimes
9252b789ec8aSmrg# not at the appropriate level. This macro enables a module to test for the
9253b789ec8aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
9254b789ec8aSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
9255b789ec8aSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
9256b789ec8aSmrg# --with-groff assumes 'auto'.
9257c43cc173Smrg#
9258b789ec8aSmrg# Interface to module:
9259b789ec8aSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
9260b789ec8aSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
9261b789ec8aSmrg# HAVE_GROFF_MS: the -ms macros package
9262b789ec8aSmrg# GROFF:	 returns the path of the groff program found
9263b789ec8aSmrg#		 returns the path set by the user in the environment
9264b789ec8aSmrg# --with-groff:	 'yes' user instructs the module to use groff
9265b789ec8aSmrg#		 'no' user instructs the module not to use groff
9266b789ec8aSmrg#
9267b789ec8aSmrg# Added in version 1.9.0:
9268b789ec8aSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
9269b789ec8aSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
9270b789ec8aSmrg#		   psselect from the psutils package.
9271b789ec8aSmrg#		   the ghostcript package. Refer to the grohtml man pages
9272b789ec8aSmrg#
9273b789ec8aSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
9274b789ec8aSmrg#
9275b789ec8aSmrg# OS and distros often splits groff in a basic and full package, the former
9276b789ec8aSmrg# having the groff program and the later having devices, fonts and macros
9277b789ec8aSmrg# Checking for the groff executable is not enough.
9278b789ec8aSmrg#
9279b789ec8aSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
9280b789ec8aSmrg# unset HAVE_GROFF or GROFF env variables.
9281b789ec8aSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
9282b789ec8aSmrg#
9283b789ec8aSmrgAC_DEFUN([XORG_WITH_GROFF],[
9284b789ec8aSmrgAC_ARG_VAR([GROFF], [Path to groff command])
9285b789ec8aSmrgm4_define([_defopt], m4_default([$1], [auto]))
9286b789ec8aSmrgAC_ARG_WITH(groff,
9287b789ec8aSmrg	AS_HELP_STRING([--with-groff],
9288b789ec8aSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
9289b789ec8aSmrg	   [use_groff=$withval], [use_groff=]_defopt)
9290b789ec8aSmrgm4_undefine([_defopt])
929137eb1ca1Smrg
9292b789ec8aSmrgif test "x$use_groff" = x"auto"; then
9293b789ec8aSmrg   AC_PATH_PROG([GROFF], [groff])
9294b789ec8aSmrg   if test "x$GROFF" = "x"; then
9295b789ec8aSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
9296b789ec8aSmrg	have_groff=no
9297b789ec8aSmrg   else
9298b789ec8aSmrg        have_groff=yes
9299b789ec8aSmrg   fi
9300b789ec8aSmrgelif test "x$use_groff" = x"yes" ; then
9301b789ec8aSmrg   AC_PATH_PROG([GROFF], [groff])
9302b789ec8aSmrg   if test "x$GROFF" = "x"; then
9303b789ec8aSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
9304b789ec8aSmrg   fi
9305b789ec8aSmrg   have_groff=yes
9306b789ec8aSmrgelif test "x$use_groff" = x"no" ; then
9307b789ec8aSmrg   if test "x$GROFF" != "x"; then
9308b789ec8aSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
9309b789ec8aSmrg   fi
9310b789ec8aSmrg   have_groff=no
9311b789ec8aSmrgelse
9312b789ec8aSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
9313b789ec8aSmrgfi
931489069ce9Smrg
9315b789ec8aSmrg# We have groff, test for the presence of the macro packages
9316b789ec8aSmrgif test "x$have_groff" = x"yes"; then
9317b789ec8aSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
9318b789ec8aSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
9319b789ec8aSmrg        groff_ms_works=yes
9320b789ec8aSmrg    else
9321b789ec8aSmrg        groff_ms_works=no
9322b789ec8aSmrg    fi
9323b789ec8aSmrg    AC_MSG_RESULT([$groff_ms_works])
9324b789ec8aSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
9325b789ec8aSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
9326b789ec8aSmrg        groff_mm_works=yes
9327b789ec8aSmrg    else
9328b789ec8aSmrg        groff_mm_works=no
9329b789ec8aSmrg    fi
9330b789ec8aSmrg    AC_MSG_RESULT([$groff_mm_works])
9331b789ec8aSmrgfi
933289069ce9Smrg
9333b789ec8aSmrg# We have groff, test for HTML dependencies, one command per package
9334b789ec8aSmrgif test "x$have_groff" = x"yes"; then
9335b789ec8aSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
9336b789ec8aSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
9337b789ec8aSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
9338b789ec8aSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
9339b789ec8aSmrg      have_groff_html=yes
9340b789ec8aSmrg   else
9341b789ec8aSmrg      have_groff_html=no
9342b789ec8aSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
9343b789ec8aSmrg   fi
9344b789ec8aSmrgfi
934589069ce9Smrg
9346b789ec8aSmrg# Set Automake conditionals for Makefiles
9347b789ec8aSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
9348b789ec8aSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
9349b789ec8aSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
9350b789ec8aSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
9351b789ec8aSmrg]) # XORG_WITH_GROFF
935289069ce9Smrg
9353b789ec8aSmrg# XORG_WITH_FOP([DEFAULT])
9354b789ec8aSmrg# ----------------
9355b789ec8aSmrg# Minimum version: 1.6.0
9356b789ec8aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
9357c43cc173Smrg#
9358b789ec8aSmrg# Documentation tools are not always available on all platforms and sometimes
9359b789ec8aSmrg# not at the appropriate level. This macro enables a module to test for the
9360b789ec8aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
9361b789ec8aSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
9362b789ec8aSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
9363b789ec8aSmrg# --with-fop assumes 'auto'.
9364b789ec8aSmrg#
9365b789ec8aSmrg# Interface to module:
9366b789ec8aSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
9367b789ec8aSmrg# FOP:	 	returns the path of the fop program found
9368b789ec8aSmrg#		returns the path set by the user in the environment
9369b789ec8aSmrg# --with-fop: 	'yes' user instructs the module to use fop
9370b789ec8aSmrg#		'no' user instructs the module not to use fop
9371b789ec8aSmrg#
9372b789ec8aSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
9373b789ec8aSmrg#
9374b789ec8aSmrgAC_DEFUN([XORG_WITH_FOP],[
9375b789ec8aSmrgAC_ARG_VAR([FOP], [Path to fop command])
9376b789ec8aSmrgm4_define([_defopt], m4_default([$1], [auto]))
9377b789ec8aSmrgAC_ARG_WITH(fop,
9378b789ec8aSmrg	AS_HELP_STRING([--with-fop],
9379b789ec8aSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
9380b789ec8aSmrg	   [use_fop=$withval], [use_fop=]_defopt)
9381b789ec8aSmrgm4_undefine([_defopt])
938289069ce9Smrg
9383b789ec8aSmrgif test "x$use_fop" = x"auto"; then
9384b789ec8aSmrg   AC_PATH_PROG([FOP], [fop])
9385b789ec8aSmrg   if test "x$FOP" = "x"; then
9386b789ec8aSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
9387b789ec8aSmrg	have_fop=no
9388b789ec8aSmrg   else
9389b789ec8aSmrg        have_fop=yes
9390b789ec8aSmrg   fi
9391b789ec8aSmrgelif test "x$use_fop" = x"yes" ; then
9392b789ec8aSmrg   AC_PATH_PROG([FOP], [fop])
9393b789ec8aSmrg   if test "x$FOP" = "x"; then
9394b789ec8aSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
9395b789ec8aSmrg   fi
9396b789ec8aSmrg   have_fop=yes
9397b789ec8aSmrgelif test "x$use_fop" = x"no" ; then
9398b789ec8aSmrg   if test "x$FOP" != "x"; then
9399b789ec8aSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
9400b789ec8aSmrg   fi
9401b789ec8aSmrg   have_fop=no
9402b789ec8aSmrgelse
9403b789ec8aSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
9404b789ec8aSmrgfi
9405b789ec8aSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
9406b789ec8aSmrg]) # XORG_WITH_FOP
940789069ce9Smrg
9408b789ec8aSmrg# XORG_WITH_PS2PDF([DEFAULT])
9409b789ec8aSmrg# ----------------
9410b789ec8aSmrg# Minimum version: 1.6.0
9411b789ec8aSmrg# Minimum version for optional DEFAULT argument: 1.11.0
941237eb1ca1Smrg#
9413b789ec8aSmrg# Documentation tools are not always available on all platforms and sometimes
9414b789ec8aSmrg# not at the appropriate level. This macro enables a module to test for the
9415b789ec8aSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
9416b789ec8aSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
9417b789ec8aSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
9418b789ec8aSmrg# --with-ps2pdf assumes 'auto'.
941937eb1ca1Smrg#
9420b789ec8aSmrg# Interface to module:
9421b789ec8aSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
9422b789ec8aSmrg# PS2PDF:	returns the path of the ps2pdf program found
9423b789ec8aSmrg#		returns the path set by the user in the environment
9424b789ec8aSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
9425b789ec8aSmrg#		 'no' user instructs the module not to use ps2pdf
9426b789ec8aSmrg#
9427b789ec8aSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
9428b789ec8aSmrg#
9429b789ec8aSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
9430b789ec8aSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
9431b789ec8aSmrgm4_define([_defopt], m4_default([$1], [auto]))
9432b789ec8aSmrgAC_ARG_WITH(ps2pdf,
9433b789ec8aSmrg	AS_HELP_STRING([--with-ps2pdf],
9434b789ec8aSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
9435b789ec8aSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
9436b789ec8aSmrgm4_undefine([_defopt])
9437c43cc173Smrg
9438b789ec8aSmrgif test "x$use_ps2pdf" = x"auto"; then
9439b789ec8aSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
9440b789ec8aSmrg   if test "x$PS2PDF" = "x"; then
9441b789ec8aSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
9442b789ec8aSmrg	have_ps2pdf=no
9443b789ec8aSmrg   else
9444b789ec8aSmrg        have_ps2pdf=yes
9445b789ec8aSmrg   fi
9446b789ec8aSmrgelif test "x$use_ps2pdf" = x"yes" ; then
9447b789ec8aSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
9448b789ec8aSmrg   if test "x$PS2PDF" = "x"; then
9449b789ec8aSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
9450b789ec8aSmrg   fi
9451b789ec8aSmrg   have_ps2pdf=yes
9452b789ec8aSmrgelif test "x$use_ps2pdf" = x"no" ; then
9453b789ec8aSmrg   if test "x$PS2PDF" != "x"; then
9454b789ec8aSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
9455b789ec8aSmrg   fi
9456b789ec8aSmrg   have_ps2pdf=no
9457b789ec8aSmrgelse
9458b789ec8aSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
9459b789ec8aSmrgfi
9460b789ec8aSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
9461b789ec8aSmrg]) # XORG_WITH_PS2PDF
9462c43cc173Smrg
9463b789ec8aSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
9464b789ec8aSmrg# ----------------
9465b789ec8aSmrg# Minimum version: 1.6.0
9466b789ec8aSmrg#
9467b789ec8aSmrg# Documentation tools are not always available on all platforms and sometimes
9468b789ec8aSmrg# not at the appropriate level. This macro enables a builder to skip all
9469b789ec8aSmrg# documentation targets except traditional man pages.
9470b789ec8aSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
9471b789ec8aSmrg# maximum flexibilty in controlling documentation building.
9472b789ec8aSmrg# Refer to:
9473b789ec8aSmrg# XORG_WITH_XMLTO         --with-xmlto
9474b789ec8aSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
9475b789ec8aSmrg# XORG_WITH_DOXYGEN       --with-doxygen
9476b789ec8aSmrg# XORG_WITH_FOP           --with-fop
9477b789ec8aSmrg# XORG_WITH_GROFF         --with-groff
9478b789ec8aSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
9479b789ec8aSmrg#
9480b789ec8aSmrg# Interface to module:
9481b789ec8aSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
9482b789ec8aSmrg# --enable-docs: 'yes' user instructs the module to generate docs
9483b789ec8aSmrg#		 'no' user instructs the module not to generate docs
9484b789ec8aSmrg# parm1:	specify the default value, yes or no.
9485b789ec8aSmrg#
9486b789ec8aSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
9487b789ec8aSmrgm4_define([docs_default], m4_default([$1], [yes]))
9488b789ec8aSmrgAC_ARG_ENABLE(docs,
9489b789ec8aSmrg	AS_HELP_STRING([--enable-docs],
9490b789ec8aSmrg	   [Enable building the documentation (default: ]docs_default[)]),
9491b789ec8aSmrg	   [build_docs=$enableval], [build_docs=]docs_default)
9492b789ec8aSmrgm4_undefine([docs_default])
9493b789ec8aSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
9494b789ec8aSmrgAC_MSG_CHECKING([whether to build documentation])
9495b789ec8aSmrgAC_MSG_RESULT([$build_docs])
9496b789ec8aSmrg]) # XORG_ENABLE_DOCS
9497b789ec8aSmrg
9498b789ec8aSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
9499b789ec8aSmrg# ----------------
9500b789ec8aSmrg# Minimum version: 1.6.0
9501b789ec8aSmrg#
9502b789ec8aSmrg# This macro enables a builder to skip all developer documentation.
9503b789ec8aSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
9504b789ec8aSmrg# maximum flexibilty in controlling documentation building.
9505b789ec8aSmrg# Refer to:
9506b789ec8aSmrg# XORG_WITH_XMLTO         --with-xmlto
9507b789ec8aSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
9508b789ec8aSmrg# XORG_WITH_DOXYGEN       --with-doxygen
9509b789ec8aSmrg# XORG_WITH_FOP           --with-fop
9510b789ec8aSmrg# XORG_WITH_GROFF         --with-groff
9511b789ec8aSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
9512b789ec8aSmrg#
9513b789ec8aSmrg# Interface to module:
9514b789ec8aSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
9515b789ec8aSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
9516b789ec8aSmrg#			'no' user instructs the module not to generate developer docs
9517b789ec8aSmrg# parm1:		specify the default value, yes or no.
9518b789ec8aSmrg#
9519b789ec8aSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
9520b789ec8aSmrgm4_define([devel_default], m4_default([$1], [yes]))
9521b789ec8aSmrgAC_ARG_ENABLE(devel-docs,
9522b789ec8aSmrg	AS_HELP_STRING([--enable-devel-docs],
9523b789ec8aSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
9524b789ec8aSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
9525b789ec8aSmrgm4_undefine([devel_default])
9526b789ec8aSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
9527b789ec8aSmrgAC_MSG_CHECKING([whether to build developer documentation])
9528b789ec8aSmrgAC_MSG_RESULT([$build_devel_docs])
9529b789ec8aSmrg]) # XORG_ENABLE_DEVEL_DOCS
9530b789ec8aSmrg
9531b789ec8aSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
9532b789ec8aSmrg# ----------------
9533b789ec8aSmrg# Minimum version: 1.6.0
9534b789ec8aSmrg#
9535b789ec8aSmrg# This macro enables a builder to skip all functional specification targets.
9536b789ec8aSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
9537b789ec8aSmrg# maximum flexibilty in controlling documentation building.
9538b789ec8aSmrg# Refer to:
9539b789ec8aSmrg# XORG_WITH_XMLTO         --with-xmlto
9540b789ec8aSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
9541b789ec8aSmrg# XORG_WITH_DOXYGEN       --with-doxygen
9542b789ec8aSmrg# XORG_WITH_FOP           --with-fop
9543b789ec8aSmrg# XORG_WITH_GROFF         --with-groff
9544b789ec8aSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
9545b789ec8aSmrg#
9546b789ec8aSmrg# Interface to module:
9547b789ec8aSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
9548b789ec8aSmrg# --enable-specs:	'yes' user instructs the module to generate specs
9549b789ec8aSmrg#			'no' user instructs the module not to generate specs
9550b789ec8aSmrg# parm1:		specify the default value, yes or no.
9551b789ec8aSmrg#
9552b789ec8aSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
9553b789ec8aSmrgm4_define([spec_default], m4_default([$1], [yes]))
9554b789ec8aSmrgAC_ARG_ENABLE(specs,
9555b789ec8aSmrg	AS_HELP_STRING([--enable-specs],
9556b789ec8aSmrg	   [Enable building the specs (default: ]spec_default[)]),
9557b789ec8aSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
9558b789ec8aSmrgm4_undefine([spec_default])
9559b789ec8aSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
9560b789ec8aSmrgAC_MSG_CHECKING([whether to build functional specifications])
9561b789ec8aSmrgAC_MSG_RESULT([$build_specs])
9562b789ec8aSmrg]) # XORG_ENABLE_SPECS
9563b789ec8aSmrg
9564b789ec8aSmrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
9565b789ec8aSmrg# ----------------------------------------------
9566b789ec8aSmrg# Minimum version: 1.13.0
9567b789ec8aSmrg#
9568b789ec8aSmrg# This macro enables a builder to enable/disable unit testing
9569b789ec8aSmrg# It makes no assumption about the test cases implementation
9570b789ec8aSmrg# Test cases may or may not use Automake "Support for test suites"
9571b789ec8aSmrg# They may or may not use the software utility library GLib
9572b789ec8aSmrg#
9573b789ec8aSmrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
9574b789ec8aSmrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
9575b789ec8aSmrg# The variable enable_unit_tests is used by other macros in this file.
9576b789ec8aSmrg#
9577b789ec8aSmrg# Interface to module:
9578b789ec8aSmrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
9579b789ec8aSmrg# enable_unit_tests:    used in configure.ac for additional configuration
9580b789ec8aSmrg# --enable-unit-tests:	'yes' user instructs the module to build tests
9581b789ec8aSmrg#			'no' user instructs the module not to build tests
9582b789ec8aSmrg# parm1:		specify the default value, yes or no.
9583b789ec8aSmrg#
9584b789ec8aSmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
9585b789ec8aSmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
9586b789ec8aSmrgAC_BEFORE([$0], [XORG_LD_WRAP])
9587b789ec8aSmrgm4_define([_defopt], m4_default([$1], [auto]))
9588b789ec8aSmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
9589b789ec8aSmrg	[Enable building unit test cases (default: ]_defopt[)]),
9590b789ec8aSmrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
9591b789ec8aSmrgm4_undefine([_defopt])
9592b789ec8aSmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
9593b789ec8aSmrgAC_MSG_CHECKING([whether to build unit test cases])
9594b789ec8aSmrgAC_MSG_RESULT([$enable_unit_tests])
9595b789ec8aSmrg]) # XORG_ENABLE_UNIT_TESTS
9596b789ec8aSmrg
9597b789ec8aSmrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
9598b789ec8aSmrg# ----------------------------------------
9599b789ec8aSmrg# Minimum version: 1.13.0
9600b789ec8aSmrg#
9601b789ec8aSmrg# GLib is a library which provides advanced data structures and functions.
9602b789ec8aSmrg# This macro enables a module to test for the presence of Glib.
9603b789ec8aSmrg#
9604b789ec8aSmrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
9605b789ec8aSmrg# Otherwise the value of $enable_unit_tests is blank.
9606b789ec8aSmrg#
9607b789ec8aSmrg# Interface to module:
9608b789ec8aSmrg# HAVE_GLIB: used in makefiles to conditionally build targets
9609b789ec8aSmrg# with_glib: used in configure.ac to know if GLib has been found
9610b789ec8aSmrg# --with-glib:	'yes' user instructs the module to use glib
9611b789ec8aSmrg#		'no' user instructs the module not to use glib
9612b789ec8aSmrg#
9613b789ec8aSmrgAC_DEFUN([XORG_WITH_GLIB],[
9614b789ec8aSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
9615b789ec8aSmrgm4_define([_defopt], m4_default([$2], [auto]))
9616b789ec8aSmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
9617b789ec8aSmrg	[Use GLib library for unit testing (default: ]_defopt[)]),
9618b789ec8aSmrg	[with_glib=$withval], [with_glib=]_defopt)
9619b789ec8aSmrgm4_undefine([_defopt])
9620b789ec8aSmrg
9621b789ec8aSmrghave_glib=no
9622b789ec8aSmrg# Do not probe GLib if user explicitly disabled unit testing
9623b789ec8aSmrgif test "x$enable_unit_tests" != x"no"; then
9624b789ec8aSmrg  # Do not probe GLib if user explicitly disabled it
9625b789ec8aSmrg  if test "x$with_glib" != x"no"; then
9626b789ec8aSmrg    m4_ifval(
9627b789ec8aSmrg      [$1],
9628b789ec8aSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
9629b789ec8aSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
9630b789ec8aSmrg    )
963189069ce9Smrg  fi
9632b789ec8aSmrgfi
9633c43cc173Smrg
9634b789ec8aSmrg# Not having GLib when unit testing has been explicitly requested is an error
9635b789ec8aSmrgif test "x$enable_unit_tests" = x"yes"; then
9636b789ec8aSmrg  if test "x$have_glib" = x"no"; then
9637b789ec8aSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
9638b789ec8aSmrg  fi
9639b789ec8aSmrgfi
9640c43cc173Smrg
9641b789ec8aSmrg# Having unit testing disabled when GLib has been explicitly requested is an error
9642b789ec8aSmrgif test "x$enable_unit_tests" = x"no"; then
9643b789ec8aSmrg  if test "x$with_glib" = x"yes"; then
9644b789ec8aSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
9645b789ec8aSmrg  fi
9646b789ec8aSmrgfi
964737eb1ca1Smrg
9648b789ec8aSmrg# Not having GLib when it has been explicitly requested is an error
9649b789ec8aSmrgif test "x$with_glib" = x"yes"; then
9650b789ec8aSmrg  if test "x$have_glib" = x"no"; then
9651b789ec8aSmrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
9652b789ec8aSmrg  fi
9653b789ec8aSmrgfi
9654b789ec8aSmrg
9655b789ec8aSmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
9656b789ec8aSmrg]) # XORG_WITH_GLIB
9657b789ec8aSmrg
9658b789ec8aSmrg# XORG_LD_WRAP
9659b789ec8aSmrg# ------------
9660b789ec8aSmrg# Minimum version: 1.13.0
966121e67964Smrg#
9662b789ec8aSmrg# Check if linker supports -wrap, passed via compiler flags
966337eb1ca1Smrg#
9664b789ec8aSmrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
9665b789ec8aSmrg# Otherwise the value of $enable_unit_tests is blank.
966637eb1ca1Smrg#
9667b789ec8aSmrgAC_DEFUN([XORG_LD_WRAP],[
9668b789ec8aSmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no])
9669b789ec8aSmrg# Not having ld wrap when unit testing has been explicitly requested is an error
9670b789ec8aSmrgif test "x$enable_unit_tests" = x"yes"; then
9671b789ec8aSmrg  if test "x$have_ld_wrap" = x"no"; then
9672b789ec8aSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
9673b789ec8aSmrg  fi
9674b789ec8aSmrgfi
9675b789ec8aSmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
967637eb1ca1Smrg#
9677b789ec8aSmrg]) # XORG_LD_WRAP
9678c43cc173Smrg
9679b789ec8aSmrg# XORG_CHECK_LINKER_FLAGS
9680b789ec8aSmrg# -----------------------
9681b789ec8aSmrg# SYNOPSIS
9682b789ec8aSmrg#
9683b789ec8aSmrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE])
9684b789ec8aSmrg#
9685b789ec8aSmrg# DESCRIPTION
9686b789ec8aSmrg#
9687b789ec8aSmrg#   Check whether the given linker FLAGS work with the current language's
9688b789ec8aSmrg#   linker, or whether they give an error.
9689b789ec8aSmrg#
9690b789ec8aSmrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
9691b789ec8aSmrg#   success/failure.
9692b789ec8aSmrg#
9693b789ec8aSmrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
9694b789ec8aSmrg#
9695b789ec8aSmrg# LICENSE
9696b789ec8aSmrg#
9697b789ec8aSmrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
9698b789ec8aSmrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
9699b789ec8aSmrg#   Copyright (c) 2009 Matteo Frigo
9700b789ec8aSmrg#
9701b789ec8aSmrg#   This program is free software: you can redistribute it and/or modify it
9702b789ec8aSmrg#   under the terms of the GNU General Public License as published by the
9703b789ec8aSmrg#   Free Software Foundation, either version 3 of the License, or (at your
9704b789ec8aSmrg#   option) any later version.
9705b789ec8aSmrg#
9706b789ec8aSmrg#   This program is distributed in the hope that it will be useful, but
9707b789ec8aSmrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
9708b789ec8aSmrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
9709b789ec8aSmrg#   Public License for more details.
9710b789ec8aSmrg#
9711b789ec8aSmrg#   You should have received a copy of the GNU General Public License along
9712b789ec8aSmrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
9713b789ec8aSmrg#
9714b789ec8aSmrg#   As a special exception, the respective Autoconf Macro's copyright owner
9715b789ec8aSmrg#   gives unlimited permission to copy, distribute and modify the configure
9716b789ec8aSmrg#   scripts that are the output of Autoconf when processing the Macro. You
9717b789ec8aSmrg#   need not follow the terms of the GNU General Public License when using
9718b789ec8aSmrg#   or distributing such scripts, even though portions of the text of the
9719b789ec8aSmrg#   Macro appear in them. The GNU General Public License (GPL) does govern
9720b789ec8aSmrg#   all other use of the material that constitutes the Autoconf Macro.
9721b789ec8aSmrg#
9722b789ec8aSmrg#   This special exception to the GPL applies to versions of the Autoconf
9723b789ec8aSmrg#   Macro released by the Autoconf Archive. When you make and distribute a
9724b789ec8aSmrg#   modified version of the Autoconf Macro, you may extend this special
9725b789ec8aSmrg#   exception to the GPL to apply to your modified version as well.#
9726b789ec8aSmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
9727b789ec8aSmrg[AC_MSG_CHECKING([whether the linker accepts $1])
9728b789ec8aSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
9729b789ec8aSmrgAS_LITERAL_IF([$1],
9730b789ec8aSmrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
9731b789ec8aSmrg      ax_save_FLAGS=$LDFLAGS
9732b789ec8aSmrg      LDFLAGS="$1"
9733b789ec8aSmrg      AC_LINK_IFELSE([AC_LANG_PROGRAM()],
9734b789ec8aSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
9735b789ec8aSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
9736b789ec8aSmrg      LDFLAGS=$ax_save_FLAGS])],
9737b789ec8aSmrg  [ax_save_FLAGS=$LDFLAGS
9738b789ec8aSmrg   LDFLAGS="$1"
9739b789ec8aSmrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
9740b789ec8aSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
9741b789ec8aSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
9742b789ec8aSmrg   LDFLAGS=$ax_save_FLAGS])
9743b789ec8aSmrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
9744b789ec8aSmrgAC_MSG_RESULT($xorg_check_linker_flags)
9745b789ec8aSmrgif test "x$xorg_check_linker_flags" = xyes; then
9746b789ec8aSmrg	m4_default([$2], :)
9747b789ec8aSmrgelse
9748b789ec8aSmrg	m4_default([$3], :)
9749b789ec8aSmrgfi
9750b789ec8aSmrg]) # XORG_CHECK_LINKER_FLAGS
9751b789ec8aSmrg
9752b789ec8aSmrg# XORG_CHECK_MALLOC_ZERO
9753b789ec8aSmrg# ----------------------
975489069ce9Smrg# Minimum version: 1.0.0
975589069ce9Smrg#
9756b789ec8aSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
9757b789ec8aSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
9758b789ec8aSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
9759b789ec8aSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
9760b789ec8aSmrgAC_ARG_ENABLE(malloc0returnsnull,
9761b789ec8aSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
9762b789ec8aSmrg		       [malloc(0) returns NULL (default: auto)]),
9763b789ec8aSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
9764b789ec8aSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
9765c43cc173Smrg
9766b789ec8aSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
9767b789ec8aSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
9768b789ec8aSmrg	AC_RUN_IFELSE([AC_LANG_PROGRAM([
9769b789ec8aSmrg#include <stdlib.h>
9770b789ec8aSmrg],[
9771b789ec8aSmrg    char *m0, *r0, *c0, *p;
9772b789ec8aSmrg    m0 = malloc(0);
9773b789ec8aSmrg    p = malloc(10);
9774b789ec8aSmrg    r0 = realloc(p,0);
9775b789ec8aSmrg    c0 = calloc(0,10);
9776b789ec8aSmrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
9777b789ec8aSmrg])],
9778b789ec8aSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
9779b789ec8aSmrg		[MALLOC_ZERO_RETURNS_NULL=no],
9780b789ec8aSmrg		[MALLOC_ZERO_RETURNS_NULL=yes])
978121e67964Smrgfi
9782b789ec8aSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
9783c43cc173Smrg
9784b789ec8aSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
9785b789ec8aSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
9786b789ec8aSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
9787b789ec8aSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
978889069ce9Smrgelse
9789b789ec8aSmrg	MALLOC_ZERO_CFLAGS=""
9790b789ec8aSmrg	XMALLOC_ZERO_CFLAGS=""
9791b789ec8aSmrg	XTMALLOC_ZERO_CFLAGS=""
979221e67964Smrgfi
9793c43cc173Smrg
9794b789ec8aSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
9795b789ec8aSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
9796b789ec8aSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
9797b789ec8aSmrg]) # XORG_CHECK_MALLOC_ZERO
9798b789ec8aSmrg
9799b789ec8aSmrg# XORG_WITH_LINT()
9800b789ec8aSmrg# ----------------
9801b789ec8aSmrg# Minimum version: 1.1.0
980237eb1ca1Smrg#
9803b789ec8aSmrg# This macro enables the use of a tool that flags some suspicious and
9804b789ec8aSmrg# non-portable constructs (likely to be bugs) in C language source code.
9805b789ec8aSmrg# It will attempt to locate the tool and use appropriate options.
9806b789ec8aSmrg# There are various lint type tools on different platforms.
9807b789ec8aSmrg#
9808b789ec8aSmrg# Interface to module:
9809b789ec8aSmrg# LINT:		returns the path to the tool found on the platform
9810b789ec8aSmrg#		or the value set to LINT on the configure cmd line
9811b789ec8aSmrg#		also an Automake conditional
9812b789ec8aSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
9813b789ec8aSmrg#
9814b789ec8aSmrg# --with-lint:	'yes' user instructs the module to use lint
9815b789ec8aSmrg#		'no' user instructs the module not to use lint (default)
9816b789ec8aSmrg#
9817b789ec8aSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
9818b789ec8aSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
9819b789ec8aSmrg#
9820b789ec8aSmrgAC_DEFUN([XORG_WITH_LINT],[
9821c43cc173Smrg
9822b789ec8aSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
9823b789ec8aSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
9824b789ec8aSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
9825b789ec8aSmrg		[Use a lint-style source code checker (default: disabled)])],
9826b789ec8aSmrg		[use_lint=$withval], [use_lint=no])
9827c43cc173Smrg
9828b789ec8aSmrg# Obtain platform specific info like program name and options
9829b789ec8aSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
9830b789ec8aSmrgcase $host_os in
9831b789ec8aSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
9832b789ec8aSmrg	lint_name=splint
9833b789ec8aSmrg	lint_options="-badflag"
9834b789ec8aSmrg	;;
9835b789ec8aSmrg  *freebsd* | *netbsd*)
9836b789ec8aSmrg	lint_name=lint
9837b789ec8aSmrg	lint_options="-u -b"
9838b789ec8aSmrg	;;
9839b789ec8aSmrg  *solaris*)
9840b789ec8aSmrg	lint_name=lint
9841b789ec8aSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
9842b789ec8aSmrg	;;
9843b789ec8aSmrgesac
98443e256790Smrg
9845b789ec8aSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
9846b789ec8aSmrgif test "x$use_lint" = x"yes" ; then
9847b789ec8aSmrg   AC_PATH_PROG([LINT], [$lint_name])
9848b789ec8aSmrg   if test "x$LINT" = "x"; then
9849b789ec8aSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
9850b789ec8aSmrg   fi
9851b789ec8aSmrgelif test "x$use_lint" = x"no" ; then
9852b789ec8aSmrg   if test "x$LINT" != "x"; then
9853b789ec8aSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
9854b789ec8aSmrg   fi
9855b789ec8aSmrgelse
9856b789ec8aSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
985789069ce9Smrgfi
98583e256790Smrg
9859b789ec8aSmrg# User supplied flags override default flags
9860b789ec8aSmrgif test "x$LINT_FLAGS" != "x"; then
9861b789ec8aSmrg   lint_options=$LINT_FLAGS
986289069ce9Smrgfi
9863c43cc173Smrg
9864b789ec8aSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
9865b789ec8aSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
9866c43cc173Smrg
9867b789ec8aSmrg]) # XORG_WITH_LINT
986821e67964Smrg
9869b789ec8aSmrg# XORG_LINT_LIBRARY(LIBNAME)
9870b789ec8aSmrg# --------------------------
9871b789ec8aSmrg# Minimum version: 1.1.0
9872b789ec8aSmrg#
9873b789ec8aSmrg# Sets up flags for building lint libraries for checking programs that call
9874b789ec8aSmrg# functions in the library.
9875b789ec8aSmrg#
9876b789ec8aSmrg# Interface to module:
9877b789ec8aSmrg# LINTLIB		- Automake variable with the name of lint library file to make
9878b789ec8aSmrg# MAKE_LINT_LIB		- Automake conditional
9879b789ec8aSmrg#
9880b789ec8aSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
9881b789ec8aSmrg#			  - 'no' user instructs the module not to create a lint library (default)
9882c43cc173Smrg
9883b789ec8aSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
9884b789ec8aSmrgAC_REQUIRE([XORG_WITH_LINT])
9885b789ec8aSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
9886b789ec8aSmrg	[Create lint library (default: disabled)])],
9887b789ec8aSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
9888c43cc173Smrg
9889b789ec8aSmrgif test "x$make_lint_lib" = x"yes" ; then
9890b789ec8aSmrg   LINTLIB=llib-l$1.ln
9891b789ec8aSmrg   if test "x$LINT" = "x"; then
9892b789ec8aSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
9893b789ec8aSmrg   fi
9894b789ec8aSmrgelif test "x$make_lint_lib" != x"no" ; then
9895b789ec8aSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
9896b789ec8aSmrgfi
9897c43cc173Smrg
9898b789ec8aSmrgAC_SUBST(LINTLIB)
9899b789ec8aSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
9900c43cc173Smrg
9901b789ec8aSmrg]) # XORG_LINT_LIBRARY
990221e67964Smrg
9903b789ec8aSmrg# XORG_CWARNFLAGS
9904b789ec8aSmrg# ---------------
9905b789ec8aSmrg# Minimum version: 1.2.0
9906c43cc173Smrg#
9907b789ec8aSmrg# Defines CWARNFLAGS to enable C compiler warnings.
990837eb1ca1Smrg#
9909b789ec8aSmrgAC_DEFUN([XORG_CWARNFLAGS], [
9910b789ec8aSmrgAC_REQUIRE([AC_PROG_CC_C99])
9911b789ec8aSmrgif  test "x$GCC" = xyes ; then
9912b789ec8aSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
9913b789ec8aSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
9914b789ec8aSmrg-Wbad-function-cast -Wformat=2"
9915b789ec8aSmrg    case `$CC -dumpversion` in
9916b789ec8aSmrg    3.4.* | 4.*)
9917b789ec8aSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
9918b789ec8aSmrg	;;
9919b789ec8aSmrg    esac
992089069ce9Smrgelse
9921b789ec8aSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
9922b789ec8aSmrg    if test "x$SUNCC" = "xyes"; then
9923b789ec8aSmrg	CWARNFLAGS="-v"
9924b789ec8aSmrg    fi
992589069ce9Smrgfi
9926b789ec8aSmrgAC_SUBST(CWARNFLAGS)
9927b789ec8aSmrg]) # XORG_CWARNFLAGS
99283e256790Smrg
9929b789ec8aSmrg# XORG_STRICT_OPTION
9930b789ec8aSmrg# -----------------------
9931b789ec8aSmrg# Minimum version: 1.3.0
9932b789ec8aSmrg#
9933b789ec8aSmrg# Add configure option to enable strict compilation
9934b789ec8aSmrgAC_DEFUN([XORG_STRICT_OPTION], [
9935b789ec8aSmrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
9936b789ec8aSmrgAC_REQUIRE([AC_PROG_CC_C99])
9937b789ec8aSmrgAC_REQUIRE([XORG_CWARNFLAGS])
993889069ce9Smrg
9939b789ec8aSmrgAC_ARG_ENABLE(strict-compilation,
9940b789ec8aSmrg			  AS_HELP_STRING([--enable-strict-compilation],
9941b789ec8aSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
9942b789ec8aSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
9943b789ec8aSmrgif test "x$STRICT_COMPILE" = "xyes"; then
9944b789ec8aSmrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
9945b789ec8aSmrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
9946b789ec8aSmrg	if test "x$GCC" = xyes ; then
9947b789ec8aSmrg		STRICT_CFLAGS="-pedantic -Werror"
9948b789ec8aSmrg	elif test "x$SUNCC" = "xyes"; then
9949b789ec8aSmrg		STRICT_CFLAGS="-errwarn"
9950b789ec8aSmrg    elif test "x$INTELCC" = "xyes"; then
9951b789ec8aSmrg		STRICT_CFLAGS="-Werror"
9952b789ec8aSmrg	fi
99533e256790Smrgfi
9954b789ec8aSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
9955b789ec8aSmrgAC_SUBST([CWARNFLAGS])
9956b789ec8aSmrg]) # XORG_STRICT_OPTION
99573e256790Smrg
9958b789ec8aSmrg# XORG_DEFAULT_OPTIONS
9959b789ec8aSmrg# --------------------
9960b789ec8aSmrg# Minimum version: 1.3.0
9961b789ec8aSmrg#
9962b789ec8aSmrg# Defines default options for X.Org modules.
9963b789ec8aSmrg#
9964b789ec8aSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
9965b789ec8aSmrgAC_REQUIRE([AC_PROG_INSTALL])
9966b789ec8aSmrgXORG_CWARNFLAGS
9967b789ec8aSmrgXORG_STRICT_OPTION
9968b789ec8aSmrgXORG_RELEASE_VERSION
9969b789ec8aSmrgXORG_CHANGELOG
9970b789ec8aSmrgXORG_INSTALL
9971b789ec8aSmrgXORG_MANPAGE_SECTIONS
9972b789ec8aSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
9973b789ec8aSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
9974b789ec8aSmrg]) # XORG_DEFAULT_OPTIONS
99753e256790Smrg
9976b789ec8aSmrg# XORG_INSTALL()
9977b789ec8aSmrg# ----------------
9978b789ec8aSmrg# Minimum version: 1.4.0
9979b789ec8aSmrg#
9980b789ec8aSmrg# Defines the variable INSTALL_CMD as the command to copy
9981b789ec8aSmrg# INSTALL from $prefix/share/util-macros.
9982b789ec8aSmrg#
9983b789ec8aSmrgAC_DEFUN([XORG_INSTALL], [
9984b789ec8aSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
9985b789ec8aSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
9986b789ec8aSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
9987b789ec8aSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
9988b789ec8aSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
9989b789ec8aSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
9990b789ec8aSmrgAC_SUBST([INSTALL_CMD])
9991b789ec8aSmrg]) # XORG_INSTALL
9992b789ec8aSmrgdnl Copyright 2005 Red Hat, Inc
9993b789ec8aSmrgdnl
9994b789ec8aSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
9995b789ec8aSmrgdnl documentation for any purpose is hereby granted without fee, provided that
9996b789ec8aSmrgdnl the above copyright notice appear in all copies and that both that
9997b789ec8aSmrgdnl copyright notice and this permission notice appear in supporting
9998b789ec8aSmrgdnl documentation.
9999b789ec8aSmrgdnl
10000b789ec8aSmrgdnl The above copyright notice and this permission notice shall be included
10001b789ec8aSmrgdnl in all copies or substantial portions of the Software.
10002b789ec8aSmrgdnl
10003b789ec8aSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10004b789ec8aSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
10005b789ec8aSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
10006b789ec8aSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
10007b789ec8aSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
10008b789ec8aSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
10009b789ec8aSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
10010b789ec8aSmrgdnl
10011b789ec8aSmrgdnl Except as contained in this notice, the name of the copyright holders shall
10012b789ec8aSmrgdnl not be used in advertising or otherwise to promote the sale, use or
10013b789ec8aSmrgdnl other dealings in this Software without prior written authorization
10014b789ec8aSmrgdnl from the copyright holders.
10015b789ec8aSmrgdnl
1001637eb1ca1Smrg
10017b789ec8aSmrg# XORG_RELEASE_VERSION
10018b789ec8aSmrg# --------------------
10019b789ec8aSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
10020b789ec8aSmrg 
10021b789ec8aSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
10022b789ec8aSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
10023b789ec8aSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
10024b789ec8aSmrg		[Major version of this package])
10025b789ec8aSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
10026b789ec8aSmrg	if test "x$PVM" = "x"; then
10027b789ec8aSmrg		PVM="0"
10028b789ec8aSmrg	fi
10029b789ec8aSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
10030b789ec8aSmrg		[$PVM],
10031b789ec8aSmrg		[Minor version of this package])
10032b789ec8aSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
10033b789ec8aSmrg	if test "x$PVP" = "x"; then
10034b789ec8aSmrg		PVP="0"
10035b789ec8aSmrg	fi
10036b789ec8aSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
10037b789ec8aSmrg		[$PVP],
10038b789ec8aSmrg		[Patch version of this package])
10039b789ec8aSmrg])
1004037eb1ca1Smrg
10041b789ec8aSmrg# XORG_CHANGELOG()
10042b789ec8aSmrg# ----------------
10043b789ec8aSmrg# Minimum version: 1.2.0
10044b789ec8aSmrg#
10045b789ec8aSmrg# Defines the variable CHANGELOG_CMD as the command to generate
10046b789ec8aSmrg# ChangeLog from git.
10047b789ec8aSmrg#
10048b789ec8aSmrg#
10049b789ec8aSmrgAC_DEFUN([XORG_CHANGELOG], [
10050b789ec8aSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
10051b789ec8aSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
10052b789ec8aSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
10053b789ec8aSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
10054b789ec8aSmrgAC_SUBST([CHANGELOG_CMD])
10055b789ec8aSmrg]) # XORG_CHANGELOG
1005637eb1ca1Smrg
10057b789ec8aSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
1005837eb1ca1Smrg#
10059b789ec8aSmrg# This file is free software; the Free Software Foundation
10060b789ec8aSmrg# gives unlimited permission to copy and/or distribute it,
10061b789ec8aSmrg# with or without modifications, as long as this notice is preserved.
1006237eb1ca1Smrg
10063b789ec8aSmrg# AM_AUTOMAKE_VERSION(VERSION)
10064b789ec8aSmrg# ----------------------------
10065b789ec8aSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
10066b789ec8aSmrg# generated from the m4 files accompanying Automake X.Y.
10067b789ec8aSmrg# (This private macro should not be called outside this file.)
10068b789ec8aSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
10069b789ec8aSmrg[am__api_version='1.11'
10070b789ec8aSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
10071b789ec8aSmrgdnl require some minimum version.  Point them to the right macro.
10072b789ec8aSmrgm4_if([$1], [1.11.1], [],
10073b789ec8aSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
10074b789ec8aSmrg])
1007537eb1ca1Smrg
10076b789ec8aSmrg# _AM_AUTOCONF_VERSION(VERSION)
10077b789ec8aSmrg# -----------------------------
10078b789ec8aSmrg# aclocal traces this macro to find the Autoconf version.
10079b789ec8aSmrg# This is a private macro too.  Using m4_define simplifies
10080b789ec8aSmrg# the logic in aclocal, which can simply ignore this definition.
10081b789ec8aSmrgm4_define([_AM_AUTOCONF_VERSION], [])
1008237eb1ca1Smrg
10083b789ec8aSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
10084b789ec8aSmrg# -------------------------------
10085b789ec8aSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
10086b789ec8aSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
10087b789ec8aSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
10088b789ec8aSmrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
10089b789ec8aSmrgm4_ifndef([AC_AUTOCONF_VERSION],
10090b789ec8aSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
10091b789ec8aSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
1009237eb1ca1Smrg
10093b789ec8aSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
1009437eb1ca1Smrg
10095b789ec8aSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
10096b789ec8aSmrg#
10097b789ec8aSmrg# This file is free software; the Free Software Foundation
10098b789ec8aSmrg# gives unlimited permission to copy and/or distribute it,
10099b789ec8aSmrg# with or without modifications, as long as this notice is preserved.
1010037eb1ca1Smrg
10101b789ec8aSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
10102b789ec8aSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
10103b789ec8aSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
1010489069ce9Smrg#
10105b789ec8aSmrg# Of course, Automake must honor this variable whenever it calls a
10106b789ec8aSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
10107b789ec8aSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
10108b789ec8aSmrg# depending on how configure is run.  This is pretty annoying, since
10109b789ec8aSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
10110b789ec8aSmrg# source directory, any form will work fine, but in subdirectories a
10111b789ec8aSmrg# relative path needs to be adjusted first.
1011289069ce9Smrg#
10113b789ec8aSmrg# $ac_aux_dir/missing
10114b789ec8aSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
10115b789ec8aSmrg# $top_srcdir/$ac_aux_dir/missing
10116b789ec8aSmrg#    fails if $ac_aux_dir is absolute,
10117b789ec8aSmrg#    fails when called from a subdirectory in a VPATH build with
10118b789ec8aSmrg#          a relative $ac_aux_dir
1011989069ce9Smrg#
10120b789ec8aSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
10121b789ec8aSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
10122b789ec8aSmrg# harmless because $srcdir is `.', but things will broke when you
10123b789ec8aSmrg# start a VPATH build or use an absolute $srcdir.
1012489069ce9Smrg#
10125b789ec8aSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
10126b789ec8aSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
10127b789ec8aSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
10128b789ec8aSmrg# and then we would define $MISSING as
10129b789ec8aSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
10130b789ec8aSmrg# This will work as long as MISSING is not called from configure, because
10131b789ec8aSmrg# unfortunately $(top_srcdir) has no meaning in configure.
10132b789ec8aSmrg# However there are other variables, like CC, which are often used in
10133b789ec8aSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
1013489069ce9Smrg#
10135b789ec8aSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
10136b789ec8aSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
10137b789ec8aSmrg# configured tree to be moved without reconfiguration.
1013837eb1ca1Smrg
10139b789ec8aSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
10140b789ec8aSmrg[dnl Rely on autoconf to set up CDPATH properly.
10141b789ec8aSmrgAC_PREREQ([2.50])dnl
10142b789ec8aSmrg# expand $ac_aux_dir to an absolute path
10143b789ec8aSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
10144b789ec8aSmrg])
1014537eb1ca1Smrg
10146b789ec8aSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
1014737eb1ca1Smrg
10148b789ec8aSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
10149b789ec8aSmrg# Free Software Foundation, Inc.
1015089069ce9Smrg#
10151b789ec8aSmrg# This file is free software; the Free Software Foundation
10152b789ec8aSmrg# gives unlimited permission to copy and/or distribute it,
10153b789ec8aSmrg# with or without modifications, as long as this notice is preserved.
1015437eb1ca1Smrg
10155b789ec8aSmrg# serial 9
10156b789ec8aSmrg
10157b789ec8aSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
10158b789ec8aSmrg# -------------------------------------
10159b789ec8aSmrg# Define a conditional.
10160b789ec8aSmrgAC_DEFUN([AM_CONDITIONAL],
10161b789ec8aSmrg[AC_PREREQ(2.52)dnl
10162b789ec8aSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
10163b789ec8aSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
10164b789ec8aSmrgAC_SUBST([$1_TRUE])dnl
10165b789ec8aSmrgAC_SUBST([$1_FALSE])dnl
10166b789ec8aSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
10167b789ec8aSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
10168b789ec8aSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
10169b789ec8aSmrgif $2; then
10170b789ec8aSmrg  $1_TRUE=
10171b789ec8aSmrg  $1_FALSE='#'
1017289069ce9Smrgelse
10173b789ec8aSmrg  $1_TRUE='#'
10174b789ec8aSmrg  $1_FALSE=
101753e256790Smrgfi
10176b789ec8aSmrgAC_CONFIG_COMMANDS_PRE(
10177b789ec8aSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
10178b789ec8aSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
10179b789ec8aSmrgUsually this means the macro was only invoked conditionally.]])
10180b789ec8aSmrgfi])])
101813e256790Smrg
10182b789ec8aSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
10183b789ec8aSmrg# Free Software Foundation, Inc.
1018489069ce9Smrg#
10185b789ec8aSmrg# This file is free software; the Free Software Foundation
10186b789ec8aSmrg# gives unlimited permission to copy and/or distribute it,
10187b789ec8aSmrg# with or without modifications, as long as this notice is preserved.
1018837eb1ca1Smrg
10189b789ec8aSmrg# serial 10
1019037eb1ca1Smrg
10191b789ec8aSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
10192b789ec8aSmrg# written in clear, in which case automake, when reading aclocal.m4,
10193b789ec8aSmrg# will think it sees a *use*, and therefore will trigger all it's
10194b789ec8aSmrg# C support machinery.  Also note that it means that autoscan, seeing
10195b789ec8aSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
10196b789ec8aSmrg
10197b789ec8aSmrg
10198b789ec8aSmrg# _AM_DEPENDENCIES(NAME)
10199b789ec8aSmrg# ----------------------
10200b789ec8aSmrg# See how the compiler implements dependency checking.
10201b789ec8aSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
10202b789ec8aSmrg# We try a few techniques and use that to set a single cache variable.
1020389069ce9Smrg#
10204b789ec8aSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
10205b789ec8aSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
10206b789ec8aSmrg# dependency, and given that the user is not expected to run this macro,
10207b789ec8aSmrg# just rely on AC_PROG_CC.
10208b789ec8aSmrgAC_DEFUN([_AM_DEPENDENCIES],
10209b789ec8aSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
10210b789ec8aSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
10211b789ec8aSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
10212b789ec8aSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
1021337eb1ca1Smrg
10214b789ec8aSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
10215b789ec8aSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
10216b789ec8aSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
10217b789ec8aSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
10218b789ec8aSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
10219b789ec8aSmrg                   [depcc="$$1"   am_compiler_list=])
10220b789ec8aSmrg
10221b789ec8aSmrgAC_CACHE_CHECK([dependency style of $depcc],
10222b789ec8aSmrg               [am_cv_$1_dependencies_compiler_type],
10223b789ec8aSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
10224b789ec8aSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
10225b789ec8aSmrg  # making bogus files that we don't know about and never remove.  For
10226b789ec8aSmrg  # instance it was reported that on HP-UX the gcc test will end up
10227b789ec8aSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
10228b789ec8aSmrg  # in D'.
10229b789ec8aSmrg  mkdir conftest.dir
10230b789ec8aSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
10231b789ec8aSmrg  # using a relative directory.
10232b789ec8aSmrg  cp "$am_depcomp" conftest.dir
10233b789ec8aSmrg  cd conftest.dir
10234b789ec8aSmrg  # We will build objects and dependencies in a subdirectory because
10235b789ec8aSmrg  # it helps to detect inapplicable dependency modes.  For instance
10236b789ec8aSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
10237b789ec8aSmrg  # side effect of compilation, but ICC will put the dependencies in
10238b789ec8aSmrg  # the current directory while Tru64 will put them in the object
10239b789ec8aSmrg  # directory.
10240b789ec8aSmrg  mkdir sub
10241b789ec8aSmrg
10242b789ec8aSmrg  am_cv_$1_dependencies_compiler_type=none
10243b789ec8aSmrg  if test "$am_compiler_list" = ""; then
10244b789ec8aSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
10245b789ec8aSmrg  fi
10246b789ec8aSmrg  am__universal=false
10247b789ec8aSmrg  m4_case([$1], [CC],
10248b789ec8aSmrg    [case " $depcc " in #(
10249b789ec8aSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
10250b789ec8aSmrg     esac],
10251b789ec8aSmrg    [CXX],
10252b789ec8aSmrg    [case " $depcc " in #(
10253b789ec8aSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
10254b789ec8aSmrg     esac])
10255b789ec8aSmrg
10256b789ec8aSmrg  for depmode in $am_compiler_list; do
10257b789ec8aSmrg    # Setup a source with many dependencies, because some compilers
10258b789ec8aSmrg    # like to wrap large dependency lists on column 80 (with \), and
10259b789ec8aSmrg    # we should not choose a depcomp mode which is confused by this.
10260b789ec8aSmrg    #
10261b789ec8aSmrg    # We need to recreate these files for each test, as the compiler may
10262b789ec8aSmrg    # overwrite some of them when testing with obscure command lines.
10263b789ec8aSmrg    # This happens at least with the AIX C compiler.
10264b789ec8aSmrg    : > sub/conftest.c
10265b789ec8aSmrg    for i in 1 2 3 4 5 6; do
10266b789ec8aSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
10267b789ec8aSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
10268b789ec8aSmrg      # Solaris 8's {/usr,}/bin/sh.
10269b789ec8aSmrg      touch sub/conftst$i.h
10270b789ec8aSmrg    done
10271b789ec8aSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
10272b789ec8aSmrg
10273b789ec8aSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
10274b789ec8aSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
10275b789ec8aSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
10276b789ec8aSmrg    # versions had trouble with output in subdirs
10277b789ec8aSmrg    am__obj=sub/conftest.${OBJEXT-o}
10278b789ec8aSmrg    am__minus_obj="-o $am__obj"
10279b789ec8aSmrg    case $depmode in
10280b789ec8aSmrg    gcc)
10281b789ec8aSmrg      # This depmode causes a compiler race in universal mode.
10282b789ec8aSmrg      test "$am__universal" = false || continue
10283b789ec8aSmrg      ;;
10284b789ec8aSmrg    nosideeffect)
10285b789ec8aSmrg      # after this tag, mechanisms are not by side-effect, so they'll
10286b789ec8aSmrg      # only be used when explicitly requested
10287b789ec8aSmrg      if test "x$enable_dependency_tracking" = xyes; then
10288b789ec8aSmrg	continue
10289b789ec8aSmrg      else
10290b789ec8aSmrg	break
10291b789ec8aSmrg      fi
10292b789ec8aSmrg      ;;
10293b789ec8aSmrg    msvisualcpp | msvcmsys)
10294b789ec8aSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
10295b789ec8aSmrg      # not run yet.  These depmodes are late enough in the game, and
10296b789ec8aSmrg      # so weak that their functioning should not be impacted.
10297b789ec8aSmrg      am__obj=conftest.${OBJEXT-o}
10298b789ec8aSmrg      am__minus_obj=
10299b789ec8aSmrg      ;;
10300b789ec8aSmrg    none) break ;;
10301b789ec8aSmrg    esac
10302b789ec8aSmrg    if depmode=$depmode \
10303b789ec8aSmrg       source=sub/conftest.c object=$am__obj \
10304b789ec8aSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
10305b789ec8aSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
10306b789ec8aSmrg         >/dev/null 2>conftest.err &&
10307b789ec8aSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
10308b789ec8aSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
10309b789ec8aSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
10310b789ec8aSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
10311b789ec8aSmrg      # icc doesn't choke on unknown options, it will just issue warnings
10312b789ec8aSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
10313b789ec8aSmrg      # that says an option was ignored or not supported.
10314b789ec8aSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
10315b789ec8aSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
10316b789ec8aSmrg      # The diagnosis changed in icc 8.0:
10317b789ec8aSmrg      #   icc: Command line remark: option '-MP' not supported
10318b789ec8aSmrg      if (grep 'ignoring option' conftest.err ||
10319b789ec8aSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
10320b789ec8aSmrg        am_cv_$1_dependencies_compiler_type=$depmode
10321b789ec8aSmrg        break
10322b789ec8aSmrg      fi
10323b789ec8aSmrg    fi
10324b789ec8aSmrg  done
10325b789ec8aSmrg
10326b789ec8aSmrg  cd ..
10327b789ec8aSmrg  rm -rf conftest.dir
1032889069ce9Smrgelse
10329b789ec8aSmrg  am_cv_$1_dependencies_compiler_type=none
10330b789ec8aSmrgfi
10331b789ec8aSmrg])
10332b789ec8aSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
10333b789ec8aSmrgAM_CONDITIONAL([am__fastdep$1], [
10334b789ec8aSmrg  test "x$enable_dependency_tracking" != xno \
10335b789ec8aSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
10336b789ec8aSmrg])
10337b789ec8aSmrg
10338b789ec8aSmrg
10339b789ec8aSmrg# AM_SET_DEPDIR
10340b789ec8aSmrg# -------------
10341b789ec8aSmrg# Choose a directory name for dependency files.
10342b789ec8aSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
10343b789ec8aSmrgAC_DEFUN([AM_SET_DEPDIR],
10344b789ec8aSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
10345b789ec8aSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
10346b789ec8aSmrg])
10347b789ec8aSmrg
10348b789ec8aSmrg
10349b789ec8aSmrg# AM_DEP_TRACK
10350b789ec8aSmrg# ------------
10351b789ec8aSmrgAC_DEFUN([AM_DEP_TRACK],
10352b789ec8aSmrg[AC_ARG_ENABLE(dependency-tracking,
10353b789ec8aSmrg[  --disable-dependency-tracking  speeds up one-time build
10354b789ec8aSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
10355b789ec8aSmrgif test "x$enable_dependency_tracking" != xno; then
10356b789ec8aSmrg  am_depcomp="$ac_aux_dir/depcomp"
10357b789ec8aSmrg  AMDEPBACKSLASH='\'
1035889069ce9Smrgfi
10359b789ec8aSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
10360b789ec8aSmrgAC_SUBST([AMDEPBACKSLASH])dnl
10361b789ec8aSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
10362b789ec8aSmrg])
10363b789ec8aSmrg
10364b789ec8aSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
10365b789ec8aSmrg
10366b789ec8aSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
10367b789ec8aSmrg# Free Software Foundation, Inc.
10368b789ec8aSmrg#
10369b789ec8aSmrg# This file is free software; the Free Software Foundation
10370b789ec8aSmrg# gives unlimited permission to copy and/or distribute it,
10371b789ec8aSmrg# with or without modifications, as long as this notice is preserved.
10372b789ec8aSmrg
10373b789ec8aSmrg#serial 5
10374b789ec8aSmrg
10375b789ec8aSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
10376b789ec8aSmrg# ------------------------------
10377b789ec8aSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
10378b789ec8aSmrg[{
10379b789ec8aSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
10380b789ec8aSmrg  # are listed without --file.  Let's play safe and only enable the eval
10381b789ec8aSmrg  # if we detect the quoting.
10382b789ec8aSmrg  case $CONFIG_FILES in
10383b789ec8aSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
10384b789ec8aSmrg  *)   set x $CONFIG_FILES ;;
10385b789ec8aSmrg  esac
10386b789ec8aSmrg  shift
10387b789ec8aSmrg  for mf
10388b789ec8aSmrg  do
10389b789ec8aSmrg    # Strip MF so we end up with the name of the file.
10390b789ec8aSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
10391b789ec8aSmrg    # Check whether this is an Automake generated Makefile or not.
10392b789ec8aSmrg    # We used to match only the files named `Makefile.in', but
10393b789ec8aSmrg    # some people rename them; so instead we look at the file content.
10394b789ec8aSmrg    # Grep'ing the first line is not enough: some people post-process
10395b789ec8aSmrg    # each Makefile.in and add a new line on top of each file to say so.
10396b789ec8aSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
10397b789ec8aSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
10398b789ec8aSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
10399b789ec8aSmrg      dirpart=`AS_DIRNAME("$mf")`
10400b789ec8aSmrg    else
10401b789ec8aSmrg      continue
10402b789ec8aSmrg    fi
10403b789ec8aSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
10404b789ec8aSmrg    # from the Makefile without running `make'.
10405b789ec8aSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
10406b789ec8aSmrg    test -z "$DEPDIR" && continue
10407b789ec8aSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
10408b789ec8aSmrg    test -z "am__include" && continue
10409b789ec8aSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
10410b789ec8aSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
10411b789ec8aSmrg    U=`sed -n 's/^U = //p' < "$mf"`
10412b789ec8aSmrg    # Find all dependency output files, they are included files with
10413b789ec8aSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
10414b789ec8aSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
10415b789ec8aSmrg    # expansion.
10416b789ec8aSmrg    for file in `sed -n "
10417b789ec8aSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
10418b789ec8aSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
10419b789ec8aSmrg      # Make sure the directory exists.
10420b789ec8aSmrg      test -f "$dirpart/$file" && continue
10421b789ec8aSmrg      fdir=`AS_DIRNAME(["$file"])`
10422b789ec8aSmrg      AS_MKDIR_P([$dirpart/$fdir])
10423b789ec8aSmrg      # echo "creating $dirpart/$file"
10424b789ec8aSmrg      echo '# dummy' > "$dirpart/$file"
10425b789ec8aSmrg    done
10426b789ec8aSmrg  done
10427b789ec8aSmrg}
10428b789ec8aSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
10429b789ec8aSmrg
10430b789ec8aSmrg
10431b789ec8aSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
10432b789ec8aSmrg# -----------------------------
10433b789ec8aSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
10434b789ec8aSmrg#
10435b789ec8aSmrg# This code is only required when automatic dependency tracking
10436b789ec8aSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
10437b789ec8aSmrg# need in order to bootstrap the dependency handling code.
10438b789ec8aSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
10439b789ec8aSmrg[AC_CONFIG_COMMANDS([depfiles],
10440b789ec8aSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
10441b789ec8aSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
10442b789ec8aSmrg])
1044337eb1ca1Smrg
10444b789ec8aSmrg# Do all the work for Automake.                             -*- Autoconf -*-
10445b789ec8aSmrg
10446b789ec8aSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
10447b789ec8aSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
10448b789ec8aSmrg#
10449b789ec8aSmrg# This file is free software; the Free Software Foundation
10450b789ec8aSmrg# gives unlimited permission to copy and/or distribute it,
10451b789ec8aSmrg# with or without modifications, as long as this notice is preserved.
10452b789ec8aSmrg
10453b789ec8aSmrg# serial 16
10454b789ec8aSmrg
10455b789ec8aSmrg# This macro actually does too much.  Some checks are only needed if
10456b789ec8aSmrg# your package does certain things.  But this isn't really a big deal.
10457b789ec8aSmrg
10458b789ec8aSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
10459b789ec8aSmrg# AM_INIT_AUTOMAKE([OPTIONS])
10460b789ec8aSmrg# -----------------------------------------------
10461b789ec8aSmrg# The call with PACKAGE and VERSION arguments is the old style
10462b789ec8aSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
10463b789ec8aSmrg# and VERSION should now be passed to AC_INIT and removed from
10464b789ec8aSmrg# the call to AM_INIT_AUTOMAKE.
10465b789ec8aSmrg# We support both call styles for the transition.  After
10466b789ec8aSmrg# the next Automake release, Autoconf can make the AC_INIT
10467b789ec8aSmrg# arguments mandatory, and then we can depend on a new Autoconf
10468b789ec8aSmrg# release and drop the old call support.
10469b789ec8aSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
10470b789ec8aSmrg[AC_PREREQ([2.62])dnl
10471b789ec8aSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
10472b789ec8aSmrgdnl the ones we care about.
10473b789ec8aSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
10474b789ec8aSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
10475b789ec8aSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
10476b789ec8aSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
10477b789ec8aSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
10478b789ec8aSmrg  # is not polluted with repeated "-I."
10479b789ec8aSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
10480b789ec8aSmrg  # test to see if srcdir already configured
10481b789ec8aSmrg  if test -f $srcdir/config.status; then
10482b789ec8aSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
10483b789ec8aSmrg  fi
1048489069ce9Smrgfi
1048589069ce9Smrg
10486b789ec8aSmrg# test whether we have cygpath
10487b789ec8aSmrgif test -z "$CYGPATH_W"; then
10488b789ec8aSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
10489b789ec8aSmrg    CYGPATH_W='cygpath -w'
10490b789ec8aSmrg  else
10491b789ec8aSmrg    CYGPATH_W=echo
10492b789ec8aSmrg  fi
104933e256790Smrgfi
10494b789ec8aSmrgAC_SUBST([CYGPATH_W])
104953e256790Smrg
10496b789ec8aSmrg# Define the identity of the package.
10497b789ec8aSmrgdnl Distinguish between old-style and new-style calls.
10498b789ec8aSmrgm4_ifval([$2],
10499b789ec8aSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
10500b789ec8aSmrg AC_SUBST([PACKAGE], [$1])dnl
10501b789ec8aSmrg AC_SUBST([VERSION], [$2])],
10502b789ec8aSmrg[_AM_SET_OPTIONS([$1])dnl
10503b789ec8aSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
10504b789ec8aSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
10505b789ec8aSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
10506b789ec8aSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
10507b789ec8aSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1050837eb1ca1Smrg
10509b789ec8aSmrg_AM_IF_OPTION([no-define],,
10510b789ec8aSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
10511b789ec8aSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
1051237eb1ca1Smrg
10513b789ec8aSmrg# Some tools Automake needs.
10514b789ec8aSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
10515b789ec8aSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
10516b789ec8aSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
10517b789ec8aSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
10518b789ec8aSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
10519b789ec8aSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
10520b789ec8aSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
10521b789ec8aSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
10522b789ec8aSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
10523b789ec8aSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
10524b789ec8aSmrg# We need awk for the "check" target.  The system "awk" is bad on
10525b789ec8aSmrg# some platforms.
10526b789ec8aSmrgAC_REQUIRE([AC_PROG_AWK])dnl
10527b789ec8aSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
10528b789ec8aSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
10529b789ec8aSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
10530b789ec8aSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
10531b789ec8aSmrg			     [_AM_PROG_TAR([v7])])])
10532b789ec8aSmrg_AM_IF_OPTION([no-dependencies],,
10533b789ec8aSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
10534b789ec8aSmrg		  [_AM_DEPENDENCIES(CC)],
10535b789ec8aSmrg		  [define([AC_PROG_CC],
10536b789ec8aSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
10537b789ec8aSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
10538b789ec8aSmrg		  [_AM_DEPENDENCIES(CXX)],
10539b789ec8aSmrg		  [define([AC_PROG_CXX],
10540b789ec8aSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
10541b789ec8aSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
10542b789ec8aSmrg		  [_AM_DEPENDENCIES(OBJC)],
10543b789ec8aSmrg		  [define([AC_PROG_OBJC],
10544b789ec8aSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
10545b789ec8aSmrg])
10546b789ec8aSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
10547b789ec8aSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
10548b789ec8aSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
10549b789ec8aSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
10550b789ec8aSmrgAC_CONFIG_COMMANDS_PRE(dnl
10551b789ec8aSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
10552b789ec8aSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
10553b789ec8aSmrg])
1055437eb1ca1Smrg
10555b789ec8aSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
10556b789ec8aSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
10557b789ec8aSmrgdnl mangled by Autoconf and run in a shell conditional statement.
10558b789ec8aSmrgm4_define([_AC_COMPILER_EXEEXT],
10559b789ec8aSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
1056037eb1ca1Smrg
10561c43cc173Smrg
10562b789ec8aSmrg# When config.status generates a header, we must update the stamp-h file.
10563b789ec8aSmrg# This file resides in the same directory as the config header
10564b789ec8aSmrg# that is generated.  The stamp files are numbered to have different names.
10565b789ec8aSmrg
10566b789ec8aSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
10567b789ec8aSmrg# loop where config.status creates the headers, so we can generate
10568b789ec8aSmrg# our stamp files there.
10569b789ec8aSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
10570b789ec8aSmrg[# Compute $1's index in $config_headers.
10571b789ec8aSmrg_am_arg=$1
10572b789ec8aSmrg_am_stamp_count=1
10573b789ec8aSmrgfor _am_header in $config_headers :; do
10574b789ec8aSmrg  case $_am_header in
10575b789ec8aSmrg    $_am_arg | $_am_arg:* )
10576b789ec8aSmrg      break ;;
10577b789ec8aSmrg    * )
10578b789ec8aSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
10579b789ec8aSmrg  esac
10580b789ec8aSmrgdone
10581b789ec8aSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
10582b789ec8aSmrg
10583b789ec8aSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
1058489069ce9Smrg#
10585b789ec8aSmrg# This file is free software; the Free Software Foundation
10586b789ec8aSmrg# gives unlimited permission to copy and/or distribute it,
10587b789ec8aSmrg# with or without modifications, as long as this notice is preserved.
10588b789ec8aSmrg
10589b789ec8aSmrg# AM_PROG_INSTALL_SH
10590b789ec8aSmrg# ------------------
10591b789ec8aSmrg# Define $install_sh.
10592b789ec8aSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
10593b789ec8aSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
10594b789ec8aSmrgif test x"${install_sh}" != xset; then
10595b789ec8aSmrg  case $am_aux_dir in
10596b789ec8aSmrg  *\ * | *\	*)
10597b789ec8aSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
10598b789ec8aSmrg  *)
10599b789ec8aSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
10600b789ec8aSmrg  esac
1060189069ce9Smrgfi
10602b789ec8aSmrgAC_SUBST(install_sh)])
1060337eb1ca1Smrg
10604b789ec8aSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
1060589069ce9Smrg#
10606b789ec8aSmrg# This file is free software; the Free Software Foundation
10607b789ec8aSmrg# gives unlimited permission to copy and/or distribute it,
10608b789ec8aSmrg# with or without modifications, as long as this notice is preserved.
10609b789ec8aSmrg
10610b789ec8aSmrg# serial 2
10611b789ec8aSmrg
10612b789ec8aSmrg# Check whether the underlying file-system supports filenames
10613b789ec8aSmrg# with a leading dot.  For instance MS-DOS doesn't.
10614b789ec8aSmrgAC_DEFUN([AM_SET_LEADING_DOT],
10615b789ec8aSmrg[rm -rf .tst 2>/dev/null
10616b789ec8aSmrgmkdir .tst 2>/dev/null
10617b789ec8aSmrgif test -d .tst; then
10618b789ec8aSmrg  am__leading_dot=.
10619b789ec8aSmrgelse
10620b789ec8aSmrg  am__leading_dot=_
1062189069ce9Smrgfi
10622b789ec8aSmrgrmdir .tst 2>/dev/null
10623b789ec8aSmrgAC_SUBST([am__leading_dot])])
1062437eb1ca1Smrg
10625b789ec8aSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
10626b789ec8aSmrg# From Jim Meyering
10627b789ec8aSmrg
10628b789ec8aSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
10629b789ec8aSmrg# Free Software Foundation, Inc.
1063089069ce9Smrg#
10631b789ec8aSmrg# This file is free software; the Free Software Foundation
10632b789ec8aSmrg# gives unlimited permission to copy and/or distribute it,
10633b789ec8aSmrg# with or without modifications, as long as this notice is preserved.
10634b789ec8aSmrg
10635b789ec8aSmrg# serial 5
10636b789ec8aSmrg
10637b789ec8aSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
10638b789ec8aSmrg# ----------------------------------
10639b789ec8aSmrg# Control maintainer-specific portions of Makefiles.
10640b789ec8aSmrg# Default is to disable them, unless `enable' is passed literally.
10641b789ec8aSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
10642b789ec8aSmrg# can override the default with the --enable/--disable switch.
10643b789ec8aSmrgAC_DEFUN([AM_MAINTAINER_MODE],
10644b789ec8aSmrg[m4_case(m4_default([$1], [disable]),
10645b789ec8aSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
10646b789ec8aSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
10647b789ec8aSmrg       [m4_define([am_maintainer_other], [enable])
10648b789ec8aSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
10649b789ec8aSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
10650b789ec8aSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
10651b789ec8aSmrg  AC_ARG_ENABLE([maintainer-mode],
10652b789ec8aSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
10653b789ec8aSmrg			  (and sometimes confusing) to the casual installer],
10654b789ec8aSmrg      [USE_MAINTAINER_MODE=$enableval],
10655b789ec8aSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
10656b789ec8aSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
10657b789ec8aSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
10658b789ec8aSmrg  MAINT=$MAINTAINER_MODE_TRUE
10659b789ec8aSmrg  AC_SUBST([MAINT])dnl
10660b789ec8aSmrg]
10661b789ec8aSmrg)
10662b789ec8aSmrg
10663b789ec8aSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
10664b789ec8aSmrg
10665b789ec8aSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
10666b789ec8aSmrg
10667b789ec8aSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
1066889069ce9Smrg#
10669b789ec8aSmrg# This file is free software; the Free Software Foundation
10670b789ec8aSmrg# gives unlimited permission to copy and/or distribute it,
10671b789ec8aSmrg# with or without modifications, as long as this notice is preserved.
10672b789ec8aSmrg
10673b789ec8aSmrg# serial 4
10674b789ec8aSmrg
10675b789ec8aSmrg# AM_MAKE_INCLUDE()
10676b789ec8aSmrg# -----------------
10677b789ec8aSmrg# Check to see how make treats includes.
10678b789ec8aSmrgAC_DEFUN([AM_MAKE_INCLUDE],
10679b789ec8aSmrg[am_make=${MAKE-make}
10680b789ec8aSmrgcat > confinc << 'END'
10681b789ec8aSmrgam__doit:
10682b789ec8aSmrg	@echo this is the am__doit target
10683b789ec8aSmrg.PHONY: am__doit
10684b789ec8aSmrgEND
10685b789ec8aSmrg# If we don't find an include directive, just comment out the code.
10686b789ec8aSmrgAC_MSG_CHECKING([for style of include used by $am_make])
10687b789ec8aSmrgam__include="#"
10688b789ec8aSmrgam__quote=
10689b789ec8aSmrg_am_result=none
10690b789ec8aSmrg# First try GNU make style include.
10691b789ec8aSmrgecho "include confinc" > confmf
10692b789ec8aSmrg# Ignore all kinds of additional output from `make'.
10693b789ec8aSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
10694b789ec8aSmrg*the\ am__doit\ target*)
10695b789ec8aSmrg  am__include=include
10696b789ec8aSmrg  am__quote=
10697b789ec8aSmrg  _am_result=GNU
10698b789ec8aSmrg  ;;
10699b789ec8aSmrgesac
10700b789ec8aSmrg# Now try BSD make style include.
10701b789ec8aSmrgif test "$am__include" = "#"; then
10702b789ec8aSmrg   echo '.include "confinc"' > confmf
10703b789ec8aSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
10704b789ec8aSmrg   *the\ am__doit\ target*)
10705b789ec8aSmrg     am__include=.include
10706b789ec8aSmrg     am__quote="\""
10707b789ec8aSmrg     _am_result=BSD
10708b789ec8aSmrg     ;;
10709b789ec8aSmrg   esac
1071089069ce9Smrgfi
10711b789ec8aSmrgAC_SUBST([am__include])
10712b789ec8aSmrgAC_SUBST([am__quote])
10713b789ec8aSmrgAC_MSG_RESULT([$_am_result])
10714b789ec8aSmrgrm -f confinc confmf
10715b789ec8aSmrg])
1071637eb1ca1Smrg
10717b789ec8aSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
10718b789ec8aSmrg
10719b789ec8aSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
10720b789ec8aSmrg# Free Software Foundation, Inc.
107213e256790Smrg#
10722b789ec8aSmrg# This file is free software; the Free Software Foundation
10723b789ec8aSmrg# gives unlimited permission to copy and/or distribute it,
10724b789ec8aSmrg# with or without modifications, as long as this notice is preserved.
1072537eb1ca1Smrg
10726b789ec8aSmrg# serial 6
10727b789ec8aSmrg
10728b789ec8aSmrg# AM_MISSING_PROG(NAME, PROGRAM)
10729b789ec8aSmrg# ------------------------------
10730b789ec8aSmrgAC_DEFUN([AM_MISSING_PROG],
10731b789ec8aSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
10732b789ec8aSmrg$1=${$1-"${am_missing_run}$2"}
10733b789ec8aSmrgAC_SUBST($1)])
10734b789ec8aSmrg
10735b789ec8aSmrg
10736b789ec8aSmrg# AM_MISSING_HAS_RUN
10737b789ec8aSmrg# ------------------
10738b789ec8aSmrg# Define MISSING if not defined so far and test if it supports --run.
10739b789ec8aSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
10740b789ec8aSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
10741b789ec8aSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
10742b789ec8aSmrgAC_REQUIRE_AUX_FILE([missing])dnl
10743b789ec8aSmrgif test x"${MISSING+set}" != xset; then
10744b789ec8aSmrg  case $am_aux_dir in
10745b789ec8aSmrg  *\ * | *\	*)
10746b789ec8aSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
10747b789ec8aSmrg  *)
10748b789ec8aSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
10749b789ec8aSmrg  esac
1075089069ce9Smrgfi
10751b789ec8aSmrg# Use eval to expand $SHELL
10752b789ec8aSmrgif eval "$MISSING --run true"; then
10753b789ec8aSmrg  am_missing_run="$MISSING --run "
1075489069ce9Smrgelse
10755b789ec8aSmrg  am_missing_run=
10756b789ec8aSmrg  AC_MSG_WARN([`missing' script is too old or missing])
1075789069ce9Smrgfi
10758b789ec8aSmrg])
1075937eb1ca1Smrg
10760b789ec8aSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
1076189069ce9Smrg#
10762b789ec8aSmrg# This file is free software; the Free Software Foundation
10763b789ec8aSmrg# gives unlimited permission to copy and/or distribute it,
10764b789ec8aSmrg# with or without modifications, as long as this notice is preserved.
10765b789ec8aSmrg
10766b789ec8aSmrg# AM_PROG_MKDIR_P
10767b789ec8aSmrg# ---------------
10768b789ec8aSmrg# Check for `mkdir -p'.
10769b789ec8aSmrgAC_DEFUN([AM_PROG_MKDIR_P],
10770b789ec8aSmrg[AC_PREREQ([2.60])dnl
10771b789ec8aSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
10772b789ec8aSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
10773b789ec8aSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
10774b789ec8aSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
10775b789ec8aSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
10776b789ec8aSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
10777b789ec8aSmrgdnl adjustment using top_builddir (which is defined more often than
10778b789ec8aSmrgdnl MKDIR_P).
10779b789ec8aSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
10780b789ec8aSmrgcase $mkdir_p in
10781b789ec8aSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
10782b789ec8aSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
10783b789ec8aSmrgesac
10784b789ec8aSmrg])
10785b789ec8aSmrg
10786b789ec8aSmrg# Helper functions for option handling.                     -*- Autoconf -*-
10787b789ec8aSmrg
10788b789ec8aSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
1078989069ce9Smrg#
10790b789ec8aSmrg# This file is free software; the Free Software Foundation
10791b789ec8aSmrg# gives unlimited permission to copy and/or distribute it,
10792b789ec8aSmrg# with or without modifications, as long as this notice is preserved.
10793b789ec8aSmrg
10794b789ec8aSmrg# serial 4
10795b789ec8aSmrg
10796b789ec8aSmrg# _AM_MANGLE_OPTION(NAME)
10797b789ec8aSmrg# -----------------------
10798b789ec8aSmrgAC_DEFUN([_AM_MANGLE_OPTION],
10799b789ec8aSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
10800b789ec8aSmrg
10801b789ec8aSmrg# _AM_SET_OPTION(NAME)
10802b789ec8aSmrg# ------------------------------
10803b789ec8aSmrg# Set option NAME.  Presently that only means defining a flag for this option.
10804b789ec8aSmrgAC_DEFUN([_AM_SET_OPTION],
10805b789ec8aSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
10806b789ec8aSmrg
10807b789ec8aSmrg# _AM_SET_OPTIONS(OPTIONS)
10808b789ec8aSmrg# ----------------------------------
10809b789ec8aSmrg# OPTIONS is a space-separated list of Automake options.
10810b789ec8aSmrgAC_DEFUN([_AM_SET_OPTIONS],
10811b789ec8aSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
10812b789ec8aSmrg
10813b789ec8aSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
10814b789ec8aSmrg# -------------------------------------------
10815b789ec8aSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
10816b789ec8aSmrgAC_DEFUN([_AM_IF_OPTION],
10817b789ec8aSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
10818b789ec8aSmrg
10819b789ec8aSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
10820b789ec8aSmrg
10821b789ec8aSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
10822b789ec8aSmrg# Free Software Foundation, Inc.
1082389069ce9Smrg#
10824b789ec8aSmrg# This file is free software; the Free Software Foundation
10825b789ec8aSmrg# gives unlimited permission to copy and/or distribute it,
10826b789ec8aSmrg# with or without modifications, as long as this notice is preserved.
10827c43cc173Smrg
10828b789ec8aSmrg# serial 5
108293e256790Smrg
10830b789ec8aSmrg# AM_SANITY_CHECK
10831b789ec8aSmrg# ---------------
10832b789ec8aSmrgAC_DEFUN([AM_SANITY_CHECK],
10833b789ec8aSmrg[AC_MSG_CHECKING([whether build environment is sane])
10834b789ec8aSmrg# Just in case
10835b789ec8aSmrgsleep 1
10836b789ec8aSmrgecho timestamp > conftest.file
10837b789ec8aSmrg# Reject unsafe characters in $srcdir or the absolute working directory
10838b789ec8aSmrg# name.  Accept space and tab only in the latter.
10839b789ec8aSmrgam_lf='
10840b789ec8aSmrg'
10841b789ec8aSmrgcase `pwd` in
10842b789ec8aSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
10843b789ec8aSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
10844b789ec8aSmrgesac
10845b789ec8aSmrgcase $srcdir in
10846b789ec8aSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
10847b789ec8aSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
108483e256790Smrgesac
108493e256790Smrg
10850b789ec8aSmrg# Do `set' in a subshell so we don't clobber the current shell's
10851b789ec8aSmrg# arguments.  Must try -L first in case configure is actually a
10852b789ec8aSmrg# symlink; some systems play weird games with the mod time of symlinks
10853b789ec8aSmrg# (eg FreeBSD returns the mod time of the symlink's containing
10854b789ec8aSmrg# directory).
10855b789ec8aSmrgif (
10856b789ec8aSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
10857b789ec8aSmrg   if test "$[*]" = "X"; then
10858b789ec8aSmrg      # -L didn't work.
10859b789ec8aSmrg      set X `ls -t "$srcdir/configure" conftest.file`
108603e256790Smrg   fi
10861b789ec8aSmrg   rm -f conftest.file
10862b789ec8aSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
10863b789ec8aSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
10864b789ec8aSmrg
10865b789ec8aSmrg      # If neither matched, then we have a broken ls.  This can happen
10866b789ec8aSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
10867b789ec8aSmrg      # broken ls alias from the environment.  This has actually
10868b789ec8aSmrg      # happened.  Such a system could not be considered "sane".
10869b789ec8aSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
10870b789ec8aSmrgalias in your environment])
108713e256790Smrg   fi
10872c43cc173Smrg
10873b789ec8aSmrg   test "$[2]" = conftest.file
10874b789ec8aSmrg   )
10875b789ec8aSmrgthen
10876b789ec8aSmrg   # Ok.
10877b789ec8aSmrg   :
10878b789ec8aSmrgelse
10879b789ec8aSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
10880b789ec8aSmrgCheck your system clock])
1088189069ce9Smrgfi
10882b789ec8aSmrgAC_MSG_RESULT(yes)])
10883c43cc173Smrg
10884b789ec8aSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
10885b789ec8aSmrg#
10886b789ec8aSmrg# This file is free software; the Free Software Foundation
10887b789ec8aSmrg# gives unlimited permission to copy and/or distribute it,
10888b789ec8aSmrg# with or without modifications, as long as this notice is preserved.
10889c43cc173Smrg
10890b789ec8aSmrg# serial 1
10891c43cc173Smrg
10892b789ec8aSmrg# AM_SILENT_RULES([DEFAULT])
1089389069ce9Smrg# --------------------------
10894b789ec8aSmrg# Enable less verbose build rules; with the default set to DEFAULT
10895b789ec8aSmrg# (`yes' being less verbose, `no' or empty being verbose).
10896b789ec8aSmrgAC_DEFUN([AM_SILENT_RULES],
10897b789ec8aSmrg[AC_ARG_ENABLE([silent-rules],
10898b789ec8aSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
10899b789ec8aSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
10900b789ec8aSmrgcase $enable_silent_rules in
10901b789ec8aSmrgyes) AM_DEFAULT_VERBOSITY=0;;
10902b789ec8aSmrgno)  AM_DEFAULT_VERBOSITY=1;;
10903b789ec8aSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
10904b789ec8aSmrgesac
10905b789ec8aSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
10906b789ec8aSmrgAM_BACKSLASH='\'
10907b789ec8aSmrgAC_SUBST([AM_BACKSLASH])dnl
10908b789ec8aSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
10909b789ec8aSmrg])
10910c43cc173Smrg
10911b789ec8aSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
10912b789ec8aSmrg#
10913b789ec8aSmrg# This file is free software; the Free Software Foundation
10914b789ec8aSmrg# gives unlimited permission to copy and/or distribute it,
10915b789ec8aSmrg# with or without modifications, as long as this notice is preserved.
10916c43cc173Smrg
10917b789ec8aSmrg# AM_PROG_INSTALL_STRIP
10918b789ec8aSmrg# ---------------------
10919b789ec8aSmrg# One issue with vendor `install' (even GNU) is that you can't
10920b789ec8aSmrg# specify the program used to strip binaries.  This is especially
10921b789ec8aSmrg# annoying in cross-compiling environments, where the build's strip
10922b789ec8aSmrg# is unlikely to handle the host's binaries.
10923b789ec8aSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
10924b789ec8aSmrg# always use install-sh in `make install-strip', and initialize
10925b789ec8aSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
10926b789ec8aSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
10927b789ec8aSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
10928b789ec8aSmrg# Installed binaries are usually stripped using `strip' when the user
10929b789ec8aSmrg# run `make install-strip'.  However `strip' might not be the right
10930b789ec8aSmrg# tool to use in cross-compilation environments, therefore Automake
10931b789ec8aSmrg# will honor the `STRIP' environment variable to overrule this program.
10932b789ec8aSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
10933b789ec8aSmrgif test "$cross_compiling" != no; then
10934b789ec8aSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
1093589069ce9Smrgfi
10936b789ec8aSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
10937b789ec8aSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
10938c27c18e8Smrg
10939b789ec8aSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
10940b789ec8aSmrg#
10941b789ec8aSmrg# This file is free software; the Free Software Foundation
10942b789ec8aSmrg# gives unlimited permission to copy and/or distribute it,
10943b789ec8aSmrg# with or without modifications, as long as this notice is preserved.
1094437eb1ca1Smrg
10945b789ec8aSmrg# serial 2
1094637eb1ca1Smrg
10947b789ec8aSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
10948b789ec8aSmrg# ---------------------------
10949b789ec8aSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
10950b789ec8aSmrg# This macro is traced by Automake.
10951b789ec8aSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
10952c27c18e8Smrg
10953b789ec8aSmrg# AM_SUBST_NOTMAKE(VARIABLE)
10954b789ec8aSmrg# ---------------------------
10955b789ec8aSmrg# Public sister of _AM_SUBST_NOTMAKE.
10956b789ec8aSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
10957b789ec8aSmrg
10958b789ec8aSmrg# Check how to create a tarball.                            -*- Autoconf -*-
10959b789ec8aSmrg
10960b789ec8aSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
1096189069ce9Smrg#
10962b789ec8aSmrg# This file is free software; the Free Software Foundation
10963b789ec8aSmrg# gives unlimited permission to copy and/or distribute it,
10964b789ec8aSmrg# with or without modifications, as long as this notice is preserved.
10965c27c18e8Smrg
10966b789ec8aSmrg# serial 2
1096789069ce9Smrg
10968b789ec8aSmrg# _AM_PROG_TAR(FORMAT)
10969c27c18e8Smrg# --------------------
10970b789ec8aSmrg# Check how to create a tarball in format FORMAT.
10971b789ec8aSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
10972c27c18e8Smrg#
10973b789ec8aSmrg# Substitute a variable $(am__tar) that is a command
10974b789ec8aSmrg# writing to stdout a FORMAT-tarball containing the directory
10975b789ec8aSmrg# $tardir.
10976b789ec8aSmrg#     tardir=directory && $(am__tar) > result.tar
10977c27c18e8Smrg#
10978b789ec8aSmrg# Substitute a variable $(am__untar) that extract such
10979b789ec8aSmrg# a tarball read from stdin.
10980b789ec8aSmrg#     $(am__untar) < result.tar
10981b789ec8aSmrgAC_DEFUN([_AM_PROG_TAR],
10982b789ec8aSmrg[# Always define AMTAR for backward compatibility.
10983b789ec8aSmrgAM_MISSING_PROG([AMTAR], [tar])
10984b789ec8aSmrgm4_if([$1], [v7],
10985b789ec8aSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
10986b789ec8aSmrg     [m4_case([$1], [ustar],, [pax],,
10987b789ec8aSmrg              [m4_fatal([Unknown tar format])])
10988b789ec8aSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
10989b789ec8aSmrg# Loop over all known methods to create a tar archive until one works.
10990b789ec8aSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
10991b789ec8aSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
10992b789ec8aSmrg# Do not fold the above two line into one, because Tru64 sh and
10993b789ec8aSmrg# Solaris sh will not grok spaces in the rhs of `-'.
10994b789ec8aSmrgfor _am_tool in $_am_tools
10995b789ec8aSmrgdo
10996b789ec8aSmrg  case $_am_tool in
10997b789ec8aSmrg  gnutar)
10998b789ec8aSmrg    for _am_tar in tar gnutar gtar;
10999b789ec8aSmrg    do
11000b789ec8aSmrg      AM_RUN_LOG([$_am_tar --version]) && break
11001b789ec8aSmrg    done
11002b789ec8aSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
11003b789ec8aSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
11004b789ec8aSmrg    am__untar="$_am_tar -xf -"
11005b789ec8aSmrg    ;;
11006b789ec8aSmrg  plaintar)
11007b789ec8aSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
11008b789ec8aSmrg    # ustar tarball either.
11009b789ec8aSmrg    (tar --version) >/dev/null 2>&1 && continue
11010b789ec8aSmrg    am__tar='tar chf - "$$tardir"'
11011b789ec8aSmrg    am__tar_='tar chf - "$tardir"'
11012b789ec8aSmrg    am__untar='tar xf -'
11013b789ec8aSmrg    ;;
11014b789ec8aSmrg  pax)
11015b789ec8aSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
11016b789ec8aSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
11017b789ec8aSmrg    am__untar='pax -r'
11018b789ec8aSmrg    ;;
11019b789ec8aSmrg  cpio)
11020b789ec8aSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
11021b789ec8aSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
11022b789ec8aSmrg    am__untar='cpio -i -H $1 -d'
11023b789ec8aSmrg    ;;
11024b789ec8aSmrg  none)
11025b789ec8aSmrg    am__tar=false
11026b789ec8aSmrg    am__tar_=false
11027b789ec8aSmrg    am__untar=false
11028b789ec8aSmrg    ;;
11029b789ec8aSmrg  esac
110303e256790Smrg
11031b789ec8aSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
11032b789ec8aSmrg  # and am__untar set.
11033b789ec8aSmrg  test -n "${am_cv_prog_tar_$1}" && break
11034c43cc173Smrg
11035b789ec8aSmrg  # tar/untar a dummy directory, and stop if the command works
11036b789ec8aSmrg  rm -rf conftest.dir
11037b789ec8aSmrg  mkdir conftest.dir
11038b789ec8aSmrg  echo GrepMe > conftest.dir/file
11039b789ec8aSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
11040b789ec8aSmrg  rm -rf conftest.dir
11041b789ec8aSmrg  if test -s conftest.tar; then
11042b789ec8aSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
11043b789ec8aSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
11044b789ec8aSmrg  fi
11045b789ec8aSmrgdone
11046b789ec8aSmrgrm -rf conftest.dir
1104721e67964Smrg
11048b789ec8aSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
11049b789ec8aSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
11050b789ec8aSmrgAC_SUBST([am__tar])
11051b789ec8aSmrgAC_SUBST([am__untar])
11052b789ec8aSmrg]) # _AM_PROG_TAR
11053c43cc173Smrg
11054