aclocal.m4 revision e4da38af
1e4da38afSmrg# generated automatically by aclocal 1.15 -*- Autoconf -*-
2a73597f9Smrg
3e4da38afSmrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
4659607e0Smrg
5659607e0Smrg# This file is free software; the Free Software Foundation
6659607e0Smrg# gives unlimited permission to copy and/or distribute it,
7659607e0Smrg# with or without modifications, as long as this notice is preserved.
8659607e0Smrg
9659607e0Smrg# This program is distributed in the hope that it will be useful,
10659607e0Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11659607e0Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12659607e0Smrg# PARTICULAR PURPOSE.
13659607e0Smrg
1484bf8334Smrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15fc27e79cSmrgm4_ifndef([AC_AUTOCONF_VERSION],
16fc27e79cSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17e4da38afSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
18e4da38afSmrg[m4_warning([this file was generated for autoconf 2.69.
19fc27e79cSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
20fc27e79cSmrgIf you have problems, you may need to regenerate the build system entirely.
21a73597f9SmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22659607e0Smrg
23e4da38afSmrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
246aab59a7Smrg#
25e4da38afSmrg#   Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
26e4da38afSmrg#   Written by Gordon Matzigkeit, 1996
27e4da38afSmrg#
28e4da38afSmrg# This file is free software; the Free Software Foundation gives
29e4da38afSmrg# unlimited permission to copy and/or distribute it, with or without
30e4da38afSmrg# modifications, as long as this notice is preserved.
3184bf8334Smrg
32e4da38afSmrgm4_define([_LT_COPYING], [dnl
33e4da38afSmrg# Copyright (C) 2014 Free Software Foundation, Inc.
34e4da38afSmrg# This is free software; see the source for copying conditions.  There is NO
35e4da38afSmrg# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3684bf8334Smrg
37e4da38afSmrg# GNU Libtool is free software; you can redistribute it and/or modify
38e4da38afSmrg# it under the terms of the GNU General Public License as published by
39e4da38afSmrg# the Free Software Foundation; either version 2 of of the License, or
40e4da38afSmrg# (at your option) any later version.
41e4da38afSmrg#
42e4da38afSmrg# As a special exception to the GNU General Public License, if you
43e4da38afSmrg# distribute this file as part of a program or library that is built
44e4da38afSmrg# using GNU Libtool, you may include this file under the  same
45e4da38afSmrg# distribution terms that you use for the rest of that program.
46e4da38afSmrg#
47e4da38afSmrg# GNU Libtool is distributed in the hope that it will be useful, but
48e4da38afSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
49e4da38afSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
50e4da38afSmrg# GNU General Public License for more details.
51e4da38afSmrg#
52e4da38afSmrg# You should have received a copy of the GNU General Public License
53e4da38afSmrg# along with this program.  If not, see <http://www.gnu.org/licenses/>.
54e4da38afSmrg])
5584bf8334Smrg
56e4da38afSmrg# serial 58 LT_INIT
5784bf8334Smrg
5884bf8334Smrg
59e4da38afSmrg# LT_PREREQ(VERSION)
60e4da38afSmrg# ------------------
61e4da38afSmrg# Complain and exit if this libtool version is less that VERSION.
62e4da38afSmrgm4_defun([LT_PREREQ],
63e4da38afSmrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
64e4da38afSmrg       [m4_default([$3],
65e4da38afSmrg		   [m4_fatal([Libtool version $1 or higher is required],
66e4da38afSmrg		             63)])],
67e4da38afSmrg       [$2])])
68fc27e79cSmrg
69659607e0Smrg
70e4da38afSmrg# _LT_CHECK_BUILDDIR
71e4da38afSmrg# ------------------
72e4da38afSmrg# Complain if the absolute build directory name contains unusual characters
73e4da38afSmrgm4_defun([_LT_CHECK_BUILDDIR],
74e4da38afSmrg[case `pwd` in
75e4da38afSmrg  *\ * | *\	*)
76e4da38afSmrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
77e4da38afSmrgesac
78a73597f9Smrg])
79659607e0Smrg
80659607e0Smrg
81e4da38afSmrg# LT_INIT([OPTIONS])
82e4da38afSmrg# ------------------
83e4da38afSmrgAC_DEFUN([LT_INIT],
84e4da38afSmrg[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
85e4da38afSmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
86e4da38afSmrgAC_BEFORE([$0], [LT_LANG])dnl
87e4da38afSmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
88e4da38afSmrgAC_BEFORE([$0], [LTDL_INIT])dnl
89e4da38afSmrgm4_require([_LT_CHECK_BUILDDIR])dnl
90659607e0Smrg
91e4da38afSmrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
92e4da38afSmrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
93e4da38afSmrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
94e4da38afSmrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
95e4da38afSmrgdnl unless we require an AC_DEFUNed macro:
96e4da38afSmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
97e4da38afSmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
98e4da38afSmrgAC_REQUIRE([LTVERSION_VERSION])dnl
99e4da38afSmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
100e4da38afSmrgm4_require([_LT_PROG_LTMAIN])dnl
101659607e0Smrg
102e4da38afSmrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
103659607e0Smrg
104e4da38afSmrgdnl Parse OPTIONS
105e4da38afSmrg_LT_SET_OPTIONS([$0], [$1])
106659607e0Smrg
107e4da38afSmrg# This can be used to rebuild libtool when needed
108e4da38afSmrgLIBTOOL_DEPS=$ltmain
109659607e0Smrg
110e4da38afSmrg# Always use our own libtool.
111e4da38afSmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
112e4da38afSmrgAC_SUBST(LIBTOOL)dnl
113659607e0Smrg
114e4da38afSmrg_LT_SETUP
115a73597f9Smrg
116e4da38afSmrg# Only expand once:
117e4da38afSmrgm4_define([LT_INIT])
118e4da38afSmrg])# LT_INIT
119a73597f9Smrg
120e4da38afSmrg# Old names:
121e4da38afSmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
122e4da38afSmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
123e4da38afSmrgdnl aclocal-1.4 backwards compatibility:
124e4da38afSmrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
125e4da38afSmrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
126659607e0Smrg
127fc27e79cSmrg
128e4da38afSmrg# _LT_PREPARE_CC_BASENAME
129e4da38afSmrg# -----------------------
130e4da38afSmrgm4_defun([_LT_PREPARE_CC_BASENAME], [
131e4da38afSmrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
132e4da38afSmrgfunc_cc_basename ()
133e4da38afSmrg{
134e4da38afSmrg    for cc_temp in @S|@*""; do
135e4da38afSmrg      case $cc_temp in
136e4da38afSmrg        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
137e4da38afSmrg        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
138e4da38afSmrg        \-*) ;;
139e4da38afSmrg        *) break;;
140e4da38afSmrg      esac
14184bf8334Smrg    done
142e4da38afSmrg    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
143e4da38afSmrg}
144e4da38afSmrg])# _LT_PREPARE_CC_BASENAME
145fc27e79cSmrg
146fc27e79cSmrg
147e4da38afSmrg# _LT_CC_BASENAME(CC)
148e4da38afSmrg# -------------------
149e4da38afSmrg# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
150e4da38afSmrg# but that macro is also expanded into generated libtool script, which
151e4da38afSmrg# arranges for $SED and $ECHO to be set by different means.
152e4da38afSmrgm4_defun([_LT_CC_BASENAME],
153e4da38afSmrg[m4_require([_LT_PREPARE_CC_BASENAME])dnl
154e4da38afSmrgAC_REQUIRE([_LT_DECL_SED])dnl
155e4da38afSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
156e4da38afSmrgfunc_cc_basename $1
157e4da38afSmrgcc_basename=$func_cc_basename_result
15884bf8334Smrg])
159659607e0Smrg
160659607e0Smrg
161e4da38afSmrg# _LT_FILEUTILS_DEFAULTS
162e4da38afSmrg# ----------------------
163e4da38afSmrg# It is okay to use these file commands and assume they have been set
164e4da38afSmrg# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
165e4da38afSmrgm4_defun([_LT_FILEUTILS_DEFAULTS],
166e4da38afSmrg[: ${CP="cp -f"}
167e4da38afSmrg: ${MV="mv -f"}
168e4da38afSmrg: ${RM="rm -f"}
169e4da38afSmrg])# _LT_FILEUTILS_DEFAULTS
170659607e0Smrg
171659607e0Smrg
172e4da38afSmrg# _LT_SETUP
173e4da38afSmrg# ---------
174e4da38afSmrgm4_defun([_LT_SETUP],
175e4da38afSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
176e4da38afSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
177e4da38afSmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
178e4da38afSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
179e4da38afSmrg
180e4da38afSmrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
181e4da38afSmrgdnl
182e4da38afSmrg_LT_DECL([], [host_alias], [0], [The host system])dnl
183e4da38afSmrg_LT_DECL([], [host], [0])dnl
184e4da38afSmrg_LT_DECL([], [host_os], [0])dnl
185e4da38afSmrgdnl
186e4da38afSmrg_LT_DECL([], [build_alias], [0], [The build system])dnl
187e4da38afSmrg_LT_DECL([], [build], [0])dnl
188e4da38afSmrg_LT_DECL([], [build_os], [0])dnl
189e4da38afSmrgdnl
190e4da38afSmrgAC_REQUIRE([AC_PROG_CC])dnl
191e4da38afSmrgAC_REQUIRE([LT_PATH_LD])dnl
192e4da38afSmrgAC_REQUIRE([LT_PATH_NM])dnl
193e4da38afSmrgdnl
194e4da38afSmrgAC_REQUIRE([AC_PROG_LN_S])dnl
195e4da38afSmrgtest -z "$LN_S" && LN_S="ln -s"
196e4da38afSmrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
197e4da38afSmrgdnl
198e4da38afSmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
199e4da38afSmrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
200e4da38afSmrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
201e4da38afSmrgdnl
202e4da38afSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
203e4da38afSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
204e4da38afSmrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
205e4da38afSmrgm4_require([_LT_CMD_RELOAD])dnl
206e4da38afSmrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
207e4da38afSmrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
208e4da38afSmrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
209e4da38afSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
210e4da38afSmrgm4_require([_LT_WITH_SYSROOT])dnl
211e4da38afSmrgm4_require([_LT_CMD_TRUNCATE])dnl
212e4da38afSmrg
213e4da38afSmrg_LT_CONFIG_LIBTOOL_INIT([
214e4da38afSmrg# See if we are running on zsh, and set the options that allow our
215e4da38afSmrg# commands through without removal of \ escapes INIT.
216e4da38afSmrgif test -n "\${ZSH_VERSION+set}"; then
217e4da38afSmrg   setopt NO_GLOB_SUBST
21884bf8334Smrgfi
21984bf8334Smrg])
220e4da38afSmrgif test -n "${ZSH_VERSION+set}"; then
221e4da38afSmrg   setopt NO_GLOB_SUBST
222e4da38afSmrgfi
223659607e0Smrg
224e4da38afSmrg_LT_CHECK_OBJDIR
225659607e0Smrg
226e4da38afSmrgm4_require([_LT_TAG_COMPILER])dnl
227659607e0Smrg
228e4da38afSmrgcase $host_os in
229e4da38afSmrgaix3*)
230e4da38afSmrg  # AIX sometimes has problems with the GCC collect2 program.  For some
231e4da38afSmrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
232e4da38afSmrg  # vanish in a puff of smoke.
233e4da38afSmrg  if test set != "${COLLECT_NAMES+set}"; then
234e4da38afSmrg    COLLECT_NAMES=
235e4da38afSmrg    export COLLECT_NAMES
236e4da38afSmrg  fi
237e4da38afSmrg  ;;
238e4da38afSmrgesac
239fc27e79cSmrg
240e4da38afSmrg# Global variables:
241e4da38afSmrgofile=libtool
242e4da38afSmrgcan_build_shared=yes
243659607e0Smrg
244e4da38afSmrg# All known linkers require a '.a' archive for static linking (except MSVC,
245e4da38afSmrg# which needs '.lib').
246e4da38afSmrglibext=a
247659607e0Smrg
248e4da38afSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
249b73be646Smrg
250e4da38afSmrgold_CC=$CC
251e4da38afSmrgold_CFLAGS=$CFLAGS
252659607e0Smrg
253e4da38afSmrg# Set sane defaults for various variables
254e4da38afSmrgtest -z "$CC" && CC=cc
255e4da38afSmrgtest -z "$LTCC" && LTCC=$CC
256e4da38afSmrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
257e4da38afSmrgtest -z "$LD" && LD=ld
258e4da38afSmrgtest -z "$ac_objext" && ac_objext=o
259659607e0Smrg
260e4da38afSmrg_LT_CC_BASENAME([$compiler])
261fc27e79cSmrg
262e4da38afSmrg# Only perform the check for file, if the check method requires it
263e4da38afSmrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
264e4da38afSmrgcase $deplibs_check_method in
265e4da38afSmrgfile_magic*)
266e4da38afSmrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
267e4da38afSmrg    _LT_PATH_MAGIC
26884bf8334Smrg  fi
269e4da38afSmrg  ;;
270e4da38afSmrgesac
271fc27e79cSmrg
272e4da38afSmrg# Use C for the default configuration in the libtool script
273e4da38afSmrgLT_SUPPORTED_TAG([CC])
274e4da38afSmrg_LT_LANG_C_CONFIG
275e4da38afSmrg_LT_LANG_DEFAULT_CONFIG
276e4da38afSmrg_LT_CONFIG_COMMANDS
277e4da38afSmrg])# _LT_SETUP
278fc27e79cSmrg
279fc27e79cSmrg
280e4da38afSmrg# _LT_PREPARE_SED_QUOTE_VARS
281e4da38afSmrg# --------------------------
282e4da38afSmrg# Define a few sed substitution that help us do robust quoting.
283e4da38afSmrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
284e4da38afSmrg[# Backslashify metacharacters that are still active within
285e4da38afSmrg# double-quoted strings.
286e4da38afSmrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
287fc27e79cSmrg
288e4da38afSmrg# Same as above, but do not quote variable references.
289e4da38afSmrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
29084bf8334Smrg
291e4da38afSmrg# Sed substitution to delay expansion of an escaped shell variable in a
292e4da38afSmrg# double_quote_subst'ed string.
293e4da38afSmrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
29484bf8334Smrg
295e4da38afSmrg# Sed substitution to delay expansion of an escaped single quote.
296e4da38afSmrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
297a73597f9Smrg
298e4da38afSmrg# Sed substitution to avoid accidental globbing in evaled expressions
299e4da38afSmrgno_glob_subst='s/\*/\\\*/g'
300e4da38afSmrg])
301fc27e79cSmrg
302e4da38afSmrg# _LT_PROG_LTMAIN
303e4da38afSmrg# ---------------
304e4da38afSmrg# Note that this code is called both from 'configure', and 'config.status'
305e4da38afSmrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
306e4da38afSmrg# 'config.status' has no value for ac_aux_dir unless we are using Automake,
307e4da38afSmrg# so we pass a copy along to make sure it has a sensible value anyway.
308e4da38afSmrgm4_defun([_LT_PROG_LTMAIN],
309e4da38afSmrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
310e4da38afSmrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
311e4da38afSmrgltmain=$ac_aux_dir/ltmain.sh
312e4da38afSmrg])# _LT_PROG_LTMAIN
313fc27e79cSmrg
314659607e0Smrg
315659607e0Smrg
316e4da38afSmrg# So that we can recreate a full libtool script including additional
317e4da38afSmrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
318e4da38afSmrg# in macros and then make a single call at the end using the 'libtool'
319e4da38afSmrg# label.
320fc27e79cSmrg
321fc27e79cSmrg
322e4da38afSmrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
323e4da38afSmrg# ----------------------------------------
324e4da38afSmrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
325e4da38afSmrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
326e4da38afSmrg[m4_ifval([$1],
327e4da38afSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
328e4da38afSmrg                     [$1
329e4da38afSmrg])])])
330659607e0Smrg
331e4da38afSmrg# Initialize.
332e4da38afSmrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
333659607e0Smrg
334659607e0Smrg
335e4da38afSmrg# _LT_CONFIG_LIBTOOL([COMMANDS])
336e4da38afSmrg# ------------------------------
337e4da38afSmrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
338e4da38afSmrgm4_define([_LT_CONFIG_LIBTOOL],
339e4da38afSmrg[m4_ifval([$1],
340e4da38afSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
341e4da38afSmrg                     [$1
342e4da38afSmrg])])])
343659607e0Smrg
344e4da38afSmrg# Initialize.
345e4da38afSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
346659607e0Smrg
347659607e0Smrg
348e4da38afSmrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
349e4da38afSmrg# -----------------------------------------------------
350e4da38afSmrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
351e4da38afSmrg[_LT_CONFIG_LIBTOOL([$1])
352e4da38afSmrg_LT_CONFIG_LIBTOOL_INIT([$2])
353a73597f9Smrg])
354a73597f9Smrg
355a73597f9Smrg
356e4da38afSmrg# _LT_FORMAT_COMMENT([COMMENT])
357e4da38afSmrg# -----------------------------
358e4da38afSmrg# Add leading comment marks to the start of each line, and a trailing
359e4da38afSmrg# full-stop to the whole comment if one is not present already.
360e4da38afSmrgm4_define([_LT_FORMAT_COMMENT],
361e4da38afSmrg[m4_ifval([$1], [
362e4da38afSmrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
363e4da38afSmrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
364e4da38afSmrg)])
365fc27e79cSmrg
366fc27e79cSmrg
367e4da38afSmrg
368e4da38afSmrg
369e4da38afSmrg
370e4da38afSmrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
371e4da38afSmrg# -------------------------------------------------------------------
372e4da38afSmrg# CONFIGNAME is the name given to the value in the libtool script.
373e4da38afSmrg# VARNAME is the (base) name used in the configure script.
374e4da38afSmrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
375e4da38afSmrg# VARNAME.  Any other value will be used directly.
376e4da38afSmrgm4_define([_LT_DECL],
377e4da38afSmrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
378e4da38afSmrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
379e4da38afSmrg	[m4_ifval([$1], [$1], [$2])])
380e4da38afSmrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
381e4da38afSmrg    m4_ifval([$4],
382e4da38afSmrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
383e4da38afSmrg    lt_dict_add_subkey([lt_decl_dict], [$2],
384e4da38afSmrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
385b73be646Smrg])
386b73be646Smrg
387659607e0Smrg
388e4da38afSmrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
389e4da38afSmrg# --------------------------------------------------------
390e4da38afSmrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
391659607e0Smrg
392659607e0Smrg
393e4da38afSmrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
394e4da38afSmrg# ------------------------------------------------
395e4da38afSmrgm4_define([lt_decl_tag_varnames],
396e4da38afSmrg[_lt_decl_filter([tagged?], [yes], $@)])
397659607e0Smrg
398659607e0Smrg
399e4da38afSmrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
400e4da38afSmrg# ---------------------------------------------------------
401e4da38afSmrgm4_define([_lt_decl_filter],
402e4da38afSmrg[m4_case([$#],
403e4da38afSmrg  [0], [m4_fatal([$0: too few arguments: $#])],
404e4da38afSmrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
405e4da38afSmrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
406e4da38afSmrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
407e4da38afSmrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
408e4da38afSmrg])
409fc27e79cSmrg
410fc27e79cSmrg
411e4da38afSmrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
412e4da38afSmrg# --------------------------------------------------
413e4da38afSmrgm4_define([lt_decl_quote_varnames],
414e4da38afSmrg[_lt_decl_filter([value], [1], $@)])
415659607e0Smrg
416659607e0Smrg
417e4da38afSmrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
418e4da38afSmrg# ---------------------------------------------------
419e4da38afSmrgm4_define([lt_decl_dquote_varnames],
420e4da38afSmrg[_lt_decl_filter([value], [2], $@)])
421659607e0Smrg
422659607e0Smrg
423e4da38afSmrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
424e4da38afSmrg# ---------------------------------------------------
425e4da38afSmrgm4_define([lt_decl_varnames_tagged],
426e4da38afSmrg[m4_assert([$# <= 2])dnl
427e4da38afSmrg_$0(m4_quote(m4_default([$1], [[, ]])),
428e4da38afSmrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
429e4da38afSmrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
430e4da38afSmrgm4_define([_lt_decl_varnames_tagged],
431e4da38afSmrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
432659607e0Smrg
433659607e0Smrg
434e4da38afSmrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
435e4da38afSmrg# ------------------------------------------------
436e4da38afSmrgm4_define([lt_decl_all_varnames],
437e4da38afSmrg[_$0(m4_quote(m4_default([$1], [[, ]])),
438e4da38afSmrg     m4_if([$2], [],
439e4da38afSmrg	   m4_quote(lt_decl_varnames),
440e4da38afSmrg	m4_quote(m4_shift($@))))[]dnl
441e4da38afSmrg])
442e4da38afSmrgm4_define([_lt_decl_all_varnames],
443e4da38afSmrg[lt_join($@, lt_decl_varnames_tagged([$1],
444e4da38afSmrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
445e4da38afSmrg])
4466aab59a7Smrg
447659607e0Smrg
448e4da38afSmrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
449e4da38afSmrg# ------------------------------------
450e4da38afSmrg# Quote a variable value, and forward it to 'config.status' so that its
451e4da38afSmrg# declaration there will have the same value as in 'configure'.  VARNAME
452e4da38afSmrg# must have a single quote delimited value for this to work.
453e4da38afSmrgm4_define([_LT_CONFIG_STATUS_DECLARE],
454e4da38afSmrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
455e4da38afSmrg
456659607e0Smrg
457e4da38afSmrg# _LT_CONFIG_STATUS_DECLARATIONS
458e4da38afSmrg# ------------------------------
459e4da38afSmrg# We delimit libtool config variables with single quotes, so when
460e4da38afSmrg# we write them to config.status, we have to be sure to quote all
461e4da38afSmrg# embedded single quotes properly.  In configure, this macro expands
462e4da38afSmrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
46384bf8334Smrg#
464e4da38afSmrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
465e4da38afSmrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
466e4da38afSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
467e4da38afSmrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
468659607e0Smrg
469e4da38afSmrg
470e4da38afSmrg# _LT_LIBTOOL_TAGS
471e4da38afSmrg# ----------------
472e4da38afSmrg# Output comment and list of tags supported by the script
473e4da38afSmrgm4_defun([_LT_LIBTOOL_TAGS],
474e4da38afSmrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
475e4da38afSmrgavailable_tags='_LT_TAGS'dnl
47684bf8334Smrg])
477fc27e79cSmrg
478e4da38afSmrg
479e4da38afSmrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
480e4da38afSmrg# -----------------------------------
481e4da38afSmrg# Extract the dictionary values for VARNAME (optionally with TAG) and
482e4da38afSmrg# expand to a commented shell variable setting:
48384bf8334Smrg#
484e4da38afSmrg#    # Some comment about what VAR is for.
485e4da38afSmrg#    visible_name=$lt_internal_name
486e4da38afSmrgm4_define([_LT_LIBTOOL_DECLARE],
487e4da38afSmrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
488e4da38afSmrg					   [description])))[]dnl
489e4da38afSmrgm4_pushdef([_libtool_name],
490e4da38afSmrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
491e4da38afSmrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
492e4da38afSmrg    [0], [_libtool_name=[$]$1],
493e4da38afSmrg    [1], [_libtool_name=$lt_[]$1],
494e4da38afSmrg    [2], [_libtool_name=$lt_[]$1],
495e4da38afSmrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
496e4da38afSmrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
497e4da38afSmrg])
498fc27e79cSmrg
499659607e0Smrg
500e4da38afSmrg# _LT_LIBTOOL_CONFIG_VARS
501e4da38afSmrg# -----------------------
502e4da38afSmrg# Produce commented declarations of non-tagged libtool config variables
503e4da38afSmrg# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
504e4da38afSmrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
505e4da38afSmrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
506e4da38afSmrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
507e4da38afSmrg[m4_foreach([_lt_var],
508e4da38afSmrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
509e4da38afSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
510659607e0Smrg
511fc27e79cSmrg
512e4da38afSmrg# _LT_LIBTOOL_TAG_VARS(TAG)
513e4da38afSmrg# -------------------------
514e4da38afSmrgm4_define([_LT_LIBTOOL_TAG_VARS],
515e4da38afSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
516e4da38afSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
517fc27e79cSmrg
518fc27e79cSmrg
519e4da38afSmrg# _LT_TAGVAR(VARNAME, [TAGNAME])
520e4da38afSmrg# ------------------------------
521e4da38afSmrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
522fc27e79cSmrg
523fc27e79cSmrg
524e4da38afSmrg# _LT_CONFIG_COMMANDS
525e4da38afSmrg# -------------------
526e4da38afSmrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
527e4da38afSmrg# variables for single and double quote escaping we saved from calls
528e4da38afSmrg# to _LT_DECL, we can put quote escaped variables declarations
529e4da38afSmrg# into 'config.status', and then the shell code to quote escape them in
530e4da38afSmrg# for loops in 'config.status'.  Finally, any additional code accumulated
531e4da38afSmrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
532e4da38afSmrgm4_defun([_LT_CONFIG_COMMANDS],
533e4da38afSmrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
534e4da38afSmrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
535e4da38afSmrg	dnl instead of duplicating it all over again into config.status,
536e4da38afSmrg	dnl then we will have config.status run $CONFIG_LT later, so it
537e4da38afSmrg	dnl needs to know what name is stored there:
538e4da38afSmrg        [AC_CONFIG_COMMANDS([libtool],
539e4da38afSmrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
540e4da38afSmrg    dnl If the libtool generation code is destined for config.status,
541e4da38afSmrg    dnl expand the accumulated commands and init code now:
542e4da38afSmrg    [AC_CONFIG_COMMANDS([libtool],
543e4da38afSmrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
544e4da38afSmrg])#_LT_CONFIG_COMMANDS
545fc27e79cSmrg
54684bf8334Smrg
547e4da38afSmrg# Initialize.
548e4da38afSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
549e4da38afSmrg[
550659607e0Smrg
551e4da38afSmrg# The HP-UX ksh and POSIX shell print the target directory to stdout
552e4da38afSmrg# if CDPATH is set.
553e4da38afSmrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
554659607e0Smrg
555e4da38afSmrgsed_quote_subst='$sed_quote_subst'
556e4da38afSmrgdouble_quote_subst='$double_quote_subst'
557e4da38afSmrgdelay_variable_subst='$delay_variable_subst'
558e4da38afSmrg_LT_CONFIG_STATUS_DECLARATIONS
559e4da38afSmrgLTCC='$LTCC'
560e4da38afSmrgLTCFLAGS='$LTCFLAGS'
561e4da38afSmrgcompiler='$compiler_DEFAULT'
562659607e0Smrg
563e4da38afSmrg# A function that is used when there is no print builtin or printf.
564e4da38afSmrgfunc_fallback_echo ()
565e4da38afSmrg{
566e4da38afSmrg  eval 'cat <<_LTECHO_EOF
567e4da38afSmrg\$[]1
568e4da38afSmrg_LTECHO_EOF'
569e4da38afSmrg}
570659607e0Smrg
571e4da38afSmrg# Quote evaled strings.
572e4da38afSmrgfor var in lt_decl_all_varnames([[ \
573e4da38afSmrg]], lt_decl_quote_varnames); do
574e4da38afSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
575e4da38afSmrg    *[[\\\\\\\`\\"\\\$]]*)
576e4da38afSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
57784bf8334Smrg      ;;
578e4da38afSmrg    *)
579e4da38afSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
58084bf8334Smrg      ;;
581e4da38afSmrg    esac
582e4da38afSmrgdone
583e4da38afSmrg
584e4da38afSmrg# Double-quote double-evaled strings.
585e4da38afSmrgfor var in lt_decl_all_varnames([[ \
586e4da38afSmrg]], lt_decl_dquote_varnames); do
587e4da38afSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
588e4da38afSmrg    *[[\\\\\\\`\\"\\\$]]*)
589e4da38afSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
59084bf8334Smrg      ;;
591e4da38afSmrg    *)
592e4da38afSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
59384bf8334Smrg      ;;
59484bf8334Smrg    esac
595e4da38afSmrgdone
59684bf8334Smrg
597e4da38afSmrg_LT_OUTPUT_LIBTOOL_INIT
598e4da38afSmrg])
599659607e0Smrg
600e4da38afSmrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
601e4da38afSmrg# ------------------------------------
602e4da38afSmrg# Generate a child script FILE with all initialization necessary to
603e4da38afSmrg# reuse the environment learned by the parent script, and make the
604e4da38afSmrg# file executable.  If COMMENT is supplied, it is inserted after the
605e4da38afSmrg# '#!' sequence but before initialization text begins.  After this
606e4da38afSmrg# macro, additional text can be appended to FILE to form the body of
607e4da38afSmrg# the child script.  The macro ends with non-zero status if the
608e4da38afSmrg# file could not be fully written (such as if the disk is full).
609e4da38afSmrgm4_ifdef([AS_INIT_GENERATED],
610e4da38afSmrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
611e4da38afSmrg[m4_defun([_LT_GENERATED_FILE_INIT],
612e4da38afSmrg[m4_require([AS_PREPARE])]dnl
613e4da38afSmrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
614e4da38afSmrg[lt_write_fail=0
615e4da38afSmrgcat >$1 <<_ASEOF || lt_write_fail=1
616e4da38afSmrg#! $SHELL
617e4da38afSmrg# Generated by $as_me.
618e4da38afSmrg$2
619e4da38afSmrgSHELL=\${CONFIG_SHELL-$SHELL}
620e4da38afSmrgexport SHELL
621e4da38afSmrg_ASEOF
622e4da38afSmrgcat >>$1 <<\_ASEOF || lt_write_fail=1
623e4da38afSmrgAS_SHELL_SANITIZE
624e4da38afSmrg_AS_PREPARE
625e4da38afSmrgexec AS_MESSAGE_FD>&1
626e4da38afSmrg_ASEOF
627e4da38afSmrgtest 0 = "$lt_write_fail" && chmod +x $1[]dnl
628e4da38afSmrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
629659607e0Smrg
630e4da38afSmrg# LT_OUTPUT
631e4da38afSmrg# ---------
632e4da38afSmrg# This macro allows early generation of the libtool script (before
633e4da38afSmrg# AC_OUTPUT is called), incase it is used in configure for compilation
634e4da38afSmrg# tests.
635e4da38afSmrgAC_DEFUN([LT_OUTPUT],
636e4da38afSmrg[: ${CONFIG_LT=./config.lt}
637e4da38afSmrgAC_MSG_NOTICE([creating $CONFIG_LT])
638e4da38afSmrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
639e4da38afSmrg[# Run this file to recreate a libtool stub with the current configuration.])
640659607e0Smrg
641e4da38afSmrgcat >>"$CONFIG_LT" <<\_LTEOF
642e4da38afSmrglt_cl_silent=false
643e4da38afSmrgexec AS_MESSAGE_LOG_FD>>config.log
644e4da38afSmrg{
645e4da38afSmrg  echo
646e4da38afSmrg  AS_BOX([Running $as_me.])
647e4da38afSmrg} >&AS_MESSAGE_LOG_FD
648a73597f9Smrg
649e4da38afSmrglt_cl_help="\
650e4da38afSmrg'$as_me' creates a local libtool stub from the current configuration,
651e4da38afSmrgfor use in further configure time tests before the real libtool is
652e4da38afSmrggenerated.
653a73597f9Smrg
654e4da38afSmrgUsage: $[0] [[OPTIONS]]
655a73597f9Smrg
656e4da38afSmrg  -h, --help      print this help, then exit
657e4da38afSmrg  -V, --version   print version number, then exit
658e4da38afSmrg  -q, --quiet     do not print progress messages
659e4da38afSmrg  -d, --debug     don't remove temporary files
6606aab59a7Smrg
661e4da38afSmrgReport bugs to <bug-libtool@gnu.org>."
662659607e0Smrg
663e4da38afSmrglt_cl_version="\
664e4da38afSmrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
665e4da38afSmrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
666e4da38afSmrgconfigured by $[0], generated by m4_PACKAGE_STRING.
667659607e0Smrg
668e4da38afSmrgCopyright (C) 2011 Free Software Foundation, Inc.
669e4da38afSmrgThis config.lt script is free software; the Free Software Foundation
670e4da38afSmrggives unlimited permision to copy, distribute and modify it."
671659607e0Smrg
672e4da38afSmrgwhile test 0 != $[#]
673e4da38afSmrgdo
674e4da38afSmrg  case $[1] in
675e4da38afSmrg    --version | --v* | -V )
676e4da38afSmrg      echo "$lt_cl_version"; exit 0 ;;
677e4da38afSmrg    --help | --h* | -h )
678e4da38afSmrg      echo "$lt_cl_help"; exit 0 ;;
679e4da38afSmrg    --debug | --d* | -d )
680e4da38afSmrg      debug=: ;;
681e4da38afSmrg    --quiet | --q* | --silent | --s* | -q )
682e4da38afSmrg      lt_cl_silent=: ;;
683659607e0Smrg
684e4da38afSmrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
685e4da38afSmrgTry '$[0] --help' for more information.]) ;;
686659607e0Smrg
687e4da38afSmrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
688e4da38afSmrgTry '$[0] --help' for more information.]) ;;
689e4da38afSmrg  esac
690e4da38afSmrg  shift
691e4da38afSmrgdone
692659607e0Smrg
693e4da38afSmrgif $lt_cl_silent; then
694e4da38afSmrg  exec AS_MESSAGE_FD>/dev/null
695e4da38afSmrgfi
696e4da38afSmrg_LTEOF
6976aab59a7Smrg
698e4da38afSmrgcat >>"$CONFIG_LT" <<_LTEOF
699e4da38afSmrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
700e4da38afSmrg_LTEOF
701fc27e79cSmrg
702e4da38afSmrgcat >>"$CONFIG_LT" <<\_LTEOF
703e4da38afSmrgAC_MSG_NOTICE([creating $ofile])
704e4da38afSmrg_LT_OUTPUT_LIBTOOL_COMMANDS
705e4da38afSmrgAS_EXIT(0)
706e4da38afSmrg_LTEOF
707e4da38afSmrgchmod +x "$CONFIG_LT"
708659607e0Smrg
709e4da38afSmrg# configure is writing to config.log, but config.lt does its own redirection,
710e4da38afSmrg# appending to config.log, which fails on DOS, as config.log is still kept
711e4da38afSmrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
712e4da38afSmrg# config.log, so it can be properly (re)opened and appended to by config.lt.
713e4da38afSmrglt_cl_success=:
714e4da38afSmrgtest yes = "$silent" &&
715e4da38afSmrg  lt_config_lt_args="$lt_config_lt_args --quiet"
716e4da38afSmrgexec AS_MESSAGE_LOG_FD>/dev/null
717e4da38afSmrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
718e4da38afSmrgexec AS_MESSAGE_LOG_FD>>config.log
719e4da38afSmrg$lt_cl_success || AS_EXIT(1)
720e4da38afSmrg])# LT_OUTPUT
721659607e0Smrg
722659607e0Smrg
723e4da38afSmrg# _LT_CONFIG(TAG)
724e4da38afSmrg# ---------------
725e4da38afSmrg# If TAG is the built-in tag, create an initial libtool script with a
726e4da38afSmrg# default configuration from the untagged config vars.  Otherwise add code
727e4da38afSmrg# to config.status for appending the configuration named by TAG from the
728e4da38afSmrg# matching tagged config vars.
729e4da38afSmrgm4_defun([_LT_CONFIG],
730e4da38afSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
731e4da38afSmrg_LT_CONFIG_SAVE_COMMANDS([
732e4da38afSmrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
733e4da38afSmrg  m4_if(_LT_TAG, [C], [
734e4da38afSmrg    # See if we are running on zsh, and set the options that allow our
735e4da38afSmrg    # commands through without removal of \ escapes.
736e4da38afSmrg    if test -n "${ZSH_VERSION+set}"; then
737e4da38afSmrg      setopt NO_GLOB_SUBST
738e4da38afSmrg    fi
739659607e0Smrg
740e4da38afSmrg    cfgfile=${ofile}T
741e4da38afSmrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
742e4da38afSmrg    $RM "$cfgfile"
743659607e0Smrg
744e4da38afSmrg    cat <<_LT_EOF >> "$cfgfile"
745e4da38afSmrg#! $SHELL
746e4da38afSmrg# Generated automatically by $as_me ($PACKAGE) $VERSION
747e4da38afSmrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
748e4da38afSmrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
749b73be646Smrg
750e4da38afSmrg# Provide generalized library-building support services.
751e4da38afSmrg# Written by Gordon Matzigkeit, 1996
752659607e0Smrg
753e4da38afSmrg_LT_COPYING
754e4da38afSmrg_LT_LIBTOOL_TAGS
755659607e0Smrg
756e4da38afSmrg# Configured defaults for sys_lib_dlsearch_path munging.
757e4da38afSmrg: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
758b73be646Smrg
759e4da38afSmrg# ### BEGIN LIBTOOL CONFIG
760e4da38afSmrg_LT_LIBTOOL_CONFIG_VARS
761e4da38afSmrg_LT_LIBTOOL_TAG_VARS
762e4da38afSmrg# ### END LIBTOOL CONFIG
763bd3a1963Smrg
764e4da38afSmrg_LT_EOF
765bd3a1963Smrg
766e4da38afSmrg    cat <<'_LT_EOF' >> "$cfgfile"
767bd3a1963Smrg
768e4da38afSmrg# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
769bd3a1963Smrg
770e4da38afSmrg_LT_PREPARE_MUNGE_PATH_LIST
771e4da38afSmrg_LT_PREPARE_CC_BASENAME
772bd3a1963Smrg
773e4da38afSmrg# ### END FUNCTIONS SHARED WITH CONFIGURE
774bd3a1963Smrg
775e4da38afSmrg_LT_EOF
776a73597f9Smrg
777e4da38afSmrg  case $host_os in
778e4da38afSmrg  aix3*)
779e4da38afSmrg    cat <<\_LT_EOF >> "$cfgfile"
780e4da38afSmrg# AIX sometimes has problems with the GCC collect2 program.  For some
781e4da38afSmrg# reason, if we set the COLLECT_NAMES environment variable, the problems
782e4da38afSmrg# vanish in a puff of smoke.
783e4da38afSmrgif test set != "${COLLECT_NAMES+set}"; then
784e4da38afSmrg  COLLECT_NAMES=
785e4da38afSmrg  export COLLECT_NAMES
786e4da38afSmrgfi
787e4da38afSmrg_LT_EOF
788e4da38afSmrg    ;;
789e4da38afSmrg  esac
790b73be646Smrg
791e4da38afSmrg  _LT_PROG_LTMAIN
792659607e0Smrg
793e4da38afSmrg  # We use sed instead of cat because bash on DJGPP gets confused if
794e4da38afSmrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
795e4da38afSmrg  # text mode, it properly converts lines to CR/LF.  This bash problem
796e4da38afSmrg  # is reportedly fixed, but why not run on old versions too?
797e4da38afSmrg  sed '$q' "$ltmain" >> "$cfgfile" \
798e4da38afSmrg     || (rm -f "$cfgfile"; exit 1)
799b73be646Smrg
800e4da38afSmrg   mv -f "$cfgfile" "$ofile" ||
801e4da38afSmrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
802e4da38afSmrg  chmod +x "$ofile"
803e4da38afSmrg],
804e4da38afSmrg[cat <<_LT_EOF >> "$ofile"
805b73be646Smrg
806e4da38afSmrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
807e4da38afSmrgdnl in a comment (ie after a #).
808e4da38afSmrg# ### BEGIN LIBTOOL TAG CONFIG: $1
809e4da38afSmrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
810e4da38afSmrg# ### END LIBTOOL TAG CONFIG: $1
811e4da38afSmrg_LT_EOF
812e4da38afSmrg])dnl /m4_if
813e4da38afSmrg],
814e4da38afSmrg[m4_if([$1], [], [
815e4da38afSmrg    PACKAGE='$PACKAGE'
816e4da38afSmrg    VERSION='$VERSION'
817e4da38afSmrg    RM='$RM'
818e4da38afSmrg    ofile='$ofile'], [])
819e4da38afSmrg])dnl /_LT_CONFIG_SAVE_COMMANDS
820e4da38afSmrg])# _LT_CONFIG
821b73be646Smrg
822b73be646Smrg
823e4da38afSmrg# LT_SUPPORTED_TAG(TAG)
824e4da38afSmrg# ---------------------
825e4da38afSmrg# Trace this macro to discover what tags are supported by the libtool
826e4da38afSmrg# --tag option, using:
827e4da38afSmrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
828e4da38afSmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
829659607e0Smrg
830659607e0Smrg
831e4da38afSmrg# C support is built-in for now
832e4da38afSmrgm4_define([_LT_LANG_C_enabled], [])
833e4da38afSmrgm4_define([_LT_TAGS], [])
834659607e0Smrg
835b73be646Smrg
836e4da38afSmrg# LT_LANG(LANG)
837e4da38afSmrg# -------------
838e4da38afSmrg# Enable libtool support for the given language if not already enabled.
839e4da38afSmrgAC_DEFUN([LT_LANG],
840e4da38afSmrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
841e4da38afSmrgm4_case([$1],
842e4da38afSmrg  [C],			[_LT_LANG(C)],
843e4da38afSmrg  [C++],		[_LT_LANG(CXX)],
844e4da38afSmrg  [Go],			[_LT_LANG(GO)],
845e4da38afSmrg  [Java],		[_LT_LANG(GCJ)],
846e4da38afSmrg  [Fortran 77],		[_LT_LANG(F77)],
847e4da38afSmrg  [Fortran],		[_LT_LANG(FC)],
848e4da38afSmrg  [Windows Resource],	[_LT_LANG(RC)],
849e4da38afSmrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
850e4da38afSmrg    [_LT_LANG($1)],
851e4da38afSmrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
852e4da38afSmrg])# LT_LANG
853659607e0Smrg
854659607e0Smrg
855e4da38afSmrg# _LT_LANG(LANGNAME)
856e4da38afSmrg# ------------------
857e4da38afSmrgm4_defun([_LT_LANG],
858e4da38afSmrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
859e4da38afSmrg  [LT_SUPPORTED_TAG([$1])dnl
860e4da38afSmrg  m4_append([_LT_TAGS], [$1 ])dnl
861e4da38afSmrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
862e4da38afSmrg  _LT_LANG_$1_CONFIG($1)])dnl
863e4da38afSmrg])# _LT_LANG
86484bf8334Smrg
865659607e0Smrg
866e4da38afSmrgm4_ifndef([AC_PROG_GO], [
867e4da38afSmrg# NOTE: This macro has been submitted for inclusion into   #
868e4da38afSmrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
869e4da38afSmrg#  a released version of Autoconf we should remove this    #
870e4da38afSmrg#  macro and use it instead.                               #
871e4da38afSmrgm4_defun([AC_PROG_GO],
872e4da38afSmrg[AC_LANG_PUSH(Go)dnl
873e4da38afSmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
874e4da38afSmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
875e4da38afSmrg_AC_ARG_VAR_LDFLAGS()dnl
876e4da38afSmrgAC_CHECK_TOOL(GOC, gccgo)
877e4da38afSmrgif test -z "$GOC"; then
878e4da38afSmrg  if test -n "$ac_tool_prefix"; then
879e4da38afSmrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
880e4da38afSmrg  fi
881e4da38afSmrgfi
882e4da38afSmrgif test -z "$GOC"; then
883e4da38afSmrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
884e4da38afSmrgfi
885e4da38afSmrg])#m4_defun
886e4da38afSmrg])#m4_ifndef
887659607e0Smrg
888659607e0Smrg
889e4da38afSmrg# _LT_LANG_DEFAULT_CONFIG
890e4da38afSmrg# -----------------------
891e4da38afSmrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
892e4da38afSmrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
893e4da38afSmrg  [LT_LANG(CXX)],
894e4da38afSmrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
895659607e0Smrg
896e4da38afSmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
897e4da38afSmrg  [LT_LANG(F77)],
898e4da38afSmrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
899fc27e79cSmrg
900e4da38afSmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
901e4da38afSmrg  [LT_LANG(FC)],
902e4da38afSmrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
903bd3a1963Smrg
904e4da38afSmrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
905e4da38afSmrgdnl pulling things in needlessly.
906e4da38afSmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
907e4da38afSmrg  [LT_LANG(GCJ)],
908e4da38afSmrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
909e4da38afSmrg    [LT_LANG(GCJ)],
910e4da38afSmrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
911e4da38afSmrg      [LT_LANG(GCJ)],
912e4da38afSmrg      [m4_ifdef([AC_PROG_GCJ],
913e4da38afSmrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
914e4da38afSmrg       m4_ifdef([A][M_PROG_GCJ],
915e4da38afSmrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
916e4da38afSmrg       m4_ifdef([LT_PROG_GCJ],
917e4da38afSmrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
918bd3a1963Smrg
919e4da38afSmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
920e4da38afSmrg  [LT_LANG(GO)],
921e4da38afSmrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
922bd3a1963Smrg
923e4da38afSmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
924e4da38afSmrg  [LT_LANG(RC)],
925e4da38afSmrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
926e4da38afSmrg])# _LT_LANG_DEFAULT_CONFIG
927bd3a1963Smrg
928e4da38afSmrg# Obsolete macros:
929e4da38afSmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
930e4da38afSmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
931e4da38afSmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
932e4da38afSmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
933e4da38afSmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
934e4da38afSmrgdnl aclocal-1.4 backwards compatibility:
935e4da38afSmrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
936e4da38afSmrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
937e4da38afSmrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
938e4da38afSmrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
939e4da38afSmrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
940bd3a1963Smrg
941659607e0Smrg
942e4da38afSmrg# _LT_TAG_COMPILER
943e4da38afSmrg# ----------------
944e4da38afSmrgm4_defun([_LT_TAG_COMPILER],
945e4da38afSmrg[AC_REQUIRE([AC_PROG_CC])dnl
946fc27e79cSmrg
947e4da38afSmrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
948e4da38afSmrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
949e4da38afSmrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
950e4da38afSmrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
951fc27e79cSmrg
952e4da38afSmrg# If no C compiler was specified, use CC.
953e4da38afSmrgLTCC=${LTCC-"$CC"}
954fc27e79cSmrg
955e4da38afSmrg# If no C compiler flags were specified, use CFLAGS.
956e4da38afSmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
957659607e0Smrg
958e4da38afSmrg# Allow CC to be a program name with arguments.
959e4da38afSmrgcompiler=$CC
960e4da38afSmrg])# _LT_TAG_COMPILER
961fc27e79cSmrg
962fc27e79cSmrg
963e4da38afSmrg# _LT_COMPILER_BOILERPLATE
964e4da38afSmrg# ------------------------
965e4da38afSmrg# Check for compiler boilerplate output or warnings with
966e4da38afSmrg# the simple compiler test code.
967e4da38afSmrgm4_defun([_LT_COMPILER_BOILERPLATE],
968e4da38afSmrg[m4_require([_LT_DECL_SED])dnl
969e4da38afSmrgac_outfile=conftest.$ac_objext
970e4da38afSmrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
971e4da38afSmrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
972e4da38afSmrg_lt_compiler_boilerplate=`cat conftest.err`
973e4da38afSmrg$RM conftest*
974e4da38afSmrg])# _LT_COMPILER_BOILERPLATE
975fc27e79cSmrg
976659607e0Smrg
977e4da38afSmrg# _LT_LINKER_BOILERPLATE
978e4da38afSmrg# ----------------------
979e4da38afSmrg# Check for linker boilerplate output or warnings with
980e4da38afSmrg# the simple link test code.
981e4da38afSmrgm4_defun([_LT_LINKER_BOILERPLATE],
982e4da38afSmrg[m4_require([_LT_DECL_SED])dnl
983e4da38afSmrgac_outfile=conftest.$ac_objext
984e4da38afSmrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
985e4da38afSmrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
986e4da38afSmrg_lt_linker_boilerplate=`cat conftest.err`
987e4da38afSmrg$RM -r conftest*
988e4da38afSmrg])# _LT_LINKER_BOILERPLATE
989659607e0Smrg
990e4da38afSmrg# _LT_REQUIRED_DARWIN_CHECKS
991e4da38afSmrg# -------------------------
992e4da38afSmrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
993e4da38afSmrg  case $host_os in
994e4da38afSmrg    rhapsody* | darwin*)
995e4da38afSmrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
996e4da38afSmrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
997e4da38afSmrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
998e4da38afSmrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
999e4da38afSmrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
1000e4da38afSmrg    _LT_DECL([], [DSYMUTIL], [1],
1001e4da38afSmrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
1002e4da38afSmrg    _LT_DECL([], [NMEDIT], [1],
1003e4da38afSmrg      [Tool to change global to local symbols on Mac OS X])
1004e4da38afSmrg    _LT_DECL([], [LIPO], [1],
1005e4da38afSmrg      [Tool to manipulate fat objects and archives on Mac OS X])
1006e4da38afSmrg    _LT_DECL([], [OTOOL], [1],
1007e4da38afSmrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
1008e4da38afSmrg    _LT_DECL([], [OTOOL64], [1],
1009e4da38afSmrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
1010659607e0Smrg
1011e4da38afSmrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
1012e4da38afSmrg      [lt_cv_apple_cc_single_mod=no
1013e4da38afSmrg      if test -z "$LT_MULTI_MODULE"; then
1014e4da38afSmrg	# By default we will add the -single_module flag. You can override
1015e4da38afSmrg	# by either setting the environment variable LT_MULTI_MODULE
1016e4da38afSmrg	# non-empty at configure time, or by adding -multi_module to the
1017e4da38afSmrg	# link flags.
1018e4da38afSmrg	rm -rf libconftest.dylib*
1019e4da38afSmrg	echo "int foo(void){return 1;}" > conftest.c
1020e4da38afSmrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1021e4da38afSmrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
1022e4da38afSmrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1023e4da38afSmrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
1024e4da38afSmrg        _lt_result=$?
1025e4da38afSmrg	# If there is a non-empty error log, and "single_module"
1026e4da38afSmrg	# appears in it, assume the flag caused a linker warning
1027e4da38afSmrg        if test -s conftest.err && $GREP single_module conftest.err; then
1028e4da38afSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
1029e4da38afSmrg	# Otherwise, if the output was created with a 0 exit code from
1030e4da38afSmrg	# the compiler, it worked.
1031e4da38afSmrg	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
1032e4da38afSmrg	  lt_cv_apple_cc_single_mod=yes
1033e4da38afSmrg	else
1034e4da38afSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
1035e4da38afSmrg	fi
1036e4da38afSmrg	rm -rf libconftest.dylib*
1037e4da38afSmrg	rm -f conftest.*
1038e4da38afSmrg      fi])
10396aab59a7Smrg
1040e4da38afSmrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
1041e4da38afSmrg      [lt_cv_ld_exported_symbols_list],
1042e4da38afSmrg      [lt_cv_ld_exported_symbols_list=no
1043e4da38afSmrg      save_LDFLAGS=$LDFLAGS
1044e4da38afSmrg      echo "_main" > conftest.sym
1045e4da38afSmrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
1046e4da38afSmrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
1047e4da38afSmrg	[lt_cv_ld_exported_symbols_list=yes],
1048e4da38afSmrg	[lt_cv_ld_exported_symbols_list=no])
1049e4da38afSmrg	LDFLAGS=$save_LDFLAGS
1050e4da38afSmrg    ])
10516aab59a7Smrg
1052e4da38afSmrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
1053e4da38afSmrg      [lt_cv_ld_force_load=no
1054e4da38afSmrg      cat > conftest.c << _LT_EOF
1055e4da38afSmrgint forced_loaded() { return 2;}
1056e4da38afSmrg_LT_EOF
1057e4da38afSmrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
1058e4da38afSmrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
1059e4da38afSmrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
1060e4da38afSmrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
1061e4da38afSmrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
1062e4da38afSmrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
1063e4da38afSmrg      cat > conftest.c << _LT_EOF
1064e4da38afSmrgint main() { return 0;}
1065e4da38afSmrg_LT_EOF
1066e4da38afSmrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
1067e4da38afSmrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
1068e4da38afSmrg      _lt_result=$?
1069e4da38afSmrg      if test -s conftest.err && $GREP force_load conftest.err; then
1070e4da38afSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
1071e4da38afSmrg      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
1072e4da38afSmrg	lt_cv_ld_force_load=yes
1073e4da38afSmrg      else
1074e4da38afSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
1075e4da38afSmrg      fi
1076e4da38afSmrg        rm -f conftest.err libconftest.a conftest conftest.c
1077e4da38afSmrg        rm -rf conftest.dSYM
1078e4da38afSmrg    ])
1079e4da38afSmrg    case $host_os in
1080e4da38afSmrg    rhapsody* | darwin1.[[012]])
1081e4da38afSmrg      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
1082e4da38afSmrg    darwin1.*)
1083e4da38afSmrg      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1084e4da38afSmrg    darwin*) # darwin 5.x on
1085e4da38afSmrg      # if running on 10.5 or later, the deployment target defaults
1086e4da38afSmrg      # to the OS version, if on x86, and 10.4, the deployment
1087e4da38afSmrg      # target defaults to 10.4. Don't you love it?
1088e4da38afSmrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
1089e4da38afSmrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
1090e4da38afSmrg	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1091e4da38afSmrg	10.[[012]][[,.]]*)
1092e4da38afSmrg	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1093e4da38afSmrg	10.*)
1094e4da38afSmrg	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1095e4da38afSmrg      esac
1096e4da38afSmrg    ;;
1097e4da38afSmrg  esac
1098e4da38afSmrg    if test yes = "$lt_cv_apple_cc_single_mod"; then
1099e4da38afSmrg      _lt_dar_single_mod='$single_module'
1100e4da38afSmrg    fi
1101e4da38afSmrg    if test yes = "$lt_cv_ld_exported_symbols_list"; then
1102e4da38afSmrg      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
1103e4da38afSmrg    else
1104e4da38afSmrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
1105e4da38afSmrg    fi
1106e4da38afSmrg    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
1107e4da38afSmrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
1108e4da38afSmrg    else
1109e4da38afSmrg      _lt_dsymutil=
1110e4da38afSmrg    fi
1111e4da38afSmrg    ;;
1112e4da38afSmrg  esac
111384bf8334Smrg])
1114659607e0Smrg
1115659607e0Smrg
1116e4da38afSmrg# _LT_DARWIN_LINKER_FEATURES([TAG])
1117e4da38afSmrg# ---------------------------------
1118e4da38afSmrg# Checks for linker and compiler features on darwin
1119e4da38afSmrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
1120e4da38afSmrg[
1121e4da38afSmrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1122e4da38afSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1123e4da38afSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
1124e4da38afSmrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
1125e4da38afSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1126e4da38afSmrg  if test yes = "$lt_cv_ld_force_load"; then
1127e4da38afSmrg    _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\"`'
1128e4da38afSmrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
1129e4da38afSmrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
1130e4da38afSmrg  else
1131e4da38afSmrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1132e4da38afSmrg  fi
1133e4da38afSmrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
1134e4da38afSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
1135e4da38afSmrg  case $cc_basename in
1136e4da38afSmrg     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
1137e4da38afSmrg     *) _lt_dar_can_shared=$GCC ;;
1138e4da38afSmrg  esac
1139e4da38afSmrg  if test yes = "$_lt_dar_can_shared"; then
1140e4da38afSmrg    output_verbose_link_cmd=func_echo_all
1141e4da38afSmrg    _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"
1142e4da38afSmrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
1143e4da38afSmrg    _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"
1144e4da38afSmrg    _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"
1145e4da38afSmrg    m4_if([$1], [CXX],
1146e4da38afSmrg[   if test yes != "$lt_cv_apple_cc_single_mod"; then
1147e4da38afSmrg      _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"
1148e4da38afSmrg      _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"
1149e4da38afSmrg    fi
1150e4da38afSmrg],[])
1151e4da38afSmrg  else
1152e4da38afSmrg  _LT_TAGVAR(ld_shlibs, $1)=no
1153e4da38afSmrg  fi
1154e4da38afSmrg])
1155659607e0Smrg
1156e4da38afSmrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
1157e4da38afSmrg# ----------------------------------
1158e4da38afSmrg# Links a minimal program and checks the executable
1159e4da38afSmrg# for the system default hardcoded library path. In most cases,
1160e4da38afSmrg# this is /usr/lib:/lib, but when the MPI compilers are used
1161e4da38afSmrg# the location of the communication and MPI libs are included too.
1162e4da38afSmrg# If we don't find anything, use the default library path according
1163e4da38afSmrg# to the aix ld manual.
1164e4da38afSmrg# Store the results from the different compilers for each TAGNAME.
1165e4da38afSmrg# Allow to override them for all tags through lt_cv_aix_libpath.
1166e4da38afSmrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
1167e4da38afSmrg[m4_require([_LT_DECL_SED])dnl
1168e4da38afSmrgif test set = "${lt_cv_aix_libpath+set}"; then
1169e4da38afSmrg  aix_libpath=$lt_cv_aix_libpath
1170e4da38afSmrgelse
1171e4da38afSmrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
1172e4da38afSmrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
1173e4da38afSmrg  lt_aix_libpath_sed='[
1174e4da38afSmrg      /Import File Strings/,/^$/ {
1175e4da38afSmrg	  /^0/ {
1176e4da38afSmrg	      s/^0  *\([^ ]*\) *$/\1/
1177e4da38afSmrg	      p
1178e4da38afSmrg	  }
1179e4da38afSmrg      }]'
1180e4da38afSmrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1181e4da38afSmrg  # Check for a 64-bit object if we didn't find anything.
1182e4da38afSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1183e4da38afSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1184e4da38afSmrg  fi],[])
1185e4da38afSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1186e4da38afSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
1187e4da38afSmrg  fi
1188e4da38afSmrg  ])
1189e4da38afSmrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
1190e4da38afSmrgfi
1191e4da38afSmrg])# _LT_SYS_MODULE_PATH_AIX
1192659607e0Smrg
1193659607e0Smrg
1194e4da38afSmrg# _LT_SHELL_INIT(ARG)
1195e4da38afSmrg# -------------------
1196e4da38afSmrgm4_define([_LT_SHELL_INIT],
1197e4da38afSmrg[m4_divert_text([M4SH-INIT], [$1
1198e4da38afSmrg])])# _LT_SHELL_INIT
1199659607e0Smrg
1200659607e0Smrg
1201659607e0Smrg
1202e4da38afSmrg# _LT_PROG_ECHO_BACKSLASH
1203e4da38afSmrg# -----------------------
1204e4da38afSmrg# Find how we can fake an echo command that does not interpret backslash.
1205e4da38afSmrg# In particular, with Autoconf 2.60 or later we add some code to the start
1206e4da38afSmrg# of the generated configure script that will find a shell with a builtin
1207e4da38afSmrg# printf (that we can use as an echo command).
1208e4da38afSmrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
1209e4da38afSmrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1210e4da38afSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1211e4da38afSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1212659607e0Smrg
1213e4da38afSmrgAC_MSG_CHECKING([how to print strings])
1214e4da38afSmrg# Test print first, because it will be a builtin if present.
1215e4da38afSmrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
1216e4da38afSmrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
1217e4da38afSmrg  ECHO='print -r --'
1218e4da38afSmrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
1219e4da38afSmrg  ECHO='printf %s\n'
1220e4da38afSmrgelse
1221e4da38afSmrg  # Use this function as a fallback that always works.
1222e4da38afSmrg  func_fallback_echo ()
1223e4da38afSmrg  {
1224e4da38afSmrg    eval 'cat <<_LTECHO_EOF
1225e4da38afSmrg$[]1
1226e4da38afSmrg_LTECHO_EOF'
1227e4da38afSmrg  }
1228e4da38afSmrg  ECHO='func_fallback_echo'
1229e4da38afSmrgfi
1230659607e0Smrg
1231e4da38afSmrg# func_echo_all arg...
1232e4da38afSmrg# Invoke $ECHO with all args, space-separated.
1233e4da38afSmrgfunc_echo_all ()
1234e4da38afSmrg{
1235e4da38afSmrg    $ECHO "$*"
1236e4da38afSmrg}
1237659607e0Smrg
1238e4da38afSmrgcase $ECHO in
1239e4da38afSmrg  printf*) AC_MSG_RESULT([printf]) ;;
1240e4da38afSmrg  print*) AC_MSG_RESULT([print -r]) ;;
1241e4da38afSmrg  *) AC_MSG_RESULT([cat]) ;;
1242e4da38afSmrgesac
1243fc27e79cSmrg
1244e4da38afSmrgm4_ifdef([_AS_DETECT_SUGGESTED],
1245e4da38afSmrg[_AS_DETECT_SUGGESTED([
1246e4da38afSmrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
1247e4da38afSmrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1248e4da38afSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1249e4da38afSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1250e4da38afSmrg    PATH=/empty FPATH=/empty; export PATH FPATH
1251e4da38afSmrg    test "X`printf %s $ECHO`" = "X$ECHO" \
1252e4da38afSmrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
1253fc27e79cSmrg
1254e4da38afSmrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1255e4da38afSmrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
1256e4da38afSmrg])# _LT_PROG_ECHO_BACKSLASH
1257659607e0Smrg
1258659607e0Smrg
1259e4da38afSmrg# _LT_WITH_SYSROOT
1260e4da38afSmrg# ----------------
1261e4da38afSmrgAC_DEFUN([_LT_WITH_SYSROOT],
1262e4da38afSmrg[AC_MSG_CHECKING([for sysroot])
1263e4da38afSmrgAC_ARG_WITH([sysroot],
1264e4da38afSmrg[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
1265e4da38afSmrg  [Search for dependent libraries within DIR (or the compiler's sysroot
1266e4da38afSmrg   if not specified).])],
1267e4da38afSmrg[], [with_sysroot=no])
1268a73597f9Smrg
126984bf8334Smrgdnl lt_sysroot will always be passed unquoted.  We quote it here
127084bf8334Smrgdnl in case the user passed a directory name.
127184bf8334Smrglt_sysroot=
1272e4da38afSmrgcase $with_sysroot in #(
127384bf8334Smrg yes)
1274e4da38afSmrg   if test yes = "$GCC"; then
127584bf8334Smrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
127684bf8334Smrg   fi
127784bf8334Smrg   ;; #(
127884bf8334Smrg /*)
127984bf8334Smrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
128084bf8334Smrg   ;; #(
128184bf8334Smrg no|'')
128284bf8334Smrg   ;; #(
128384bf8334Smrg *)
1284e4da38afSmrg   AC_MSG_RESULT([$with_sysroot])
128584bf8334Smrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
128684bf8334Smrg   ;;
128784bf8334Smrgesac
1288a73597f9Smrg
128984bf8334Smrg AC_MSG_RESULT([${lt_sysroot:-no}])
129084bf8334Smrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
1291e4da38afSmrg[dependent libraries, and where our libraries should be installed.])])
1292a73597f9Smrg
129384bf8334Smrg# _LT_ENABLE_LOCK
129484bf8334Smrg# ---------------
129584bf8334Smrgm4_defun([_LT_ENABLE_LOCK],
129684bf8334Smrg[AC_ARG_ENABLE([libtool-lock],
129784bf8334Smrg  [AS_HELP_STRING([--disable-libtool-lock],
129884bf8334Smrg    [avoid locking (might break parallel builds)])])
1299e4da38afSmrgtest no = "$enable_libtool_lock" || enable_libtool_lock=yes
1300a73597f9Smrg
130184bf8334Smrg# Some flags need to be propagated to the compiler or linker for good
130284bf8334Smrg# libtool support.
130384bf8334Smrgcase $host in
130484bf8334Smrgia64-*-hpux*)
1305e4da38afSmrg  # Find out what ABI is being produced by ac_compile, and set mode
1306e4da38afSmrg  # options accordingly.
130784bf8334Smrg  echo 'int i;' > conftest.$ac_ext
130884bf8334Smrg  if AC_TRY_EVAL(ac_compile); then
130984bf8334Smrg    case `/usr/bin/file conftest.$ac_objext` in
131084bf8334Smrg      *ELF-32*)
1311e4da38afSmrg	HPUX_IA64_MODE=32
131284bf8334Smrg	;;
131384bf8334Smrg      *ELF-64*)
1314e4da38afSmrg	HPUX_IA64_MODE=64
131584bf8334Smrg	;;
131684bf8334Smrg    esac
1317a73597f9Smrg  fi
131884bf8334Smrg  rm -rf conftest*
1319a73597f9Smrg  ;;
132084bf8334Smrg*-*-irix6*)
1321e4da38afSmrg  # Find out what ABI is being produced by ac_compile, and set linker
1322e4da38afSmrg  # options accordingly.
132384bf8334Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
132484bf8334Smrg  if AC_TRY_EVAL(ac_compile); then
1325e4da38afSmrg    if test yes = "$lt_cv_prog_gnu_ld"; then
132684bf8334Smrg      case `/usr/bin/file conftest.$ac_objext` in
132784bf8334Smrg	*32-bit*)
132884bf8334Smrg	  LD="${LD-ld} -melf32bsmip"
132984bf8334Smrg	  ;;
133084bf8334Smrg	*N32*)
133184bf8334Smrg	  LD="${LD-ld} -melf32bmipn32"
133284bf8334Smrg	  ;;
133384bf8334Smrg	*64-bit*)
133484bf8334Smrg	  LD="${LD-ld} -melf64bmip"
1335a73597f9Smrg	;;
133684bf8334Smrg      esac
133784bf8334Smrg    else
133884bf8334Smrg      case `/usr/bin/file conftest.$ac_objext` in
133984bf8334Smrg	*32-bit*)
134084bf8334Smrg	  LD="${LD-ld} -32"
134184bf8334Smrg	  ;;
134284bf8334Smrg	*N32*)
134384bf8334Smrg	  LD="${LD-ld} -n32"
134484bf8334Smrg	  ;;
134584bf8334Smrg	*64-bit*)
134684bf8334Smrg	  LD="${LD-ld} -64"
134784bf8334Smrg	  ;;
134884bf8334Smrg      esac
134984bf8334Smrg    fi
1350a73597f9Smrg  fi
135184bf8334Smrg  rm -rf conftest*
1352a73597f9Smrg  ;;
1353a73597f9Smrg
1354e4da38afSmrgmips64*-*linux*)
1355e4da38afSmrg  # Find out what ABI is being produced by ac_compile, and set linker
1356e4da38afSmrg  # options accordingly.
1357e4da38afSmrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1358e4da38afSmrg  if AC_TRY_EVAL(ac_compile); then
1359e4da38afSmrg    emul=elf
1360e4da38afSmrg    case `/usr/bin/file conftest.$ac_objext` in
1361e4da38afSmrg      *32-bit*)
1362e4da38afSmrg	emul="${emul}32"
1363e4da38afSmrg	;;
1364e4da38afSmrg      *64-bit*)
1365e4da38afSmrg	emul="${emul}64"
1366e4da38afSmrg	;;
1367e4da38afSmrg    esac
1368e4da38afSmrg    case `/usr/bin/file conftest.$ac_objext` in
1369e4da38afSmrg      *MSB*)
1370e4da38afSmrg	emul="${emul}btsmip"
1371e4da38afSmrg	;;
1372e4da38afSmrg      *LSB*)
1373e4da38afSmrg	emul="${emul}ltsmip"
1374e4da38afSmrg	;;
1375e4da38afSmrg    esac
1376e4da38afSmrg    case `/usr/bin/file conftest.$ac_objext` in
1377e4da38afSmrg      *N32*)
1378e4da38afSmrg	emul="${emul}n32"
1379e4da38afSmrg	;;
1380e4da38afSmrg    esac
1381e4da38afSmrg    LD="${LD-ld} -m $emul"
1382e4da38afSmrg  fi
1383e4da38afSmrg  rm -rf conftest*
1384e4da38afSmrg  ;;
1385e4da38afSmrg
1386e4da38afSmrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
138784bf8334Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1388e4da38afSmrg  # Find out what ABI is being produced by ac_compile, and set linker
1389e4da38afSmrg  # options accordingly.  Note that the listed cases only cover the
1390e4da38afSmrg  # situations where additional linker options are needed (such as when
1391e4da38afSmrg  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
1392e4da38afSmrg  # vice versa); the common cases where no linker options are needed do
1393e4da38afSmrg  # not appear in the list.
139484bf8334Smrg  echo 'int i;' > conftest.$ac_ext
139584bf8334Smrg  if AC_TRY_EVAL(ac_compile); then
139684bf8334Smrg    case `/usr/bin/file conftest.o` in
139784bf8334Smrg      *32-bit*)
139884bf8334Smrg	case $host in
139984bf8334Smrg	  x86_64-*kfreebsd*-gnu)
140084bf8334Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
140184bf8334Smrg	    ;;
140284bf8334Smrg	  x86_64-*linux*)
1403e4da38afSmrg	    case `/usr/bin/file conftest.o` in
1404e4da38afSmrg	      *x86-64*)
1405e4da38afSmrg		LD="${LD-ld} -m elf32_x86_64"
1406e4da38afSmrg		;;
1407e4da38afSmrg	      *)
1408e4da38afSmrg		LD="${LD-ld} -m elf_i386"
1409e4da38afSmrg		;;
1410e4da38afSmrg	    esac
1411e4da38afSmrg	    ;;
1412e4da38afSmrg	  powerpc64le-*linux*)
1413e4da38afSmrg	    LD="${LD-ld} -m elf32lppclinux"
141484bf8334Smrg	    ;;
1415e4da38afSmrg	  powerpc64-*linux*)
141684bf8334Smrg	    LD="${LD-ld} -m elf32ppclinux"
141784bf8334Smrg	    ;;
141884bf8334Smrg	  s390x-*linux*)
141984bf8334Smrg	    LD="${LD-ld} -m elf_s390"
142084bf8334Smrg	    ;;
142184bf8334Smrg	  sparc64-*linux*)
142284bf8334Smrg	    LD="${LD-ld} -m elf32_sparc"
142384bf8334Smrg	    ;;
142484bf8334Smrg	esac
142584bf8334Smrg	;;
142684bf8334Smrg      *64-bit*)
142784bf8334Smrg	case $host in
142884bf8334Smrg	  x86_64-*kfreebsd*-gnu)
142984bf8334Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
143084bf8334Smrg	    ;;
143184bf8334Smrg	  x86_64-*linux*)
143284bf8334Smrg	    LD="${LD-ld} -m elf_x86_64"
143384bf8334Smrg	    ;;
1434e4da38afSmrg	  powerpcle-*linux*)
1435e4da38afSmrg	    LD="${LD-ld} -m elf64lppc"
1436e4da38afSmrg	    ;;
1437e4da38afSmrg	  powerpc-*linux*)
143884bf8334Smrg	    LD="${LD-ld} -m elf64ppc"
143984bf8334Smrg	    ;;
144084bf8334Smrg	  s390*-*linux*|s390*-*tpf*)
144184bf8334Smrg	    LD="${LD-ld} -m elf64_s390"
144284bf8334Smrg	    ;;
144384bf8334Smrg	  sparc*-*linux*)
144484bf8334Smrg	    LD="${LD-ld} -m elf64_sparc"
144584bf8334Smrg	    ;;
144684bf8334Smrg	esac
144784bf8334Smrg	;;
144884bf8334Smrg    esac
144984bf8334Smrg  fi
145084bf8334Smrg  rm -rf conftest*
1451a73597f9Smrg  ;;
1452a73597f9Smrg
145384bf8334Smrg*-*-sco3.2v5*)
145484bf8334Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1455e4da38afSmrg  SAVE_CFLAGS=$CFLAGS
145684bf8334Smrg  CFLAGS="$CFLAGS -belf"
145784bf8334Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
145884bf8334Smrg    [AC_LANG_PUSH(C)
145984bf8334Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
146084bf8334Smrg     AC_LANG_POP])
1461e4da38afSmrg  if test yes != "$lt_cv_cc_needs_belf"; then
146284bf8334Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1463e4da38afSmrg    CFLAGS=$SAVE_CFLAGS
146484bf8334Smrg  fi
1465a73597f9Smrg  ;;
146684bf8334Smrg*-*solaris*)
1467e4da38afSmrg  # Find out what ABI is being produced by ac_compile, and set linker
1468e4da38afSmrg  # options accordingly.
146984bf8334Smrg  echo 'int i;' > conftest.$ac_ext
147084bf8334Smrg  if AC_TRY_EVAL(ac_compile); then
147184bf8334Smrg    case `/usr/bin/file conftest.o` in
147284bf8334Smrg    *64-bit*)
147384bf8334Smrg      case $lt_cv_prog_gnu_ld in
147484bf8334Smrg      yes*)
147584bf8334Smrg        case $host in
1476e4da38afSmrg        i?86-*-solaris*|x86_64-*-solaris*)
147784bf8334Smrg          LD="${LD-ld} -m elf_x86_64"
147884bf8334Smrg          ;;
147984bf8334Smrg        sparc*-*-solaris*)
148084bf8334Smrg          LD="${LD-ld} -m elf64_sparc"
148184bf8334Smrg          ;;
148284bf8334Smrg        esac
148384bf8334Smrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
148484bf8334Smrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
1485e4da38afSmrg          LD=${LD-ld}_sol2
148684bf8334Smrg        fi
148784bf8334Smrg        ;;
148884bf8334Smrg      *)
148984bf8334Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
149084bf8334Smrg	  LD="${LD-ld} -64"
149184bf8334Smrg	fi
149284bf8334Smrg	;;
149384bf8334Smrg      esac
149484bf8334Smrg      ;;
149584bf8334Smrg    esac
149684bf8334Smrg  fi
149784bf8334Smrg  rm -rf conftest*
1498a73597f9Smrg  ;;
1499a73597f9Smrgesac
1500a73597f9Smrg
1501e4da38afSmrgneed_locks=$enable_libtool_lock
150284bf8334Smrg])# _LT_ENABLE_LOCK
1503b73be646Smrg
1504b73be646Smrg
150584bf8334Smrg# _LT_PROG_AR
150684bf8334Smrg# -----------
150784bf8334Smrgm4_defun([_LT_PROG_AR],
150884bf8334Smrg[AC_CHECK_TOOLS(AR, [ar], false)
150984bf8334Smrg: ${AR=ar}
151084bf8334Smrg: ${AR_FLAGS=cru}
151184bf8334Smrg_LT_DECL([], [AR], [1], [The archiver])
151284bf8334Smrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
1513bd3a1963Smrg
151484bf8334SmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
151584bf8334Smrg  [lt_cv_ar_at_file=no
151684bf8334Smrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
151784bf8334Smrg     [echo conftest.$ac_objext > conftest.lst
151884bf8334Smrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
151984bf8334Smrg      AC_TRY_EVAL([lt_ar_try])
1520e4da38afSmrg      if test 0 -eq "$ac_status"; then
152184bf8334Smrg	# Ensure the archiver fails upon bogus file names.
152284bf8334Smrg	rm -f conftest.$ac_objext libconftest.a
152384bf8334Smrg	AC_TRY_EVAL([lt_ar_try])
1524e4da38afSmrg	if test 0 -ne "$ac_status"; then
152584bf8334Smrg          lt_cv_ar_at_file=@
152684bf8334Smrg        fi
1527a73597f9Smrg      fi
152884bf8334Smrg      rm -f conftest.* libconftest.a
152984bf8334Smrg     ])
153084bf8334Smrg  ])
153184bf8334Smrg
1532e4da38afSmrgif test no = "$lt_cv_ar_at_file"; then
153384bf8334Smrg  archiver_list_spec=
1534b73be646Smrgelse
153584bf8334Smrg  archiver_list_spec=$lt_cv_ar_at_file
1536b73be646Smrgfi
153784bf8334Smrg_LT_DECL([], [archiver_list_spec], [1],
153884bf8334Smrg  [How to feed a file listing to the archiver])
153984bf8334Smrg])# _LT_PROG_AR
1540b73be646Smrg
1541b73be646Smrg
154284bf8334Smrg# _LT_CMD_OLD_ARCHIVE
154384bf8334Smrg# -------------------
154484bf8334Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
154584bf8334Smrg[_LT_PROG_AR
1546b73be646Smrg
154784bf8334SmrgAC_CHECK_TOOL(STRIP, strip, :)
154884bf8334Smrgtest -z "$STRIP" && STRIP=:
154984bf8334Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1550b73be646Smrg
155184bf8334SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
155284bf8334Smrgtest -z "$RANLIB" && RANLIB=:
155384bf8334Smrg_LT_DECL([], [RANLIB], [1],
155484bf8334Smrg    [Commands used to install an old-style archive])
1555a73597f9Smrg
155684bf8334Smrg# Determine commands to create old-style static archives.
155784bf8334Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
155884bf8334Smrgold_postinstall_cmds='chmod 644 $oldlib'
155984bf8334Smrgold_postuninstall_cmds=
1560a73597f9Smrg
156184bf8334Smrgif test -n "$RANLIB"; then
156284bf8334Smrg  case $host_os in
1563e4da38afSmrg  bitrig* | openbsd*)
156484bf8334Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
1565a73597f9Smrg    ;;
1566a73597f9Smrg  *)
156784bf8334Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
1568a73597f9Smrg    ;;
1569a73597f9Smrg  esac
157084bf8334Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
1571a73597f9Smrgfi
1572bd3a1963Smrg
1573a73597f9Smrgcase $host_os in
1574a73597f9Smrg  darwin*)
157584bf8334Smrg    lock_old_archive_extraction=yes ;;
157684bf8334Smrg  *)
157784bf8334Smrg    lock_old_archive_extraction=no ;;
1578a73597f9Smrgesac
157984bf8334Smrg_LT_DECL([], [old_postinstall_cmds], [2])
158084bf8334Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
158184bf8334Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
158284bf8334Smrg    [Commands used to build an old-style archive])
158384bf8334Smrg_LT_DECL([], [lock_old_archive_extraction], [0],
158484bf8334Smrg    [Whether to use a lock for old archive extraction])
158584bf8334Smrg])# _LT_CMD_OLD_ARCHIVE
1586b73be646Smrg
1587b73be646Smrg
158884bf8334Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
158984bf8334Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
159084bf8334Smrg# ----------------------------------------------------------------
159184bf8334Smrg# Check whether the given compiler option works
159284bf8334SmrgAC_DEFUN([_LT_COMPILER_OPTION],
159384bf8334Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
159484bf8334Smrgm4_require([_LT_DECL_SED])dnl
159584bf8334SmrgAC_CACHE_CHECK([$1], [$2],
159684bf8334Smrg  [$2=no
159784bf8334Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
159884bf8334Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1599e4da38afSmrg   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
160084bf8334Smrg   # Insert the option either (1) after the last *FLAGS variable, or
160184bf8334Smrg   # (2) before a word containing "conftest.", or (3) at the end.
160284bf8334Smrg   # Note that $ac_compile itself does not contain backslashes and begins
160384bf8334Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
160484bf8334Smrg   # The option is referenced via a variable to avoid confusing sed.
160584bf8334Smrg   lt_compile=`echo "$ac_compile" | $SED \
160684bf8334Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
160784bf8334Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
160884bf8334Smrg   -e 's:$: $lt_compiler_flag:'`
160984bf8334Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
161084bf8334Smrg   (eval "$lt_compile" 2>conftest.err)
161184bf8334Smrg   ac_status=$?
161284bf8334Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
161384bf8334Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
161484bf8334Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
161584bf8334Smrg     # The compiler can only warn and ignore the option if not recognized
161684bf8334Smrg     # So say no if there are warnings other than the usual output.
161784bf8334Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
161884bf8334Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
161984bf8334Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
162084bf8334Smrg       $2=yes
162184bf8334Smrg     fi
162284bf8334Smrg   fi
162384bf8334Smrg   $RM conftest*
162484bf8334Smrg])
1625b73be646Smrg
1626e4da38afSmrgif test yes = "[$]$2"; then
162784bf8334Smrg    m4_if([$5], , :, [$5])
162884bf8334Smrgelse
162984bf8334Smrg    m4_if([$6], , :, [$6])
163084bf8334Smrgfi
163184bf8334Smrg])# _LT_COMPILER_OPTION
1632b73be646Smrg
163384bf8334Smrg# Old name:
163484bf8334SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
163584bf8334Smrgdnl aclocal-1.4 backwards compatibility:
163684bf8334Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1637bd3a1963Smrg
1638bd3a1963Smrg
163984bf8334Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
164084bf8334Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
164184bf8334Smrg# ----------------------------------------------------
164284bf8334Smrg# Check whether the given linker option works
164384bf8334SmrgAC_DEFUN([_LT_LINKER_OPTION],
164484bf8334Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
164584bf8334Smrgm4_require([_LT_DECL_SED])dnl
164684bf8334SmrgAC_CACHE_CHECK([$1], [$2],
164784bf8334Smrg  [$2=no
1648e4da38afSmrg   save_LDFLAGS=$LDFLAGS
164984bf8334Smrg   LDFLAGS="$LDFLAGS $3"
165084bf8334Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
165184bf8334Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
165284bf8334Smrg     # The linker can only warn and ignore the option if not recognized
165384bf8334Smrg     # So say no if there are warnings
165484bf8334Smrg     if test -s conftest.err; then
165584bf8334Smrg       # Append any errors to the config.log.
165684bf8334Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
165784bf8334Smrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
165884bf8334Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
165984bf8334Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
166084bf8334Smrg         $2=yes
166184bf8334Smrg       fi
166284bf8334Smrg     else
166384bf8334Smrg       $2=yes
166484bf8334Smrg     fi
166584bf8334Smrg   fi
166684bf8334Smrg   $RM -r conftest*
1667e4da38afSmrg   LDFLAGS=$save_LDFLAGS
166884bf8334Smrg])
1669bd3a1963Smrg
1670e4da38afSmrgif test yes = "[$]$2"; then
167184bf8334Smrg    m4_if([$4], , :, [$4])
167284bf8334Smrgelse
167384bf8334Smrg    m4_if([$5], , :, [$5])
167484bf8334Smrgfi
167584bf8334Smrg])# _LT_LINKER_OPTION
1676bd3a1963Smrg
167784bf8334Smrg# Old name:
167884bf8334SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
167984bf8334Smrgdnl aclocal-1.4 backwards compatibility:
168084bf8334Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1681b73be646Smrg
1682b73be646Smrg
168384bf8334Smrg# LT_CMD_MAX_LEN
168484bf8334Smrg#---------------
168584bf8334SmrgAC_DEFUN([LT_CMD_MAX_LEN],
168684bf8334Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
168784bf8334Smrg# find the maximum length of command line arguments
168884bf8334SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
168984bf8334SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
169084bf8334Smrg  i=0
1691e4da38afSmrg  teststring=ABCD
1692b73be646Smrg
169384bf8334Smrg  case $build_os in
169484bf8334Smrg  msdosdjgpp*)
169584bf8334Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
169684bf8334Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
169784bf8334Smrg    # during glob expansion).  Even if it were fixed, the result of this
169884bf8334Smrg    # check would be larger than it should be.
169984bf8334Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
170084bf8334Smrg    ;;
1701b73be646Smrg
170284bf8334Smrg  gnu*)
170384bf8334Smrg    # Under GNU Hurd, this test is not required because there is
170484bf8334Smrg    # no limit to the length of command line arguments.
170584bf8334Smrg    # Libtool will interpret -1 as no limit whatsoever
170684bf8334Smrg    lt_cv_sys_max_cmd_len=-1;
1707a73597f9Smrg    ;;
1708b73be646Smrg
170984bf8334Smrg  cygwin* | mingw* | cegcc*)
171084bf8334Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
171184bf8334Smrg    # about 5 minutes as the teststring grows exponentially.
171284bf8334Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
171384bf8334Smrg    # you end up with a "frozen" computer, even though with patience
171484bf8334Smrg    # the test eventually succeeds (with a max line length of 256k).
171584bf8334Smrg    # Instead, let's just punt: use the minimum linelength reported by
171684bf8334Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
171784bf8334Smrg    lt_cv_sys_max_cmd_len=8192;
171884bf8334Smrg    ;;
1719b73be646Smrg
172084bf8334Smrg  mint*)
172184bf8334Smrg    # On MiNT this can take a long time and run out of memory.
172284bf8334Smrg    lt_cv_sys_max_cmd_len=8192;
172384bf8334Smrg    ;;
1724b73be646Smrg
172584bf8334Smrg  amigaos*)
172684bf8334Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
172784bf8334Smrg    # So we just punt and use a minimum line length of 8192.
172884bf8334Smrg    lt_cv_sys_max_cmd_len=8192;
172984bf8334Smrg    ;;
1730bd3a1963Smrg
1731e4da38afSmrg  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
173284bf8334Smrg    # This has been around since 386BSD, at least.  Likely further.
173384bf8334Smrg    if test -x /sbin/sysctl; then
173484bf8334Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
173584bf8334Smrg    elif test -x /usr/sbin/sysctl; then
173684bf8334Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
173784bf8334Smrg    else
173884bf8334Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
173984bf8334Smrg    fi
174084bf8334Smrg    # And add a safety zone
174184bf8334Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
174284bf8334Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1743b73be646Smrg    ;;
174484bf8334Smrg
174584bf8334Smrg  interix*)
174684bf8334Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
174784bf8334Smrg    lt_cv_sys_max_cmd_len=196608
1748b73be646Smrg    ;;
174984bf8334Smrg
175084bf8334Smrg  os2*)
175184bf8334Smrg    # The test takes a long time on OS/2.
175284bf8334Smrg    lt_cv_sys_max_cmd_len=8192
1753b73be646Smrg    ;;
175484bf8334Smrg
175584bf8334Smrg  osf*)
175684bf8334Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
175784bf8334Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
175884bf8334Smrg    # nice to cause kernel panics so lets avoid the loop below.
175984bf8334Smrg    # First set a reasonable default.
176084bf8334Smrg    lt_cv_sys_max_cmd_len=16384
176184bf8334Smrg    #
176284bf8334Smrg    if test -x /sbin/sysconfig; then
176384bf8334Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
176484bf8334Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
176584bf8334Smrg      esac
176684bf8334Smrg    fi
1767b73be646Smrg    ;;
176884bf8334Smrg  sco3.2v5*)
176984bf8334Smrg    lt_cv_sys_max_cmd_len=102400
1770b73be646Smrg    ;;
177184bf8334Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
177284bf8334Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
177384bf8334Smrg    if test -n "$kargmax"; then
177484bf8334Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
177584bf8334Smrg    else
177684bf8334Smrg      lt_cv_sys_max_cmd_len=32768
177784bf8334Smrg    fi
1778b73be646Smrg    ;;
177984bf8334Smrg  *)
178084bf8334Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1781e4da38afSmrg    if test -n "$lt_cv_sys_max_cmd_len" && \
1782e4da38afSmrg       test undefined != "$lt_cv_sys_max_cmd_len"; then
178384bf8334Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
178484bf8334Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1785b73be646Smrg    else
178684bf8334Smrg      # Make teststring a little bigger before we do anything with it.
178784bf8334Smrg      # a 1K string should be a reasonable start.
1788e4da38afSmrg      for i in 1 2 3 4 5 6 7 8; do
178984bf8334Smrg        teststring=$teststring$teststring
179084bf8334Smrg      done
179184bf8334Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
179284bf8334Smrg      # If test is not a shell built-in, we'll probably end up computing a
179384bf8334Smrg      # maximum length that is only half of the actual maximum length, but
179484bf8334Smrg      # we can't tell.
1795e4da38afSmrg      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
179684bf8334Smrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
1797e4da38afSmrg	      test 17 != "$i" # 1/2 MB should be enough
179884bf8334Smrg      do
179984bf8334Smrg        i=`expr $i + 1`
180084bf8334Smrg        teststring=$teststring$teststring
180184bf8334Smrg      done
180284bf8334Smrg      # Only check the string length outside the loop.
180384bf8334Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
180484bf8334Smrg      teststring=
180584bf8334Smrg      # Add a significant safety factor because C++ compilers can tack on
180684bf8334Smrg      # massive amounts of additional arguments before passing them to the
180784bf8334Smrg      # linker.  It appears as though 1/2 is a usable value.
180884bf8334Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1809b73be646Smrg    fi
1810b73be646Smrg    ;;
1811b73be646Smrg  esac
181284bf8334Smrg])
1813e4da38afSmrgif test -n "$lt_cv_sys_max_cmd_len"; then
181484bf8334Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
181584bf8334Smrgelse
181684bf8334Smrg  AC_MSG_RESULT(none)
1817b73be646Smrgfi
181884bf8334Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
181984bf8334Smrg_LT_DECL([], [max_cmd_len], [0],
182084bf8334Smrg    [What is the maximum length of a command?])
182184bf8334Smrg])# LT_CMD_MAX_LEN
1822659607e0Smrg
182384bf8334Smrg# Old name:
182484bf8334SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
182584bf8334Smrgdnl aclocal-1.4 backwards compatibility:
182684bf8334Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1827bd3a1963Smrg
1828659607e0Smrg
182984bf8334Smrg# _LT_HEADER_DLFCN
183084bf8334Smrg# ----------------
183184bf8334Smrgm4_defun([_LT_HEADER_DLFCN],
183284bf8334Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
183384bf8334Smrg])# _LT_HEADER_DLFCN
1834b73be646Smrg
183584bf8334Smrg
183684bf8334Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
183784bf8334Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
183884bf8334Smrg# ----------------------------------------------------------------
183984bf8334Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
184084bf8334Smrg[m4_require([_LT_HEADER_DLFCN])dnl
1841e4da38afSmrgif test yes = "$cross_compiling"; then :
184284bf8334Smrg  [$4]
1843a73597f9Smrgelse
184484bf8334Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
184584bf8334Smrg  lt_status=$lt_dlunknown
184684bf8334Smrg  cat > conftest.$ac_ext <<_LT_EOF
184784bf8334Smrg[#line $LINENO "configure"
184884bf8334Smrg#include "confdefs.h"
1849b73be646Smrg
185084bf8334Smrg#if HAVE_DLFCN_H
185184bf8334Smrg#include <dlfcn.h>
185284bf8334Smrg#endif
1853b73be646Smrg
185484bf8334Smrg#include <stdio.h>
1855b73be646Smrg
185684bf8334Smrg#ifdef RTLD_GLOBAL
185784bf8334Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
185884bf8334Smrg#else
185984bf8334Smrg#  ifdef DL_GLOBAL
186084bf8334Smrg#    define LT_DLGLOBAL		DL_GLOBAL
186184bf8334Smrg#  else
186284bf8334Smrg#    define LT_DLGLOBAL		0
186384bf8334Smrg#  endif
186484bf8334Smrg#endif
1865b73be646Smrg
186684bf8334Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
186784bf8334Smrg   find out it does not work in some platform. */
186884bf8334Smrg#ifndef LT_DLLAZY_OR_NOW
186984bf8334Smrg#  ifdef RTLD_LAZY
187084bf8334Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
187184bf8334Smrg#  else
187284bf8334Smrg#    ifdef DL_LAZY
187384bf8334Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
187484bf8334Smrg#    else
187584bf8334Smrg#      ifdef RTLD_NOW
187684bf8334Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
187784bf8334Smrg#      else
187884bf8334Smrg#        ifdef DL_NOW
187984bf8334Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
188084bf8334Smrg#        else
188184bf8334Smrg#          define LT_DLLAZY_OR_NOW	0
188284bf8334Smrg#        endif
188384bf8334Smrg#      endif
188484bf8334Smrg#    endif
188584bf8334Smrg#  endif
188684bf8334Smrg#endif
1887b73be646Smrg
1888e4da38afSmrg/* When -fvisibility=hidden is used, assume the code has been annotated
188984bf8334Smrg   correspondingly for the symbols needed.  */
1890e4da38afSmrg#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
189184bf8334Smrgint fnord () __attribute__((visibility("default")));
189284bf8334Smrg#endif
1893a73597f9Smrg
189484bf8334Smrgint fnord () { return 42; }
189584bf8334Smrgint main ()
189684bf8334Smrg{
189784bf8334Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
189884bf8334Smrg  int status = $lt_dlunknown;
1899a73597f9Smrg
190084bf8334Smrg  if (self)
190184bf8334Smrg    {
190284bf8334Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
190384bf8334Smrg      else
190484bf8334Smrg        {
190584bf8334Smrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
190684bf8334Smrg          else puts (dlerror ());
190784bf8334Smrg	}
190884bf8334Smrg      /* dlclose (self); */
190984bf8334Smrg    }
191084bf8334Smrg  else
191184bf8334Smrg    puts (dlerror ());
191284bf8334Smrg
191384bf8334Smrg  return status;
191484bf8334Smrg}]
191584bf8334Smrg_LT_EOF
1916e4da38afSmrg  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
191784bf8334Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
191884bf8334Smrg    lt_status=$?
191984bf8334Smrg    case x$lt_status in
192084bf8334Smrg      x$lt_dlno_uscore) $1 ;;
192184bf8334Smrg      x$lt_dlneed_uscore) $2 ;;
192284bf8334Smrg      x$lt_dlunknown|x*) $3 ;;
192384bf8334Smrg    esac
192484bf8334Smrg  else :
192584bf8334Smrg    # compilation failed
192684bf8334Smrg    $3
1927b73be646Smrg  fi
1928a73597f9Smrgfi
192984bf8334Smrgrm -fr conftest*
193084bf8334Smrg])# _LT_TRY_DLOPEN_SELF
1931b73be646Smrg
1932659607e0Smrg
193384bf8334Smrg# LT_SYS_DLOPEN_SELF
193484bf8334Smrg# ------------------
193584bf8334SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
193684bf8334Smrg[m4_require([_LT_HEADER_DLFCN])dnl
1937e4da38afSmrgif test yes != "$enable_dlopen"; then
193884bf8334Smrg  enable_dlopen=unknown
193984bf8334Smrg  enable_dlopen_self=unknown
194084bf8334Smrg  enable_dlopen_self_static=unknown
194184bf8334Smrgelse
194284bf8334Smrg  lt_cv_dlopen=no
194384bf8334Smrg  lt_cv_dlopen_libs=
1944659607e0Smrg
194584bf8334Smrg  case $host_os in
194684bf8334Smrg  beos*)
1947e4da38afSmrg    lt_cv_dlopen=load_add_on
194884bf8334Smrg    lt_cv_dlopen_libs=
194984bf8334Smrg    lt_cv_dlopen_self=yes
195084bf8334Smrg    ;;
1951659607e0Smrg
195284bf8334Smrg  mingw* | pw32* | cegcc*)
1953e4da38afSmrg    lt_cv_dlopen=LoadLibrary
195484bf8334Smrg    lt_cv_dlopen_libs=
195584bf8334Smrg    ;;
1956659607e0Smrg
195784bf8334Smrg  cygwin*)
1958e4da38afSmrg    lt_cv_dlopen=dlopen
195984bf8334Smrg    lt_cv_dlopen_libs=
196084bf8334Smrg    ;;
196184bf8334Smrg
196284bf8334Smrg  darwin*)
1963e4da38afSmrg    # if libdl is installed we need to link against it
196484bf8334Smrg    AC_CHECK_LIB([dl], [dlopen],
1965e4da38afSmrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
1966e4da38afSmrg    lt_cv_dlopen=dyld
196784bf8334Smrg    lt_cv_dlopen_libs=
196884bf8334Smrg    lt_cv_dlopen_self=yes
196984bf8334Smrg    ])
197084bf8334Smrg    ;;
1971659607e0Smrg
1972e4da38afSmrg  tpf*)
1973e4da38afSmrg    # Don't try to run any link tests for TPF.  We know it's impossible
1974e4da38afSmrg    # because TPF is a cross-compiler, and we know how we open DSOs.
1975e4da38afSmrg    lt_cv_dlopen=dlopen
1976e4da38afSmrg    lt_cv_dlopen_libs=
1977e4da38afSmrg    lt_cv_dlopen_self=no
1978e4da38afSmrg    ;;
1979e4da38afSmrg
1980a73597f9Smrg  *)
198184bf8334Smrg    AC_CHECK_FUNC([shl_load],
1982e4da38afSmrg	  [lt_cv_dlopen=shl_load],
198384bf8334Smrg      [AC_CHECK_LIB([dld], [shl_load],
1984e4da38afSmrg	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
198584bf8334Smrg	[AC_CHECK_FUNC([dlopen],
1986e4da38afSmrg	      [lt_cv_dlopen=dlopen],
198784bf8334Smrg	  [AC_CHECK_LIB([dl], [dlopen],
1988e4da38afSmrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
198984bf8334Smrg	    [AC_CHECK_LIB([svld], [dlopen],
1990e4da38afSmrg		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
199184bf8334Smrg	      [AC_CHECK_LIB([dld], [dld_link],
1992e4da38afSmrg		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
199384bf8334Smrg	      ])
199484bf8334Smrg	    ])
199584bf8334Smrg	  ])
199684bf8334Smrg	])
199784bf8334Smrg      ])
199884bf8334Smrg    ;;
1999b73be646Smrg  esac
2000659607e0Smrg
2001e4da38afSmrg  if test no = "$lt_cv_dlopen"; then
200284bf8334Smrg    enable_dlopen=no
2003e4da38afSmrg  else
2004e4da38afSmrg    enable_dlopen=yes
200584bf8334Smrg  fi
2006659607e0Smrg
200784bf8334Smrg  case $lt_cv_dlopen in
200884bf8334Smrg  dlopen)
2009e4da38afSmrg    save_CPPFLAGS=$CPPFLAGS
2010e4da38afSmrg    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2011659607e0Smrg
2012e4da38afSmrg    save_LDFLAGS=$LDFLAGS
201384bf8334Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2014659607e0Smrg
2015e4da38afSmrg    save_LIBS=$LIBS
201684bf8334Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
2017659607e0Smrg
201884bf8334Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
201984bf8334Smrg	  lt_cv_dlopen_self, [dnl
202084bf8334Smrg	  _LT_TRY_DLOPEN_SELF(
202184bf8334Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
202284bf8334Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
202384bf8334Smrg    ])
2024659607e0Smrg
2025e4da38afSmrg    if test yes = "$lt_cv_dlopen_self"; then
202684bf8334Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
202784bf8334Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
202884bf8334Smrg	  lt_cv_dlopen_self_static, [dnl
202984bf8334Smrg	  _LT_TRY_DLOPEN_SELF(
203084bf8334Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
203184bf8334Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
203284bf8334Smrg      ])
203384bf8334Smrg    fi
2034b73be646Smrg
2035e4da38afSmrg    CPPFLAGS=$save_CPPFLAGS
2036e4da38afSmrg    LDFLAGS=$save_LDFLAGS
2037e4da38afSmrg    LIBS=$save_LIBS
203884bf8334Smrg    ;;
203984bf8334Smrg  esac
2040fc27e79cSmrg
204184bf8334Smrg  case $lt_cv_dlopen_self in
204284bf8334Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
204384bf8334Smrg  *) enable_dlopen_self=unknown ;;
204484bf8334Smrg  esac
2045fc27e79cSmrg
204684bf8334Smrg  case $lt_cv_dlopen_self_static in
204784bf8334Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
204884bf8334Smrg  *) enable_dlopen_self_static=unknown ;;
204984bf8334Smrg  esac
205084bf8334Smrgfi
205184bf8334Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
205284bf8334Smrg	 [Whether dlopen is supported])
205384bf8334Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
205484bf8334Smrg	 [Whether dlopen of programs is supported])
205584bf8334Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
205684bf8334Smrg	 [Whether dlopen of statically linked programs is supported])
205784bf8334Smrg])# LT_SYS_DLOPEN_SELF
2058fc27e79cSmrg
205984bf8334Smrg# Old name:
206084bf8334SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
206184bf8334Smrgdnl aclocal-1.4 backwards compatibility:
206284bf8334Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
2063fc27e79cSmrg
2064659607e0Smrg
206584bf8334Smrg# _LT_COMPILER_C_O([TAGNAME])
206684bf8334Smrg# ---------------------------
206784bf8334Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
206884bf8334Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
206984bf8334Smrgm4_defun([_LT_COMPILER_C_O],
207084bf8334Smrg[m4_require([_LT_DECL_SED])dnl
207184bf8334Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
207284bf8334Smrgm4_require([_LT_TAG_COMPILER])dnl
207384bf8334SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
207484bf8334Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
207584bf8334Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
207684bf8334Smrg   $RM -r conftest 2>/dev/null
207784bf8334Smrg   mkdir conftest
207884bf8334Smrg   cd conftest
207984bf8334Smrg   mkdir out
208084bf8334Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2081a73597f9Smrg
208284bf8334Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
208384bf8334Smrg   # Insert the option either (1) after the last *FLAGS variable, or
208484bf8334Smrg   # (2) before a word containing "conftest.", or (3) at the end.
208584bf8334Smrg   # Note that $ac_compile itself does not contain backslashes and begins
208684bf8334Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
208784bf8334Smrg   lt_compile=`echo "$ac_compile" | $SED \
208884bf8334Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
208984bf8334Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
209084bf8334Smrg   -e 's:$: $lt_compiler_flag:'`
209184bf8334Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
209284bf8334Smrg   (eval "$lt_compile" 2>out/conftest.err)
209384bf8334Smrg   ac_status=$?
209484bf8334Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
209584bf8334Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
209684bf8334Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
209784bf8334Smrg   then
209884bf8334Smrg     # The compiler can only warn and ignore the option if not recognized
209984bf8334Smrg     # So say no if there are warnings
210084bf8334Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
210184bf8334Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
210284bf8334Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
210384bf8334Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
210484bf8334Smrg     fi
210584bf8334Smrg   fi
210684bf8334Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
210784bf8334Smrg   $RM conftest*
210884bf8334Smrg   # SGI C++ compiler will create directory out/ii_files/ for
210984bf8334Smrg   # template instantiation
211084bf8334Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
211184bf8334Smrg   $RM out/* && rmdir out
211284bf8334Smrg   cd ..
211384bf8334Smrg   $RM -r conftest
211484bf8334Smrg   $RM conftest*
211584bf8334Smrg])
211684bf8334Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
211784bf8334Smrg	[Does compiler simultaneously support -c and -o options?])
211884bf8334Smrg])# _LT_COMPILER_C_O
2119a73597f9Smrg
2120659607e0Smrg
212184bf8334Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
212284bf8334Smrg# ----------------------------------
212384bf8334Smrg# Check to see if we can do hard links to lock some files if needed
212484bf8334Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
212584bf8334Smrg[m4_require([_LT_ENABLE_LOCK])dnl
212684bf8334Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
212784bf8334Smrg_LT_COMPILER_C_O([$1])
2128659607e0Smrg
2129e4da38afSmrghard_links=nottested
2130e4da38afSmrgif test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
213184bf8334Smrg  # do not overwrite the value of need_locks provided by the user
213284bf8334Smrg  AC_MSG_CHECKING([if we can lock with hard links])
213384bf8334Smrg  hard_links=yes
213484bf8334Smrg  $RM conftest*
213584bf8334Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
213684bf8334Smrg  touch conftest.a
213784bf8334Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
213884bf8334Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
213984bf8334Smrg  AC_MSG_RESULT([$hard_links])
2140e4da38afSmrg  if test no = "$hard_links"; then
2141e4da38afSmrg    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
214284bf8334Smrg    need_locks=warn
214384bf8334Smrg  fi
214484bf8334Smrgelse
214584bf8334Smrg  need_locks=no
214684bf8334Smrgfi
214784bf8334Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
214884bf8334Smrg])# _LT_COMPILER_FILE_LOCKS
2149659607e0Smrg
2150659607e0Smrg
215184bf8334Smrg# _LT_CHECK_OBJDIR
215284bf8334Smrg# ----------------
215384bf8334Smrgm4_defun([_LT_CHECK_OBJDIR],
215484bf8334Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
215584bf8334Smrg[rm -f .libs 2>/dev/null
215684bf8334Smrgmkdir .libs 2>/dev/null
215784bf8334Smrgif test -d .libs; then
215884bf8334Smrg  lt_cv_objdir=.libs
215984bf8334Smrgelse
216084bf8334Smrg  # MS-DOS does not allow filenames that begin with a dot.
216184bf8334Smrg  lt_cv_objdir=_libs
216284bf8334Smrgfi
216384bf8334Smrgrmdir .libs 2>/dev/null])
216484bf8334Smrgobjdir=$lt_cv_objdir
216584bf8334Smrg_LT_DECL([], [objdir], [0],
216684bf8334Smrg         [The name of the directory that contains temporary libtool files])dnl
216784bf8334Smrgm4_pattern_allow([LT_OBJDIR])dnl
2168e4da38afSmrgAC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
2169e4da38afSmrg  [Define to the sub-directory where libtool stores uninstalled libraries.])
217084bf8334Smrg])# _LT_CHECK_OBJDIR
2171a73597f9Smrg
2172a73597f9Smrg
217384bf8334Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
217484bf8334Smrg# --------------------------------------
217584bf8334Smrg# Check hardcoding attributes.
217684bf8334Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
217784bf8334Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
217884bf8334Smrg_LT_TAGVAR(hardcode_action, $1)=
217984bf8334Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
218084bf8334Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
2181e4da38afSmrg   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
2182659607e0Smrg
218384bf8334Smrg  # We can hardcode non-existent directories.
2184e4da38afSmrg  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
218584bf8334Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
218684bf8334Smrg     # have to relink, otherwise we might link with an installed library
218784bf8334Smrg     # when we should be linking with a yet-to-be-installed one
2188e4da38afSmrg     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
2189e4da38afSmrg     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
219084bf8334Smrg    # Linking always hardcodes the temporary library directory.
219184bf8334Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
2192a73597f9Smrg  else
219384bf8334Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
219484bf8334Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
2195a73597f9Smrg  fi
2196a73597f9Smrgelse
219784bf8334Smrg  # We cannot hardcode anything, or else we can only hardcode existing
219884bf8334Smrg  # directories.
219984bf8334Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
2200a73597f9Smrgfi
220184bf8334SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2202659607e0Smrg
2203e4da38afSmrgif test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
2204e4da38afSmrg   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
220584bf8334Smrg  # Fast installation is not supported
220684bf8334Smrg  enable_fast_install=no
2207e4da38afSmrgelif test yes = "$shlibpath_overrides_runpath" ||
2208e4da38afSmrg     test no = "$enable_shared"; then
220984bf8334Smrg  # Fast installation is not necessary
221084bf8334Smrg  enable_fast_install=needless
2211a73597f9Smrgfi
221284bf8334Smrg_LT_TAGDECL([], [hardcode_action], [0],
221384bf8334Smrg    [How to hardcode a shared library path into an executable])
221484bf8334Smrg])# _LT_LINKER_HARDCODE_LIBPATH
2215659607e0Smrg
2216a73597f9Smrg
221784bf8334Smrg# _LT_CMD_STRIPLIB
221884bf8334Smrg# ----------------
221984bf8334Smrgm4_defun([_LT_CMD_STRIPLIB],
222084bf8334Smrg[m4_require([_LT_DECL_EGREP])
222184bf8334Smrgstriplib=
222284bf8334Smrgold_striplib=
222384bf8334SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
222484bf8334Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
222584bf8334Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
222684bf8334Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
222784bf8334Smrg  AC_MSG_RESULT([yes])
222884bf8334Smrgelse
222984bf8334Smrg# FIXME - insert some real tests, host_os isn't really good enough
223084bf8334Smrg  case $host_os in
223184bf8334Smrg  darwin*)
2232e4da38afSmrg    if test -n "$STRIP"; then
223384bf8334Smrg      striplib="$STRIP -x"
223484bf8334Smrg      old_striplib="$STRIP -S"
223584bf8334Smrg      AC_MSG_RESULT([yes])
223684bf8334Smrg    else
223784bf8334Smrg      AC_MSG_RESULT([no])
223884bf8334Smrg    fi
223984bf8334Smrg    ;;
224084bf8334Smrg  *)
224184bf8334Smrg    AC_MSG_RESULT([no])
224284bf8334Smrg    ;;
224384bf8334Smrg  esac
224484bf8334Smrgfi
224584bf8334Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
224684bf8334Smrg_LT_DECL([], [striplib], [1])
224784bf8334Smrg])# _LT_CMD_STRIPLIB
2248659607e0Smrg
2249659607e0Smrg
2250e4da38afSmrg# _LT_PREPARE_MUNGE_PATH_LIST
2251e4da38afSmrg# ---------------------------
2252e4da38afSmrg# Make sure func_munge_path_list() is defined correctly.
2253e4da38afSmrgm4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
2254e4da38afSmrg[[# func_munge_path_list VARIABLE PATH
2255e4da38afSmrg# -----------------------------------
2256e4da38afSmrg# VARIABLE is name of variable containing _space_ separated list of
2257e4da38afSmrg# directories to be munged by the contents of PATH, which is string
2258e4da38afSmrg# having a format:
2259e4da38afSmrg# "DIR[:DIR]:"
2260e4da38afSmrg#       string "DIR[ DIR]" will be prepended to VARIABLE
2261e4da38afSmrg# ":DIR[:DIR]"
2262e4da38afSmrg#       string "DIR[ DIR]" will be appended to VARIABLE
2263e4da38afSmrg# "DIRP[:DIRP]::[DIRA:]DIRA"
2264e4da38afSmrg#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
2265e4da38afSmrg#       "DIRA[ DIRA]" will be appended to VARIABLE
2266e4da38afSmrg# "DIR[:DIR]"
2267e4da38afSmrg#       VARIABLE will be replaced by "DIR[ DIR]"
2268e4da38afSmrgfunc_munge_path_list ()
2269e4da38afSmrg{
2270e4da38afSmrg    case x@S|@2 in
2271e4da38afSmrg    x)
2272e4da38afSmrg        ;;
2273e4da38afSmrg    *:)
2274e4da38afSmrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
2275e4da38afSmrg        ;;
2276e4da38afSmrg    x:*)
2277e4da38afSmrg        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
2278e4da38afSmrg        ;;
2279e4da38afSmrg    *::*)
2280e4da38afSmrg        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
2281e4da38afSmrg        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
2282e4da38afSmrg        ;;
2283e4da38afSmrg    *)
2284e4da38afSmrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
2285e4da38afSmrg        ;;
2286e4da38afSmrg    esac
2287e4da38afSmrg}
2288e4da38afSmrg]])# _LT_PREPARE_PATH_LIST
2289e4da38afSmrg
2290e4da38afSmrg
229184bf8334Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
229284bf8334Smrg# -----------------------------
229384bf8334Smrg# PORTME Fill in your ld.so characteristics
229484bf8334Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
229584bf8334Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
229684bf8334Smrgm4_require([_LT_DECL_EGREP])dnl
229784bf8334Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
229884bf8334Smrgm4_require([_LT_DECL_OBJDUMP])dnl
229984bf8334Smrgm4_require([_LT_DECL_SED])dnl
230084bf8334Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
2301e4da38afSmrgm4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
230284bf8334SmrgAC_MSG_CHECKING([dynamic linker characteristics])
230384bf8334Smrgm4_if([$1],
230484bf8334Smrg	[], [
2305e4da38afSmrgif test yes = "$GCC"; then
230684bf8334Smrg  case $host_os in
2307e4da38afSmrg    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
2308e4da38afSmrg    *) lt_awk_arg='/^libraries:/' ;;
230984bf8334Smrg  esac
231084bf8334Smrg  case $host_os in
2311e4da38afSmrg    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
2312e4da38afSmrg    *) lt_sed_strip_eq='s|=/|/|g' ;;
231384bf8334Smrg  esac
231484bf8334Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
231584bf8334Smrg  case $lt_search_path_spec in
231684bf8334Smrg  *\;*)
231784bf8334Smrg    # if the path contains ";" then we assume it to be the separator
231884bf8334Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
231984bf8334Smrg    # assumed that no part of a normal pathname contains ";" but that should
232084bf8334Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
232184bf8334Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
232284bf8334Smrg    ;;
232384bf8334Smrg  *)
232484bf8334Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
232584bf8334Smrg    ;;
232684bf8334Smrg  esac
232784bf8334Smrg  # Ok, now we have the path, separated by spaces, we can step through it
2328e4da38afSmrg  # and add multilib dir if necessary...
232984bf8334Smrg  lt_tmp_lt_search_path_spec=
2330e4da38afSmrg  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2331e4da38afSmrg  # ...but if some path component already ends with the multilib dir we assume
2332e4da38afSmrg  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
2333e4da38afSmrg  case "$lt_multi_os_dir; $lt_search_path_spec " in
2334e4da38afSmrg  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
2335e4da38afSmrg    lt_multi_os_dir=
2336e4da38afSmrg    ;;
2337e4da38afSmrg  esac
233884bf8334Smrg  for lt_sys_path in $lt_search_path_spec; do
2339e4da38afSmrg    if test -d "$lt_sys_path$lt_multi_os_dir"; then
2340e4da38afSmrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
2341e4da38afSmrg    elif test -n "$lt_multi_os_dir"; then
234284bf8334Smrg      test -d "$lt_sys_path" && \
234384bf8334Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
234484bf8334Smrg    fi
234584bf8334Smrg  done
234684bf8334Smrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
2347e4da38afSmrgBEGIN {RS = " "; FS = "/|\n";} {
2348e4da38afSmrg  lt_foo = "";
2349e4da38afSmrg  lt_count = 0;
235084bf8334Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
235184bf8334Smrg    if ($lt_i != "" && $lt_i != ".") {
235284bf8334Smrg      if ($lt_i == "..") {
235384bf8334Smrg        lt_count++;
235484bf8334Smrg      } else {
235584bf8334Smrg        if (lt_count == 0) {
2356e4da38afSmrg          lt_foo = "/" $lt_i lt_foo;
235784bf8334Smrg        } else {
235884bf8334Smrg          lt_count--;
235984bf8334Smrg        }
236084bf8334Smrg      }
236184bf8334Smrg    }
236284bf8334Smrg  }
236384bf8334Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
236484bf8334Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
236584bf8334Smrg}'`
236684bf8334Smrg  # AWK program above erroneously prepends '/' to C:/dos/paths
236784bf8334Smrg  # for these hosts.
236884bf8334Smrg  case $host_os in
236984bf8334Smrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
2370e4da38afSmrg      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
237184bf8334Smrg  esac
237284bf8334Smrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
237384bf8334Smrgelse
237484bf8334Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
237584bf8334Smrgfi])
237684bf8334Smrglibrary_names_spec=
237784bf8334Smrglibname_spec='lib$name'
237884bf8334Smrgsoname_spec=
2379e4da38afSmrgshrext_cmds=.so
238084bf8334Smrgpostinstall_cmds=
238184bf8334Smrgpostuninstall_cmds=
238284bf8334Smrgfinish_cmds=
238384bf8334Smrgfinish_eval=
238484bf8334Smrgshlibpath_var=
238584bf8334Smrgshlibpath_overrides_runpath=unknown
238684bf8334Smrgversion_type=none
238784bf8334Smrgdynamic_linker="$host_os ld.so"
238884bf8334Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
238984bf8334Smrgneed_lib_prefix=unknown
239084bf8334Smrghardcode_into_libs=no
2391bd3a1963Smrg
239284bf8334Smrg# when you set need_version to no, make sure it does not cause -set_version
239384bf8334Smrg# flags to be left without arguments
239484bf8334Smrgneed_version=unknown
239584bf8334Smrg
2396e4da38afSmrgAC_ARG_VAR([LT_SYS_LIBRARY_PATH],
2397e4da38afSmrg[User-defined run-time library search path.])
2398e4da38afSmrg
239984bf8334Smrgcase $host_os in
240084bf8334Smrgaix3*)
240184bf8334Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2402e4da38afSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
240384bf8334Smrg  shlibpath_var=LIBPATH
240484bf8334Smrg
240584bf8334Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
2406e4da38afSmrg  soname_spec='$libname$release$shared_ext$major'
240784bf8334Smrg  ;;
240884bf8334Smrg
240984bf8334Smrgaix[[4-9]]*)
241084bf8334Smrg  version_type=linux # correct to gnu/linux during the next big refactor
241184bf8334Smrg  need_lib_prefix=no
241284bf8334Smrg  need_version=no
241384bf8334Smrg  hardcode_into_libs=yes
2414e4da38afSmrg  if test ia64 = "$host_cpu"; then
241584bf8334Smrg    # AIX 5 supports IA64
2416e4da38afSmrg    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
241784bf8334Smrg    shlibpath_var=LD_LIBRARY_PATH
241884bf8334Smrg  else
241984bf8334Smrg    # With GCC up to 2.95.x, collect2 would create an import file
242084bf8334Smrg    # for dependence libraries.  The import file would start with
2421e4da38afSmrg    # the line '#! .'.  This would cause the generated library to
2422e4da38afSmrg    # depend on '.', always an invalid library.  This was fixed in
242384bf8334Smrg    # development snapshots of GCC prior to 3.0.
242484bf8334Smrg    case $host_os in
242584bf8334Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
242684bf8334Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
242784bf8334Smrg	   echo ' yes '
2428e4da38afSmrg	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
242984bf8334Smrg	:
243084bf8334Smrg      else
243184bf8334Smrg	can_build_shared=no
243284bf8334Smrg      fi
2433a73597f9Smrg      ;;
243484bf8334Smrg    esac
2435e4da38afSmrg    # Using Import Files as archive members, it is possible to support
2436e4da38afSmrg    # filename-based versioning of shared library archives on AIX. While
2437e4da38afSmrg    # this would work for both with and without runtime linking, it will
2438e4da38afSmrg    # prevent static linking of such archives. So we do filename-based
2439e4da38afSmrg    # shared library versioning with .so extension only, which is used
2440e4da38afSmrg    # when both runtime linking and shared linking is enabled.
2441e4da38afSmrg    # Unfortunately, runtime linking may impact performance, so we do
2442e4da38afSmrg    # not want this to be the default eventually. Also, we use the
2443e4da38afSmrg    # versioned .so libs for executables only if there is the -brtl
2444e4da38afSmrg    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
2445e4da38afSmrg    # To allow for filename-based versioning support, we need to create
2446e4da38afSmrg    # libNAME.so.V as an archive file, containing:
2447e4da38afSmrg    # *) an Import File, referring to the versioned filename of the
2448e4da38afSmrg    #    archive as well as the shared archive member, telling the
2449e4da38afSmrg    #    bitwidth (32 or 64) of that shared object, and providing the
2450e4da38afSmrg    #    list of exported symbols of that shared object, eventually
2451e4da38afSmrg    #    decorated with the 'weak' keyword
2452e4da38afSmrg    # *) the shared object with the F_LOADONLY flag set, to really avoid
2453e4da38afSmrg    #    it being seen by the linker.
2454e4da38afSmrg    # At run time we better use the real file rather than another symlink,
2455e4da38afSmrg    # but for link time we create the symlink libNAME.so -> libNAME.so.V
2456e4da38afSmrg
2457e4da38afSmrg    case $with_aix_soname,$aix_use_runtimelinking in
2458e4da38afSmrg    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
245984bf8334Smrg    # soname into executable. Probably we can add versioning support to
246084bf8334Smrg    # collect2, so additional links can be useful in future.
2461e4da38afSmrg    aix,yes) # traditional libtool
2462e4da38afSmrg      dynamic_linker='AIX unversionable lib.so'
246384bf8334Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
246484bf8334Smrg      # instead of lib<name>.a to let people know that these are not
246584bf8334Smrg      # typical AIX shared libraries.
2466e4da38afSmrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2467e4da38afSmrg      ;;
2468e4da38afSmrg    aix,no) # traditional AIX only
2469e4da38afSmrg      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
247084bf8334Smrg      # We preserve .a as extension for shared libraries through AIX4.2
247184bf8334Smrg      # and later when we are not doing run time linking.
2472e4da38afSmrg      library_names_spec='$libname$release.a $libname.a'
2473e4da38afSmrg      soname_spec='$libname$release$shared_ext$major'
2474e4da38afSmrg      ;;
2475e4da38afSmrg    svr4,*) # full svr4 only
2476e4da38afSmrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
2477e4da38afSmrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2478e4da38afSmrg      # We do not specify a path in Import Files, so LIBPATH fires.
2479e4da38afSmrg      shlibpath_overrides_runpath=yes
2480e4da38afSmrg      ;;
2481e4da38afSmrg    *,yes) # both, prefer svr4
2482e4da38afSmrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
2483e4da38afSmrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2484e4da38afSmrg      # unpreferred sharedlib libNAME.a needs extra handling
2485e4da38afSmrg      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
2486e4da38afSmrg      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
2487e4da38afSmrg      # We do not specify a path in Import Files, so LIBPATH fires.
2488e4da38afSmrg      shlibpath_overrides_runpath=yes
2489e4da38afSmrg      ;;
2490e4da38afSmrg    *,no) # both, prefer aix
2491e4da38afSmrg      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
2492e4da38afSmrg      library_names_spec='$libname$release.a $libname.a'
2493e4da38afSmrg      soname_spec='$libname$release$shared_ext$major'
2494e4da38afSmrg      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
2495e4da38afSmrg      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
2496e4da38afSmrg      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
2497e4da38afSmrg      ;;
2498e4da38afSmrg    esac
249984bf8334Smrg    shlibpath_var=LIBPATH
250084bf8334Smrg  fi
250184bf8334Smrg  ;;
250284bf8334Smrg
250384bf8334Smrgamigaos*)
250484bf8334Smrg  case $host_cpu in
250584bf8334Smrg  powerpc)
250684bf8334Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
250784bf8334Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2508e4da38afSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
250984bf8334Smrg    ;;
251084bf8334Smrg  m68k)
251184bf8334Smrg    library_names_spec='$libname.ixlibrary $libname.a'
251284bf8334Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
2513e4da38afSmrg    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
251484bf8334Smrg    ;;
251584bf8334Smrg  esac
251684bf8334Smrg  ;;
251784bf8334Smrg
251884bf8334Smrgbeos*)
2519e4da38afSmrg  library_names_spec='$libname$shared_ext'
252084bf8334Smrg  dynamic_linker="$host_os ld.so"
252184bf8334Smrg  shlibpath_var=LIBRARY_PATH
252284bf8334Smrg  ;;
252384bf8334Smrg
252484bf8334Smrgbsdi[[45]]*)
252584bf8334Smrg  version_type=linux # correct to gnu/linux during the next big refactor
252684bf8334Smrg  need_version=no
2527e4da38afSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2528e4da38afSmrg  soname_spec='$libname$release$shared_ext$major'
252984bf8334Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
253084bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
253184bf8334Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
253284bf8334Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
253384bf8334Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
253484bf8334Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
253584bf8334Smrg  # libtool to hard-code these into programs
253684bf8334Smrg  ;;
253784bf8334Smrg
253884bf8334Smrgcygwin* | mingw* | pw32* | cegcc*)
253984bf8334Smrg  version_type=windows
2540e4da38afSmrg  shrext_cmds=.dll
254184bf8334Smrg  need_version=no
254284bf8334Smrg  need_lib_prefix=no
254384bf8334Smrg
254484bf8334Smrg  case $GCC,$cc_basename in
254584bf8334Smrg  yes,*)
254684bf8334Smrg    # gcc
254784bf8334Smrg    library_names_spec='$libname.dll.a'
254884bf8334Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2549e4da38afSmrg    postinstall_cmds='base_file=`basename \$file`~
2550e4da38afSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
255184bf8334Smrg      dldir=$destdir/`dirname \$dlpath`~
255284bf8334Smrg      test -d \$dldir || mkdir -p \$dldir~
255384bf8334Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
255484bf8334Smrg      chmod a+x \$dldir/$dlname~
255584bf8334Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
255684bf8334Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
255784bf8334Smrg      fi'
255884bf8334Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
255984bf8334Smrg      dlpath=$dir/\$dldll~
256084bf8334Smrg       $RM \$dlpath'
256184bf8334Smrg    shlibpath_overrides_runpath=yes
256284bf8334Smrg
256384bf8334Smrg    case $host_os in
256484bf8334Smrg    cygwin*)
256584bf8334Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2566e4da38afSmrg      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
256784bf8334Smrgm4_if([$1], [],[
256884bf8334Smrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
2569a73597f9Smrg      ;;
257084bf8334Smrg    mingw* | cegcc*)
257184bf8334Smrg      # MinGW DLLs use traditional 'lib' prefix
2572e4da38afSmrg      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2573a73597f9Smrg      ;;
257484bf8334Smrg    pw32*)
257584bf8334Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
2576e4da38afSmrg      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2577a73597f9Smrg      ;;
257884bf8334Smrg    esac
257984bf8334Smrg    dynamic_linker='Win32 ld.exe'
258084bf8334Smrg    ;;
258184bf8334Smrg
258284bf8334Smrg  *,cl*)
258384bf8334Smrg    # Native MSVC
258484bf8334Smrg    libname_spec='$name'
2585e4da38afSmrg    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2586e4da38afSmrg    library_names_spec='$libname.dll.lib'
258784bf8334Smrg
258884bf8334Smrg    case $build_os in
258984bf8334Smrg    mingw*)
259084bf8334Smrg      sys_lib_search_path_spec=
259184bf8334Smrg      lt_save_ifs=$IFS
259284bf8334Smrg      IFS=';'
259384bf8334Smrg      for lt_path in $LIB
259484bf8334Smrg      do
259584bf8334Smrg        IFS=$lt_save_ifs
259684bf8334Smrg        # Let DOS variable expansion print the short 8.3 style file name.
259784bf8334Smrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
259884bf8334Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
259984bf8334Smrg      done
260084bf8334Smrg      IFS=$lt_save_ifs
260184bf8334Smrg      # Convert to MSYS style.
260284bf8334Smrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
2603a73597f9Smrg      ;;
260484bf8334Smrg    cygwin*)
260584bf8334Smrg      # Convert to unix form, then to dos form, then back to unix form
260684bf8334Smrg      # but this time dos style (no spaces!) so that the unix form looks
260784bf8334Smrg      # like /cygdrive/c/PROGRA~1:/cygdr...
260884bf8334Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
260984bf8334Smrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
261084bf8334Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2611bd3a1963Smrg      ;;
2612bd3a1963Smrg    *)
2613e4da38afSmrg      sys_lib_search_path_spec=$LIB
261484bf8334Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
261584bf8334Smrg        # It is most probably a Windows format PATH.
261684bf8334Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
261784bf8334Smrg      else
261884bf8334Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
261984bf8334Smrg      fi
262084bf8334Smrg      # FIXME: find the short name or the path components, as spaces are
262184bf8334Smrg      # common. (e.g. "Program Files" -> "PROGRA~1")
2622bd3a1963Smrg      ;;
2623bd3a1963Smrg    esac
262484bf8334Smrg
262584bf8334Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2626e4da38afSmrg    postinstall_cmds='base_file=`basename \$file`~
2627e4da38afSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
262884bf8334Smrg      dldir=$destdir/`dirname \$dlpath`~
262984bf8334Smrg      test -d \$dldir || mkdir -p \$dldir~
263084bf8334Smrg      $install_prog $dir/$dlname \$dldir/$dlname'
263184bf8334Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
263284bf8334Smrg      dlpath=$dir/\$dldll~
263384bf8334Smrg       $RM \$dlpath'
263484bf8334Smrg    shlibpath_overrides_runpath=yes
263584bf8334Smrg    dynamic_linker='Win32 link.exe'
263684bf8334Smrg    ;;
263784bf8334Smrg
263884bf8334Smrg  *)
263984bf8334Smrg    # Assume MSVC wrapper
2640e4da38afSmrg    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
264184bf8334Smrg    dynamic_linker='Win32 ld.exe'
264284bf8334Smrg    ;;
264384bf8334Smrg  esac
264484bf8334Smrg  # FIXME: first we should search . and the directory the executable is in
264584bf8334Smrg  shlibpath_var=PATH
264684bf8334Smrg  ;;
264784bf8334Smrg
264884bf8334Smrgdarwin* | rhapsody*)
264984bf8334Smrg  dynamic_linker="$host_os dyld"
265084bf8334Smrg  version_type=darwin
265184bf8334Smrg  need_lib_prefix=no
265284bf8334Smrg  need_version=no
2653e4da38afSmrg  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
2654e4da38afSmrg  soname_spec='$libname$release$major$shared_ext'
265584bf8334Smrg  shlibpath_overrides_runpath=yes
265684bf8334Smrg  shlibpath_var=DYLD_LIBRARY_PATH
265784bf8334Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
265884bf8334Smrgm4_if([$1], [],[
265984bf8334Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
266084bf8334Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
266184bf8334Smrg  ;;
266284bf8334Smrg
266384bf8334Smrgdgux*)
266484bf8334Smrg  version_type=linux # correct to gnu/linux during the next big refactor
266584bf8334Smrg  need_lib_prefix=no
266684bf8334Smrg  need_version=no
2667e4da38afSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2668e4da38afSmrg  soname_spec='$libname$release$shared_ext$major'
266984bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
267084bf8334Smrg  ;;
267184bf8334Smrg
267284bf8334Smrgfreebsd* | dragonfly*)
267384bf8334Smrg  # DragonFly does not have aout.  When/if they implement a new
267484bf8334Smrg  # versioning mechanism, adjust this.
267584bf8334Smrg  if test -x /usr/bin/objformat; then
267684bf8334Smrg    objformat=`/usr/bin/objformat`
2677b73be646Smrg  else
2678b73be646Smrg    case $host_os in
267984bf8334Smrg    freebsd[[23]].*) objformat=aout ;;
268084bf8334Smrg    *) objformat=elf ;;
268184bf8334Smrg    esac
268284bf8334Smrg  fi
268384bf8334Smrg  version_type=freebsd-$objformat
268484bf8334Smrg  case $version_type in
268584bf8334Smrg    freebsd-elf*)
2686e4da38afSmrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2687e4da38afSmrg      soname_spec='$libname$release$shared_ext$major'
268884bf8334Smrg      need_version=no
268984bf8334Smrg      need_lib_prefix=no
269084bf8334Smrg      ;;
269184bf8334Smrg    freebsd-*)
2692e4da38afSmrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
269384bf8334Smrg      need_version=yes
269484bf8334Smrg      ;;
269584bf8334Smrg  esac
269684bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
269784bf8334Smrg  case $host_os in
269884bf8334Smrg  freebsd2.*)
269984bf8334Smrg    shlibpath_overrides_runpath=yes
270084bf8334Smrg    ;;
270184bf8334Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
270284bf8334Smrg    shlibpath_overrides_runpath=yes
270384bf8334Smrg    hardcode_into_libs=yes
270484bf8334Smrg    ;;
270584bf8334Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
270684bf8334Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
270784bf8334Smrg    shlibpath_overrides_runpath=no
270884bf8334Smrg    hardcode_into_libs=yes
270984bf8334Smrg    ;;
271084bf8334Smrg  *) # from 4.6 on, and DragonFly
271184bf8334Smrg    shlibpath_overrides_runpath=yes
271284bf8334Smrg    hardcode_into_libs=yes
271384bf8334Smrg    ;;
271484bf8334Smrg  esac
271584bf8334Smrg  ;;
271684bf8334Smrg
271784bf8334Smrghaiku*)
271884bf8334Smrg  version_type=linux # correct to gnu/linux during the next big refactor
271984bf8334Smrg  need_lib_prefix=no
272084bf8334Smrg  need_version=no
272184bf8334Smrg  dynamic_linker="$host_os runtime_loader"
2722e4da38afSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2723e4da38afSmrg  soname_spec='$libname$release$shared_ext$major'
272484bf8334Smrg  shlibpath_var=LIBRARY_PATH
2725e4da38afSmrg  shlibpath_overrides_runpath=no
272684bf8334Smrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
272784bf8334Smrg  hardcode_into_libs=yes
272884bf8334Smrg  ;;
272984bf8334Smrg
273084bf8334Smrghpux9* | hpux10* | hpux11*)
273184bf8334Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
273284bf8334Smrg  # link against other versions.
273384bf8334Smrg  version_type=sunos
273484bf8334Smrg  need_lib_prefix=no
273584bf8334Smrg  need_version=no
273684bf8334Smrg  case $host_cpu in
273784bf8334Smrg  ia64*)
273884bf8334Smrg    shrext_cmds='.so'
273984bf8334Smrg    hardcode_into_libs=yes
274084bf8334Smrg    dynamic_linker="$host_os dld.so"
274184bf8334Smrg    shlibpath_var=LD_LIBRARY_PATH
274284bf8334Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2743e4da38afSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2744e4da38afSmrg    soname_spec='$libname$release$shared_ext$major'
2745e4da38afSmrg    if test 32 = "$HPUX_IA64_MODE"; then
274684bf8334Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2747e4da38afSmrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
274884bf8334Smrg    else
274984bf8334Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2750e4da38afSmrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
275184bf8334Smrg    fi
275284bf8334Smrg    ;;
275384bf8334Smrg  hppa*64*)
275484bf8334Smrg    shrext_cmds='.sl'
275584bf8334Smrg    hardcode_into_libs=yes
275684bf8334Smrg    dynamic_linker="$host_os dld.sl"
275784bf8334Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
275884bf8334Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2759e4da38afSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2760e4da38afSmrg    soname_spec='$libname$release$shared_ext$major'
276184bf8334Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
276284bf8334Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
276384bf8334Smrg    ;;
276484bf8334Smrg  *)
276584bf8334Smrg    shrext_cmds='.sl'
276684bf8334Smrg    dynamic_linker="$host_os dld.sl"
276784bf8334Smrg    shlibpath_var=SHLIB_PATH
276884bf8334Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2769e4da38afSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2770e4da38afSmrg    soname_spec='$libname$release$shared_ext$major'
277184bf8334Smrg    ;;
277284bf8334Smrg  esac
277384bf8334Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
277484bf8334Smrg  postinstall_cmds='chmod 555 $lib'
277584bf8334Smrg  # or fails outright, so override atomically:
277684bf8334Smrg  install_override_mode=555
277784bf8334Smrg  ;;
277884bf8334Smrg
277984bf8334Smrginterix[[3-9]]*)
278084bf8334Smrg  version_type=linux # correct to gnu/linux during the next big refactor
278184bf8334Smrg  need_lib_prefix=no
278284bf8334Smrg  need_version=no
2783e4da38afSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2784e4da38afSmrg  soname_spec='$libname$release$shared_ext$major'
278584bf8334Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
278684bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
278784bf8334Smrg  shlibpath_overrides_runpath=no
278884bf8334Smrg  hardcode_into_libs=yes
278984bf8334Smrg  ;;
279084bf8334Smrg
279184bf8334Smrgirix5* | irix6* | nonstopux*)
279284bf8334Smrg  case $host_os in
279384bf8334Smrg    nonstopux*) version_type=nonstopux ;;
279484bf8334Smrg    *)
2795e4da38afSmrg	if test yes = "$lt_cv_prog_gnu_ld"; then
279684bf8334Smrg		version_type=linux # correct to gnu/linux during the next big refactor
2797a73597f9Smrg	else
279884bf8334Smrg		version_type=irix
279984bf8334Smrg	fi ;;
280084bf8334Smrg  esac
280184bf8334Smrg  need_lib_prefix=no
280284bf8334Smrg  need_version=no
2803e4da38afSmrg  soname_spec='$libname$release$shared_ext$major'
2804e4da38afSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
280584bf8334Smrg  case $host_os in
280684bf8334Smrg  irix5* | nonstopux*)
280784bf8334Smrg    libsuff= shlibsuff=
280884bf8334Smrg    ;;
280984bf8334Smrg  *)
281084bf8334Smrg    case $LD in # libtool.m4 will add one of these switches to LD
281184bf8334Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
281284bf8334Smrg      libsuff= shlibsuff= libmagic=32-bit;;
281384bf8334Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
281484bf8334Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
281584bf8334Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
281684bf8334Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
281784bf8334Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
2818b73be646Smrg    esac
281984bf8334Smrg    ;;
282084bf8334Smrg  esac
282184bf8334Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
282284bf8334Smrg  shlibpath_overrides_runpath=no
2823e4da38afSmrg  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
2824e4da38afSmrg  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
282584bf8334Smrg  hardcode_into_libs=yes
282684bf8334Smrg  ;;
2827b73be646Smrg
282884bf8334Smrg# No shared lib support for Linux oldld, aout, or coff.
282984bf8334Smrglinux*oldld* | linux*aout* | linux*coff*)
283084bf8334Smrg  dynamic_linker=no
283184bf8334Smrg  ;;
2832b73be646Smrg
2833e4da38afSmrglinux*android*)
2834e4da38afSmrg  version_type=none # Android doesn't support versioned libraries.
2835e4da38afSmrg  need_lib_prefix=no
2836e4da38afSmrg  need_version=no
2837e4da38afSmrg  library_names_spec='$libname$release$shared_ext'
2838e4da38afSmrg  soname_spec='$libname$release$shared_ext'
2839e4da38afSmrg  finish_cmds=
2840e4da38afSmrg  shlibpath_var=LD_LIBRARY_PATH
2841e4da38afSmrg  shlibpath_overrides_runpath=yes
2842e4da38afSmrg
2843e4da38afSmrg  # This implies no fast_install, which is unacceptable.
2844e4da38afSmrg  # Some rework will be needed to allow for fast_install
2845e4da38afSmrg  # before this can be enabled.
2846e4da38afSmrg  hardcode_into_libs=yes
2847e4da38afSmrg
2848e4da38afSmrg  dynamic_linker='Android linker'
2849e4da38afSmrg  # Don't embed -rpath directories since the linker doesn't support them.
2850e4da38afSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
2851e4da38afSmrg  ;;
2852e4da38afSmrg
285384bf8334Smrg# This must be glibc/ELF.
2854e4da38afSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
285584bf8334Smrg  version_type=linux # correct to gnu/linux during the next big refactor
285684bf8334Smrg  need_lib_prefix=no
285784bf8334Smrg  need_version=no
2858e4da38afSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2859e4da38afSmrg  soname_spec='$libname$release$shared_ext$major'
286084bf8334Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
286184bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
286284bf8334Smrg  shlibpath_overrides_runpath=no
2863bd3a1963Smrg
286484bf8334Smrg  # Some binutils ld are patched to set DT_RUNPATH
286584bf8334Smrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
286684bf8334Smrg    [lt_cv_shlibpath_overrides_runpath=no
286784bf8334Smrg    save_LDFLAGS=$LDFLAGS
286884bf8334Smrg    save_libdir=$libdir
286984bf8334Smrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
287084bf8334Smrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
287184bf8334Smrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
287284bf8334Smrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
287384bf8334Smrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
287484bf8334Smrg    LDFLAGS=$save_LDFLAGS
287584bf8334Smrg    libdir=$save_libdir
287684bf8334Smrg    ])
287784bf8334Smrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
2878659607e0Smrg
287984bf8334Smrg  # This implies no fast_install, which is unacceptable.
288084bf8334Smrg  # Some rework will be needed to allow for fast_install
288184bf8334Smrg  # before this can be enabled.
288284bf8334Smrg  hardcode_into_libs=yes
2883659607e0Smrg
2884e4da38afSmrg  # Add ABI-specific directories to the system library path.
2885e4da38afSmrg  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
2886e4da38afSmrg
2887e4da38afSmrg  # Ideally, we could use ldconfig to report *all* directores which are
2888e4da38afSmrg  # searched for libraries, however this is still not possible.  Aside from not
2889e4da38afSmrg  # being certain /sbin/ldconfig is available, command
2890e4da38afSmrg  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
2891e4da38afSmrg  # even though it is searched at run-time.  Try to do the best guess by
2892e4da38afSmrg  # appending ld.so.conf contents (and includes) to the search path.
289384bf8334Smrg  if test -f /etc/ld.so.conf; then
289484bf8334Smrg    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' ' '`
2895e4da38afSmrg    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
289684bf8334Smrg  fi
2897659607e0Smrg
289884bf8334Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
289984bf8334Smrg  # powerpc, because MkLinux only supported shared libraries with the
290084bf8334Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
290184bf8334Smrg  # most powerpc-linux boxes support dynamic linking these days and
290284bf8334Smrg  # people can always --disable-shared, the test was removed, and we
290384bf8334Smrg  # assume the GNU/Linux dynamic linker is in use.
290484bf8334Smrg  dynamic_linker='GNU/Linux ld.so'
290584bf8334Smrg  ;;
2906659607e0Smrg
290784bf8334Smrgnetbsd*)
290884bf8334Smrg  version_type=sunos
290984bf8334Smrg  need_lib_prefix=no
291084bf8334Smrg  need_version=no
291184bf8334Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2912e4da38afSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
291384bf8334Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
291484bf8334Smrg    dynamic_linker='NetBSD (a.out) ld.so'
291584bf8334Smrg  else
2916e4da38afSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2917e4da38afSmrg    soname_spec='$libname$release$shared_ext$major'
291884bf8334Smrg    dynamic_linker='NetBSD ld.elf_so'
291984bf8334Smrg  fi
292084bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
292184bf8334Smrg  shlibpath_overrides_runpath=yes
292284bf8334Smrg  hardcode_into_libs=yes
292384bf8334Smrg  ;;
292484bf8334Smrg
292584bf8334Smrgnewsos6)
292684bf8334Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2927e4da38afSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
292884bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
292984bf8334Smrg  shlibpath_overrides_runpath=yes
293084bf8334Smrg  ;;
293184bf8334Smrg
293284bf8334Smrg*nto* | *qnx*)
293384bf8334Smrg  version_type=qnx
293484bf8334Smrg  need_lib_prefix=no
293584bf8334Smrg  need_version=no
2936e4da38afSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2937e4da38afSmrg  soname_spec='$libname$release$shared_ext$major'
293884bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
293984bf8334Smrg  shlibpath_overrides_runpath=no
294084bf8334Smrg  hardcode_into_libs=yes
294184bf8334Smrg  dynamic_linker='ldqnx.so'
294284bf8334Smrg  ;;
294384bf8334Smrg
2944e4da38afSmrgopenbsd* | bitrig*)
294584bf8334Smrg  version_type=sunos
2946e4da38afSmrg  sys_lib_dlsearch_path_spec=/usr/lib
294784bf8334Smrg  need_lib_prefix=no
2948e4da38afSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
2949e4da38afSmrg    need_version=no
295084bf8334Smrg  else
2951e4da38afSmrg    need_version=yes
295284bf8334Smrg  fi
2953e4da38afSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2954e4da38afSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2955e4da38afSmrg  shlibpath_var=LD_LIBRARY_PATH
2956e4da38afSmrg  shlibpath_overrides_runpath=yes
295784bf8334Smrg  ;;
2958bd3a1963Smrg
295984bf8334Smrgos2*)
296084bf8334Smrg  libname_spec='$name'
2961e4da38afSmrg  version_type=windows
2962e4da38afSmrg  shrext_cmds=.dll
2963e4da38afSmrg  need_version=no
296484bf8334Smrg  need_lib_prefix=no
2965e4da38afSmrg  # OS/2 can only load a DLL with a base name of 8 characters or less.
2966e4da38afSmrg  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
2967e4da38afSmrg    v=$($ECHO $release$versuffix | tr -d .-);
2968e4da38afSmrg    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
2969e4da38afSmrg    $ECHO $n$v`$shared_ext'
2970e4da38afSmrg  library_names_spec='${libname}_dll.$libext'
297184bf8334Smrg  dynamic_linker='OS/2 ld.exe'
2972e4da38afSmrg  shlibpath_var=BEGINLIBPATH
2973e4da38afSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2974e4da38afSmrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2975e4da38afSmrg  postinstall_cmds='base_file=`basename \$file`~
2976e4da38afSmrg    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
2977e4da38afSmrg    dldir=$destdir/`dirname \$dlpath`~
2978e4da38afSmrg    test -d \$dldir || mkdir -p \$dldir~
2979e4da38afSmrg    $install_prog $dir/$dlname \$dldir/$dlname~
2980e4da38afSmrg    chmod a+x \$dldir/$dlname~
2981e4da38afSmrg    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2982e4da38afSmrg      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2983e4da38afSmrg    fi'
2984e4da38afSmrg  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
2985e4da38afSmrg    dlpath=$dir/\$dldll~
2986e4da38afSmrg    $RM \$dlpath'
298784bf8334Smrg  ;;
2988659607e0Smrg
298984bf8334Smrgosf3* | osf4* | osf5*)
299084bf8334Smrg  version_type=osf
299184bf8334Smrg  need_lib_prefix=no
299284bf8334Smrg  need_version=no
2993e4da38afSmrg  soname_spec='$libname$release$shared_ext$major'
2994e4da38afSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
299584bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
299684bf8334Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2997e4da38afSmrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
299884bf8334Smrg  ;;
2999659607e0Smrg
300084bf8334Smrgrdos*)
300184bf8334Smrg  dynamic_linker=no
300284bf8334Smrg  ;;
3003659607e0Smrg
300484bf8334Smrgsolaris*)
300584bf8334Smrg  version_type=linux # correct to gnu/linux during the next big refactor
300684bf8334Smrg  need_lib_prefix=no
300784bf8334Smrg  need_version=no
3008e4da38afSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3009e4da38afSmrg  soname_spec='$libname$release$shared_ext$major'
301084bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
301184bf8334Smrg  shlibpath_overrides_runpath=yes
301284bf8334Smrg  hardcode_into_libs=yes
301384bf8334Smrg  # ldd complains unless libraries are executable
301484bf8334Smrg  postinstall_cmds='chmod +x $lib'
301584bf8334Smrg  ;;
3016659607e0Smrg
301784bf8334Smrgsunos4*)
301884bf8334Smrg  version_type=sunos
3019e4da38afSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
302084bf8334Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
302184bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
302284bf8334Smrg  shlibpath_overrides_runpath=yes
3023e4da38afSmrg  if test yes = "$with_gnu_ld"; then
302484bf8334Smrg    need_lib_prefix=no
302584bf8334Smrg  fi
302684bf8334Smrg  need_version=yes
302784bf8334Smrg  ;;
3028a73597f9Smrg
302984bf8334Smrgsysv4 | sysv4.3*)
303084bf8334Smrg  version_type=linux # correct to gnu/linux during the next big refactor
3031e4da38afSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3032e4da38afSmrg  soname_spec='$libname$release$shared_ext$major'
303384bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
303484bf8334Smrg  case $host_vendor in
303584bf8334Smrg    sni)
303684bf8334Smrg      shlibpath_overrides_runpath=no
303784bf8334Smrg      need_lib_prefix=no
303884bf8334Smrg      runpath_var=LD_RUN_PATH
3039a73597f9Smrg      ;;
304084bf8334Smrg    siemens)
304184bf8334Smrg      need_lib_prefix=no
3042a73597f9Smrg      ;;
304384bf8334Smrg    motorola)
304484bf8334Smrg      need_lib_prefix=no
304584bf8334Smrg      need_version=no
304684bf8334Smrg      shlibpath_overrides_runpath=no
304784bf8334Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3048a73597f9Smrg      ;;
304984bf8334Smrg  esac
305084bf8334Smrg  ;;
3051b73be646Smrg
305284bf8334Smrgsysv4*MP*)
3053e4da38afSmrg  if test -d /usr/nec; then
305484bf8334Smrg    version_type=linux # correct to gnu/linux during the next big refactor
3055e4da38afSmrg    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
3056e4da38afSmrg    soname_spec='$libname$shared_ext.$major'
305784bf8334Smrg    shlibpath_var=LD_LIBRARY_PATH
305884bf8334Smrg  fi
305984bf8334Smrg  ;;
3060a73597f9Smrg
306184bf8334Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3062e4da38afSmrg  version_type=sco
306384bf8334Smrg  need_lib_prefix=no
306484bf8334Smrg  need_version=no
3065e4da38afSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
3066e4da38afSmrg  soname_spec='$libname$release$shared_ext$major'
306784bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
306884bf8334Smrg  shlibpath_overrides_runpath=yes
306984bf8334Smrg  hardcode_into_libs=yes
3070e4da38afSmrg  if test yes = "$with_gnu_ld"; then
307184bf8334Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
307284bf8334Smrg  else
307384bf8334Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
307484bf8334Smrg    case $host_os in
307584bf8334Smrg      sco3.2v5*)
307684bf8334Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3077b73be646Smrg	;;
307884bf8334Smrg    esac
307984bf8334Smrg  fi
308084bf8334Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
308184bf8334Smrg  ;;
3082fc27e79cSmrg
308384bf8334Smrgtpf*)
308484bf8334Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
308584bf8334Smrg  version_type=linux # correct to gnu/linux during the next big refactor
308684bf8334Smrg  need_lib_prefix=no
308784bf8334Smrg  need_version=no
3088e4da38afSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
308984bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
309084bf8334Smrg  shlibpath_overrides_runpath=no
309184bf8334Smrg  hardcode_into_libs=yes
309284bf8334Smrg  ;;
3093659607e0Smrg
309484bf8334Smrguts4*)
309584bf8334Smrg  version_type=linux # correct to gnu/linux during the next big refactor
3096e4da38afSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3097e4da38afSmrg  soname_spec='$libname$release$shared_ext$major'
309884bf8334Smrg  shlibpath_var=LD_LIBRARY_PATH
309984bf8334Smrg  ;;
3100a73597f9Smrg
310184bf8334Smrg*)
310284bf8334Smrg  dynamic_linker=no
310384bf8334Smrg  ;;
3104a73597f9Smrgesac
310584bf8334SmrgAC_MSG_RESULT([$dynamic_linker])
3106e4da38afSmrgtest no = "$dynamic_linker" && can_build_shared=no
3107a73597f9Smrg
310884bf8334Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3109e4da38afSmrgif test yes = "$GCC"; then
311084bf8334Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
311184bf8334Smrgfi
3112a73597f9Smrg
3113e4da38afSmrgif test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
3114e4da38afSmrg  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
311584bf8334Smrgfi
3116e4da38afSmrg
3117e4da38afSmrgif test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
3118e4da38afSmrg  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
3119a73597f9Smrgfi
3120a73597f9Smrg
3121e4da38afSmrg# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
3122e4da38afSmrgconfigure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
3123e4da38afSmrg
3124e4da38afSmrg# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
3125e4da38afSmrgfunc_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
3126e4da38afSmrg
3127e4da38afSmrg# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
3128e4da38afSmrgconfigure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
3129e4da38afSmrg
313084bf8334Smrg_LT_DECL([], [variables_saved_for_relink], [1],
313184bf8334Smrg    [Variables whose values should be saved in libtool wrapper scripts and
313284bf8334Smrg    restored at link time])
313384bf8334Smrg_LT_DECL([], [need_lib_prefix], [0],
313484bf8334Smrg    [Do we need the "lib" prefix for modules?])
313584bf8334Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
313684bf8334Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
313784bf8334Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
313884bf8334Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
313984bf8334Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
314084bf8334Smrg    [Is shlibpath searched before the hard-coded library search path?])
314184bf8334Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
314284bf8334Smrg_LT_DECL([], [library_names_spec], [1],
314384bf8334Smrg    [[List of archive names.  First name is the real one, the rest are links.
314484bf8334Smrg    The last name is the one that the linker finds with -lNAME]])
314584bf8334Smrg_LT_DECL([], [soname_spec], [1],
314684bf8334Smrg    [[The coded name of the library, if different from the real name]])
314784bf8334Smrg_LT_DECL([], [install_override_mode], [1],
314884bf8334Smrg    [Permission mode override for installation of shared libraries])
314984bf8334Smrg_LT_DECL([], [postinstall_cmds], [2],
315084bf8334Smrg    [Command to use after installation of a shared archive])
315184bf8334Smrg_LT_DECL([], [postuninstall_cmds], [2],
315284bf8334Smrg    [Command to use after uninstallation of a shared archive])
315384bf8334Smrg_LT_DECL([], [finish_cmds], [2],
315484bf8334Smrg    [Commands used to finish a libtool library installation in a directory])
315584bf8334Smrg_LT_DECL([], [finish_eval], [1],
315684bf8334Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
315784bf8334Smrg    not shown]])
315884bf8334Smrg_LT_DECL([], [hardcode_into_libs], [0],
315984bf8334Smrg    [Whether we should hardcode library paths into libraries])
316084bf8334Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
316184bf8334Smrg    [Compile-time system search path for libraries])
3162e4da38afSmrg_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
3163e4da38afSmrg    [Detected run-time system search path for libraries])
3164e4da38afSmrg_LT_DECL([], [configure_time_lt_sys_library_path], [2],
3165e4da38afSmrg    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
316684bf8334Smrg])# _LT_SYS_DYNAMIC_LINKER
3167a73597f9Smrg
3168a73597f9Smrg
316984bf8334Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
317084bf8334Smrg# --------------------------
3171e4da38afSmrg# find a file program that can recognize shared library
317284bf8334SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
317384bf8334Smrg[m4_require([_LT_DECL_EGREP])dnl
317484bf8334SmrgAC_MSG_CHECKING([for $1])
317584bf8334SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
317684bf8334Smrg[case $MAGIC_CMD in
317784bf8334Smrg[[\\/*] |  ?:[\\/]*])
3178e4da38afSmrg  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
317984bf8334Smrg  ;;
318084bf8334Smrg*)
3181e4da38afSmrg  lt_save_MAGIC_CMD=$MAGIC_CMD
3182e4da38afSmrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
318384bf8334Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
318484bf8334Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
318584bf8334Smrgdnl not every word.  This closes a longstanding sh security hole.
318684bf8334Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
318784bf8334Smrg  for ac_dir in $ac_dummy; do
3188e4da38afSmrg    IFS=$lt_save_ifs
318984bf8334Smrg    test -z "$ac_dir" && ac_dir=.
3190e4da38afSmrg    if test -f "$ac_dir/$1"; then
3191e4da38afSmrg      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
319284bf8334Smrg      if test -n "$file_magic_test_file"; then
319384bf8334Smrg	case $deplibs_check_method in
319484bf8334Smrg	"file_magic "*)
319584bf8334Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
3196e4da38afSmrg	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
319784bf8334Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
319884bf8334Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
319984bf8334Smrg	    :
320084bf8334Smrg	  else
320184bf8334Smrg	    cat <<_LT_EOF 1>&2
3202fc27e79cSmrg
320384bf8334Smrg*** Warning: the command libtool uses to detect shared libraries,
320484bf8334Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
320584bf8334Smrg*** The result is that libtool may fail to recognize shared libraries
320684bf8334Smrg*** as such.  This will affect the creation of libtool libraries that
320784bf8334Smrg*** depend on shared libraries, but programs linked with such libtool
320884bf8334Smrg*** libraries will work regardless of this problem.  Nevertheless, you
320984bf8334Smrg*** may want to report the problem to your system manager and/or to
321084bf8334Smrg*** bug-libtool@gnu.org
321184bf8334Smrg
321284bf8334Smrg_LT_EOF
321384bf8334Smrg	  fi ;;
321484bf8334Smrg	esac
321584bf8334Smrg      fi
321684bf8334Smrg      break
3217a73597f9Smrg    fi
321884bf8334Smrg  done
3219e4da38afSmrg  IFS=$lt_save_ifs
3220e4da38afSmrg  MAGIC_CMD=$lt_save_MAGIC_CMD
322184bf8334Smrg  ;;
322284bf8334Smrgesac])
3223e4da38afSmrgMAGIC_CMD=$lt_cv_path_MAGIC_CMD
322484bf8334Smrgif test -n "$MAGIC_CMD"; then
322584bf8334Smrg  AC_MSG_RESULT($MAGIC_CMD)
322684bf8334Smrgelse
322784bf8334Smrg  AC_MSG_RESULT(no)
322884bf8334Smrgfi
322984bf8334Smrg_LT_DECL([], [MAGIC_CMD], [0],
323084bf8334Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
323184bf8334Smrg])# _LT_PATH_TOOL_PREFIX
3232a73597f9Smrg
323384bf8334Smrg# Old name:
323484bf8334SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
323584bf8334Smrgdnl aclocal-1.4 backwards compatibility:
323684bf8334Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3237a73597f9Smrg
323884bf8334Smrg
323984bf8334Smrg# _LT_PATH_MAGIC
324084bf8334Smrg# --------------
3241e4da38afSmrg# find a file program that can recognize a shared library
324284bf8334Smrgm4_defun([_LT_PATH_MAGIC],
324384bf8334Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
324484bf8334Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
324584bf8334Smrg  if test -n "$ac_tool_prefix"; then
324684bf8334Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
324784bf8334Smrg  else
324884bf8334Smrg    MAGIC_CMD=:
3249b73be646Smrg  fi
325084bf8334Smrgfi
325184bf8334Smrg])# _LT_PATH_MAGIC
3252fc27e79cSmrg
3253659607e0Smrg
325484bf8334Smrg# LT_PATH_LD
325584bf8334Smrg# ----------
325684bf8334Smrg# find the pathname to the GNU or non-GNU linker
325784bf8334SmrgAC_DEFUN([LT_PATH_LD],
325884bf8334Smrg[AC_REQUIRE([AC_PROG_CC])dnl
325984bf8334SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
326084bf8334SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
326184bf8334Smrgm4_require([_LT_DECL_SED])dnl
326284bf8334Smrgm4_require([_LT_DECL_EGREP])dnl
326384bf8334Smrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3264659607e0Smrg
326584bf8334SmrgAC_ARG_WITH([gnu-ld],
326684bf8334Smrg    [AS_HELP_STRING([--with-gnu-ld],
326784bf8334Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
3268e4da38afSmrg    [test no = "$withval" || with_gnu_ld=yes],
326984bf8334Smrg    [with_gnu_ld=no])dnl
3270659607e0Smrg
327184bf8334Smrgac_prog=ld
3272e4da38afSmrgif test yes = "$GCC"; then
327384bf8334Smrg  # Check if gcc -print-prog-name=ld gives a path.
327484bf8334Smrg  AC_MSG_CHECKING([for ld used by $CC])
327584bf8334Smrg  case $host in
327684bf8334Smrg  *-*-mingw*)
3277e4da38afSmrg    # gcc leaves a trailing carriage return, which upsets mingw
327884bf8334Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
327984bf8334Smrg  *)
328084bf8334Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
328184bf8334Smrg  esac
328284bf8334Smrg  case $ac_prog in
328384bf8334Smrg    # Accept absolute paths.
328484bf8334Smrg    [[\\/]]* | ?:[[\\/]]*)
328584bf8334Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
328684bf8334Smrg      # Canonicalize the pathname of ld
328784bf8334Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
328884bf8334Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
328984bf8334Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
329084bf8334Smrg      done
3291e4da38afSmrg      test -z "$LD" && LD=$ac_prog
3292a73597f9Smrg      ;;
329384bf8334Smrg  "")
329484bf8334Smrg    # If it fails, then pretend we aren't using GCC.
329584bf8334Smrg    ac_prog=ld
329684bf8334Smrg    ;;
329784bf8334Smrg  *)
329884bf8334Smrg    # If it is relative, then search for the first ld in PATH.
329984bf8334Smrg    with_gnu_ld=unknown
330084bf8334Smrg    ;;
330184bf8334Smrg  esac
3302e4da38afSmrgelif test yes = "$with_gnu_ld"; then
330384bf8334Smrg  AC_MSG_CHECKING([for GNU ld])
330484bf8334Smrgelse
330584bf8334Smrg  AC_MSG_CHECKING([for non-GNU ld])
330684bf8334Smrgfi
330784bf8334SmrgAC_CACHE_VAL(lt_cv_path_LD,
330884bf8334Smrg[if test -z "$LD"; then
3309e4da38afSmrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
331084bf8334Smrg  for ac_dir in $PATH; do
3311e4da38afSmrg    IFS=$lt_save_ifs
331284bf8334Smrg    test -z "$ac_dir" && ac_dir=.
331384bf8334Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3314e4da38afSmrg      lt_cv_path_LD=$ac_dir/$ac_prog
331584bf8334Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
331684bf8334Smrg      # but apparently some variants of GNU ld only accept -v.
331784bf8334Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
331884bf8334Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
331984bf8334Smrg      *GNU* | *'with BFD'*)
3320e4da38afSmrg	test no != "$with_gnu_ld" && break
332184bf8334Smrg	;;
332284bf8334Smrg      *)
3323e4da38afSmrg	test yes != "$with_gnu_ld" && break
332484bf8334Smrg	;;
3325a73597f9Smrg      esac
332684bf8334Smrg    fi
332784bf8334Smrg  done
3328e4da38afSmrg  IFS=$lt_save_ifs
332984bf8334Smrgelse
3330e4da38afSmrg  lt_cv_path_LD=$LD # Let the user override the test with a path.
333184bf8334Smrgfi])
3332e4da38afSmrgLD=$lt_cv_path_LD
333384bf8334Smrgif test -n "$LD"; then
333484bf8334Smrg  AC_MSG_RESULT($LD)
333584bf8334Smrgelse
333684bf8334Smrg  AC_MSG_RESULT(no)
333784bf8334Smrgfi
333884bf8334Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
333984bf8334Smrg_LT_PATH_LD_GNU
334084bf8334SmrgAC_SUBST([LD])
3341659607e0Smrg
334284bf8334Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
334384bf8334Smrg])# LT_PATH_LD
3344659607e0Smrg
334584bf8334Smrg# Old names:
334684bf8334SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
334784bf8334SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
334884bf8334Smrgdnl aclocal-1.4 backwards compatibility:
334984bf8334Smrgdnl AC_DEFUN([AM_PROG_LD], [])
335084bf8334Smrgdnl AC_DEFUN([AC_PROG_LD], [])
3351a73597f9Smrg
3352a73597f9Smrg
335384bf8334Smrg# _LT_PATH_LD_GNU
335484bf8334Smrg#- --------------
335584bf8334Smrgm4_defun([_LT_PATH_LD_GNU],
335684bf8334Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
335784bf8334Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
335884bf8334Smrgcase `$LD -v 2>&1 </dev/null` in
335984bf8334Smrg*GNU* | *'with BFD'*)
336084bf8334Smrg  lt_cv_prog_gnu_ld=yes
336184bf8334Smrg  ;;
336284bf8334Smrg*)
336384bf8334Smrg  lt_cv_prog_gnu_ld=no
336484bf8334Smrg  ;;
336584bf8334Smrgesac])
336684bf8334Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
336784bf8334Smrg])# _LT_PATH_LD_GNU
3368a73597f9Smrg
3369a73597f9Smrg
337084bf8334Smrg# _LT_CMD_RELOAD
337184bf8334Smrg# --------------
337284bf8334Smrg# find reload flag for linker
337384bf8334Smrg#   -- PORTME Some linkers may need a different reload flag.
337484bf8334Smrgm4_defun([_LT_CMD_RELOAD],
337584bf8334Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
337684bf8334Smrg  lt_cv_ld_reload_flag,
337784bf8334Smrg  [lt_cv_ld_reload_flag='-r'])
337884bf8334Smrgreload_flag=$lt_cv_ld_reload_flag
337984bf8334Smrgcase $reload_flag in
338084bf8334Smrg"" | " "*) ;;
338184bf8334Smrg*) reload_flag=" $reload_flag" ;;
338284bf8334Smrgesac
338384bf8334Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
338484bf8334Smrgcase $host_os in
338584bf8334Smrg  cygwin* | mingw* | pw32* | cegcc*)
3386e4da38afSmrg    if test yes != "$GCC"; then
338784bf8334Smrg      reload_cmds=false
338884bf8334Smrg    fi
338984bf8334Smrg    ;;
339084bf8334Smrg  darwin*)
3391e4da38afSmrg    if test yes = "$GCC"; then
3392e4da38afSmrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
339384bf8334Smrg    else
339484bf8334Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
339584bf8334Smrg    fi
339684bf8334Smrg    ;;
339784bf8334Smrgesac
339884bf8334Smrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
339984bf8334Smrg_LT_TAGDECL([], [reload_cmds], [2])dnl
340084bf8334Smrg])# _LT_CMD_RELOAD
3401b73be646Smrg
3402fc27e79cSmrg
3403e4da38afSmrg# _LT_PATH_DD
3404e4da38afSmrg# -----------
3405e4da38afSmrg# find a working dd
3406e4da38afSmrgm4_defun([_LT_PATH_DD],
3407e4da38afSmrg[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
3408e4da38afSmrg[printf 0123456789abcdef0123456789abcdef >conftest.i
3409e4da38afSmrgcat conftest.i conftest.i >conftest2.i
3410e4da38afSmrg: ${lt_DD:=$DD}
3411e4da38afSmrgAC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
3412e4da38afSmrg[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3413e4da38afSmrg  cmp -s conftest.i conftest.out \
3414e4da38afSmrg  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
3415e4da38afSmrgfi])
3416e4da38afSmrgrm -f conftest.i conftest2.i conftest.out])
3417e4da38afSmrg])# _LT_PATH_DD
3418e4da38afSmrg
3419e4da38afSmrg
3420e4da38afSmrg# _LT_CMD_TRUNCATE
3421e4da38afSmrg# ----------------
3422e4da38afSmrg# find command to truncate a binary pipe
3423e4da38afSmrgm4_defun([_LT_CMD_TRUNCATE],
3424e4da38afSmrg[m4_require([_LT_PATH_DD])
3425e4da38afSmrgAC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
3426e4da38afSmrg[printf 0123456789abcdef0123456789abcdef >conftest.i
3427e4da38afSmrgcat conftest.i conftest.i >conftest2.i
3428e4da38afSmrglt_cv_truncate_bin=
3429e4da38afSmrgif "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3430e4da38afSmrg  cmp -s conftest.i conftest.out \
3431e4da38afSmrg  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
3432e4da38afSmrgfi
3433e4da38afSmrgrm -f conftest.i conftest2.i conftest.out
3434e4da38afSmrgtest -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
3435e4da38afSmrg_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
3436e4da38afSmrg  [Command to truncate a binary pipe])
3437e4da38afSmrg])# _LT_CMD_TRUNCATE
3438e4da38afSmrg
3439e4da38afSmrg
344084bf8334Smrg# _LT_CHECK_MAGIC_METHOD
344184bf8334Smrg# ----------------------
344284bf8334Smrg# how to check for library dependencies
344384bf8334Smrg#  -- PORTME fill in with the dynamic library characteristics
344484bf8334Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
344584bf8334Smrg[m4_require([_LT_DECL_EGREP])
344684bf8334Smrgm4_require([_LT_DECL_OBJDUMP])
344784bf8334SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
344884bf8334Smrglt_cv_deplibs_check_method,
344984bf8334Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
345084bf8334Smrglt_cv_file_magic_test_file=
345184bf8334Smrglt_cv_deplibs_check_method='unknown'
345284bf8334Smrg# Need to set the preceding variable on all platforms that support
345384bf8334Smrg# interlibrary dependencies.
345484bf8334Smrg# 'none' -- dependencies not supported.
3455e4da38afSmrg# 'unknown' -- same as none, but documents that we really don't know.
345684bf8334Smrg# 'pass_all' -- all dependencies passed with no checks.
345784bf8334Smrg# 'test_compile' -- check by making test program.
345884bf8334Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
3459e4da38afSmrg# that responds to the $file_magic_cmd with a given extended regex.
3460e4da38afSmrg# If you have 'file' or equivalent on your system and you're not sure
3461e4da38afSmrg# whether 'pass_all' will *always* work, you probably want this one.
3462fc27e79cSmrg
346384bf8334Smrgcase $host_os in
346484bf8334Smrgaix[[4-9]]*)
346584bf8334Smrg  lt_cv_deplibs_check_method=pass_all
346684bf8334Smrg  ;;
3467659607e0Smrg
346884bf8334Smrgbeos*)
346984bf8334Smrg  lt_cv_deplibs_check_method=pass_all
347084bf8334Smrg  ;;
3471b73be646Smrg
347284bf8334Smrgbsdi[[45]]*)
347384bf8334Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
347484bf8334Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
347584bf8334Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
347684bf8334Smrg  ;;
3477659607e0Smrg
347884bf8334Smrgcygwin*)
347984bf8334Smrg  # func_win32_libid is a shell function defined in ltmain.sh
348084bf8334Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
348184bf8334Smrg  lt_cv_file_magic_cmd='func_win32_libid'
348284bf8334Smrg  ;;
3483659607e0Smrg
348484bf8334Smrgmingw* | pw32*)
348584bf8334Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
348684bf8334Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
348784bf8334Smrg  # unless we find 'file', for example because we are cross-compiling.
3488e4da38afSmrg  if ( file / ) >/dev/null 2>&1; then
348984bf8334Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
349084bf8334Smrg    lt_cv_file_magic_cmd='func_win32_libid'
349184bf8334Smrg  else
349284bf8334Smrg    # Keep this pattern in sync with the one in func_win32_libid.
349384bf8334Smrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
349484bf8334Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
349584bf8334Smrg  fi
349684bf8334Smrg  ;;
3497fc27e79cSmrg
349884bf8334Smrgcegcc*)
349984bf8334Smrg  # use the weaker test based on 'objdump'. See mingw*.
350084bf8334Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
350184bf8334Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
350284bf8334Smrg  ;;
3503a73597f9Smrg
350484bf8334Smrgdarwin* | rhapsody*)
350584bf8334Smrg  lt_cv_deplibs_check_method=pass_all
350684bf8334Smrg  ;;
3507a73597f9Smrg
350884bf8334Smrgfreebsd* | dragonfly*)
350984bf8334Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
351084bf8334Smrg    case $host_cpu in
351184bf8334Smrg    i*86 )
351284bf8334Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
351384bf8334Smrg      # Let's accept both of them until this is cleared up.
351484bf8334Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
351584bf8334Smrg      lt_cv_file_magic_cmd=/usr/bin/file
351684bf8334Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3517a73597f9Smrg      ;;
3518a73597f9Smrg    esac
3519a73597f9Smrg  else
352084bf8334Smrg    lt_cv_deplibs_check_method=pass_all
352184bf8334Smrg  fi
352284bf8334Smrg  ;;
3523659607e0Smrg
352484bf8334Smrghaiku*)
352584bf8334Smrg  lt_cv_deplibs_check_method=pass_all
352684bf8334Smrg  ;;
35276aab59a7Smrg
352884bf8334Smrghpux10.20* | hpux11*)
352984bf8334Smrg  lt_cv_file_magic_cmd=/usr/bin/file
353084bf8334Smrg  case $host_cpu in
353184bf8334Smrg  ia64*)
353284bf8334Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
353384bf8334Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
353484bf8334Smrg    ;;
353584bf8334Smrg  hppa*64*)
353684bf8334Smrg    [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]']
353784bf8334Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
353884bf8334Smrg    ;;
353984bf8334Smrg  *)
354084bf8334Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
354184bf8334Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
354284bf8334Smrg    ;;
354384bf8334Smrg  esac
354484bf8334Smrg  ;;
35456aab59a7Smrg
354684bf8334Smrginterix[[3-9]]*)
354784bf8334Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
354884bf8334Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
354984bf8334Smrg  ;;
3550b73be646Smrg
355184bf8334Smrgirix5* | irix6* | nonstopux*)
355284bf8334Smrg  case $LD in
355384bf8334Smrg  *-32|*"-32 ") libmagic=32-bit;;
355484bf8334Smrg  *-n32|*"-n32 ") libmagic=N32;;
355584bf8334Smrg  *-64|*"-64 ") libmagic=64-bit;;
355684bf8334Smrg  *) libmagic=never-match;;
355784bf8334Smrg  esac
355884bf8334Smrg  lt_cv_deplibs_check_method=pass_all
355984bf8334Smrg  ;;
3560fc27e79cSmrg
356184bf8334Smrg# This must be glibc/ELF.
3562e4da38afSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
356384bf8334Smrg  lt_cv_deplibs_check_method=pass_all
356484bf8334Smrg  ;;
3565fc27e79cSmrg
356684bf8334Smrgnetbsd*)
356784bf8334Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
356884bf8334Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
356984bf8334Smrg  else
357084bf8334Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
357184bf8334Smrg  fi
357284bf8334Smrg  ;;
3573a73597f9Smrg
357484bf8334Smrgnewos6*)
357584bf8334Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
357684bf8334Smrg  lt_cv_file_magic_cmd=/usr/bin/file
357784bf8334Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
357884bf8334Smrg  ;;
3579659607e0Smrg
358084bf8334Smrg*nto* | *qnx*)
358184bf8334Smrg  lt_cv_deplibs_check_method=pass_all
358284bf8334Smrg  ;;
3583659607e0Smrg
3584e4da38afSmrgopenbsd* | bitrig*)
3585e4da38afSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
358684bf8334Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
358784bf8334Smrg  else
358884bf8334Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
358984bf8334Smrg  fi
359084bf8334Smrg  ;;
3591659607e0Smrg
359284bf8334Smrgosf3* | osf4* | osf5*)
359384bf8334Smrg  lt_cv_deplibs_check_method=pass_all
359484bf8334Smrg  ;;
3595659607e0Smrg
359684bf8334Smrgrdos*)
359784bf8334Smrg  lt_cv_deplibs_check_method=pass_all
359884bf8334Smrg  ;;
3599659607e0Smrg
360084bf8334Smrgsolaris*)
360184bf8334Smrg  lt_cv_deplibs_check_method=pass_all
360284bf8334Smrg  ;;
3603659607e0Smrg
360484bf8334Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
360584bf8334Smrg  lt_cv_deplibs_check_method=pass_all
360684bf8334Smrg  ;;
3607b73be646Smrg
360884bf8334Smrgsysv4 | sysv4.3*)
360984bf8334Smrg  case $host_vendor in
361084bf8334Smrg  motorola)
361184bf8334Smrg    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]]'
361284bf8334Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
361384bf8334Smrg    ;;
361484bf8334Smrg  ncr)
361584bf8334Smrg    lt_cv_deplibs_check_method=pass_all
361684bf8334Smrg    ;;
361784bf8334Smrg  sequent)
361884bf8334Smrg    lt_cv_file_magic_cmd='/bin/file'
361984bf8334Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
362084bf8334Smrg    ;;
362184bf8334Smrg  sni)
362284bf8334Smrg    lt_cv_file_magic_cmd='/bin/file'
362384bf8334Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
362484bf8334Smrg    lt_cv_file_magic_test_file=/lib/libc.so
362584bf8334Smrg    ;;
362684bf8334Smrg  siemens)
362784bf8334Smrg    lt_cv_deplibs_check_method=pass_all
362884bf8334Smrg    ;;
362984bf8334Smrg  pc)
363084bf8334Smrg    lt_cv_deplibs_check_method=pass_all
363184bf8334Smrg    ;;
363284bf8334Smrg  esac
363384bf8334Smrg  ;;
3634b73be646Smrg
363584bf8334Smrgtpf*)
363684bf8334Smrg  lt_cv_deplibs_check_method=pass_all
363784bf8334Smrg  ;;
3638e4da38afSmrgos2*)
3639e4da38afSmrg  lt_cv_deplibs_check_method=pass_all
3640e4da38afSmrg  ;;
364184bf8334Smrgesac
364284bf8334Smrg])
3643bd3a1963Smrg
364484bf8334Smrgfile_magic_glob=
364584bf8334Smrgwant_nocaseglob=no
364684bf8334Smrgif test "$build" = "$host"; then
364784bf8334Smrg  case $host_os in
364884bf8334Smrg  mingw* | pw32*)
364984bf8334Smrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
365084bf8334Smrg      want_nocaseglob=yes
365184bf8334Smrg    else
365284bf8334Smrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
365384bf8334Smrg    fi
365484bf8334Smrg    ;;
365584bf8334Smrg  esac
365684bf8334Smrgfi
3657fc27e79cSmrg
365884bf8334Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
365984bf8334Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
366084bf8334Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
366184bf8334Smrg
366284bf8334Smrg_LT_DECL([], [deplibs_check_method], [1],
366384bf8334Smrg    [Method to check whether dependent libraries are shared objects])
366484bf8334Smrg_LT_DECL([], [file_magic_cmd], [1],
366584bf8334Smrg    [Command to use when deplibs_check_method = "file_magic"])
366684bf8334Smrg_LT_DECL([], [file_magic_glob], [1],
366784bf8334Smrg    [How to find potential files when deplibs_check_method = "file_magic"])
366884bf8334Smrg_LT_DECL([], [want_nocaseglob], [1],
366984bf8334Smrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
367084bf8334Smrg])# _LT_CHECK_MAGIC_METHOD
367184bf8334Smrg
367284bf8334Smrg
367384bf8334Smrg# LT_PATH_NM
367484bf8334Smrg# ----------
367584bf8334Smrg# find the pathname to a BSD- or MS-compatible name lister
367684bf8334SmrgAC_DEFUN([LT_PATH_NM],
367784bf8334Smrg[AC_REQUIRE([AC_PROG_CC])dnl
367884bf8334SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
367984bf8334Smrg[if test -n "$NM"; then
368084bf8334Smrg  # Let the user override the test.
3681e4da38afSmrg  lt_cv_path_NM=$NM
368284bf8334Smrgelse
3683e4da38afSmrg  lt_nm_to_check=${ac_tool_prefix}nm
368484bf8334Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
368584bf8334Smrg    lt_nm_to_check="$lt_nm_to_check nm"
368684bf8334Smrg  fi
368784bf8334Smrg  for lt_tmp_nm in $lt_nm_to_check; do
3688e4da38afSmrg    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
368984bf8334Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3690e4da38afSmrg      IFS=$lt_save_ifs
369184bf8334Smrg      test -z "$ac_dir" && ac_dir=.
3692e4da38afSmrg      tmp_nm=$ac_dir/$lt_tmp_nm
3693e4da38afSmrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
369484bf8334Smrg	# Check to see if the nm accepts a BSD-compat flag.
3695e4da38afSmrg	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
369684bf8334Smrg	#   nm: unknown option "B" ignored
369784bf8334Smrg	# Tru64's nm complains that /dev/null is an invalid object file
3698e4da38afSmrg	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
3699e4da38afSmrg	case $build_os in
3700e4da38afSmrg	mingw*) lt_bad_file=conftest.nm/nofile ;;
3701e4da38afSmrg	*) lt_bad_file=/dev/null ;;
3702e4da38afSmrg	esac
3703e4da38afSmrg	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
3704e4da38afSmrg	*$lt_bad_file* | *'Invalid file or object type'*)
370584bf8334Smrg	  lt_cv_path_NM="$tmp_nm -B"
3706e4da38afSmrg	  break 2
3707a73597f9Smrg	  ;;
3708a73597f9Smrg	*)
370984bf8334Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
371084bf8334Smrg	  */dev/null*)
371184bf8334Smrg	    lt_cv_path_NM="$tmp_nm -p"
3712e4da38afSmrg	    break 2
371384bf8334Smrg	    ;;
371484bf8334Smrg	  *)
371584bf8334Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
371684bf8334Smrg	    continue # so that we can try to find one that supports BSD flags
371784bf8334Smrg	    ;;
371884bf8334Smrg	  esac
3719a73597f9Smrg	  ;;
3720a73597f9Smrg	esac
3721a73597f9Smrg      fi
372284bf8334Smrg    done
3723e4da38afSmrg    IFS=$lt_save_ifs
372484bf8334Smrg  done
372584bf8334Smrg  : ${lt_cv_path_NM=no}
372684bf8334Smrgfi])
3727e4da38afSmrgif test no != "$lt_cv_path_NM"; then
3728e4da38afSmrg  NM=$lt_cv_path_NM
372984bf8334Smrgelse
373084bf8334Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
373184bf8334Smrg  if test -n "$DUMPBIN"; then :
373284bf8334Smrg    # Let the user override the test.
373384bf8334Smrg  else
373484bf8334Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
3735e4da38afSmrg    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
373684bf8334Smrg    *COFF*)
3737e4da38afSmrg      DUMPBIN="$DUMPBIN -symbols -headers"
3738a73597f9Smrg      ;;
373984bf8334Smrg    *)
374084bf8334Smrg      DUMPBIN=:
3741a73597f9Smrg      ;;
374284bf8334Smrg    esac
374384bf8334Smrg  fi
374484bf8334Smrg  AC_SUBST([DUMPBIN])
3745e4da38afSmrg  if test : != "$DUMPBIN"; then
3746e4da38afSmrg    NM=$DUMPBIN
374784bf8334Smrg  fi
374884bf8334Smrgfi
374984bf8334Smrgtest -z "$NM" && NM=nm
375084bf8334SmrgAC_SUBST([NM])
375184bf8334Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3752659607e0Smrg
375384bf8334SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
375484bf8334Smrg  [lt_cv_nm_interface="BSD nm"
375584bf8334Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
375684bf8334Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
375784bf8334Smrg  (eval "$ac_compile" 2>conftest.err)
375884bf8334Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
375984bf8334Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
376084bf8334Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
376184bf8334Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
376284bf8334Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
376384bf8334Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
376484bf8334Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
376584bf8334Smrg    lt_cv_nm_interface="MS dumpbin"
376684bf8334Smrg  fi
376784bf8334Smrg  rm -f conftest*])
376884bf8334Smrg])# LT_PATH_NM
3769659607e0Smrg
377084bf8334Smrg# Old names:
377184bf8334SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
377284bf8334SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
377384bf8334Smrgdnl aclocal-1.4 backwards compatibility:
377484bf8334Smrgdnl AC_DEFUN([AM_PROG_NM], [])
377584bf8334Smrgdnl AC_DEFUN([AC_PROG_NM], [])
3776659607e0Smrg
377784bf8334Smrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
377884bf8334Smrg# --------------------------------
377984bf8334Smrg# how to determine the name of the shared library
378084bf8334Smrg# associated with a specific link library.
378184bf8334Smrg#  -- PORTME fill in with the dynamic library characteristics
378284bf8334Smrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
378384bf8334Smrg[m4_require([_LT_DECL_EGREP])
378484bf8334Smrgm4_require([_LT_DECL_OBJDUMP])
378584bf8334Smrgm4_require([_LT_DECL_DLLTOOL])
378684bf8334SmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
378784bf8334Smrglt_cv_sharedlib_from_linklib_cmd,
378884bf8334Smrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
3789659607e0Smrg
379084bf8334Smrgcase $host_os in
379184bf8334Smrgcygwin* | mingw* | pw32* | cegcc*)
3792e4da38afSmrg  # two different shell functions defined in ltmain.sh;
3793e4da38afSmrg  # decide which one to use based on capabilities of $DLLTOOL
379484bf8334Smrg  case `$DLLTOOL --help 2>&1` in
379584bf8334Smrg  *--identify-strict*)
379684bf8334Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
379784bf8334Smrg    ;;
379884bf8334Smrg  *)
379984bf8334Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
380084bf8334Smrg    ;;
380184bf8334Smrg  esac
380284bf8334Smrg  ;;
380384bf8334Smrg*)
380484bf8334Smrg  # fallback: assume linklib IS sharedlib
3805e4da38afSmrg  lt_cv_sharedlib_from_linklib_cmd=$ECHO
380684bf8334Smrg  ;;
380784bf8334Smrgesac
380884bf8334Smrg])
380984bf8334Smrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
381084bf8334Smrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3811659607e0Smrg
381284bf8334Smrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
381384bf8334Smrg    [Command to associate shared and link libraries])
381484bf8334Smrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3815fc27e79cSmrg
3816fc27e79cSmrg
381784bf8334Smrg# _LT_PATH_MANIFEST_TOOL
381884bf8334Smrg# ----------------------
381984bf8334Smrg# locate the manifest tool
382084bf8334Smrgm4_defun([_LT_PATH_MANIFEST_TOOL],
382184bf8334Smrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
382284bf8334Smrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
382384bf8334SmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
382484bf8334Smrg  [lt_cv_path_mainfest_tool=no
382584bf8334Smrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
382684bf8334Smrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
382784bf8334Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
382884bf8334Smrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
382984bf8334Smrg    lt_cv_path_mainfest_tool=yes
383084bf8334Smrg  fi
383184bf8334Smrg  rm -f conftest*])
3832e4da38afSmrgif test yes != "$lt_cv_path_mainfest_tool"; then
383384bf8334Smrg  MANIFEST_TOOL=:
383484bf8334Smrgfi
383584bf8334Smrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
383684bf8334Smrg])# _LT_PATH_MANIFEST_TOOL
3837fc27e79cSmrg
3838b73be646Smrg
3839e4da38afSmrg# _LT_DLL_DEF_P([FILE])
3840e4da38afSmrg# ---------------------
3841e4da38afSmrg# True iff FILE is a Windows DLL '.def' file.
3842e4da38afSmrg# Keep in sync with func_dll_def_p in the libtool script
3843e4da38afSmrgAC_DEFUN([_LT_DLL_DEF_P],
3844e4da38afSmrg[dnl
3845e4da38afSmrg  test DEF = "`$SED -n dnl
3846e4da38afSmrg    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
3847e4da38afSmrg    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
3848e4da38afSmrg    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
3849e4da38afSmrg    -e q dnl                          Only consider the first "real" line
3850e4da38afSmrg    $1`" dnl
3851e4da38afSmrg])# _LT_DLL_DEF_P
3852e4da38afSmrg
3853e4da38afSmrg
385484bf8334Smrg# LT_LIB_M
385584bf8334Smrg# --------
385684bf8334Smrg# check for math library
385784bf8334SmrgAC_DEFUN([LT_LIB_M],
385884bf8334Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
385984bf8334SmrgLIBM=
386084bf8334Smrgcase $host in
386184bf8334Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
386284bf8334Smrg  # These system don't have libm, or don't need it
386384bf8334Smrg  ;;
386484bf8334Smrg*-ncr-sysv4.3*)
3865e4da38afSmrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
386684bf8334Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
386784bf8334Smrg  ;;
386884bf8334Smrg*)
3869e4da38afSmrg  AC_CHECK_LIB(m, cos, LIBM=-lm)
387084bf8334Smrg  ;;
387184bf8334Smrgesac
387284bf8334SmrgAC_SUBST([LIBM])
387384bf8334Smrg])# LT_LIB_M
3874bd3a1963Smrg
387584bf8334Smrg# Old name:
387684bf8334SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
387784bf8334Smrgdnl aclocal-1.4 backwards compatibility:
387884bf8334Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3879bd3a1963Smrg
3880b73be646Smrg
388184bf8334Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
388284bf8334Smrg# -------------------------------
388384bf8334Smrgm4_defun([_LT_COMPILER_NO_RTTI],
388484bf8334Smrg[m4_require([_LT_TAG_COMPILER])dnl
3885b73be646Smrg
388684bf8334Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3887b73be646Smrg
3888e4da38afSmrgif test yes = "$GCC"; then
388984bf8334Smrg  case $cc_basename in
389084bf8334Smrg  nvcc*)
389184bf8334Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
389284bf8334Smrg  *)
389384bf8334Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
389484bf8334Smrg  esac
3895a73597f9Smrg
389684bf8334Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
389784bf8334Smrg    lt_cv_prog_compiler_rtti_exceptions,
389884bf8334Smrg    [-fno-rtti -fno-exceptions], [],
389984bf8334Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
390084bf8334Smrgfi
390184bf8334Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
390284bf8334Smrg	[Compiler flag to turn off builtin functions])
390384bf8334Smrg])# _LT_COMPILER_NO_RTTI
3904a73597f9Smrg
3905a73597f9Smrg
390684bf8334Smrg# _LT_CMD_GLOBAL_SYMBOLS
390784bf8334Smrg# ----------------------
390884bf8334Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
390984bf8334Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
391084bf8334SmrgAC_REQUIRE([AC_PROG_CC])dnl
391184bf8334SmrgAC_REQUIRE([AC_PROG_AWK])dnl
391284bf8334SmrgAC_REQUIRE([LT_PATH_NM])dnl
391384bf8334SmrgAC_REQUIRE([LT_PATH_LD])dnl
391484bf8334Smrgm4_require([_LT_DECL_SED])dnl
391584bf8334Smrgm4_require([_LT_DECL_EGREP])dnl
391684bf8334Smrgm4_require([_LT_TAG_COMPILER])dnl
3917a73597f9Smrg
391884bf8334Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
391984bf8334SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
392084bf8334SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
392184bf8334Smrg[
392284bf8334Smrg# These are sane defaults that work on at least a few old systems.
392384bf8334Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3924b73be646Smrg
392584bf8334Smrg# Character class describing NM global symbol codes.
392684bf8334Smrgsymcode='[[BCDEGRST]]'
3927b73be646Smrg
392884bf8334Smrg# Regexp to match symbols that can be accessed directly from C.
392984bf8334Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3930b73be646Smrg
393184bf8334Smrg# Define system-specific variables.
393284bf8334Smrgcase $host_os in
393384bf8334Smrgaix*)
393484bf8334Smrg  symcode='[[BCDT]]'
393584bf8334Smrg  ;;
393684bf8334Smrgcygwin* | mingw* | pw32* | cegcc*)
393784bf8334Smrg  symcode='[[ABCDGISTW]]'
393884bf8334Smrg  ;;
393984bf8334Smrghpux*)
3940e4da38afSmrg  if test ia64 = "$host_cpu"; then
394184bf8334Smrg    symcode='[[ABCDEGRST]]'
394284bf8334Smrg  fi
394384bf8334Smrg  ;;
394484bf8334Smrgirix* | nonstopux*)
394584bf8334Smrg  symcode='[[BCDEGRST]]'
394684bf8334Smrg  ;;
394784bf8334Smrgosf*)
394884bf8334Smrg  symcode='[[BCDEGQRST]]'
394984bf8334Smrg  ;;
395084bf8334Smrgsolaris*)
395184bf8334Smrg  symcode='[[BDRT]]'
395284bf8334Smrg  ;;
395384bf8334Smrgsco3.2v5*)
395484bf8334Smrg  symcode='[[DT]]'
395584bf8334Smrg  ;;
395684bf8334Smrgsysv4.2uw2*)
395784bf8334Smrg  symcode='[[DT]]'
395884bf8334Smrg  ;;
395984bf8334Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
396084bf8334Smrg  symcode='[[ABDT]]'
396184bf8334Smrg  ;;
396284bf8334Smrgsysv4)
396384bf8334Smrg  symcode='[[DFNSTU]]'
396484bf8334Smrg  ;;
396584bf8334Smrgesac
3966bd3a1963Smrg
396784bf8334Smrg# If we're using GNU nm, then use its standard symbol codes.
396884bf8334Smrgcase `$NM -V 2>&1` in
396984bf8334Smrg*GNU* | *'with BFD'*)
397084bf8334Smrg  symcode='[[ABCDGIRSTW]]' ;;
397184bf8334Smrgesac
3972a73597f9Smrg
3973e4da38afSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
3974e4da38afSmrg  # Gets list of data symbols to import.
3975e4da38afSmrg  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
3976e4da38afSmrg  # Adjust the below global symbol transforms to fixup imported variables.
3977e4da38afSmrg  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
3978e4da38afSmrg  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
3979e4da38afSmrg  lt_c_name_lib_hook="\
3980e4da38afSmrg  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
3981e4da38afSmrg  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
3982e4da38afSmrgelse
3983e4da38afSmrg  # Disable hooks by default.
3984e4da38afSmrg  lt_cv_sys_global_symbol_to_import=
3985e4da38afSmrg  lt_cdecl_hook=
3986e4da38afSmrg  lt_c_name_hook=
3987e4da38afSmrg  lt_c_name_lib_hook=
3988e4da38afSmrgfi
3989e4da38afSmrg
399084bf8334Smrg# Transform an extracted symbol line into a proper C declaration.
399184bf8334Smrg# Some systems (esp. on ia64) link data and code symbols differently,
399284bf8334Smrg# so use this general approach.
3993e4da38afSmrglt_cv_sys_global_symbol_to_cdecl="sed -n"\
3994e4da38afSmrg$lt_cdecl_hook\
3995e4da38afSmrg" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
3996e4da38afSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
3997a73597f9Smrg
399884bf8334Smrg# Transform an extracted symbol line into symbol name and symbol address
3999e4da38afSmrglt_cv_sys_global_symbol_to_c_name_address="sed -n"\
4000e4da38afSmrg$lt_c_name_hook\
4001e4da38afSmrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
4002e4da38afSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
4003e4da38afSmrg
4004e4da38afSmrg# Transform an extracted symbol line into symbol name with lib prefix and
4005e4da38afSmrg# symbol address.
4006e4da38afSmrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
4007e4da38afSmrg$lt_c_name_lib_hook\
4008e4da38afSmrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
4009e4da38afSmrg" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
4010e4da38afSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
401184bf8334Smrg
401284bf8334Smrg# Handle CRLF in mingw tool chain
401384bf8334Smrgopt_cr=
401484bf8334Smrgcase $build_os in
401584bf8334Smrgmingw*)
401684bf8334Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4017bd3a1963Smrg  ;;
4018bd3a1963Smrgesac
4019bd3a1963Smrg
402084bf8334Smrg# Try without a prefix underscore, then with it.
402184bf8334Smrgfor ac_symprfx in "" "_"; do
4022b73be646Smrg
402384bf8334Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
402484bf8334Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
4025b73be646Smrg
402684bf8334Smrg  # Write the raw and C identifiers.
402784bf8334Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4028e4da38afSmrg    # Fake it for dumpbin and say T for any non-static function,
4029e4da38afSmrg    # D for any global variable and I for any imported variable.
403084bf8334Smrg    # Also find C++ and __fastcall symbols from MSVC++,
403184bf8334Smrg    # which start with @ or ?.
403284bf8334Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
403384bf8334Smrg"     {last_section=section; section=\$ 3};"\
403484bf8334Smrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
403584bf8334Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
4036e4da38afSmrg"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
4037e4da38afSmrg"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
4038e4da38afSmrg"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
403984bf8334Smrg"     \$ 0!~/External *\|/{next};"\
404084bf8334Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
404184bf8334Smrg"     {if(hide[section]) next};"\
4042e4da38afSmrg"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
4043e4da38afSmrg"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
4044e4da38afSmrg"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
4045e4da38afSmrg"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
404684bf8334Smrg"     ' prfx=^$ac_symprfx]"
404784bf8334Smrg  else
404884bf8334Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
404984bf8334Smrg  fi
405084bf8334Smrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4051659607e0Smrg
405284bf8334Smrg  # Check to see that the pipe works correctly.
405384bf8334Smrg  pipe_works=no
4054659607e0Smrg
405584bf8334Smrg  rm -f conftest*
405684bf8334Smrg  cat > conftest.$ac_ext <<_LT_EOF
405784bf8334Smrg#ifdef __cplusplus
405884bf8334Smrgextern "C" {
405984bf8334Smrg#endif
406084bf8334Smrgchar nm_test_var;
406184bf8334Smrgvoid nm_test_func(void);
406284bf8334Smrgvoid nm_test_func(void){}
406384bf8334Smrg#ifdef __cplusplus
406484bf8334Smrg}
406584bf8334Smrg#endif
406684bf8334Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
406784bf8334Smrg_LT_EOF
4068659607e0Smrg
406984bf8334Smrg  if AC_TRY_EVAL(ac_compile); then
407084bf8334Smrg    # Now try to grab the symbols.
407184bf8334Smrg    nlist=conftest.nm
407284bf8334Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
407384bf8334Smrg      # Try sorting and uniquifying the output.
407484bf8334Smrg      if sort "$nlist" | uniq > "$nlist"T; then
407584bf8334Smrg	mv -f "$nlist"T "$nlist"
407684bf8334Smrg      else
407784bf8334Smrg	rm -f "$nlist"T
407884bf8334Smrg      fi
4079659607e0Smrg
408084bf8334Smrg      # Make sure that we snagged all the symbols we need.
408184bf8334Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
408284bf8334Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
408384bf8334Smrg	  cat <<_LT_EOF > conftest.$ac_ext
408484bf8334Smrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
4085e4da38afSmrg#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
4086e4da38afSmrg/* DATA imports from DLLs on WIN32 can't be const, because runtime
408784bf8334Smrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
408884bf8334Smrg# define LT@&t@_DLSYM_CONST
4089e4da38afSmrg#elif defined __osf__
409084bf8334Smrg/* This system does not cope well with relocations in const data.  */
409184bf8334Smrg# define LT@&t@_DLSYM_CONST
409284bf8334Smrg#else
409384bf8334Smrg# define LT@&t@_DLSYM_CONST const
409484bf8334Smrg#endif
4095659607e0Smrg
409684bf8334Smrg#ifdef __cplusplus
409784bf8334Smrgextern "C" {
409884bf8334Smrg#endif
4099659607e0Smrg
410084bf8334Smrg_LT_EOF
410184bf8334Smrg	  # Now generate the symbol file.
410284bf8334Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4103659607e0Smrg
410484bf8334Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
4105fc27e79cSmrg
410684bf8334Smrg/* The mapping between symbol names and symbols.  */
410784bf8334SmrgLT@&t@_DLSYM_CONST struct {
410884bf8334Smrg  const char *name;
410984bf8334Smrg  void       *address;
411084bf8334Smrg}
411184bf8334Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
411284bf8334Smrg{
411384bf8334Smrg  { "@PROGRAM@", (void *) 0 },
411484bf8334Smrg_LT_EOF
4115e4da38afSmrg	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
411684bf8334Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
411784bf8334Smrg  {0, (void *) 0}
411884bf8334Smrg};
4119659607e0Smrg
412084bf8334Smrg/* This works around a problem in FreeBSD linker */
412184bf8334Smrg#ifdef FREEBSD_WORKAROUND
412284bf8334Smrgstatic const void *lt_preloaded_setup() {
412384bf8334Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
412484bf8334Smrg}
412584bf8334Smrg#endif
4126659607e0Smrg
412784bf8334Smrg#ifdef __cplusplus
412884bf8334Smrg}
412984bf8334Smrg#endif
413084bf8334Smrg_LT_EOF
413184bf8334Smrg	  # Now try linking the two files.
413284bf8334Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
413384bf8334Smrg	  lt_globsym_save_LIBS=$LIBS
413484bf8334Smrg	  lt_globsym_save_CFLAGS=$CFLAGS
4135e4da38afSmrg	  LIBS=conftstm.$ac_objext
413684bf8334Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4137e4da38afSmrg	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
413884bf8334Smrg	    pipe_works=yes
413984bf8334Smrg	  fi
414084bf8334Smrg	  LIBS=$lt_globsym_save_LIBS
414184bf8334Smrg	  CFLAGS=$lt_globsym_save_CFLAGS
414284bf8334Smrg	else
414384bf8334Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
414484bf8334Smrg	fi
414584bf8334Smrg      else
414684bf8334Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
414784bf8334Smrg      fi
414884bf8334Smrg    else
414984bf8334Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4150a73597f9Smrg    fi
415184bf8334Smrg  else
415284bf8334Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
415384bf8334Smrg    cat conftest.$ac_ext >&5
415484bf8334Smrg  fi
415584bf8334Smrg  rm -rf conftest* conftst*
415684bf8334Smrg
415784bf8334Smrg  # Do not use the global_symbol_pipe unless it works.
4158e4da38afSmrg  if test yes = "$pipe_works"; then
415984bf8334Smrg    break
416084bf8334Smrg  else
416184bf8334Smrg    lt_cv_sys_global_symbol_pipe=
416284bf8334Smrg  fi
416384bf8334Smrgdone
416484bf8334Smrg])
416584bf8334Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
416684bf8334Smrg  lt_cv_sys_global_symbol_to_cdecl=
416784bf8334Smrgfi
416884bf8334Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
416984bf8334Smrg  AC_MSG_RESULT(failed)
417084bf8334Smrgelse
417184bf8334Smrg  AC_MSG_RESULT(ok)
417284bf8334Smrgfi
417384bf8334Smrg
417484bf8334Smrg# Response file support.
417584bf8334Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
417684bf8334Smrg  nm_file_list_spec='@'
417784bf8334Smrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
417884bf8334Smrg  nm_file_list_spec='@'
417984bf8334Smrgfi
418084bf8334Smrg
418184bf8334Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
418284bf8334Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
418384bf8334Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
418484bf8334Smrg    [Transform the output of nm in a proper C declaration])
4185e4da38afSmrg_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
4186e4da38afSmrg    [Transform the output of nm into a list of symbols to manually relocate])
418784bf8334Smrg_LT_DECL([global_symbol_to_c_name_address],
418884bf8334Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
418984bf8334Smrg    [Transform the output of nm in a C name address pair])
419084bf8334Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
419184bf8334Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
419284bf8334Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
4193e4da38afSmrg_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
4194e4da38afSmrg    [The name lister interface])
419584bf8334Smrg_LT_DECL([], [nm_file_list_spec], [1],
419684bf8334Smrg    [Specify filename containing input files for $NM])
419784bf8334Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
419884bf8334Smrg
419984bf8334Smrg
420084bf8334Smrg# _LT_COMPILER_PIC([TAGNAME])
420184bf8334Smrg# ---------------------------
420284bf8334Smrgm4_defun([_LT_COMPILER_PIC],
420384bf8334Smrg[m4_require([_LT_TAG_COMPILER])dnl
420484bf8334Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
420584bf8334Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
420684bf8334Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
420784bf8334Smrg
420884bf8334Smrgm4_if([$1], [CXX], [
420984bf8334Smrg  # C++ specific cases for pic, static, wl, etc.
4210e4da38afSmrg  if test yes = "$GXX"; then
421184bf8334Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
421284bf8334Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
421384bf8334Smrg
421484bf8334Smrg    case $host_os in
421584bf8334Smrg    aix*)
421684bf8334Smrg      # All AIX code is PIC.
4217e4da38afSmrg      if test ia64 = "$host_cpu"; then
421884bf8334Smrg	# AIX 5 now supports IA64 processor
421984bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
422084bf8334Smrg      fi
4221e4da38afSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
422284bf8334Smrg      ;;
422384bf8334Smrg
422484bf8334Smrg    amigaos*)
422584bf8334Smrg      case $host_cpu in
422684bf8334Smrg      powerpc)
422784bf8334Smrg            # see comment about AmigaOS4 .so support
422884bf8334Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
422984bf8334Smrg        ;;
423084bf8334Smrg      m68k)
423184bf8334Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
4232e4da38afSmrg            # adding the '-m68020' flag to GCC prevents building anything better,
4233e4da38afSmrg            # like '-m68040'.
423484bf8334Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
423584bf8334Smrg        ;;
423684bf8334Smrg      esac
423784bf8334Smrg      ;;
423884bf8334Smrg
423984bf8334Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
424084bf8334Smrg      # PIC is the default for these OSes.
424184bf8334Smrg      ;;
424284bf8334Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
424384bf8334Smrg      # This hack is so that the source file can tell whether it is being
424484bf8334Smrg      # built for inclusion in a dll (and should export symbols for example).
424584bf8334Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
424684bf8334Smrg      # (--disable-auto-import) libraries
424784bf8334Smrg      m4_if([$1], [GCJ], [],
424884bf8334Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4249e4da38afSmrg      case $host_os in
4250e4da38afSmrg      os2*)
4251e4da38afSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4252e4da38afSmrg	;;
4253e4da38afSmrg      esac
425484bf8334Smrg      ;;
425584bf8334Smrg    darwin* | rhapsody*)
425684bf8334Smrg      # PIC is the default on this platform
425784bf8334Smrg      # Common symbols not allowed in MH_DYLIB files
425884bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
425984bf8334Smrg      ;;
426084bf8334Smrg    *djgpp*)
426184bf8334Smrg      # DJGPP does not support shared libraries at all
426284bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
426384bf8334Smrg      ;;
426484bf8334Smrg    haiku*)
426584bf8334Smrg      # PIC is the default for Haiku.
426684bf8334Smrg      # The "-static" flag exists, but is broken.
426784bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
426884bf8334Smrg      ;;
426984bf8334Smrg    interix[[3-9]]*)
427084bf8334Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
427184bf8334Smrg      # Instead, we relocate shared libraries at runtime.
427284bf8334Smrg      ;;
427384bf8334Smrg    sysv4*MP*)
427484bf8334Smrg      if test -d /usr/nec; then
427584bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
427684bf8334Smrg      fi
427784bf8334Smrg      ;;
427884bf8334Smrg    hpux*)
427984bf8334Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
428084bf8334Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
428184bf8334Smrg      # sets the default TLS model and affects inlining.
428284bf8334Smrg      case $host_cpu in
428384bf8334Smrg      hppa*64*)
428484bf8334Smrg	;;
428584bf8334Smrg      *)
428684bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
428784bf8334Smrg	;;
428884bf8334Smrg      esac
428984bf8334Smrg      ;;
429084bf8334Smrg    *qnx* | *nto*)
429184bf8334Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
429284bf8334Smrg      # it will coredump.
429384bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
429484bf8334Smrg      ;;
429584bf8334Smrg    *)
429684bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
429784bf8334Smrg      ;;
429884bf8334Smrg    esac
429984bf8334Smrg  else
430084bf8334Smrg    case $host_os in
430184bf8334Smrg      aix[[4-9]]*)
430284bf8334Smrg	# All AIX code is PIC.
4303e4da38afSmrg	if test ia64 = "$host_cpu"; then
430484bf8334Smrg	  # AIX 5 now supports IA64 processor
430584bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
430684bf8334Smrg	else
430784bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
430884bf8334Smrg	fi
430984bf8334Smrg	;;
431084bf8334Smrg      chorus*)
431184bf8334Smrg	case $cc_basename in
431284bf8334Smrg	cxch68*)
431384bf8334Smrg	  # Green Hills C++ Compiler
431484bf8334Smrg	  # _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"
431584bf8334Smrg	  ;;
431684bf8334Smrg	esac
431784bf8334Smrg	;;
431884bf8334Smrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
431984bf8334Smrg	# This hack is so that the source file can tell whether it is being
432084bf8334Smrg	# built for inclusion in a dll (and should export symbols for example).
432184bf8334Smrg	m4_if([$1], [GCJ], [],
432284bf8334Smrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
432384bf8334Smrg	;;
432484bf8334Smrg      dgux*)
432584bf8334Smrg	case $cc_basename in
432684bf8334Smrg	  ec++*)
432784bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
432884bf8334Smrg	    ;;
432984bf8334Smrg	  ghcx*)
433084bf8334Smrg	    # Green Hills C++ Compiler
433184bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
433284bf8334Smrg	    ;;
433384bf8334Smrg	  *)
433484bf8334Smrg	    ;;
433584bf8334Smrg	esac
433684bf8334Smrg	;;
433784bf8334Smrg      freebsd* | dragonfly*)
433884bf8334Smrg	# FreeBSD uses GNU C++
433984bf8334Smrg	;;
434084bf8334Smrg      hpux9* | hpux10* | hpux11*)
434184bf8334Smrg	case $cc_basename in
434284bf8334Smrg	  CC*)
434384bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4344e4da38afSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4345e4da38afSmrg	    if test ia64 != "$host_cpu"; then
434684bf8334Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
434784bf8334Smrg	    fi
434884bf8334Smrg	    ;;
434984bf8334Smrg	  aCC*)
435084bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4351e4da38afSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
435284bf8334Smrg	    case $host_cpu in
435384bf8334Smrg	    hppa*64*|ia64*)
435484bf8334Smrg	      # +Z the default
435584bf8334Smrg	      ;;
435684bf8334Smrg	    *)
435784bf8334Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
435884bf8334Smrg	      ;;
435984bf8334Smrg	    esac
436084bf8334Smrg	    ;;
436184bf8334Smrg	  *)
436284bf8334Smrg	    ;;
436384bf8334Smrg	esac
436484bf8334Smrg	;;
436584bf8334Smrg      interix*)
436684bf8334Smrg	# This is c89, which is MS Visual C++ (no shared libs)
436784bf8334Smrg	# Anyone wants to do a port?
436884bf8334Smrg	;;
436984bf8334Smrg      irix5* | irix6* | nonstopux*)
437084bf8334Smrg	case $cc_basename in
437184bf8334Smrg	  CC*)
437284bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
437384bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
437484bf8334Smrg	    # CC pic flag -KPIC is the default.
437584bf8334Smrg	    ;;
437684bf8334Smrg	  *)
437784bf8334Smrg	    ;;
437884bf8334Smrg	esac
437984bf8334Smrg	;;
4380e4da38afSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
438184bf8334Smrg	case $cc_basename in
438284bf8334Smrg	  KCC*)
438384bf8334Smrg	    # KAI C++ Compiler
438484bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
438584bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
438684bf8334Smrg	    ;;
438784bf8334Smrg	  ecpc* )
4388e4da38afSmrg	    # old Intel C++ for x86_64, which still supported -KPIC.
438984bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
439084bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
439184bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
439284bf8334Smrg	    ;;
439384bf8334Smrg	  icpc* )
439484bf8334Smrg	    # Intel C++, used to be incompatible with GCC.
439584bf8334Smrg	    # ICC 10 doesn't accept -KPIC any more.
439684bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
439784bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
439884bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
439984bf8334Smrg	    ;;
440084bf8334Smrg	  pgCC* | pgcpp*)
440184bf8334Smrg	    # Portland Group C++ compiler
440284bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
440384bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
440484bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
440584bf8334Smrg	    ;;
440684bf8334Smrg	  cxx*)
440784bf8334Smrg	    # Compaq C++
440884bf8334Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
440984bf8334Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
441084bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
441184bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
441284bf8334Smrg	    ;;
441384bf8334Smrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
441484bf8334Smrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
441584bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
441684bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
441784bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
441884bf8334Smrg	    ;;
441984bf8334Smrg	  *)
442084bf8334Smrg	    case `$CC -V 2>&1 | sed 5q` in
442184bf8334Smrg	    *Sun\ C*)
442284bf8334Smrg	      # Sun C++ 5.9
442384bf8334Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
442484bf8334Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
442584bf8334Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
442684bf8334Smrg	      ;;
442784bf8334Smrg	    esac
442884bf8334Smrg	    ;;
442984bf8334Smrg	esac
443084bf8334Smrg	;;
443184bf8334Smrg      lynxos*)
443284bf8334Smrg	;;
443384bf8334Smrg      m88k*)
443484bf8334Smrg	;;
443584bf8334Smrg      mvs*)
443684bf8334Smrg	case $cc_basename in
443784bf8334Smrg	  cxx*)
443884bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
443984bf8334Smrg	    ;;
444084bf8334Smrg	  *)
444184bf8334Smrg	    ;;
444284bf8334Smrg	esac
444384bf8334Smrg	;;
444484bf8334Smrg      netbsd*)
444584bf8334Smrg	;;
444684bf8334Smrg      *qnx* | *nto*)
444784bf8334Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
444884bf8334Smrg        # it will coredump.
444984bf8334Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
445084bf8334Smrg        ;;
445184bf8334Smrg      osf3* | osf4* | osf5*)
445284bf8334Smrg	case $cc_basename in
445384bf8334Smrg	  KCC*)
445484bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
445584bf8334Smrg	    ;;
445684bf8334Smrg	  RCC*)
445784bf8334Smrg	    # Rational C++ 2.4.1
445884bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
445984bf8334Smrg	    ;;
446084bf8334Smrg	  cxx*)
446184bf8334Smrg	    # Digital/Compaq C++
446284bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
446384bf8334Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
446484bf8334Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
446584bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
446684bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
446784bf8334Smrg	    ;;
446884bf8334Smrg	  *)
446984bf8334Smrg	    ;;
447084bf8334Smrg	esac
447184bf8334Smrg	;;
447284bf8334Smrg      psos*)
447384bf8334Smrg	;;
447484bf8334Smrg      solaris*)
447584bf8334Smrg	case $cc_basename in
447684bf8334Smrg	  CC* | sunCC*)
447784bf8334Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
447884bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
447984bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
448084bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
448184bf8334Smrg	    ;;
448284bf8334Smrg	  gcx*)
448384bf8334Smrg	    # Green Hills C++ Compiler
448484bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
448584bf8334Smrg	    ;;
448684bf8334Smrg	  *)
448784bf8334Smrg	    ;;
448884bf8334Smrg	esac
448984bf8334Smrg	;;
449084bf8334Smrg      sunos4*)
449184bf8334Smrg	case $cc_basename in
449284bf8334Smrg	  CC*)
449384bf8334Smrg	    # Sun C++ 4.x
449484bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
449584bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
449684bf8334Smrg	    ;;
449784bf8334Smrg	  lcc*)
449884bf8334Smrg	    # Lucid
449984bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
450084bf8334Smrg	    ;;
450184bf8334Smrg	  *)
450284bf8334Smrg	    ;;
450384bf8334Smrg	esac
450484bf8334Smrg	;;
450584bf8334Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
450684bf8334Smrg	case $cc_basename in
450784bf8334Smrg	  CC*)
450884bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
450984bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
451084bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
451184bf8334Smrg	    ;;
451284bf8334Smrg	esac
451384bf8334Smrg	;;
451484bf8334Smrg      tandem*)
451584bf8334Smrg	case $cc_basename in
451684bf8334Smrg	  NCC*)
451784bf8334Smrg	    # NonStop-UX NCC 3.20
451884bf8334Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
451984bf8334Smrg	    ;;
452084bf8334Smrg	  *)
452184bf8334Smrg	    ;;
452284bf8334Smrg	esac
452384bf8334Smrg	;;
452484bf8334Smrg      vxworks*)
452584bf8334Smrg	;;
452684bf8334Smrg      *)
452784bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
452884bf8334Smrg	;;
452984bf8334Smrg    esac
453084bf8334Smrg  fi
453184bf8334Smrg],
453284bf8334Smrg[
4533e4da38afSmrg  if test yes = "$GCC"; then
453484bf8334Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
453584bf8334Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4536fc27e79cSmrg
453784bf8334Smrg    case $host_os in
453884bf8334Smrg      aix*)
453984bf8334Smrg      # All AIX code is PIC.
4540e4da38afSmrg      if test ia64 = "$host_cpu"; then
454184bf8334Smrg	# AIX 5 now supports IA64 processor
454284bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
454384bf8334Smrg      fi
4544e4da38afSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
454584bf8334Smrg      ;;
4546fc27e79cSmrg
454784bf8334Smrg    amigaos*)
454884bf8334Smrg      case $host_cpu in
454984bf8334Smrg      powerpc)
455084bf8334Smrg            # see comment about AmigaOS4 .so support
455184bf8334Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
455284bf8334Smrg        ;;
455384bf8334Smrg      m68k)
455484bf8334Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
4555e4da38afSmrg            # adding the '-m68020' flag to GCC prevents building anything better,
4556e4da38afSmrg            # like '-m68040'.
455784bf8334Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
455884bf8334Smrg        ;;
455984bf8334Smrg      esac
456084bf8334Smrg      ;;
4561fc27e79cSmrg
456284bf8334Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
456384bf8334Smrg      # PIC is the default for these OSes.
456484bf8334Smrg      ;;
4565fc27e79cSmrg
456684bf8334Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
456784bf8334Smrg      # This hack is so that the source file can tell whether it is being
456884bf8334Smrg      # built for inclusion in a dll (and should export symbols for example).
456984bf8334Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
457084bf8334Smrg      # (--disable-auto-import) libraries
457184bf8334Smrg      m4_if([$1], [GCJ], [],
457284bf8334Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4573e4da38afSmrg      case $host_os in
4574e4da38afSmrg      os2*)
4575e4da38afSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4576e4da38afSmrg	;;
4577e4da38afSmrg      esac
457884bf8334Smrg      ;;
4579fc27e79cSmrg
458084bf8334Smrg    darwin* | rhapsody*)
458184bf8334Smrg      # PIC is the default on this platform
458284bf8334Smrg      # Common symbols not allowed in MH_DYLIB files
458384bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
458484bf8334Smrg      ;;
4585b73be646Smrg
458684bf8334Smrg    haiku*)
458784bf8334Smrg      # PIC is the default for Haiku.
458884bf8334Smrg      # The "-static" flag exists, but is broken.
458984bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
459084bf8334Smrg      ;;
4591b73be646Smrg
459284bf8334Smrg    hpux*)
459384bf8334Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
459484bf8334Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
459584bf8334Smrg      # sets the default TLS model and affects inlining.
459684bf8334Smrg      case $host_cpu in
459784bf8334Smrg      hppa*64*)
459884bf8334Smrg	# +Z the default
459984bf8334Smrg	;;
460084bf8334Smrg      *)
460184bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
460284bf8334Smrg	;;
460384bf8334Smrg      esac
460484bf8334Smrg      ;;
4605b73be646Smrg
460684bf8334Smrg    interix[[3-9]]*)
460784bf8334Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
460884bf8334Smrg      # Instead, we relocate shared libraries at runtime.
460984bf8334Smrg      ;;
4610659607e0Smrg
461184bf8334Smrg    msdosdjgpp*)
461284bf8334Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
461384bf8334Smrg      # on systems that don't support them.
461484bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
461584bf8334Smrg      enable_shared=no
461684bf8334Smrg      ;;
4617659607e0Smrg
461884bf8334Smrg    *nto* | *qnx*)
461984bf8334Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
462084bf8334Smrg      # it will coredump.
462184bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
462284bf8334Smrg      ;;
4623b73be646Smrg
462484bf8334Smrg    sysv4*MP*)
462584bf8334Smrg      if test -d /usr/nec; then
462684bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
462784bf8334Smrg      fi
462884bf8334Smrg      ;;
4629659607e0Smrg
463084bf8334Smrg    *)
463184bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
463284bf8334Smrg      ;;
463384bf8334Smrg    esac
4634bd3a1963Smrg
463584bf8334Smrg    case $cc_basename in
463684bf8334Smrg    nvcc*) # Cuda Compiler Driver 2.2
463784bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
463884bf8334Smrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
463984bf8334Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
464084bf8334Smrg      fi
464184bf8334Smrg      ;;
464284bf8334Smrg    esac
4643a73597f9Smrg  else
464484bf8334Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
464584bf8334Smrg    case $host_os in
464684bf8334Smrg    aix*)
464784bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4648e4da38afSmrg      if test ia64 = "$host_cpu"; then
464984bf8334Smrg	# AIX 5 now supports IA64 processor
465084bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
465184bf8334Smrg      else
465284bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
465384bf8334Smrg      fi
465484bf8334Smrg      ;;
4655659607e0Smrg
4656e4da38afSmrg    darwin* | rhapsody*)
4657e4da38afSmrg      # PIC is the default on this platform
4658e4da38afSmrg      # Common symbols not allowed in MH_DYLIB files
4659e4da38afSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4660e4da38afSmrg      case $cc_basename in
4661e4da38afSmrg      nagfor*)
4662e4da38afSmrg        # NAG Fortran compiler
4663e4da38afSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4664e4da38afSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4665e4da38afSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4666e4da38afSmrg        ;;
4667e4da38afSmrg      esac
4668e4da38afSmrg      ;;
4669e4da38afSmrg
467084bf8334Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
467184bf8334Smrg      # This hack is so that the source file can tell whether it is being
467284bf8334Smrg      # built for inclusion in a dll (and should export symbols for example).
467384bf8334Smrg      m4_if([$1], [GCJ], [],
467484bf8334Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4675e4da38afSmrg      case $host_os in
4676e4da38afSmrg      os2*)
4677e4da38afSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4678e4da38afSmrg	;;
4679e4da38afSmrg      esac
468084bf8334Smrg      ;;
4681659607e0Smrg
468284bf8334Smrg    hpux9* | hpux10* | hpux11*)
468384bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
468484bf8334Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
468584bf8334Smrg      # not for PA HP-UX.
468684bf8334Smrg      case $host_cpu in
468784bf8334Smrg      hppa*64*|ia64*)
468884bf8334Smrg	# +Z the default
468984bf8334Smrg	;;
469084bf8334Smrg      *)
469184bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
469284bf8334Smrg	;;
469384bf8334Smrg      esac
469484bf8334Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
4695e4da38afSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
469684bf8334Smrg      ;;
4697fc27e79cSmrg
469884bf8334Smrg    irix5* | irix6* | nonstopux*)
469984bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
470084bf8334Smrg      # PIC (with -KPIC) is the default.
470184bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
470284bf8334Smrg      ;;
4703a73597f9Smrg
4704e4da38afSmrg    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
470584bf8334Smrg      case $cc_basename in
4706e4da38afSmrg      # old Intel for x86_64, which still supported -KPIC.
470784bf8334Smrg      ecc*)
470884bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
470984bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
471084bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
471184bf8334Smrg        ;;
471284bf8334Smrg      # icc used to be incompatible with GCC.
471384bf8334Smrg      # ICC 10 doesn't accept -KPIC any more.
471484bf8334Smrg      icc* | ifort*)
471584bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
471684bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
471784bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
471884bf8334Smrg        ;;
471984bf8334Smrg      # Lahey Fortran 8.1.
472084bf8334Smrg      lf95*)
472184bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
472284bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
472384bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
472484bf8334Smrg	;;
472584bf8334Smrg      nagfor*)
472684bf8334Smrg	# NAG Fortran compiler
472784bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
472884bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
472984bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
473084bf8334Smrg	;;
4731e4da38afSmrg      tcc*)
4732e4da38afSmrg	# Fabrice Bellard et al's Tiny C Compiler
4733e4da38afSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4734e4da38afSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4735e4da38afSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4736e4da38afSmrg	;;
473784bf8334Smrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
473884bf8334Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
473984bf8334Smrg	# which looks to be a dead project)
474084bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
474184bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
474284bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
474384bf8334Smrg        ;;
474484bf8334Smrg      ccc*)
474584bf8334Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
474684bf8334Smrg        # All Alpha code is PIC.
474784bf8334Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
474884bf8334Smrg        ;;
474984bf8334Smrg      xl* | bgxl* | bgf* | mpixl*)
475084bf8334Smrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
475184bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
475284bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
475384bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
475484bf8334Smrg	;;
475584bf8334Smrg      *)
475684bf8334Smrg	case `$CC -V 2>&1 | sed 5q` in
475784bf8334Smrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
475884bf8334Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
475984bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
476084bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
476184bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
476284bf8334Smrg	  ;;
476384bf8334Smrg	*Sun\ F* | *Sun*Fortran*)
476484bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
476584bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
476684bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
476784bf8334Smrg	  ;;
476884bf8334Smrg	*Sun\ C*)
476984bf8334Smrg	  # Sun C 5.9
477084bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
477184bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
477284bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
477384bf8334Smrg	  ;;
477484bf8334Smrg        *Intel*\ [[CF]]*Compiler*)
477584bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
477684bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
477784bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
477884bf8334Smrg	  ;;
477984bf8334Smrg	*Portland\ Group*)
478084bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
478184bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
478284bf8334Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
478384bf8334Smrg	  ;;
478484bf8334Smrg	esac
478584bf8334Smrg	;;
478684bf8334Smrg      esac
478784bf8334Smrg      ;;
4788a73597f9Smrg
478984bf8334Smrg    newsos6)
479084bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
479184bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
479284bf8334Smrg      ;;
4793a73597f9Smrg
479484bf8334Smrg    *nto* | *qnx*)
479584bf8334Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
479684bf8334Smrg      # it will coredump.
479784bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
479884bf8334Smrg      ;;
4799a73597f9Smrg
480084bf8334Smrg    osf3* | osf4* | osf5*)
480184bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
480284bf8334Smrg      # All OSF/1 code is PIC.
480384bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
480484bf8334Smrg      ;;
4805a73597f9Smrg
480684bf8334Smrg    rdos*)
480784bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
480884bf8334Smrg      ;;
4809fc27e79cSmrg
481084bf8334Smrg    solaris*)
481184bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
481284bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
481384bf8334Smrg      case $cc_basename in
481484bf8334Smrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
481584bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
481684bf8334Smrg      *)
481784bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
481884bf8334Smrg      esac
481984bf8334Smrg      ;;
4820bd3a1963Smrg
482184bf8334Smrg    sunos4*)
482284bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
482384bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
482484bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
482584bf8334Smrg      ;;
4826fc27e79cSmrg
482784bf8334Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
482884bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
482984bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
483084bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
483184bf8334Smrg      ;;
4832659607e0Smrg
483384bf8334Smrg    sysv4*MP*)
4834e4da38afSmrg      if test -d /usr/nec; then
483584bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
483684bf8334Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
483784bf8334Smrg      fi
483884bf8334Smrg      ;;
4839fc27e79cSmrg
484084bf8334Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
484184bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
484284bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
484384bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
484484bf8334Smrg      ;;
4845b73be646Smrg
484684bf8334Smrg    unicos*)
484784bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
484884bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
484984bf8334Smrg      ;;
4850b73be646Smrg
485184bf8334Smrg    uts4*)
485284bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
485384bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
485484bf8334Smrg      ;;
4855659607e0Smrg
485684bf8334Smrg    *)
485784bf8334Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
485884bf8334Smrg      ;;
485984bf8334Smrg    esac
486084bf8334Smrg  fi
486184bf8334Smrg])
486284bf8334Smrgcase $host_os in
4863e4da38afSmrg  # For platforms that do not support PIC, -DPIC is meaningless:
486484bf8334Smrg  *djgpp*)
486584bf8334Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
486684bf8334Smrg    ;;
486784bf8334Smrg  *)
486884bf8334Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
486984bf8334Smrg    ;;
487084bf8334Smrgesac
4871a73597f9Smrg
487284bf8334SmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
487384bf8334Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
487484bf8334Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
487584bf8334Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
4876a73597f9Smrg
487784bf8334Smrg#
487884bf8334Smrg# Check to make sure the PIC flag actually works.
487984bf8334Smrg#
488084bf8334Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
488184bf8334Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
488284bf8334Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
488384bf8334Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
488484bf8334Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
488584bf8334Smrg     "" | " "*) ;;
488684bf8334Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
488784bf8334Smrg     esac],
488884bf8334Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
488984bf8334Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
489084bf8334Smrgfi
489184bf8334Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
489284bf8334Smrg	[Additional compiler flags for building library objects])
4893a73597f9Smrg
489484bf8334Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
489584bf8334Smrg	[How to pass a linker flag through the compiler])
489684bf8334Smrg#
489784bf8334Smrg# Check to make sure the static flag actually works.
489884bf8334Smrg#
489984bf8334Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
490084bf8334Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
490184bf8334Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
490284bf8334Smrg  $lt_tmp_static_flag,
490384bf8334Smrg  [],
490484bf8334Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
490584bf8334Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
490684bf8334Smrg	[Compiler flag to prevent dynamic linking])
490784bf8334Smrg])# _LT_COMPILER_PIC
490884bf8334Smrg
490984bf8334Smrg
491084bf8334Smrg# _LT_LINKER_SHLIBS([TAGNAME])
491184bf8334Smrg# ----------------------------
491284bf8334Smrg# See if the linker supports building shared libraries.
491384bf8334Smrgm4_defun([_LT_LINKER_SHLIBS],
491484bf8334Smrg[AC_REQUIRE([LT_PATH_LD])dnl
491584bf8334SmrgAC_REQUIRE([LT_PATH_NM])dnl
491684bf8334Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
491784bf8334Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
491884bf8334Smrgm4_require([_LT_DECL_EGREP])dnl
491984bf8334Smrgm4_require([_LT_DECL_SED])dnl
492084bf8334Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
492184bf8334Smrgm4_require([_LT_TAG_COMPILER])dnl
492284bf8334SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
492384bf8334Smrgm4_if([$1], [CXX], [
492484bf8334Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
492584bf8334Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
492684bf8334Smrg  case $host_os in
492784bf8334Smrg  aix[[4-9]]*)
492884bf8334Smrg    # If we're using GNU nm, then we don't want the "-C" option.
4929e4da38afSmrg    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
4930e4da38afSmrg    # Without the "-l" option, or with the "-B" option, AIX nm treats
4931e4da38afSmrg    # weak defined symbols like other global defined symbols, whereas
4932e4da38afSmrg    # GNU nm marks them as "W".
4933e4da38afSmrg    # While the 'weak' keyword is ignored in the Export File, we need
4934e4da38afSmrg    # it in the Import File for the 'aix-soname' feature, so we have
4935e4da38afSmrg    # to replace the "-B" option with "-P" for AIX nm.
493684bf8334Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4937e4da38afSmrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
493884bf8334Smrg    else
4939e4da38afSmrg      _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
494084bf8334Smrg    fi
494184bf8334Smrg    ;;
494284bf8334Smrg  pw32*)
4943e4da38afSmrg    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
494484bf8334Smrg    ;;
494584bf8334Smrg  cygwin* | mingw* | cegcc*)
494684bf8334Smrg    case $cc_basename in
494784bf8334Smrg    cl*)
494884bf8334Smrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
494984bf8334Smrg      ;;
495084bf8334Smrg    *)
495184bf8334Smrg      _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'
495284bf8334Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
495384bf8334Smrg      ;;
495484bf8334Smrg    esac
495584bf8334Smrg    ;;
495684bf8334Smrg  *)
495784bf8334Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
495884bf8334Smrg    ;;
495984bf8334Smrg  esac
496084bf8334Smrg], [
496184bf8334Smrg  runpath_var=
496284bf8334Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
496384bf8334Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
496484bf8334Smrg  _LT_TAGVAR(archive_cmds, $1)=
496584bf8334Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
496684bf8334Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
496784bf8334Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
496884bf8334Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
496984bf8334Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
497084bf8334Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
497184bf8334Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
497284bf8334Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
497384bf8334Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
497484bf8334Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
497584bf8334Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
497684bf8334Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
497784bf8334Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
497884bf8334Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
497984bf8334Smrg  _LT_TAGVAR(module_cmds, $1)=
498084bf8334Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
498184bf8334Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
498284bf8334Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
498384bf8334Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
498484bf8334Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
498584bf8334Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
498684bf8334Smrg  # included in the symbol list
498784bf8334Smrg  _LT_TAGVAR(include_expsyms, $1)=
498884bf8334Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
4989e4da38afSmrg  # it will be wrapped by ' (' and ')$', so one must not match beginning or
4990e4da38afSmrg  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
4991e4da38afSmrg  # as well as any symbol that contains 'd'.
499284bf8334Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
499384bf8334Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
499484bf8334Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
499584bf8334Smrg  # the symbol is explicitly referenced.  Since portable code cannot
499684bf8334Smrg  # rely on this symbol name, it's probably fine to never include it in
499784bf8334Smrg  # preloaded symbol tables.
499884bf8334Smrg  # Exclude shared library initialization/finalization symbols.
499984bf8334Smrgdnl Note also adjust exclude_expsyms for C++ above.
500084bf8334Smrg  extract_expsyms_cmds=
500184bf8334Smrg
500284bf8334Smrg  case $host_os in
500384bf8334Smrg  cygwin* | mingw* | pw32* | cegcc*)
500484bf8334Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
500584bf8334Smrg    # When not using gcc, we currently assume that we are using
500684bf8334Smrg    # Microsoft Visual C++.
5007e4da38afSmrg    if test yes != "$GCC"; then
500884bf8334Smrg      with_gnu_ld=no
500984bf8334Smrg    fi
501084bf8334Smrg    ;;
501184bf8334Smrg  interix*)
501284bf8334Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
501384bf8334Smrg    with_gnu_ld=yes
501484bf8334Smrg    ;;
5015e4da38afSmrg  openbsd* | bitrig*)
501684bf8334Smrg    with_gnu_ld=no
501784bf8334Smrg    ;;
501884bf8334Smrg  esac
5019a73597f9Smrg
502084bf8334Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
502184bf8334Smrg
502284bf8334Smrg  # On some targets, GNU ld is compatible enough with the native linker
502384bf8334Smrg  # that we're better off using the native interface for both.
502484bf8334Smrg  lt_use_gnu_ld_interface=no
5025e4da38afSmrg  if test yes = "$with_gnu_ld"; then
502684bf8334Smrg    case $host_os in
502784bf8334Smrg      aix*)
502884bf8334Smrg	# The AIX port of GNU ld has always aspired to compatibility
502984bf8334Smrg	# with the native linker.  However, as the warning in the GNU ld
503084bf8334Smrg	# block says, versions before 2.19.5* couldn't really create working
503184bf8334Smrg	# shared libraries, regardless of the interface used.
503284bf8334Smrg	case `$LD -v 2>&1` in
503384bf8334Smrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
503484bf8334Smrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
503584bf8334Smrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
503684bf8334Smrg	  *)
503784bf8334Smrg	    lt_use_gnu_ld_interface=yes
503884bf8334Smrg	    ;;
5039b73be646Smrg	esac
5040fc27e79cSmrg	;;
504184bf8334Smrg      *)
504284bf8334Smrg	lt_use_gnu_ld_interface=yes
5043bd3a1963Smrg	;;
504484bf8334Smrg    esac
504584bf8334Smrg  fi
5046a73597f9Smrg
5047e4da38afSmrg  if test yes = "$lt_use_gnu_ld_interface"; then
504884bf8334Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
5049e4da38afSmrg    wlarc='$wl'
5050a73597f9Smrg
505184bf8334Smrg    # Set some defaults for GNU ld with shared library support. These
505284bf8334Smrg    # are reset later if shared libraries are not supported. Putting them
505384bf8334Smrg    # here allows them to be overridden if necessary.
505484bf8334Smrg    runpath_var=LD_RUN_PATH
5055e4da38afSmrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5056e4da38afSmrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
505784bf8334Smrg    # ancient GNU ld didn't support --whole-archive et. al.
505884bf8334Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
5059e4da38afSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
506084bf8334Smrg    else
506184bf8334Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
506284bf8334Smrg    fi
506384bf8334Smrg    supports_anon_versioning=no
5064e4da38afSmrg    case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
506584bf8334Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
506684bf8334Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
506784bf8334Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
506884bf8334Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
506984bf8334Smrg      *\ 2.11.*) ;; # other 2.11 versions
507084bf8334Smrg      *) supports_anon_versioning=yes ;;
507184bf8334Smrg    esac
5072a73597f9Smrg
507384bf8334Smrg    # See if GNU ld supports shared libraries.
507484bf8334Smrg    case $host_os in
507584bf8334Smrg    aix[[3-9]]*)
507684bf8334Smrg      # On AIX/PPC, the GNU linker is very broken
5077e4da38afSmrg      if test ia64 != "$host_cpu"; then
507884bf8334Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
507984bf8334Smrg	cat <<_LT_EOF 1>&2
5080a73597f9Smrg
508184bf8334Smrg*** Warning: the GNU linker, at least up to release 2.19, is reported
508284bf8334Smrg*** to be unable to reliably create shared libraries on AIX.
508384bf8334Smrg*** Therefore, libtool is disabling shared libraries support.  If you
508484bf8334Smrg*** really care for shared libraries, you may want to install binutils
508584bf8334Smrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
508684bf8334Smrg*** You will then need to restart the configuration process.
5087a73597f9Smrg
508884bf8334Smrg_LT_EOF
508984bf8334Smrg      fi
509084bf8334Smrg      ;;
5091a73597f9Smrg
509284bf8334Smrg    amigaos*)
509384bf8334Smrg      case $host_cpu in
509484bf8334Smrg      powerpc)
509584bf8334Smrg            # see comment about AmigaOS4 .so support
5096e4da38afSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
509784bf8334Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
509884bf8334Smrg        ;;
509984bf8334Smrg      m68k)
510084bf8334Smrg            _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)'
510184bf8334Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
510284bf8334Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
510384bf8334Smrg        ;;
510484bf8334Smrg      esac
510584bf8334Smrg      ;;
5106a73597f9Smrg
510784bf8334Smrg    beos*)
510884bf8334Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
510984bf8334Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
511084bf8334Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
511184bf8334Smrg	# support --undefined.  This deserves some investigation.  FIXME
5112e4da38afSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
511384bf8334Smrg      else
511484bf8334Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
511584bf8334Smrg      fi
511684bf8334Smrg      ;;
5117a73597f9Smrg
511884bf8334Smrg    cygwin* | mingw* | pw32* | cegcc*)
511984bf8334Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
512084bf8334Smrg      # as there is no search path for DLLs.
512184bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5122e4da38afSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
512384bf8334Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
512484bf8334Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
512584bf8334Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
512684bf8334Smrg      _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'
512784bf8334Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5128a73597f9Smrg
512984bf8334Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5130e4da38afSmrg        _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'
5131e4da38afSmrg	# If the export-symbols file already is a .def file, use it as
5132e4da38afSmrg	# is; otherwise, prepend EXPORTS...
5133e4da38afSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5134e4da38afSmrg          cp $export_symbols $output_objdir/$soname.def;
5135e4da38afSmrg        else
5136e4da38afSmrg          echo EXPORTS > $output_objdir/$soname.def;
5137e4da38afSmrg          cat $export_symbols >> $output_objdir/$soname.def;
5138e4da38afSmrg        fi~
5139e4da38afSmrg        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
514084bf8334Smrg      else
514184bf8334Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
514284bf8334Smrg      fi
514384bf8334Smrg      ;;
5144a73597f9Smrg
514584bf8334Smrg    haiku*)
5146e4da38afSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
514784bf8334Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
514884bf8334Smrg      ;;
5149a73597f9Smrg
5150e4da38afSmrg    os2*)
5151e4da38afSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5152e4da38afSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5153e4da38afSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5154e4da38afSmrg      shrext_cmds=.dll
5155e4da38afSmrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5156e4da38afSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5157e4da38afSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5158e4da38afSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5159e4da38afSmrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5160e4da38afSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5161e4da38afSmrg	emximp -o $lib $output_objdir/$libname.def'
5162e4da38afSmrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5163e4da38afSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5164e4da38afSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5165e4da38afSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5166e4da38afSmrg	prefix_cmds="$SED"~
5167e4da38afSmrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
5168e4da38afSmrg	  prefix_cmds="$prefix_cmds -e 1d";
5169e4da38afSmrg	fi~
5170e4da38afSmrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5171e4da38afSmrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5172e4da38afSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5173e4da38afSmrg	emximp -o $lib $output_objdir/$libname.def'
5174e4da38afSmrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5175e4da38afSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5176e4da38afSmrg      ;;
5177e4da38afSmrg
517884bf8334Smrg    interix[[3-9]]*)
517984bf8334Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
518084bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5181e4da38afSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5182e4da38afSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
518384bf8334Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
518484bf8334Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
518584bf8334Smrg      # default) and relocated if they conflict, which is a slow very memory
518684bf8334Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
518784bf8334Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
518884bf8334Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5189e4da38afSmrg      _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'
5190e4da38afSmrg      _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'
519184bf8334Smrg      ;;
519284bf8334Smrg
519384bf8334Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
519484bf8334Smrg      tmp_diet=no
5195e4da38afSmrg      if test linux-dietlibc = "$host_os"; then
519684bf8334Smrg	case $cc_basename in
519784bf8334Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
519884bf8334Smrg	esac
519984bf8334Smrg      fi
520084bf8334Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
5201e4da38afSmrg	 && test no = "$tmp_diet"
520284bf8334Smrg      then
520384bf8334Smrg	tmp_addflag=' $pic_flag'
520484bf8334Smrg	tmp_sharedflag='-shared'
520584bf8334Smrg	case $cc_basename,$host_cpu in
520684bf8334Smrg        pgcc*)				# Portland Group C compiler
5207e4da38afSmrg	  _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'
520884bf8334Smrg	  tmp_addflag=' $pic_flag'
520984bf8334Smrg	  ;;
521084bf8334Smrg	pgf77* | pgf90* | pgf95* | pgfortran*)
521184bf8334Smrg					# Portland Group f77 and f90 compilers
5212e4da38afSmrg	  _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'
521384bf8334Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
521484bf8334Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
521584bf8334Smrg	  tmp_addflag=' -i_dynamic' ;;
521684bf8334Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
521784bf8334Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
521884bf8334Smrg	ifc* | ifort*)			# Intel Fortran compiler
521984bf8334Smrg	  tmp_addflag=' -nofor_main' ;;
522084bf8334Smrg	lf95*)				# Lahey Fortran 8.1
522184bf8334Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
522284bf8334Smrg	  tmp_sharedflag='--shared' ;;
5223e4da38afSmrg        nagfor*)                        # NAGFOR 5.3
5224e4da38afSmrg          tmp_sharedflag='-Wl,-shared' ;;
522584bf8334Smrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
522684bf8334Smrg	  tmp_sharedflag='-qmkshrobj'
522784bf8334Smrg	  tmp_addflag= ;;
522884bf8334Smrg	nvcc*)	# Cuda Compiler Driver 2.2
5229e4da38afSmrg	  _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'
523084bf8334Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
523184bf8334Smrg	  ;;
523284bf8334Smrg	esac
523384bf8334Smrg	case `$CC -V 2>&1 | sed 5q` in
523484bf8334Smrg	*Sun\ C*)			# Sun C 5.9
5235e4da38afSmrg	  _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'
523684bf8334Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
523784bf8334Smrg	  tmp_sharedflag='-G' ;;
523884bf8334Smrg	*Sun\ F*)			# Sun Fortran 8.3
523984bf8334Smrg	  tmp_sharedflag='-G' ;;
524084bf8334Smrg	esac
5241e4da38afSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5242a73597f9Smrg
5243e4da38afSmrg        if test yes = "$supports_anon_versioning"; then
524484bf8334Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5245e4da38afSmrg            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5246e4da38afSmrg            echo "local: *; };" >> $output_objdir/$libname.ver~
5247e4da38afSmrg            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
524884bf8334Smrg        fi
5249a73597f9Smrg
525084bf8334Smrg	case $cc_basename in
5251e4da38afSmrg	tcc*)
5252e4da38afSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
5253e4da38afSmrg	  ;;
525484bf8334Smrg	xlf* | bgf* | bgxlf* | mpixlf*)
525584bf8334Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
525684bf8334Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
5257e4da38afSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
525884bf8334Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
5259e4da38afSmrg	  if test yes = "$supports_anon_versioning"; then
526084bf8334Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5261e4da38afSmrg              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5262e4da38afSmrg              echo "local: *; };" >> $output_objdir/$libname.ver~
5263e4da38afSmrg              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
526484bf8334Smrg	  fi
526584bf8334Smrg	  ;;
5266fc27e79cSmrg	esac
526784bf8334Smrg      else
526884bf8334Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
526984bf8334Smrg      fi
527084bf8334Smrg      ;;
5271a73597f9Smrg
527284bf8334Smrg    netbsd*)
527384bf8334Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
527484bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
527584bf8334Smrg	wlarc=
527684bf8334Smrg      else
5277e4da38afSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5278e4da38afSmrg	_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'
527984bf8334Smrg      fi
528084bf8334Smrg      ;;
528184bf8334Smrg
528284bf8334Smrg    solaris*)
528384bf8334Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
5284a73597f9Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
528584bf8334Smrg	cat <<_LT_EOF 1>&2
5286a73597f9Smrg
528784bf8334Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
528884bf8334Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
528984bf8334Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
529084bf8334Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
529184bf8334Smrg*** your PATH or compiler configuration so that the native linker is
529284bf8334Smrg*** used, and then restart.
5293a73597f9Smrg
529484bf8334Smrg_LT_EOF
529584bf8334Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5296e4da38afSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5297e4da38afSmrg	_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'
529884bf8334Smrg      else
529984bf8334Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
530084bf8334Smrg      fi
530184bf8334Smrg      ;;
5302a73597f9Smrg
530384bf8334Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
530484bf8334Smrg      case `$LD -v 2>&1` in
530584bf8334Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
530684bf8334Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
530784bf8334Smrg	cat <<_LT_EOF 1>&2
5308a73597f9Smrg
5309e4da38afSmrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
531084bf8334Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
531184bf8334Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
531284bf8334Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
531384bf8334Smrg*** your PATH or compiler configuration so that the native linker is
531484bf8334Smrg*** used, and then restart.
5315a73597f9Smrg
531684bf8334Smrg_LT_EOF
5317a73597f9Smrg	;;
531884bf8334Smrg	*)
531984bf8334Smrg	  # For security reasons, it is highly recommended that you always
532084bf8334Smrg	  # use absolute paths for naming shared libraries, and exclude the
532184bf8334Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
532284bf8334Smrg	  # requires that you compile everything twice, which is a pain.
532384bf8334Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5324e4da38afSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5325e4da38afSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5326e4da38afSmrg	    _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'
532784bf8334Smrg	  else
532884bf8334Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5329a73597f9Smrg	  fi
5330a73597f9Smrg	;;
533184bf8334Smrg      esac
533284bf8334Smrg      ;;
5333a73597f9Smrg
533484bf8334Smrg    sunos4*)
533584bf8334Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
533684bf8334Smrg      wlarc=
533784bf8334Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
533884bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
533984bf8334Smrg      ;;
5340a73597f9Smrg
534184bf8334Smrg    *)
534284bf8334Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5343e4da38afSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5344e4da38afSmrg	_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'
534584bf8334Smrg      else
534684bf8334Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
534784bf8334Smrg      fi
534884bf8334Smrg      ;;
534984bf8334Smrg    esac
5350a73597f9Smrg
5351e4da38afSmrg    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
535284bf8334Smrg      runpath_var=
535384bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
535484bf8334Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
535584bf8334Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
535684bf8334Smrg    fi
535784bf8334Smrg  else
535884bf8334Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
535984bf8334Smrg    case $host_os in
536084bf8334Smrg    aix3*)
536184bf8334Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
536284bf8334Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
536384bf8334Smrg      _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'
536484bf8334Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
536584bf8334Smrg      # are no directories specified by -L.
536684bf8334Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5367e4da38afSmrg      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
536884bf8334Smrg	# Neither direct hardcoding nor static linking is supported with a
536984bf8334Smrg	# broken collect2.
537084bf8334Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
537184bf8334Smrg      fi
537284bf8334Smrg      ;;
5373a73597f9Smrg
537484bf8334Smrg    aix[[4-9]]*)
5375e4da38afSmrg      if test ia64 = "$host_cpu"; then
537684bf8334Smrg	# On IA64, the linker does run time linking by default, so we don't
537784bf8334Smrg	# have to do anything special.
537884bf8334Smrg	aix_use_runtimelinking=no
537984bf8334Smrg	exp_sym_flag='-Bexport'
5380e4da38afSmrg	no_entry_flag=
538184bf8334Smrg      else
538284bf8334Smrg	# If we're using GNU nm, then we don't want the "-C" option.
5383e4da38afSmrg	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
5384e4da38afSmrg	# Without the "-l" option, or with the "-B" option, AIX nm treats
5385e4da38afSmrg	# weak defined symbols like other global defined symbols, whereas
5386e4da38afSmrg	# GNU nm marks them as "W".
5387e4da38afSmrg	# While the 'weak' keyword is ignored in the Export File, we need
5388e4da38afSmrg	# it in the Import File for the 'aix-soname' feature, so we have
5389e4da38afSmrg	# to replace the "-B" option with "-P" for AIX nm.
539084bf8334Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5391e4da38afSmrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
539284bf8334Smrg	else
5393e4da38afSmrg	  _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
539484bf8334Smrg	fi
539584bf8334Smrg	aix_use_runtimelinking=no
539684bf8334Smrg
539784bf8334Smrg	# Test if we are trying to use run time linking or normal
539884bf8334Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
5399e4da38afSmrg	# have runtime linking enabled, and use it for executables.
5400e4da38afSmrg	# For shared libraries, we enable/disable runtime linking
5401e4da38afSmrg	# depending on the kind of the shared library created -
5402e4da38afSmrg	# when "with_aix_soname,aix_use_runtimelinking" is:
5403e4da38afSmrg	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
5404e4da38afSmrg	# "aix,yes"  lib.so          shared, rtl:yes, for executables
5405e4da38afSmrg	#            lib.a           static archive
5406e4da38afSmrg	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
5407e4da38afSmrg	#            lib.a(lib.so.V) shared, rtl:no,  for executables
5408e4da38afSmrg	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
5409e4da38afSmrg	#            lib.a(lib.so.V) shared, rtl:no
5410e4da38afSmrg	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
5411e4da38afSmrg	#            lib.a           static archive
541284bf8334Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
541384bf8334Smrg	  for ld_flag in $LDFLAGS; do
5414e4da38afSmrg	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
541584bf8334Smrg	    aix_use_runtimelinking=yes
541684bf8334Smrg	    break
541784bf8334Smrg	  fi
541884bf8334Smrg	  done
5419e4da38afSmrg	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
5420e4da38afSmrg	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
5421e4da38afSmrg	    # so we don't have lib.a shared libs to link our executables.
5422e4da38afSmrg	    # We have to force runtime linking in this case.
5423e4da38afSmrg	    aix_use_runtimelinking=yes
5424e4da38afSmrg	    LDFLAGS="$LDFLAGS -Wl,-brtl"
5425e4da38afSmrg	  fi
542684bf8334Smrg	  ;;
542784bf8334Smrg	esac
5428a73597f9Smrg
542984bf8334Smrg	exp_sym_flag='-bexport'
543084bf8334Smrg	no_entry_flag='-bnoentry'
543184bf8334Smrg      fi
5432a73597f9Smrg
543384bf8334Smrg      # When large executables or shared objects are built, AIX ld can
543484bf8334Smrg      # have problems creating the table of contents.  If linking a library
543584bf8334Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
543684bf8334Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
543784bf8334Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5438a73597f9Smrg
543984bf8334Smrg      _LT_TAGVAR(archive_cmds, $1)=''
544084bf8334Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
544184bf8334Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
544284bf8334Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
544384bf8334Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5444e4da38afSmrg      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
5445e4da38afSmrg      case $with_aix_soname,$aix_use_runtimelinking in
5446e4da38afSmrg      aix,*) ;; # traditional, no import file
5447e4da38afSmrg      svr4,* | *,yes) # use import file
5448e4da38afSmrg	# The Import File defines what to hardcode.
5449e4da38afSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
5450e4da38afSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5451e4da38afSmrg	;;
5452e4da38afSmrg      esac
5453a73597f9Smrg
5454e4da38afSmrg      if test yes = "$GCC"; then
545584bf8334Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
545684bf8334Smrg	# We only want to do this on AIX 4.2 and lower, the check
545784bf8334Smrg	# below for broken collect2 doesn't work under 4.3+
5458e4da38afSmrg	  collect2name=`$CC -print-prog-name=collect2`
545984bf8334Smrg	  if test -f "$collect2name" &&
546084bf8334Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
546184bf8334Smrg	  then
546284bf8334Smrg	  # We have reworked collect2
546384bf8334Smrg	  :
546484bf8334Smrg	  else
546584bf8334Smrg	  # We have old collect2
546684bf8334Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
546784bf8334Smrg	  # It fails to find uninstalled libraries when the uninstalled
546884bf8334Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
546984bf8334Smrg	  # to unsupported forces relinking
547084bf8334Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
547184bf8334Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
547284bf8334Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
547384bf8334Smrg	  fi
547484bf8334Smrg	  ;;
547584bf8334Smrg	esac
547684bf8334Smrg	shared_flag='-shared'
5477e4da38afSmrg	if test yes = "$aix_use_runtimelinking"; then
5478e4da38afSmrg	  shared_flag="$shared_flag "'$wl-G'
547984bf8334Smrg	fi
5480e4da38afSmrg	# Need to ensure runtime linking is disabled for the traditional
5481e4da38afSmrg	# shared library, or the linker may eventually find shared libraries
5482e4da38afSmrg	# /with/ Import File - we do not want to mix them.
5483e4da38afSmrg	shared_flag_aix='-shared'
5484e4da38afSmrg	shared_flag_svr4='-shared $wl-G'
548584bf8334Smrg      else
548684bf8334Smrg	# not using gcc
5487e4da38afSmrg	if test ia64 = "$host_cpu"; then
548884bf8334Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
548984bf8334Smrg	# chokes on -Wl,-G. The following line is correct:
549084bf8334Smrg	  shared_flag='-G'
549184bf8334Smrg	else
5492e4da38afSmrg	  if test yes = "$aix_use_runtimelinking"; then
5493e4da38afSmrg	    shared_flag='$wl-G'
549484bf8334Smrg	  else
5495e4da38afSmrg	    shared_flag='$wl-bM:SRE'
549684bf8334Smrg	  fi
5497e4da38afSmrg	  shared_flag_aix='$wl-bM:SRE'
5498e4da38afSmrg	  shared_flag_svr4='$wl-G'
549984bf8334Smrg	fi
550084bf8334Smrg      fi
5501a73597f9Smrg
5502e4da38afSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
550384bf8334Smrg      # It seems that -bexpall does not export symbols beginning with
550484bf8334Smrg      # underscore (_), so it is better to generate a list of symbols to export.
550584bf8334Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
5506e4da38afSmrg      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
550784bf8334Smrg	# Warning - without using the other runtime loading flags (-brtl),
550884bf8334Smrg	# -berok will link without error, but may produce a broken library.
550984bf8334Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
551084bf8334Smrg        # Determine the default libpath from the value encoded in an
551184bf8334Smrg        # empty executable.
551284bf8334Smrg        _LT_SYS_MODULE_PATH_AIX([$1])
5513e4da38afSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5514e4da38afSmrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
551584bf8334Smrg      else
5516e4da38afSmrg	if test ia64 = "$host_cpu"; then
5517e4da38afSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
551884bf8334Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5519e4da38afSmrg	  _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"
552084bf8334Smrg	else
552184bf8334Smrg	 # Determine the default libpath from the value encoded in an
552284bf8334Smrg	 # empty executable.
552384bf8334Smrg	 _LT_SYS_MODULE_PATH_AIX([$1])
5524e4da38afSmrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
552584bf8334Smrg	  # Warning - without using the other run time loading flags,
552684bf8334Smrg	  # -berok will link without error, but may produce a broken library.
5527e4da38afSmrg	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
5528e4da38afSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
5529e4da38afSmrg	  if test yes = "$with_gnu_ld"; then
553084bf8334Smrg	    # We only use this code for GNU lds that support --whole-archive.
5531e4da38afSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
553284bf8334Smrg	  else
553384bf8334Smrg	    # Exported symbols can be pulled into shared objects from archives
553484bf8334Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
553584bf8334Smrg	  fi
553684bf8334Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5537e4da38afSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
5538e4da38afSmrg	  # -brtl affects multiple linker settings, -berok does not and is overridden later
5539e4da38afSmrg	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
5540e4da38afSmrg	  if test svr4 != "$with_aix_soname"; then
5541e4da38afSmrg	    # This is similar to how AIX traditionally builds its shared libraries.
5542e4da38afSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
5543e4da38afSmrg	  fi
5544e4da38afSmrg	  if test aix != "$with_aix_soname"; then
5545e4da38afSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
5546e4da38afSmrg	  else
5547e4da38afSmrg	    # used by -dlpreopen to get the symbols
5548e4da38afSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
5549e4da38afSmrg	  fi
5550e4da38afSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
555184bf8334Smrg	fi
555284bf8334Smrg      fi
555384bf8334Smrg      ;;
5554a73597f9Smrg
555584bf8334Smrg    amigaos*)
555684bf8334Smrg      case $host_cpu in
555784bf8334Smrg      powerpc)
555884bf8334Smrg            # see comment about AmigaOS4 .so support
5559e4da38afSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
556084bf8334Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5561a73597f9Smrg        ;;
556284bf8334Smrg      m68k)
556384bf8334Smrg            _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)'
556484bf8334Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
556584bf8334Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5566a73597f9Smrg        ;;
556784bf8334Smrg      esac
556884bf8334Smrg      ;;
5569a73597f9Smrg
557084bf8334Smrg    bsdi[[45]]*)
557184bf8334Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
557284bf8334Smrg      ;;
5573a73597f9Smrg
557484bf8334Smrg    cygwin* | mingw* | pw32* | cegcc*)
557584bf8334Smrg      # When not using gcc, we currently assume that we are using
557684bf8334Smrg      # Microsoft Visual C++.
557784bf8334Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
557884bf8334Smrg      # no search path for DLLs.
557984bf8334Smrg      case $cc_basename in
558084bf8334Smrg      cl*)
558184bf8334Smrg	# Native MSVC
558284bf8334Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
558384bf8334Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
558484bf8334Smrg	_LT_TAGVAR(always_export_symbols, $1)=yes
558584bf8334Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
558684bf8334Smrg	# Tell ltmain to make .lib files, not .a files.
558784bf8334Smrg	libext=lib
558884bf8334Smrg	# Tell ltmain to make .dll files, not .so files.
5589e4da38afSmrg	shrext_cmds=.dll
559084bf8334Smrg	# FIXME: Setting linknames here is a bad hack.
5591e4da38afSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
5592e4da38afSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5593e4da38afSmrg            cp "$export_symbols" "$output_objdir/$soname.def";
5594e4da38afSmrg            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
5595e4da38afSmrg          else
5596e4da38afSmrg            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
5597e4da38afSmrg          fi~
5598e4da38afSmrg          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5599e4da38afSmrg          linknames='
560084bf8334Smrg	# The linker will not automatically build a static lib if we build a DLL.
560184bf8334Smrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
560284bf8334Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
560384bf8334Smrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
560484bf8334Smrg	_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'
560584bf8334Smrg	# Don't use ranlib
560684bf8334Smrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
560784bf8334Smrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
5608e4da38afSmrg          lt_tool_outputfile="@TOOL_OUTPUT@"~
5609e4da38afSmrg          case $lt_outputfile in
5610e4da38afSmrg            *.exe|*.EXE) ;;
5611e4da38afSmrg            *)
5612e4da38afSmrg              lt_outputfile=$lt_outputfile.exe
5613e4da38afSmrg              lt_tool_outputfile=$lt_tool_outputfile.exe
5614e4da38afSmrg              ;;
5615e4da38afSmrg          esac~
5616e4da38afSmrg          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
5617e4da38afSmrg            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5618e4da38afSmrg            $RM "$lt_outputfile.manifest";
5619e4da38afSmrg          fi'
562084bf8334Smrg	;;
562184bf8334Smrg      *)
562284bf8334Smrg	# Assume MSVC wrapper
562384bf8334Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
562484bf8334Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
562584bf8334Smrg	# Tell ltmain to make .lib files, not .a files.
562684bf8334Smrg	libext=lib
562784bf8334Smrg	# Tell ltmain to make .dll files, not .so files.
5628e4da38afSmrg	shrext_cmds=.dll
562984bf8334Smrg	# FIXME: Setting linknames here is a bad hack.
563084bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
563184bf8334Smrg	# The linker will automatically build a .lib file if we build a DLL.
563284bf8334Smrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
563384bf8334Smrg	# FIXME: Should let the user specify the lib program.
563484bf8334Smrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
563584bf8334Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
563684bf8334Smrg	;;
563784bf8334Smrg      esac
563884bf8334Smrg      ;;
563984bf8334Smrg
564084bf8334Smrg    darwin* | rhapsody*)
564184bf8334Smrg      _LT_DARWIN_LINKER_FEATURES($1)
564284bf8334Smrg      ;;
5643a73597f9Smrg
564484bf8334Smrg    dgux*)
564584bf8334Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
564684bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
564784bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
564884bf8334Smrg      ;;
5649a73597f9Smrg
565084bf8334Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
565184bf8334Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
565284bf8334Smrg    # does not break anything, and helps significantly (at the cost of a little
565384bf8334Smrg    # extra space).
565484bf8334Smrg    freebsd2.2*)
565584bf8334Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
565684bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
565784bf8334Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
565884bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
565984bf8334Smrg      ;;
5660a73597f9Smrg
566184bf8334Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
566284bf8334Smrg    freebsd2.*)
566384bf8334Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
566484bf8334Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
566584bf8334Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
566684bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
566784bf8334Smrg      ;;
5668a73597f9Smrg
566984bf8334Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
567084bf8334Smrg    freebsd* | dragonfly*)
567184bf8334Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
567284bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
567384bf8334Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
567484bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
567584bf8334Smrg      ;;
5676a73597f9Smrg
567784bf8334Smrg    hpux9*)
5678e4da38afSmrg      if test yes = "$GCC"; then
5679e4da38afSmrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
568084bf8334Smrg      else
5681e4da38afSmrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
568284bf8334Smrg      fi
5683e4da38afSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
568484bf8334Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
568584bf8334Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5686a73597f9Smrg
568784bf8334Smrg      # hardcode_minus_L: Not really in the search PATH,
568884bf8334Smrg      # but as the default location of the library.
568984bf8334Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5690e4da38afSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
569184bf8334Smrg      ;;
5692a73597f9Smrg
569384bf8334Smrg    hpux10*)
5694e4da38afSmrg      if test yes,no = "$GCC,$with_gnu_ld"; then
5695e4da38afSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
569684bf8334Smrg      else
569784bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
569884bf8334Smrg      fi
5699e4da38afSmrg      if test no = "$with_gnu_ld"; then
5700e4da38afSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
570184bf8334Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
570284bf8334Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
570384bf8334Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5704e4da38afSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
570584bf8334Smrg	# hardcode_minus_L: Not really in the search PATH,
570684bf8334Smrg	# but as the default location of the library.
570784bf8334Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
570884bf8334Smrg      fi
570984bf8334Smrg      ;;
5710a73597f9Smrg
571184bf8334Smrg    hpux11*)
5712e4da38afSmrg      if test yes,no = "$GCC,$with_gnu_ld"; then
571384bf8334Smrg	case $host_cpu in
571484bf8334Smrg	hppa*64*)
5715e4da38afSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
571684bf8334Smrg	  ;;
571784bf8334Smrg	ia64*)
5718e4da38afSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5719a73597f9Smrg	  ;;
5720a73597f9Smrg	*)
5721e4da38afSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5722a73597f9Smrg	  ;;
572384bf8334Smrg	esac
572484bf8334Smrg      else
572584bf8334Smrg	case $host_cpu in
572684bf8334Smrg	hppa*64*)
5727e4da38afSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
572884bf8334Smrg	  ;;
572984bf8334Smrg	ia64*)
5730e4da38afSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
573184bf8334Smrg	  ;;
573284bf8334Smrg	*)
573384bf8334Smrg	m4_if($1, [], [
573484bf8334Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
573584bf8334Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
573684bf8334Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
573784bf8334Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
5738e4da38afSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
573984bf8334Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
5740e4da38afSmrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
574184bf8334Smrg	  ;;
574284bf8334Smrg	esac
574384bf8334Smrg      fi
5744e4da38afSmrg      if test no = "$with_gnu_ld"; then
5745e4da38afSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
574684bf8334Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5747a73597f9Smrg
574884bf8334Smrg	case $host_cpu in
574984bf8334Smrg	hppa*64*|ia64*)
575084bf8334Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
575184bf8334Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
575284bf8334Smrg	  ;;
575384bf8334Smrg	*)
575484bf8334Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
575584bf8334Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5756e4da38afSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5757a73597f9Smrg
575884bf8334Smrg	  # hardcode_minus_L: Not really in the search PATH,
575984bf8334Smrg	  # but as the default location of the library.
576084bf8334Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
576184bf8334Smrg	  ;;
5762b73be646Smrg	esac
576384bf8334Smrg      fi
5764a73597f9Smrg      ;;
5765a73597f9Smrg
576684bf8334Smrg    irix5* | irix6* | nonstopux*)
5767e4da38afSmrg      if test yes = "$GCC"; then
5768e4da38afSmrg	_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'
576984bf8334Smrg	# Try to use the -exported_symbol ld option, if it does not
577084bf8334Smrg	# work, assume that -exports_file does not work either and
577184bf8334Smrg	# implicitly export all symbols.
577284bf8334Smrg	# This should be the same for all languages, so no per-tag cache variable.
577384bf8334Smrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
577484bf8334Smrg	  [lt_cv_irix_exported_symbol],
5775e4da38afSmrg	  [save_LDFLAGS=$LDFLAGS
5776e4da38afSmrg	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
577784bf8334Smrg	   AC_LINK_IFELSE(
577884bf8334Smrg	     [AC_LANG_SOURCE(
577984bf8334Smrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
578084bf8334Smrg			      [C++], [[int foo (void) { return 0; }]],
578184bf8334Smrg			      [Fortran 77], [[
578284bf8334Smrg      subroutine foo
578384bf8334Smrg      end]],
578484bf8334Smrg			      [Fortran], [[
578584bf8334Smrg      subroutine foo
578684bf8334Smrg      end]])])],
578784bf8334Smrg	      [lt_cv_irix_exported_symbol=yes],
578884bf8334Smrg	      [lt_cv_irix_exported_symbol=no])
5789e4da38afSmrg           LDFLAGS=$save_LDFLAGS])
5790e4da38afSmrg	if test yes = "$lt_cv_irix_exported_symbol"; then
5791e4da38afSmrg          _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'
579284bf8334Smrg	fi
579384bf8334Smrg      else
5794e4da38afSmrg	_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'
5795e4da38afSmrg	_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'
579684bf8334Smrg      fi
579784bf8334Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5798e4da38afSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
579984bf8334Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
580084bf8334Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
580184bf8334Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
580284bf8334Smrg      ;;
5803659607e0Smrg
5804e4da38afSmrg    linux*)
5805e4da38afSmrg      case $cc_basename in
5806e4da38afSmrg      tcc*)
5807e4da38afSmrg	# Fabrice Bellard et al's Tiny C Compiler
5808e4da38afSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
5809e4da38afSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5810e4da38afSmrg	;;
5811e4da38afSmrg      esac
5812e4da38afSmrg      ;;
5813e4da38afSmrg
581484bf8334Smrg    netbsd*)
581584bf8334Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
581684bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
581784bf8334Smrg      else
581884bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
581984bf8334Smrg      fi
582084bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
582184bf8334Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
582284bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
582384bf8334Smrg      ;;
5824659607e0Smrg
582584bf8334Smrg    newsos6)
582684bf8334Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
582784bf8334Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5828e4da38afSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
582984bf8334Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
583084bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
583184bf8334Smrg      ;;
5832659607e0Smrg
583384bf8334Smrg    *nto* | *qnx*)
583484bf8334Smrg      ;;
5835bd3a1963Smrg
5836e4da38afSmrg    openbsd* | bitrig*)
583784bf8334Smrg      if test -f /usr/libexec/ld.so; then
583884bf8334Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
583984bf8334Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
584084bf8334Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5841e4da38afSmrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
584284bf8334Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5843e4da38afSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
5844e4da38afSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5845e4da38afSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
584684bf8334Smrg	else
5847e4da38afSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5848e4da38afSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
584984bf8334Smrg	fi
585084bf8334Smrg      else
585184bf8334Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
585284bf8334Smrg      fi
585384bf8334Smrg      ;;
5854659607e0Smrg
585584bf8334Smrg    os2*)
585684bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
585784bf8334Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
585884bf8334Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5859e4da38afSmrg      shrext_cmds=.dll
5860e4da38afSmrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5861e4da38afSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5862e4da38afSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5863e4da38afSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5864e4da38afSmrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5865e4da38afSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5866e4da38afSmrg	emximp -o $lib $output_objdir/$libname.def'
5867e4da38afSmrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5868e4da38afSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5869e4da38afSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5870e4da38afSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5871e4da38afSmrg	prefix_cmds="$SED"~
5872e4da38afSmrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
5873e4da38afSmrg	  prefix_cmds="$prefix_cmds -e 1d";
5874e4da38afSmrg	fi~
5875e4da38afSmrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5876e4da38afSmrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5877e4da38afSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5878e4da38afSmrg	emximp -o $lib $output_objdir/$libname.def'
5879e4da38afSmrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5880e4da38afSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
588184bf8334Smrg      ;;
5882659607e0Smrg
588384bf8334Smrg    osf3*)
5884e4da38afSmrg      if test yes = "$GCC"; then
5885e4da38afSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5886e4da38afSmrg	_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'
588784bf8334Smrg      else
588884bf8334Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5889e4da38afSmrg	_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'
589084bf8334Smrg      fi
589184bf8334Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5892e4da38afSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
589384bf8334Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
589484bf8334Smrg      ;;
5895659607e0Smrg
589684bf8334Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
5897e4da38afSmrg      if test yes = "$GCC"; then
5898e4da38afSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5899e4da38afSmrg	_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'
5900e4da38afSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
590184bf8334Smrg      else
590284bf8334Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5903e4da38afSmrg	_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'
590484bf8334Smrg	_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~
5905e4da38afSmrg          $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'
5906659607e0Smrg
590784bf8334Smrg	# Both c and cxx compiler support -rpath directly
590884bf8334Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
590984bf8334Smrg      fi
591084bf8334Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
591184bf8334Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
591284bf8334Smrg      ;;
5913659607e0Smrg
591484bf8334Smrg    solaris*)
591584bf8334Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
5916e4da38afSmrg      if test yes = "$GCC"; then
5917e4da38afSmrg	wlarc='$wl'
5918e4da38afSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
591984bf8334Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5920e4da38afSmrg          $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'
592184bf8334Smrg      else
592284bf8334Smrg	case `$CC -V 2>&1` in
592384bf8334Smrg	*"Compilers 5.0"*)
592484bf8334Smrg	  wlarc=''
5925e4da38afSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
592684bf8334Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5927e4da38afSmrg            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
592884bf8334Smrg	  ;;
592984bf8334Smrg	*)
5930e4da38afSmrg	  wlarc='$wl'
5931e4da38afSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
593284bf8334Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5933e4da38afSmrg            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
593484bf8334Smrg	  ;;
593584bf8334Smrg	esac
593684bf8334Smrg      fi
593784bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
593884bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
593984bf8334Smrg      case $host_os in
594084bf8334Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
594184bf8334Smrg      *)
594284bf8334Smrg	# The compiler driver will combine and reorder linker options,
5943e4da38afSmrg	# but understands '-z linker_flag'.  GCC discards it without '$wl',
594484bf8334Smrg	# but is careful enough not to reorder.
594584bf8334Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
5946e4da38afSmrg	if test yes = "$GCC"; then
5947e4da38afSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
594884bf8334Smrg	else
594984bf8334Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
595084bf8334Smrg	fi
595184bf8334Smrg	;;
595284bf8334Smrg      esac
595384bf8334Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
595484bf8334Smrg      ;;
5955bd3a1963Smrg
595684bf8334Smrg    sunos4*)
5957e4da38afSmrg      if test sequent = "$host_vendor"; then
595884bf8334Smrg	# Use $CC to link under sequent, because it throws in some extra .o
595984bf8334Smrg	# files that make .init and .fini sections work.
5960e4da38afSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
596184bf8334Smrg      else
596284bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
596384bf8334Smrg      fi
596484bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
596584bf8334Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
596684bf8334Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
596784bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
596884bf8334Smrg      ;;
5969659607e0Smrg
597084bf8334Smrg    sysv4)
597184bf8334Smrg      case $host_vendor in
597284bf8334Smrg	sni)
597384bf8334Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
597484bf8334Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
597584bf8334Smrg	;;
597684bf8334Smrg	siemens)
597784bf8334Smrg	  ## LD is ld it makes a PLAMLIB
597884bf8334Smrg	  ## CC just makes a GrossModule.
597984bf8334Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
598084bf8334Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
598184bf8334Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
598284bf8334Smrg        ;;
598384bf8334Smrg	motorola)
598484bf8334Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
598584bf8334Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
598684bf8334Smrg	;;
598784bf8334Smrg      esac
598884bf8334Smrg      runpath_var='LD_RUN_PATH'
598984bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
599084bf8334Smrg      ;;
5991659607e0Smrg
599284bf8334Smrg    sysv4.3*)
599384bf8334Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
599484bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
599584bf8334Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
599684bf8334Smrg      ;;
59976aab59a7Smrg
599884bf8334Smrg    sysv4*MP*)
599984bf8334Smrg      if test -d /usr/nec; then
600084bf8334Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
600184bf8334Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
600284bf8334Smrg	runpath_var=LD_RUN_PATH
600384bf8334Smrg	hardcode_runpath_var=yes
600484bf8334Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
600584bf8334Smrg      fi
600684bf8334Smrg      ;;
60076aab59a7Smrg
600884bf8334Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6009e4da38afSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
601084bf8334Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
601184bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
601284bf8334Smrg      runpath_var='LD_RUN_PATH'
60136aab59a7Smrg
6014e4da38afSmrg      if test yes = "$GCC"; then
6015e4da38afSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6016e4da38afSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
601784bf8334Smrg      else
6018e4da38afSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6019e4da38afSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
602084bf8334Smrg      fi
602184bf8334Smrg      ;;
60226aab59a7Smrg
602384bf8334Smrg    sysv5* | sco3.2v5* | sco5v6*)
6024e4da38afSmrg      # Note: We CANNOT use -z defs as we might desire, because we do not
602584bf8334Smrg      # link with -lc, and that would cause any symbols used from libc to
602684bf8334Smrg      # always be unresolved, which means just about no library would
602784bf8334Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
602884bf8334Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
602984bf8334Smrg      # as -z defs.
6030e4da38afSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
6031e4da38afSmrg      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
603284bf8334Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
603384bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6034e4da38afSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
603584bf8334Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
603684bf8334Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
6037e4da38afSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
603884bf8334Smrg      runpath_var='LD_RUN_PATH'
60396aab59a7Smrg
6040e4da38afSmrg      if test yes = "$GCC"; then
6041e4da38afSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6042e4da38afSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
604384bf8334Smrg      else
6044e4da38afSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6045e4da38afSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
604684bf8334Smrg      fi
604784bf8334Smrg      ;;
6048b73be646Smrg
604984bf8334Smrg    uts4*)
605084bf8334Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
605184bf8334Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
605284bf8334Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
605384bf8334Smrg      ;;
6054b73be646Smrg
605584bf8334Smrg    *)
605684bf8334Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
605784bf8334Smrg      ;;
6058a73597f9Smrg    esac
6059b73be646Smrg
6060e4da38afSmrg    if test sni = "$host_vendor"; then
606184bf8334Smrg      case $host in
606284bf8334Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6063e4da38afSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
606484bf8334Smrg	;;
606584bf8334Smrg      esac
606684bf8334Smrg    fi
606784bf8334Smrg  fi
606884bf8334Smrg])
606984bf8334SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6070e4da38afSmrgtest no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
6071b73be646Smrg
607284bf8334Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
6073b73be646Smrg
607484bf8334Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
607584bf8334Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
607684bf8334Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
607784bf8334Smrg    [The commands to extract the exported symbol list from a shared archive])
6078fc27e79cSmrg
607984bf8334Smrg#
608084bf8334Smrg# Do we need to explicitly link libc?
608184bf8334Smrg#
608284bf8334Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
608384bf8334Smrgx|xyes)
608484bf8334Smrg  # Assume -lc should be added
608584bf8334Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
60866aab59a7Smrg
6087e4da38afSmrg  if test yes,yes = "$GCC,$enable_shared"; then
608884bf8334Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
608984bf8334Smrg    *'~'*)
609084bf8334Smrg      # FIXME: we may have to deal with multi-command sequences.
6091b73be646Smrg      ;;
609284bf8334Smrg    '$CC '*)
609384bf8334Smrg      # Test whether the compiler implicitly links with -lc since on some
609484bf8334Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
609584bf8334Smrg      # to ld, don't add -lc before -lgcc.
609684bf8334Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
609784bf8334Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
609884bf8334Smrg	[$RM conftest*
609984bf8334Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
61006aab59a7Smrg
610184bf8334Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
610284bf8334Smrg	  soname=conftest
610384bf8334Smrg	  lib=conftest
610484bf8334Smrg	  libobjs=conftest.$ac_objext
610584bf8334Smrg	  deplibs=
610684bf8334Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
610784bf8334Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
610884bf8334Smrg	  compiler_flags=-v
610984bf8334Smrg	  linker_flags=-v
611084bf8334Smrg	  verstring=
611184bf8334Smrg	  output_objdir=.
611284bf8334Smrg	  libname=conftest
611384bf8334Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
611484bf8334Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
611584bf8334Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
611684bf8334Smrg	  then
611784bf8334Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
611884bf8334Smrg	  else
611984bf8334Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
612084bf8334Smrg	  fi
612184bf8334Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
612284bf8334Smrg	else
612384bf8334Smrg	  cat conftest.err 1>&5
612484bf8334Smrg	fi
612584bf8334Smrg	$RM conftest*
612684bf8334Smrg	])
612784bf8334Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
6128b73be646Smrg      ;;
6129b73be646Smrg    esac
613084bf8334Smrg  fi
6131a73597f9Smrg  ;;
6132fc27e79cSmrgesac
6133fc27e79cSmrg
613484bf8334Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
613584bf8334Smrg    [Whether or not to add -lc for building shared libraries])
613684bf8334Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
613784bf8334Smrg    [enable_shared_with_static_runtimes], [0],
613884bf8334Smrg    [Whether or not to disallow shared libs when runtime libs are static])
613984bf8334Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
614084bf8334Smrg    [Compiler flag to allow reflexive dlopens])
614184bf8334Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
614284bf8334Smrg    [Compiler flag to generate shared objects directly from archives])
614384bf8334Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
614484bf8334Smrg    [Whether the compiler copes with passing no objects directly])
614584bf8334Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
614684bf8334Smrg    [Create an old-style archive from a shared archive])
614784bf8334Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
614884bf8334Smrg    [Create a temporary old-style archive to link instead of a shared archive])
614984bf8334Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
615084bf8334Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
615184bf8334Smrg_LT_TAGDECL([], [module_cmds], [2],
615284bf8334Smrg    [Commands used to build a loadable module if different from building
615384bf8334Smrg    a shared archive.])
615484bf8334Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
615584bf8334Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
615684bf8334Smrg    [Whether we are building with GNU ld or not])
615784bf8334Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
615884bf8334Smrg    [Flag that allows shared libraries with undefined symbols to be built])
615984bf8334Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
616084bf8334Smrg    [Flag that enforces no undefined symbols])
616184bf8334Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
616284bf8334Smrg    [Flag to hardcode $libdir into a binary during linking.
616384bf8334Smrg    This must work even if $libdir does not exist])
616484bf8334Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
616584bf8334Smrg    [Whether we need a single "-rpath" flag with a separated argument])
616684bf8334Smrg_LT_TAGDECL([], [hardcode_direct], [0],
6167e4da38afSmrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
616884bf8334Smrg    DIR into the resulting binary])
616984bf8334Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
6170e4da38afSmrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
617184bf8334Smrg    DIR into the resulting binary and the resulting library dependency is
6172e4da38afSmrg    "absolute", i.e impossible to change by setting $shlibpath_var if the
617384bf8334Smrg    library is relocated])
617484bf8334Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
617584bf8334Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
617684bf8334Smrg    into the resulting binary])
617784bf8334Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
617884bf8334Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
617984bf8334Smrg    into the resulting binary])
618084bf8334Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
618184bf8334Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
618284bf8334Smrg    into the library and all subsequent libraries and executables linked
618384bf8334Smrg    against it])
618484bf8334Smrg_LT_TAGDECL([], [inherit_rpath], [0],
618584bf8334Smrg    [Set to yes if linker adds runtime paths of dependent libraries
618684bf8334Smrg    to runtime path list])
618784bf8334Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
618884bf8334Smrg    [Whether libtool must link a program against all its dependency libraries])
618984bf8334Smrg_LT_TAGDECL([], [always_export_symbols], [0],
619084bf8334Smrg    [Set to "yes" if exported symbols are required])
619184bf8334Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
619284bf8334Smrg    [The commands to list exported symbols])
619384bf8334Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
619484bf8334Smrg    [Symbols that should not be listed in the preloaded symbols])
619584bf8334Smrg_LT_TAGDECL([], [include_expsyms], [1],
619684bf8334Smrg    [Symbols that must always be exported])
619784bf8334Smrg_LT_TAGDECL([], [prelink_cmds], [2],
619884bf8334Smrg    [Commands necessary for linking programs (against libraries) with templates])
619984bf8334Smrg_LT_TAGDECL([], [postlink_cmds], [2],
620084bf8334Smrg    [Commands necessary for finishing linking programs])
620184bf8334Smrg_LT_TAGDECL([], [file_list_spec], [1],
620284bf8334Smrg    [Specify filename containing input files])
620384bf8334Smrgdnl FIXME: Not yet implemented
620484bf8334Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
620584bf8334Smrgdnl    [Compiler flag to generate thread safe objects])
620684bf8334Smrg])# _LT_LINKER_SHLIBS
6207a73597f9Smrg
62086aab59a7Smrg
620984bf8334Smrg# _LT_LANG_C_CONFIG([TAG])
621084bf8334Smrg# ------------------------
621184bf8334Smrg# Ensure that the configuration variables for a C compiler are suitably
621284bf8334Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
6213e4da38afSmrg# the compiler configuration to 'libtool'.
621484bf8334Smrgm4_defun([_LT_LANG_C_CONFIG],
621584bf8334Smrg[m4_require([_LT_DECL_EGREP])dnl
6216e4da38afSmrglt_save_CC=$CC
621784bf8334SmrgAC_LANG_PUSH(C)
62186aab59a7Smrg
621984bf8334Smrg# Source file extension for C test sources.
622084bf8334Smrgac_ext=c
62216aab59a7Smrg
622284bf8334Smrg# Object file extension for compiled C test sources.
6223a73597f9Smrgobjext=o
6224a73597f9Smrg_LT_TAGVAR(objext, $1)=$objext
6225fc27e79cSmrg
6226e4da38afSmrg# Code to be used in simple compile tests
6227e4da38afSmrglt_simple_compile_test_code="int some_variable = 0;"
6228e4da38afSmrg
6229e4da38afSmrg# Code to be used in simple link tests
6230e4da38afSmrglt_simple_link_test_code='int main(){return(0);}'
6231e4da38afSmrg
6232e4da38afSmrg_LT_TAG_COMPILER
6233e4da38afSmrg# Save the default compiler, since it gets overwritten when the other
6234e4da38afSmrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
6235e4da38afSmrgcompiler_DEFAULT=$CC
6236e4da38afSmrg
6237e4da38afSmrg# save warnings/boilerplate of simple test code
6238e4da38afSmrg_LT_COMPILER_BOILERPLATE
6239e4da38afSmrg_LT_LINKER_BOILERPLATE
6240e4da38afSmrg
6241e4da38afSmrgif test -n "$compiler"; then
6242e4da38afSmrg  _LT_COMPILER_NO_RTTI($1)
6243e4da38afSmrg  _LT_COMPILER_PIC($1)
6244e4da38afSmrg  _LT_COMPILER_C_O($1)
6245e4da38afSmrg  _LT_COMPILER_FILE_LOCKS($1)
6246e4da38afSmrg  _LT_LINKER_SHLIBS($1)
6247e4da38afSmrg  _LT_SYS_DYNAMIC_LINKER($1)
6248e4da38afSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
6249e4da38afSmrg  LT_SYS_DLOPEN_SELF
6250e4da38afSmrg  _LT_CMD_STRIPLIB
6251e4da38afSmrg
6252e4da38afSmrg  # Report what library types will actually be built
6253e4da38afSmrg  AC_MSG_CHECKING([if libtool supports shared libraries])
6254e4da38afSmrg  AC_MSG_RESULT([$can_build_shared])
6255e4da38afSmrg
6256e4da38afSmrg  AC_MSG_CHECKING([whether to build shared libraries])
6257e4da38afSmrg  test no = "$can_build_shared" && enable_shared=no
6258e4da38afSmrg
6259e4da38afSmrg  # On AIX, shared libraries and static libraries use the same namespace, and
6260e4da38afSmrg  # are all built from PIC.
6261e4da38afSmrg  case $host_os in
6262e4da38afSmrg  aix3*)
6263e4da38afSmrg    test yes = "$enable_shared" && enable_static=no
6264e4da38afSmrg    if test -n "$RANLIB"; then
6265e4da38afSmrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
6266e4da38afSmrg      postinstall_cmds='$RANLIB $lib'
6267e4da38afSmrg    fi
6268e4da38afSmrg    ;;
6269e4da38afSmrg
6270e4da38afSmrg  aix[[4-9]]*)
6271e4da38afSmrg    if test ia64 != "$host_cpu"; then
6272e4da38afSmrg      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
6273e4da38afSmrg      yes,aix,yes) ;;			# shared object as lib.so file only
6274e4da38afSmrg      yes,svr4,*) ;;			# shared object as lib.so archive member only
6275e4da38afSmrg      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
6276e4da38afSmrg      esac
6277e4da38afSmrg    fi
6278e4da38afSmrg    ;;
6279e4da38afSmrg  esac
6280e4da38afSmrg  AC_MSG_RESULT([$enable_shared])
6281e4da38afSmrg
6282e4da38afSmrg  AC_MSG_CHECKING([whether to build static libraries])
6283e4da38afSmrg  # Make sure either enable_shared or enable_static is yes.
6284e4da38afSmrg  test yes = "$enable_shared" || enable_static=yes
6285e4da38afSmrg  AC_MSG_RESULT([$enable_static])
6286e4da38afSmrg
6287e4da38afSmrg  _LT_CONFIG($1)
6288e4da38afSmrgfi
6289e4da38afSmrgAC_LANG_POP
6290e4da38afSmrgCC=$lt_save_CC
6291e4da38afSmrg])# _LT_LANG_C_CONFIG
6292e4da38afSmrg
6293e4da38afSmrg
6294e4da38afSmrg# _LT_LANG_CXX_CONFIG([TAG])
6295e4da38afSmrg# --------------------------
6296e4da38afSmrg# Ensure that the configuration variables for a C++ compiler are suitably
6297e4da38afSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
6298e4da38afSmrg# the compiler configuration to 'libtool'.
6299e4da38afSmrgm4_defun([_LT_LANG_CXX_CONFIG],
6300e4da38afSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6301e4da38afSmrgm4_require([_LT_DECL_EGREP])dnl
6302e4da38afSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
6303e4da38afSmrgif test -n "$CXX" && ( test no != "$CXX" &&
6304e4da38afSmrg    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
6305e4da38afSmrg    (test g++ != "$CXX"))); then
6306e4da38afSmrg  AC_PROG_CXXCPP
6307e4da38afSmrgelse
6308e4da38afSmrg  _lt_caught_CXX_error=yes
6309e4da38afSmrgfi
6310e4da38afSmrg
6311e4da38afSmrgAC_LANG_PUSH(C++)
6312e4da38afSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6313e4da38afSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
6314e4da38afSmrg_LT_TAGVAR(always_export_symbols, $1)=no
6315e4da38afSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
6316e4da38afSmrg_LT_TAGVAR(compiler_needs_object, $1)=no
6317e4da38afSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6318e4da38afSmrg_LT_TAGVAR(hardcode_direct, $1)=no
6319e4da38afSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6320e4da38afSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6321e4da38afSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
6322e4da38afSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
6323e4da38afSmrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6324e4da38afSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
6325e4da38afSmrg_LT_TAGVAR(inherit_rpath, $1)=no
6326e4da38afSmrg_LT_TAGVAR(module_cmds, $1)=
6327e4da38afSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
6328e4da38afSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
6329e4da38afSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6330e4da38afSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
6331e4da38afSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6332e4da38afSmrg_LT_TAGVAR(no_undefined_flag, $1)=
6333e4da38afSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
6334e4da38afSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6335e4da38afSmrg
6336e4da38afSmrg# Source file extension for C++ test sources.
6337e4da38afSmrgac_ext=cpp
6338e4da38afSmrg
6339e4da38afSmrg# Object file extension for compiled C++ test sources.
6340e4da38afSmrgobjext=o
6341e4da38afSmrg_LT_TAGVAR(objext, $1)=$objext
6342e4da38afSmrg
6343e4da38afSmrg# No sense in running all these tests if we already determined that
6344e4da38afSmrg# the CXX compiler isn't working.  Some variables (like enable_shared)
6345e4da38afSmrg# are currently assumed to apply to all compilers on this platform,
6346e4da38afSmrg# and will be corrupted by setting them based on a non-working compiler.
6347e4da38afSmrgif test yes != "$_lt_caught_CXX_error"; then
6348e4da38afSmrg  # Code to be used in simple compile tests
6349e4da38afSmrg  lt_simple_compile_test_code="int some_variable = 0;"
6350e4da38afSmrg
6351e4da38afSmrg  # Code to be used in simple link tests
6352e4da38afSmrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
6353e4da38afSmrg
6354e4da38afSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6355e4da38afSmrg  _LT_TAG_COMPILER
6356e4da38afSmrg
6357e4da38afSmrg  # save warnings/boilerplate of simple test code
6358e4da38afSmrg  _LT_COMPILER_BOILERPLATE
6359e4da38afSmrg  _LT_LINKER_BOILERPLATE
6360e4da38afSmrg
6361e4da38afSmrg  # Allow CC to be a program name with arguments.
6362e4da38afSmrg  lt_save_CC=$CC
6363e4da38afSmrg  lt_save_CFLAGS=$CFLAGS
6364e4da38afSmrg  lt_save_LD=$LD
6365e4da38afSmrg  lt_save_GCC=$GCC
6366e4da38afSmrg  GCC=$GXX
6367e4da38afSmrg  lt_save_with_gnu_ld=$with_gnu_ld
6368e4da38afSmrg  lt_save_path_LD=$lt_cv_path_LD
6369e4da38afSmrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
6370e4da38afSmrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
6371e4da38afSmrg  else
6372e4da38afSmrg    $as_unset lt_cv_prog_gnu_ld
6373e4da38afSmrg  fi
6374e4da38afSmrg  if test -n "${lt_cv_path_LDCXX+set}"; then
6375e4da38afSmrg    lt_cv_path_LD=$lt_cv_path_LDCXX
6376e4da38afSmrg  else
6377e4da38afSmrg    $as_unset lt_cv_path_LD
6378e4da38afSmrg  fi
6379e4da38afSmrg  test -z "${LDCXX+set}" || LD=$LDCXX
6380e4da38afSmrg  CC=${CXX-"c++"}
6381e4da38afSmrg  CFLAGS=$CXXFLAGS
6382e4da38afSmrg  compiler=$CC
6383e4da38afSmrg  _LT_TAGVAR(compiler, $1)=$CC
6384e4da38afSmrg  _LT_CC_BASENAME([$compiler])
6385e4da38afSmrg
6386e4da38afSmrg  if test -n "$compiler"; then
6387e4da38afSmrg    # We don't want -fno-exception when compiling C++ code, so set the
6388e4da38afSmrg    # no_builtin_flag separately
6389e4da38afSmrg    if test yes = "$GXX"; then
6390e4da38afSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
6391e4da38afSmrg    else
6392e4da38afSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
6393e4da38afSmrg    fi
6394e4da38afSmrg
6395e4da38afSmrg    if test yes = "$GXX"; then
6396e4da38afSmrg      # Set up default GNU C++ configuration
6397e4da38afSmrg
6398e4da38afSmrg      LT_PATH_LD
6399e4da38afSmrg
6400e4da38afSmrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
6401e4da38afSmrg      # archiving commands below assume that GNU ld is being used.
6402e4da38afSmrg      if test yes = "$with_gnu_ld"; then
6403e4da38afSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6404e4da38afSmrg        _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'
6405e4da38afSmrg
6406e4da38afSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6407e4da38afSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6408e4da38afSmrg
6409e4da38afSmrg        # If archive_cmds runs LD, not CC, wlarc should be empty
6410e4da38afSmrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
6411e4da38afSmrg        #     investigate it a little bit more. (MM)
6412e4da38afSmrg        wlarc='$wl'
6413e4da38afSmrg
6414e4da38afSmrg        # ancient GNU ld didn't support --whole-archive et. al.
6415e4da38afSmrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
6416e4da38afSmrg	  $GREP 'no-whole-archive' > /dev/null; then
6417e4da38afSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
6418e4da38afSmrg        else
6419e4da38afSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
6420e4da38afSmrg        fi
6421e4da38afSmrg      else
6422e4da38afSmrg        with_gnu_ld=no
6423e4da38afSmrg        wlarc=
6424e4da38afSmrg
6425e4da38afSmrg        # A generic and very simple default shared library creation
6426e4da38afSmrg        # command for GNU C++ for the case where it uses the native
6427e4da38afSmrg        # linker, instead of GNU ld.  If possible, this setting should
6428e4da38afSmrg        # overridden to take advantage of the native linker features on
6429e4da38afSmrg        # the platform it is being used on.
6430e4da38afSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6431e4da38afSmrg      fi
6432e4da38afSmrg
6433e4da38afSmrg      # Commands to make compiler produce verbose output that lists
6434e4da38afSmrg      # what "hidden" libraries, object files and flags are used when
6435e4da38afSmrg      # linking a shared library.
6436e4da38afSmrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6437e4da38afSmrg
6438e4da38afSmrg    else
6439e4da38afSmrg      GXX=no
6440e4da38afSmrg      with_gnu_ld=no
6441e4da38afSmrg      wlarc=
6442e4da38afSmrg    fi
6443e4da38afSmrg
6444e4da38afSmrg    # PORTME: fill in a description of your system's C++ link characteristics
6445e4da38afSmrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
6446e4da38afSmrg    _LT_TAGVAR(ld_shlibs, $1)=yes
6447e4da38afSmrg    case $host_os in
6448e4da38afSmrg      aix3*)
6449e4da38afSmrg        # FIXME: insert proper C++ library support
6450e4da38afSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6451e4da38afSmrg        ;;
6452e4da38afSmrg      aix[[4-9]]*)
6453e4da38afSmrg        if test ia64 = "$host_cpu"; then
6454e4da38afSmrg          # On IA64, the linker does run time linking by default, so we don't
6455e4da38afSmrg          # have to do anything special.
6456e4da38afSmrg          aix_use_runtimelinking=no
6457e4da38afSmrg          exp_sym_flag='-Bexport'
6458e4da38afSmrg          no_entry_flag=
6459e4da38afSmrg        else
6460e4da38afSmrg          aix_use_runtimelinking=no
6461a73597f9Smrg
6462e4da38afSmrg          # Test if we are trying to use run time linking or normal
6463e4da38afSmrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
6464e4da38afSmrg          # have runtime linking enabled, and use it for executables.
6465e4da38afSmrg          # For shared libraries, we enable/disable runtime linking
6466e4da38afSmrg          # depending on the kind of the shared library created -
6467e4da38afSmrg          # when "with_aix_soname,aix_use_runtimelinking" is:
6468e4da38afSmrg          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
6469e4da38afSmrg          # "aix,yes"  lib.so          shared, rtl:yes, for executables
6470e4da38afSmrg          #            lib.a           static archive
6471e4da38afSmrg          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
6472e4da38afSmrg          #            lib.a(lib.so.V) shared, rtl:no,  for executables
6473e4da38afSmrg          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
6474e4da38afSmrg          #            lib.a(lib.so.V) shared, rtl:no
6475e4da38afSmrg          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
6476e4da38afSmrg          #            lib.a           static archive
6477e4da38afSmrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6478e4da38afSmrg	    for ld_flag in $LDFLAGS; do
6479e4da38afSmrg	      case $ld_flag in
6480e4da38afSmrg	      *-brtl*)
6481e4da38afSmrg	        aix_use_runtimelinking=yes
6482e4da38afSmrg	        break
6483e4da38afSmrg	        ;;
6484e4da38afSmrg	      esac
6485e4da38afSmrg	    done
6486e4da38afSmrg	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
6487e4da38afSmrg	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
6488e4da38afSmrg	      # so we don't have lib.a shared libs to link our executables.
6489e4da38afSmrg	      # We have to force runtime linking in this case.
6490e4da38afSmrg	      aix_use_runtimelinking=yes
6491e4da38afSmrg	      LDFLAGS="$LDFLAGS -Wl,-brtl"
6492e4da38afSmrg	    fi
6493e4da38afSmrg	    ;;
6494e4da38afSmrg          esac
6495a73597f9Smrg
6496e4da38afSmrg          exp_sym_flag='-bexport'
6497e4da38afSmrg          no_entry_flag='-bnoentry'
6498e4da38afSmrg        fi
6499bd3a1963Smrg
6500e4da38afSmrg        # When large executables or shared objects are built, AIX ld can
6501e4da38afSmrg        # have problems creating the table of contents.  If linking a library
6502e4da38afSmrg        # or program results in "error TOC overflow" add -mminimal-toc to
6503e4da38afSmrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6504e4da38afSmrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
65056aab59a7Smrg
6506e4da38afSmrg        _LT_TAGVAR(archive_cmds, $1)=''
6507e4da38afSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
6508e4da38afSmrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6509e4da38afSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6510e4da38afSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
6511e4da38afSmrg        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
6512e4da38afSmrg        case $with_aix_soname,$aix_use_runtimelinking in
6513e4da38afSmrg        aix,*) ;;	# no import file
6514e4da38afSmrg        svr4,* | *,yes) # use import file
6515e4da38afSmrg          # The Import File defines what to hardcode.
6516e4da38afSmrg          _LT_TAGVAR(hardcode_direct, $1)=no
6517e4da38afSmrg          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6518e4da38afSmrg          ;;
6519e4da38afSmrg        esac
65206aab59a7Smrg
6521e4da38afSmrg        if test yes = "$GXX"; then
6522e4da38afSmrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
6523e4da38afSmrg          # We only want to do this on AIX 4.2 and lower, the check
6524e4da38afSmrg          # below for broken collect2 doesn't work under 4.3+
6525e4da38afSmrg	  collect2name=`$CC -print-prog-name=collect2`
6526e4da38afSmrg	  if test -f "$collect2name" &&
6527e4da38afSmrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6528e4da38afSmrg	  then
6529e4da38afSmrg	    # We have reworked collect2
6530e4da38afSmrg	    :
6531e4da38afSmrg	  else
6532e4da38afSmrg	    # We have old collect2
6533e4da38afSmrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
6534e4da38afSmrg	    # It fails to find uninstalled libraries when the uninstalled
6535e4da38afSmrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
6536e4da38afSmrg	    # to unsupported forces relinking
6537e4da38afSmrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
6538e4da38afSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6539e4da38afSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
6540e4da38afSmrg	  fi
6541e4da38afSmrg          esac
6542e4da38afSmrg          shared_flag='-shared'
6543e4da38afSmrg	  if test yes = "$aix_use_runtimelinking"; then
6544e4da38afSmrg	    shared_flag=$shared_flag' $wl-G'
6545e4da38afSmrg	  fi
6546e4da38afSmrg	  # Need to ensure runtime linking is disabled for the traditional
6547e4da38afSmrg	  # shared library, or the linker may eventually find shared libraries
6548e4da38afSmrg	  # /with/ Import File - we do not want to mix them.
6549e4da38afSmrg	  shared_flag_aix='-shared'
6550e4da38afSmrg	  shared_flag_svr4='-shared $wl-G'
6551e4da38afSmrg        else
6552e4da38afSmrg          # not using gcc
6553e4da38afSmrg          if test ia64 = "$host_cpu"; then
6554e4da38afSmrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6555e4da38afSmrg	  # chokes on -Wl,-G. The following line is correct:
6556e4da38afSmrg	  shared_flag='-G'
6557e4da38afSmrg          else
6558e4da38afSmrg	    if test yes = "$aix_use_runtimelinking"; then
6559e4da38afSmrg	      shared_flag='$wl-G'
6560e4da38afSmrg	    else
6561e4da38afSmrg	      shared_flag='$wl-bM:SRE'
6562e4da38afSmrg	    fi
6563e4da38afSmrg	    shared_flag_aix='$wl-bM:SRE'
6564e4da38afSmrg	    shared_flag_svr4='$wl-G'
6565e4da38afSmrg          fi
6566e4da38afSmrg        fi
65676aab59a7Smrg
6568e4da38afSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
6569e4da38afSmrg        # It seems that -bexpall does not export symbols beginning with
6570e4da38afSmrg        # underscore (_), so it is better to generate a list of symbols to
6571e4da38afSmrg	# export.
6572e4da38afSmrg        _LT_TAGVAR(always_export_symbols, $1)=yes
6573e4da38afSmrg	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
6574e4da38afSmrg          # Warning - without using the other runtime loading flags (-brtl),
6575e4da38afSmrg          # -berok will link without error, but may produce a broken library.
6576e4da38afSmrg          # The "-G" linker flag allows undefined symbols.
6577e4da38afSmrg          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
6578e4da38afSmrg          # Determine the default libpath from the value encoded in an empty
6579e4da38afSmrg          # executable.
6580e4da38afSmrg          _LT_SYS_MODULE_PATH_AIX([$1])
6581e4da38afSmrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
65826aab59a7Smrg
6583e4da38afSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
6584e4da38afSmrg        else
6585e4da38afSmrg          if test ia64 = "$host_cpu"; then
6586e4da38afSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
6587e4da38afSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6588e4da38afSmrg	    _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"
6589e4da38afSmrg          else
6590e4da38afSmrg	    # Determine the default libpath from the value encoded in an
6591e4da38afSmrg	    # empty executable.
6592e4da38afSmrg	    _LT_SYS_MODULE_PATH_AIX([$1])
6593e4da38afSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
6594e4da38afSmrg	    # Warning - without using the other run time loading flags,
6595e4da38afSmrg	    # -berok will link without error, but may produce a broken library.
6596e4da38afSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
6597e4da38afSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
6598e4da38afSmrg	    if test yes = "$with_gnu_ld"; then
6599e4da38afSmrg	      # We only use this code for GNU lds that support --whole-archive.
6600e4da38afSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
6601e4da38afSmrg	    else
6602e4da38afSmrg	      # Exported symbols can be pulled into shared objects from archives
6603e4da38afSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6604e4da38afSmrg	    fi
6605e4da38afSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6606e4da38afSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
6607e4da38afSmrg	    # -brtl affects multiple linker settings, -berok does not and is overridden later
6608e4da38afSmrg	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
6609e4da38afSmrg	    if test svr4 != "$with_aix_soname"; then
6610e4da38afSmrg	      # This is similar to how AIX traditionally builds its shared
6611e4da38afSmrg	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
6612e4da38afSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
6613e4da38afSmrg	    fi
6614e4da38afSmrg	    if test aix != "$with_aix_soname"; then
6615e4da38afSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
6616e4da38afSmrg	    else
6617e4da38afSmrg	      # used by -dlpreopen to get the symbols
6618e4da38afSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
6619e4da38afSmrg	    fi
6620e4da38afSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
6621e4da38afSmrg          fi
6622e4da38afSmrg        fi
6623e4da38afSmrg        ;;
66246aab59a7Smrg
6625e4da38afSmrg      beos*)
6626e4da38afSmrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6627e4da38afSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6628e4da38afSmrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
6629e4da38afSmrg	  # support --undefined.  This deserves some investigation.  FIXME
6630e4da38afSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6631e4da38afSmrg	else
6632e4da38afSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6633e4da38afSmrg	fi
6634e4da38afSmrg	;;
663584bf8334Smrg
6636e4da38afSmrg      chorus*)
6637e4da38afSmrg        case $cc_basename in
6638e4da38afSmrg          *)
6639e4da38afSmrg	  # FIXME: insert proper C++ library support
6640e4da38afSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6641e4da38afSmrg	  ;;
6642e4da38afSmrg        esac
6643e4da38afSmrg        ;;
6644fc27e79cSmrg
6645e4da38afSmrg      cygwin* | mingw* | pw32* | cegcc*)
6646e4da38afSmrg	case $GXX,$cc_basename in
6647e4da38afSmrg	,cl* | no,cl*)
6648e4da38afSmrg	  # Native MSVC
6649e4da38afSmrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
6650e4da38afSmrg	  # no search path for DLLs.
6651e4da38afSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6652e4da38afSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6653e4da38afSmrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
6654e4da38afSmrg	  _LT_TAGVAR(file_list_spec, $1)='@'
6655e4da38afSmrg	  # Tell ltmain to make .lib files, not .a files.
6656e4da38afSmrg	  libext=lib
6657e4da38afSmrg	  # Tell ltmain to make .dll files, not .so files.
6658e4da38afSmrg	  shrext_cmds=.dll
6659e4da38afSmrg	  # FIXME: Setting linknames here is a bad hack.
6660e4da38afSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
6661e4da38afSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6662e4da38afSmrg              cp "$export_symbols" "$output_objdir/$soname.def";
6663e4da38afSmrg              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
6664e4da38afSmrg            else
6665e4da38afSmrg              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
6666e4da38afSmrg            fi~
6667e4da38afSmrg            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6668e4da38afSmrg            linknames='
6669e4da38afSmrg	  # The linker will not automatically build a static lib if we build a DLL.
6670e4da38afSmrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6671e4da38afSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6672e4da38afSmrg	  # Don't use ranlib
6673e4da38afSmrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6674e4da38afSmrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6675e4da38afSmrg            lt_tool_outputfile="@TOOL_OUTPUT@"~
6676e4da38afSmrg            case $lt_outputfile in
6677e4da38afSmrg              *.exe|*.EXE) ;;
6678e4da38afSmrg              *)
6679e4da38afSmrg                lt_outputfile=$lt_outputfile.exe
6680e4da38afSmrg                lt_tool_outputfile=$lt_tool_outputfile.exe
6681e4da38afSmrg                ;;
6682e4da38afSmrg            esac~
6683e4da38afSmrg            func_to_tool_file "$lt_outputfile"~
6684e4da38afSmrg            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
6685e4da38afSmrg              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6686e4da38afSmrg              $RM "$lt_outputfile.manifest";
6687e4da38afSmrg            fi'
6688e4da38afSmrg	  ;;
6689e4da38afSmrg	*)
6690e4da38afSmrg	  # g++
6691e4da38afSmrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6692e4da38afSmrg	  # as there is no search path for DLLs.
6693e4da38afSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6694e4da38afSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
6695e4da38afSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6696e4da38afSmrg	  _LT_TAGVAR(always_export_symbols, $1)=no
6697e4da38afSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6698fc27e79cSmrg
6699e4da38afSmrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6700e4da38afSmrg	    _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'
6701e4da38afSmrg	    # If the export-symbols file already is a .def file, use it as
6702e4da38afSmrg	    # is; otherwise, prepend EXPORTS...
6703e4da38afSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6704e4da38afSmrg              cp $export_symbols $output_objdir/$soname.def;
6705e4da38afSmrg            else
6706e4da38afSmrg              echo EXPORTS > $output_objdir/$soname.def;
6707e4da38afSmrg              cat $export_symbols >> $output_objdir/$soname.def;
6708e4da38afSmrg            fi~
6709e4da38afSmrg            $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'
6710e4da38afSmrg	  else
6711e4da38afSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6712e4da38afSmrg	  fi
6713e4da38afSmrg	  ;;
6714e4da38afSmrg	esac
6715e4da38afSmrg	;;
6716e4da38afSmrg      darwin* | rhapsody*)
6717e4da38afSmrg        _LT_DARWIN_LINKER_FEATURES($1)
6718e4da38afSmrg	;;
6719fc27e79cSmrg
6720e4da38afSmrg      os2*)
6721e4da38afSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6722e4da38afSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
6723e4da38afSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6724e4da38afSmrg	shrext_cmds=.dll
6725e4da38afSmrg	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6726e4da38afSmrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6727e4da38afSmrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6728e4da38afSmrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
6729e4da38afSmrg	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
6730e4da38afSmrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6731e4da38afSmrg	  emximp -o $lib $output_objdir/$libname.def'
6732e4da38afSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6733e4da38afSmrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6734e4da38afSmrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6735e4da38afSmrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
6736e4da38afSmrg	  prefix_cmds="$SED"~
6737e4da38afSmrg	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
6738e4da38afSmrg	    prefix_cmds="$prefix_cmds -e 1d";
6739e4da38afSmrg	  fi~
6740e4da38afSmrg	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
6741e4da38afSmrg	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
6742e4da38afSmrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6743e4da38afSmrg	  emximp -o $lib $output_objdir/$libname.def'
6744e4da38afSmrg	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
6745e4da38afSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6746e4da38afSmrg	;;
6747a73597f9Smrg
6748e4da38afSmrg      dgux*)
6749e4da38afSmrg        case $cc_basename in
6750e4da38afSmrg          ec++*)
6751e4da38afSmrg	    # FIXME: insert proper C++ library support
6752e4da38afSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6753e4da38afSmrg	    ;;
6754e4da38afSmrg          ghcx*)
6755e4da38afSmrg	    # Green Hills C++ Compiler
6756e4da38afSmrg	    # FIXME: insert proper C++ library support
6757e4da38afSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6758e4da38afSmrg	    ;;
6759e4da38afSmrg          *)
6760e4da38afSmrg	    # FIXME: insert proper C++ library support
6761e4da38afSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6762e4da38afSmrg	    ;;
6763e4da38afSmrg        esac
6764e4da38afSmrg        ;;
6765a73597f9Smrg
6766e4da38afSmrg      freebsd2.*)
6767e4da38afSmrg        # C++ shared libraries reported to be fairly broken before
6768e4da38afSmrg	# switch to ELF
6769e4da38afSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6770e4da38afSmrg        ;;
6771a73597f9Smrg
6772e4da38afSmrg      freebsd-elf*)
6773e4da38afSmrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6774e4da38afSmrg        ;;
6775a73597f9Smrg
6776e4da38afSmrg      freebsd* | dragonfly*)
6777e4da38afSmrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
6778e4da38afSmrg        # conventions
6779e4da38afSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
6780e4da38afSmrg        ;;
6781fc27e79cSmrg
6782e4da38afSmrg      haiku*)
6783e4da38afSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6784e4da38afSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
6785e4da38afSmrg        ;;
6786bd3a1963Smrg
6787e4da38afSmrg      hpux9*)
6788e4da38afSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
6789e4da38afSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6790e4da38afSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6791e4da38afSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
6792e4da38afSmrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6793e4da38afSmrg				             # but as the default
6794e4da38afSmrg				             # location of the library.
6795fc27e79cSmrg
6796e4da38afSmrg        case $cc_basename in
6797e4da38afSmrg          CC*)
6798e4da38afSmrg            # FIXME: insert proper C++ library support
6799e4da38afSmrg            _LT_TAGVAR(ld_shlibs, $1)=no
6800e4da38afSmrg            ;;
6801e4da38afSmrg          aCC*)
6802e4da38afSmrg            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
6803e4da38afSmrg            # Commands to make compiler produce verbose output that lists
6804e4da38afSmrg            # what "hidden" libraries, object files and flags are used when
6805e4da38afSmrg            # linking a shared library.
6806e4da38afSmrg            #
6807e4da38afSmrg            # There doesn't appear to be a way to prevent this compiler from
6808e4da38afSmrg            # explicitly linking system object files so we need to strip them
6809e4da38afSmrg            # from the output so that they don't get included in the library
6810e4da38afSmrg            # dependencies.
6811e4da38afSmrg            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"'
6812e4da38afSmrg            ;;
6813e4da38afSmrg          *)
6814e4da38afSmrg            if test yes = "$GXX"; then
6815e4da38afSmrg              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
6816e4da38afSmrg            else
6817e4da38afSmrg              # FIXME: insert proper C++ library support
6818e4da38afSmrg              _LT_TAGVAR(ld_shlibs, $1)=no
6819e4da38afSmrg            fi
6820e4da38afSmrg            ;;
6821e4da38afSmrg        esac
6822e4da38afSmrg        ;;
68236aab59a7Smrg
6824e4da38afSmrg      hpux10*|hpux11*)
6825e4da38afSmrg        if test no = "$with_gnu_ld"; then
6826e4da38afSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
6827e4da38afSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
68286aab59a7Smrg
6829e4da38afSmrg          case $host_cpu in
6830e4da38afSmrg            hppa*64*|ia64*)
6831e4da38afSmrg              ;;
6832e4da38afSmrg            *)
6833e4da38afSmrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6834e4da38afSmrg              ;;
6835e4da38afSmrg          esac
6836e4da38afSmrg        fi
6837e4da38afSmrg        case $host_cpu in
6838e4da38afSmrg          hppa*64*|ia64*)
6839e4da38afSmrg            _LT_TAGVAR(hardcode_direct, $1)=no
6840e4da38afSmrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6841e4da38afSmrg            ;;
6842e4da38afSmrg          *)
6843e4da38afSmrg            _LT_TAGVAR(hardcode_direct, $1)=yes
6844e4da38afSmrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6845e4da38afSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6846e4da38afSmrg					         # but as the default
6847e4da38afSmrg					         # location of the library.
6848e4da38afSmrg            ;;
6849e4da38afSmrg        esac
68506aab59a7Smrg
6851e4da38afSmrg        case $cc_basename in
6852e4da38afSmrg          CC*)
6853e4da38afSmrg	    # FIXME: insert proper C++ library support
6854e4da38afSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6855e4da38afSmrg	    ;;
6856e4da38afSmrg          aCC*)
6857e4da38afSmrg	    case $host_cpu in
6858e4da38afSmrg	      hppa*64*)
6859e4da38afSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6860e4da38afSmrg	        ;;
6861e4da38afSmrg	      ia64*)
6862e4da38afSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6863e4da38afSmrg	        ;;
6864e4da38afSmrg	      *)
6865e4da38afSmrg	        _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'
6866e4da38afSmrg	        ;;
6867e4da38afSmrg	    esac
6868e4da38afSmrg	    # Commands to make compiler produce verbose output that lists
6869e4da38afSmrg	    # what "hidden" libraries, object files and flags are used when
6870e4da38afSmrg	    # linking a shared library.
6871e4da38afSmrg	    #
6872e4da38afSmrg	    # There doesn't appear to be a way to prevent this compiler from
6873e4da38afSmrg	    # explicitly linking system object files so we need to strip them
6874e4da38afSmrg	    # from the output so that they don't get included in the library
6875e4da38afSmrg	    # dependencies.
6876e4da38afSmrg	    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"'
6877e4da38afSmrg	    ;;
6878e4da38afSmrg          *)
6879e4da38afSmrg	    if test yes = "$GXX"; then
6880e4da38afSmrg	      if test no = "$with_gnu_ld"; then
6881e4da38afSmrg	        case $host_cpu in
6882e4da38afSmrg	          hppa*64*)
6883e4da38afSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6884e4da38afSmrg	            ;;
6885e4da38afSmrg	          ia64*)
6886e4da38afSmrg	            _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'
6887e4da38afSmrg	            ;;
6888e4da38afSmrg	          *)
6889e4da38afSmrg	            _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'
6890e4da38afSmrg	            ;;
6891e4da38afSmrg	        esac
6892e4da38afSmrg	      fi
6893e4da38afSmrg	    else
6894e4da38afSmrg	      # FIXME: insert proper C++ library support
6895e4da38afSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
6896e4da38afSmrg	    fi
6897e4da38afSmrg	    ;;
6898e4da38afSmrg        esac
6899e4da38afSmrg        ;;
69006aab59a7Smrg
6901e4da38afSmrg      interix[[3-9]]*)
6902e4da38afSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
6903e4da38afSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6904e4da38afSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6905e4da38afSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6906e4da38afSmrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
6907e4da38afSmrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
6908e4da38afSmrg	# default) and relocated if they conflict, which is a slow very memory
6909e4da38afSmrg	# consuming and fragmenting process.  To avoid this, we pick a random,
6910e4da38afSmrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
6911e4da38afSmrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
6912e4da38afSmrg	_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'
6913e4da38afSmrg	_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'
6914e4da38afSmrg	;;
6915e4da38afSmrg      irix5* | irix6*)
6916e4da38afSmrg        case $cc_basename in
6917e4da38afSmrg          CC*)
6918e4da38afSmrg	    # SGI C++
6919e4da38afSmrg	    _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'
6920659607e0Smrg
6921e4da38afSmrg	    # Archives containing C++ object files must be created using
6922e4da38afSmrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
6923e4da38afSmrg	    # necessary to make sure instantiated templates are included
6924e4da38afSmrg	    # in the archive.
6925e4da38afSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
6926e4da38afSmrg	    ;;
6927e4da38afSmrg          *)
6928e4da38afSmrg	    if test yes = "$GXX"; then
6929e4da38afSmrg	      if test no = "$with_gnu_ld"; then
6930e4da38afSmrg	        _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'
6931e4da38afSmrg	      else
6932e4da38afSmrg	        _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'
6933e4da38afSmrg	      fi
6934e4da38afSmrg	    fi
6935e4da38afSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6936e4da38afSmrg	    ;;
6937e4da38afSmrg        esac
6938e4da38afSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6939e4da38afSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6940e4da38afSmrg        _LT_TAGVAR(inherit_rpath, $1)=yes
6941e4da38afSmrg        ;;
6942fc27e79cSmrg
6943e4da38afSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
6944e4da38afSmrg        case $cc_basename in
6945e4da38afSmrg          KCC*)
6946e4da38afSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6947fc27e79cSmrg
6948e4da38afSmrg	    # KCC will only create a shared library if the output file
6949e4da38afSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6950e4da38afSmrg	    # to its proper name (with version) after linking.
6951e4da38afSmrg	    _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'
6952e4da38afSmrg	    _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'
6953e4da38afSmrg	    # Commands to make compiler produce verbose output that lists
6954e4da38afSmrg	    # what "hidden" libraries, object files and flags are used when
6955e4da38afSmrg	    # linking a shared library.
6956e4da38afSmrg	    #
6957e4da38afSmrg	    # There doesn't appear to be a way to prevent this compiler from
6958e4da38afSmrg	    # explicitly linking system object files so we need to strip them
6959e4da38afSmrg	    # from the output so that they don't get included in the library
6960e4da38afSmrg	    # dependencies.
6961e4da38afSmrg	    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"'
6962e4da38afSmrg
6963e4da38afSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6964e4da38afSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6965e4da38afSmrg
6966e4da38afSmrg	    # Archives containing C++ object files must be created using
6967e4da38afSmrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
6968e4da38afSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
6969e4da38afSmrg	    ;;
6970e4da38afSmrg	  icpc* | ecpc* )
6971e4da38afSmrg	    # Intel C++
6972e4da38afSmrg	    with_gnu_ld=yes
6973e4da38afSmrg	    # version 8.0 and above of icpc choke on multiply defined symbols
6974e4da38afSmrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
6975e4da38afSmrg	    # earlier do not add the objects themselves.
6976e4da38afSmrg	    case `$CC -V 2>&1` in
6977e4da38afSmrg	      *"Version 7."*)
6978e4da38afSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6979e4da38afSmrg		_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'
6980e4da38afSmrg		;;
6981e4da38afSmrg	      *)  # Version 8.0 or newer
6982e4da38afSmrg	        tmp_idyn=
6983e4da38afSmrg	        case $host_cpu in
6984e4da38afSmrg		  ia64*) tmp_idyn=' -i_dynamic';;
6985e4da38afSmrg		esac
6986e4da38afSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6987e4da38afSmrg		_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'
6988e4da38afSmrg		;;
6989e4da38afSmrg	    esac
6990e4da38afSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6991e4da38afSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6992e4da38afSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6993e4da38afSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
6994e4da38afSmrg	    ;;
6995e4da38afSmrg          pgCC* | pgcpp*)
6996e4da38afSmrg            # Portland Group C++ compiler
6997e4da38afSmrg	    case `$CC -V` in
6998e4da38afSmrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
6999e4da38afSmrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
7000e4da38afSmrg               rm -rf $tpldir~
7001e4da38afSmrg               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
7002e4da38afSmrg               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
7003e4da38afSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
7004e4da38afSmrg                rm -rf $tpldir~
7005e4da38afSmrg                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
7006e4da38afSmrg                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
7007e4da38afSmrg                $RANLIB $oldlib'
7008e4da38afSmrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
7009e4da38afSmrg                rm -rf $tpldir~
7010e4da38afSmrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7011e4da38afSmrg                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7012e4da38afSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
7013e4da38afSmrg                rm -rf $tpldir~
7014e4da38afSmrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7015e4da38afSmrg                $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'
7016e4da38afSmrg	      ;;
7017e4da38afSmrg	    *) # Version 6 and above use weak symbols
7018e4da38afSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7019e4da38afSmrg	      _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'
7020e4da38afSmrg	      ;;
7021e4da38afSmrg	    esac
7022e4da38afSmrg
7023e4da38afSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
7024e4da38afSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7025e4da38afSmrg	    _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'
7026e4da38afSmrg            ;;
7027e4da38afSmrg	  cxx*)
7028e4da38afSmrg	    # Compaq C++
7029e4da38afSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7030e4da38afSmrg	    _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'
7031fc27e79cSmrg
7032e4da38afSmrg	    runpath_var=LD_RUN_PATH
7033e4da38afSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7034e4da38afSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7035fc27e79cSmrg
7036e4da38afSmrg	    # Commands to make compiler produce verbose output that lists
7037e4da38afSmrg	    # what "hidden" libraries, object files and flags are used when
7038e4da38afSmrg	    # linking a shared library.
7039e4da38afSmrg	    #
7040e4da38afSmrg	    # There doesn't appear to be a way to prevent this compiler from
7041e4da38afSmrg	    # explicitly linking system object files so we need to strip them
7042e4da38afSmrg	    # from the output so that they don't get included in the library
7043e4da38afSmrg	    # dependencies.
7044e4da38afSmrg	    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'
7045e4da38afSmrg	    ;;
7046e4da38afSmrg	  xl* | mpixl* | bgxl*)
7047e4da38afSmrg	    # IBM XL 8.0 on PPC, with GNU ld
7048e4da38afSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7049e4da38afSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7050e4da38afSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
7051e4da38afSmrg	    if test yes = "$supports_anon_versioning"; then
7052e4da38afSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
7053e4da38afSmrg                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7054e4da38afSmrg                echo "local: *; };" >> $output_objdir/$libname.ver~
7055e4da38afSmrg                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
7056e4da38afSmrg	    fi
7057e4da38afSmrg	    ;;
7058e4da38afSmrg	  *)
7059e4da38afSmrg	    case `$CC -V 2>&1 | sed 5q` in
7060e4da38afSmrg	    *Sun\ C*)
7061e4da38afSmrg	      # Sun C++ 5.9
7062e4da38afSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7063e4da38afSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7064e4da38afSmrg	      _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'
7065e4da38afSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7066e4da38afSmrg	      _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'
7067e4da38afSmrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
7068659607e0Smrg
7069e4da38afSmrg	      # Not sure whether something based on
7070e4da38afSmrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
7071e4da38afSmrg	      # would be better.
7072e4da38afSmrg	      output_verbose_link_cmd='func_echo_all'
7073659607e0Smrg
7074e4da38afSmrg	      # Archives containing C++ object files must be created using
7075e4da38afSmrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7076e4da38afSmrg	      # necessary to make sure instantiated templates are included
7077e4da38afSmrg	      # in the archive.
7078e4da38afSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7079e4da38afSmrg	      ;;
7080e4da38afSmrg	    esac
7081e4da38afSmrg	    ;;
7082e4da38afSmrg	esac
7083e4da38afSmrg	;;
7084659607e0Smrg
7085e4da38afSmrg      lynxos*)
7086e4da38afSmrg        # FIXME: insert proper C++ library support
7087e4da38afSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
7088e4da38afSmrg	;;
7089e4da38afSmrg
7090e4da38afSmrg      m88k*)
709184bf8334Smrg        # FIXME: insert proper C++ library support
709284bf8334Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
7093e4da38afSmrg	;;
7094a73597f9Smrg
7095e4da38afSmrg      mvs*)
7096e4da38afSmrg        case $cc_basename in
7097e4da38afSmrg          cxx*)
7098e4da38afSmrg	    # FIXME: insert proper C++ library support
7099e4da38afSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
710084bf8334Smrg	    ;;
7101e4da38afSmrg	  *)
7102e4da38afSmrg	    # FIXME: insert proper C++ library support
7103e4da38afSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7104e4da38afSmrg	    ;;
7105e4da38afSmrg	esac
7106e4da38afSmrg	;;
7107659607e0Smrg
7108e4da38afSmrg      netbsd*)
7109e4da38afSmrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7110e4da38afSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
7111e4da38afSmrg	  wlarc=
7112e4da38afSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7113e4da38afSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
7114e4da38afSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7115e4da38afSmrg	fi
7116e4da38afSmrg	# Workaround some broken pre-1.5 toolchains
7117e4da38afSmrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
7118e4da38afSmrg	;;
7119659607e0Smrg
7120e4da38afSmrg      *nto* | *qnx*)
7121e4da38afSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
7122e4da38afSmrg	;;
7123659607e0Smrg
7124e4da38afSmrg      openbsd* | bitrig*)
7125e4da38afSmrg	if test -f /usr/libexec/ld.so; then
7126e4da38afSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
7127e4da38afSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7128e4da38afSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7129e4da38afSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7130e4da38afSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7131e4da38afSmrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
7132e4da38afSmrg	    _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'
7133e4da38afSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
7134e4da38afSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
713584bf8334Smrg	  fi
7136e4da38afSmrg	  output_verbose_link_cmd=func_echo_all
713784bf8334Smrg	else
713884bf8334Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
713984bf8334Smrg	fi
714084bf8334Smrg	;;
71416aab59a7Smrg
7142e4da38afSmrg      osf3* | osf4* | osf5*)
714384bf8334Smrg        case $cc_basename in
7144e4da38afSmrg          KCC*)
7145e4da38afSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
71466aab59a7Smrg
7147e4da38afSmrg	    # KCC will only create a shared library if the output file
7148e4da38afSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7149e4da38afSmrg	    # to its proper name (with version) after linking.
7150e4da38afSmrg	    _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'
7151e4da38afSmrg
7152e4da38afSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7153e4da38afSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7154e4da38afSmrg
7155e4da38afSmrg	    # Archives containing C++ object files must be created using
7156e4da38afSmrg	    # the KAI C++ compiler.
7157e4da38afSmrg	    case $host in
7158e4da38afSmrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
7159e4da38afSmrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
7160e4da38afSmrg	    esac
7161e4da38afSmrg	    ;;
7162e4da38afSmrg          RCC*)
7163e4da38afSmrg	    # Rational C++ 2.4.1
7164e4da38afSmrg	    # FIXME: insert proper C++ library support
7165e4da38afSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7166e4da38afSmrg	    ;;
7167e4da38afSmrg          cxx*)
7168e4da38afSmrg	    case $host in
7169e4da38afSmrg	      osf3*)
7170e4da38afSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7171e4da38afSmrg	        _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'
7172e4da38afSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7173e4da38afSmrg		;;
717484bf8334Smrg	      *)
7175e4da38afSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7176e4da38afSmrg	        _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'
7177e4da38afSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7178e4da38afSmrg                  echo "-hidden">> $lib.exp~
7179e4da38afSmrg                  $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~
7180e4da38afSmrg                  $RM $lib.exp'
7181e4da38afSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
718284bf8334Smrg		;;
7183e4da38afSmrg	    esac
7184e4da38afSmrg
7185e4da38afSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7186e4da38afSmrg
7187e4da38afSmrg	    # Commands to make compiler produce verbose output that lists
7188e4da38afSmrg	    # what "hidden" libraries, object files and flags are used when
7189e4da38afSmrg	    # linking a shared library.
7190e4da38afSmrg	    #
7191e4da38afSmrg	    # There doesn't appear to be a way to prevent this compiler from
7192e4da38afSmrg	    # explicitly linking system object files so we need to strip them
7193e4da38afSmrg	    # from the output so that they don't get included in the library
7194e4da38afSmrg	    # dependencies.
7195e4da38afSmrg	    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"'
7196e4da38afSmrg	    ;;
7197e4da38afSmrg	  *)
7198e4da38afSmrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
7199e4da38afSmrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7200e4da38afSmrg	      case $host in
7201e4da38afSmrg	        osf3*)
7202e4da38afSmrg	          _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'
7203e4da38afSmrg		  ;;
7204e4da38afSmrg	        *)
7205e4da38afSmrg	          _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'
7206e4da38afSmrg		  ;;
7207e4da38afSmrg	      esac
7208e4da38afSmrg
7209e4da38afSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7210e4da38afSmrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7211e4da38afSmrg
7212e4da38afSmrg	      # Commands to make compiler produce verbose output that lists
7213e4da38afSmrg	      # what "hidden" libraries, object files and flags are used when
7214e4da38afSmrg	      # linking a shared library.
7215e4da38afSmrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7216a73597f9Smrg
721784bf8334Smrg	    else
7218e4da38afSmrg	      # FIXME: insert proper C++ library support
7219e4da38afSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
7220e4da38afSmrg	    fi
7221e4da38afSmrg	    ;;
7222e4da38afSmrg        esac
7223e4da38afSmrg        ;;
7224a73597f9Smrg
7225e4da38afSmrg      psos*)
7226e4da38afSmrg        # FIXME: insert proper C++ library support
7227e4da38afSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7228e4da38afSmrg        ;;
7229e4da38afSmrg
7230e4da38afSmrg      sunos4*)
723184bf8334Smrg        case $cc_basename in
7232e4da38afSmrg          CC*)
7233e4da38afSmrg	    # Sun C++ 4.x
723484bf8334Smrg	    # FIXME: insert proper C++ library support
723584bf8334Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
723684bf8334Smrg	    ;;
7237e4da38afSmrg          lcc*)
7238e4da38afSmrg	    # Lucid
723984bf8334Smrg	    # FIXME: insert proper C++ library support
724084bf8334Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
724184bf8334Smrg	    ;;
724284bf8334Smrg          *)
724384bf8334Smrg	    # FIXME: insert proper C++ library support
724484bf8334Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
724584bf8334Smrg	    ;;
724684bf8334Smrg        esac
724784bf8334Smrg        ;;
7248a73597f9Smrg
7249e4da38afSmrg      solaris*)
725084bf8334Smrg        case $cc_basename in
7251e4da38afSmrg          CC* | sunCC*)
7252e4da38afSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
7253e4da38afSmrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
7254e4da38afSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7255e4da38afSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7256e4da38afSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7257e4da38afSmrg              $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'
72586aab59a7Smrg
7259e4da38afSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7260e4da38afSmrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7261e4da38afSmrg	    case $host_os in
7262e4da38afSmrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
726384bf8334Smrg	      *)
7264e4da38afSmrg		# The compiler driver will combine and reorder linker options,
7265e4da38afSmrg		# but understands '-z linker_flag'.
7266e4da38afSmrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
7267e4da38afSmrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
726884bf8334Smrg	        ;;
726984bf8334Smrg	    esac
7270e4da38afSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7271e4da38afSmrg
7272e4da38afSmrg	    output_verbose_link_cmd='func_echo_all'
7273e4da38afSmrg
7274e4da38afSmrg	    # Archives containing C++ object files must be created using
7275e4da38afSmrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7276e4da38afSmrg	    # necessary to make sure instantiated templates are included
7277e4da38afSmrg	    # in the archive.
7278e4da38afSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7279e4da38afSmrg	    ;;
7280e4da38afSmrg          gcx*)
7281e4da38afSmrg	    # Green Hills C++ Compiler
7282e4da38afSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7283e4da38afSmrg
7284e4da38afSmrg	    # The C++ compiler must be used to create the archive.
7285e4da38afSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
728684bf8334Smrg	    ;;
728784bf8334Smrg          *)
7288e4da38afSmrg	    # GNU C++ compiler with Solaris linker
7289e4da38afSmrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
7290e4da38afSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
7291e4da38afSmrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
7292e4da38afSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7293e4da38afSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7294e4da38afSmrg                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7295e4da38afSmrg
7296e4da38afSmrg	        # Commands to make compiler produce verbose output that lists
7297e4da38afSmrg	        # what "hidden" libraries, object files and flags are used when
7298e4da38afSmrg	        # linking a shared library.
7299e4da38afSmrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7300e4da38afSmrg	      else
7301e4da38afSmrg	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
7302e4da38afSmrg	        # platform.
7303e4da38afSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7304e4da38afSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7305e4da38afSmrg                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7306e4da38afSmrg
7307e4da38afSmrg	        # Commands to make compiler produce verbose output that lists
7308e4da38afSmrg	        # what "hidden" libraries, object files and flags are used when
7309e4da38afSmrg	        # linking a shared library.
7310e4da38afSmrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
731184bf8334Smrg	      fi
7312e4da38afSmrg
7313e4da38afSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
7314e4da38afSmrg	      case $host_os in
7315e4da38afSmrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7316e4da38afSmrg		*)
7317e4da38afSmrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
7318e4da38afSmrg		  ;;
7319e4da38afSmrg	      esac
732084bf8334Smrg	    fi
732184bf8334Smrg	    ;;
732284bf8334Smrg        esac
732384bf8334Smrg        ;;
73246aab59a7Smrg
7325e4da38afSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7326e4da38afSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7327e4da38afSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7328e4da38afSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7329e4da38afSmrg      runpath_var='LD_RUN_PATH'
7330e4da38afSmrg
7331e4da38afSmrg      case $cc_basename in
7332e4da38afSmrg        CC*)
7333e4da38afSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7334e4da38afSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7335e4da38afSmrg	  ;;
7336e4da38afSmrg	*)
7337e4da38afSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7338e4da38afSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7339e4da38afSmrg	  ;;
7340e4da38afSmrg      esac
7341e4da38afSmrg      ;;
7342e4da38afSmrg
7343e4da38afSmrg      sysv5* | sco3.2v5* | sco5v6*)
7344e4da38afSmrg	# Note: We CANNOT use -z defs as we might desire, because we do not
7345e4da38afSmrg	# link with -lc, and that would cause any symbols used from libc to
7346e4da38afSmrg	# always be unresolved, which means just about no library would
7347e4da38afSmrg	# ever link correctly.  If we're not using GNU ld we use -z text
7348e4da38afSmrg	# though, which does catch some bad symbols but isn't as heavy-handed
7349e4da38afSmrg	# as -z defs.
7350e4da38afSmrg	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7351e4da38afSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
7352e4da38afSmrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7353e4da38afSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7354e4da38afSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
7355e4da38afSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7356e4da38afSmrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
7357e4da38afSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
7358e4da38afSmrg	runpath_var='LD_RUN_PATH'
7359e4da38afSmrg
7360e4da38afSmrg	case $cc_basename in
736184bf8334Smrg          CC*)
7362e4da38afSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7363e4da38afSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7364e4da38afSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
7365e4da38afSmrg              '"$_LT_TAGVAR(old_archive_cmds, $1)"
7366e4da38afSmrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
7367e4da38afSmrg              '"$_LT_TAGVAR(reload_cmds, $1)"
7368e4da38afSmrg	    ;;
7369e4da38afSmrg	  *)
7370e4da38afSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7371e4da38afSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7372e4da38afSmrg	    ;;
7373e4da38afSmrg	esac
7374e4da38afSmrg      ;;
73756aab59a7Smrg
7376e4da38afSmrg      tandem*)
7377e4da38afSmrg        case $cc_basename in
7378e4da38afSmrg          NCC*)
7379e4da38afSmrg	    # NonStop-UX NCC 3.20
7380e4da38afSmrg	    # FIXME: insert proper C++ library support
7381e4da38afSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
738284bf8334Smrg	    ;;
738384bf8334Smrg          *)
7384e4da38afSmrg	    # FIXME: insert proper C++ library support
7385e4da38afSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
738684bf8334Smrg	    ;;
738784bf8334Smrg        esac
738884bf8334Smrg        ;;
73896aab59a7Smrg
7390e4da38afSmrg      vxworks*)
7391e4da38afSmrg        # FIXME: insert proper C++ library support
7392e4da38afSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7393e4da38afSmrg        ;;
73946aab59a7Smrg
7395e4da38afSmrg      *)
7396e4da38afSmrg        # FIXME: insert proper C++ library support
7397e4da38afSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7398e4da38afSmrg        ;;
7399e4da38afSmrg    esac
740084bf8334Smrg
7401e4da38afSmrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7402e4da38afSmrg    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
740384bf8334Smrg
7404e4da38afSmrg    _LT_TAGVAR(GCC, $1)=$GXX
7405e4da38afSmrg    _LT_TAGVAR(LD, $1)=$LD
7406fc27e79cSmrg
7407e4da38afSmrg    ## CAVEAT EMPTOR:
7408e4da38afSmrg    ## There is no encapsulation within the following macros, do not change
7409e4da38afSmrg    ## the running order or otherwise move them around unless you know exactly
7410e4da38afSmrg    ## what you are doing...
7411e4da38afSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
7412e4da38afSmrg    _LT_COMPILER_PIC($1)
7413e4da38afSmrg    _LT_COMPILER_C_O($1)
7414e4da38afSmrg    _LT_COMPILER_FILE_LOCKS($1)
7415e4da38afSmrg    _LT_LINKER_SHLIBS($1)
7416e4da38afSmrg    _LT_SYS_DYNAMIC_LINKER($1)
7417e4da38afSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7418e4da38afSmrg
7419e4da38afSmrg    _LT_CONFIG($1)
7420e4da38afSmrg  fi # test -n "$compiler"
7421e4da38afSmrg
7422e4da38afSmrg  CC=$lt_save_CC
7423e4da38afSmrg  CFLAGS=$lt_save_CFLAGS
7424e4da38afSmrg  LDCXX=$LD
7425e4da38afSmrg  LD=$lt_save_LD
7426e4da38afSmrg  GCC=$lt_save_GCC
7427e4da38afSmrg  with_gnu_ld=$lt_save_with_gnu_ld
7428e4da38afSmrg  lt_cv_path_LDCXX=$lt_cv_path_LD
7429e4da38afSmrg  lt_cv_path_LD=$lt_save_path_LD
7430e4da38afSmrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
7431e4da38afSmrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
7432e4da38afSmrgfi # test yes != "$_lt_caught_CXX_error"
7433e4da38afSmrg
7434e4da38afSmrgAC_LANG_POP
7435e4da38afSmrg])# _LT_LANG_CXX_CONFIG
7436e4da38afSmrg
7437e4da38afSmrg
7438e4da38afSmrg# _LT_FUNC_STRIPNAME_CNF
7439e4da38afSmrg# ----------------------
7440e4da38afSmrg# func_stripname_cnf prefix suffix name
7441e4da38afSmrg# strip PREFIX and SUFFIX off of NAME.
7442e4da38afSmrg# PREFIX and SUFFIX must not contain globbing or regex special
7443e4da38afSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
7444e4da38afSmrg# dot (in which case that matches only a dot).
7445e4da38afSmrg#
7446e4da38afSmrg# This function is identical to the (non-XSI) version of func_stripname,
7447e4da38afSmrg# except this one can be used by m4 code that may be executed by configure,
7448e4da38afSmrg# rather than the libtool script.
7449e4da38afSmrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
7450e4da38afSmrgAC_REQUIRE([_LT_DECL_SED])
7451e4da38afSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
7452e4da38afSmrgfunc_stripname_cnf ()
7453e4da38afSmrg{
7454e4da38afSmrg  case @S|@2 in
7455e4da38afSmrg  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
7456e4da38afSmrg  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
7457e4da38afSmrg  esac
7458e4da38afSmrg} # func_stripname_cnf
7459e4da38afSmrg])# _LT_FUNC_STRIPNAME_CNF
7460e4da38afSmrg
7461e4da38afSmrg
7462e4da38afSmrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
7463e4da38afSmrg# ---------------------------------
7464e4da38afSmrg# Figure out "hidden" library dependencies from verbose
7465e4da38afSmrg# compiler output when linking a shared library.
7466e4da38afSmrg# Parse the compiler output and extract the necessary
7467e4da38afSmrg# objects, libraries and library flags.
7468e4da38afSmrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
7469e4da38afSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7470e4da38afSmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
7471e4da38afSmrg# Dependencies to place before and after the object being linked:
7472e4da38afSmrg_LT_TAGVAR(predep_objects, $1)=
7473e4da38afSmrg_LT_TAGVAR(postdep_objects, $1)=
7474e4da38afSmrg_LT_TAGVAR(predeps, $1)=
7475e4da38afSmrg_LT_TAGVAR(postdeps, $1)=
7476e4da38afSmrg_LT_TAGVAR(compiler_lib_search_path, $1)=
7477e4da38afSmrg
7478e4da38afSmrgdnl we can't use the lt_simple_compile_test_code here,
7479e4da38afSmrgdnl because it contains code intended for an executable,
7480e4da38afSmrgdnl not a library.  It's possible we should let each
7481e4da38afSmrgdnl tag define a new lt_????_link_test_code variable,
7482e4da38afSmrgdnl but it's only used here...
7483e4da38afSmrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
7484e4da38afSmrgint a;
7485e4da38afSmrgvoid foo (void) { a = 0; }
7486e4da38afSmrg_LT_EOF
7487e4da38afSmrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
7488e4da38afSmrgclass Foo
7489e4da38afSmrg{
7490e4da38afSmrgpublic:
7491e4da38afSmrg  Foo (void) { a = 0; }
7492e4da38afSmrgprivate:
7493e4da38afSmrg  int a;
7494e4da38afSmrg};
7495e4da38afSmrg_LT_EOF
7496e4da38afSmrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
7497e4da38afSmrg      subroutine foo
7498e4da38afSmrg      implicit none
7499e4da38afSmrg      integer*4 a
7500e4da38afSmrg      a=0
7501e4da38afSmrg      return
7502e4da38afSmrg      end
7503e4da38afSmrg_LT_EOF
7504e4da38afSmrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
7505e4da38afSmrg      subroutine foo
7506e4da38afSmrg      implicit none
7507e4da38afSmrg      integer a
7508e4da38afSmrg      a=0
7509e4da38afSmrg      return
7510e4da38afSmrg      end
7511e4da38afSmrg_LT_EOF
7512e4da38afSmrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
7513e4da38afSmrgpublic class foo {
7514e4da38afSmrg  private int a;
7515e4da38afSmrg  public void bar (void) {
7516e4da38afSmrg    a = 0;
7517e4da38afSmrg  }
7518e4da38afSmrg};
7519e4da38afSmrg_LT_EOF
7520e4da38afSmrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
7521e4da38afSmrgpackage foo
7522e4da38afSmrgfunc foo() {
7523e4da38afSmrg}
7524e4da38afSmrg_LT_EOF
7525e4da38afSmrg])
7526e4da38afSmrg
7527e4da38afSmrg_lt_libdeps_save_CFLAGS=$CFLAGS
7528e4da38afSmrgcase "$CC $CFLAGS " in #(
7529e4da38afSmrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
7530e4da38afSmrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
7531e4da38afSmrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
7532e4da38afSmrgesac
7533e4da38afSmrg
7534e4da38afSmrgdnl Parse the compiler output and extract the necessary
7535e4da38afSmrgdnl objects, libraries and library flags.
7536e4da38afSmrgif AC_TRY_EVAL(ac_compile); then
7537e4da38afSmrg  # Parse the compiler output and extract the necessary
7538e4da38afSmrg  # objects, libraries and library flags.
7539e4da38afSmrg
7540e4da38afSmrg  # Sentinel used to keep track of whether or not we are before
7541e4da38afSmrg  # the conftest object file.
7542e4da38afSmrg  pre_test_object_deps_done=no
7543e4da38afSmrg
7544e4da38afSmrg  for p in `eval "$output_verbose_link_cmd"`; do
7545e4da38afSmrg    case $prev$p in
7546e4da38afSmrg
7547e4da38afSmrg    -L* | -R* | -l*)
7548e4da38afSmrg       # Some compilers place space between "-{L,R}" and the path.
7549e4da38afSmrg       # Remove the space.
7550e4da38afSmrg       if test x-L = "$p" ||
7551e4da38afSmrg          test x-R = "$p"; then
7552e4da38afSmrg	 prev=$p
7553e4da38afSmrg	 continue
7554e4da38afSmrg       fi
7555e4da38afSmrg
7556e4da38afSmrg       # Expand the sysroot to ease extracting the directories later.
7557e4da38afSmrg       if test -z "$prev"; then
7558e4da38afSmrg         case $p in
7559e4da38afSmrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
7560e4da38afSmrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
7561e4da38afSmrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
7562e4da38afSmrg         esac
7563e4da38afSmrg       fi
7564e4da38afSmrg       case $p in
7565e4da38afSmrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
7566e4da38afSmrg       esac
7567e4da38afSmrg       if test no = "$pre_test_object_deps_done"; then
7568e4da38afSmrg	 case $prev in
7569e4da38afSmrg	 -L | -R)
7570e4da38afSmrg	   # Internal compiler library paths should come after those
7571e4da38afSmrg	   # provided the user.  The postdeps already come after the
7572e4da38afSmrg	   # user supplied libs so there is no need to process them.
7573e4da38afSmrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
7574e4da38afSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
7575e4da38afSmrg	   else
7576e4da38afSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
7577e4da38afSmrg	   fi
7578e4da38afSmrg	   ;;
7579e4da38afSmrg	 # The "-l" case would never come before the object being
7580e4da38afSmrg	 # linked, so don't bother handling this case.
7581e4da38afSmrg	 esac
7582e4da38afSmrg       else
7583e4da38afSmrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
7584e4da38afSmrg	   _LT_TAGVAR(postdeps, $1)=$prev$p
7585e4da38afSmrg	 else
7586e4da38afSmrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
7587e4da38afSmrg	 fi
7588e4da38afSmrg       fi
7589e4da38afSmrg       prev=
7590e4da38afSmrg       ;;
7591fc27e79cSmrg
7592e4da38afSmrg    *.lto.$objext) ;; # Ignore GCC LTO objects
7593e4da38afSmrg    *.$objext)
7594e4da38afSmrg       # This assumes that the test object file only shows up
7595e4da38afSmrg       # once in the compiler output.
7596e4da38afSmrg       if test "$p" = "conftest.$objext"; then
7597e4da38afSmrg	 pre_test_object_deps_done=yes
7598e4da38afSmrg	 continue
7599e4da38afSmrg       fi
7600fc27e79cSmrg
7601e4da38afSmrg       if test no = "$pre_test_object_deps_done"; then
7602e4da38afSmrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
7603e4da38afSmrg	   _LT_TAGVAR(predep_objects, $1)=$p
7604e4da38afSmrg	 else
7605e4da38afSmrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
7606e4da38afSmrg	 fi
7607e4da38afSmrg       else
7608e4da38afSmrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
7609e4da38afSmrg	   _LT_TAGVAR(postdep_objects, $1)=$p
7610e4da38afSmrg	 else
7611e4da38afSmrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
7612e4da38afSmrg	 fi
7613e4da38afSmrg       fi
7614e4da38afSmrg       ;;
7615fc27e79cSmrg
7616e4da38afSmrg    *) ;; # Ignore the rest.
7617a73597f9Smrg
7618e4da38afSmrg    esac
7619e4da38afSmrg  done
7620a73597f9Smrg
7621e4da38afSmrg  # Clean up.
7622e4da38afSmrg  rm -f a.out a.exe
7623e4da38afSmrgelse
7624e4da38afSmrg  echo "libtool.m4: error: problem compiling $1 test program"
7625e4da38afSmrgfi
7626a73597f9Smrg
7627e4da38afSmrg$RM -f confest.$objext
7628e4da38afSmrgCFLAGS=$_lt_libdeps_save_CFLAGS
7629a73597f9Smrg
7630e4da38afSmrg# PORTME: override above test on systems where it is broken
7631e4da38afSmrgm4_if([$1], [CXX],
7632e4da38afSmrg[case $host_os in
7633e4da38afSmrginterix[[3-9]]*)
7634e4da38afSmrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
7635e4da38afSmrg  # hack all around it, let's just trust "g++" to DTRT.
7636e4da38afSmrg  _LT_TAGVAR(predep_objects,$1)=
7637e4da38afSmrg  _LT_TAGVAR(postdep_objects,$1)=
7638e4da38afSmrg  _LT_TAGVAR(postdeps,$1)=
7639e4da38afSmrg  ;;
7640e4da38afSmrgesac
7641e4da38afSmrg])
7642a73597f9Smrg
7643e4da38afSmrgcase " $_LT_TAGVAR(postdeps, $1) " in
7644e4da38afSmrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
7645e4da38afSmrgesac
7646e4da38afSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
7647e4da38afSmrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
7648e4da38afSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
7649e4da38afSmrgfi
7650e4da38afSmrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
7651e4da38afSmrg    [The directories searched by this compiler when creating a shared library])
7652e4da38afSmrg_LT_TAGDECL([], [predep_objects], [1],
7653e4da38afSmrg    [Dependencies to place before and after the objects being linked to
7654e4da38afSmrg    create a shared library])
7655e4da38afSmrg_LT_TAGDECL([], [postdep_objects], [1])
7656e4da38afSmrg_LT_TAGDECL([], [predeps], [1])
7657e4da38afSmrg_LT_TAGDECL([], [postdeps], [1])
7658e4da38afSmrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
7659e4da38afSmrg    [The library search path used internally by the compiler when linking
7660e4da38afSmrg    a shared library])
7661e4da38afSmrg])# _LT_SYS_HIDDEN_LIBDEPS
7662a73597f9Smrg
7663a73597f9Smrg
7664e4da38afSmrg# _LT_LANG_F77_CONFIG([TAG])
7665e4da38afSmrg# --------------------------
7666e4da38afSmrg# Ensure that the configuration variables for a Fortran 77 compiler are
7667e4da38afSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7668e4da38afSmrg# to write the compiler configuration to 'libtool'.
7669e4da38afSmrgm4_defun([_LT_LANG_F77_CONFIG],
7670e4da38afSmrg[AC_LANG_PUSH(Fortran 77)
7671e4da38afSmrgif test -z "$F77" || test no = "$F77"; then
7672e4da38afSmrg  _lt_disable_F77=yes
7673e4da38afSmrgfi
7674a73597f9Smrg
7675e4da38afSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7676e4da38afSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
7677e4da38afSmrg_LT_TAGVAR(always_export_symbols, $1)=no
7678e4da38afSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
7679e4da38afSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7680e4da38afSmrg_LT_TAGVAR(hardcode_direct, $1)=no
7681e4da38afSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7682e4da38afSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7683e4da38afSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
7684e4da38afSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
7685e4da38afSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
7686e4da38afSmrg_LT_TAGVAR(inherit_rpath, $1)=no
7687e4da38afSmrg_LT_TAGVAR(module_cmds, $1)=
7688e4da38afSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
7689e4da38afSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
7690e4da38afSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7691e4da38afSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7692e4da38afSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7693e4da38afSmrg_LT_TAGVAR(no_undefined_flag, $1)=
7694e4da38afSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
7695e4da38afSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7696a73597f9Smrg
7697e4da38afSmrg# Source file extension for f77 test sources.
7698e4da38afSmrgac_ext=f
7699fc27e79cSmrg
7700e4da38afSmrg# Object file extension for compiled f77 test sources.
7701e4da38afSmrgobjext=o
7702e4da38afSmrg_LT_TAGVAR(objext, $1)=$objext
7703fc27e79cSmrg
7704e4da38afSmrg# No sense in running all these tests if we already determined that
7705e4da38afSmrg# the F77 compiler isn't working.  Some variables (like enable_shared)
7706e4da38afSmrg# are currently assumed to apply to all compilers on this platform,
7707e4da38afSmrg# and will be corrupted by setting them based on a non-working compiler.
7708e4da38afSmrgif test yes != "$_lt_disable_F77"; then
7709e4da38afSmrg  # Code to be used in simple compile tests
7710e4da38afSmrg  lt_simple_compile_test_code="\
7711e4da38afSmrg      subroutine t
7712e4da38afSmrg      return
7713e4da38afSmrg      end
7714e4da38afSmrg"
7715fc27e79cSmrg
7716e4da38afSmrg  # Code to be used in simple link tests
7717e4da38afSmrg  lt_simple_link_test_code="\
7718e4da38afSmrg      program t
7719e4da38afSmrg      end
7720e4da38afSmrg"
7721fc27e79cSmrg
7722e4da38afSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7723e4da38afSmrg  _LT_TAG_COMPILER
7724fc27e79cSmrg
7725e4da38afSmrg  # save warnings/boilerplate of simple test code
7726e4da38afSmrg  _LT_COMPILER_BOILERPLATE
7727e4da38afSmrg  _LT_LINKER_BOILERPLATE
7728fc27e79cSmrg
7729e4da38afSmrg  # Allow CC to be a program name with arguments.
7730e4da38afSmrg  lt_save_CC=$CC
7731e4da38afSmrg  lt_save_GCC=$GCC
7732e4da38afSmrg  lt_save_CFLAGS=$CFLAGS
7733e4da38afSmrg  CC=${F77-"f77"}
7734e4da38afSmrg  CFLAGS=$FFLAGS
7735e4da38afSmrg  compiler=$CC
7736e4da38afSmrg  _LT_TAGVAR(compiler, $1)=$CC
7737e4da38afSmrg  _LT_CC_BASENAME([$compiler])
7738e4da38afSmrg  GCC=$G77
7739e4da38afSmrg  if test -n "$compiler"; then
7740e4da38afSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
7741e4da38afSmrg    AC_MSG_RESULT([$can_build_shared])
7742fc27e79cSmrg
7743e4da38afSmrg    AC_MSG_CHECKING([whether to build shared libraries])
7744e4da38afSmrg    test no = "$can_build_shared" && enable_shared=no
7745fc27e79cSmrg
7746e4da38afSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
7747e4da38afSmrg    # are all built from PIC.
7748e4da38afSmrg    case $host_os in
7749e4da38afSmrg      aix3*)
7750e4da38afSmrg        test yes = "$enable_shared" && enable_static=no
7751e4da38afSmrg        if test -n "$RANLIB"; then
7752e4da38afSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7753e4da38afSmrg          postinstall_cmds='$RANLIB $lib'
7754e4da38afSmrg        fi
775584bf8334Smrg        ;;
7756e4da38afSmrg      aix[[4-9]]*)
7757e4da38afSmrg	if test ia64 != "$host_cpu"; then
7758e4da38afSmrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7759e4da38afSmrg	  yes,aix,yes) ;;		# shared object as lib.so file only
7760e4da38afSmrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
7761e4da38afSmrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
7762e4da38afSmrg	  esac
7763e4da38afSmrg	fi
776484bf8334Smrg        ;;
7765e4da38afSmrg    esac
7766e4da38afSmrg    AC_MSG_RESULT([$enable_shared])
7767fc27e79cSmrg
7768e4da38afSmrg    AC_MSG_CHECKING([whether to build static libraries])
7769e4da38afSmrg    # Make sure either enable_shared or enable_static is yes.
7770e4da38afSmrg    test yes = "$enable_shared" || enable_static=yes
7771e4da38afSmrg    AC_MSG_RESULT([$enable_static])
7772fc27e79cSmrg
7773e4da38afSmrg    _LT_TAGVAR(GCC, $1)=$G77
7774e4da38afSmrg    _LT_TAGVAR(LD, $1)=$LD
7775fc27e79cSmrg
7776e4da38afSmrg    ## CAVEAT EMPTOR:
7777e4da38afSmrg    ## There is no encapsulation within the following macros, do not change
7778e4da38afSmrg    ## the running order or otherwise move them around unless you know exactly
7779e4da38afSmrg    ## what you are doing...
7780e4da38afSmrg    _LT_COMPILER_PIC($1)
7781e4da38afSmrg    _LT_COMPILER_C_O($1)
7782e4da38afSmrg    _LT_COMPILER_FILE_LOCKS($1)
7783e4da38afSmrg    _LT_LINKER_SHLIBS($1)
7784e4da38afSmrg    _LT_SYS_DYNAMIC_LINKER($1)
7785e4da38afSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7786fc27e79cSmrg
7787e4da38afSmrg    _LT_CONFIG($1)
7788e4da38afSmrg  fi # test -n "$compiler"
7789fc27e79cSmrg
7790e4da38afSmrg  GCC=$lt_save_GCC
7791e4da38afSmrg  CC=$lt_save_CC
7792e4da38afSmrg  CFLAGS=$lt_save_CFLAGS
7793e4da38afSmrgfi # test yes != "$_lt_disable_F77"
7794fc27e79cSmrg
7795e4da38afSmrgAC_LANG_POP
7796e4da38afSmrg])# _LT_LANG_F77_CONFIG
7797fc27e79cSmrg
7798fc27e79cSmrg
7799e4da38afSmrg# _LT_LANG_FC_CONFIG([TAG])
7800e4da38afSmrg# -------------------------
7801e4da38afSmrg# Ensure that the configuration variables for a Fortran compiler are
7802e4da38afSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7803e4da38afSmrg# to write the compiler configuration to 'libtool'.
7804e4da38afSmrgm4_defun([_LT_LANG_FC_CONFIG],
7805e4da38afSmrg[AC_LANG_PUSH(Fortran)
7806fc27e79cSmrg
7807e4da38afSmrgif test -z "$FC" || test no = "$FC"; then
7808e4da38afSmrg  _lt_disable_FC=yes
7809e4da38afSmrgfi
7810fc27e79cSmrg
7811e4da38afSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7812e4da38afSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
7813e4da38afSmrg_LT_TAGVAR(always_export_symbols, $1)=no
7814e4da38afSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
7815e4da38afSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7816e4da38afSmrg_LT_TAGVAR(hardcode_direct, $1)=no
7817e4da38afSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7818e4da38afSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7819e4da38afSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
7820e4da38afSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
7821e4da38afSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
7822e4da38afSmrg_LT_TAGVAR(inherit_rpath, $1)=no
7823e4da38afSmrg_LT_TAGVAR(module_cmds, $1)=
7824e4da38afSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
7825e4da38afSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
7826e4da38afSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7827e4da38afSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7828e4da38afSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7829e4da38afSmrg_LT_TAGVAR(no_undefined_flag, $1)=
7830e4da38afSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
7831e4da38afSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7832fc27e79cSmrg
7833e4da38afSmrg# Source file extension for fc test sources.
7834e4da38afSmrgac_ext=${ac_fc_srcext-f}
7835bd3a1963Smrg
7836e4da38afSmrg# Object file extension for compiled fc test sources.
7837e4da38afSmrgobjext=o
7838e4da38afSmrg_LT_TAGVAR(objext, $1)=$objext
7839a73597f9Smrg
7840e4da38afSmrg# No sense in running all these tests if we already determined that
7841e4da38afSmrg# the FC compiler isn't working.  Some variables (like enable_shared)
7842e4da38afSmrg# are currently assumed to apply to all compilers on this platform,
7843e4da38afSmrg# and will be corrupted by setting them based on a non-working compiler.
7844e4da38afSmrgif test yes != "$_lt_disable_FC"; then
7845e4da38afSmrg  # Code to be used in simple compile tests
7846e4da38afSmrg  lt_simple_compile_test_code="\
7847e4da38afSmrg      subroutine t
7848e4da38afSmrg      return
7849e4da38afSmrg      end
7850e4da38afSmrg"
7851fc27e79cSmrg
7852e4da38afSmrg  # Code to be used in simple link tests
7853e4da38afSmrg  lt_simple_link_test_code="\
7854e4da38afSmrg      program t
7855e4da38afSmrg      end
7856e4da38afSmrg"
7857fc27e79cSmrg
7858e4da38afSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7859e4da38afSmrg  _LT_TAG_COMPILER
7860e4da38afSmrg
7861e4da38afSmrg  # save warnings/boilerplate of simple test code
7862e4da38afSmrg  _LT_COMPILER_BOILERPLATE
7863e4da38afSmrg  _LT_LINKER_BOILERPLATE
7864e4da38afSmrg
7865e4da38afSmrg  # Allow CC to be a program name with arguments.
7866e4da38afSmrg  lt_save_CC=$CC
7867e4da38afSmrg  lt_save_GCC=$GCC
7868e4da38afSmrg  lt_save_CFLAGS=$CFLAGS
7869e4da38afSmrg  CC=${FC-"f95"}
7870e4da38afSmrg  CFLAGS=$FCFLAGS
7871e4da38afSmrg  compiler=$CC
7872e4da38afSmrg  GCC=$ac_cv_fc_compiler_gnu
7873e4da38afSmrg
7874e4da38afSmrg  _LT_TAGVAR(compiler, $1)=$CC
7875e4da38afSmrg  _LT_CC_BASENAME([$compiler])
7876e4da38afSmrg
7877e4da38afSmrg  if test -n "$compiler"; then
7878e4da38afSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
7879e4da38afSmrg    AC_MSG_RESULT([$can_build_shared])
7880e4da38afSmrg
7881e4da38afSmrg    AC_MSG_CHECKING([whether to build shared libraries])
7882e4da38afSmrg    test no = "$can_build_shared" && enable_shared=no
7883fc27e79cSmrg
7884e4da38afSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
7885e4da38afSmrg    # are all built from PIC.
7886e4da38afSmrg    case $host_os in
7887e4da38afSmrg      aix3*)
7888e4da38afSmrg        test yes = "$enable_shared" && enable_static=no
7889e4da38afSmrg        if test -n "$RANLIB"; then
7890e4da38afSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7891e4da38afSmrg          postinstall_cmds='$RANLIB $lib'
7892e4da38afSmrg        fi
7893e4da38afSmrg        ;;
7894e4da38afSmrg      aix[[4-9]]*)
7895e4da38afSmrg	if test ia64 != "$host_cpu"; then
7896e4da38afSmrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7897e4da38afSmrg	  yes,aix,yes) ;;		# shared object as lib.so file only
7898e4da38afSmrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
7899e4da38afSmrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
7900e4da38afSmrg	  esac
7901e4da38afSmrg	fi
790284bf8334Smrg        ;;
790384bf8334Smrg    esac
7904e4da38afSmrg    AC_MSG_RESULT([$enable_shared])
7905fc27e79cSmrg
7906e4da38afSmrg    AC_MSG_CHECKING([whether to build static libraries])
7907e4da38afSmrg    # Make sure either enable_shared or enable_static is yes.
7908e4da38afSmrg    test yes = "$enable_shared" || enable_static=yes
7909e4da38afSmrg    AC_MSG_RESULT([$enable_static])
7910fc27e79cSmrg
7911e4da38afSmrg    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
7912e4da38afSmrg    _LT_TAGVAR(LD, $1)=$LD
79136aab59a7Smrg
791484bf8334Smrg    ## CAVEAT EMPTOR:
791584bf8334Smrg    ## There is no encapsulation within the following macros, do not change
791684bf8334Smrg    ## the running order or otherwise move them around unless you know exactly
791784bf8334Smrg    ## what you are doing...
791884bf8334Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
791984bf8334Smrg    _LT_COMPILER_PIC($1)
792084bf8334Smrg    _LT_COMPILER_C_O($1)
792184bf8334Smrg    _LT_COMPILER_FILE_LOCKS($1)
792284bf8334Smrg    _LT_LINKER_SHLIBS($1)
792384bf8334Smrg    _LT_SYS_DYNAMIC_LINKER($1)
792484bf8334Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
79256aab59a7Smrg
792684bf8334Smrg    _LT_CONFIG($1)
792784bf8334Smrg  fi # test -n "$compiler"
7928fc27e79cSmrg
7929e4da38afSmrg  GCC=$lt_save_GCC
793084bf8334Smrg  CC=$lt_save_CC
793184bf8334Smrg  CFLAGS=$lt_save_CFLAGS
7932e4da38afSmrgfi # test yes != "$_lt_disable_FC"
79336aab59a7Smrg
793484bf8334SmrgAC_LANG_POP
7935e4da38afSmrg])# _LT_LANG_FC_CONFIG
79366aab59a7Smrg
7937fc27e79cSmrg
7938e4da38afSmrg# _LT_LANG_GCJ_CONFIG([TAG])
7939e4da38afSmrg# --------------------------
7940e4da38afSmrg# Ensure that the configuration variables for the GNU Java Compiler compiler
7941e4da38afSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7942e4da38afSmrg# to write the compiler configuration to 'libtool'.
7943e4da38afSmrgm4_defun([_LT_LANG_GCJ_CONFIG],
7944e4da38afSmrg[AC_REQUIRE([LT_PROG_GCJ])dnl
7945e4da38afSmrgAC_LANG_SAVE
7946fc27e79cSmrg
7947e4da38afSmrg# Source file extension for Java test sources.
7948e4da38afSmrgac_ext=java
7949e4da38afSmrg
7950e4da38afSmrg# Object file extension for compiled Java test sources.
7951e4da38afSmrgobjext=o
7952e4da38afSmrg_LT_TAGVAR(objext, $1)=$objext
7953e4da38afSmrg
7954e4da38afSmrg# Code to be used in simple compile tests
7955e4da38afSmrglt_simple_compile_test_code="class foo {}"
7956e4da38afSmrg
7957e4da38afSmrg# Code to be used in simple link tests
7958e4da38afSmrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
7959e4da38afSmrg
7960e4da38afSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7961e4da38afSmrg_LT_TAG_COMPILER
7962e4da38afSmrg
7963e4da38afSmrg# save warnings/boilerplate of simple test code
7964e4da38afSmrg_LT_COMPILER_BOILERPLATE
7965e4da38afSmrg_LT_LINKER_BOILERPLATE
7966e4da38afSmrg
7967e4da38afSmrg# Allow CC to be a program name with arguments.
7968e4da38afSmrglt_save_CC=$CC
7969e4da38afSmrglt_save_CFLAGS=$CFLAGS
7970e4da38afSmrglt_save_GCC=$GCC
7971e4da38afSmrgGCC=yes
7972e4da38afSmrgCC=${GCJ-"gcj"}
7973e4da38afSmrgCFLAGS=$GCJFLAGS
7974e4da38afSmrgcompiler=$CC
7975e4da38afSmrg_LT_TAGVAR(compiler, $1)=$CC
7976e4da38afSmrg_LT_TAGVAR(LD, $1)=$LD
7977e4da38afSmrg_LT_CC_BASENAME([$compiler])
7978e4da38afSmrg
7979e4da38afSmrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
7980e4da38afSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7981e4da38afSmrg
7982e4da38afSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7983e4da38afSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7984e4da38afSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7985e4da38afSmrg
7986e4da38afSmrgif test -n "$compiler"; then
7987e4da38afSmrg  _LT_COMPILER_NO_RTTI($1)
7988e4da38afSmrg  _LT_COMPILER_PIC($1)
7989e4da38afSmrg  _LT_COMPILER_C_O($1)
7990e4da38afSmrg  _LT_COMPILER_FILE_LOCKS($1)
7991e4da38afSmrg  _LT_LINKER_SHLIBS($1)
7992e4da38afSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
7993e4da38afSmrg
7994e4da38afSmrg  _LT_CONFIG($1)
7995e4da38afSmrgfi
7996e4da38afSmrg
7997e4da38afSmrgAC_LANG_RESTORE
7998e4da38afSmrg
7999e4da38afSmrgGCC=$lt_save_GCC
8000e4da38afSmrgCC=$lt_save_CC
8001e4da38afSmrgCFLAGS=$lt_save_CFLAGS
8002e4da38afSmrg])# _LT_LANG_GCJ_CONFIG
8003e4da38afSmrg
8004e4da38afSmrg
8005e4da38afSmrg# _LT_LANG_GO_CONFIG([TAG])
8006e4da38afSmrg# --------------------------
8007e4da38afSmrg# Ensure that the configuration variables for the GNU Go compiler
8008e4da38afSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8009e4da38afSmrg# to write the compiler configuration to 'libtool'.
8010e4da38afSmrgm4_defun([_LT_LANG_GO_CONFIG],
8011e4da38afSmrg[AC_REQUIRE([LT_PROG_GO])dnl
8012e4da38afSmrgAC_LANG_SAVE
8013e4da38afSmrg
8014e4da38afSmrg# Source file extension for Go test sources.
8015e4da38afSmrgac_ext=go
8016e4da38afSmrg
8017e4da38afSmrg# Object file extension for compiled Go test sources.
8018e4da38afSmrgobjext=o
8019e4da38afSmrg_LT_TAGVAR(objext, $1)=$objext
8020e4da38afSmrg
8021e4da38afSmrg# Code to be used in simple compile tests
8022e4da38afSmrglt_simple_compile_test_code="package main; func main() { }"
8023e4da38afSmrg
8024e4da38afSmrg# Code to be used in simple link tests
8025e4da38afSmrglt_simple_link_test_code='package main; func main() { }'
8026e4da38afSmrg
8027e4da38afSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8028e4da38afSmrg_LT_TAG_COMPILER
8029e4da38afSmrg
8030e4da38afSmrg# save warnings/boilerplate of simple test code
8031e4da38afSmrg_LT_COMPILER_BOILERPLATE
8032e4da38afSmrg_LT_LINKER_BOILERPLATE
8033e4da38afSmrg
8034e4da38afSmrg# Allow CC to be a program name with arguments.
8035e4da38afSmrglt_save_CC=$CC
8036e4da38afSmrglt_save_CFLAGS=$CFLAGS
8037e4da38afSmrglt_save_GCC=$GCC
8038e4da38afSmrgGCC=yes
8039e4da38afSmrgCC=${GOC-"gccgo"}
8040e4da38afSmrgCFLAGS=$GOFLAGS
8041e4da38afSmrgcompiler=$CC
8042e4da38afSmrg_LT_TAGVAR(compiler, $1)=$CC
8043e4da38afSmrg_LT_TAGVAR(LD, $1)=$LD
8044e4da38afSmrg_LT_CC_BASENAME([$compiler])
8045e4da38afSmrg
8046e4da38afSmrg# Go did not exist at the time GCC didn't implicitly link libc in.
8047e4da38afSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8048e4da38afSmrg
8049e4da38afSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8050e4da38afSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
8051e4da38afSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8052e4da38afSmrg
8053e4da38afSmrgif test -n "$compiler"; then
8054e4da38afSmrg  _LT_COMPILER_NO_RTTI($1)
8055e4da38afSmrg  _LT_COMPILER_PIC($1)
8056e4da38afSmrg  _LT_COMPILER_C_O($1)
8057e4da38afSmrg  _LT_COMPILER_FILE_LOCKS($1)
8058e4da38afSmrg  _LT_LINKER_SHLIBS($1)
8059e4da38afSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8060e4da38afSmrg
8061e4da38afSmrg  _LT_CONFIG($1)
8062e4da38afSmrgfi
8063e4da38afSmrg
8064e4da38afSmrgAC_LANG_RESTORE
8065e4da38afSmrg
8066e4da38afSmrgGCC=$lt_save_GCC
8067e4da38afSmrgCC=$lt_save_CC
8068e4da38afSmrgCFLAGS=$lt_save_CFLAGS
8069e4da38afSmrg])# _LT_LANG_GO_CONFIG
8070e4da38afSmrg
8071e4da38afSmrg
8072e4da38afSmrg# _LT_LANG_RC_CONFIG([TAG])
8073e4da38afSmrg# -------------------------
8074e4da38afSmrg# Ensure that the configuration variables for the Windows resource compiler
8075e4da38afSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8076e4da38afSmrg# to write the compiler configuration to 'libtool'.
8077e4da38afSmrgm4_defun([_LT_LANG_RC_CONFIG],
8078e4da38afSmrg[AC_REQUIRE([LT_PROG_RC])dnl
8079e4da38afSmrgAC_LANG_SAVE
8080e4da38afSmrg
8081e4da38afSmrg# Source file extension for RC test sources.
8082e4da38afSmrgac_ext=rc
8083e4da38afSmrg
8084e4da38afSmrg# Object file extension for compiled RC test sources.
8085e4da38afSmrgobjext=o
8086e4da38afSmrg_LT_TAGVAR(objext, $1)=$objext
8087e4da38afSmrg
8088e4da38afSmrg# Code to be used in simple compile tests
8089e4da38afSmrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8090e4da38afSmrg
8091e4da38afSmrg# Code to be used in simple link tests
8092e4da38afSmrglt_simple_link_test_code=$lt_simple_compile_test_code
8093e4da38afSmrg
8094e4da38afSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8095e4da38afSmrg_LT_TAG_COMPILER
8096e4da38afSmrg
8097e4da38afSmrg# save warnings/boilerplate of simple test code
8098e4da38afSmrg_LT_COMPILER_BOILERPLATE
8099e4da38afSmrg_LT_LINKER_BOILERPLATE
8100e4da38afSmrg
8101e4da38afSmrg# Allow CC to be a program name with arguments.
8102e4da38afSmrglt_save_CC=$CC
8103e4da38afSmrglt_save_CFLAGS=$CFLAGS
8104e4da38afSmrglt_save_GCC=$GCC
8105e4da38afSmrgGCC=
8106e4da38afSmrgCC=${RC-"windres"}
8107e4da38afSmrgCFLAGS=
8108e4da38afSmrgcompiler=$CC
8109e4da38afSmrg_LT_TAGVAR(compiler, $1)=$CC
8110e4da38afSmrg_LT_CC_BASENAME([$compiler])
8111e4da38afSmrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8112e4da38afSmrg
8113e4da38afSmrgif test -n "$compiler"; then
8114e4da38afSmrg  :
8115e4da38afSmrg  _LT_CONFIG($1)
8116e4da38afSmrgfi
8117e4da38afSmrg
8118e4da38afSmrgGCC=$lt_save_GCC
8119e4da38afSmrgAC_LANG_RESTORE
8120e4da38afSmrgCC=$lt_save_CC
8121e4da38afSmrgCFLAGS=$lt_save_CFLAGS
8122e4da38afSmrg])# _LT_LANG_RC_CONFIG
8123e4da38afSmrg
8124e4da38afSmrg
8125e4da38afSmrg# LT_PROG_GCJ
8126e4da38afSmrg# -----------
8127e4da38afSmrgAC_DEFUN([LT_PROG_GCJ],
8128e4da38afSmrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
8129e4da38afSmrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
8130e4da38afSmrg    [AC_CHECK_TOOL(GCJ, gcj,)
8131e4da38afSmrg      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
8132e4da38afSmrg      AC_SUBST(GCJFLAGS)])])[]dnl
8133e4da38afSmrg])
8134e4da38afSmrg
8135e4da38afSmrg# Old name:
8136e4da38afSmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
8137e4da38afSmrgdnl aclocal-1.4 backwards compatibility:
8138e4da38afSmrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8139a73597f9Smrg
8140e4da38afSmrg
8141e4da38afSmrg# LT_PROG_GO
8142e4da38afSmrg# ----------
8143e4da38afSmrgAC_DEFUN([LT_PROG_GO],
8144e4da38afSmrg[AC_CHECK_TOOL(GOC, gccgo,)
814584bf8334Smrg])
8146a73597f9Smrg
814784bf8334Smrg
8148e4da38afSmrg# LT_PROG_RC
8149e4da38afSmrg# ----------
8150e4da38afSmrgAC_DEFUN([LT_PROG_RC],
8151e4da38afSmrg[AC_CHECK_TOOL(RC, windres,)
8152e4da38afSmrg])
8153a73597f9Smrg
8154e4da38afSmrg# Old name:
8155e4da38afSmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
8156e4da38afSmrgdnl aclocal-1.4 backwards compatibility:
8157e4da38afSmrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
8158a73597f9Smrg
8159a73597f9Smrg
8160e4da38afSmrg# _LT_DECL_EGREP
8161e4da38afSmrg# --------------
8162e4da38afSmrg# If we don't have a new enough Autoconf to choose the best grep
8163e4da38afSmrg# available, choose the one first in the user's PATH.
8164e4da38afSmrgm4_defun([_LT_DECL_EGREP],
8165e4da38afSmrg[AC_REQUIRE([AC_PROG_EGREP])dnl
8166e4da38afSmrgAC_REQUIRE([AC_PROG_FGREP])dnl
8167e4da38afSmrgtest -z "$GREP" && GREP=grep
8168e4da38afSmrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
8169e4da38afSmrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
8170e4da38afSmrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
8171e4da38afSmrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
8172e4da38afSmrgAC_SUBST([GREP])
8173e4da38afSmrg])
8174a73597f9Smrg
8175fc27e79cSmrg
8176e4da38afSmrg# _LT_DECL_OBJDUMP
8177e4da38afSmrg# --------------
8178e4da38afSmrg# If we don't have a new enough Autoconf to choose the best objdump
8179e4da38afSmrg# available, choose the one first in the user's PATH.
8180e4da38afSmrgm4_defun([_LT_DECL_OBJDUMP],
8181e4da38afSmrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
8182e4da38afSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
8183e4da38afSmrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
8184e4da38afSmrgAC_SUBST([OBJDUMP])
8185e4da38afSmrg])
8186b73be646Smrg
8187e4da38afSmrg# _LT_DECL_DLLTOOL
8188e4da38afSmrg# ----------------
8189e4da38afSmrg# Ensure DLLTOOL variable is set.
8190e4da38afSmrgm4_defun([_LT_DECL_DLLTOOL],
8191e4da38afSmrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8192e4da38afSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
8193e4da38afSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
8194e4da38afSmrgAC_SUBST([DLLTOOL])
8195e4da38afSmrg])
8196a73597f9Smrg
8197e4da38afSmrg# _LT_DECL_SED
8198e4da38afSmrg# ------------
8199e4da38afSmrg# Check for a fully-functional sed program, that truncates
8200e4da38afSmrg# as few characters as possible.  Prefer GNU sed if found.
8201e4da38afSmrgm4_defun([_LT_DECL_SED],
8202e4da38afSmrg[AC_PROG_SED
8203e4da38afSmrgtest -z "$SED" && SED=sed
8204e4da38afSmrgXsed="$SED -e 1s/^X//"
8205e4da38afSmrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
8206e4da38afSmrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
8207e4da38afSmrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
8208e4da38afSmrg])# _LT_DECL_SED
8209a73597f9Smrg
8210e4da38afSmrgm4_ifndef([AC_PROG_SED], [
8211e4da38afSmrg# NOTE: This macro has been submitted for inclusion into   #
8212e4da38afSmrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
8213e4da38afSmrg#  a released version of Autoconf we should remove this    #
8214e4da38afSmrg#  macro and use it instead.                               #
8215e4da38afSmrg
8216e4da38afSmrgm4_defun([AC_PROG_SED],
8217e4da38afSmrg[AC_MSG_CHECKING([for a sed that does not truncate output])
8218e4da38afSmrgAC_CACHE_VAL(lt_cv_path_SED,
8219e4da38afSmrg[# Loop through the user's path and test for sed and gsed.
8220e4da38afSmrg# Then use that list of sed's as ones to test for truncation.
8221e4da38afSmrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8222e4da38afSmrgfor as_dir in $PATH
8223e4da38afSmrgdo
8224e4da38afSmrg  IFS=$as_save_IFS
8225e4da38afSmrg  test -z "$as_dir" && as_dir=.
8226e4da38afSmrg  for lt_ac_prog in sed gsed; do
8227e4da38afSmrg    for ac_exec_ext in '' $ac_executable_extensions; do
8228e4da38afSmrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8229e4da38afSmrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
8230e4da38afSmrg      fi
8231e4da38afSmrg    done
8232e4da38afSmrg  done
8233e4da38afSmrgdone
8234e4da38afSmrgIFS=$as_save_IFS
8235e4da38afSmrglt_ac_max=0
8236e4da38afSmrglt_ac_count=0
8237e4da38afSmrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
8238e4da38afSmrg# along with /bin/sed that truncates output.
8239e4da38afSmrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8240e4da38afSmrg  test ! -f "$lt_ac_sed" && continue
8241e4da38afSmrg  cat /dev/null > conftest.in
8242e4da38afSmrg  lt_ac_count=0
8243e4da38afSmrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8244e4da38afSmrg  # Check for GNU sed and select it if it is found.
8245e4da38afSmrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8246e4da38afSmrg    lt_cv_path_SED=$lt_ac_sed
8247e4da38afSmrg    break
8248e4da38afSmrg  fi
8249e4da38afSmrg  while true; do
8250e4da38afSmrg    cat conftest.in conftest.in >conftest.tmp
8251e4da38afSmrg    mv conftest.tmp conftest.in
8252e4da38afSmrg    cp conftest.in conftest.nl
8253e4da38afSmrg    echo >>conftest.nl
8254e4da38afSmrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8255e4da38afSmrg    cmp -s conftest.out conftest.nl || break
8256e4da38afSmrg    # 10000 chars as input seems more than enough
8257e4da38afSmrg    test 10 -lt "$lt_ac_count" && break
8258e4da38afSmrg    lt_ac_count=`expr $lt_ac_count + 1`
8259e4da38afSmrg    if test "$lt_ac_count" -gt "$lt_ac_max"; then
8260e4da38afSmrg      lt_ac_max=$lt_ac_count
8261e4da38afSmrg      lt_cv_path_SED=$lt_ac_sed
8262e4da38afSmrg    fi
826384bf8334Smrg  done
8264e4da38afSmrgdone
8265e4da38afSmrg])
8266e4da38afSmrgSED=$lt_cv_path_SED
8267e4da38afSmrgAC_SUBST([SED])
8268e4da38afSmrgAC_MSG_RESULT([$SED])
8269e4da38afSmrg])#AC_PROG_SED
8270e4da38afSmrg])#m4_ifndef
8271a73597f9Smrg
8272e4da38afSmrg# Old name:
8273e4da38afSmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
8274e4da38afSmrgdnl aclocal-1.4 backwards compatibility:
8275e4da38afSmrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
8276a73597f9Smrg
8277a73597f9Smrg
8278e4da38afSmrg# _LT_CHECK_SHELL_FEATURES
8279e4da38afSmrg# ------------------------
8280e4da38afSmrg# Find out whether the shell is Bourne or XSI compatible,
8281e4da38afSmrg# or has some other useful features.
8282e4da38afSmrgm4_defun([_LT_CHECK_SHELL_FEATURES],
8283e4da38afSmrg[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8284e4da38afSmrg  lt_unset=unset
8285e4da38afSmrgelse
8286e4da38afSmrg  lt_unset=false
8287e4da38afSmrgfi
8288e4da38afSmrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8289e4da38afSmrg
8290e4da38afSmrg# test EBCDIC or ASCII
8291e4da38afSmrgcase `echo X|tr X '\101'` in
8292e4da38afSmrg A) # ASCII based system
8293e4da38afSmrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8294e4da38afSmrg  lt_SP2NL='tr \040 \012'
8295e4da38afSmrg  lt_NL2SP='tr \015\012 \040\040'
8296e4da38afSmrg  ;;
8297e4da38afSmrg *) # EBCDIC based system
8298e4da38afSmrg  lt_SP2NL='tr \100 \n'
8299e4da38afSmrg  lt_NL2SP='tr \r\n \100\100'
830084bf8334Smrg  ;;
8301e4da38afSmrgesac
8302e4da38afSmrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8303e4da38afSmrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8304e4da38afSmrg])# _LT_CHECK_SHELL_FEATURES
8305a73597f9Smrg
8306a73597f9Smrg
8307e4da38afSmrg# _LT_PATH_CONVERSION_FUNCTIONS
8308e4da38afSmrg# -----------------------------
8309e4da38afSmrg# Determine what file name conversion functions should be used by
8310e4da38afSmrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
8311e4da38afSmrg# for certain cross-compile configurations and native mingw.
8312e4da38afSmrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
8313e4da38afSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8314e4da38afSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
8315e4da38afSmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
8316e4da38afSmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
8317e4da38afSmrg[case $host in
8318e4da38afSmrg  *-*-mingw* )
8319e4da38afSmrg    case $build in
8320e4da38afSmrg      *-*-mingw* ) # actually msys
8321e4da38afSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
8322e4da38afSmrg        ;;
8323e4da38afSmrg      *-*-cygwin* )
8324e4da38afSmrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
8325e4da38afSmrg        ;;
8326e4da38afSmrg      * ) # otherwise, assume *nix
8327e4da38afSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
8328e4da38afSmrg        ;;
832984bf8334Smrg    esac
833084bf8334Smrg    ;;
8331e4da38afSmrg  *-*-cygwin* )
8332e4da38afSmrg    case $build in
8333e4da38afSmrg      *-*-mingw* ) # actually msys
8334e4da38afSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
8335e4da38afSmrg        ;;
8336e4da38afSmrg      *-*-cygwin* )
8337e4da38afSmrg        lt_cv_to_host_file_cmd=func_convert_file_noop
8338e4da38afSmrg        ;;
8339e4da38afSmrg      * ) # otherwise, assume *nix
8340e4da38afSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
8341e4da38afSmrg        ;;
834284bf8334Smrg    esac
834384bf8334Smrg    ;;
8344e4da38afSmrg  * ) # unhandled hosts (and "normal" native builds)
8345e4da38afSmrg    lt_cv_to_host_file_cmd=func_convert_file_noop
8346e4da38afSmrg    ;;
834784bf8334Smrgesac
8348a73597f9Smrg])
8349e4da38afSmrgto_host_file_cmd=$lt_cv_to_host_file_cmd
8350e4da38afSmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
8351e4da38afSmrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
8352e4da38afSmrg         [0], [convert $build file names to $host format])dnl
8353b73be646Smrg
8354e4da38afSmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
8355e4da38afSmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
8356e4da38afSmrg[#assume ordinary cross tools, or native build.
8357e4da38afSmrglt_cv_to_tool_file_cmd=func_convert_file_noop
8358e4da38afSmrgcase $host in
8359e4da38afSmrg  *-*-mingw* )
8360e4da38afSmrg    case $build in
8361e4da38afSmrg      *-*-mingw* ) # actually msys
8362e4da38afSmrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
8363e4da38afSmrg        ;;
8364e4da38afSmrg    esac
8365e4da38afSmrg    ;;
836684bf8334Smrgesac
8367e4da38afSmrg])
8368e4da38afSmrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
8369e4da38afSmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
8370e4da38afSmrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
8371e4da38afSmrg         [0], [convert $build files to toolchain format])dnl
8372e4da38afSmrg])# _LT_PATH_CONVERSION_FUNCTIONS
8373b73be646Smrg
8374e4da38afSmrg# Helper functions for option handling.                    -*- Autoconf -*-
8375e4da38afSmrg#
8376e4da38afSmrg#   Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
8377e4da38afSmrg#   Foundation, Inc.
8378e4da38afSmrg#   Written by Gary V. Vaughan, 2004
8379e4da38afSmrg#
8380e4da38afSmrg# This file is free software; the Free Software Foundation gives
8381e4da38afSmrg# unlimited permission to copy and/or distribute it, with or without
8382e4da38afSmrg# modifications, as long as this notice is preserved.
8383b73be646Smrg
8384e4da38afSmrg# serial 8 ltoptions.m4
8385fc27e79cSmrg
8386e4da38afSmrg# This is to help aclocal find these macros, as it can't see m4_define.
8387e4da38afSmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
8388fc27e79cSmrg
8389fc27e79cSmrg
8390e4da38afSmrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
8391e4da38afSmrg# ------------------------------------------
8392e4da38afSmrgm4_define([_LT_MANGLE_OPTION],
8393e4da38afSmrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
8394fc27e79cSmrg
8395fc27e79cSmrg
8396e4da38afSmrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
8397e4da38afSmrg# ---------------------------------------
8398e4da38afSmrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
8399e4da38afSmrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
8400e4da38afSmrg# saved as a flag.
8401e4da38afSmrgm4_define([_LT_SET_OPTION],
8402e4da38afSmrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
8403e4da38afSmrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
8404e4da38afSmrg        _LT_MANGLE_DEFUN([$1], [$2]),
8405e4da38afSmrg    [m4_warning([Unknown $1 option '$2'])])[]dnl
8406e4da38afSmrg])
8407fc27e79cSmrg
8408fc27e79cSmrg
8409e4da38afSmrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
8410e4da38afSmrg# ------------------------------------------------------------
8411e4da38afSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
8412e4da38afSmrgm4_define([_LT_IF_OPTION],
8413e4da38afSmrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
8414fc27e79cSmrg
8415fc27e79cSmrg
8416e4da38afSmrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
8417e4da38afSmrg# -------------------------------------------------------
8418e4da38afSmrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
8419e4da38afSmrg# are set.
8420e4da38afSmrgm4_define([_LT_UNLESS_OPTIONS],
8421e4da38afSmrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8422e4da38afSmrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
8423e4da38afSmrg		      [m4_define([$0_found])])])[]dnl
8424e4da38afSmrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
8425e4da38afSmrg])[]dnl
8426e4da38afSmrg])
8427fc27e79cSmrg
8428fc27e79cSmrg
8429e4da38afSmrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
8430e4da38afSmrg# ----------------------------------------
8431e4da38afSmrg# OPTION-LIST is a space-separated list of Libtool options associated
8432e4da38afSmrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
8433e4da38afSmrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
8434e4da38afSmrg# the unknown option and exit.
8435e4da38afSmrgm4_defun([_LT_SET_OPTIONS],
8436e4da38afSmrg[# Set options
8437e4da38afSmrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8438e4da38afSmrg    [_LT_SET_OPTION([$1], _LT_Option)])
8439fc27e79cSmrg
8440e4da38afSmrgm4_if([$1],[LT_INIT],[
8441e4da38afSmrg  dnl
8442e4da38afSmrg  dnl Simply set some default values (i.e off) if boolean options were not
8443e4da38afSmrg  dnl specified:
8444e4da38afSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
8445e4da38afSmrg  ])
8446e4da38afSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
8447e4da38afSmrg  ])
8448e4da38afSmrg  dnl
8449e4da38afSmrg  dnl If no reference was made to various pairs of opposing options, then
8450e4da38afSmrg  dnl we run the default mode handler for the pair.  For example, if neither
8451e4da38afSmrg  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
8452e4da38afSmrg  dnl archives by default:
8453e4da38afSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
8454e4da38afSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
8455e4da38afSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
8456e4da38afSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
8457e4da38afSmrg		   [_LT_ENABLE_FAST_INSTALL])
8458e4da38afSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
8459e4da38afSmrg		   [_LT_WITH_AIX_SONAME([aix])])
8460e4da38afSmrg  ])
8461e4da38afSmrg])# _LT_SET_OPTIONS
8462fc27e79cSmrg
8463fc27e79cSmrg
8464fc27e79cSmrg
8465e4da38afSmrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
8466e4da38afSmrg# -----------------------------------------
8467e4da38afSmrgm4_define([_LT_MANGLE_DEFUN],
8468e4da38afSmrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
8469b73be646Smrg
8470fc27e79cSmrg
8471e4da38afSmrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
8472e4da38afSmrg# -----------------------------------------------
8473e4da38afSmrgm4_define([LT_OPTION_DEFINE],
8474e4da38afSmrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
8475e4da38afSmrg])# LT_OPTION_DEFINE
8476fc27e79cSmrg
8477fc27e79cSmrg
8478e4da38afSmrg# dlopen
8479e4da38afSmrg# ------
8480e4da38afSmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
8481e4da38afSmrg])
8482fc27e79cSmrg
8483e4da38afSmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
8484e4da38afSmrg[_LT_SET_OPTION([LT_INIT], [dlopen])
8485e4da38afSmrgAC_DIAGNOSE([obsolete],
8486e4da38afSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8487e4da38afSmrgput the 'dlopen' option into LT_INIT's first parameter.])
8488e4da38afSmrg])
8489fc27e79cSmrg
8490e4da38afSmrgdnl aclocal-1.4 backwards compatibility:
8491e4da38afSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
8492bd3a1963Smrg
8493fc27e79cSmrg
8494e4da38afSmrg# win32-dll
8495e4da38afSmrg# ---------
8496e4da38afSmrg# Declare package support for building win32 dll's.
8497e4da38afSmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
8498e4da38afSmrg[enable_win32_dll=yes
8499fc27e79cSmrg
8500e4da38afSmrgcase $host in
8501e4da38afSmrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
8502e4da38afSmrg  AC_CHECK_TOOL(AS, as, false)
8503e4da38afSmrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8504e4da38afSmrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
8505e4da38afSmrg  ;;
8506e4da38afSmrgesac
8507fc27e79cSmrg
8508e4da38afSmrgtest -z "$AS" && AS=as
8509e4da38afSmrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
8510fc27e79cSmrg
8511e4da38afSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
8512e4da38afSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
8513fc27e79cSmrg
8514e4da38afSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
8515e4da38afSmrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
8516e4da38afSmrg])# win32-dll
8517fc27e79cSmrg
8518e4da38afSmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
8519e4da38afSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8520e4da38afSmrg_LT_SET_OPTION([LT_INIT], [win32-dll])
8521e4da38afSmrgAC_DIAGNOSE([obsolete],
8522e4da38afSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8523e4da38afSmrgput the 'win32-dll' option into LT_INIT's first parameter.])
8524e4da38afSmrg])
8525bd3a1963Smrg
8526e4da38afSmrgdnl aclocal-1.4 backwards compatibility:
8527e4da38afSmrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
8528fc27e79cSmrg
8529fc27e79cSmrg
8530e4da38afSmrg# _LT_ENABLE_SHARED([DEFAULT])
8531e4da38afSmrg# ----------------------------
8532e4da38afSmrg# implement the --enable-shared flag, and supports the 'shared' and
8533e4da38afSmrg# 'disable-shared' LT_INIT options.
8534e4da38afSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
8535e4da38afSmrgm4_define([_LT_ENABLE_SHARED],
8536e4da38afSmrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
8537e4da38afSmrgAC_ARG_ENABLE([shared],
8538e4da38afSmrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
8539e4da38afSmrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
8540e4da38afSmrg    [p=${PACKAGE-default}
8541e4da38afSmrg    case $enableval in
8542e4da38afSmrg    yes) enable_shared=yes ;;
8543e4da38afSmrg    no) enable_shared=no ;;
8544e4da38afSmrg    *)
8545e4da38afSmrg      enable_shared=no
8546e4da38afSmrg      # Look at the argument we got.  We use all the common list separators.
8547e4da38afSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8548e4da38afSmrg      for pkg in $enableval; do
8549e4da38afSmrg	IFS=$lt_save_ifs
8550e4da38afSmrg	if test "X$pkg" = "X$p"; then
8551e4da38afSmrg	  enable_shared=yes
8552e4da38afSmrg	fi
8553e4da38afSmrg      done
8554e4da38afSmrg      IFS=$lt_save_ifs
8555e4da38afSmrg      ;;
8556e4da38afSmrg    esac],
8557e4da38afSmrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
8558fc27e79cSmrg
8559e4da38afSmrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
8560e4da38afSmrg	[Whether or not to build shared libraries])
8561e4da38afSmrg])# _LT_ENABLE_SHARED
8562fc27e79cSmrg
8563e4da38afSmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
8564e4da38afSmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
8565fc27e79cSmrg
8566e4da38afSmrg# Old names:
8567e4da38afSmrgAC_DEFUN([AC_ENABLE_SHARED],
8568e4da38afSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
8569e4da38afSmrg])
8570fc27e79cSmrg
8571e4da38afSmrgAC_DEFUN([AC_DISABLE_SHARED],
8572e4da38afSmrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
8573e4da38afSmrg])
8574fc27e79cSmrg
8575e4da38afSmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
8576e4da38afSmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
8577a73597f9Smrg
8578e4da38afSmrgdnl aclocal-1.4 backwards compatibility:
8579e4da38afSmrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
8580e4da38afSmrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
8581fc27e79cSmrg
8582fc27e79cSmrg
8583fc27e79cSmrg
8584e4da38afSmrg# _LT_ENABLE_STATIC([DEFAULT])
8585e4da38afSmrg# ----------------------------
8586e4da38afSmrg# implement the --enable-static flag, and support the 'static' and
8587e4da38afSmrg# 'disable-static' LT_INIT options.
8588e4da38afSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
8589e4da38afSmrgm4_define([_LT_ENABLE_STATIC],
8590e4da38afSmrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
8591e4da38afSmrgAC_ARG_ENABLE([static],
8592e4da38afSmrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
8593e4da38afSmrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
8594e4da38afSmrg    [p=${PACKAGE-default}
8595e4da38afSmrg    case $enableval in
8596e4da38afSmrg    yes) enable_static=yes ;;
8597e4da38afSmrg    no) enable_static=no ;;
8598e4da38afSmrg    *)
8599e4da38afSmrg     enable_static=no
8600e4da38afSmrg      # Look at the argument we got.  We use all the common list separators.
8601e4da38afSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8602e4da38afSmrg      for pkg in $enableval; do
8603e4da38afSmrg	IFS=$lt_save_ifs
8604e4da38afSmrg	if test "X$pkg" = "X$p"; then
8605e4da38afSmrg	  enable_static=yes
8606e4da38afSmrg	fi
8607e4da38afSmrg      done
8608e4da38afSmrg      IFS=$lt_save_ifs
8609e4da38afSmrg      ;;
8610e4da38afSmrg    esac],
8611e4da38afSmrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
8612fc27e79cSmrg
8613e4da38afSmrg    _LT_DECL([build_old_libs], [enable_static], [0],
8614e4da38afSmrg	[Whether or not to build static libraries])
8615e4da38afSmrg])# _LT_ENABLE_STATIC
8616fc27e79cSmrg
8617e4da38afSmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
8618e4da38afSmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
8619fc27e79cSmrg
8620e4da38afSmrg# Old names:
8621e4da38afSmrgAC_DEFUN([AC_ENABLE_STATIC],
8622e4da38afSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
8623e4da38afSmrg])
8624fc27e79cSmrg
8625e4da38afSmrgAC_DEFUN([AC_DISABLE_STATIC],
8626e4da38afSmrg[_LT_SET_OPTION([LT_INIT], [disable-static])
8627e4da38afSmrg])
8628fc27e79cSmrg
8629e4da38afSmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
8630e4da38afSmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
8631fc27e79cSmrg
8632e4da38afSmrgdnl aclocal-1.4 backwards compatibility:
8633e4da38afSmrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
8634e4da38afSmrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
8635fc27e79cSmrg
8636fc27e79cSmrg
8637fc27e79cSmrg
8638e4da38afSmrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
8639e4da38afSmrg# ----------------------------------
8640e4da38afSmrg# implement the --enable-fast-install flag, and support the 'fast-install'
8641e4da38afSmrg# and 'disable-fast-install' LT_INIT options.
8642e4da38afSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
8643e4da38afSmrgm4_define([_LT_ENABLE_FAST_INSTALL],
8644e4da38afSmrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
8645e4da38afSmrgAC_ARG_ENABLE([fast-install],
8646e4da38afSmrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
8647e4da38afSmrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
8648e4da38afSmrg    [p=${PACKAGE-default}
8649e4da38afSmrg    case $enableval in
8650e4da38afSmrg    yes) enable_fast_install=yes ;;
8651e4da38afSmrg    no) enable_fast_install=no ;;
8652e4da38afSmrg    *)
8653e4da38afSmrg      enable_fast_install=no
8654e4da38afSmrg      # Look at the argument we got.  We use all the common list separators.
8655e4da38afSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8656e4da38afSmrg      for pkg in $enableval; do
8657e4da38afSmrg	IFS=$lt_save_ifs
8658e4da38afSmrg	if test "X$pkg" = "X$p"; then
8659e4da38afSmrg	  enable_fast_install=yes
8660e4da38afSmrg	fi
8661e4da38afSmrg      done
8662e4da38afSmrg      IFS=$lt_save_ifs
8663e4da38afSmrg      ;;
8664e4da38afSmrg    esac],
8665e4da38afSmrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
8666fc27e79cSmrg
8667e4da38afSmrg_LT_DECL([fast_install], [enable_fast_install], [0],
8668e4da38afSmrg	 [Whether or not to optimize for fast installation])dnl
8669e4da38afSmrg])# _LT_ENABLE_FAST_INSTALL
8670b73be646Smrg
8671e4da38afSmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
8672e4da38afSmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
8673a73597f9Smrg
8674e4da38afSmrg# Old names:
8675e4da38afSmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
8676e4da38afSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
8677e4da38afSmrgAC_DIAGNOSE([obsolete],
8678e4da38afSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8679e4da38afSmrgthe 'fast-install' option into LT_INIT's first parameter.])
8680e4da38afSmrg])
8681a73597f9Smrg
8682e4da38afSmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
8683e4da38afSmrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
8684e4da38afSmrgAC_DIAGNOSE([obsolete],
8685e4da38afSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8686e4da38afSmrgthe 'disable-fast-install' option into LT_INIT's first parameter.])
8687e4da38afSmrg])
8688b73be646Smrg
8689e4da38afSmrgdnl aclocal-1.4 backwards compatibility:
8690e4da38afSmrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
8691e4da38afSmrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
8692fc27e79cSmrg
8693fc27e79cSmrg
8694e4da38afSmrg# _LT_WITH_AIX_SONAME([DEFAULT])
8695e4da38afSmrg# ----------------------------------
8696e4da38afSmrg# implement the --with-aix-soname flag, and support the `aix-soname=aix'
8697e4da38afSmrg# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
8698e4da38afSmrg# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
8699e4da38afSmrgm4_define([_LT_WITH_AIX_SONAME],
8700e4da38afSmrg[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
8701e4da38afSmrgshared_archive_member_spec=
8702e4da38afSmrgcase $host,$enable_shared in
8703e4da38afSmrgpower*-*-aix[[5-9]]*,yes)
8704e4da38afSmrg  AC_MSG_CHECKING([which variant of shared library versioning to provide])
8705e4da38afSmrg  AC_ARG_WITH([aix-soname],
8706e4da38afSmrg    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
8707e4da38afSmrg      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
8708e4da38afSmrg    [case $withval in
8709e4da38afSmrg    aix|svr4|both)
8710e4da38afSmrg      ;;
8711e4da38afSmrg    *)
8712e4da38afSmrg      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
8713e4da38afSmrg      ;;
8714e4da38afSmrg    esac
8715e4da38afSmrg    lt_cv_with_aix_soname=$with_aix_soname],
8716e4da38afSmrg    [AC_CACHE_VAL([lt_cv_with_aix_soname],
8717e4da38afSmrg      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
8718e4da38afSmrg    with_aix_soname=$lt_cv_with_aix_soname])
8719e4da38afSmrg  AC_MSG_RESULT([$with_aix_soname])
8720e4da38afSmrg  if test aix != "$with_aix_soname"; then
8721e4da38afSmrg    # For the AIX way of multilib, we name the shared archive member
8722e4da38afSmrg    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
8723e4da38afSmrg    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
8724e4da38afSmrg    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
8725e4da38afSmrg    # the AIX toolchain works better with OBJECT_MODE set (default 32).
8726e4da38afSmrg    if test 64 = "${OBJECT_MODE-32}"; then
8727e4da38afSmrg      shared_archive_member_spec=shr_64
8728e4da38afSmrg    else
8729e4da38afSmrg      shared_archive_member_spec=shr
8730e4da38afSmrg    fi
8731e4da38afSmrg  fi
8732e4da38afSmrg  ;;
8733e4da38afSmrg*)
8734e4da38afSmrg  with_aix_soname=aix
8735e4da38afSmrg  ;;
8736e4da38afSmrgesac
8737fc27e79cSmrg
8738e4da38afSmrg_LT_DECL([], [shared_archive_member_spec], [0],
8739e4da38afSmrg    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
8740e4da38afSmrg])# _LT_WITH_AIX_SONAME
8741fc27e79cSmrg
8742e4da38afSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
8743e4da38afSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
8744e4da38afSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
8745fc27e79cSmrg
8746fc27e79cSmrg
8747e4da38afSmrg# _LT_WITH_PIC([MODE])
8748e4da38afSmrg# --------------------
8749e4da38afSmrg# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
8750e4da38afSmrg# LT_INIT options.
8751e4da38afSmrg# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
8752e4da38afSmrgm4_define([_LT_WITH_PIC],
8753e4da38afSmrg[AC_ARG_WITH([pic],
8754e4da38afSmrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
8755e4da38afSmrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
8756e4da38afSmrg    [lt_p=${PACKAGE-default}
8757e4da38afSmrg    case $withval in
8758e4da38afSmrg    yes|no) pic_mode=$withval ;;
8759e4da38afSmrg    *)
8760e4da38afSmrg      pic_mode=default
8761e4da38afSmrg      # Look at the argument we got.  We use all the common list separators.
8762e4da38afSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8763e4da38afSmrg      for lt_pkg in $withval; do
8764e4da38afSmrg	IFS=$lt_save_ifs
8765e4da38afSmrg	if test "X$lt_pkg" = "X$lt_p"; then
8766e4da38afSmrg	  pic_mode=yes
8767e4da38afSmrg	fi
8768e4da38afSmrg      done
8769e4da38afSmrg      IFS=$lt_save_ifs
8770e4da38afSmrg      ;;
8771e4da38afSmrg    esac],
8772e4da38afSmrg    [pic_mode=m4_default([$1], [default])])
877384bf8334Smrg
8774e4da38afSmrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
8775e4da38afSmrg])# _LT_WITH_PIC
8776fc27e79cSmrg
8777e4da38afSmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
8778e4da38afSmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
8779fc27e79cSmrg
8780e4da38afSmrg# Old name:
8781e4da38afSmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
8782e4da38afSmrg[_LT_SET_OPTION([LT_INIT], [pic-only])
8783e4da38afSmrgAC_DIAGNOSE([obsolete],
8784e4da38afSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8785e4da38afSmrgput the 'pic-only' option into LT_INIT's first parameter.])
8786e4da38afSmrg])
8787fc27e79cSmrg
8788e4da38afSmrgdnl aclocal-1.4 backwards compatibility:
8789e4da38afSmrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
8790fc27e79cSmrg
8791fc27e79cSmrg
8792e4da38afSmrgm4_define([_LTDL_MODE], [])
8793e4da38afSmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
8794e4da38afSmrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
8795e4da38afSmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
8796e4da38afSmrg		 [m4_define([_LTDL_MODE], [recursive])])
8797e4da38afSmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
8798e4da38afSmrg		 [m4_define([_LTDL_MODE], [subproject])])
8799fc27e79cSmrg
8800e4da38afSmrgm4_define([_LTDL_TYPE], [])
8801e4da38afSmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
8802e4da38afSmrg		 [m4_define([_LTDL_TYPE], [installable])])
8803e4da38afSmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
8804e4da38afSmrg		 [m4_define([_LTDL_TYPE], [convenience])])
8805fc27e79cSmrg
8806e4da38afSmrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
8807e4da38afSmrg#
8808e4da38afSmrg# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
8809e4da38afSmrg# Foundation, Inc.
8810e4da38afSmrg# Written by Gary V. Vaughan, 2004
8811e4da38afSmrg#
8812e4da38afSmrg# This file is free software; the Free Software Foundation gives
8813e4da38afSmrg# unlimited permission to copy and/or distribute it, with or without
8814e4da38afSmrg# modifications, as long as this notice is preserved.
8815fc27e79cSmrg
8816e4da38afSmrg# serial 6 ltsugar.m4
8817fc27e79cSmrg
8818e4da38afSmrg# This is to help aclocal find these macros, as it can't see m4_define.
8819e4da38afSmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
8820fc27e79cSmrg
8821fc27e79cSmrg
8822e4da38afSmrg# lt_join(SEP, ARG1, [ARG2...])
8823e4da38afSmrg# -----------------------------
8824e4da38afSmrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
8825e4da38afSmrg# associated separator.
8826e4da38afSmrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
8827e4da38afSmrg# versions in m4sugar had bugs.
8828e4da38afSmrgm4_define([lt_join],
8829e4da38afSmrg[m4_if([$#], [1], [],
8830e4da38afSmrg       [$#], [2], [[$2]],
8831e4da38afSmrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
8832e4da38afSmrgm4_define([_lt_join],
8833e4da38afSmrg[m4_if([$#$2], [2], [],
8834e4da38afSmrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
8835fc27e79cSmrg
8836fc27e79cSmrg
8837e4da38afSmrg# lt_car(LIST)
8838e4da38afSmrg# lt_cdr(LIST)
8839e4da38afSmrg# ------------
8840e4da38afSmrg# Manipulate m4 lists.
8841e4da38afSmrg# These macros are necessary as long as will still need to support
8842e4da38afSmrg# Autoconf-2.59, which quotes differently.
8843e4da38afSmrgm4_define([lt_car], [[$1]])
8844e4da38afSmrgm4_define([lt_cdr],
8845e4da38afSmrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
8846e4da38afSmrg       [$#], 1, [],
8847e4da38afSmrg       [m4_dquote(m4_shift($@))])])
8848e4da38afSmrgm4_define([lt_unquote], $1)
8849a73597f9Smrg
8850fc27e79cSmrg
8851e4da38afSmrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
8852e4da38afSmrg# ------------------------------------------
8853e4da38afSmrg# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
8854e4da38afSmrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
8855e4da38afSmrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
8856e4da38afSmrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
8857e4da38afSmrg# than defined and empty).
8858e4da38afSmrg#
8859e4da38afSmrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
8860e4da38afSmrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
8861e4da38afSmrgm4_define([lt_append],
8862e4da38afSmrg[m4_define([$1],
8863e4da38afSmrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
8864fc27e79cSmrg
8865fc27e79cSmrg
8866fc27e79cSmrg
8867e4da38afSmrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
8868e4da38afSmrg# ----------------------------------------------------------
8869e4da38afSmrg# Produce a SEP delimited list of all paired combinations of elements of
8870e4da38afSmrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
8871e4da38afSmrg# has the form PREFIXmINFIXSUFFIXn.
8872e4da38afSmrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
8873e4da38afSmrgm4_define([lt_combine],
8874e4da38afSmrg[m4_if(m4_eval([$# > 3]), [1],
8875e4da38afSmrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
8876e4da38afSmrg[[m4_foreach([_Lt_prefix], [$2],
8877e4da38afSmrg	     [m4_foreach([_Lt_suffix],
8878e4da38afSmrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
8879e4da38afSmrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
8880fc27e79cSmrg
8881fc27e79cSmrg
8882e4da38afSmrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
8883e4da38afSmrg# -----------------------------------------------------------------------
8884e4da38afSmrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
8885e4da38afSmrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
8886e4da38afSmrgm4_define([lt_if_append_uniq],
8887e4da38afSmrg[m4_ifdef([$1],
8888e4da38afSmrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
8889e4da38afSmrg		 [lt_append([$1], [$2], [$3])$4],
8890e4da38afSmrg		 [$5])],
8891e4da38afSmrg	  [lt_append([$1], [$2], [$3])$4])])
8892fc27e79cSmrg
8893fc27e79cSmrg
8894e4da38afSmrg# lt_dict_add(DICT, KEY, VALUE)
8895e4da38afSmrg# -----------------------------
8896e4da38afSmrgm4_define([lt_dict_add],
8897e4da38afSmrg[m4_define([$1($2)], [$3])])
8898a73597f9Smrg
8899fc27e79cSmrg
8900e4da38afSmrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
8901e4da38afSmrg# --------------------------------------------
8902e4da38afSmrgm4_define([lt_dict_add_subkey],
8903e4da38afSmrg[m4_define([$1($2:$3)], [$4])])
8904fc27e79cSmrg
8905fc27e79cSmrg
8906e4da38afSmrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
8907e4da38afSmrg# ----------------------------------
8908e4da38afSmrgm4_define([lt_dict_fetch],
8909e4da38afSmrg[m4_ifval([$3],
8910e4da38afSmrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
8911e4da38afSmrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
8912bd3a1963Smrg
8913fc27e79cSmrg
8914e4da38afSmrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
8915e4da38afSmrg# -----------------------------------------------------------------
8916e4da38afSmrgm4_define([lt_if_dict_fetch],
8917e4da38afSmrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
8918e4da38afSmrg	[$5],
8919e4da38afSmrg    [$6])])
8920bd3a1963Smrg
8921bd3a1963Smrg
8922e4da38afSmrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
8923e4da38afSmrg# --------------------------------------------------------------
8924e4da38afSmrgm4_define([lt_dict_filter],
8925e4da38afSmrg[m4_if([$5], [], [],
8926e4da38afSmrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
8927e4da38afSmrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
8928e4da38afSmrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
8929e4da38afSmrg])
893084bf8334Smrg
8931e4da38afSmrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
8932e4da38afSmrg#
8933e4da38afSmrg#   Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
8934e4da38afSmrg#   Written by Scott James Remnant, 2004
8935e4da38afSmrg#
8936e4da38afSmrg# This file is free software; the Free Software Foundation gives
8937e4da38afSmrg# unlimited permission to copy and/or distribute it, with or without
8938e4da38afSmrg# modifications, as long as this notice is preserved.
8939fc27e79cSmrg
8940e4da38afSmrg# @configure_input@
8941b73be646Smrg
8942e4da38afSmrg# serial 4179 ltversion.m4
8943e4da38afSmrg# This file is part of GNU Libtool
894484bf8334Smrg
8945e4da38afSmrgm4_define([LT_PACKAGE_VERSION], [2.4.6])
8946e4da38afSmrgm4_define([LT_PACKAGE_REVISION], [2.4.6])
894784bf8334Smrg
8948e4da38afSmrgAC_DEFUN([LTVERSION_VERSION],
8949e4da38afSmrg[macro_version='2.4.6'
8950e4da38afSmrgmacro_revision='2.4.6'
8951e4da38afSmrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
8952e4da38afSmrg_LT_DECL(, macro_revision, 0)
8953e4da38afSmrg])
8954fc27e79cSmrg
8955e4da38afSmrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
8956e4da38afSmrg#
8957e4da38afSmrg#   Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
8958e4da38afSmrg#   Foundation, Inc.
8959e4da38afSmrg#   Written by Scott James Remnant, 2004.
8960e4da38afSmrg#
8961e4da38afSmrg# This file is free software; the Free Software Foundation gives
8962e4da38afSmrg# unlimited permission to copy and/or distribute it, with or without
8963e4da38afSmrg# modifications, as long as this notice is preserved.
8964fc27e79cSmrg
8965e4da38afSmrg# serial 5 lt~obsolete.m4
8966fc27e79cSmrg
8967e4da38afSmrg# These exist entirely to fool aclocal when bootstrapping libtool.
8968e4da38afSmrg#
8969e4da38afSmrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
8970e4da38afSmrg# which have later been changed to m4_define as they aren't part of the
8971e4da38afSmrg# exported API, or moved to Autoconf or Automake where they belong.
8972e4da38afSmrg#
8973e4da38afSmrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
8974e4da38afSmrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
8975e4da38afSmrg# using a macro with the same name in our local m4/libtool.m4 it'll
8976e4da38afSmrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
8977e4da38afSmrg# and doesn't know about Autoconf macros at all.)
8978e4da38afSmrg#
8979e4da38afSmrg# So we provide this file, which has a silly filename so it's always
8980e4da38afSmrg# included after everything else.  This provides aclocal with the
8981e4da38afSmrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
8982e4da38afSmrg# because those macros already exist, or will be overwritten later.
8983e4da38afSmrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
8984e4da38afSmrg#
8985e4da38afSmrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
8986e4da38afSmrg# Yes, that means every name once taken will need to remain here until
8987e4da38afSmrg# we give up compatibility with versions before 1.7, at which point
8988e4da38afSmrg# we need to keep only those names which we still refer to.
8989fc27e79cSmrg
8990e4da38afSmrg# This is to help aclocal find these macros, as it can't see m4_define.
8991e4da38afSmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
8992fc27e79cSmrg
8993e4da38afSmrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
8994e4da38afSmrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
8995e4da38afSmrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
8996e4da38afSmrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
8997e4da38afSmrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
8998e4da38afSmrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
8999e4da38afSmrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
9000e4da38afSmrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
9001e4da38afSmrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
9002e4da38afSmrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
9003e4da38afSmrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
9004e4da38afSmrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
9005e4da38afSmrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
9006e4da38afSmrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
9007e4da38afSmrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
9008e4da38afSmrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
9009e4da38afSmrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
9010e4da38afSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
9011e4da38afSmrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
9012e4da38afSmrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
9013e4da38afSmrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
9014e4da38afSmrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
9015e4da38afSmrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
9016e4da38afSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
9017e4da38afSmrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
9018e4da38afSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
9019e4da38afSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
9020e4da38afSmrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
9021e4da38afSmrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
9022e4da38afSmrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
9023e4da38afSmrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
9024e4da38afSmrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
9025e4da38afSmrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
9026e4da38afSmrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
9027e4da38afSmrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
9028e4da38afSmrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
9029e4da38afSmrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
9030e4da38afSmrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
9031e4da38afSmrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
9032e4da38afSmrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
9033e4da38afSmrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
9034e4da38afSmrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
9035e4da38afSmrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
9036e4da38afSmrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
9037e4da38afSmrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
9038e4da38afSmrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
9039e4da38afSmrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
9040e4da38afSmrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
9041e4da38afSmrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
9042e4da38afSmrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
9043e4da38afSmrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
9044e4da38afSmrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
9045e4da38afSmrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
9046e4da38afSmrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
9047e4da38afSmrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
9048e4da38afSmrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
9049e4da38afSmrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
9050e4da38afSmrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
9051e4da38afSmrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
9052e4da38afSmrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
9053e4da38afSmrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
9054fc27e79cSmrg
9055e4da38afSmrgdnl pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
9056e4da38afSmrgdnl serial 11 (pkg-config-0.29.1)
9057e4da38afSmrgdnl
9058e4da38afSmrgdnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
9059e4da38afSmrgdnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
9060e4da38afSmrgdnl
9061e4da38afSmrgdnl This program is free software; you can redistribute it and/or modify
9062e4da38afSmrgdnl it under the terms of the GNU General Public License as published by
9063e4da38afSmrgdnl the Free Software Foundation; either version 2 of the License, or
9064e4da38afSmrgdnl (at your option) any later version.
9065e4da38afSmrgdnl
9066e4da38afSmrgdnl This program is distributed in the hope that it will be useful, but
9067e4da38afSmrgdnl WITHOUT ANY WARRANTY; without even the implied warranty of
9068e4da38afSmrgdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9069e4da38afSmrgdnl General Public License for more details.
9070e4da38afSmrgdnl
9071e4da38afSmrgdnl You should have received a copy of the GNU General Public License
9072e4da38afSmrgdnl along with this program; if not, write to the Free Software
9073e4da38afSmrgdnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
9074e4da38afSmrgdnl 02111-1307, USA.
9075e4da38afSmrgdnl
9076e4da38afSmrgdnl As a special exception to the GNU General Public License, if you
9077e4da38afSmrgdnl distribute this file as part of a program that contains a
9078e4da38afSmrgdnl configuration script generated by Autoconf, you may include it under
9079e4da38afSmrgdnl the same distribution terms that you use for the rest of that
9080e4da38afSmrgdnl program.
9081e4da38afSmrg
9082e4da38afSmrgdnl PKG_PREREQ(MIN-VERSION)
9083e4da38afSmrgdnl -----------------------
9084e4da38afSmrgdnl Since: 0.29
9085e4da38afSmrgdnl
9086e4da38afSmrgdnl Verify that the version of the pkg-config macros are at least
9087e4da38afSmrgdnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
9088e4da38afSmrgdnl installed version of pkg-config, this checks the developer's version
9089e4da38afSmrgdnl of pkg.m4 when generating configure.
9090e4da38afSmrgdnl
9091e4da38afSmrgdnl To ensure that this macro is defined, also add:
9092e4da38afSmrgdnl m4_ifndef([PKG_PREREQ],
9093e4da38afSmrgdnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
9094e4da38afSmrgdnl
9095e4da38afSmrgdnl See the "Since" comment for each macro you use to see what version
9096e4da38afSmrgdnl of the macros you require.
9097e4da38afSmrgm4_defun([PKG_PREREQ],
9098e4da38afSmrg[m4_define([PKG_MACROS_VERSION], [0.29.1])
9099e4da38afSmrgm4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
9100e4da38afSmrg    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
9101e4da38afSmrg])dnl PKG_PREREQ
9102e4da38afSmrg
9103e4da38afSmrgdnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
9104e4da38afSmrgdnl ----------------------------------
9105e4da38afSmrgdnl Since: 0.16
9106e4da38afSmrgdnl
9107e4da38afSmrgdnl Search for the pkg-config tool and set the PKG_CONFIG variable to
9108e4da38afSmrgdnl first found in the path. Checks that the version of pkg-config found
9109e4da38afSmrgdnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
9110e4da38afSmrgdnl used since that's the first version where most current features of
9111e4da38afSmrgdnl pkg-config existed.
9112e4da38afSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
9113e4da38afSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
9114e4da38afSmrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
9115e4da38afSmrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
9116e4da38afSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
9117e4da38afSmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
9118e4da38afSmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
9119fc27e79cSmrg
9120e4da38afSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
9121e4da38afSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
9122a73597f9Smrgfi
9123e4da38afSmrgif test -n "$PKG_CONFIG"; then
9124e4da38afSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
9125e4da38afSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
9126e4da38afSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
9127e4da38afSmrg		AC_MSG_RESULT([yes])
9128e4da38afSmrg	else
9129e4da38afSmrg		AC_MSG_RESULT([no])
9130e4da38afSmrg		PKG_CONFIG=""
9131e4da38afSmrg	fi
9132e4da38afSmrgfi[]dnl
9133e4da38afSmrg])dnl PKG_PROG_PKG_CONFIG
9134fc27e79cSmrg
9135e4da38afSmrgdnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
9136e4da38afSmrgdnl -------------------------------------------------------------------
9137e4da38afSmrgdnl Since: 0.18
9138e4da38afSmrgdnl
9139e4da38afSmrgdnl Check to see whether a particular set of modules exists. Similar to
9140e4da38afSmrgdnl PKG_CHECK_MODULES(), but does not set variables or print errors.
9141e4da38afSmrgdnl
9142e4da38afSmrgdnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9143e4da38afSmrgdnl only at the first occurence in configure.ac, so if the first place
9144e4da38afSmrgdnl it's called might be skipped (such as if it is within an "if", you
9145e4da38afSmrgdnl have to call PKG_CHECK_EXISTS manually
9146e4da38afSmrgAC_DEFUN([PKG_CHECK_EXISTS],
9147e4da38afSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9148e4da38afSmrgif test -n "$PKG_CONFIG" && \
9149e4da38afSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
9150e4da38afSmrg  m4_default([$2], [:])
9151e4da38afSmrgm4_ifvaln([$3], [else
9152e4da38afSmrg  $3])dnl
9153e4da38afSmrgfi])
9154fc27e79cSmrg
9155e4da38afSmrgdnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
9156e4da38afSmrgdnl ---------------------------------------------
9157e4da38afSmrgdnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
9158e4da38afSmrgdnl pkg_failed based on the result.
9159e4da38afSmrgm4_define([_PKG_CONFIG],
9160e4da38afSmrg[if test -n "$$1"; then
9161e4da38afSmrg    pkg_cv_[]$1="$$1"
9162e4da38afSmrg elif test -n "$PKG_CONFIG"; then
9163e4da38afSmrg    PKG_CHECK_EXISTS([$3],
9164e4da38afSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
9165e4da38afSmrg		      test "x$?" != "x0" && pkg_failed=yes ],
9166e4da38afSmrg		     [pkg_failed=yes])
9167e4da38afSmrg else
9168e4da38afSmrg    pkg_failed=untried
9169e4da38afSmrgfi[]dnl
9170e4da38afSmrg])dnl _PKG_CONFIG
9171fc27e79cSmrg
9172e4da38afSmrgdnl _PKG_SHORT_ERRORS_SUPPORTED
9173e4da38afSmrgdnl ---------------------------
9174e4da38afSmrgdnl Internal check to see if pkg-config supports short errors.
9175e4da38afSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
9176e4da38afSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9177e4da38afSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
9178e4da38afSmrg        _pkg_short_errors_supported=yes
917984bf8334Smrgelse
9180e4da38afSmrg        _pkg_short_errors_supported=no
9181e4da38afSmrgfi[]dnl
9182e4da38afSmrg])dnl _PKG_SHORT_ERRORS_SUPPORTED
9183fc27e79cSmrg
9184fc27e79cSmrg
9185e4da38afSmrgdnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
9186e4da38afSmrgdnl   [ACTION-IF-NOT-FOUND])
9187e4da38afSmrgdnl --------------------------------------------------------------
9188e4da38afSmrgdnl Since: 0.4.0
9189e4da38afSmrgdnl
9190e4da38afSmrgdnl Note that if there is a possibility the first call to
9191e4da38afSmrgdnl PKG_CHECK_MODULES might not happen, you should be sure to include an
9192e4da38afSmrgdnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
9193e4da38afSmrgAC_DEFUN([PKG_CHECK_MODULES],
9194e4da38afSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9195e4da38afSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
9196e4da38afSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
9197fc27e79cSmrg
9198e4da38afSmrgpkg_failed=no
9199e4da38afSmrgAC_MSG_CHECKING([for $1])
9200a73597f9Smrg
9201e4da38afSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
9202e4da38afSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
9203fc27e79cSmrg
9204e4da38afSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
9205e4da38afSmrgand $1[]_LIBS to avoid the need to call pkg-config.
9206e4da38afSmrgSee the pkg-config man page for more details.])
9207fc27e79cSmrg
9208e4da38afSmrgif test $pkg_failed = yes; then
9209e4da38afSmrg   	AC_MSG_RESULT([no])
9210e4da38afSmrg        _PKG_SHORT_ERRORS_SUPPORTED
9211e4da38afSmrg        if test $_pkg_short_errors_supported = yes; then
9212e4da38afSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
9213e4da38afSmrg        else 
9214e4da38afSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
9215e4da38afSmrg        fi
9216e4da38afSmrg	# Put the nasty error message in config.log where it belongs
9217e4da38afSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
9218fc27e79cSmrg
9219e4da38afSmrg	m4_default([$4], [AC_MSG_ERROR(
9220e4da38afSmrg[Package requirements ($2) were not met:
9221fc27e79cSmrg
9222e4da38afSmrg$$1_PKG_ERRORS
9223fc27e79cSmrg
9224e4da38afSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
9225e4da38afSmrginstalled software in a non-standard prefix.
9226fc27e79cSmrg
9227e4da38afSmrg_PKG_TEXT])[]dnl
9228e4da38afSmrg        ])
9229e4da38afSmrgelif test $pkg_failed = untried; then
9230e4da38afSmrg     	AC_MSG_RESULT([no])
9231e4da38afSmrg	m4_default([$4], [AC_MSG_FAILURE(
9232e4da38afSmrg[The pkg-config script could not be found or is too old.  Make sure it
9233e4da38afSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
9234e4da38afSmrgpath to pkg-config.
9235e4da38afSmrg
9236e4da38afSmrg_PKG_TEXT
9237e4da38afSmrg
9238e4da38afSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
9239e4da38afSmrg        ])
9240e4da38afSmrgelse
9241e4da38afSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
9242e4da38afSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
9243e4da38afSmrg        AC_MSG_RESULT([yes])
9244e4da38afSmrg	$3
9245e4da38afSmrgfi[]dnl
9246e4da38afSmrg])dnl PKG_CHECK_MODULES
9247fc27e79cSmrg
9248fc27e79cSmrg
9249e4da38afSmrgdnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
9250e4da38afSmrgdnl   [ACTION-IF-NOT-FOUND])
9251e4da38afSmrgdnl ---------------------------------------------------------------------
9252e4da38afSmrgdnl Since: 0.29
9253e4da38afSmrgdnl
9254e4da38afSmrgdnl Checks for existence of MODULES and gathers its build flags with
9255e4da38afSmrgdnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
9256e4da38afSmrgdnl and VARIABLE-PREFIX_LIBS from --libs.
9257e4da38afSmrgdnl
9258e4da38afSmrgdnl Note that if there is a possibility the first call to
9259e4da38afSmrgdnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
9260e4da38afSmrgdnl include an explicit call to PKG_PROG_PKG_CONFIG in your
9261e4da38afSmrgdnl configure.ac.
9262e4da38afSmrgAC_DEFUN([PKG_CHECK_MODULES_STATIC],
9263e4da38afSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9264e4da38afSmrg_save_PKG_CONFIG=$PKG_CONFIG
9265e4da38afSmrgPKG_CONFIG="$PKG_CONFIG --static"
9266e4da38afSmrgPKG_CHECK_MODULES($@)
9267e4da38afSmrgPKG_CONFIG=$_save_PKG_CONFIG[]dnl
9268e4da38afSmrg])dnl PKG_CHECK_MODULES_STATIC
9269fc27e79cSmrg
9270fc27e79cSmrg
9271e4da38afSmrgdnl PKG_INSTALLDIR([DIRECTORY])
9272e4da38afSmrgdnl -------------------------
9273e4da38afSmrgdnl Since: 0.27
9274e4da38afSmrgdnl
9275e4da38afSmrgdnl Substitutes the variable pkgconfigdir as the location where a module
9276e4da38afSmrgdnl should install pkg-config .pc files. By default the directory is
9277e4da38afSmrgdnl $libdir/pkgconfig, but the default can be changed by passing
9278e4da38afSmrgdnl DIRECTORY. The user can override through the --with-pkgconfigdir
9279e4da38afSmrgdnl parameter.
9280e4da38afSmrgAC_DEFUN([PKG_INSTALLDIR],
9281e4da38afSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
9282e4da38afSmrgm4_pushdef([pkg_description],
9283e4da38afSmrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
9284e4da38afSmrgAC_ARG_WITH([pkgconfigdir],
9285e4da38afSmrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
9286e4da38afSmrg    [with_pkgconfigdir=]pkg_default)
9287e4da38afSmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
9288e4da38afSmrgm4_popdef([pkg_default])
9289e4da38afSmrgm4_popdef([pkg_description])
9290e4da38afSmrg])dnl PKG_INSTALLDIR
9291e4da38afSmrg
9292e4da38afSmrg
9293e4da38afSmrgdnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
9294e4da38afSmrgdnl --------------------------------
9295e4da38afSmrgdnl Since: 0.27
9296e4da38afSmrgdnl
9297e4da38afSmrgdnl Substitutes the variable noarch_pkgconfigdir as the location where a
9298e4da38afSmrgdnl module should install arch-independent pkg-config .pc files. By
9299e4da38afSmrgdnl default the directory is $datadir/pkgconfig, but the default can be
9300e4da38afSmrgdnl changed by passing DIRECTORY. The user can override through the
9301e4da38afSmrgdnl --with-noarch-pkgconfigdir parameter.
9302e4da38afSmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
9303e4da38afSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
9304e4da38afSmrgm4_pushdef([pkg_description],
9305e4da38afSmrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
9306e4da38afSmrgAC_ARG_WITH([noarch-pkgconfigdir],
9307e4da38afSmrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
9308e4da38afSmrg    [with_noarch_pkgconfigdir=]pkg_default)
9309e4da38afSmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
9310e4da38afSmrgm4_popdef([pkg_default])
9311e4da38afSmrgm4_popdef([pkg_description])
9312e4da38afSmrg])dnl PKG_NOARCH_INSTALLDIR
9313e4da38afSmrg
9314e4da38afSmrg
9315e4da38afSmrgdnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
9316e4da38afSmrgdnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
9317e4da38afSmrgdnl -------------------------------------------
9318e4da38afSmrgdnl Since: 0.28
9319e4da38afSmrgdnl
9320e4da38afSmrgdnl Retrieves the value of the pkg-config variable for the given module.
9321e4da38afSmrgAC_DEFUN([PKG_CHECK_VAR],
9322e4da38afSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9323e4da38afSmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
9324fc27e79cSmrg
9325e4da38afSmrg_PKG_CONFIG([$1], [variable="][$3]["], [$2])
9326e4da38afSmrgAS_VAR_COPY([$1], [pkg_cv_][$1])
9327b73be646Smrg
9328e4da38afSmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl
9329e4da38afSmrg])dnl PKG_CHECK_VAR
9330b73be646Smrg
9331e4da38afSmrg# Copyright (C) 2002-2014 Free Software Foundation, Inc.
9332e4da38afSmrg#
9333e4da38afSmrg# This file is free software; the Free Software Foundation
9334e4da38afSmrg# gives unlimited permission to copy and/or distribute it,
9335e4da38afSmrg# with or without modifications, as long as this notice is preserved.
9336b73be646Smrg
9337e4da38afSmrg# AM_AUTOMAKE_VERSION(VERSION)
9338e4da38afSmrg# ----------------------------
9339e4da38afSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
9340e4da38afSmrg# generated from the m4 files accompanying Automake X.Y.
9341e4da38afSmrg# (This private macro should not be called outside this file.)
9342e4da38afSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
9343e4da38afSmrg[am__api_version='1.15'
9344e4da38afSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
9345e4da38afSmrgdnl require some minimum version.  Point them to the right macro.
9346e4da38afSmrgm4_if([$1], [1.15], [],
9347e4da38afSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
9348e4da38afSmrg])
9349b73be646Smrg
9350e4da38afSmrg# _AM_AUTOCONF_VERSION(VERSION)
9351e4da38afSmrg# -----------------------------
9352e4da38afSmrg# aclocal traces this macro to find the Autoconf version.
9353e4da38afSmrg# This is a private macro too.  Using m4_define simplifies
9354e4da38afSmrg# the logic in aclocal, which can simply ignore this definition.
9355e4da38afSmrgm4_define([_AM_AUTOCONF_VERSION], [])
9356b73be646Smrg
9357e4da38afSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
9358e4da38afSmrg# -------------------------------
9359e4da38afSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
9360e4da38afSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
9361e4da38afSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
9362e4da38afSmrg[AM_AUTOMAKE_VERSION([1.15])dnl
9363e4da38afSmrgm4_ifndef([AC_AUTOCONF_VERSION],
9364e4da38afSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
9365e4da38afSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
9366bd3a1963Smrg
9367e4da38afSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
9368fc27e79cSmrg
9369e4da38afSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
9370e4da38afSmrg#
9371e4da38afSmrg# This file is free software; the Free Software Foundation
9372e4da38afSmrg# gives unlimited permission to copy and/or distribute it,
9373e4da38afSmrg# with or without modifications, as long as this notice is preserved.
9374fc27e79cSmrg
9375e4da38afSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
9376e4da38afSmrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
9377e4da38afSmrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
9378e4da38afSmrg#
9379e4da38afSmrg# Of course, Automake must honor this variable whenever it calls a
9380e4da38afSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
9381e4da38afSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
9382e4da38afSmrg# depending on how configure is run.  This is pretty annoying, since
9383e4da38afSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
9384e4da38afSmrg# source directory, any form will work fine, but in subdirectories a
9385e4da38afSmrg# relative path needs to be adjusted first.
9386e4da38afSmrg#
9387e4da38afSmrg# $ac_aux_dir/missing
9388e4da38afSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
9389e4da38afSmrg# $top_srcdir/$ac_aux_dir/missing
9390e4da38afSmrg#    fails if $ac_aux_dir is absolute,
9391e4da38afSmrg#    fails when called from a subdirectory in a VPATH build with
9392e4da38afSmrg#          a relative $ac_aux_dir
9393e4da38afSmrg#
9394e4da38afSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
9395e4da38afSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
9396e4da38afSmrg# harmless because $srcdir is '.', but things will broke when you
9397e4da38afSmrg# start a VPATH build or use an absolute $srcdir.
9398e4da38afSmrg#
9399e4da38afSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
9400e4da38afSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
9401e4da38afSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
9402e4da38afSmrg# and then we would define $MISSING as
9403e4da38afSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
9404e4da38afSmrg# This will work as long as MISSING is not called from configure, because
9405e4da38afSmrg# unfortunately $(top_srcdir) has no meaning in configure.
9406e4da38afSmrg# However there are other variables, like CC, which are often used in
9407e4da38afSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
9408e4da38afSmrg#
9409e4da38afSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
9410e4da38afSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
9411e4da38afSmrg# configured tree to be moved without reconfiguration.
9412fc27e79cSmrg
9413e4da38afSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
9414e4da38afSmrg[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
9415e4da38afSmrg# Expand $ac_aux_dir to an absolute path.
9416e4da38afSmrgam_aux_dir=`cd "$ac_aux_dir" && pwd`
941784bf8334Smrg])
9418fc27e79cSmrg
9419e4da38afSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
9420fc27e79cSmrg
9421e4da38afSmrg# Copyright (C) 1997-2014 Free Software Foundation, Inc.
9422e4da38afSmrg#
9423e4da38afSmrg# This file is free software; the Free Software Foundation
9424e4da38afSmrg# gives unlimited permission to copy and/or distribute it,
9425e4da38afSmrg# with or without modifications, as long as this notice is preserved.
9426fc27e79cSmrg
9427e4da38afSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
9428e4da38afSmrg# -------------------------------------
9429e4da38afSmrg# Define a conditional.
9430e4da38afSmrgAC_DEFUN([AM_CONDITIONAL],
9431e4da38afSmrg[AC_PREREQ([2.52])dnl
9432e4da38afSmrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
9433e4da38afSmrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
9434e4da38afSmrgAC_SUBST([$1_TRUE])dnl
9435e4da38afSmrgAC_SUBST([$1_FALSE])dnl
9436e4da38afSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
9437e4da38afSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
9438e4da38afSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
9439e4da38afSmrgif $2; then
9440e4da38afSmrg  $1_TRUE=
9441e4da38afSmrg  $1_FALSE='#'
9442e4da38afSmrgelse
9443e4da38afSmrg  $1_TRUE='#'
9444e4da38afSmrg  $1_FALSE=
9445e4da38afSmrgfi
9446e4da38afSmrgAC_CONFIG_COMMANDS_PRE(
9447e4da38afSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
9448e4da38afSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
9449e4da38afSmrgUsually this means the macro was only invoked conditionally.]])
9450e4da38afSmrgfi])])
9451fc27e79cSmrg
9452e4da38afSmrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
9453e4da38afSmrg#
9454e4da38afSmrg# This file is free software; the Free Software Foundation
9455e4da38afSmrg# gives unlimited permission to copy and/or distribute it,
9456e4da38afSmrg# with or without modifications, as long as this notice is preserved.
945784bf8334Smrg
945884bf8334Smrg
9459e4da38afSmrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
9460e4da38afSmrg# written in clear, in which case automake, when reading aclocal.m4,
9461e4da38afSmrg# will think it sees a *use*, and therefore will trigger all it's
9462e4da38afSmrg# C support machinery.  Also note that it means that autoscan, seeing
9463e4da38afSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
946484bf8334Smrg
9465fc27e79cSmrg
9466e4da38afSmrg# _AM_DEPENDENCIES(NAME)
9467e4da38afSmrg# ----------------------
9468e4da38afSmrg# See how the compiler implements dependency checking.
9469e4da38afSmrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
9470e4da38afSmrg# We try a few techniques and use that to set a single cache variable.
9471e4da38afSmrg#
9472e4da38afSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
9473e4da38afSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
9474e4da38afSmrg# dependency, and given that the user is not expected to run this macro,
9475e4da38afSmrg# just rely on AC_PROG_CC.
9476e4da38afSmrgAC_DEFUN([_AM_DEPENDENCIES],
9477e4da38afSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
9478e4da38afSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
9479e4da38afSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
9480e4da38afSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
9481b73be646Smrg
9482e4da38afSmrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
9483e4da38afSmrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
9484e4da38afSmrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
9485e4da38afSmrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
9486e4da38afSmrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
9487e4da38afSmrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
9488e4da38afSmrg                    [depcc="$$1"   am_compiler_list=])
9489b73be646Smrg
9490e4da38afSmrgAC_CACHE_CHECK([dependency style of $depcc],
9491e4da38afSmrg               [am_cv_$1_dependencies_compiler_type],
9492e4da38afSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
9493e4da38afSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
9494e4da38afSmrg  # making bogus files that we don't know about and never remove.  For
9495e4da38afSmrg  # instance it was reported that on HP-UX the gcc test will end up
9496e4da38afSmrg  # making a dummy file named 'D' -- because '-MD' means "put the output
9497e4da38afSmrg  # in D".
9498e4da38afSmrg  rm -rf conftest.dir
9499e4da38afSmrg  mkdir conftest.dir
9500e4da38afSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
9501e4da38afSmrg  # using a relative directory.
9502e4da38afSmrg  cp "$am_depcomp" conftest.dir
9503e4da38afSmrg  cd conftest.dir
9504e4da38afSmrg  # We will build objects and dependencies in a subdirectory because
9505e4da38afSmrg  # it helps to detect inapplicable dependency modes.  For instance
9506e4da38afSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
9507e4da38afSmrg  # side effect of compilation, but ICC will put the dependencies in
9508e4da38afSmrg  # the current directory while Tru64 will put them in the object
9509e4da38afSmrg  # directory.
9510e4da38afSmrg  mkdir sub
9511e4da38afSmrg
9512e4da38afSmrg  am_cv_$1_dependencies_compiler_type=none
9513e4da38afSmrg  if test "$am_compiler_list" = ""; then
9514e4da38afSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
9515e4da38afSmrg  fi
9516e4da38afSmrg  am__universal=false
9517e4da38afSmrg  m4_case([$1], [CC],
9518e4da38afSmrg    [case " $depcc " in #(
9519e4da38afSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
9520e4da38afSmrg     esac],
9521e4da38afSmrg    [CXX],
9522e4da38afSmrg    [case " $depcc " in #(
9523e4da38afSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
9524e4da38afSmrg     esac])
9525fc27e79cSmrg
9526e4da38afSmrg  for depmode in $am_compiler_list; do
9527e4da38afSmrg    # Setup a source with many dependencies, because some compilers
9528e4da38afSmrg    # like to wrap large dependency lists on column 80 (with \), and
9529e4da38afSmrg    # we should not choose a depcomp mode which is confused by this.
9530e4da38afSmrg    #
9531e4da38afSmrg    # We need to recreate these files for each test, as the compiler may
9532e4da38afSmrg    # overwrite some of them when testing with obscure command lines.
9533e4da38afSmrg    # This happens at least with the AIX C compiler.
9534e4da38afSmrg    : > sub/conftest.c
9535e4da38afSmrg    for i in 1 2 3 4 5 6; do
9536e4da38afSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
9537e4da38afSmrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
9538e4da38afSmrg      # Solaris 10 /bin/sh.
9539e4da38afSmrg      echo '/* dummy */' > sub/conftst$i.h
9540e4da38afSmrg    done
9541e4da38afSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
9542fc27e79cSmrg
9543e4da38afSmrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
9544e4da38afSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
9545e4da38afSmrg    # handle '-M -o', and we need to detect this.  Also, some Intel
9546e4da38afSmrg    # versions had trouble with output in subdirs.
9547e4da38afSmrg    am__obj=sub/conftest.${OBJEXT-o}
9548e4da38afSmrg    am__minus_obj="-o $am__obj"
9549e4da38afSmrg    case $depmode in
9550e4da38afSmrg    gcc)
9551e4da38afSmrg      # This depmode causes a compiler race in universal mode.
9552e4da38afSmrg      test "$am__universal" = false || continue
955384bf8334Smrg      ;;
9554e4da38afSmrg    nosideeffect)
9555e4da38afSmrg      # After this tag, mechanisms are not by side-effect, so they'll
9556e4da38afSmrg      # only be used when explicitly requested.
9557e4da38afSmrg      if test "x$enable_dependency_tracking" = xyes; then
9558e4da38afSmrg	continue
9559e4da38afSmrg      else
9560e4da38afSmrg	break
9561e4da38afSmrg      fi
9562e4da38afSmrg      ;;
9563e4da38afSmrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
9564e4da38afSmrg      # This compiler won't grok '-c -o', but also, the minuso test has
9565e4da38afSmrg      # not run yet.  These depmodes are late enough in the game, and
9566e4da38afSmrg      # so weak that their functioning should not be impacted.
9567e4da38afSmrg      am__obj=conftest.${OBJEXT-o}
9568e4da38afSmrg      am__minus_obj=
9569e4da38afSmrg      ;;
9570e4da38afSmrg    none) break ;;
9571e4da38afSmrg    esac
9572e4da38afSmrg    if depmode=$depmode \
9573e4da38afSmrg       source=sub/conftest.c object=$am__obj \
9574e4da38afSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
9575e4da38afSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
9576e4da38afSmrg         >/dev/null 2>conftest.err &&
9577e4da38afSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
9578e4da38afSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
9579e4da38afSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
9580e4da38afSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
9581e4da38afSmrg      # icc doesn't choke on unknown options, it will just issue warnings
9582e4da38afSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
9583e4da38afSmrg      # that says an option was ignored or not supported.
9584e4da38afSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
9585e4da38afSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
9586e4da38afSmrg      # The diagnosis changed in icc 8.0:
9587e4da38afSmrg      #   icc: Command line remark: option '-MP' not supported
9588e4da38afSmrg      if (grep 'ignoring option' conftest.err ||
9589e4da38afSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
9590e4da38afSmrg        am_cv_$1_dependencies_compiler_type=$depmode
9591e4da38afSmrg        break
9592e4da38afSmrg      fi
9593e4da38afSmrg    fi
9594e4da38afSmrg  done
9595fc27e79cSmrg
9596e4da38afSmrg  cd ..
9597e4da38afSmrg  rm -rf conftest.dir
9598e4da38afSmrgelse
9599e4da38afSmrg  am_cv_$1_dependencies_compiler_type=none
9600e4da38afSmrgfi
960184bf8334Smrg])
9602e4da38afSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
9603e4da38afSmrgAM_CONDITIONAL([am__fastdep$1], [
9604e4da38afSmrg  test "x$enable_dependency_tracking" != xno \
9605e4da38afSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
960684bf8334Smrg])
960784bf8334Smrg
960884bf8334Smrg
9609e4da38afSmrg# AM_SET_DEPDIR
9610e4da38afSmrg# -------------
9611e4da38afSmrg# Choose a directory name for dependency files.
9612e4da38afSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
9613e4da38afSmrgAC_DEFUN([AM_SET_DEPDIR],
9614e4da38afSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
9615e4da38afSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
9616e4da38afSmrg])
961784bf8334Smrg
961884bf8334Smrg
9619e4da38afSmrg# AM_DEP_TRACK
9620e4da38afSmrg# ------------
9621e4da38afSmrgAC_DEFUN([AM_DEP_TRACK],
9622e4da38afSmrg[AC_ARG_ENABLE([dependency-tracking], [dnl
9623e4da38afSmrgAS_HELP_STRING(
9624e4da38afSmrg  [--enable-dependency-tracking],
9625e4da38afSmrg  [do not reject slow dependency extractors])
9626e4da38afSmrgAS_HELP_STRING(
9627e4da38afSmrg  [--disable-dependency-tracking],
9628e4da38afSmrg  [speeds up one-time build])])
9629e4da38afSmrgif test "x$enable_dependency_tracking" != xno; then
9630e4da38afSmrg  am_depcomp="$ac_aux_dir/depcomp"
9631e4da38afSmrg  AMDEPBACKSLASH='\'
9632e4da38afSmrg  am__nodep='_no'
9633e4da38afSmrgfi
9634e4da38afSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
9635e4da38afSmrgAC_SUBST([AMDEPBACKSLASH])dnl
9636e4da38afSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
9637e4da38afSmrgAC_SUBST([am__nodep])dnl
9638e4da38afSmrg_AM_SUBST_NOTMAKE([am__nodep])dnl
9639e4da38afSmrg])
964084bf8334Smrg
9641e4da38afSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
9642fc27e79cSmrg
9643e4da38afSmrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
9644e4da38afSmrg#
9645e4da38afSmrg# This file is free software; the Free Software Foundation
9646e4da38afSmrg# gives unlimited permission to copy and/or distribute it,
9647e4da38afSmrg# with or without modifications, as long as this notice is preserved.
9648fc27e79cSmrg
9649fc27e79cSmrg
9650e4da38afSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
9651e4da38afSmrg# ------------------------------
9652e4da38afSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
9653e4da38afSmrg[{
9654e4da38afSmrg  # Older Autoconf quotes --file arguments for eval, but not when files
9655e4da38afSmrg  # are listed without --file.  Let's play safe and only enable the eval
9656e4da38afSmrg  # if we detect the quoting.
9657e4da38afSmrg  case $CONFIG_FILES in
9658e4da38afSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
9659e4da38afSmrg  *)   set x $CONFIG_FILES ;;
9660e4da38afSmrg  esac
9661e4da38afSmrg  shift
9662e4da38afSmrg  for mf
9663e4da38afSmrg  do
9664e4da38afSmrg    # Strip MF so we end up with the name of the file.
9665e4da38afSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
9666e4da38afSmrg    # Check whether this is an Automake generated Makefile or not.
9667e4da38afSmrg    # We used to match only the files named 'Makefile.in', but
9668e4da38afSmrg    # some people rename them; so instead we look at the file content.
9669e4da38afSmrg    # Grep'ing the first line is not enough: some people post-process
9670e4da38afSmrg    # each Makefile.in and add a new line on top of each file to say so.
9671e4da38afSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
9672e4da38afSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
9673e4da38afSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
9674e4da38afSmrg      dirpart=`AS_DIRNAME("$mf")`
9675e4da38afSmrg    else
9676e4da38afSmrg      continue
9677e4da38afSmrg    fi
9678e4da38afSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
9679e4da38afSmrg    # from the Makefile without running 'make'.
9680e4da38afSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
9681e4da38afSmrg    test -z "$DEPDIR" && continue
9682e4da38afSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
9683e4da38afSmrg    test -z "$am__include" && continue
9684e4da38afSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
9685e4da38afSmrg    # Find all dependency output files, they are included files with
9686e4da38afSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
9687e4da38afSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
9688e4da38afSmrg    # expansion.
9689e4da38afSmrg    for file in `sed -n "
9690e4da38afSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
9691e4da38afSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
9692e4da38afSmrg      # Make sure the directory exists.
9693e4da38afSmrg      test -f "$dirpart/$file" && continue
9694e4da38afSmrg      fdir=`AS_DIRNAME(["$file"])`
9695e4da38afSmrg      AS_MKDIR_P([$dirpart/$fdir])
9696e4da38afSmrg      # echo "creating $dirpart/$file"
9697e4da38afSmrg      echo '# dummy' > "$dirpart/$file"
9698e4da38afSmrg    done
9699e4da38afSmrg  done
9700e4da38afSmrg}
9701e4da38afSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
9702fc27e79cSmrg
9703e4da38afSmrg
9704e4da38afSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
9705e4da38afSmrg# -----------------------------
9706e4da38afSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
9707e4da38afSmrg#
9708e4da38afSmrg# This code is only required when automatic dependency tracking
9709e4da38afSmrg# is enabled.  FIXME.  This creates each '.P' file that we will
9710e4da38afSmrg# need in order to bootstrap the dependency handling code.
9711e4da38afSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
9712e4da38afSmrg[AC_CONFIG_COMMANDS([depfiles],
9713e4da38afSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
9714e4da38afSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
971584bf8334Smrg])
9716fc27e79cSmrg
9717e4da38afSmrg# Do all the work for Automake.                             -*- Autoconf -*-
9718fc27e79cSmrg
9719e4da38afSmrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
9720e4da38afSmrg#
9721e4da38afSmrg# This file is free software; the Free Software Foundation
9722e4da38afSmrg# gives unlimited permission to copy and/or distribute it,
9723e4da38afSmrg# with or without modifications, as long as this notice is preserved.
972484bf8334Smrg
9725e4da38afSmrg# This macro actually does too much.  Some checks are only needed if
9726e4da38afSmrg# your package does certain things.  But this isn't really a big deal.
972784bf8334Smrg
9728e4da38afSmrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
9729e4da38afSmrgm4_define([AC_PROG_CC],
9730e4da38afSmrgm4_defn([AC_PROG_CC])
9731e4da38afSmrg[_AM_PROG_CC_C_O
9732e4da38afSmrg])
973384bf8334Smrg
9734e4da38afSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
9735e4da38afSmrg# AM_INIT_AUTOMAKE([OPTIONS])
9736e4da38afSmrg# -----------------------------------------------
9737e4da38afSmrg# The call with PACKAGE and VERSION arguments is the old style
9738e4da38afSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
9739e4da38afSmrg# and VERSION should now be passed to AC_INIT and removed from
9740e4da38afSmrg# the call to AM_INIT_AUTOMAKE.
9741e4da38afSmrg# We support both call styles for the transition.  After
9742e4da38afSmrg# the next Automake release, Autoconf can make the AC_INIT
9743e4da38afSmrg# arguments mandatory, and then we can depend on a new Autoconf
9744e4da38afSmrg# release and drop the old call support.
9745e4da38afSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
9746e4da38afSmrg[AC_PREREQ([2.65])dnl
9747e4da38afSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
9748e4da38afSmrgdnl the ones we care about.
9749e4da38afSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
9750e4da38afSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
9751e4da38afSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
9752e4da38afSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
9753e4da38afSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
9754e4da38afSmrg  # is not polluted with repeated "-I."
9755e4da38afSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
9756e4da38afSmrg  # test to see if srcdir already configured
9757e4da38afSmrg  if test -f $srcdir/config.status; then
9758e4da38afSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
9759e4da38afSmrg  fi
9760e4da38afSmrgfi
976184bf8334Smrg
9762e4da38afSmrg# test whether we have cygpath
9763e4da38afSmrgif test -z "$CYGPATH_W"; then
9764e4da38afSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
9765e4da38afSmrg    CYGPATH_W='cygpath -w'
9766e4da38afSmrg  else
9767e4da38afSmrg    CYGPATH_W=echo
9768e4da38afSmrg  fi
9769e4da38afSmrgfi
9770e4da38afSmrgAC_SUBST([CYGPATH_W])
977184bf8334Smrg
9772e4da38afSmrg# Define the identity of the package.
9773e4da38afSmrgdnl Distinguish between old-style and new-style calls.
9774e4da38afSmrgm4_ifval([$2],
9775e4da38afSmrg[AC_DIAGNOSE([obsolete],
9776e4da38afSmrg             [$0: two- and three-arguments forms are deprecated.])
9777e4da38afSmrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
9778e4da38afSmrg AC_SUBST([PACKAGE], [$1])dnl
9779e4da38afSmrg AC_SUBST([VERSION], [$2])],
9780e4da38afSmrg[_AM_SET_OPTIONS([$1])dnl
9781e4da38afSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
9782e4da38afSmrgm4_if(
9783e4da38afSmrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
9784e4da38afSmrg  [ok:ok],,
9785e4da38afSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
9786e4da38afSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
9787e4da38afSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
978884bf8334Smrg
9789e4da38afSmrg_AM_IF_OPTION([no-define],,
9790e4da38afSmrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
9791e4da38afSmrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
979284bf8334Smrg
9793e4da38afSmrg# Some tools Automake needs.
9794e4da38afSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
9795e4da38afSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
9796e4da38afSmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
9797e4da38afSmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
9798e4da38afSmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
9799e4da38afSmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
9800e4da38afSmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
9801e4da38afSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
9802e4da38afSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
9803e4da38afSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
9804e4da38afSmrg# For better backward compatibility.  To be removed once Automake 1.9.x
9805e4da38afSmrg# dies out for good.  For more background, see:
9806e4da38afSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
9807e4da38afSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
9808e4da38afSmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
9809e4da38afSmrg# We need awk for the "check" target (and possibly the TAP driver).  The
9810e4da38afSmrg# system "awk" is bad on some platforms.
9811e4da38afSmrgAC_REQUIRE([AC_PROG_AWK])dnl
9812e4da38afSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
9813e4da38afSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
9814e4da38afSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
9815e4da38afSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
9816e4da38afSmrg			     [_AM_PROG_TAR([v7])])])
9817e4da38afSmrg_AM_IF_OPTION([no-dependencies],,
9818e4da38afSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
9819e4da38afSmrg		  [_AM_DEPENDENCIES([CC])],
9820e4da38afSmrg		  [m4_define([AC_PROG_CC],
9821e4da38afSmrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
9822e4da38afSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
9823e4da38afSmrg		  [_AM_DEPENDENCIES([CXX])],
9824e4da38afSmrg		  [m4_define([AC_PROG_CXX],
9825e4da38afSmrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
9826e4da38afSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
9827e4da38afSmrg		  [_AM_DEPENDENCIES([OBJC])],
9828e4da38afSmrg		  [m4_define([AC_PROG_OBJC],
9829e4da38afSmrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
9830e4da38afSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
9831e4da38afSmrg		  [_AM_DEPENDENCIES([OBJCXX])],
9832e4da38afSmrg		  [m4_define([AC_PROG_OBJCXX],
9833e4da38afSmrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
983484bf8334Smrg])
9835e4da38afSmrgAC_REQUIRE([AM_SILENT_RULES])dnl
9836e4da38afSmrgdnl The testsuite driver may need to know about EXEEXT, so add the
9837e4da38afSmrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
9838e4da38afSmrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
9839e4da38afSmrgAC_CONFIG_COMMANDS_PRE(dnl
9840e4da38afSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
9841e4da38afSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
9842fc27e79cSmrg
9843e4da38afSmrg# POSIX will say in a future version that running "rm -f" with no argument
9844e4da38afSmrg# is OK; and we want to be able to make that assumption in our Makefile
9845e4da38afSmrg# recipes.  So use an aggressive probe to check that the usage we want is
9846e4da38afSmrg# actually supported "in the wild" to an acceptable degree.
9847e4da38afSmrg# See automake bug#10828.
9848e4da38afSmrg# To make any issue more visible, cause the running configure to be aborted
9849e4da38afSmrg# by default if the 'rm' program in use doesn't match our expectations; the
9850e4da38afSmrg# user can still override this though.
9851e4da38afSmrgif rm -f && rm -fr && rm -rf; then : OK; else
9852e4da38afSmrg  cat >&2 <<'END'
9853e4da38afSmrgOops!
9854fc27e79cSmrg
9855e4da38afSmrgYour 'rm' program seems unable to run without file operands specified
9856e4da38afSmrgon the command line, even when the '-f' option is present.  This is contrary
9857e4da38afSmrgto the behaviour of most rm programs out there, and not conforming with
9858e4da38afSmrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
9859fc27e79cSmrg
9860e4da38afSmrgPlease tell bug-automake@gnu.org about your system, including the value
9861e4da38afSmrgof your $PATH and any error possibly output before this message.  This
9862e4da38afSmrgcan help us improve future automake versions.
9863fc27e79cSmrg
9864e4da38afSmrgEND
9865e4da38afSmrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
9866e4da38afSmrg    echo 'Configuration will proceed anyway, since you have set the' >&2
9867e4da38afSmrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
9868e4da38afSmrg    echo >&2
9869e4da38afSmrg  else
9870e4da38afSmrg    cat >&2 <<'END'
9871e4da38afSmrgAborting the configuration process, to ensure you take notice of the issue.
9872fc27e79cSmrg
9873e4da38afSmrgYou can download and install GNU coreutils to get an 'rm' implementation
9874e4da38afSmrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
9875fc27e79cSmrg
9876e4da38afSmrgIf you want to complete the configuration process using your problematic
9877e4da38afSmrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
9878e4da38afSmrgto "yes", and re-run configure.
9879a73597f9Smrg
9880e4da38afSmrgEND
9881e4da38afSmrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
9882e4da38afSmrg  fi
9883e4da38afSmrgfi
9884e4da38afSmrgdnl The trailing newline in this macro's definition is deliberate, for
9885e4da38afSmrgdnl backward compatibility and to allow trailing 'dnl'-style comments
9886e4da38afSmrgdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
988784bf8334Smrg])
9888fc27e79cSmrg
9889e4da38afSmrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
9890e4da38afSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
9891e4da38afSmrgdnl mangled by Autoconf and run in a shell conditional statement.
9892e4da38afSmrgm4_define([_AC_COMPILER_EXEEXT],
9893e4da38afSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
9894fc27e79cSmrg
9895e4da38afSmrg# When config.status generates a header, we must update the stamp-h file.
9896e4da38afSmrg# This file resides in the same directory as the config header
9897e4da38afSmrg# that is generated.  The stamp files are numbered to have different names.
989884bf8334Smrg
9899e4da38afSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
9900e4da38afSmrg# loop where config.status creates the headers, so we can generate
9901e4da38afSmrg# our stamp files there.
9902e4da38afSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
9903e4da38afSmrg[# Compute $1's index in $config_headers.
9904e4da38afSmrg_am_arg=$1
9905e4da38afSmrg_am_stamp_count=1
9906e4da38afSmrgfor _am_header in $config_headers :; do
9907e4da38afSmrg  case $_am_header in
9908e4da38afSmrg    $_am_arg | $_am_arg:* )
9909e4da38afSmrg      break ;;
9910e4da38afSmrg    * )
9911e4da38afSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
9912e4da38afSmrg  esac
9913e4da38afSmrgdone
9914e4da38afSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
9915fc27e79cSmrg
9916e4da38afSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
9917a73597f9Smrg#
9918e4da38afSmrg# This file is free software; the Free Software Foundation
9919e4da38afSmrg# gives unlimited permission to copy and/or distribute it,
9920e4da38afSmrg# with or without modifications, as long as this notice is preserved.
99216aab59a7Smrg
9922e4da38afSmrg# AM_PROG_INSTALL_SH
9923e4da38afSmrg# ------------------
9924e4da38afSmrg# Define $install_sh.
9925e4da38afSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
9926e4da38afSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
9927e4da38afSmrgif test x"${install_sh+set}" != xset; then
9928e4da38afSmrg  case $am_aux_dir in
9929e4da38afSmrg  *\ * | *\	*)
9930e4da38afSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
9931e4da38afSmrg  *)
9932e4da38afSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
9933e4da38afSmrg  esac
9934e4da38afSmrgfi
9935e4da38afSmrgAC_SUBST([install_sh])])
9936fc27e79cSmrg
9937e4da38afSmrg# Copyright (C) 2003-2014 Free Software Foundation, Inc.
9938e4da38afSmrg#
9939e4da38afSmrg# This file is free software; the Free Software Foundation
9940e4da38afSmrg# gives unlimited permission to copy and/or distribute it,
9941e4da38afSmrg# with or without modifications, as long as this notice is preserved.
994284bf8334Smrg
9943e4da38afSmrg# Check whether the underlying file-system supports filenames
9944e4da38afSmrg# with a leading dot.  For instance MS-DOS doesn't.
9945e4da38afSmrgAC_DEFUN([AM_SET_LEADING_DOT],
9946e4da38afSmrg[rm -rf .tst 2>/dev/null
9947e4da38afSmrgmkdir .tst 2>/dev/null
9948e4da38afSmrgif test -d .tst; then
9949e4da38afSmrg  am__leading_dot=.
9950e4da38afSmrgelse
9951e4da38afSmrg  am__leading_dot=_
9952e4da38afSmrgfi
9953e4da38afSmrgrmdir .tst 2>/dev/null
9954e4da38afSmrgAC_SUBST([am__leading_dot])])
995584bf8334Smrg
9956e4da38afSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
995784bf8334Smrg
9958e4da38afSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
9959e4da38afSmrg#
9960e4da38afSmrg# This file is free software; the Free Software Foundation
9961e4da38afSmrg# gives unlimited permission to copy and/or distribute it,
9962e4da38afSmrg# with or without modifications, as long as this notice is preserved.
996384bf8334Smrg
9964e4da38afSmrg# AM_MAKE_INCLUDE()
9965e4da38afSmrg# -----------------
9966e4da38afSmrg# Check to see how make treats includes.
9967e4da38afSmrgAC_DEFUN([AM_MAKE_INCLUDE],
9968e4da38afSmrg[am_make=${MAKE-make}
9969e4da38afSmrgcat > confinc << 'END'
9970e4da38afSmrgam__doit:
9971e4da38afSmrg	@echo this is the am__doit target
9972e4da38afSmrg.PHONY: am__doit
9973e4da38afSmrgEND
9974e4da38afSmrg# If we don't find an include directive, just comment out the code.
9975e4da38afSmrgAC_MSG_CHECKING([for style of include used by $am_make])
9976e4da38afSmrgam__include="#"
9977e4da38afSmrgam__quote=
9978e4da38afSmrg_am_result=none
9979e4da38afSmrg# First try GNU make style include.
9980e4da38afSmrgecho "include confinc" > confmf
9981e4da38afSmrg# Ignore all kinds of additional output from 'make'.
9982e4da38afSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
9983e4da38afSmrg*the\ am__doit\ target*)
9984e4da38afSmrg  am__include=include
9985e4da38afSmrg  am__quote=
9986e4da38afSmrg  _am_result=GNU
9987e4da38afSmrg  ;;
9988e4da38afSmrgesac
9989e4da38afSmrg# Now try BSD make style include.
9990e4da38afSmrgif test "$am__include" = "#"; then
9991e4da38afSmrg   echo '.include "confinc"' > confmf
9992e4da38afSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
9993e4da38afSmrg   *the\ am__doit\ target*)
9994e4da38afSmrg     am__include=.include
9995e4da38afSmrg     am__quote="\""
9996e4da38afSmrg     _am_result=BSD
9997e4da38afSmrg     ;;
9998e4da38afSmrg   esac
9999e4da38afSmrgfi
10000e4da38afSmrgAC_SUBST([am__include])
10001e4da38afSmrgAC_SUBST([am__quote])
10002e4da38afSmrgAC_MSG_RESULT([$_am_result])
10003e4da38afSmrgrm -f confinc confmf
10004e4da38afSmrg])
1000584bf8334Smrg
10006e4da38afSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
1000784bf8334Smrg
10008e4da38afSmrg# Copyright (C) 1997-2014 Free Software Foundation, Inc.
10009a73597f9Smrg#
10010e4da38afSmrg# This file is free software; the Free Software Foundation
10011e4da38afSmrg# gives unlimited permission to copy and/or distribute it,
10012e4da38afSmrg# with or without modifications, as long as this notice is preserved.
10013659607e0Smrg
10014e4da38afSmrg# AM_MISSING_PROG(NAME, PROGRAM)
10015e4da38afSmrg# ------------------------------
10016e4da38afSmrgAC_DEFUN([AM_MISSING_PROG],
10017e4da38afSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
10018e4da38afSmrg$1=${$1-"${am_missing_run}$2"}
10019e4da38afSmrgAC_SUBST($1)])
10020659607e0Smrg
10021e4da38afSmrg# AM_MISSING_HAS_RUN
10022e4da38afSmrg# ------------------
10023e4da38afSmrg# Define MISSING if not defined so far and test if it is modern enough.
10024e4da38afSmrg# If it is, set am_missing_run to use it, otherwise, to nothing.
10025e4da38afSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
10026e4da38afSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
10027e4da38afSmrgAC_REQUIRE_AUX_FILE([missing])dnl
10028e4da38afSmrgif test x"${MISSING+set}" != xset; then
10029e4da38afSmrg  case $am_aux_dir in
10030e4da38afSmrg  *\ * | *\	*)
10031e4da38afSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
10032e4da38afSmrg  *)
10033e4da38afSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
10034e4da38afSmrg  esac
10035e4da38afSmrgfi
10036e4da38afSmrg# Use eval to expand $SHELL
10037e4da38afSmrgif eval "$MISSING --is-lightweight"; then
10038e4da38afSmrg  am_missing_run="$MISSING "
10039e4da38afSmrgelse
10040e4da38afSmrg  am_missing_run=
10041e4da38afSmrg  AC_MSG_WARN(['missing' script is too old or missing])
10042e4da38afSmrgfi
10043e4da38afSmrg])
1004484bf8334Smrg
10045e4da38afSmrg# Helper functions for option handling.                     -*- Autoconf -*-
1004684bf8334Smrg
10047e4da38afSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
10048e4da38afSmrg#
10049e4da38afSmrg# This file is free software; the Free Software Foundation
10050e4da38afSmrg# gives unlimited permission to copy and/or distribute it,
10051e4da38afSmrg# with or without modifications, as long as this notice is preserved.
1005284bf8334Smrg
10053e4da38afSmrg# _AM_MANGLE_OPTION(NAME)
10054e4da38afSmrg# -----------------------
10055e4da38afSmrgAC_DEFUN([_AM_MANGLE_OPTION],
10056e4da38afSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1005784bf8334Smrg
10058e4da38afSmrg# _AM_SET_OPTION(NAME)
10059e4da38afSmrg# --------------------
10060e4da38afSmrg# Set option NAME.  Presently that only means defining a flag for this option.
10061e4da38afSmrgAC_DEFUN([_AM_SET_OPTION],
10062e4da38afSmrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
1006384bf8334Smrg
10064e4da38afSmrg# _AM_SET_OPTIONS(OPTIONS)
10065e4da38afSmrg# ------------------------
10066e4da38afSmrg# OPTIONS is a space-separated list of Automake options.
10067e4da38afSmrgAC_DEFUN([_AM_SET_OPTIONS],
10068e4da38afSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1006984bf8334Smrg
10070e4da38afSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
10071e4da38afSmrg# -------------------------------------------
10072e4da38afSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
10073e4da38afSmrgAC_DEFUN([_AM_IF_OPTION],
10074e4da38afSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1007584bf8334Smrg
10076e4da38afSmrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
10077e4da38afSmrg#
10078e4da38afSmrg# This file is free software; the Free Software Foundation
10079e4da38afSmrg# gives unlimited permission to copy and/or distribute it,
10080e4da38afSmrg# with or without modifications, as long as this notice is preserved.
1008184bf8334Smrg
10082e4da38afSmrg# _AM_PROG_CC_C_O
10083e4da38afSmrg# ---------------
10084e4da38afSmrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
10085e4da38afSmrg# to automatically call this.
10086e4da38afSmrgAC_DEFUN([_AM_PROG_CC_C_O],
10087e4da38afSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
10088e4da38afSmrgAC_REQUIRE_AUX_FILE([compile])dnl
10089e4da38afSmrgAC_LANG_PUSH([C])dnl
10090e4da38afSmrgAC_CACHE_CHECK(
10091e4da38afSmrg  [whether $CC understands -c and -o together],
10092e4da38afSmrg  [am_cv_prog_cc_c_o],
10093e4da38afSmrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
10094e4da38afSmrg  # Make sure it works both with $CC and with simple cc.
10095e4da38afSmrg  # Following AC_PROG_CC_C_O, we do the test twice because some
10096e4da38afSmrg  # compilers refuse to overwrite an existing .o file with -o,
10097e4da38afSmrg  # though they will create one.
10098e4da38afSmrg  am_cv_prog_cc_c_o=yes
10099e4da38afSmrg  for am_i in 1 2; do
10100e4da38afSmrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
10101e4da38afSmrg         && test -f conftest2.$ac_objext; then
10102e4da38afSmrg      : OK
10103e4da38afSmrg    else
10104e4da38afSmrg      am_cv_prog_cc_c_o=no
10105e4da38afSmrg      break
10106e4da38afSmrg    fi
10107e4da38afSmrg  done
10108e4da38afSmrg  rm -f core conftest*
10109e4da38afSmrg  unset am_i])
10110e4da38afSmrgif test "$am_cv_prog_cc_c_o" != yes; then
10111e4da38afSmrg   # Losing compiler, so override with the script.
10112e4da38afSmrg   # FIXME: It is wrong to rewrite CC.
10113e4da38afSmrg   # But if we don't then we get into trouble of one sort or another.
10114e4da38afSmrg   # A longer-term fix would be to have automake use am__CC in this case,
10115e4da38afSmrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
10116e4da38afSmrg   CC="$am_aux_dir/compile $CC"
10117e4da38afSmrgfi
10118e4da38afSmrgAC_LANG_POP([C])])
1011984bf8334Smrg
10120e4da38afSmrg# For backward compatibility.
10121e4da38afSmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
1012284bf8334Smrg
10123e4da38afSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
10124e4da38afSmrg#
10125e4da38afSmrg# This file is free software; the Free Software Foundation
10126e4da38afSmrg# gives unlimited permission to copy and/or distribute it,
10127e4da38afSmrg# with or without modifications, as long as this notice is preserved.
10128659607e0Smrg
10129e4da38afSmrg# AM_RUN_LOG(COMMAND)
10130e4da38afSmrg# -------------------
10131e4da38afSmrg# Run COMMAND, save the exit status in ac_status, and log it.
10132e4da38afSmrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
10133e4da38afSmrgAC_DEFUN([AM_RUN_LOG],
10134e4da38afSmrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
10135e4da38afSmrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
10136e4da38afSmrg   ac_status=$?
10137e4da38afSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
10138e4da38afSmrg   (exit $ac_status); }])
10139659607e0Smrg
10140e4da38afSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
10141b73be646Smrg
10142e4da38afSmrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
10143a73597f9Smrg#
10144e4da38afSmrg# This file is free software; the Free Software Foundation
10145e4da38afSmrg# gives unlimited permission to copy and/or distribute it,
10146e4da38afSmrg# with or without modifications, as long as this notice is preserved.
1014784bf8334Smrg
10148e4da38afSmrg# AM_SANITY_CHECK
10149e4da38afSmrg# ---------------
10150e4da38afSmrgAC_DEFUN([AM_SANITY_CHECK],
10151e4da38afSmrg[AC_MSG_CHECKING([whether build environment is sane])
10152e4da38afSmrg# Reject unsafe characters in $srcdir or the absolute working directory
10153e4da38afSmrg# name.  Accept space and tab only in the latter.
10154e4da38afSmrgam_lf='
10155e4da38afSmrg'
10156e4da38afSmrgcase `pwd` in
10157e4da38afSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
10158e4da38afSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
10159e4da38afSmrgesac
10160e4da38afSmrgcase $srcdir in
10161e4da38afSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
10162e4da38afSmrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
10163e4da38afSmrgesac
1016484bf8334Smrg
10165e4da38afSmrg# Do 'set' in a subshell so we don't clobber the current shell's
10166e4da38afSmrg# arguments.  Must try -L first in case configure is actually a
10167e4da38afSmrg# symlink; some systems play weird games with the mod time of symlinks
10168e4da38afSmrg# (eg FreeBSD returns the mod time of the symlink's containing
10169e4da38afSmrg# directory).
10170e4da38afSmrgif (
10171e4da38afSmrg   am_has_slept=no
10172e4da38afSmrg   for am_try in 1 2; do
10173e4da38afSmrg     echo "timestamp, slept: $am_has_slept" > conftest.file
10174e4da38afSmrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
10175e4da38afSmrg     if test "$[*]" = "X"; then
10176e4da38afSmrg	# -L didn't work.
10177e4da38afSmrg	set X `ls -t "$srcdir/configure" conftest.file`
10178e4da38afSmrg     fi
10179e4da38afSmrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
10180e4da38afSmrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
1018184bf8334Smrg
10182e4da38afSmrg	# If neither matched, then we have a broken ls.  This can happen
10183e4da38afSmrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
10184e4da38afSmrg	# broken ls alias from the environment.  This has actually
10185e4da38afSmrg	# happened.  Such a system could not be considered "sane".
10186e4da38afSmrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
10187e4da38afSmrg  alias in your environment])
10188e4da38afSmrg     fi
10189e4da38afSmrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
10190e4da38afSmrg       break
10191e4da38afSmrg     fi
10192e4da38afSmrg     # Just in case.
10193e4da38afSmrg     sleep 1
10194e4da38afSmrg     am_has_slept=yes
10195e4da38afSmrg   done
10196e4da38afSmrg   test "$[2]" = conftest.file
10197e4da38afSmrg   )
10198e4da38afSmrgthen
10199e4da38afSmrg   # Ok.
10200e4da38afSmrg   :
10201e4da38afSmrgelse
10202e4da38afSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
10203e4da38afSmrgCheck your system clock])
10204e4da38afSmrgfi
10205e4da38afSmrgAC_MSG_RESULT([yes])
10206e4da38afSmrg# If we didn't sleep, we still need to ensure time stamps of config.status and
10207e4da38afSmrg# generated files are strictly newer.
10208e4da38afSmrgam_sleep_pid=
10209e4da38afSmrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
10210e4da38afSmrg  ( sleep 1 ) &
10211e4da38afSmrg  am_sleep_pid=$!
10212e4da38afSmrgfi
10213e4da38afSmrgAC_CONFIG_COMMANDS_PRE(
10214e4da38afSmrg  [AC_MSG_CHECKING([that generated files are newer than configure])
10215e4da38afSmrg   if test -n "$am_sleep_pid"; then
10216e4da38afSmrg     # Hide warnings about reused PIDs.
10217e4da38afSmrg     wait $am_sleep_pid 2>/dev/null
10218e4da38afSmrg   fi
10219e4da38afSmrg   AC_MSG_RESULT([done])])
10220e4da38afSmrgrm -f conftest.file
1022184bf8334Smrg])
1022284bf8334Smrg
10223e4da38afSmrg# Copyright (C) 2009-2014 Free Software Foundation, Inc.
10224a73597f9Smrg#
10225e4da38afSmrg# This file is free software; the Free Software Foundation
10226e4da38afSmrg# gives unlimited permission to copy and/or distribute it,
10227e4da38afSmrg# with or without modifications, as long as this notice is preserved.
1022884bf8334Smrg
10229e4da38afSmrg# AM_SILENT_RULES([DEFAULT])
10230e4da38afSmrg# --------------------------
10231e4da38afSmrg# Enable less verbose build rules; with the default set to DEFAULT
10232e4da38afSmrg# ("yes" being less verbose, "no" or empty being verbose).
10233e4da38afSmrgAC_DEFUN([AM_SILENT_RULES],
10234e4da38afSmrg[AC_ARG_ENABLE([silent-rules], [dnl
10235e4da38afSmrgAS_HELP_STRING(
10236e4da38afSmrg  [--enable-silent-rules],
10237e4da38afSmrg  [less verbose build output (undo: "make V=1")])
10238e4da38afSmrgAS_HELP_STRING(
10239e4da38afSmrg  [--disable-silent-rules],
10240e4da38afSmrg  [verbose build output (undo: "make V=0")])dnl
10241e4da38afSmrg])
10242e4da38afSmrgcase $enable_silent_rules in @%:@ (((
10243e4da38afSmrg  yes) AM_DEFAULT_VERBOSITY=0;;
10244e4da38afSmrg   no) AM_DEFAULT_VERBOSITY=1;;
10245e4da38afSmrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
10246e4da38afSmrgesac
10247e4da38afSmrgdnl
10248e4da38afSmrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
10249e4da38afSmrgdnl do not support nested variable expansions.
10250e4da38afSmrgdnl See automake bug#9928 and bug#10237.
10251e4da38afSmrgam_make=${MAKE-make}
10252e4da38afSmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
10253e4da38afSmrg   [am_cv_make_support_nested_variables],
10254e4da38afSmrg   [if AS_ECHO([['TRUE=$(BAR$(V))
10255e4da38afSmrgBAR0=false
10256e4da38afSmrgBAR1=true
10257e4da38afSmrgV=1
10258e4da38afSmrgam__doit:
10259e4da38afSmrg	@$(TRUE)
10260e4da38afSmrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
10261e4da38afSmrg  am_cv_make_support_nested_variables=yes
10262e4da38afSmrgelse
10263e4da38afSmrg  am_cv_make_support_nested_variables=no
10264e4da38afSmrgfi])
10265e4da38afSmrgif test $am_cv_make_support_nested_variables = yes; then
10266e4da38afSmrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
10267e4da38afSmrg  AM_V='$(V)'
10268e4da38afSmrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
10269e4da38afSmrgelse
10270e4da38afSmrg  AM_V=$AM_DEFAULT_VERBOSITY
10271e4da38afSmrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
10272e4da38afSmrgfi
10273e4da38afSmrgAC_SUBST([AM_V])dnl
10274e4da38afSmrgAM_SUBST_NOTMAKE([AM_V])dnl
10275e4da38afSmrgAC_SUBST([AM_DEFAULT_V])dnl
10276e4da38afSmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
10277e4da38afSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
10278e4da38afSmrgAM_BACKSLASH='\'
10279e4da38afSmrgAC_SUBST([AM_BACKSLASH])dnl
10280e4da38afSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
10281e4da38afSmrg])
1028284bf8334Smrg
10283e4da38afSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
10284a73597f9Smrg#
10285e4da38afSmrg# This file is free software; the Free Software Foundation
10286e4da38afSmrg# gives unlimited permission to copy and/or distribute it,
10287e4da38afSmrg# with or without modifications, as long as this notice is preserved.
1028884bf8334Smrg
10289e4da38afSmrg# AM_PROG_INSTALL_STRIP
10290e4da38afSmrg# ---------------------
10291e4da38afSmrg# One issue with vendor 'install' (even GNU) is that you can't
10292e4da38afSmrg# specify the program used to strip binaries.  This is especially
10293e4da38afSmrg# annoying in cross-compiling environments, where the build's strip
10294e4da38afSmrg# is unlikely to handle the host's binaries.
10295e4da38afSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
10296e4da38afSmrg# always use install-sh in "make install-strip", and initialize
10297e4da38afSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
10298e4da38afSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
10299e4da38afSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
10300e4da38afSmrg# Installed binaries are usually stripped using 'strip' when the user
10301e4da38afSmrg# run "make install-strip".  However 'strip' might not be the right
10302e4da38afSmrg# tool to use in cross-compilation environments, therefore Automake
10303e4da38afSmrg# will honor the 'STRIP' environment variable to overrule this program.
10304e4da38afSmrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
10305e4da38afSmrgif test "$cross_compiling" != no; then
10306e4da38afSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
1030784bf8334Smrgfi
10308e4da38afSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
10309e4da38afSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
1031084bf8334Smrg
10311e4da38afSmrg# Copyright (C) 2006-2014 Free Software Foundation, Inc.
1031284bf8334Smrg#
10313e4da38afSmrg# This file is free software; the Free Software Foundation
10314e4da38afSmrg# gives unlimited permission to copy and/or distribute it,
10315e4da38afSmrg# with or without modifications, as long as this notice is preserved.
1031684bf8334Smrg
10317e4da38afSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
10318e4da38afSmrg# ---------------------------
10319e4da38afSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
10320e4da38afSmrg# This macro is traced by Automake.
10321e4da38afSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
1032284bf8334Smrg
10323e4da38afSmrg# AM_SUBST_NOTMAKE(VARIABLE)
10324e4da38afSmrg# --------------------------
10325e4da38afSmrg# Public sister of _AM_SUBST_NOTMAKE.
10326e4da38afSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
10327659607e0Smrg
10328e4da38afSmrg# Check how to create a tarball.                            -*- Autoconf -*-
1032984bf8334Smrg
10330e4da38afSmrg# Copyright (C) 2004-2014 Free Software Foundation, Inc.
10331a73597f9Smrg#
10332e4da38afSmrg# This file is free software; the Free Software Foundation
10333e4da38afSmrg# gives unlimited permission to copy and/or distribute it,
10334e4da38afSmrg# with or without modifications, as long as this notice is preserved.
10335e4da38afSmrg
10336e4da38afSmrg# _AM_PROG_TAR(FORMAT)
10337e4da38afSmrg# --------------------
10338e4da38afSmrg# Check how to create a tarball in format FORMAT.
10339e4da38afSmrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
10340a73597f9Smrg#
10341e4da38afSmrg# Substitute a variable $(am__tar) that is a command
10342e4da38afSmrg# writing to stdout a FORMAT-tarball containing the directory
10343e4da38afSmrg# $tardir.
10344e4da38afSmrg#     tardir=directory && $(am__tar) > result.tar
10345a73597f9Smrg#
10346e4da38afSmrg# Substitute a variable $(am__untar) that extract such
10347e4da38afSmrg# a tarball read from stdin.
10348e4da38afSmrg#     $(am__untar) < result.tar
10349a73597f9Smrg#
10350e4da38afSmrgAC_DEFUN([_AM_PROG_TAR],
10351e4da38afSmrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
10352e4da38afSmrg# in the wild :-(  We should find a proper way to deprecate it ...
10353e4da38afSmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
10354fc27e79cSmrg
10355e4da38afSmrg# We'll loop over all known methods to create a tar archive until one works.
10356e4da38afSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
10357fc27e79cSmrg
10358e4da38afSmrgm4_if([$1], [v7],
10359e4da38afSmrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
10360fc27e79cSmrg
10361e4da38afSmrg  [m4_case([$1],
10362e4da38afSmrg    [ustar],
10363e4da38afSmrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
10364e4da38afSmrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
10365e4da38afSmrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
10366e4da38afSmrg      # and bug#13588).
10367e4da38afSmrg      am_max_uid=2097151 # 2^21 - 1
10368e4da38afSmrg      am_max_gid=$am_max_uid
10369e4da38afSmrg      # The $UID and $GID variables are not portable, so we need to resort
10370e4da38afSmrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
10371e4da38afSmrg      # below are definitely unexpected, so allow the users to see them
10372e4da38afSmrg      # (that is, avoid stderr redirection).
10373e4da38afSmrg      am_uid=`id -u || echo unknown`
10374e4da38afSmrg      am_gid=`id -g || echo unknown`
10375e4da38afSmrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
10376e4da38afSmrg      if test $am_uid -le $am_max_uid; then
10377e4da38afSmrg         AC_MSG_RESULT([yes])
10378e4da38afSmrg      else
10379e4da38afSmrg         AC_MSG_RESULT([no])
10380e4da38afSmrg         _am_tools=none
10381e4da38afSmrg      fi
10382e4da38afSmrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
10383e4da38afSmrg      if test $am_gid -le $am_max_gid; then
10384e4da38afSmrg         AC_MSG_RESULT([yes])
10385e4da38afSmrg      else
10386e4da38afSmrg        AC_MSG_RESULT([no])
10387e4da38afSmrg        _am_tools=none
10388e4da38afSmrg      fi],
10389fc27e79cSmrg
10390e4da38afSmrg  [pax],
10391e4da38afSmrg    [],
10392b73be646Smrg
10393e4da38afSmrg  [m4_fatal([Unknown tar format])])
10394fc27e79cSmrg
10395e4da38afSmrg  AC_MSG_CHECKING([how to create a $1 tar archive])
1039684bf8334Smrg
10397e4da38afSmrg  # Go ahead even if we have the value already cached.  We do so because we
10398e4da38afSmrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
10399e4da38afSmrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1040084bf8334Smrg
10401e4da38afSmrg  for _am_tool in $_am_tools; do
10402e4da38afSmrg    case $_am_tool in
10403e4da38afSmrg    gnutar)
10404e4da38afSmrg      for _am_tar in tar gnutar gtar; do
10405e4da38afSmrg        AM_RUN_LOG([$_am_tar --version]) && break
10406e4da38afSmrg      done
10407e4da38afSmrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
10408e4da38afSmrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
10409e4da38afSmrg      am__untar="$_am_tar -xf -"
10410e4da38afSmrg      ;;
10411e4da38afSmrg    plaintar)
10412e4da38afSmrg      # Must skip GNU tar: if it does not support --format= it doesn't create
10413e4da38afSmrg      # ustar tarball either.
10414e4da38afSmrg      (tar --version) >/dev/null 2>&1 && continue
10415e4da38afSmrg      am__tar='tar chf - "$$tardir"'
10416e4da38afSmrg      am__tar_='tar chf - "$tardir"'
10417e4da38afSmrg      am__untar='tar xf -'
10418e4da38afSmrg      ;;
10419e4da38afSmrg    pax)
10420e4da38afSmrg      am__tar='pax -L -x $1 -w "$$tardir"'
10421e4da38afSmrg      am__tar_='pax -L -x $1 -w "$tardir"'
10422e4da38afSmrg      am__untar='pax -r'
10423e4da38afSmrg      ;;
10424e4da38afSmrg    cpio)
10425e4da38afSmrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
10426e4da38afSmrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
10427e4da38afSmrg      am__untar='cpio -i -H $1 -d'
10428e4da38afSmrg      ;;
10429e4da38afSmrg    none)
10430e4da38afSmrg      am__tar=false
10431e4da38afSmrg      am__tar_=false
10432e4da38afSmrg      am__untar=false
10433e4da38afSmrg      ;;
10434e4da38afSmrg    esac
10435fc27e79cSmrg
10436e4da38afSmrg    # If the value was cached, stop now.  We just wanted to have am__tar
10437e4da38afSmrg    # and am__untar set.
10438e4da38afSmrg    test -n "${am_cv_prog_tar_$1}" && break
1043984bf8334Smrg
10440e4da38afSmrg    # tar/untar a dummy directory, and stop if the command works.
10441e4da38afSmrg    rm -rf conftest.dir
10442e4da38afSmrg    mkdir conftest.dir
10443e4da38afSmrg    echo GrepMe > conftest.dir/file
10444e4da38afSmrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
10445e4da38afSmrg    rm -rf conftest.dir
10446e4da38afSmrg    if test -s conftest.tar; then
10447e4da38afSmrg      AM_RUN_LOG([$am__untar <conftest.tar])
10448e4da38afSmrg      AM_RUN_LOG([cat conftest.dir/file])
10449e4da38afSmrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
10450e4da38afSmrg    fi
10451e4da38afSmrg  done
10452e4da38afSmrg  rm -rf conftest.dir
10453e4da38afSmrg
10454e4da38afSmrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
10455e4da38afSmrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
10456e4da38afSmrg
10457e4da38afSmrgAC_SUBST([am__tar])
10458e4da38afSmrgAC_SUBST([am__untar])
10459e4da38afSmrg]) # _AM_PROG_TAR
10460fc27e79cSmrg
1046184bf8334Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
1046284bf8334Smrgdnl
10463e4da38afSmrgdnl Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
1046484bf8334Smrgdnl
1046584bf8334Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
1046684bf8334Smrgdnl copy of this software and associated documentation files (the "Software"),
1046784bf8334Smrgdnl to deal in the Software without restriction, including without limitation
1046884bf8334Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
1046984bf8334Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
1047084bf8334Smrgdnl Software is furnished to do so, subject to the following conditions:
1047184bf8334Smrgdnl
1047284bf8334Smrgdnl The above copyright notice and this permission notice (including the next
1047384bf8334Smrgdnl paragraph) shall be included in all copies or substantial portions of the
1047484bf8334Smrgdnl Software.
1047584bf8334Smrgdnl
1047684bf8334Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1047784bf8334Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1047884bf8334Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1047984bf8334Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1048084bf8334Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1048184bf8334Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1048284bf8334Smrgdnl DEALINGS IN THE SOFTWARE.
10483fc27e79cSmrg
1048484bf8334Smrg# XORG_MACROS_VERSION(required-version)
1048584bf8334Smrg# -------------------------------------
10486a73597f9Smrg# Minimum version: 1.1.0
10487a73597f9Smrg#
1048884bf8334Smrg# If you're using a macro added in Version 1.1 or newer, include this in
1048984bf8334Smrg# your configure.ac with the minimum required version, such as:
1049084bf8334Smrg# XORG_MACROS_VERSION(1.1)
10491a73597f9Smrg#
1049284bf8334Smrg# To ensure that this macro is defined, also add:
1049384bf8334Smrg# m4_ifndef([XORG_MACROS_VERSION],
1049484bf8334Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
10495a73597f9Smrg#
10496a73597f9Smrg#
1049784bf8334Smrg# See the "minimum version" comment for each macro you use to see what
1049884bf8334Smrg# version you require.
1049984bf8334Smrgm4_defun([XORG_MACROS_VERSION],[
1050084bf8334Smrgm4_define([vers_have], [1.19.0])
1050184bf8334Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
1050284bf8334Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
1050384bf8334Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
1050484bf8334Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
1050584bf8334Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
1050684bf8334Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
1050784bf8334Smrgm4_undefine([vers_have])
1050884bf8334Smrgm4_undefine([maj_have])
1050984bf8334Smrgm4_undefine([maj_needed])
1051084bf8334Smrg]) # XORG_MACROS_VERSION
1051184bf8334Smrg
1051284bf8334Smrg# XORG_PROG_RAWCPP()
1051384bf8334Smrg# ------------------
1051484bf8334Smrg# Minimum version: 1.0.0
1051584bf8334Smrg#
1051684bf8334Smrg# Find cpp program and necessary flags for use in pre-processing text files
1051784bf8334Smrg# such as man pages and config files
1051884bf8334SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
1051984bf8334SmrgAC_REQUIRE([AC_PROG_CPP])
1052084bf8334SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
1052184bf8334Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
1052284bf8334Smrg
1052384bf8334Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
1052484bf8334Smrg# which is not the best choice for supporting other OS'es, but covers most
1052584bf8334Smrg# of the ones we need for now.
1052684bf8334SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
1052784bf8334SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
1052884bf8334Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1052984bf8334Smrg	AC_MSG_RESULT([no])
1053084bf8334Smrgelse
1053184bf8334Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1053284bf8334Smrg		RAWCPPFLAGS=-undef
1053384bf8334Smrg		AC_MSG_RESULT([yes])
1053484bf8334Smrg	# under Cygwin unix is still defined even with -undef
1053584bf8334Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
1053684bf8334Smrg		RAWCPPFLAGS="-undef -ansi"
1053784bf8334Smrg		AC_MSG_RESULT([yes, with -ansi])
1053884bf8334Smrg	else
1053984bf8334Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
1054084bf8334Smrg	fi
1054184bf8334Smrgfi
1054284bf8334Smrgrm -f conftest.$ac_ext
1054384bf8334Smrg
1054484bf8334SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
1054584bf8334SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
1054684bf8334Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1054784bf8334Smrg	AC_MSG_RESULT([no])
1054884bf8334Smrgelse
1054984bf8334Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
1055084bf8334Smrg		TRADITIONALCPPFLAGS="-traditional"
1055184bf8334Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
1055284bf8334Smrg		AC_MSG_RESULT([yes])
1055384bf8334Smrg	else
1055484bf8334Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
1055584bf8334Smrg	fi
1055684bf8334Smrgfi
1055784bf8334Smrgrm -f conftest.$ac_ext
1055884bf8334SmrgAC_SUBST(RAWCPPFLAGS)
1055984bf8334SmrgAC_SUBST(TRADITIONALCPPFLAGS)
1056084bf8334Smrg]) # XORG_PROG_RAWCPP
1056184bf8334Smrg
1056284bf8334Smrg# XORG_MANPAGE_SECTIONS()
1056384bf8334Smrg# -----------------------
1056484bf8334Smrg# Minimum version: 1.0.0
10565a73597f9Smrg#
1056684bf8334Smrg# Determine which sections man pages go in for the different man page types
1056784bf8334Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
1056884bf8334Smrg# Not sure if there's any better way than just hardcoding by OS name.
1056984bf8334Smrg# Override default settings by setting environment variables
1057084bf8334Smrg# Added MAN_SUBSTS in version 1.8
1057184bf8334Smrg# Added AC_PROG_SED in version 1.8
10572fc27e79cSmrg
1057384bf8334SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
1057484bf8334SmrgAC_REQUIRE([AC_CANONICAL_HOST])
1057584bf8334SmrgAC_REQUIRE([AC_PROG_SED])
10576fc27e79cSmrg
1057784bf8334Smrgif test x$APP_MAN_SUFFIX = x    ; then
1057884bf8334Smrg    APP_MAN_SUFFIX=1
1057984bf8334Smrgfi
1058084bf8334Smrgif test x$APP_MAN_DIR = x    ; then
1058184bf8334Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
1058284bf8334Smrgfi
10583fc27e79cSmrg
1058484bf8334Smrgif test x$LIB_MAN_SUFFIX = x    ; then
1058584bf8334Smrg    LIB_MAN_SUFFIX=3
1058684bf8334Smrgfi
1058784bf8334Smrgif test x$LIB_MAN_DIR = x    ; then
1058884bf8334Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
10589a73597f9Smrgfi
10590fc27e79cSmrg
1059184bf8334Smrgif test x$FILE_MAN_SUFFIX = x    ; then
1059284bf8334Smrg    case $host_os in
10593e4da38afSmrg	# Solaris 2.0 - 11 use SysV man page sections
10594e4da38afSmrg	solaris2.?|solaris2.1[[01]])	FILE_MAN_SUFFIX=4  ;;
10595e4da38afSmrg	*)				FILE_MAN_SUFFIX=5  ;;
1059684bf8334Smrg    esac
1059784bf8334Smrgfi
1059884bf8334Smrgif test x$FILE_MAN_DIR = x    ; then
1059984bf8334Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
10600a73597f9Smrgfi
10601fc27e79cSmrg
1060284bf8334Smrgif test x$MISC_MAN_SUFFIX = x    ; then
1060384bf8334Smrg    case $host_os in
10604e4da38afSmrg	# Solaris 2.0 - 11 use SysV man page sections
10605e4da38afSmrg	solaris2.?|solaris2.1[[01]])	MISC_MAN_SUFFIX=5  ;;
10606e4da38afSmrg	*)				MISC_MAN_SUFFIX=7  ;;
1060784bf8334Smrg    esac
1060884bf8334Smrgfi
1060984bf8334Smrgif test x$MISC_MAN_DIR = x    ; then
1061084bf8334Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
1061184bf8334Smrgfi
10612fc27e79cSmrg
1061384bf8334Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
1061484bf8334Smrg    case $host_os in
10615e4da38afSmrg	# Solaris 2.0 - 11 use SysV man page sections
10616e4da38afSmrg	solaris2.?|solaris2.1[[01]])	DRIVER_MAN_SUFFIX=7  ;;
10617e4da38afSmrg	*)				DRIVER_MAN_SUFFIX=4  ;;
1061884bf8334Smrg    esac
1061984bf8334Smrgfi
1062084bf8334Smrgif test x$DRIVER_MAN_DIR = x    ; then
1062184bf8334Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1062284bf8334Smrgfi
10623fc27e79cSmrg
1062484bf8334Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
1062584bf8334Smrg    case $host_os in
10626e4da38afSmrg	# Solaris 2.0 - 11 use SysV man page sections
10627e4da38afSmrg	solaris2.?|solaris2.1[[01]])	ADMIN_MAN_SUFFIX=1m ;;
10628e4da38afSmrg	*)				ADMIN_MAN_SUFFIX=8  ;;
1062984bf8334Smrg    esac
1063084bf8334Smrgfi
1063184bf8334Smrgif test x$ADMIN_MAN_DIR = x    ; then
1063284bf8334Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
1063384bf8334Smrgfi
10634fc27e79cSmrg
10635a73597f9Smrg
1063684bf8334SmrgAC_SUBST([APP_MAN_SUFFIX])
1063784bf8334SmrgAC_SUBST([LIB_MAN_SUFFIX])
1063884bf8334SmrgAC_SUBST([FILE_MAN_SUFFIX])
1063984bf8334SmrgAC_SUBST([MISC_MAN_SUFFIX])
1064084bf8334SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
1064184bf8334SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
1064284bf8334SmrgAC_SUBST([APP_MAN_DIR])
1064384bf8334SmrgAC_SUBST([LIB_MAN_DIR])
1064484bf8334SmrgAC_SUBST([FILE_MAN_DIR])
1064584bf8334SmrgAC_SUBST([MISC_MAN_DIR])
1064684bf8334SmrgAC_SUBST([DRIVER_MAN_DIR])
1064784bf8334SmrgAC_SUBST([ADMIN_MAN_DIR])
10648b73be646Smrg
1064984bf8334SmrgXORG_MAN_PAGE="X Version 11"
1065084bf8334SmrgAC_SUBST([XORG_MAN_PAGE])
1065184bf8334SmrgMAN_SUBSTS="\
1065284bf8334Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1065384bf8334Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
1065484bf8334Smrg	-e 's|__xservername__|Xorg|g' \
1065584bf8334Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
10656e4da38afSmrg	-e 's|__xorgconfdir__|xorg.conf.d|g' \
1065784bf8334Smrg	-e 's|__projectroot__|\$(prefix)|g' \
1065884bf8334Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
1065984bf8334Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
1066084bf8334Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
1066184bf8334Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
1066284bf8334Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
1066384bf8334Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
1066484bf8334Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
1066584bf8334SmrgAC_SUBST([MAN_SUBSTS])
10666fc27e79cSmrg
1066784bf8334Smrg]) # XORG_MANPAGE_SECTIONS
10668fc27e79cSmrg
1066984bf8334Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
1067084bf8334Smrg# ------------------------
1067184bf8334Smrg# Minimum version: 1.7.0
10672a73597f9Smrg#
1067384bf8334Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
1067484bf8334Smrg# provided by xorg-sgml-doctools, if installed.
1067584bf8334SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
1067684bf8334SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
1067784bf8334SmrgXORG_SGML_PATH=
1067884bf8334SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
1067984bf8334Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
1068084bf8334Smrg    [m4_ifval([$1],[:],
1068184bf8334Smrg        [if test x"$cross_compiling" != x"yes" ; then
1068284bf8334Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
1068384bf8334Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
1068484bf8334Smrg         fi])
1068584bf8334Smrg    ])
10686659607e0Smrg
1068784bf8334Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
1068884bf8334Smrg# the path and the name of the doc stylesheet
1068984bf8334Smrgif test "x$XORG_SGML_PATH" != "x" ; then
1069084bf8334Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
1069184bf8334Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
1069284bf8334Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
1069384bf8334Smrgelse
1069484bf8334Smrg   AC_MSG_RESULT([no])
1069584bf8334Smrgfi
10696a73597f9Smrg
1069784bf8334SmrgAC_SUBST(XORG_SGML_PATH)
1069884bf8334SmrgAC_SUBST(STYLESHEET_SRCDIR)
1069984bf8334SmrgAC_SUBST(XSL_STYLESHEET)
1070084bf8334SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
1070184bf8334Smrg]) # XORG_CHECK_SGML_DOCTOOLS
10702a73597f9Smrg
1070384bf8334Smrg# XORG_CHECK_LINUXDOC
1070484bf8334Smrg# -------------------
1070584bf8334Smrg# Minimum version: 1.0.0
1070684bf8334Smrg#
1070784bf8334Smrg# Defines the variable MAKE_TEXT if the necessary tools and
1070884bf8334Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
1070984bf8334Smrg# Whether or not the necessary tools and files are found can be checked
1071084bf8334Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
1071184bf8334SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
1071284bf8334SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
1071384bf8334SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
10714659607e0Smrg
1071584bf8334SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
10716a73597f9Smrg
1071784bf8334SmrgAC_MSG_CHECKING([whether to build documentation])
10718bd3a1963Smrg
1071984bf8334Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
1072084bf8334Smrg   BUILDDOC=yes
1072184bf8334Smrgelse
1072284bf8334Smrg   BUILDDOC=no
10723a73597f9Smrgfi
10724bd3a1963Smrg
1072584bf8334SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
10726a73597f9Smrg
1072784bf8334SmrgAC_MSG_RESULT([$BUILDDOC])
10728a73597f9Smrg
1072984bf8334SmrgAC_MSG_CHECKING([whether to build pdf documentation])
10730a73597f9Smrg
1073184bf8334Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
1073284bf8334Smrg   BUILDPDFDOC=yes
1073384bf8334Smrgelse
1073484bf8334Smrg   BUILDPDFDOC=no
1073584bf8334Smrgfi
10736a73597f9Smrg
1073784bf8334SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10738a73597f9Smrg
1073984bf8334SmrgAC_MSG_RESULT([$BUILDPDFDOC])
10740659607e0Smrg
1074184bf8334SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
1074284bf8334SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
1074384bf8334SmrgMAKE_PDF="$PS2PDF"
1074484bf8334SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
1074584bf8334Smrg
1074684bf8334SmrgAC_SUBST(MAKE_TEXT)
1074784bf8334SmrgAC_SUBST(MAKE_PS)
1074884bf8334SmrgAC_SUBST(MAKE_PDF)
1074984bf8334SmrgAC_SUBST(MAKE_HTML)
1075084bf8334Smrg]) # XORG_CHECK_LINUXDOC
1075184bf8334Smrg
1075284bf8334Smrg# XORG_CHECK_DOCBOOK
1075384bf8334Smrg# -------------------
1075484bf8334Smrg# Minimum version: 1.0.0
10755a73597f9Smrg#
1075684bf8334Smrg# Checks for the ability to build output formats from SGML DocBook source.
1075784bf8334Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
1075884bf8334Smrg# indicates whether the necessary tools and files are found and, if set,
1075984bf8334Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
1076084bf8334SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
1076184bf8334SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10762659607e0Smrg
1076384bf8334SmrgBUILDTXTDOC=no
1076484bf8334SmrgBUILDPDFDOC=no
1076584bf8334SmrgBUILDPSDOC=no
1076684bf8334SmrgBUILDHTMLDOC=no
10767a73597f9Smrg
1076884bf8334SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
1076984bf8334SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
1077084bf8334SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
1077184bf8334SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
1077284bf8334Smrg
1077384bf8334SmrgAC_MSG_CHECKING([whether to build text documentation])
1077484bf8334Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
1077584bf8334Smrg   test x$BUILD_TXTDOC != xno; then
1077684bf8334Smrg	BUILDTXTDOC=yes
10777a73597f9Smrgfi
1077884bf8334SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
1077984bf8334SmrgAC_MSG_RESULT([$BUILDTXTDOC])
10780659607e0Smrg
1078184bf8334SmrgAC_MSG_CHECKING([whether to build PDF documentation])
1078284bf8334Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
1078384bf8334Smrg   test x$BUILD_PDFDOC != xno; then
1078484bf8334Smrg	BUILDPDFDOC=yes
1078584bf8334Smrgfi
1078684bf8334SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
1078784bf8334SmrgAC_MSG_RESULT([$BUILDPDFDOC])
10788a73597f9Smrg
1078984bf8334SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
1079084bf8334Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
1079184bf8334Smrg   test x$BUILD_PSDOC != xno; then
1079284bf8334Smrg	BUILDPSDOC=yes
1079384bf8334Smrgfi
1079484bf8334SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
1079584bf8334SmrgAC_MSG_RESULT([$BUILDPSDOC])
10796659607e0Smrg
1079784bf8334SmrgAC_MSG_CHECKING([whether to build HTML documentation])
1079884bf8334Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
1079984bf8334Smrg   test x$BUILD_HTMLDOC != xno; then
1080084bf8334Smrg	BUILDHTMLDOC=yes
1080184bf8334Smrgfi
1080284bf8334SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
1080384bf8334SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
10804a73597f9Smrg
1080584bf8334SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
1080684bf8334SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
1080784bf8334SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
1080884bf8334SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
10809a73597f9Smrg
1081084bf8334SmrgAC_SUBST(MAKE_TEXT)
1081184bf8334SmrgAC_SUBST(MAKE_PS)
1081284bf8334SmrgAC_SUBST(MAKE_PDF)
1081384bf8334SmrgAC_SUBST(MAKE_HTML)
1081484bf8334Smrg]) # XORG_CHECK_DOCBOOK
10815a73597f9Smrg
1081684bf8334Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
1081784bf8334Smrg# ----------------
1081884bf8334Smrg# Minimum version: 1.5.0
1081984bf8334Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1082084bf8334Smrg#
1082184bf8334Smrg# Documentation tools are not always available on all platforms and sometimes
1082284bf8334Smrg# not at the appropriate level. This macro enables a module to test for the
1082384bf8334Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1082484bf8334Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
1082584bf8334Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
1082684bf8334Smrg# --with-xmlto assumes 'auto'.
1082784bf8334Smrg#
1082884bf8334Smrg# Interface to module:
1082984bf8334Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
1083084bf8334Smrg# XMLTO:	returns the path of the xmlto program found
1083184bf8334Smrg#		returns the path set by the user in the environment
1083284bf8334Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
1083384bf8334Smrg#		'no' user instructs the module not to use xmlto
1083484bf8334Smrg#
1083584bf8334Smrg# Added in version 1.10.0
1083684bf8334Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
1083784bf8334Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
1083884bf8334Smrg#
1083984bf8334Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
1084084bf8334Smrg#
1084184bf8334SmrgAC_DEFUN([XORG_WITH_XMLTO],[
1084284bf8334SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
1084384bf8334Smrgm4_define([_defopt], m4_default([$2], [auto]))
1084484bf8334SmrgAC_ARG_WITH(xmlto,
1084584bf8334Smrg	AS_HELP_STRING([--with-xmlto],
1084684bf8334Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
1084784bf8334Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
1084884bf8334Smrgm4_undefine([_defopt])
1084984bf8334Smrg
1085084bf8334Smrgif test "x$use_xmlto" = x"auto"; then
1085184bf8334Smrg   AC_PATH_PROG([XMLTO], [xmlto])
1085284bf8334Smrg   if test "x$XMLTO" = "x"; then
1085384bf8334Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
1085484bf8334Smrg	have_xmlto=no
1085584bf8334Smrg   else
1085684bf8334Smrg        have_xmlto=yes
1085784bf8334Smrg   fi
1085884bf8334Smrgelif test "x$use_xmlto" = x"yes" ; then
1085984bf8334Smrg   AC_PATH_PROG([XMLTO], [xmlto])
1086084bf8334Smrg   if test "x$XMLTO" = "x"; then
1086184bf8334Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
1086284bf8334Smrg   fi
1086384bf8334Smrg   have_xmlto=yes
1086484bf8334Smrgelif test "x$use_xmlto" = x"no" ; then
1086584bf8334Smrg   if test "x$XMLTO" != "x"; then
1086684bf8334Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
1086784bf8334Smrg   fi
1086884bf8334Smrg   have_xmlto=no
10869a73597f9Smrgelse
1087084bf8334Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
10871a73597f9Smrgfi
10872659607e0Smrg
1087384bf8334Smrg# Test for a minimum version of xmlto, if provided.
1087484bf8334Smrgm4_ifval([$1],
1087584bf8334Smrg[if test "$have_xmlto" = yes; then
1087684bf8334Smrg    # scrape the xmlto version
1087784bf8334Smrg    AC_MSG_CHECKING([the xmlto version])
1087884bf8334Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
1087984bf8334Smrg    AC_MSG_RESULT([$xmlto_version])
1088084bf8334Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
1088184bf8334Smrg        [if test "x$use_xmlto" = xauto; then
1088284bf8334Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
1088384bf8334Smrg            have_xmlto=no
1088484bf8334Smrg        else
1088584bf8334Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
1088684bf8334Smrg        fi])
1088784bf8334Smrgfi])
10888b73be646Smrg
1088984bf8334Smrg# Test for the ability of xmlto to generate a text target
10890e4da38afSmrg#
10891e4da38afSmrg# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the
10892e4da38afSmrg# following test for empty XML docbook files.
10893e4da38afSmrg# For compatibility reasons use the following empty XML docbook file and if
10894e4da38afSmrg# it fails try it again with a non-empty XML file.
1089584bf8334Smrghave_xmlto_text=no
1089684bf8334Smrgcat > conftest.xml << "EOF"
1089784bf8334SmrgEOF
1089884bf8334SmrgAS_IF([test "$have_xmlto" = yes],
1089984bf8334Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
1090084bf8334Smrg             [have_xmlto_text=yes],
10901e4da38afSmrg             [# Try it again with a non-empty XML file.
10902e4da38afSmrg              cat > conftest.xml << "EOF"
10903e4da38afSmrg<x></x>
10904e4da38afSmrgEOF
10905e4da38afSmrg              AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
10906e4da38afSmrg                    [have_xmlto_text=yes],
10907e4da38afSmrg                    [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])])
1090884bf8334Smrgrm -f conftest.xml
1090984bf8334SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
1091084bf8334SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
1091184bf8334Smrg]) # XORG_WITH_XMLTO
1091284bf8334Smrg
1091384bf8334Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
1091484bf8334Smrg# --------------------------------------------
1091584bf8334Smrg# Minimum version: 1.12.0
1091684bf8334Smrg# Minimum version for optional DEFAULT argument: 1.12.0
10917a73597f9Smrg#
1091884bf8334Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
1091984bf8334Smrg# XML-based language used for the transformation of XML documents.
1092084bf8334Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
1092184bf8334Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
1092284bf8334Smrg# The XSLT processor is often used as a standalone tool for transformations.
1092384bf8334Smrg# It should not be assumed that this tool is used only to work with documnetation.
1092484bf8334Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
10925a73597f9Smrg#
1092684bf8334Smrg# Interface to module:
1092784bf8334Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
1092884bf8334Smrg# XSLTPROC:	 returns the path of the xsltproc program found
1092984bf8334Smrg#		 returns the path set by the user in the environment
1093084bf8334Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
1093184bf8334Smrg#		  'no' user instructs the module not to use xsltproc
1093284bf8334Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
10933a73597f9Smrg#
1093484bf8334Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
10935a73597f9Smrg#
1093684bf8334SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
1093784bf8334SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
1093884bf8334Smrg# Preserves the interface, should it be implemented later
1093984bf8334Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
1094084bf8334Smrgm4_define([_defopt], m4_default([$2], [auto]))
1094184bf8334SmrgAC_ARG_WITH(xsltproc,
1094284bf8334Smrg	AS_HELP_STRING([--with-xsltproc],
1094384bf8334Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
1094484bf8334Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
1094584bf8334Smrgm4_undefine([_defopt])
10946a73597f9Smrg
1094784bf8334Smrgif test "x$use_xsltproc" = x"auto"; then
1094884bf8334Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
1094984bf8334Smrg   if test "x$XSLTPROC" = "x"; then
1095084bf8334Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
1095184bf8334Smrg	have_xsltproc=no
1095284bf8334Smrg   else
1095384bf8334Smrg        have_xsltproc=yes
1095484bf8334Smrg   fi
1095584bf8334Smrgelif test "x$use_xsltproc" = x"yes" ; then
1095684bf8334Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
1095784bf8334Smrg   if test "x$XSLTPROC" = "x"; then
1095884bf8334Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
1095984bf8334Smrg   fi
1096084bf8334Smrg   have_xsltproc=yes
1096184bf8334Smrgelif test "x$use_xsltproc" = x"no" ; then
1096284bf8334Smrg   if test "x$XSLTPROC" != "x"; then
1096384bf8334Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
1096484bf8334Smrg   fi
1096584bf8334Smrg   have_xsltproc=no
1096684bf8334Smrgelse
1096784bf8334Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
10968bd3a1963Smrgfi
10969fc27e79cSmrg
1097084bf8334SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
1097184bf8334Smrg]) # XORG_WITH_XSLTPROC
1097284bf8334Smrg
1097384bf8334Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
1097484bf8334Smrg# ----------------------------------------
1097584bf8334Smrg# Minimum version: 1.15.0
10976a73597f9Smrg#
1097784bf8334Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
1097884bf8334Smrg# scanning arbitrary text files, extracting information from those text files,
1097984bf8334Smrg# and printing reports based on that information.
10980a73597f9Smrg#
1098184bf8334Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
10982a73597f9Smrg#
1098384bf8334Smrg# Interface to module:
1098484bf8334Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
1098584bf8334Smrg# PERL:	     returns the path of the perl program found
1098684bf8334Smrg#	     returns the path set by the user in the environment
1098784bf8334Smrg# --with-perl: 'yes' user instructs the module to use perl
1098884bf8334Smrg#	       'no' user instructs the module not to use perl
1098984bf8334Smrg# have_perl: returns yes if perl found in PATH or no
10990a73597f9Smrg#
1099184bf8334Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
1099284bf8334Smrg#
1099384bf8334SmrgAC_DEFUN([XORG_WITH_PERL],[
1099484bf8334SmrgAC_ARG_VAR([PERL], [Path to perl command])
1099584bf8334Smrg# Preserves the interface, should it be implemented later
1099684bf8334Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
1099784bf8334Smrgm4_define([_defopt], m4_default([$2], [auto]))
1099884bf8334SmrgAC_ARG_WITH(perl,
1099984bf8334Smrg	AS_HELP_STRING([--with-perl],
1100084bf8334Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
1100184bf8334Smrg	   [use_perl=$withval], [use_perl=]_defopt)
1100284bf8334Smrgm4_undefine([_defopt])
1100384bf8334Smrg
1100484bf8334Smrgif test "x$use_perl" = x"auto"; then
1100584bf8334Smrg   AC_PATH_PROG([PERL], [perl])
1100684bf8334Smrg   if test "x$PERL" = "x"; then
1100784bf8334Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
1100884bf8334Smrg	have_perl=no
1100984bf8334Smrg   else
1101084bf8334Smrg        have_perl=yes
1101184bf8334Smrg   fi
1101284bf8334Smrgelif test "x$use_perl" = x"yes" ; then
1101384bf8334Smrg   AC_PATH_PROG([PERL], [perl])
1101484bf8334Smrg   if test "x$PERL" = "x"; then
1101584bf8334Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
1101684bf8334Smrg   fi
1101784bf8334Smrg   have_perl=yes
1101884bf8334Smrgelif test "x$use_perl" = x"no" ; then
1101984bf8334Smrg   if test "x$PERL" != "x"; then
1102084bf8334Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
1102184bf8334Smrg   fi
1102284bf8334Smrg   have_perl=no
1102384bf8334Smrgelse
1102484bf8334Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
1102584bf8334Smrgfi
11026bd3a1963Smrg
1102784bf8334SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
1102884bf8334Smrg]) # XORG_WITH_PERL
110296aab59a7Smrg
1103084bf8334Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
11031a73597f9Smrg# ----------------
1103284bf8334Smrg# Minimum version: 1.5.0
1103384bf8334Smrg# Minimum version for optional DEFAULT argument: 1.11.0
11034fc27e79cSmrg#
1103584bf8334Smrg# Documentation tools are not always available on all platforms and sometimes
1103684bf8334Smrg# not at the appropriate level. This macro enables a module to test for the
1103784bf8334Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1103884bf8334Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
1103984bf8334Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
1104084bf8334Smrg# --with-asciidoc assumes 'auto'.
11041b73be646Smrg#
1104284bf8334Smrg# Interface to module:
1104384bf8334Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
1104484bf8334Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
1104584bf8334Smrg#		 returns the path set by the user in the environment
1104684bf8334Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
1104784bf8334Smrg#		  'no' user instructs the module not to use asciidoc
11048a73597f9Smrg#
1104984bf8334Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
11050a73597f9Smrg#
1105184bf8334SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
1105284bf8334SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
1105384bf8334Smrgm4_define([_defopt], m4_default([$2], [auto]))
1105484bf8334SmrgAC_ARG_WITH(asciidoc,
1105584bf8334Smrg	AS_HELP_STRING([--with-asciidoc],
1105684bf8334Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
1105784bf8334Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
1105884bf8334Smrgm4_undefine([_defopt])
11059659607e0Smrg
1106084bf8334Smrgif test "x$use_asciidoc" = x"auto"; then
1106184bf8334Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1106284bf8334Smrg   if test "x$ASCIIDOC" = "x"; then
1106384bf8334Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
1106484bf8334Smrg	have_asciidoc=no
1106584bf8334Smrg   else
1106684bf8334Smrg        have_asciidoc=yes
1106784bf8334Smrg   fi
1106884bf8334Smrgelif test "x$use_asciidoc" = x"yes" ; then
1106984bf8334Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
1107084bf8334Smrg   if test "x$ASCIIDOC" = "x"; then
1107184bf8334Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
1107284bf8334Smrg   fi
1107384bf8334Smrg   have_asciidoc=yes
1107484bf8334Smrgelif test "x$use_asciidoc" = x"no" ; then
1107584bf8334Smrg   if test "x$ASCIIDOC" != "x"; then
1107684bf8334Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
1107784bf8334Smrg   fi
1107884bf8334Smrg   have_asciidoc=no
1107984bf8334Smrgelse
1108084bf8334Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
1108184bf8334Smrgfi
1108284bf8334Smrgm4_ifval([$1],
1108384bf8334Smrg[if test "$have_asciidoc" = yes; then
1108484bf8334Smrg    # scrape the asciidoc version
1108584bf8334Smrg    AC_MSG_CHECKING([the asciidoc version])
1108684bf8334Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
1108784bf8334Smrg    AC_MSG_RESULT([$asciidoc_version])
1108884bf8334Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
1108984bf8334Smrg        [if test "x$use_asciidoc" = xauto; then
1109084bf8334Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
1109184bf8334Smrg            have_asciidoc=no
1109284bf8334Smrg        else
1109384bf8334Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
1109484bf8334Smrg        fi])
1109584bf8334Smrgfi])
1109684bf8334SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
1109784bf8334Smrg]) # XORG_WITH_ASCIIDOC
11098659607e0Smrg
1109984bf8334Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
1110084bf8334Smrg# -------------------------------------------
1110184bf8334Smrg# Minimum version: 1.5.0
1110284bf8334Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1110384bf8334Smrg# Minimum version for optional DOT checking: 1.18.0
1110484bf8334Smrg#
1110584bf8334Smrg# Documentation tools are not always available on all platforms and sometimes
1110684bf8334Smrg# not at the appropriate level. This macro enables a module to test for the
1110784bf8334Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1110884bf8334Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
1110984bf8334Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
1111084bf8334Smrg# --with-doxygen assumes 'auto'.
1111184bf8334Smrg#
1111284bf8334Smrg# Interface to module:
1111384bf8334Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
1111484bf8334Smrg# DOXYGEN:	 returns the path of the doxygen program found
1111584bf8334Smrg#		 returns the path set by the user in the environment
1111684bf8334Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
1111784bf8334Smrg#		  'no' user instructs the module not to use doxygen
1111884bf8334Smrg#
1111984bf8334Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
1112084bf8334Smrg#
1112184bf8334SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
1112284bf8334SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
1112384bf8334SmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
1112484bf8334Smrgm4_define([_defopt], m4_default([$2], [auto]))
1112584bf8334SmrgAC_ARG_WITH(doxygen,
1112684bf8334Smrg	AS_HELP_STRING([--with-doxygen],
1112784bf8334Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
1112884bf8334Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
1112984bf8334Smrgm4_undefine([_defopt])
11130659607e0Smrg
1113184bf8334Smrgif test "x$use_doxygen" = x"auto"; then
1113284bf8334Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1113384bf8334Smrg   if test "x$DOXYGEN" = "x"; then
1113484bf8334Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
1113584bf8334Smrg	have_doxygen=no
1113684bf8334Smrg   else
1113784bf8334Smrg        have_doxygen=yes
1113884bf8334Smrg   fi
1113984bf8334Smrgelif test "x$use_doxygen" = x"yes" ; then
1114084bf8334Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1114184bf8334Smrg   if test "x$DOXYGEN" = "x"; then
1114284bf8334Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
1114384bf8334Smrg   fi
1114484bf8334Smrg   have_doxygen=yes
1114584bf8334Smrgelif test "x$use_doxygen" = x"no" ; then
1114684bf8334Smrg   if test "x$DOXYGEN" != "x"; then
1114784bf8334Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
1114884bf8334Smrg   fi
1114984bf8334Smrg   have_doxygen=no
1115084bf8334Smrgelse
1115184bf8334Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
1115284bf8334Smrgfi
1115384bf8334Smrgm4_ifval([$1],
1115484bf8334Smrg[if test "$have_doxygen" = yes; then
1115584bf8334Smrg    # scrape the doxygen version
1115684bf8334Smrg    AC_MSG_CHECKING([the doxygen version])
1115784bf8334Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
1115884bf8334Smrg    AC_MSG_RESULT([$doxygen_version])
1115984bf8334Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
1116084bf8334Smrg        [if test "x$use_doxygen" = xauto; then
1116184bf8334Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
1116284bf8334Smrg            have_doxygen=no
1116384bf8334Smrg        else
1116484bf8334Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
1116584bf8334Smrg        fi])
1116684bf8334Smrgfi])
11167659607e0Smrg
1116884bf8334Smrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
1116984bf8334Smrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
1117084bf8334Smrgdnl 	HAVE_DOT = @HAVE_DOT@
1117184bf8334SmrgHAVE_DOT=no
1117284bf8334Smrgif test "x$have_doxygen" = "xyes"; then
1117384bf8334Smrg  AC_PATH_PROG([DOT], [dot])
1117484bf8334Smrg    if test "x$DOT" != "x"; then
1117584bf8334Smrg      HAVE_DOT=yes
1117684bf8334Smrg    fi
1117784bf8334Smrgfi
11178659607e0Smrg
1117984bf8334SmrgAC_SUBST([HAVE_DOT])
1118084bf8334SmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
1118184bf8334SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
1118284bf8334Smrg]) # XORG_WITH_DOXYGEN
11183659607e0Smrg
1118484bf8334Smrg# XORG_WITH_GROFF([DEFAULT])
1118584bf8334Smrg# ----------------
1118684bf8334Smrg# Minimum version: 1.6.0
1118784bf8334Smrg# Minimum version for optional DEFAULT argument: 1.11.0
11188a73597f9Smrg#
1118984bf8334Smrg# Documentation tools are not always available on all platforms and sometimes
1119084bf8334Smrg# not at the appropriate level. This macro enables a module to test for the
1119184bf8334Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1119284bf8334Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
1119384bf8334Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
1119484bf8334Smrg# --with-groff assumes 'auto'.
11195a73597f9Smrg#
1119684bf8334Smrg# Interface to module:
1119784bf8334Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
1119884bf8334Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
1119984bf8334Smrg# HAVE_GROFF_MS: the -ms macros package
1120084bf8334Smrg# GROFF:	 returns the path of the groff program found
1120184bf8334Smrg#		 returns the path set by the user in the environment
1120284bf8334Smrg# --with-groff:	 'yes' user instructs the module to use groff
1120384bf8334Smrg#		 'no' user instructs the module not to use groff
11204a73597f9Smrg#
1120584bf8334Smrg# Added in version 1.9.0:
1120684bf8334Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
1120784bf8334Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
1120884bf8334Smrg#		   psselect from the psutils package.
1120984bf8334Smrg#		   the ghostcript package. Refer to the grohtml man pages
11210a73597f9Smrg#
1121184bf8334Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
11212a73597f9Smrg#
1121384bf8334Smrg# OS and distros often splits groff in a basic and full package, the former
1121484bf8334Smrg# having the groff program and the later having devices, fonts and macros
1121584bf8334Smrg# Checking for the groff executable is not enough.
11216a73597f9Smrg#
1121784bf8334Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
1121884bf8334Smrg# unset HAVE_GROFF or GROFF env variables.
1121984bf8334Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
11220a73597f9Smrg#
1122184bf8334SmrgAC_DEFUN([XORG_WITH_GROFF],[
1122284bf8334SmrgAC_ARG_VAR([GROFF], [Path to groff command])
1122384bf8334Smrgm4_define([_defopt], m4_default([$1], [auto]))
1122484bf8334SmrgAC_ARG_WITH(groff,
1122584bf8334Smrg	AS_HELP_STRING([--with-groff],
1122684bf8334Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
1122784bf8334Smrg	   [use_groff=$withval], [use_groff=]_defopt)
1122884bf8334Smrgm4_undefine([_defopt])
11229659607e0Smrg
1123084bf8334Smrgif test "x$use_groff" = x"auto"; then
1123184bf8334Smrg   AC_PATH_PROG([GROFF], [groff])
1123284bf8334Smrg   if test "x$GROFF" = "x"; then
1123384bf8334Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
1123484bf8334Smrg	have_groff=no
1123584bf8334Smrg   else
1123684bf8334Smrg        have_groff=yes
1123784bf8334Smrg   fi
1123884bf8334Smrgelif test "x$use_groff" = x"yes" ; then
1123984bf8334Smrg   AC_PATH_PROG([GROFF], [groff])
1124084bf8334Smrg   if test "x$GROFF" = "x"; then
1124184bf8334Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
1124284bf8334Smrg   fi
1124384bf8334Smrg   have_groff=yes
1124484bf8334Smrgelif test "x$use_groff" = x"no" ; then
1124584bf8334Smrg   if test "x$GROFF" != "x"; then
1124684bf8334Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
1124784bf8334Smrg   fi
1124884bf8334Smrg   have_groff=no
11249a73597f9Smrgelse
1125084bf8334Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
11251a73597f9Smrgfi
112526aab59a7Smrg
1125384bf8334Smrg# We have groff, test for the presence of the macro packages
1125484bf8334Smrgif test "x$have_groff" = x"yes"; then
1125584bf8334Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
1125684bf8334Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
1125784bf8334Smrg        groff_ms_works=yes
1125884bf8334Smrg    else
1125984bf8334Smrg        groff_ms_works=no
11260a73597f9Smrg    fi
1126184bf8334Smrg    AC_MSG_RESULT([$groff_ms_works])
1126284bf8334Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
1126384bf8334Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
1126484bf8334Smrg        groff_mm_works=yes
1126584bf8334Smrg    else
1126684bf8334Smrg        groff_mm_works=no
1126784bf8334Smrg    fi
1126884bf8334Smrg    AC_MSG_RESULT([$groff_mm_works])
11269a73597f9Smrgfi
11270fc27e79cSmrg
1127184bf8334Smrg# We have groff, test for HTML dependencies, one command per package
1127284bf8334Smrgif test "x$have_groff" = x"yes"; then
1127384bf8334Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
1127484bf8334Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
1127584bf8334Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
1127684bf8334Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
1127784bf8334Smrg      have_groff_html=yes
1127884bf8334Smrg   else
1127984bf8334Smrg      have_groff_html=no
1128084bf8334Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
1128184bf8334Smrg   fi
1128284bf8334Smrgfi
11283a73597f9Smrg
1128484bf8334Smrg# Set Automake conditionals for Makefiles
1128584bf8334SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
1128684bf8334SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
1128784bf8334SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
1128884bf8334SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
1128984bf8334Smrg]) # XORG_WITH_GROFF
11290b73be646Smrg
1129184bf8334Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
1129284bf8334Smrg# ---------------------------------------
1129384bf8334Smrg# Minimum version: 1.6.0
1129484bf8334Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1129584bf8334Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
1129684bf8334Smrg#
1129784bf8334Smrg# Documentation tools are not always available on all platforms and sometimes
1129884bf8334Smrg# not at the appropriate level. This macro enables a module to test for the
1129984bf8334Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1130084bf8334Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
1130184bf8334Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
1130284bf8334Smrg# --with-fop assumes 'auto'.
1130384bf8334Smrg#
1130484bf8334Smrg# Interface to module:
1130584bf8334Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
1130684bf8334Smrg# FOP:	 	returns the path of the fop program found
1130784bf8334Smrg#		returns the path set by the user in the environment
1130884bf8334Smrg# --with-fop: 	'yes' user instructs the module to use fop
1130984bf8334Smrg#		'no' user instructs the module not to use fop
1131084bf8334Smrg#
1131184bf8334Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
1131284bf8334Smrg#
1131384bf8334SmrgAC_DEFUN([XORG_WITH_FOP],[
1131484bf8334SmrgAC_ARG_VAR([FOP], [Path to fop command])
1131584bf8334Smrgm4_define([_defopt], m4_default([$2], [auto]))
1131684bf8334SmrgAC_ARG_WITH(fop,
1131784bf8334Smrg	AS_HELP_STRING([--with-fop],
1131884bf8334Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
1131984bf8334Smrg	   [use_fop=$withval], [use_fop=]_defopt)
1132084bf8334Smrgm4_undefine([_defopt])
11321b73be646Smrg
1132284bf8334Smrgif test "x$use_fop" = x"auto"; then
1132384bf8334Smrg   AC_PATH_PROG([FOP], [fop])
1132484bf8334Smrg   if test "x$FOP" = "x"; then
1132584bf8334Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
1132684bf8334Smrg	have_fop=no
1132784bf8334Smrg   else
1132884bf8334Smrg        have_fop=yes
1132984bf8334Smrg   fi
1133084bf8334Smrgelif test "x$use_fop" = x"yes" ; then
1133184bf8334Smrg   AC_PATH_PROG([FOP], [fop])
1133284bf8334Smrg   if test "x$FOP" = "x"; then
1133384bf8334Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
1133484bf8334Smrg   fi
1133584bf8334Smrg   have_fop=yes
1133684bf8334Smrgelif test "x$use_fop" = x"no" ; then
1133784bf8334Smrg   if test "x$FOP" != "x"; then
1133884bf8334Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
1133984bf8334Smrg   fi
1134084bf8334Smrg   have_fop=no
1134184bf8334Smrgelse
1134284bf8334Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
11343a73597f9Smrgfi
11344b73be646Smrg
1134584bf8334Smrg# Test for a minimum version of fop, if provided.
1134684bf8334Smrgm4_ifval([$1],
1134784bf8334Smrg[if test "$have_fop" = yes; then
1134884bf8334Smrg    # scrape the fop version
1134984bf8334Smrg    AC_MSG_CHECKING([for fop minimum version])
1135084bf8334Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
1135184bf8334Smrg    AC_MSG_RESULT([$fop_version])
1135284bf8334Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
1135384bf8334Smrg        [if test "x$use_fop" = xauto; then
1135484bf8334Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
1135584bf8334Smrg            have_fop=no
1135684bf8334Smrg        else
1135784bf8334Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
1135884bf8334Smrg        fi])
1135984bf8334Smrgfi])
1136084bf8334SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
1136184bf8334Smrg]) # XORG_WITH_FOP
11362b73be646Smrg
1136384bf8334Smrg# XORG_WITH_M4([MIN-VERSION])
1136484bf8334Smrg# ---------------------------
1136584bf8334Smrg# Minimum version: 1.19.0
11366a73597f9Smrg#
1136784bf8334Smrg# This macro attempts to locate an m4 macro processor which supports
1136884bf8334Smrg# -I option and is only useful for modules relying on M4 in order to
1136984bf8334Smrg# expand macros in source code files.
1137084bf8334Smrg#
1137184bf8334Smrg# Interface to module:
1137284bf8334Smrg# M4:	 	returns the path of the m4 program found
1137384bf8334Smrg#		returns the path set by the user in the environment
1137484bf8334Smrg#
1137584bf8334SmrgAC_DEFUN([XORG_WITH_M4], [
1137684bf8334SmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
1137784bf8334Smrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
1137884bf8334Smrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
1137984bf8334Smrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
1138084bf8334Smrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
1138184bf8334Smrg   [$PATH:/usr/gnu/bin])])
11382b73be646Smrg
1138384bf8334SmrgAC_SUBST([M4], [$ac_cv_path_M4])
1138484bf8334Smrg]) # XORG_WITH_M4
11385659607e0Smrg
1138684bf8334Smrg# XORG_WITH_PS2PDF([DEFAULT])
1138784bf8334Smrg# ----------------
1138884bf8334Smrg# Minimum version: 1.6.0
1138984bf8334Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1139084bf8334Smrg#
1139184bf8334Smrg# Documentation tools are not always available on all platforms and sometimes
1139284bf8334Smrg# not at the appropriate level. This macro enables a module to test for the
1139384bf8334Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1139484bf8334Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
1139584bf8334Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
1139684bf8334Smrg# --with-ps2pdf assumes 'auto'.
1139784bf8334Smrg#
1139884bf8334Smrg# Interface to module:
1139984bf8334Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
1140084bf8334Smrg# PS2PDF:	returns the path of the ps2pdf program found
1140184bf8334Smrg#		returns the path set by the user in the environment
1140284bf8334Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
1140384bf8334Smrg#		 'no' user instructs the module not to use ps2pdf
1140484bf8334Smrg#
1140584bf8334Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
1140684bf8334Smrg#
1140784bf8334SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
1140884bf8334SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
1140984bf8334Smrgm4_define([_defopt], m4_default([$1], [auto]))
1141084bf8334SmrgAC_ARG_WITH(ps2pdf,
1141184bf8334Smrg	AS_HELP_STRING([--with-ps2pdf],
1141284bf8334Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
1141384bf8334Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
1141484bf8334Smrgm4_undefine([_defopt])
11415659607e0Smrg
1141684bf8334Smrgif test "x$use_ps2pdf" = x"auto"; then
1141784bf8334Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1141884bf8334Smrg   if test "x$PS2PDF" = "x"; then
1141984bf8334Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
1142084bf8334Smrg	have_ps2pdf=no
1142184bf8334Smrg   else
1142284bf8334Smrg        have_ps2pdf=yes
1142384bf8334Smrg   fi
1142484bf8334Smrgelif test "x$use_ps2pdf" = x"yes" ; then
1142584bf8334Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1142684bf8334Smrg   if test "x$PS2PDF" = "x"; then
1142784bf8334Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
1142884bf8334Smrg   fi
1142984bf8334Smrg   have_ps2pdf=yes
1143084bf8334Smrgelif test "x$use_ps2pdf" = x"no" ; then
1143184bf8334Smrg   if test "x$PS2PDF" != "x"; then
1143284bf8334Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
1143384bf8334Smrg   fi
1143484bf8334Smrg   have_ps2pdf=no
1143584bf8334Smrgelse
1143684bf8334Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
1143784bf8334Smrgfi
1143884bf8334SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
1143984bf8334Smrg]) # XORG_WITH_PS2PDF
11440659607e0Smrg
1144184bf8334Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
1144284bf8334Smrg# ----------------
1144384bf8334Smrg# Minimum version: 1.6.0
11444a73597f9Smrg#
1144584bf8334Smrg# Documentation tools are not always available on all platforms and sometimes
1144684bf8334Smrg# not at the appropriate level. This macro enables a builder to skip all
1144784bf8334Smrg# documentation targets except traditional man pages.
1144884bf8334Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1144984bf8334Smrg# maximum flexibilty in controlling documentation building.
1145084bf8334Smrg# Refer to:
1145184bf8334Smrg# XORG_WITH_XMLTO         --with-xmlto
1145284bf8334Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1145384bf8334Smrg# XORG_WITH_DOXYGEN       --with-doxygen
1145484bf8334Smrg# XORG_WITH_FOP           --with-fop
1145584bf8334Smrg# XORG_WITH_GROFF         --with-groff
1145684bf8334Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
1145784bf8334Smrg#
1145884bf8334Smrg# Interface to module:
1145984bf8334Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
1146084bf8334Smrg# --enable-docs: 'yes' user instructs the module to generate docs
1146184bf8334Smrg#		 'no' user instructs the module not to generate docs
1146284bf8334Smrg# parm1:	specify the default value, yes or no.
1146384bf8334Smrg#
1146484bf8334SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
1146584bf8334Smrgm4_define([docs_default], m4_default([$1], [yes]))
1146684bf8334SmrgAC_ARG_ENABLE(docs,
1146784bf8334Smrg	AS_HELP_STRING([--enable-docs],
1146884bf8334Smrg	   [Enable building the documentation (default: ]docs_default[)]),
1146984bf8334Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
1147084bf8334Smrgm4_undefine([docs_default])
1147184bf8334SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
1147284bf8334SmrgAC_MSG_CHECKING([whether to build documentation])
1147384bf8334SmrgAC_MSG_RESULT([$build_docs])
1147484bf8334Smrg]) # XORG_ENABLE_DOCS
11475659607e0Smrg
1147684bf8334Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
1147784bf8334Smrg# ----------------
1147884bf8334Smrg# Minimum version: 1.6.0
11479a73597f9Smrg#
1148084bf8334Smrg# This macro enables a builder to skip all developer documentation.
1148184bf8334Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1148284bf8334Smrg# maximum flexibilty in controlling documentation building.
1148384bf8334Smrg# Refer to:
1148484bf8334Smrg# XORG_WITH_XMLTO         --with-xmlto
1148584bf8334Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1148684bf8334Smrg# XORG_WITH_DOXYGEN       --with-doxygen
1148784bf8334Smrg# XORG_WITH_FOP           --with-fop
1148884bf8334Smrg# XORG_WITH_GROFF         --with-groff
1148984bf8334Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
1149084bf8334Smrg#
1149184bf8334Smrg# Interface to module:
1149284bf8334Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
1149384bf8334Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
1149484bf8334Smrg#			'no' user instructs the module not to generate developer docs
1149584bf8334Smrg# parm1:		specify the default value, yes or no.
1149684bf8334Smrg#
1149784bf8334SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
1149884bf8334Smrgm4_define([devel_default], m4_default([$1], [yes]))
1149984bf8334SmrgAC_ARG_ENABLE(devel-docs,
1150084bf8334Smrg	AS_HELP_STRING([--enable-devel-docs],
1150184bf8334Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
1150284bf8334Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
1150384bf8334Smrgm4_undefine([devel_default])
1150484bf8334SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
1150584bf8334SmrgAC_MSG_CHECKING([whether to build developer documentation])
1150684bf8334SmrgAC_MSG_RESULT([$build_devel_docs])
1150784bf8334Smrg]) # XORG_ENABLE_DEVEL_DOCS
11508659607e0Smrg
1150984bf8334Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
1151084bf8334Smrg# ----------------
1151184bf8334Smrg# Minimum version: 1.6.0
1151284bf8334Smrg#
1151384bf8334Smrg# This macro enables a builder to skip all functional specification targets.
1151484bf8334Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1151584bf8334Smrg# maximum flexibilty in controlling documentation building.
1151684bf8334Smrg# Refer to:
1151784bf8334Smrg# XORG_WITH_XMLTO         --with-xmlto
1151884bf8334Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1151984bf8334Smrg# XORG_WITH_DOXYGEN       --with-doxygen
1152084bf8334Smrg# XORG_WITH_FOP           --with-fop
1152184bf8334Smrg# XORG_WITH_GROFF         --with-groff
1152284bf8334Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
1152384bf8334Smrg#
1152484bf8334Smrg# Interface to module:
1152584bf8334Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
1152684bf8334Smrg# --enable-specs:	'yes' user instructs the module to generate specs
1152784bf8334Smrg#			'no' user instructs the module not to generate specs
1152884bf8334Smrg# parm1:		specify the default value, yes or no.
1152984bf8334Smrg#
1153084bf8334SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
1153184bf8334Smrgm4_define([spec_default], m4_default([$1], [yes]))
1153284bf8334SmrgAC_ARG_ENABLE(specs,
1153384bf8334Smrg	AS_HELP_STRING([--enable-specs],
1153484bf8334Smrg	   [Enable building the specs (default: ]spec_default[)]),
1153584bf8334Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
1153684bf8334Smrgm4_undefine([spec_default])
1153784bf8334SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
1153884bf8334SmrgAC_MSG_CHECKING([whether to build functional specifications])
1153984bf8334SmrgAC_MSG_RESULT([$build_specs])
1154084bf8334Smrg]) # XORG_ENABLE_SPECS
11541b73be646Smrg
1154284bf8334Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
1154384bf8334Smrg# ----------------------------------------------
1154484bf8334Smrg# Minimum version: 1.13.0
1154584bf8334Smrg#
1154684bf8334Smrg# This macro enables a builder to enable/disable unit testing
1154784bf8334Smrg# It makes no assumption about the test cases implementation
1154884bf8334Smrg# Test cases may or may not use Automake "Support for test suites"
1154984bf8334Smrg# They may or may not use the software utility library GLib
1155084bf8334Smrg#
1155184bf8334Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
1155284bf8334Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
1155384bf8334Smrg# The variable enable_unit_tests is used by other macros in this file.
1155484bf8334Smrg#
1155584bf8334Smrg# Interface to module:
1155684bf8334Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
1155784bf8334Smrg# enable_unit_tests:    used in configure.ac for additional configuration
1155884bf8334Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
1155984bf8334Smrg#			'no' user instructs the module not to build tests
1156084bf8334Smrg# parm1:		specify the default value, yes or no.
1156184bf8334Smrg#
1156284bf8334SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
1156384bf8334SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
1156484bf8334SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
1156584bf8334SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
1156684bf8334Smrgm4_define([_defopt], m4_default([$1], [auto]))
1156784bf8334SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
1156884bf8334Smrg	[Enable building unit test cases (default: ]_defopt[)]),
1156984bf8334Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
1157084bf8334Smrgm4_undefine([_defopt])
1157184bf8334SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
1157284bf8334SmrgAC_MSG_CHECKING([whether to build unit test cases])
1157384bf8334SmrgAC_MSG_RESULT([$enable_unit_tests])
1157484bf8334Smrg]) # XORG_ENABLE_UNIT_TESTS
11575659607e0Smrg
1157684bf8334Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
1157784bf8334Smrg# ------------------------------------------------------
1157884bf8334Smrg# Minimum version: 1.17.0
1157984bf8334Smrg#
1158084bf8334Smrg# This macro enables a builder to enable/disable integration testing
1158184bf8334Smrg# It makes no assumption about the test cases' implementation
1158284bf8334Smrg# Test cases may or may not use Automake "Support for test suites"
1158384bf8334Smrg#
1158484bf8334Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
1158584bf8334Smrg# usually requires less dependencies and may be built and run under less
1158684bf8334Smrg# stringent environments than integration tests.
1158784bf8334Smrg#
1158884bf8334Smrg# Interface to module:
1158984bf8334Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
1159084bf8334Smrg# enable_integration_tests:   used in configure.ac for additional configuration
1159184bf8334Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
1159284bf8334Smrg#                             'no' user instructs the module not to build tests
1159384bf8334Smrg# parm1:                      specify the default value, yes or no.
1159484bf8334Smrg#
1159584bf8334SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
1159684bf8334SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
1159784bf8334Smrgm4_define([_defopt], m4_default([$1], [auto]))
1159884bf8334SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
1159984bf8334Smrg	[Enable building integration test cases (default: ]_defopt[)]),
1160084bf8334Smrg	[enable_integration_tests=$enableval],
1160184bf8334Smrg	[enable_integration_tests=]_defopt)
1160284bf8334Smrgm4_undefine([_defopt])
1160384bf8334SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
1160484bf8334Smrg	[test "x$enable_integration_tests" != xno])
1160584bf8334SmrgAC_MSG_CHECKING([whether to build unit test cases])
1160684bf8334SmrgAC_MSG_RESULT([$enable_integration_tests])
1160784bf8334Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
11608659607e0Smrg
1160984bf8334Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
1161084bf8334Smrg# ----------------------------------------
1161184bf8334Smrg# Minimum version: 1.13.0
1161284bf8334Smrg#
1161384bf8334Smrg# GLib is a library which provides advanced data structures and functions.
1161484bf8334Smrg# This macro enables a module to test for the presence of Glib.
1161584bf8334Smrg#
1161684bf8334Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
1161784bf8334Smrg# Otherwise the value of $enable_unit_tests is blank.
1161884bf8334Smrg#
1161984bf8334Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
1162084bf8334Smrg# test support usually requires less dependencies and may be built and run under
1162184bf8334Smrg# less stringent environments than integration tests.
1162284bf8334Smrg#
1162384bf8334Smrg# Interface to module:
1162484bf8334Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
1162584bf8334Smrg# with_glib: used in configure.ac to know if GLib has been found
1162684bf8334Smrg# --with-glib:	'yes' user instructs the module to use glib
1162784bf8334Smrg#		'no' user instructs the module not to use glib
1162884bf8334Smrg#
1162984bf8334SmrgAC_DEFUN([XORG_WITH_GLIB],[
1163084bf8334SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
1163184bf8334Smrgm4_define([_defopt], m4_default([$2], [auto]))
1163284bf8334SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
1163384bf8334Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
1163484bf8334Smrg	[with_glib=$withval], [with_glib=]_defopt)
1163584bf8334Smrgm4_undefine([_defopt])
11636659607e0Smrg
1163784bf8334Smrghave_glib=no
1163884bf8334Smrg# Do not probe GLib if user explicitly disabled unit testing
1163984bf8334Smrgif test "x$enable_unit_tests" != x"no"; then
1164084bf8334Smrg  # Do not probe GLib if user explicitly disabled it
1164184bf8334Smrg  if test "x$with_glib" != x"no"; then
1164284bf8334Smrg    m4_ifval(
1164384bf8334Smrg      [$1],
1164484bf8334Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
1164584bf8334Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
1164684bf8334Smrg    )
1164784bf8334Smrg  fi
1164884bf8334Smrgfi
11649659607e0Smrg
1165084bf8334Smrg# Not having GLib when unit testing has been explicitly requested is an error
1165184bf8334Smrgif test "x$enable_unit_tests" = x"yes"; then
1165284bf8334Smrg  if test "x$have_glib" = x"no"; then
1165384bf8334Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1165484bf8334Smrg  fi
1165584bf8334Smrgfi
11656659607e0Smrg
1165784bf8334Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
1165884bf8334Smrgif test "x$enable_unit_tests" = x"no"; then
1165984bf8334Smrg  if test "x$with_glib" = x"yes"; then
1166084bf8334Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1166184bf8334Smrg  fi
1166284bf8334Smrgfi
11663659607e0Smrg
1166484bf8334Smrg# Not having GLib when it has been explicitly requested is an error
1166584bf8334Smrgif test "x$with_glib" = x"yes"; then
1166684bf8334Smrg  if test "x$have_glib" = x"no"; then
1166784bf8334Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
1166884bf8334Smrg  fi
1166984bf8334Smrgfi
11670659607e0Smrg
1167184bf8334SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
1167284bf8334Smrg]) # XORG_WITH_GLIB
1167384bf8334Smrg
1167484bf8334Smrg# XORG_LD_WRAP([required|optional])
1167584bf8334Smrg# ---------------------------------
1167684bf8334Smrg# Minimum version: 1.13.0
11677a73597f9Smrg#
1167884bf8334Smrg# Check if linker supports -wrap, passed via compiler flags
1167984bf8334Smrg#
1168084bf8334Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
1168184bf8334Smrg# Otherwise the value of $enable_unit_tests is blank.
1168284bf8334Smrg#
1168384bf8334Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
1168484bf8334Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
1168584bf8334Smrg# available, an argument of "optional" allows use when some unit tests require
1168684bf8334Smrg# ld -wrap and others do not.
1168784bf8334Smrg#
1168884bf8334SmrgAC_DEFUN([XORG_LD_WRAP],[
1168984bf8334SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
1169084bf8334Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
1169184bf8334Smrg                      void __wrap_exit(int status) { return; }],
1169284bf8334Smrg                     [exit(0);])])
1169384bf8334Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
1169484bf8334Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
1169584bf8334Smrg  if test "x$have_ld_wrap" = x"no"; then
1169684bf8334Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
1169784bf8334Smrg  fi
1169884bf8334Smrgfi
1169984bf8334SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
1170084bf8334Smrg#
1170184bf8334Smrg]) # XORG_LD_WRAP
1170284bf8334Smrg
1170384bf8334Smrg# XORG_CHECK_LINKER_FLAGS
1170484bf8334Smrg# -----------------------
1170584bf8334Smrg# SYNOPSIS
1170684bf8334Smrg#
1170784bf8334Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
1170884bf8334Smrg#
1170984bf8334Smrg# DESCRIPTION
1171084bf8334Smrg#
1171184bf8334Smrg#   Check whether the given linker FLAGS work with the current language's
1171284bf8334Smrg#   linker, or whether they give an error.
1171384bf8334Smrg#
1171484bf8334Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
1171584bf8334Smrg#   success/failure.
1171684bf8334Smrg#
1171784bf8334Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
1171884bf8334Smrg#
1171984bf8334Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
1172084bf8334Smrg#
1172184bf8334Smrg# LICENSE
1172284bf8334Smrg#
1172384bf8334Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
1172484bf8334Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
1172584bf8334Smrg#   Copyright (c) 2009 Matteo Frigo
1172684bf8334Smrg#
1172784bf8334Smrg#   This program is free software: you can redistribute it and/or modify it
1172884bf8334Smrg#   under the terms of the GNU General Public License as published by the
1172984bf8334Smrg#   Free Software Foundation, either version 3 of the License, or (at your
1173084bf8334Smrg#   option) any later version.
1173184bf8334Smrg#
1173284bf8334Smrg#   This program is distributed in the hope that it will be useful, but
1173384bf8334Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
1173484bf8334Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
1173584bf8334Smrg#   Public License for more details.
1173684bf8334Smrg#
1173784bf8334Smrg#   You should have received a copy of the GNU General Public License along
1173884bf8334Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
1173984bf8334Smrg#
1174084bf8334Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
1174184bf8334Smrg#   gives unlimited permission to copy, distribute and modify the configure
1174284bf8334Smrg#   scripts that are the output of Autoconf when processing the Macro. You
1174384bf8334Smrg#   need not follow the terms of the GNU General Public License when using
1174484bf8334Smrg#   or distributing such scripts, even though portions of the text of the
1174584bf8334Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
1174684bf8334Smrg#   all other use of the material that constitutes the Autoconf Macro.
1174784bf8334Smrg#
1174884bf8334Smrg#   This special exception to the GPL applies to versions of the Autoconf
1174984bf8334Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
1175084bf8334Smrg#   modified version of the Autoconf Macro, you may extend this special
1175184bf8334Smrg#   exception to the GPL to apply to your modified version as well.#
1175284bf8334SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
1175384bf8334Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
1175484bf8334Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
1175584bf8334SmrgAS_LITERAL_IF([$1],
1175684bf8334Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
1175784bf8334Smrg      ax_save_FLAGS=$LDFLAGS
1175884bf8334Smrg      LDFLAGS="$1"
1175984bf8334Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
1176084bf8334Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1176184bf8334Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1176284bf8334Smrg      LDFLAGS=$ax_save_FLAGS])],
1176384bf8334Smrg  [ax_save_FLAGS=$LDFLAGS
1176484bf8334Smrg   LDFLAGS="$1"
1176584bf8334Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
1176684bf8334Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1176784bf8334Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1176884bf8334Smrg   LDFLAGS=$ax_save_FLAGS])
1176984bf8334Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
1177084bf8334SmrgAC_MSG_RESULT($xorg_check_linker_flags)
1177184bf8334Smrgif test "x$xorg_check_linker_flags" = xyes; then
1177284bf8334Smrg	m4_default([$2], :)
1177384bf8334Smrgelse
1177484bf8334Smrg	m4_default([$3], :)
1177584bf8334Smrgfi
1177684bf8334Smrg]) # XORG_CHECK_LINKER_FLAGS
11777659607e0Smrg
1177884bf8334Smrg# XORG_MEMORY_CHECK_FLAGS
1177984bf8334Smrg# -----------------------
1178084bf8334Smrg# Minimum version: 1.16.0
1178184bf8334Smrg#
1178284bf8334Smrg# This macro attempts to find appropriate memory checking functionality
1178384bf8334Smrg# for various platforms which unit testing code may use to catch various
1178484bf8334Smrg# forms of memory allocation and access errors in testing.
1178584bf8334Smrg#
1178684bf8334Smrg# Interface to module:
1178784bf8334Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
1178884bf8334Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
1178984bf8334Smrg#
1179084bf8334Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
1179184bf8334Smrg#
1179284bf8334SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
11793659607e0Smrg
1179484bf8334SmrgAC_REQUIRE([AC_CANONICAL_HOST])
1179584bf8334SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
1179684bf8334Smrg           [Environment variables to enable memory checking in tests])
1179784bf8334Smrg
1179884bf8334Smrg# Check for different types of support on different platforms
1179984bf8334Smrgcase $host_os in
1180084bf8334Smrg    solaris*)
1180184bf8334Smrg        AC_CHECK_LIB([umem], [umem_alloc],
1180284bf8334Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
1180384bf8334Smrg        ;;
1180484bf8334Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
1180584bf8334Smrg        # both directly and inverted, so should not be 0 or 255.
1180684bf8334Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
1180784bf8334Smrg        ;;
1180884bf8334Smrg    darwin*)
1180984bf8334Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
1181084bf8334Smrg        ;;
1181184bf8334Smrg    *bsd*)
1181284bf8334Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
1181384bf8334Smrg        ;;
1181484bf8334Smrgesac
1181584bf8334Smrg
1181684bf8334Smrg# User supplied flags override default flags
1181784bf8334Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
1181884bf8334Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
11819a73597f9Smrgfi
11820659607e0Smrg
1182184bf8334SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
1182284bf8334Smrg]) # XORG_WITH_LINT
1182384bf8334Smrg
1182484bf8334Smrg# XORG_CHECK_MALLOC_ZERO
1182584bf8334Smrg# ----------------------
1182684bf8334Smrg# Minimum version: 1.0.0
11827a73597f9Smrg#
1182884bf8334Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
1182984bf8334Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
1183084bf8334Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
1183184bf8334SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
1183284bf8334SmrgAC_ARG_ENABLE(malloc0returnsnull,
1183384bf8334Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
1183484bf8334Smrg		       [malloc(0) returns NULL (default: auto)]),
1183584bf8334Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
1183684bf8334Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
11837659607e0Smrg
1183884bf8334SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
1183984bf8334Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1184084bf8334SmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
1184184bf8334Smrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
1184284bf8334Smrg#include <stdlib.h>
1184384bf8334Smrg],[
1184484bf8334Smrg    char *m0, *r0, *c0, *p;
1184584bf8334Smrg    m0 = malloc(0);
1184684bf8334Smrg    p = malloc(10);
1184784bf8334Smrg    r0 = realloc(p,0);
1184884bf8334Smrg    c0 = calloc(0,10);
1184984bf8334Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
1185084bf8334Smrg])],
1185184bf8334Smrg		[xorg_cv_malloc0_returns_null=yes],
1185284bf8334Smrg		[xorg_cv_malloc0_returns_null=no])])
1185384bf8334SmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
1185484bf8334Smrgfi
1185584bf8334SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
11856659607e0Smrg
1185784bf8334Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
1185884bf8334Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
1185984bf8334Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
1186084bf8334Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
11861a73597f9Smrgelse
1186284bf8334Smrg	MALLOC_ZERO_CFLAGS=""
1186384bf8334Smrg	XMALLOC_ZERO_CFLAGS=""
1186484bf8334Smrg	XTMALLOC_ZERO_CFLAGS=""
11865a73597f9Smrgfi
11866659607e0Smrg
1186784bf8334SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
1186884bf8334SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
1186984bf8334SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
1187084bf8334Smrg]) # XORG_CHECK_MALLOC_ZERO
11871659607e0Smrg
1187284bf8334Smrg# XORG_WITH_LINT()
1187384bf8334Smrg# ----------------
1187484bf8334Smrg# Minimum version: 1.1.0
11875b73be646Smrg#
1187684bf8334Smrg# This macro enables the use of a tool that flags some suspicious and
1187784bf8334Smrg# non-portable constructs (likely to be bugs) in C language source code.
1187884bf8334Smrg# It will attempt to locate the tool and use appropriate options.
1187984bf8334Smrg# There are various lint type tools on different platforms.
1188084bf8334Smrg#
1188184bf8334Smrg# Interface to module:
1188284bf8334Smrg# LINT:		returns the path to the tool found on the platform
1188384bf8334Smrg#		or the value set to LINT on the configure cmd line
1188484bf8334Smrg#		also an Automake conditional
1188584bf8334Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
1188684bf8334Smrg#
1188784bf8334Smrg# --with-lint:	'yes' user instructs the module to use lint
1188884bf8334Smrg#		'no' user instructs the module not to use lint (default)
1188984bf8334Smrg#
1189084bf8334Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
1189184bf8334Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
1189284bf8334Smrg#
1189384bf8334SmrgAC_DEFUN([XORG_WITH_LINT],[
11894659607e0Smrg
1189584bf8334SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
1189684bf8334SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
1189784bf8334SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
1189884bf8334Smrg		[Use a lint-style source code checker (default: disabled)])],
1189984bf8334Smrg		[use_lint=$withval], [use_lint=no])
11900659607e0Smrg
1190184bf8334Smrg# Obtain platform specific info like program name and options
1190284bf8334Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
1190384bf8334Smrgcase $host_os in
1190484bf8334Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
1190584bf8334Smrg	lint_name=splint
1190684bf8334Smrg	lint_options="-badflag"
1190784bf8334Smrg	;;
1190884bf8334Smrg  *freebsd* | *netbsd*)
1190984bf8334Smrg	lint_name=lint
1191084bf8334Smrg	lint_options="-u -b"
1191184bf8334Smrg	;;
1191284bf8334Smrg  *solaris*)
1191384bf8334Smrg	lint_name=lint
1191484bf8334Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
1191584bf8334Smrg	;;
11916a73597f9Smrgesac
1191784bf8334Smrg
1191884bf8334Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
1191984bf8334Smrgif test "x$use_lint" = x"yes" ; then
1192084bf8334Smrg   AC_PATH_PROG([LINT], [$lint_name])
1192184bf8334Smrg   if test "x$LINT" = "x"; then
1192284bf8334Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
1192384bf8334Smrg   fi
1192484bf8334Smrgelif test "x$use_lint" = x"no" ; then
1192584bf8334Smrg   if test "x$LINT" != "x"; then
1192684bf8334Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
1192784bf8334Smrg   fi
1192884bf8334Smrgelse
1192984bf8334Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
11930a73597f9Smrgfi
11931659607e0Smrg
1193284bf8334Smrg# User supplied flags override default flags
1193384bf8334Smrgif test "x$LINT_FLAGS" != "x"; then
1193484bf8334Smrg   lint_options=$LINT_FLAGS
1193584bf8334Smrgfi
11936659607e0Smrg
1193784bf8334SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
1193884bf8334SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
11939659607e0Smrg
1194084bf8334Smrg]) # XORG_WITH_LINT
119416aab59a7Smrg
1194284bf8334Smrg# XORG_LINT_LIBRARY(LIBNAME)
1194384bf8334Smrg# --------------------------
1194484bf8334Smrg# Minimum version: 1.1.0
1194584bf8334Smrg#
1194684bf8334Smrg# Sets up flags for building lint libraries for checking programs that call
1194784bf8334Smrg# functions in the library.
1194884bf8334Smrg#
1194984bf8334Smrg# Interface to module:
1195084bf8334Smrg# LINTLIB		- Automake variable with the name of lint library file to make
1195184bf8334Smrg# MAKE_LINT_LIB		- Automake conditional
1195284bf8334Smrg#
1195384bf8334Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
1195484bf8334Smrg#			  - 'no' user instructs the module not to create a lint library (default)
11955659607e0Smrg
1195684bf8334SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
1195784bf8334SmrgAC_REQUIRE([XORG_WITH_LINT])
1195884bf8334SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
1195984bf8334Smrg	[Create lint library (default: disabled)])],
1196084bf8334Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
11961659607e0Smrg
1196284bf8334Smrgif test "x$make_lint_lib" = x"yes" ; then
1196384bf8334Smrg   LINTLIB=llib-l$1.ln
1196484bf8334Smrg   if test "x$LINT" = "x"; then
1196584bf8334Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
1196684bf8334Smrg   fi
1196784bf8334Smrgelif test "x$make_lint_lib" != x"no" ; then
1196884bf8334Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
11969a73597f9Smrgfi
11970659607e0Smrg
1197184bf8334SmrgAC_SUBST(LINTLIB)
1197284bf8334SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
1197384bf8334Smrg
1197484bf8334Smrg]) # XORG_LINT_LIBRARY
11975659607e0Smrg
1197684bf8334Smrg# XORG_COMPILER_BRAND
1197784bf8334Smrg# -------------------
1197884bf8334Smrg# Minimum version: 1.14.0
11979a73597f9Smrg#
1198084bf8334Smrg# Checks for various brands of compilers and sets flags as appropriate:
1198184bf8334Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
1198284bf8334Smrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
1198384bf8334Smrg#   clang compiler - sets CLANGCC to "yes"
1198484bf8334Smrg#   Intel compiler - sets INTELCC to "yes"
1198584bf8334Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
1198684bf8334Smrg#
1198784bf8334SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
1198884bf8334SmrgAC_LANG_CASE(
1198984bf8334Smrg	[C], [
1199084bf8334Smrg		AC_REQUIRE([AC_PROG_CC_C99])
1199184bf8334Smrg	],
1199284bf8334Smrg	[C++], [
1199384bf8334Smrg		AC_REQUIRE([AC_PROG_CXX])
1199484bf8334Smrg	]
1199584bf8334Smrg)
1199684bf8334SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
1199784bf8334SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
1199884bf8334SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
1199984bf8334Smrg]) # XORG_COMPILER_BRAND
1200084bf8334Smrg
1200184bf8334Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
1200284bf8334Smrg# ---------------
1200384bf8334Smrg# Minimum version: 1.16.0
1200484bf8334Smrg#
1200584bf8334Smrg# Test if the compiler works when passed the given flag as a command line argument.
1200684bf8334Smrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
1200784bf8334Smrg# next flag in the list until there are no more options.
1200884bf8334Smrg#
1200984bf8334Smrg# Note that this does not guarantee that the compiler supports the flag as some
1201084bf8334Smrg# compilers will simply ignore arguments that they do not understand, but we do
1201184bf8334Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
1201284bf8334Smrg# -Werror=unused-command-line-argument
1201384bf8334Smrg#
1201484bf8334SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
1201584bf8334Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
1201684bf8334Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
1201784bf8334Smrg
1201884bf8334SmrgAC_LANG_COMPILER_REQUIRE
1201984bf8334Smrg
1202084bf8334SmrgAC_LANG_CASE(
1202184bf8334Smrg	[C], [
1202284bf8334Smrg		AC_REQUIRE([AC_PROG_CC_C99])
1202384bf8334Smrg		define([PREFIX], [C])
1202484bf8334Smrg		define([CACHE_PREFIX], [cc])
1202584bf8334Smrg		define([COMPILER], [$CC])
1202684bf8334Smrg	],
1202784bf8334Smrg	[C++], [
1202884bf8334Smrg		define([PREFIX], [CXX])
1202984bf8334Smrg		define([CACHE_PREFIX], [cxx])
1203084bf8334Smrg		define([COMPILER], [$CXX])
1203184bf8334Smrg	]
1203284bf8334Smrg)
1203384bf8334Smrg
1203484bf8334Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
12035659607e0Smrg
1203684bf8334Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
1203784bf8334Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1203884bf8334Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
1203984bf8334Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
1204084bf8334Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1204184bf8334Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
1204284bf8334Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
1204384bf8334Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
1204484bf8334Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1204584bf8334Smrgfi
12046659607e0Smrg
1204784bf8334Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
1204884bf8334Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
1204984bf8334Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1205084bf8334Smrg	fi
1205184bf8334Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1205284bf8334Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
1205384bf8334Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
1205484bf8334Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
1205584bf8334Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
1205684bf8334Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
1205784bf8334Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
1205884bf8334Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
1205984bf8334Smrgfi
12060659607e0Smrg
1206184bf8334Smrgfound="no"
1206284bf8334Smrgm4_foreach([flag], m4_cdr($@), [
1206384bf8334Smrg	if test $found = "no" ; then
1206484bf8334Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
1206584bf8334Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
1206684bf8334Smrg		fi
12067659607e0Smrg
1206884bf8334Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
1206984bf8334Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
1207084bf8334Smrg		fi
120716aab59a7Smrg
1207284bf8334Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
120736aab59a7Smrg
1207484bf8334Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
1207584bf8334Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
1207684bf8334Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
1207784bf8334Smrg		AC_CACHE_VAL($cacheid,
1207884bf8334Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
1207984bf8334Smrg					     [eval $cacheid=yes],
1208084bf8334Smrg					     [eval $cacheid=no])])
12081659607e0Smrg
1208284bf8334Smrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
12083b73be646Smrg
1208484bf8334Smrg		eval supported=\$$cacheid
1208584bf8334Smrg		AC_MSG_RESULT([$supported])
1208684bf8334Smrg		if test "$supported" = "yes" ; then
1208784bf8334Smrg			$1="$$1 ]flag["
1208884bf8334Smrg			found="yes"
1208984bf8334Smrg		fi
1209084bf8334Smrg	fi
1209184bf8334Smrg])
1209284bf8334Smrg]) # XORG_TESTSET_CFLAG
12093b73be646Smrg
1209484bf8334Smrg# XORG_COMPILER_FLAGS
12095a73597f9Smrg# ---------------
1209684bf8334Smrg# Minimum version: 1.16.0
1209784bf8334Smrg#
1209884bf8334Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
1209984bf8334Smrg# arguments supported by the selected compiler which do NOT alter the generated
1210084bf8334Smrg# code.  These arguments will cause the compiler to print various warnings
1210184bf8334Smrg# during compilation AND turn a conservative set of warnings into errors.
1210284bf8334Smrg#
1210384bf8334Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
1210484bf8334Smrg# future versions of util-macros as options are added to new compilers.
1210584bf8334Smrg#
1210684bf8334SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
1210784bf8334SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
12108b73be646Smrg
1210984bf8334SmrgAC_ARG_ENABLE(selective-werror,
1211084bf8334Smrg              AS_HELP_STRING([--disable-selective-werror],
1211184bf8334Smrg                             [Turn off selective compiler errors. (default: enabled)]),
1211284bf8334Smrg              [SELECTIVE_WERROR=$enableval],
1211384bf8334Smrg              [SELECTIVE_WERROR=yes])
12114a73597f9Smrg
1211584bf8334SmrgAC_LANG_CASE(
1211684bf8334Smrg        [C], [
1211784bf8334Smrg                define([PREFIX], [C])
1211884bf8334Smrg        ],
1211984bf8334Smrg        [C++], [
1212084bf8334Smrg                define([PREFIX], [CXX])
1212184bf8334Smrg        ]
1212284bf8334Smrg)
1212384bf8334Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
1212484bf8334Smrgif test "x$SUNCC" = "xyes"; then
1212584bf8334Smrg    [BASE_]PREFIX[FLAGS]="-v"
12126a73597f9Smrgelse
1212784bf8334Smrg    [BASE_]PREFIX[FLAGS]=""
12128a73597f9Smrgfi
12129659607e0Smrg
1213084bf8334Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
1213184bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
1213284bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
1213384bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
1213484bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
12135fc27e79cSmrg
1213684bf8334SmrgAC_LANG_CASE(
1213784bf8334Smrg	[C], [
1213884bf8334Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
1213984bf8334Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
1214084bf8334Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
1214184bf8334Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
1214284bf8334Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
1214384bf8334Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
1214484bf8334Smrg	]
1214584bf8334Smrg)
12146b73be646Smrg
1214784bf8334Smrg# This chunk adds additional warnings that could catch undesired effects.
1214884bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
1214984bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
1215084bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
1215184bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
1215284bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
1215384bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
1215484bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
1215584bf8334Smrg
1215684bf8334Smrg# These are currently disabled because they are noisy.  They will be enabled
1215784bf8334Smrg# in the future once the codebase is sufficiently modernized to silence
1215884bf8334Smrg# them.  For now, I don't want them to drown out the other warnings.
1215984bf8334Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
1216084bf8334Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
1216184bf8334Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
1216284bf8334Smrg
1216384bf8334Smrg# Turn some warnings into errors, so we don't accidently get successful builds
1216484bf8334Smrg# when there are problems that should be fixed.
1216584bf8334Smrg
1216684bf8334Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
1216784bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
1216884bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
1216984bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
1217084bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
1217184bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
1217284bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
1217384bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
1217484bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
1217584bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
1217684bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
1217784bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
1217884bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
1217984bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
12180a73597f9Smrgelse
1218184bf8334SmrgAC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors.  This should not be necessary.  Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT])
1218284bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
1218384bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
1218484bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
1218584bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
1218684bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
1218784bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
1218884bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
1218984bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
1219084bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
1219184bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
1219284bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
1219384bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
1219484bf8334SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
12195a73597f9Smrgfi
12196a73597f9Smrg
1219784bf8334SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
1219884bf8334Smrg]) # XORG_COMPILER_FLAGS
12199a73597f9Smrg
1220084bf8334Smrg# XORG_CWARNFLAGS
1220184bf8334Smrg# ---------------
1220284bf8334Smrg# Minimum version: 1.2.0
1220384bf8334Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
122046aab59a7Smrg#
1220584bf8334Smrg# Defines CWARNFLAGS to enable C compiler warnings.
1220684bf8334Smrg#
1220784bf8334Smrg# This function is deprecated because it defines -fno-strict-aliasing
1220884bf8334Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
1220984bf8334Smrg# is needed, then it should be added explicitly in the module when
1221084bf8334Smrg# it is updated to use BASE_CFLAGS.
1221184bf8334Smrg#
1221284bf8334SmrgAC_DEFUN([XORG_CWARNFLAGS], [
1221384bf8334SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
1221484bf8334SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
1221584bf8334SmrgAC_LANG_CASE(
1221684bf8334Smrg	[C], [
1221784bf8334Smrg		CWARNFLAGS="$BASE_CFLAGS"
1221884bf8334Smrg		if  test "x$GCC" = xyes ; then
1221984bf8334Smrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
1222084bf8334Smrg		fi
1222184bf8334Smrg		AC_SUBST(CWARNFLAGS)
1222284bf8334Smrg	]
1222384bf8334Smrg)
1222484bf8334Smrg]) # XORG_CWARNFLAGS
12225659607e0Smrg
1222684bf8334Smrg# XORG_STRICT_OPTION
1222784bf8334Smrg# -----------------------
1222884bf8334Smrg# Minimum version: 1.3.0
1222984bf8334Smrg#
1223084bf8334Smrg# Add configure option to enable strict compilation flags, such as treating
1223184bf8334Smrg# warnings as fatal errors.
1223284bf8334Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
1223384bf8334Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
1223484bf8334Smrg#
1223584bf8334Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
1223684bf8334Smrg# when strict compilation is unconditionally desired.
1223784bf8334SmrgAC_DEFUN([XORG_STRICT_OPTION], [
1223884bf8334SmrgAC_REQUIRE([XORG_CWARNFLAGS])
1223984bf8334SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
12240fc27e79cSmrg
1224184bf8334SmrgAC_ARG_ENABLE(strict-compilation,
1224284bf8334Smrg			  AS_HELP_STRING([--enable-strict-compilation],
1224384bf8334Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
1224484bf8334Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
12245fc27e79cSmrg
1224684bf8334SmrgAC_LANG_CASE(
1224784bf8334Smrg        [C], [
1224884bf8334Smrg                define([PREFIX], [C])
1224984bf8334Smrg        ],
1225084bf8334Smrg        [C++], [
1225184bf8334Smrg                define([PREFIX], [CXX])
1225284bf8334Smrg        ]
1225384bf8334Smrg)
12254b73be646Smrg
1225584bf8334Smrg[STRICT_]PREFIX[FLAGS]=""
1225684bf8334SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
1225784bf8334SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
12258b73be646Smrg
1225984bf8334Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
1226084bf8334Smrg# activate it with -Werror, so we add it here explicitly.
1226184bf8334SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
12262659607e0Smrg
1226384bf8334Smrgif test "x$STRICT_COMPILE" = "xyes"; then
1226484bf8334Smrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
1226584bf8334Smrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
1226684bf8334Smrgfi
1226784bf8334SmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
1226884bf8334SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
1226984bf8334SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
1227084bf8334Smrg]) # XORG_STRICT_OPTION
12271659607e0Smrg
1227284bf8334Smrg# XORG_DEFAULT_OPTIONS
12273a73597f9Smrg# --------------------
1227484bf8334Smrg# Minimum version: 1.3.0
12275fc27e79cSmrg#
1227684bf8334Smrg# Defines default options for X.Org modules.
12277b73be646Smrg#
1227884bf8334SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
1227984bf8334SmrgAC_REQUIRE([AC_PROG_INSTALL])
1228084bf8334SmrgXORG_COMPILER_FLAGS
1228184bf8334SmrgXORG_CWARNFLAGS
1228284bf8334SmrgXORG_STRICT_OPTION
1228384bf8334SmrgXORG_RELEASE_VERSION
1228484bf8334SmrgXORG_CHANGELOG
1228584bf8334SmrgXORG_INSTALL
1228684bf8334SmrgXORG_MANPAGE_SECTIONS
1228784bf8334Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
1228884bf8334Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
1228984bf8334Smrg]) # XORG_DEFAULT_OPTIONS
1229084bf8334Smrg
1229184bf8334Smrg# XORG_INSTALL()
1229284bf8334Smrg# ----------------
1229384bf8334Smrg# Minimum version: 1.4.0
1229484bf8334Smrg#
1229584bf8334Smrg# Defines the variable INSTALL_CMD as the command to copy
1229684bf8334Smrg# INSTALL from $prefix/share/util-macros.
1229784bf8334Smrg#
1229884bf8334SmrgAC_DEFUN([XORG_INSTALL], [
1229984bf8334SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
1230084bf8334Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
1230184bf8334SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
1230284bf8334Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
1230384bf8334Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
1230484bf8334Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
1230584bf8334SmrgAC_SUBST([INSTALL_CMD])
1230684bf8334Smrg]) # XORG_INSTALL
1230784bf8334Smrgdnl Copyright 2005 Red Hat, Inc
1230884bf8334Smrgdnl
1230984bf8334Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
1231084bf8334Smrgdnl documentation for any purpose is hereby granted without fee, provided that
1231184bf8334Smrgdnl the above copyright notice appear in all copies and that both that
1231284bf8334Smrgdnl copyright notice and this permission notice appear in supporting
1231384bf8334Smrgdnl documentation.
1231484bf8334Smrgdnl
1231584bf8334Smrgdnl The above copyright notice and this permission notice shall be included
1231684bf8334Smrgdnl in all copies or substantial portions of the Software.
1231784bf8334Smrgdnl
1231884bf8334Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1231984bf8334Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1232084bf8334Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1232184bf8334Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
1232284bf8334Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1232384bf8334Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1232484bf8334Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
1232584bf8334Smrgdnl
1232684bf8334Smrgdnl Except as contained in this notice, the name of the copyright holders shall
1232784bf8334Smrgdnl not be used in advertising or otherwise to promote the sale, use or
1232884bf8334Smrgdnl other dealings in this Software without prior written authorization
1232984bf8334Smrgdnl from the copyright holders.
1233084bf8334Smrgdnl
12331659607e0Smrg
1233284bf8334Smrg# XORG_RELEASE_VERSION
1233384bf8334Smrg# --------------------
1233484bf8334Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
12335659607e0Smrg
1233684bf8334SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
1233784bf8334Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
1233884bf8334Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
1233984bf8334Smrg		[Major version of this package])
1234084bf8334Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
1234184bf8334Smrg	if test "x$PVM" = "x"; then
1234284bf8334Smrg		PVM="0"
1234384bf8334Smrg	fi
1234484bf8334Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
1234584bf8334Smrg		[$PVM],
1234684bf8334Smrg		[Minor version of this package])
1234784bf8334Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
1234884bf8334Smrg	if test "x$PVP" = "x"; then
1234984bf8334Smrg		PVP="0"
1235084bf8334Smrg	fi
1235184bf8334Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
1235284bf8334Smrg		[$PVP],
1235384bf8334Smrg		[Patch version of this package])
1235484bf8334Smrg])
12355a73597f9Smrg
1235684bf8334Smrg# XORG_CHANGELOG()
1235784bf8334Smrg# ----------------
1235884bf8334Smrg# Minimum version: 1.2.0
1235984bf8334Smrg#
1236084bf8334Smrg# Defines the variable CHANGELOG_CMD as the command to generate
1236184bf8334Smrg# ChangeLog from git.
1236284bf8334Smrg#
1236384bf8334Smrg#
1236484bf8334SmrgAC_DEFUN([XORG_CHANGELOG], [
1236584bf8334SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
1236684bf8334Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
1236784bf8334Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
1236884bf8334Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
1236984bf8334SmrgAC_SUBST([CHANGELOG_CMD])
1237084bf8334Smrg]) # XORG_CHANGELOG
12371659607e0Smrg
12372