aclocal.m4 revision e07dc26b
1e07dc26bSmrg# generated automatically by aclocal 1.15 -*- Autoconf -*-
2e07dc26bSmrg
3e07dc26bSmrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
4e07dc26bSmrg
5e07dc26bSmrg# This file is free software; the Free Software Foundation
6e07dc26bSmrg# gives unlimited permission to copy and/or distribute it,
7e07dc26bSmrg# with or without modifications, as long as this notice is preserved.
8e07dc26bSmrg
9e07dc26bSmrg# This program is distributed in the hope that it will be useful,
10e07dc26bSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11e07dc26bSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12e07dc26bSmrg# PARTICULAR PURPOSE.
13e07dc26bSmrg
14e07dc26bSmrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15e07dc26bSmrgm4_ifndef([AC_AUTOCONF_VERSION],
16e07dc26bSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17e07dc26bSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
18e07dc26bSmrg[m4_warning([this file was generated for autoconf 2.69.
19e07dc26bSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
20e07dc26bSmrgIf you have problems, you may need to regenerate the build system entirely.
21e07dc26bSmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22e07dc26bSmrg
23e07dc26bSmrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
24e07dc26bSmrg#
25e07dc26bSmrg#   Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
26e07dc26bSmrg#   Written by Gordon Matzigkeit, 1996
27e07dc26bSmrg#
28e07dc26bSmrg# This file is free software; the Free Software Foundation gives
29e07dc26bSmrg# unlimited permission to copy and/or distribute it, with or without
30e07dc26bSmrg# modifications, as long as this notice is preserved.
31e07dc26bSmrg
32e07dc26bSmrgm4_define([_LT_COPYING], [dnl
33e07dc26bSmrg# Copyright (C) 2014 Free Software Foundation, Inc.
34e07dc26bSmrg# This is free software; see the source for copying conditions.  There is NO
35e07dc26bSmrg# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
36e07dc26bSmrg
37e07dc26bSmrg# GNU Libtool is free software; you can redistribute it and/or modify
38e07dc26bSmrg# it under the terms of the GNU General Public License as published by
39e07dc26bSmrg# the Free Software Foundation; either version 2 of of the License, or
40e07dc26bSmrg# (at your option) any later version.
41e07dc26bSmrg#
42e07dc26bSmrg# As a special exception to the GNU General Public License, if you
43e07dc26bSmrg# distribute this file as part of a program or library that is built
44e07dc26bSmrg# using GNU Libtool, you may include this file under the  same
45e07dc26bSmrg# distribution terms that you use for the rest of that program.
46e07dc26bSmrg#
47e07dc26bSmrg# GNU Libtool is distributed in the hope that it will be useful, but
48e07dc26bSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
49e07dc26bSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
50e07dc26bSmrg# GNU General Public License for more details.
51e07dc26bSmrg#
52e07dc26bSmrg# You should have received a copy of the GNU General Public License
53e07dc26bSmrg# along with this program.  If not, see <http://www.gnu.org/licenses/>.
54e07dc26bSmrg])
55e07dc26bSmrg
56e07dc26bSmrg# serial 58 LT_INIT
57e07dc26bSmrg
58e07dc26bSmrg
59e07dc26bSmrg# LT_PREREQ(VERSION)
60e07dc26bSmrg# ------------------
61e07dc26bSmrg# Complain and exit if this libtool version is less that VERSION.
62e07dc26bSmrgm4_defun([LT_PREREQ],
63e07dc26bSmrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
64e07dc26bSmrg       [m4_default([$3],
65e07dc26bSmrg		   [m4_fatal([Libtool version $1 or higher is required],
66e07dc26bSmrg		             63)])],
67e07dc26bSmrg       [$2])])
68e07dc26bSmrg
69e07dc26bSmrg
70e07dc26bSmrg# _LT_CHECK_BUILDDIR
71e07dc26bSmrg# ------------------
72e07dc26bSmrg# Complain if the absolute build directory name contains unusual characters
73e07dc26bSmrgm4_defun([_LT_CHECK_BUILDDIR],
74e07dc26bSmrg[case `pwd` in
75e07dc26bSmrg  *\ * | *\	*)
76e07dc26bSmrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
77e07dc26bSmrgesac
78e07dc26bSmrg])
79e07dc26bSmrg
80e07dc26bSmrg
81e07dc26bSmrg# LT_INIT([OPTIONS])
82e07dc26bSmrg# ------------------
83e07dc26bSmrgAC_DEFUN([LT_INIT],
84e07dc26bSmrg[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
85e07dc26bSmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
86e07dc26bSmrgAC_BEFORE([$0], [LT_LANG])dnl
87e07dc26bSmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
88e07dc26bSmrgAC_BEFORE([$0], [LTDL_INIT])dnl
89e07dc26bSmrgm4_require([_LT_CHECK_BUILDDIR])dnl
90e07dc26bSmrg
91e07dc26bSmrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
92e07dc26bSmrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
93e07dc26bSmrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
94e07dc26bSmrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
95e07dc26bSmrgdnl unless we require an AC_DEFUNed macro:
96e07dc26bSmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
97e07dc26bSmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
98e07dc26bSmrgAC_REQUIRE([LTVERSION_VERSION])dnl
99e07dc26bSmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
100e07dc26bSmrgm4_require([_LT_PROG_LTMAIN])dnl
101e07dc26bSmrg
102e07dc26bSmrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
103e07dc26bSmrg
104e07dc26bSmrgdnl Parse OPTIONS
105e07dc26bSmrg_LT_SET_OPTIONS([$0], [$1])
106e07dc26bSmrg
107e07dc26bSmrg# This can be used to rebuild libtool when needed
108e07dc26bSmrgLIBTOOL_DEPS=$ltmain
109e07dc26bSmrg
110e07dc26bSmrg# Always use our own libtool.
111e07dc26bSmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
112e07dc26bSmrgAC_SUBST(LIBTOOL)dnl
113e07dc26bSmrg
114e07dc26bSmrg_LT_SETUP
115e07dc26bSmrg
116e07dc26bSmrg# Only expand once:
117e07dc26bSmrgm4_define([LT_INIT])
118e07dc26bSmrg])# LT_INIT
119e07dc26bSmrg
120e07dc26bSmrg# Old names:
121e07dc26bSmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
122e07dc26bSmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
123e07dc26bSmrgdnl aclocal-1.4 backwards compatibility:
124e07dc26bSmrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
125e07dc26bSmrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
126e07dc26bSmrg
127e07dc26bSmrg
128e07dc26bSmrg# _LT_PREPARE_CC_BASENAME
129e07dc26bSmrg# -----------------------
130e07dc26bSmrgm4_defun([_LT_PREPARE_CC_BASENAME], [
131e07dc26bSmrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
132e07dc26bSmrgfunc_cc_basename ()
133e07dc26bSmrg{
134e07dc26bSmrg    for cc_temp in @S|@*""; do
135e07dc26bSmrg      case $cc_temp in
136e07dc26bSmrg        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
137e07dc26bSmrg        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
138e07dc26bSmrg        \-*) ;;
139e07dc26bSmrg        *) break;;
140e07dc26bSmrg      esac
141e07dc26bSmrg    done
142e07dc26bSmrg    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
143e07dc26bSmrg}
144e07dc26bSmrg])# _LT_PREPARE_CC_BASENAME
145e07dc26bSmrg
146e07dc26bSmrg
147e07dc26bSmrg# _LT_CC_BASENAME(CC)
148e07dc26bSmrg# -------------------
149e07dc26bSmrg# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
150e07dc26bSmrg# but that macro is also expanded into generated libtool script, which
151e07dc26bSmrg# arranges for $SED and $ECHO to be set by different means.
152e07dc26bSmrgm4_defun([_LT_CC_BASENAME],
153e07dc26bSmrg[m4_require([_LT_PREPARE_CC_BASENAME])dnl
154e07dc26bSmrgAC_REQUIRE([_LT_DECL_SED])dnl
155e07dc26bSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
156e07dc26bSmrgfunc_cc_basename $1
157e07dc26bSmrgcc_basename=$func_cc_basename_result
158e07dc26bSmrg])
159e07dc26bSmrg
160e07dc26bSmrg
161e07dc26bSmrg# _LT_FILEUTILS_DEFAULTS
162e07dc26bSmrg# ----------------------
163e07dc26bSmrg# It is okay to use these file commands and assume they have been set
164e07dc26bSmrg# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
165e07dc26bSmrgm4_defun([_LT_FILEUTILS_DEFAULTS],
166e07dc26bSmrg[: ${CP="cp -f"}
167e07dc26bSmrg: ${MV="mv -f"}
168e07dc26bSmrg: ${RM="rm -f"}
169e07dc26bSmrg])# _LT_FILEUTILS_DEFAULTS
170e07dc26bSmrg
171e07dc26bSmrg
172e07dc26bSmrg# _LT_SETUP
173e07dc26bSmrg# ---------
174e07dc26bSmrgm4_defun([_LT_SETUP],
175e07dc26bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
176e07dc26bSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
177e07dc26bSmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
178e07dc26bSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
179e07dc26bSmrg
180e07dc26bSmrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
181e07dc26bSmrgdnl
182e07dc26bSmrg_LT_DECL([], [host_alias], [0], [The host system])dnl
183e07dc26bSmrg_LT_DECL([], [host], [0])dnl
184e07dc26bSmrg_LT_DECL([], [host_os], [0])dnl
185e07dc26bSmrgdnl
186e07dc26bSmrg_LT_DECL([], [build_alias], [0], [The build system])dnl
187e07dc26bSmrg_LT_DECL([], [build], [0])dnl
188e07dc26bSmrg_LT_DECL([], [build_os], [0])dnl
189e07dc26bSmrgdnl
190e07dc26bSmrgAC_REQUIRE([AC_PROG_CC])dnl
191e07dc26bSmrgAC_REQUIRE([LT_PATH_LD])dnl
192e07dc26bSmrgAC_REQUIRE([LT_PATH_NM])dnl
193e07dc26bSmrgdnl
194e07dc26bSmrgAC_REQUIRE([AC_PROG_LN_S])dnl
195e07dc26bSmrgtest -z "$LN_S" && LN_S="ln -s"
196e07dc26bSmrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
197e07dc26bSmrgdnl
198e07dc26bSmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
199e07dc26bSmrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
200e07dc26bSmrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
201e07dc26bSmrgdnl
202e07dc26bSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
203e07dc26bSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
204e07dc26bSmrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
205e07dc26bSmrgm4_require([_LT_CMD_RELOAD])dnl
206e07dc26bSmrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
207e07dc26bSmrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
208e07dc26bSmrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
209e07dc26bSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
210e07dc26bSmrgm4_require([_LT_WITH_SYSROOT])dnl
211e07dc26bSmrgm4_require([_LT_CMD_TRUNCATE])dnl
212e07dc26bSmrg
213e07dc26bSmrg_LT_CONFIG_LIBTOOL_INIT([
214e07dc26bSmrg# See if we are running on zsh, and set the options that allow our
215e07dc26bSmrg# commands through without removal of \ escapes INIT.
216e07dc26bSmrgif test -n "\${ZSH_VERSION+set}"; then
217e07dc26bSmrg   setopt NO_GLOB_SUBST
218e07dc26bSmrgfi
219e07dc26bSmrg])
220e07dc26bSmrgif test -n "${ZSH_VERSION+set}"; then
221e07dc26bSmrg   setopt NO_GLOB_SUBST
222e07dc26bSmrgfi
223e07dc26bSmrg
224e07dc26bSmrg_LT_CHECK_OBJDIR
225e07dc26bSmrg
226e07dc26bSmrgm4_require([_LT_TAG_COMPILER])dnl
227e07dc26bSmrg
228e07dc26bSmrgcase $host_os in
229e07dc26bSmrgaix3*)
230e07dc26bSmrg  # AIX sometimes has problems with the GCC collect2 program.  For some
231e07dc26bSmrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
232e07dc26bSmrg  # vanish in a puff of smoke.
233e07dc26bSmrg  if test set != "${COLLECT_NAMES+set}"; then
234e07dc26bSmrg    COLLECT_NAMES=
235e07dc26bSmrg    export COLLECT_NAMES
236e07dc26bSmrg  fi
237e07dc26bSmrg  ;;
238e07dc26bSmrgesac
239e07dc26bSmrg
240e07dc26bSmrg# Global variables:
241e07dc26bSmrgofile=libtool
242e07dc26bSmrgcan_build_shared=yes
243e07dc26bSmrg
244e07dc26bSmrg# All known linkers require a '.a' archive for static linking (except MSVC,
245e07dc26bSmrg# which needs '.lib').
246e07dc26bSmrglibext=a
247e07dc26bSmrg
248e07dc26bSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
249e07dc26bSmrg
250e07dc26bSmrgold_CC=$CC
251e07dc26bSmrgold_CFLAGS=$CFLAGS
252e07dc26bSmrg
253e07dc26bSmrg# Set sane defaults for various variables
254e07dc26bSmrgtest -z "$CC" && CC=cc
255e07dc26bSmrgtest -z "$LTCC" && LTCC=$CC
256e07dc26bSmrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
257e07dc26bSmrgtest -z "$LD" && LD=ld
258e07dc26bSmrgtest -z "$ac_objext" && ac_objext=o
259e07dc26bSmrg
260e07dc26bSmrg_LT_CC_BASENAME([$compiler])
261e07dc26bSmrg
262e07dc26bSmrg# Only perform the check for file, if the check method requires it
263e07dc26bSmrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
264e07dc26bSmrgcase $deplibs_check_method in
265e07dc26bSmrgfile_magic*)
266e07dc26bSmrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
267e07dc26bSmrg    _LT_PATH_MAGIC
268e07dc26bSmrg  fi
269e07dc26bSmrg  ;;
270e07dc26bSmrgesac
271e07dc26bSmrg
272e07dc26bSmrg# Use C for the default configuration in the libtool script
273e07dc26bSmrgLT_SUPPORTED_TAG([CC])
274e07dc26bSmrg_LT_LANG_C_CONFIG
275e07dc26bSmrg_LT_LANG_DEFAULT_CONFIG
276e07dc26bSmrg_LT_CONFIG_COMMANDS
277e07dc26bSmrg])# _LT_SETUP
278e07dc26bSmrg
279e07dc26bSmrg
280e07dc26bSmrg# _LT_PREPARE_SED_QUOTE_VARS
281e07dc26bSmrg# --------------------------
282e07dc26bSmrg# Define a few sed substitution that help us do robust quoting.
283e07dc26bSmrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
284e07dc26bSmrg[# Backslashify metacharacters that are still active within
285e07dc26bSmrg# double-quoted strings.
286e07dc26bSmrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
287e07dc26bSmrg
288e07dc26bSmrg# Same as above, but do not quote variable references.
289e07dc26bSmrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
290e07dc26bSmrg
291e07dc26bSmrg# Sed substitution to delay expansion of an escaped shell variable in a
292e07dc26bSmrg# double_quote_subst'ed string.
293e07dc26bSmrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
294e07dc26bSmrg
295e07dc26bSmrg# Sed substitution to delay expansion of an escaped single quote.
296e07dc26bSmrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
297e07dc26bSmrg
298e07dc26bSmrg# Sed substitution to avoid accidental globbing in evaled expressions
299e07dc26bSmrgno_glob_subst='s/\*/\\\*/g'
300e07dc26bSmrg])
301e07dc26bSmrg
302e07dc26bSmrg# _LT_PROG_LTMAIN
303e07dc26bSmrg# ---------------
304e07dc26bSmrg# Note that this code is called both from 'configure', and 'config.status'
305e07dc26bSmrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
306e07dc26bSmrg# 'config.status' has no value for ac_aux_dir unless we are using Automake,
307e07dc26bSmrg# so we pass a copy along to make sure it has a sensible value anyway.
308e07dc26bSmrgm4_defun([_LT_PROG_LTMAIN],
309e07dc26bSmrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
310e07dc26bSmrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
311e07dc26bSmrgltmain=$ac_aux_dir/ltmain.sh
312e07dc26bSmrg])# _LT_PROG_LTMAIN
313e07dc26bSmrg
314e07dc26bSmrg
315e07dc26bSmrg
316e07dc26bSmrg# So that we can recreate a full libtool script including additional
317e07dc26bSmrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
318e07dc26bSmrg# in macros and then make a single call at the end using the 'libtool'
319e07dc26bSmrg# label.
320e07dc26bSmrg
321e07dc26bSmrg
322e07dc26bSmrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
323e07dc26bSmrg# ----------------------------------------
324e07dc26bSmrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
325e07dc26bSmrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
326e07dc26bSmrg[m4_ifval([$1],
327e07dc26bSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
328e07dc26bSmrg                     [$1
329e07dc26bSmrg])])])
330e07dc26bSmrg
331e07dc26bSmrg# Initialize.
332e07dc26bSmrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
333e07dc26bSmrg
334e07dc26bSmrg
335e07dc26bSmrg# _LT_CONFIG_LIBTOOL([COMMANDS])
336e07dc26bSmrg# ------------------------------
337e07dc26bSmrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
338e07dc26bSmrgm4_define([_LT_CONFIG_LIBTOOL],
339e07dc26bSmrg[m4_ifval([$1],
340e07dc26bSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
341e07dc26bSmrg                     [$1
342e07dc26bSmrg])])])
343e07dc26bSmrg
344e07dc26bSmrg# Initialize.
345e07dc26bSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
346e07dc26bSmrg
347e07dc26bSmrg
348e07dc26bSmrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
349e07dc26bSmrg# -----------------------------------------------------
350e07dc26bSmrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
351e07dc26bSmrg[_LT_CONFIG_LIBTOOL([$1])
352e07dc26bSmrg_LT_CONFIG_LIBTOOL_INIT([$2])
353e07dc26bSmrg])
354e07dc26bSmrg
355e07dc26bSmrg
356e07dc26bSmrg# _LT_FORMAT_COMMENT([COMMENT])
357e07dc26bSmrg# -----------------------------
358e07dc26bSmrg# Add leading comment marks to the start of each line, and a trailing
359e07dc26bSmrg# full-stop to the whole comment if one is not present already.
360e07dc26bSmrgm4_define([_LT_FORMAT_COMMENT],
361e07dc26bSmrg[m4_ifval([$1], [
362e07dc26bSmrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
363e07dc26bSmrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
364e07dc26bSmrg)])
365e07dc26bSmrg
366e07dc26bSmrg
367e07dc26bSmrg
368e07dc26bSmrg
369e07dc26bSmrg
370e07dc26bSmrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
371e07dc26bSmrg# -------------------------------------------------------------------
372e07dc26bSmrg# CONFIGNAME is the name given to the value in the libtool script.
373e07dc26bSmrg# VARNAME is the (base) name used in the configure script.
374e07dc26bSmrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
375e07dc26bSmrg# VARNAME.  Any other value will be used directly.
376e07dc26bSmrgm4_define([_LT_DECL],
377e07dc26bSmrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
378e07dc26bSmrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
379e07dc26bSmrg	[m4_ifval([$1], [$1], [$2])])
380e07dc26bSmrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
381e07dc26bSmrg    m4_ifval([$4],
382e07dc26bSmrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
383e07dc26bSmrg    lt_dict_add_subkey([lt_decl_dict], [$2],
384e07dc26bSmrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
385e07dc26bSmrg])
386e07dc26bSmrg
387e07dc26bSmrg
388e07dc26bSmrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
389e07dc26bSmrg# --------------------------------------------------------
390e07dc26bSmrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
391e07dc26bSmrg
392e07dc26bSmrg
393e07dc26bSmrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
394e07dc26bSmrg# ------------------------------------------------
395e07dc26bSmrgm4_define([lt_decl_tag_varnames],
396e07dc26bSmrg[_lt_decl_filter([tagged?], [yes], $@)])
397e07dc26bSmrg
398e07dc26bSmrg
399e07dc26bSmrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
400e07dc26bSmrg# ---------------------------------------------------------
401e07dc26bSmrgm4_define([_lt_decl_filter],
402e07dc26bSmrg[m4_case([$#],
403e07dc26bSmrg  [0], [m4_fatal([$0: too few arguments: $#])],
404e07dc26bSmrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
405e07dc26bSmrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
406e07dc26bSmrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
407e07dc26bSmrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
408e07dc26bSmrg])
409e07dc26bSmrg
410e07dc26bSmrg
411e07dc26bSmrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
412e07dc26bSmrg# --------------------------------------------------
413e07dc26bSmrgm4_define([lt_decl_quote_varnames],
414e07dc26bSmrg[_lt_decl_filter([value], [1], $@)])
415e07dc26bSmrg
416e07dc26bSmrg
417e07dc26bSmrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
418e07dc26bSmrg# ---------------------------------------------------
419e07dc26bSmrgm4_define([lt_decl_dquote_varnames],
420e07dc26bSmrg[_lt_decl_filter([value], [2], $@)])
421e07dc26bSmrg
422e07dc26bSmrg
423e07dc26bSmrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
424e07dc26bSmrg# ---------------------------------------------------
425e07dc26bSmrgm4_define([lt_decl_varnames_tagged],
426e07dc26bSmrg[m4_assert([$# <= 2])dnl
427e07dc26bSmrg_$0(m4_quote(m4_default([$1], [[, ]])),
428e07dc26bSmrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
429e07dc26bSmrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
430e07dc26bSmrgm4_define([_lt_decl_varnames_tagged],
431e07dc26bSmrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
432e07dc26bSmrg
433e07dc26bSmrg
434e07dc26bSmrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
435e07dc26bSmrg# ------------------------------------------------
436e07dc26bSmrgm4_define([lt_decl_all_varnames],
437e07dc26bSmrg[_$0(m4_quote(m4_default([$1], [[, ]])),
438e07dc26bSmrg     m4_if([$2], [],
439e07dc26bSmrg	   m4_quote(lt_decl_varnames),
440e07dc26bSmrg	m4_quote(m4_shift($@))))[]dnl
441e07dc26bSmrg])
442e07dc26bSmrgm4_define([_lt_decl_all_varnames],
443e07dc26bSmrg[lt_join($@, lt_decl_varnames_tagged([$1],
444e07dc26bSmrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
445e07dc26bSmrg])
446e07dc26bSmrg
447e07dc26bSmrg
448e07dc26bSmrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
449e07dc26bSmrg# ------------------------------------
450e07dc26bSmrg# Quote a variable value, and forward it to 'config.status' so that its
451e07dc26bSmrg# declaration there will have the same value as in 'configure'.  VARNAME
452e07dc26bSmrg# must have a single quote delimited value for this to work.
453e07dc26bSmrgm4_define([_LT_CONFIG_STATUS_DECLARE],
454e07dc26bSmrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
455e07dc26bSmrg
456e07dc26bSmrg
457e07dc26bSmrg# _LT_CONFIG_STATUS_DECLARATIONS
458e07dc26bSmrg# ------------------------------
459e07dc26bSmrg# We delimit libtool config variables with single quotes, so when
460e07dc26bSmrg# we write them to config.status, we have to be sure to quote all
461e07dc26bSmrg# embedded single quotes properly.  In configure, this macro expands
462e07dc26bSmrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
463e07dc26bSmrg#
464e07dc26bSmrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
465e07dc26bSmrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
466e07dc26bSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
467e07dc26bSmrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
468e07dc26bSmrg
469e07dc26bSmrg
470e07dc26bSmrg# _LT_LIBTOOL_TAGS
471e07dc26bSmrg# ----------------
472e07dc26bSmrg# Output comment and list of tags supported by the script
473e07dc26bSmrgm4_defun([_LT_LIBTOOL_TAGS],
474e07dc26bSmrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
475e07dc26bSmrgavailable_tags='_LT_TAGS'dnl
476e07dc26bSmrg])
477e07dc26bSmrg
478e07dc26bSmrg
479e07dc26bSmrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
480e07dc26bSmrg# -----------------------------------
481e07dc26bSmrg# Extract the dictionary values for VARNAME (optionally with TAG) and
482e07dc26bSmrg# expand to a commented shell variable setting:
483e07dc26bSmrg#
484e07dc26bSmrg#    # Some comment about what VAR is for.
485e07dc26bSmrg#    visible_name=$lt_internal_name
486e07dc26bSmrgm4_define([_LT_LIBTOOL_DECLARE],
487e07dc26bSmrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
488e07dc26bSmrg					   [description])))[]dnl
489e07dc26bSmrgm4_pushdef([_libtool_name],
490e07dc26bSmrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
491e07dc26bSmrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
492e07dc26bSmrg    [0], [_libtool_name=[$]$1],
493e07dc26bSmrg    [1], [_libtool_name=$lt_[]$1],
494e07dc26bSmrg    [2], [_libtool_name=$lt_[]$1],
495e07dc26bSmrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
496e07dc26bSmrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
497e07dc26bSmrg])
498e07dc26bSmrg
499e07dc26bSmrg
500e07dc26bSmrg# _LT_LIBTOOL_CONFIG_VARS
501e07dc26bSmrg# -----------------------
502e07dc26bSmrg# Produce commented declarations of non-tagged libtool config variables
503e07dc26bSmrg# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
504e07dc26bSmrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
505e07dc26bSmrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
506e07dc26bSmrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
507e07dc26bSmrg[m4_foreach([_lt_var],
508e07dc26bSmrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
509e07dc26bSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
510e07dc26bSmrg
511e07dc26bSmrg
512e07dc26bSmrg# _LT_LIBTOOL_TAG_VARS(TAG)
513e07dc26bSmrg# -------------------------
514e07dc26bSmrgm4_define([_LT_LIBTOOL_TAG_VARS],
515e07dc26bSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
516e07dc26bSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
517e07dc26bSmrg
518e07dc26bSmrg
519e07dc26bSmrg# _LT_TAGVAR(VARNAME, [TAGNAME])
520e07dc26bSmrg# ------------------------------
521e07dc26bSmrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
522e07dc26bSmrg
523e07dc26bSmrg
524e07dc26bSmrg# _LT_CONFIG_COMMANDS
525e07dc26bSmrg# -------------------
526e07dc26bSmrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
527e07dc26bSmrg# variables for single and double quote escaping we saved from calls
528e07dc26bSmrg# to _LT_DECL, we can put quote escaped variables declarations
529e07dc26bSmrg# into 'config.status', and then the shell code to quote escape them in
530e07dc26bSmrg# for loops in 'config.status'.  Finally, any additional code accumulated
531e07dc26bSmrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
532e07dc26bSmrgm4_defun([_LT_CONFIG_COMMANDS],
533e07dc26bSmrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
534e07dc26bSmrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
535e07dc26bSmrg	dnl instead of duplicating it all over again into config.status,
536e07dc26bSmrg	dnl then we will have config.status run $CONFIG_LT later, so it
537e07dc26bSmrg	dnl needs to know what name is stored there:
538e07dc26bSmrg        [AC_CONFIG_COMMANDS([libtool],
539e07dc26bSmrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
540e07dc26bSmrg    dnl If the libtool generation code is destined for config.status,
541e07dc26bSmrg    dnl expand the accumulated commands and init code now:
542e07dc26bSmrg    [AC_CONFIG_COMMANDS([libtool],
543e07dc26bSmrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
544e07dc26bSmrg])#_LT_CONFIG_COMMANDS
545e07dc26bSmrg
546e07dc26bSmrg
547e07dc26bSmrg# Initialize.
548e07dc26bSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
549e07dc26bSmrg[
550e07dc26bSmrg
551e07dc26bSmrg# The HP-UX ksh and POSIX shell print the target directory to stdout
552e07dc26bSmrg# if CDPATH is set.
553e07dc26bSmrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
554e07dc26bSmrg
555e07dc26bSmrgsed_quote_subst='$sed_quote_subst'
556e07dc26bSmrgdouble_quote_subst='$double_quote_subst'
557e07dc26bSmrgdelay_variable_subst='$delay_variable_subst'
558e07dc26bSmrg_LT_CONFIG_STATUS_DECLARATIONS
559e07dc26bSmrgLTCC='$LTCC'
560e07dc26bSmrgLTCFLAGS='$LTCFLAGS'
561e07dc26bSmrgcompiler='$compiler_DEFAULT'
562e07dc26bSmrg
563e07dc26bSmrg# A function that is used when there is no print builtin or printf.
564e07dc26bSmrgfunc_fallback_echo ()
565e07dc26bSmrg{
566e07dc26bSmrg  eval 'cat <<_LTECHO_EOF
567e07dc26bSmrg\$[]1
568e07dc26bSmrg_LTECHO_EOF'
569e07dc26bSmrg}
570e07dc26bSmrg
571e07dc26bSmrg# Quote evaled strings.
572e07dc26bSmrgfor var in lt_decl_all_varnames([[ \
573e07dc26bSmrg]], lt_decl_quote_varnames); do
574e07dc26bSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
575e07dc26bSmrg    *[[\\\\\\\`\\"\\\$]]*)
576e07dc26bSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
577e07dc26bSmrg      ;;
578e07dc26bSmrg    *)
579e07dc26bSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
580e07dc26bSmrg      ;;
581e07dc26bSmrg    esac
582e07dc26bSmrgdone
583e07dc26bSmrg
584e07dc26bSmrg# Double-quote double-evaled strings.
585e07dc26bSmrgfor var in lt_decl_all_varnames([[ \
586e07dc26bSmrg]], lt_decl_dquote_varnames); do
587e07dc26bSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
588e07dc26bSmrg    *[[\\\\\\\`\\"\\\$]]*)
589e07dc26bSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
590e07dc26bSmrg      ;;
591e07dc26bSmrg    *)
592e07dc26bSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
593e07dc26bSmrg      ;;
594e07dc26bSmrg    esac
595e07dc26bSmrgdone
596e07dc26bSmrg
597e07dc26bSmrg_LT_OUTPUT_LIBTOOL_INIT
598e07dc26bSmrg])
599e07dc26bSmrg
600e07dc26bSmrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
601e07dc26bSmrg# ------------------------------------
602e07dc26bSmrg# Generate a child script FILE with all initialization necessary to
603e07dc26bSmrg# reuse the environment learned by the parent script, and make the
604e07dc26bSmrg# file executable.  If COMMENT is supplied, it is inserted after the
605e07dc26bSmrg# '#!' sequence but before initialization text begins.  After this
606e07dc26bSmrg# macro, additional text can be appended to FILE to form the body of
607e07dc26bSmrg# the child script.  The macro ends with non-zero status if the
608e07dc26bSmrg# file could not be fully written (such as if the disk is full).
609e07dc26bSmrgm4_ifdef([AS_INIT_GENERATED],
610e07dc26bSmrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
611e07dc26bSmrg[m4_defun([_LT_GENERATED_FILE_INIT],
612e07dc26bSmrg[m4_require([AS_PREPARE])]dnl
613e07dc26bSmrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
614e07dc26bSmrg[lt_write_fail=0
615e07dc26bSmrgcat >$1 <<_ASEOF || lt_write_fail=1
616e07dc26bSmrg#! $SHELL
617e07dc26bSmrg# Generated by $as_me.
618e07dc26bSmrg$2
619e07dc26bSmrgSHELL=\${CONFIG_SHELL-$SHELL}
620e07dc26bSmrgexport SHELL
621e07dc26bSmrg_ASEOF
622e07dc26bSmrgcat >>$1 <<\_ASEOF || lt_write_fail=1
623e07dc26bSmrgAS_SHELL_SANITIZE
624e07dc26bSmrg_AS_PREPARE
625e07dc26bSmrgexec AS_MESSAGE_FD>&1
626e07dc26bSmrg_ASEOF
627e07dc26bSmrgtest 0 = "$lt_write_fail" && chmod +x $1[]dnl
628e07dc26bSmrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
629e07dc26bSmrg
630e07dc26bSmrg# LT_OUTPUT
631e07dc26bSmrg# ---------
632e07dc26bSmrg# This macro allows early generation of the libtool script (before
633e07dc26bSmrg# AC_OUTPUT is called), incase it is used in configure for compilation
634e07dc26bSmrg# tests.
635e07dc26bSmrgAC_DEFUN([LT_OUTPUT],
636e07dc26bSmrg[: ${CONFIG_LT=./config.lt}
637e07dc26bSmrgAC_MSG_NOTICE([creating $CONFIG_LT])
638e07dc26bSmrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
639e07dc26bSmrg[# Run this file to recreate a libtool stub with the current configuration.])
640e07dc26bSmrg
641e07dc26bSmrgcat >>"$CONFIG_LT" <<\_LTEOF
642e07dc26bSmrglt_cl_silent=false
643e07dc26bSmrgexec AS_MESSAGE_LOG_FD>>config.log
644e07dc26bSmrg{
645e07dc26bSmrg  echo
646e07dc26bSmrg  AS_BOX([Running $as_me.])
647e07dc26bSmrg} >&AS_MESSAGE_LOG_FD
648e07dc26bSmrg
649e07dc26bSmrglt_cl_help="\
650e07dc26bSmrg'$as_me' creates a local libtool stub from the current configuration,
651e07dc26bSmrgfor use in further configure time tests before the real libtool is
652e07dc26bSmrggenerated.
653e07dc26bSmrg
654e07dc26bSmrgUsage: $[0] [[OPTIONS]]
655e07dc26bSmrg
656e07dc26bSmrg  -h, --help      print this help, then exit
657e07dc26bSmrg  -V, --version   print version number, then exit
658e07dc26bSmrg  -q, --quiet     do not print progress messages
659e07dc26bSmrg  -d, --debug     don't remove temporary files
660e07dc26bSmrg
661e07dc26bSmrgReport bugs to <bug-libtool@gnu.org>."
662e07dc26bSmrg
663e07dc26bSmrglt_cl_version="\
664e07dc26bSmrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
665e07dc26bSmrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
666e07dc26bSmrgconfigured by $[0], generated by m4_PACKAGE_STRING.
667e07dc26bSmrg
668e07dc26bSmrgCopyright (C) 2011 Free Software Foundation, Inc.
669e07dc26bSmrgThis config.lt script is free software; the Free Software Foundation
670e07dc26bSmrggives unlimited permision to copy, distribute and modify it."
671e07dc26bSmrg
672e07dc26bSmrgwhile test 0 != $[#]
673e07dc26bSmrgdo
674e07dc26bSmrg  case $[1] in
675e07dc26bSmrg    --version | --v* | -V )
676e07dc26bSmrg      echo "$lt_cl_version"; exit 0 ;;
677e07dc26bSmrg    --help | --h* | -h )
678e07dc26bSmrg      echo "$lt_cl_help"; exit 0 ;;
679e07dc26bSmrg    --debug | --d* | -d )
680e07dc26bSmrg      debug=: ;;
681e07dc26bSmrg    --quiet | --q* | --silent | --s* | -q )
682e07dc26bSmrg      lt_cl_silent=: ;;
683e07dc26bSmrg
684e07dc26bSmrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
685e07dc26bSmrgTry '$[0] --help' for more information.]) ;;
686e07dc26bSmrg
687e07dc26bSmrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
688e07dc26bSmrgTry '$[0] --help' for more information.]) ;;
689e07dc26bSmrg  esac
690e07dc26bSmrg  shift
691e07dc26bSmrgdone
692e07dc26bSmrg
693e07dc26bSmrgif $lt_cl_silent; then
694e07dc26bSmrg  exec AS_MESSAGE_FD>/dev/null
695e07dc26bSmrgfi
696e07dc26bSmrg_LTEOF
697e07dc26bSmrg
698e07dc26bSmrgcat >>"$CONFIG_LT" <<_LTEOF
699e07dc26bSmrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
700e07dc26bSmrg_LTEOF
701e07dc26bSmrg
702e07dc26bSmrgcat >>"$CONFIG_LT" <<\_LTEOF
703e07dc26bSmrgAC_MSG_NOTICE([creating $ofile])
704e07dc26bSmrg_LT_OUTPUT_LIBTOOL_COMMANDS
705e07dc26bSmrgAS_EXIT(0)
706e07dc26bSmrg_LTEOF
707e07dc26bSmrgchmod +x "$CONFIG_LT"
708e07dc26bSmrg
709e07dc26bSmrg# configure is writing to config.log, but config.lt does its own redirection,
710e07dc26bSmrg# appending to config.log, which fails on DOS, as config.log is still kept
711e07dc26bSmrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
712e07dc26bSmrg# config.log, so it can be properly (re)opened and appended to by config.lt.
713e07dc26bSmrglt_cl_success=:
714e07dc26bSmrgtest yes = "$silent" &&
715e07dc26bSmrg  lt_config_lt_args="$lt_config_lt_args --quiet"
716e07dc26bSmrgexec AS_MESSAGE_LOG_FD>/dev/null
717e07dc26bSmrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
718e07dc26bSmrgexec AS_MESSAGE_LOG_FD>>config.log
719e07dc26bSmrg$lt_cl_success || AS_EXIT(1)
720e07dc26bSmrg])# LT_OUTPUT
721e07dc26bSmrg
722e07dc26bSmrg
723e07dc26bSmrg# _LT_CONFIG(TAG)
724e07dc26bSmrg# ---------------
725e07dc26bSmrg# If TAG is the built-in tag, create an initial libtool script with a
726e07dc26bSmrg# default configuration from the untagged config vars.  Otherwise add code
727e07dc26bSmrg# to config.status for appending the configuration named by TAG from the
728e07dc26bSmrg# matching tagged config vars.
729e07dc26bSmrgm4_defun([_LT_CONFIG],
730e07dc26bSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
731e07dc26bSmrg_LT_CONFIG_SAVE_COMMANDS([
732e07dc26bSmrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
733e07dc26bSmrg  m4_if(_LT_TAG, [C], [
734e07dc26bSmrg    # See if we are running on zsh, and set the options that allow our
735e07dc26bSmrg    # commands through without removal of \ escapes.
736e07dc26bSmrg    if test -n "${ZSH_VERSION+set}"; then
737e07dc26bSmrg      setopt NO_GLOB_SUBST
738e07dc26bSmrg    fi
739e07dc26bSmrg
740e07dc26bSmrg    cfgfile=${ofile}T
741e07dc26bSmrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
742e07dc26bSmrg    $RM "$cfgfile"
743e07dc26bSmrg
744e07dc26bSmrg    cat <<_LT_EOF >> "$cfgfile"
745e07dc26bSmrg#! $SHELL
746e07dc26bSmrg# Generated automatically by $as_me ($PACKAGE) $VERSION
747e07dc26bSmrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
748e07dc26bSmrg
749e07dc26bSmrg# Provide generalized library-building support services.
750e07dc26bSmrg# Written by Gordon Matzigkeit, 1996
751e07dc26bSmrg
752e07dc26bSmrg_LT_COPYING
753e07dc26bSmrg_LT_LIBTOOL_TAGS
754e07dc26bSmrg
755e07dc26bSmrg# Configured defaults for sys_lib_dlsearch_path munging.
756e07dc26bSmrg: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
757e07dc26bSmrg
758e07dc26bSmrg# ### BEGIN LIBTOOL CONFIG
759e07dc26bSmrg_LT_LIBTOOL_CONFIG_VARS
760e07dc26bSmrg_LT_LIBTOOL_TAG_VARS
761e07dc26bSmrg# ### END LIBTOOL CONFIG
762e07dc26bSmrg
763e07dc26bSmrg_LT_EOF
764e07dc26bSmrg
765e07dc26bSmrg    cat <<'_LT_EOF' >> "$cfgfile"
766e07dc26bSmrg
767e07dc26bSmrg# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
768e07dc26bSmrg
769e07dc26bSmrg_LT_PREPARE_MUNGE_PATH_LIST
770e07dc26bSmrg_LT_PREPARE_CC_BASENAME
771e07dc26bSmrg
772e07dc26bSmrg# ### END FUNCTIONS SHARED WITH CONFIGURE
773e07dc26bSmrg
774e07dc26bSmrg_LT_EOF
775e07dc26bSmrg
776e07dc26bSmrg  case $host_os in
777e07dc26bSmrg  aix3*)
778e07dc26bSmrg    cat <<\_LT_EOF >> "$cfgfile"
779e07dc26bSmrg# AIX sometimes has problems with the GCC collect2 program.  For some
780e07dc26bSmrg# reason, if we set the COLLECT_NAMES environment variable, the problems
781e07dc26bSmrg# vanish in a puff of smoke.
782e07dc26bSmrgif test set != "${COLLECT_NAMES+set}"; then
783e07dc26bSmrg  COLLECT_NAMES=
784e07dc26bSmrg  export COLLECT_NAMES
785e07dc26bSmrgfi
786e07dc26bSmrg_LT_EOF
787e07dc26bSmrg    ;;
788e07dc26bSmrg  esac
789e07dc26bSmrg
790e07dc26bSmrg  _LT_PROG_LTMAIN
791e07dc26bSmrg
792e07dc26bSmrg  # We use sed instead of cat because bash on DJGPP gets confused if
793e07dc26bSmrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
794e07dc26bSmrg  # text mode, it properly converts lines to CR/LF.  This bash problem
795e07dc26bSmrg  # is reportedly fixed, but why not run on old versions too?
796e07dc26bSmrg  sed '$q' "$ltmain" >> "$cfgfile" \
797e07dc26bSmrg     || (rm -f "$cfgfile"; exit 1)
798e07dc26bSmrg
799e07dc26bSmrg   mv -f "$cfgfile" "$ofile" ||
800e07dc26bSmrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
801e07dc26bSmrg  chmod +x "$ofile"
802e07dc26bSmrg],
803e07dc26bSmrg[cat <<_LT_EOF >> "$ofile"
804e07dc26bSmrg
805e07dc26bSmrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
806e07dc26bSmrgdnl in a comment (ie after a #).
807e07dc26bSmrg# ### BEGIN LIBTOOL TAG CONFIG: $1
808e07dc26bSmrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
809e07dc26bSmrg# ### END LIBTOOL TAG CONFIG: $1
810e07dc26bSmrg_LT_EOF
811e07dc26bSmrg])dnl /m4_if
812e07dc26bSmrg],
813e07dc26bSmrg[m4_if([$1], [], [
814e07dc26bSmrg    PACKAGE='$PACKAGE'
815e07dc26bSmrg    VERSION='$VERSION'
816e07dc26bSmrg    RM='$RM'
817e07dc26bSmrg    ofile='$ofile'], [])
818e07dc26bSmrg])dnl /_LT_CONFIG_SAVE_COMMANDS
819e07dc26bSmrg])# _LT_CONFIG
820e07dc26bSmrg
821e07dc26bSmrg
822e07dc26bSmrg# LT_SUPPORTED_TAG(TAG)
823e07dc26bSmrg# ---------------------
824e07dc26bSmrg# Trace this macro to discover what tags are supported by the libtool
825e07dc26bSmrg# --tag option, using:
826e07dc26bSmrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
827e07dc26bSmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
828e07dc26bSmrg
829e07dc26bSmrg
830e07dc26bSmrg# C support is built-in for now
831e07dc26bSmrgm4_define([_LT_LANG_C_enabled], [])
832e07dc26bSmrgm4_define([_LT_TAGS], [])
833e07dc26bSmrg
834e07dc26bSmrg
835e07dc26bSmrg# LT_LANG(LANG)
836e07dc26bSmrg# -------------
837e07dc26bSmrg# Enable libtool support for the given language if not already enabled.
838e07dc26bSmrgAC_DEFUN([LT_LANG],
839e07dc26bSmrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
840e07dc26bSmrgm4_case([$1],
841e07dc26bSmrg  [C],			[_LT_LANG(C)],
842e07dc26bSmrg  [C++],		[_LT_LANG(CXX)],
843e07dc26bSmrg  [Go],			[_LT_LANG(GO)],
844e07dc26bSmrg  [Java],		[_LT_LANG(GCJ)],
845e07dc26bSmrg  [Fortran 77],		[_LT_LANG(F77)],
846e07dc26bSmrg  [Fortran],		[_LT_LANG(FC)],
847e07dc26bSmrg  [Windows Resource],	[_LT_LANG(RC)],
848e07dc26bSmrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
849e07dc26bSmrg    [_LT_LANG($1)],
850e07dc26bSmrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
851e07dc26bSmrg])# LT_LANG
852e07dc26bSmrg
853e07dc26bSmrg
854e07dc26bSmrg# _LT_LANG(LANGNAME)
855e07dc26bSmrg# ------------------
856e07dc26bSmrgm4_defun([_LT_LANG],
857e07dc26bSmrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
858e07dc26bSmrg  [LT_SUPPORTED_TAG([$1])dnl
859e07dc26bSmrg  m4_append([_LT_TAGS], [$1 ])dnl
860e07dc26bSmrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
861e07dc26bSmrg  _LT_LANG_$1_CONFIG($1)])dnl
862e07dc26bSmrg])# _LT_LANG
863e07dc26bSmrg
864e07dc26bSmrg
865e07dc26bSmrgm4_ifndef([AC_PROG_GO], [
866e07dc26bSmrg# NOTE: This macro has been submitted for inclusion into   #
867e07dc26bSmrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
868e07dc26bSmrg#  a released version of Autoconf we should remove this    #
869e07dc26bSmrg#  macro and use it instead.                               #
870e07dc26bSmrgm4_defun([AC_PROG_GO],
871e07dc26bSmrg[AC_LANG_PUSH(Go)dnl
872e07dc26bSmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
873e07dc26bSmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
874e07dc26bSmrg_AC_ARG_VAR_LDFLAGS()dnl
875e07dc26bSmrgAC_CHECK_TOOL(GOC, gccgo)
876e07dc26bSmrgif test -z "$GOC"; then
877e07dc26bSmrg  if test -n "$ac_tool_prefix"; then
878e07dc26bSmrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
879e07dc26bSmrg  fi
880e07dc26bSmrgfi
881e07dc26bSmrgif test -z "$GOC"; then
882e07dc26bSmrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
883e07dc26bSmrgfi
884e07dc26bSmrg])#m4_defun
885e07dc26bSmrg])#m4_ifndef
886e07dc26bSmrg
887e07dc26bSmrg
888e07dc26bSmrg# _LT_LANG_DEFAULT_CONFIG
889e07dc26bSmrg# -----------------------
890e07dc26bSmrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
891e07dc26bSmrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
892e07dc26bSmrg  [LT_LANG(CXX)],
893e07dc26bSmrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
894e07dc26bSmrg
895e07dc26bSmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
896e07dc26bSmrg  [LT_LANG(F77)],
897e07dc26bSmrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
898e07dc26bSmrg
899e07dc26bSmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
900e07dc26bSmrg  [LT_LANG(FC)],
901e07dc26bSmrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
902e07dc26bSmrg
903e07dc26bSmrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
904e07dc26bSmrgdnl pulling things in needlessly.
905e07dc26bSmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
906e07dc26bSmrg  [LT_LANG(GCJ)],
907e07dc26bSmrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
908e07dc26bSmrg    [LT_LANG(GCJ)],
909e07dc26bSmrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
910e07dc26bSmrg      [LT_LANG(GCJ)],
911e07dc26bSmrg      [m4_ifdef([AC_PROG_GCJ],
912e07dc26bSmrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
913e07dc26bSmrg       m4_ifdef([A][M_PROG_GCJ],
914e07dc26bSmrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
915e07dc26bSmrg       m4_ifdef([LT_PROG_GCJ],
916e07dc26bSmrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
917e07dc26bSmrg
918e07dc26bSmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
919e07dc26bSmrg  [LT_LANG(GO)],
920e07dc26bSmrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
921e07dc26bSmrg
922e07dc26bSmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
923e07dc26bSmrg  [LT_LANG(RC)],
924e07dc26bSmrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
925e07dc26bSmrg])# _LT_LANG_DEFAULT_CONFIG
926e07dc26bSmrg
927e07dc26bSmrg# Obsolete macros:
928e07dc26bSmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
929e07dc26bSmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
930e07dc26bSmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
931e07dc26bSmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
932e07dc26bSmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
933e07dc26bSmrgdnl aclocal-1.4 backwards compatibility:
934e07dc26bSmrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
935e07dc26bSmrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
936e07dc26bSmrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
937e07dc26bSmrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
938e07dc26bSmrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
939e07dc26bSmrg
940e07dc26bSmrg
941e07dc26bSmrg# _LT_TAG_COMPILER
942e07dc26bSmrg# ----------------
943e07dc26bSmrgm4_defun([_LT_TAG_COMPILER],
944e07dc26bSmrg[AC_REQUIRE([AC_PROG_CC])dnl
945e07dc26bSmrg
946e07dc26bSmrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
947e07dc26bSmrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
948e07dc26bSmrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
949e07dc26bSmrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
950e07dc26bSmrg
951e07dc26bSmrg# If no C compiler was specified, use CC.
952e07dc26bSmrgLTCC=${LTCC-"$CC"}
953e07dc26bSmrg
954e07dc26bSmrg# If no C compiler flags were specified, use CFLAGS.
955e07dc26bSmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
956e07dc26bSmrg
957e07dc26bSmrg# Allow CC to be a program name with arguments.
958e07dc26bSmrgcompiler=$CC
959e07dc26bSmrg])# _LT_TAG_COMPILER
960e07dc26bSmrg
961e07dc26bSmrg
962e07dc26bSmrg# _LT_COMPILER_BOILERPLATE
963e07dc26bSmrg# ------------------------
964e07dc26bSmrg# Check for compiler boilerplate output or warnings with
965e07dc26bSmrg# the simple compiler test code.
966e07dc26bSmrgm4_defun([_LT_COMPILER_BOILERPLATE],
967e07dc26bSmrg[m4_require([_LT_DECL_SED])dnl
968e07dc26bSmrgac_outfile=conftest.$ac_objext
969e07dc26bSmrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
970e07dc26bSmrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
971e07dc26bSmrg_lt_compiler_boilerplate=`cat conftest.err`
972e07dc26bSmrg$RM conftest*
973e07dc26bSmrg])# _LT_COMPILER_BOILERPLATE
974e07dc26bSmrg
975e07dc26bSmrg
976e07dc26bSmrg# _LT_LINKER_BOILERPLATE
977e07dc26bSmrg# ----------------------
978e07dc26bSmrg# Check for linker boilerplate output or warnings with
979e07dc26bSmrg# the simple link test code.
980e07dc26bSmrgm4_defun([_LT_LINKER_BOILERPLATE],
981e07dc26bSmrg[m4_require([_LT_DECL_SED])dnl
982e07dc26bSmrgac_outfile=conftest.$ac_objext
983e07dc26bSmrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
984e07dc26bSmrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
985e07dc26bSmrg_lt_linker_boilerplate=`cat conftest.err`
986e07dc26bSmrg$RM -r conftest*
987e07dc26bSmrg])# _LT_LINKER_BOILERPLATE
988e07dc26bSmrg
989e07dc26bSmrg# _LT_REQUIRED_DARWIN_CHECKS
990e07dc26bSmrg# -------------------------
991e07dc26bSmrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
992e07dc26bSmrg  case $host_os in
993e07dc26bSmrg    rhapsody* | darwin*)
994e07dc26bSmrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
995e07dc26bSmrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
996e07dc26bSmrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
997e07dc26bSmrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
998e07dc26bSmrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
999e07dc26bSmrg    _LT_DECL([], [DSYMUTIL], [1],
1000e07dc26bSmrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
1001e07dc26bSmrg    _LT_DECL([], [NMEDIT], [1],
1002e07dc26bSmrg      [Tool to change global to local symbols on Mac OS X])
1003e07dc26bSmrg    _LT_DECL([], [LIPO], [1],
1004e07dc26bSmrg      [Tool to manipulate fat objects and archives on Mac OS X])
1005e07dc26bSmrg    _LT_DECL([], [OTOOL], [1],
1006e07dc26bSmrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
1007e07dc26bSmrg    _LT_DECL([], [OTOOL64], [1],
1008e07dc26bSmrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
1009e07dc26bSmrg
1010e07dc26bSmrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
1011e07dc26bSmrg      [lt_cv_apple_cc_single_mod=no
1012e07dc26bSmrg      if test -z "$LT_MULTI_MODULE"; then
1013e07dc26bSmrg	# By default we will add the -single_module flag. You can override
1014e07dc26bSmrg	# by either setting the environment variable LT_MULTI_MODULE
1015e07dc26bSmrg	# non-empty at configure time, or by adding -multi_module to the
1016e07dc26bSmrg	# link flags.
1017e07dc26bSmrg	rm -rf libconftest.dylib*
1018e07dc26bSmrg	echo "int foo(void){return 1;}" > conftest.c
1019e07dc26bSmrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1020e07dc26bSmrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
1021e07dc26bSmrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1022e07dc26bSmrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
1023e07dc26bSmrg        _lt_result=$?
1024e07dc26bSmrg	# If there is a non-empty error log, and "single_module"
1025e07dc26bSmrg	# appears in it, assume the flag caused a linker warning
1026e07dc26bSmrg        if test -s conftest.err && $GREP single_module conftest.err; then
1027e07dc26bSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
1028e07dc26bSmrg	# Otherwise, if the output was created with a 0 exit code from
1029e07dc26bSmrg	# the compiler, it worked.
1030e07dc26bSmrg	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
1031e07dc26bSmrg	  lt_cv_apple_cc_single_mod=yes
1032e07dc26bSmrg	else
1033e07dc26bSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
1034e07dc26bSmrg	fi
1035e07dc26bSmrg	rm -rf libconftest.dylib*
1036e07dc26bSmrg	rm -f conftest.*
1037e07dc26bSmrg      fi])
1038e07dc26bSmrg
1039e07dc26bSmrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
1040e07dc26bSmrg      [lt_cv_ld_exported_symbols_list],
1041e07dc26bSmrg      [lt_cv_ld_exported_symbols_list=no
1042e07dc26bSmrg      save_LDFLAGS=$LDFLAGS
1043e07dc26bSmrg      echo "_main" > conftest.sym
1044e07dc26bSmrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
1045e07dc26bSmrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
1046e07dc26bSmrg	[lt_cv_ld_exported_symbols_list=yes],
1047e07dc26bSmrg	[lt_cv_ld_exported_symbols_list=no])
1048e07dc26bSmrg	LDFLAGS=$save_LDFLAGS
1049e07dc26bSmrg    ])
1050e07dc26bSmrg
1051e07dc26bSmrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
1052e07dc26bSmrg      [lt_cv_ld_force_load=no
1053e07dc26bSmrg      cat > conftest.c << _LT_EOF
1054e07dc26bSmrgint forced_loaded() { return 2;}
1055e07dc26bSmrg_LT_EOF
1056e07dc26bSmrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
1057e07dc26bSmrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
1058e07dc26bSmrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
1059e07dc26bSmrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
1060e07dc26bSmrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
1061e07dc26bSmrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
1062e07dc26bSmrg      cat > conftest.c << _LT_EOF
1063e07dc26bSmrgint main() { return 0;}
1064e07dc26bSmrg_LT_EOF
1065e07dc26bSmrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
1066e07dc26bSmrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
1067e07dc26bSmrg      _lt_result=$?
1068e07dc26bSmrg      if test -s conftest.err && $GREP force_load conftest.err; then
1069e07dc26bSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
1070e07dc26bSmrg      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
1071e07dc26bSmrg	lt_cv_ld_force_load=yes
1072e07dc26bSmrg      else
1073e07dc26bSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
1074e07dc26bSmrg      fi
1075e07dc26bSmrg        rm -f conftest.err libconftest.a conftest conftest.c
1076e07dc26bSmrg        rm -rf conftest.dSYM
1077e07dc26bSmrg    ])
1078e07dc26bSmrg    case $host_os in
1079e07dc26bSmrg    rhapsody* | darwin1.[[012]])
1080e07dc26bSmrg      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
1081e07dc26bSmrg    darwin1.*)
1082e07dc26bSmrg      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1083e07dc26bSmrg    darwin*) # darwin 5.x on
1084e07dc26bSmrg      # if running on 10.5 or later, the deployment target defaults
1085e07dc26bSmrg      # to the OS version, if on x86, and 10.4, the deployment
1086e07dc26bSmrg      # target defaults to 10.4. Don't you love it?
1087e07dc26bSmrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
1088e07dc26bSmrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
1089e07dc26bSmrg	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1090e07dc26bSmrg	10.[[012]][[,.]]*)
1091e07dc26bSmrg	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1092e07dc26bSmrg	10.*)
1093e07dc26bSmrg	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1094e07dc26bSmrg      esac
1095e07dc26bSmrg    ;;
1096e07dc26bSmrg  esac
1097e07dc26bSmrg    if test yes = "$lt_cv_apple_cc_single_mod"; then
1098e07dc26bSmrg      _lt_dar_single_mod='$single_module'
1099e07dc26bSmrg    fi
1100e07dc26bSmrg    if test yes = "$lt_cv_ld_exported_symbols_list"; then
1101e07dc26bSmrg      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
1102e07dc26bSmrg    else
1103e07dc26bSmrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
1104e07dc26bSmrg    fi
1105e07dc26bSmrg    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
1106e07dc26bSmrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
1107e07dc26bSmrg    else
1108e07dc26bSmrg      _lt_dsymutil=
1109e07dc26bSmrg    fi
1110e07dc26bSmrg    ;;
1111e07dc26bSmrg  esac
1112e07dc26bSmrg])
1113e07dc26bSmrg
1114e07dc26bSmrg
1115e07dc26bSmrg# _LT_DARWIN_LINKER_FEATURES([TAG])
1116e07dc26bSmrg# ---------------------------------
1117e07dc26bSmrg# Checks for linker and compiler features on darwin
1118e07dc26bSmrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
1119e07dc26bSmrg[
1120e07dc26bSmrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1121e07dc26bSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1122e07dc26bSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
1123e07dc26bSmrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
1124e07dc26bSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1125e07dc26bSmrg  if test yes = "$lt_cv_ld_force_load"; then
1126e07dc26bSmrg    _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\"`'
1127e07dc26bSmrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
1128e07dc26bSmrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
1129e07dc26bSmrg  else
1130e07dc26bSmrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1131e07dc26bSmrg  fi
1132e07dc26bSmrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
1133e07dc26bSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
1134e07dc26bSmrg  case $cc_basename in
1135e07dc26bSmrg     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
1136e07dc26bSmrg     *) _lt_dar_can_shared=$GCC ;;
1137e07dc26bSmrg  esac
1138e07dc26bSmrg  if test yes = "$_lt_dar_can_shared"; then
1139e07dc26bSmrg    output_verbose_link_cmd=func_echo_all
1140e07dc26bSmrg    _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"
1141e07dc26bSmrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
1142e07dc26bSmrg    _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"
1143e07dc26bSmrg    _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"
1144e07dc26bSmrg    m4_if([$1], [CXX],
1145e07dc26bSmrg[   if test yes != "$lt_cv_apple_cc_single_mod"; then
1146e07dc26bSmrg      _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"
1147e07dc26bSmrg      _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"
1148e07dc26bSmrg    fi
1149e07dc26bSmrg],[])
1150e07dc26bSmrg  else
1151e07dc26bSmrg  _LT_TAGVAR(ld_shlibs, $1)=no
1152e07dc26bSmrg  fi
1153e07dc26bSmrg])
1154e07dc26bSmrg
1155e07dc26bSmrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
1156e07dc26bSmrg# ----------------------------------
1157e07dc26bSmrg# Links a minimal program and checks the executable
1158e07dc26bSmrg# for the system default hardcoded library path. In most cases,
1159e07dc26bSmrg# this is /usr/lib:/lib, but when the MPI compilers are used
1160e07dc26bSmrg# the location of the communication and MPI libs are included too.
1161e07dc26bSmrg# If we don't find anything, use the default library path according
1162e07dc26bSmrg# to the aix ld manual.
1163e07dc26bSmrg# Store the results from the different compilers for each TAGNAME.
1164e07dc26bSmrg# Allow to override them for all tags through lt_cv_aix_libpath.
1165e07dc26bSmrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
1166e07dc26bSmrg[m4_require([_LT_DECL_SED])dnl
1167e07dc26bSmrgif test set = "${lt_cv_aix_libpath+set}"; then
1168e07dc26bSmrg  aix_libpath=$lt_cv_aix_libpath
1169e07dc26bSmrgelse
1170e07dc26bSmrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
1171e07dc26bSmrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
1172e07dc26bSmrg  lt_aix_libpath_sed='[
1173e07dc26bSmrg      /Import File Strings/,/^$/ {
1174e07dc26bSmrg	  /^0/ {
1175e07dc26bSmrg	      s/^0  *\([^ ]*\) *$/\1/
1176e07dc26bSmrg	      p
1177e07dc26bSmrg	  }
1178e07dc26bSmrg      }]'
1179e07dc26bSmrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1180e07dc26bSmrg  # Check for a 64-bit object if we didn't find anything.
1181e07dc26bSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1182e07dc26bSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1183e07dc26bSmrg  fi],[])
1184e07dc26bSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1185e07dc26bSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
1186e07dc26bSmrg  fi
1187e07dc26bSmrg  ])
1188e07dc26bSmrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
1189e07dc26bSmrgfi
1190e07dc26bSmrg])# _LT_SYS_MODULE_PATH_AIX
1191e07dc26bSmrg
1192e07dc26bSmrg
1193e07dc26bSmrg# _LT_SHELL_INIT(ARG)
1194e07dc26bSmrg# -------------------
1195e07dc26bSmrgm4_define([_LT_SHELL_INIT],
1196e07dc26bSmrg[m4_divert_text([M4SH-INIT], [$1
1197e07dc26bSmrg])])# _LT_SHELL_INIT
1198e07dc26bSmrg
1199e07dc26bSmrg
1200e07dc26bSmrg
1201e07dc26bSmrg# _LT_PROG_ECHO_BACKSLASH
1202e07dc26bSmrg# -----------------------
1203e07dc26bSmrg# Find how we can fake an echo command that does not interpret backslash.
1204e07dc26bSmrg# In particular, with Autoconf 2.60 or later we add some code to the start
1205e07dc26bSmrg# of the generated configure script that will find a shell with a builtin
1206e07dc26bSmrg# printf (that we can use as an echo command).
1207e07dc26bSmrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
1208e07dc26bSmrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1209e07dc26bSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1210e07dc26bSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1211e07dc26bSmrg
1212e07dc26bSmrgAC_MSG_CHECKING([how to print strings])
1213e07dc26bSmrg# Test print first, because it will be a builtin if present.
1214e07dc26bSmrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
1215e07dc26bSmrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
1216e07dc26bSmrg  ECHO='print -r --'
1217e07dc26bSmrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
1218e07dc26bSmrg  ECHO='printf %s\n'
1219e07dc26bSmrgelse
1220e07dc26bSmrg  # Use this function as a fallback that always works.
1221e07dc26bSmrg  func_fallback_echo ()
1222e07dc26bSmrg  {
1223e07dc26bSmrg    eval 'cat <<_LTECHO_EOF
1224e07dc26bSmrg$[]1
1225e07dc26bSmrg_LTECHO_EOF'
1226e07dc26bSmrg  }
1227e07dc26bSmrg  ECHO='func_fallback_echo'
1228e07dc26bSmrgfi
1229e07dc26bSmrg
1230e07dc26bSmrg# func_echo_all arg...
1231e07dc26bSmrg# Invoke $ECHO with all args, space-separated.
1232e07dc26bSmrgfunc_echo_all ()
1233e07dc26bSmrg{
1234e07dc26bSmrg    $ECHO "$*"
1235e07dc26bSmrg}
1236e07dc26bSmrg
1237e07dc26bSmrgcase $ECHO in
1238e07dc26bSmrg  printf*) AC_MSG_RESULT([printf]) ;;
1239e07dc26bSmrg  print*) AC_MSG_RESULT([print -r]) ;;
1240e07dc26bSmrg  *) AC_MSG_RESULT([cat]) ;;
1241e07dc26bSmrgesac
1242e07dc26bSmrg
1243e07dc26bSmrgm4_ifdef([_AS_DETECT_SUGGESTED],
1244e07dc26bSmrg[_AS_DETECT_SUGGESTED([
1245e07dc26bSmrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
1246e07dc26bSmrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1247e07dc26bSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1248e07dc26bSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1249e07dc26bSmrg    PATH=/empty FPATH=/empty; export PATH FPATH
1250e07dc26bSmrg    test "X`printf %s $ECHO`" = "X$ECHO" \
1251e07dc26bSmrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
1252e07dc26bSmrg
1253e07dc26bSmrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1254e07dc26bSmrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
1255e07dc26bSmrg])# _LT_PROG_ECHO_BACKSLASH
1256e07dc26bSmrg
1257e07dc26bSmrg
1258e07dc26bSmrg# _LT_WITH_SYSROOT
1259e07dc26bSmrg# ----------------
1260e07dc26bSmrgAC_DEFUN([_LT_WITH_SYSROOT],
1261e07dc26bSmrg[AC_MSG_CHECKING([for sysroot])
1262e07dc26bSmrgAC_ARG_WITH([sysroot],
1263e07dc26bSmrg[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
1264e07dc26bSmrg  [Search for dependent libraries within DIR (or the compiler's sysroot
1265e07dc26bSmrg   if not specified).])],
1266e07dc26bSmrg[], [with_sysroot=no])
1267e07dc26bSmrg
1268e07dc26bSmrgdnl lt_sysroot will always be passed unquoted.  We quote it here
1269e07dc26bSmrgdnl in case the user passed a directory name.
1270e07dc26bSmrglt_sysroot=
1271e07dc26bSmrgcase $with_sysroot in #(
1272e07dc26bSmrg yes)
1273e07dc26bSmrg   if test yes = "$GCC"; then
1274e07dc26bSmrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
1275e07dc26bSmrg   fi
1276e07dc26bSmrg   ;; #(
1277e07dc26bSmrg /*)
1278e07dc26bSmrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
1279e07dc26bSmrg   ;; #(
1280e07dc26bSmrg no|'')
1281e07dc26bSmrg   ;; #(
1282e07dc26bSmrg *)
1283e07dc26bSmrg   AC_MSG_RESULT([$with_sysroot])
1284e07dc26bSmrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
1285e07dc26bSmrg   ;;
1286e07dc26bSmrgesac
1287e07dc26bSmrg
1288e07dc26bSmrg AC_MSG_RESULT([${lt_sysroot:-no}])
1289e07dc26bSmrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
1290e07dc26bSmrg[dependent libraries, and where our libraries should be installed.])])
1291e07dc26bSmrg
1292e07dc26bSmrg# _LT_ENABLE_LOCK
1293e07dc26bSmrg# ---------------
1294e07dc26bSmrgm4_defun([_LT_ENABLE_LOCK],
1295e07dc26bSmrg[AC_ARG_ENABLE([libtool-lock],
1296e07dc26bSmrg  [AS_HELP_STRING([--disable-libtool-lock],
1297e07dc26bSmrg    [avoid locking (might break parallel builds)])])
1298e07dc26bSmrgtest no = "$enable_libtool_lock" || enable_libtool_lock=yes
1299e07dc26bSmrg
1300e07dc26bSmrg# Some flags need to be propagated to the compiler or linker for good
1301e07dc26bSmrg# libtool support.
1302e07dc26bSmrgcase $host in
1303e07dc26bSmrgia64-*-hpux*)
1304e07dc26bSmrg  # Find out what ABI is being produced by ac_compile, and set mode
1305e07dc26bSmrg  # options accordingly.
1306e07dc26bSmrg  echo 'int i;' > conftest.$ac_ext
1307e07dc26bSmrg  if AC_TRY_EVAL(ac_compile); then
1308e07dc26bSmrg    case `/usr/bin/file conftest.$ac_objext` in
1309e07dc26bSmrg      *ELF-32*)
1310e07dc26bSmrg	HPUX_IA64_MODE=32
1311e07dc26bSmrg	;;
1312e07dc26bSmrg      *ELF-64*)
1313e07dc26bSmrg	HPUX_IA64_MODE=64
1314e07dc26bSmrg	;;
1315e07dc26bSmrg    esac
1316e07dc26bSmrg  fi
1317e07dc26bSmrg  rm -rf conftest*
1318e07dc26bSmrg  ;;
1319e07dc26bSmrg*-*-irix6*)
1320e07dc26bSmrg  # Find out what ABI is being produced by ac_compile, and set linker
1321e07dc26bSmrg  # options accordingly.
1322e07dc26bSmrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1323e07dc26bSmrg  if AC_TRY_EVAL(ac_compile); then
1324e07dc26bSmrg    if test yes = "$lt_cv_prog_gnu_ld"; then
1325e07dc26bSmrg      case `/usr/bin/file conftest.$ac_objext` in
1326e07dc26bSmrg	*32-bit*)
1327e07dc26bSmrg	  LD="${LD-ld} -melf32bsmip"
1328e07dc26bSmrg	  ;;
1329e07dc26bSmrg	*N32*)
1330e07dc26bSmrg	  LD="${LD-ld} -melf32bmipn32"
1331e07dc26bSmrg	  ;;
1332e07dc26bSmrg	*64-bit*)
1333e07dc26bSmrg	  LD="${LD-ld} -melf64bmip"
1334e07dc26bSmrg	;;
1335e07dc26bSmrg      esac
1336e07dc26bSmrg    else
1337e07dc26bSmrg      case `/usr/bin/file conftest.$ac_objext` in
1338e07dc26bSmrg	*32-bit*)
1339e07dc26bSmrg	  LD="${LD-ld} -32"
1340e07dc26bSmrg	  ;;
1341e07dc26bSmrg	*N32*)
1342e07dc26bSmrg	  LD="${LD-ld} -n32"
1343e07dc26bSmrg	  ;;
1344e07dc26bSmrg	*64-bit*)
1345e07dc26bSmrg	  LD="${LD-ld} -64"
1346e07dc26bSmrg	  ;;
1347e07dc26bSmrg      esac
1348e07dc26bSmrg    fi
1349e07dc26bSmrg  fi
1350e07dc26bSmrg  rm -rf conftest*
1351e07dc26bSmrg  ;;
1352e07dc26bSmrg
1353e07dc26bSmrgmips64*-*linux*)
1354e07dc26bSmrg  # Find out what ABI is being produced by ac_compile, and set linker
1355e07dc26bSmrg  # options accordingly.
1356e07dc26bSmrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1357e07dc26bSmrg  if AC_TRY_EVAL(ac_compile); then
1358e07dc26bSmrg    emul=elf
1359e07dc26bSmrg    case `/usr/bin/file conftest.$ac_objext` in
1360e07dc26bSmrg      *32-bit*)
1361e07dc26bSmrg	emul="${emul}32"
1362e07dc26bSmrg	;;
1363e07dc26bSmrg      *64-bit*)
1364e07dc26bSmrg	emul="${emul}64"
1365e07dc26bSmrg	;;
1366e07dc26bSmrg    esac
1367e07dc26bSmrg    case `/usr/bin/file conftest.$ac_objext` in
1368e07dc26bSmrg      *MSB*)
1369e07dc26bSmrg	emul="${emul}btsmip"
1370e07dc26bSmrg	;;
1371e07dc26bSmrg      *LSB*)
1372e07dc26bSmrg	emul="${emul}ltsmip"
1373e07dc26bSmrg	;;
1374e07dc26bSmrg    esac
1375e07dc26bSmrg    case `/usr/bin/file conftest.$ac_objext` in
1376e07dc26bSmrg      *N32*)
1377e07dc26bSmrg	emul="${emul}n32"
1378e07dc26bSmrg	;;
1379e07dc26bSmrg    esac
1380e07dc26bSmrg    LD="${LD-ld} -m $emul"
1381e07dc26bSmrg  fi
1382e07dc26bSmrg  rm -rf conftest*
1383e07dc26bSmrg  ;;
1384e07dc26bSmrg
1385e07dc26bSmrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
1386e07dc26bSmrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1387e07dc26bSmrg  # Find out what ABI is being produced by ac_compile, and set linker
1388e07dc26bSmrg  # options accordingly.  Note that the listed cases only cover the
1389e07dc26bSmrg  # situations where additional linker options are needed (such as when
1390e07dc26bSmrg  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
1391e07dc26bSmrg  # vice versa); the common cases where no linker options are needed do
1392e07dc26bSmrg  # not appear in the list.
1393e07dc26bSmrg  echo 'int i;' > conftest.$ac_ext
1394e07dc26bSmrg  if AC_TRY_EVAL(ac_compile); then
1395e07dc26bSmrg    case `/usr/bin/file conftest.o` in
1396e07dc26bSmrg      *32-bit*)
1397e07dc26bSmrg	case $host in
1398e07dc26bSmrg	  x86_64-*kfreebsd*-gnu)
1399e07dc26bSmrg	    LD="${LD-ld} -m elf_i386_fbsd"
1400e07dc26bSmrg	    ;;
1401e07dc26bSmrg	  x86_64-*linux*)
1402e07dc26bSmrg	    case `/usr/bin/file conftest.o` in
1403e07dc26bSmrg	      *x86-64*)
1404e07dc26bSmrg		LD="${LD-ld} -m elf32_x86_64"
1405e07dc26bSmrg		;;
1406e07dc26bSmrg	      *)
1407e07dc26bSmrg		LD="${LD-ld} -m elf_i386"
1408e07dc26bSmrg		;;
1409e07dc26bSmrg	    esac
1410e07dc26bSmrg	    ;;
1411e07dc26bSmrg	  powerpc64le-*linux*)
1412e07dc26bSmrg	    LD="${LD-ld} -m elf32lppclinux"
1413e07dc26bSmrg	    ;;
1414e07dc26bSmrg	  powerpc64-*linux*)
1415e07dc26bSmrg	    LD="${LD-ld} -m elf32ppclinux"
1416e07dc26bSmrg	    ;;
1417e07dc26bSmrg	  s390x-*linux*)
1418e07dc26bSmrg	    LD="${LD-ld} -m elf_s390"
1419e07dc26bSmrg	    ;;
1420e07dc26bSmrg	  sparc64-*linux*)
1421e07dc26bSmrg	    LD="${LD-ld} -m elf32_sparc"
1422e07dc26bSmrg	    ;;
1423e07dc26bSmrg	esac
1424e07dc26bSmrg	;;
1425e07dc26bSmrg      *64-bit*)
1426e07dc26bSmrg	case $host in
1427e07dc26bSmrg	  x86_64-*kfreebsd*-gnu)
1428e07dc26bSmrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
1429e07dc26bSmrg	    ;;
1430e07dc26bSmrg	  x86_64-*linux*)
1431e07dc26bSmrg	    LD="${LD-ld} -m elf_x86_64"
1432e07dc26bSmrg	    ;;
1433e07dc26bSmrg	  powerpcle-*linux*)
1434e07dc26bSmrg	    LD="${LD-ld} -m elf64lppc"
1435e07dc26bSmrg	    ;;
1436e07dc26bSmrg	  powerpc-*linux*)
1437e07dc26bSmrg	    LD="${LD-ld} -m elf64ppc"
1438e07dc26bSmrg	    ;;
1439e07dc26bSmrg	  s390*-*linux*|s390*-*tpf*)
1440e07dc26bSmrg	    LD="${LD-ld} -m elf64_s390"
1441e07dc26bSmrg	    ;;
1442e07dc26bSmrg	  sparc*-*linux*)
1443e07dc26bSmrg	    LD="${LD-ld} -m elf64_sparc"
1444e07dc26bSmrg	    ;;
1445e07dc26bSmrg	esac
1446e07dc26bSmrg	;;
1447e07dc26bSmrg    esac
1448e07dc26bSmrg  fi
1449e07dc26bSmrg  rm -rf conftest*
1450e07dc26bSmrg  ;;
1451e07dc26bSmrg
1452e07dc26bSmrg*-*-sco3.2v5*)
1453e07dc26bSmrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1454e07dc26bSmrg  SAVE_CFLAGS=$CFLAGS
1455e07dc26bSmrg  CFLAGS="$CFLAGS -belf"
1456e07dc26bSmrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1457e07dc26bSmrg    [AC_LANG_PUSH(C)
1458e07dc26bSmrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1459e07dc26bSmrg     AC_LANG_POP])
1460e07dc26bSmrg  if test yes != "$lt_cv_cc_needs_belf"; then
1461e07dc26bSmrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1462e07dc26bSmrg    CFLAGS=$SAVE_CFLAGS
1463e07dc26bSmrg  fi
1464e07dc26bSmrg  ;;
1465e07dc26bSmrg*-*solaris*)
1466e07dc26bSmrg  # Find out what ABI is being produced by ac_compile, and set linker
1467e07dc26bSmrg  # options accordingly.
1468e07dc26bSmrg  echo 'int i;' > conftest.$ac_ext
1469e07dc26bSmrg  if AC_TRY_EVAL(ac_compile); then
1470e07dc26bSmrg    case `/usr/bin/file conftest.o` in
1471e07dc26bSmrg    *64-bit*)
1472e07dc26bSmrg      case $lt_cv_prog_gnu_ld in
1473e07dc26bSmrg      yes*)
1474e07dc26bSmrg        case $host in
1475e07dc26bSmrg        i?86-*-solaris*|x86_64-*-solaris*)
1476e07dc26bSmrg          LD="${LD-ld} -m elf_x86_64"
1477e07dc26bSmrg          ;;
1478e07dc26bSmrg        sparc*-*-solaris*)
1479e07dc26bSmrg          LD="${LD-ld} -m elf64_sparc"
1480e07dc26bSmrg          ;;
1481e07dc26bSmrg        esac
1482e07dc26bSmrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
1483e07dc26bSmrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
1484e07dc26bSmrg          LD=${LD-ld}_sol2
1485e07dc26bSmrg        fi
1486e07dc26bSmrg        ;;
1487e07dc26bSmrg      *)
1488e07dc26bSmrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1489e07dc26bSmrg	  LD="${LD-ld} -64"
1490e07dc26bSmrg	fi
1491e07dc26bSmrg	;;
1492e07dc26bSmrg      esac
1493e07dc26bSmrg      ;;
1494e07dc26bSmrg    esac
1495e07dc26bSmrg  fi
1496e07dc26bSmrg  rm -rf conftest*
1497e07dc26bSmrg  ;;
1498e07dc26bSmrgesac
1499e07dc26bSmrg
1500e07dc26bSmrgneed_locks=$enable_libtool_lock
1501e07dc26bSmrg])# _LT_ENABLE_LOCK
1502e07dc26bSmrg
1503e07dc26bSmrg
1504e07dc26bSmrg# _LT_PROG_AR
1505e07dc26bSmrg# -----------
1506e07dc26bSmrgm4_defun([_LT_PROG_AR],
1507e07dc26bSmrg[AC_CHECK_TOOLS(AR, [ar], false)
1508e07dc26bSmrg: ${AR=ar}
1509e07dc26bSmrg: ${AR_FLAGS=cru}
1510e07dc26bSmrg_LT_DECL([], [AR], [1], [The archiver])
1511e07dc26bSmrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
1512e07dc26bSmrg
1513e07dc26bSmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
1514e07dc26bSmrg  [lt_cv_ar_at_file=no
1515e07dc26bSmrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
1516e07dc26bSmrg     [echo conftest.$ac_objext > conftest.lst
1517e07dc26bSmrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
1518e07dc26bSmrg      AC_TRY_EVAL([lt_ar_try])
1519e07dc26bSmrg      if test 0 -eq "$ac_status"; then
1520e07dc26bSmrg	# Ensure the archiver fails upon bogus file names.
1521e07dc26bSmrg	rm -f conftest.$ac_objext libconftest.a
1522e07dc26bSmrg	AC_TRY_EVAL([lt_ar_try])
1523e07dc26bSmrg	if test 0 -ne "$ac_status"; then
1524e07dc26bSmrg          lt_cv_ar_at_file=@
1525e07dc26bSmrg        fi
1526e07dc26bSmrg      fi
1527e07dc26bSmrg      rm -f conftest.* libconftest.a
1528e07dc26bSmrg     ])
1529e07dc26bSmrg  ])
1530e07dc26bSmrg
1531e07dc26bSmrgif test no = "$lt_cv_ar_at_file"; then
1532e07dc26bSmrg  archiver_list_spec=
1533e07dc26bSmrgelse
1534e07dc26bSmrg  archiver_list_spec=$lt_cv_ar_at_file
1535e07dc26bSmrgfi
1536e07dc26bSmrg_LT_DECL([], [archiver_list_spec], [1],
1537e07dc26bSmrg  [How to feed a file listing to the archiver])
1538e07dc26bSmrg])# _LT_PROG_AR
1539e07dc26bSmrg
1540e07dc26bSmrg
1541e07dc26bSmrg# _LT_CMD_OLD_ARCHIVE
1542e07dc26bSmrg# -------------------
1543e07dc26bSmrgm4_defun([_LT_CMD_OLD_ARCHIVE],
1544e07dc26bSmrg[_LT_PROG_AR
1545e07dc26bSmrg
1546e07dc26bSmrgAC_CHECK_TOOL(STRIP, strip, :)
1547e07dc26bSmrgtest -z "$STRIP" && STRIP=:
1548e07dc26bSmrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1549e07dc26bSmrg
1550e07dc26bSmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
1551e07dc26bSmrgtest -z "$RANLIB" && RANLIB=:
1552e07dc26bSmrg_LT_DECL([], [RANLIB], [1],
1553e07dc26bSmrg    [Commands used to install an old-style archive])
1554e07dc26bSmrg
1555e07dc26bSmrg# Determine commands to create old-style static archives.
1556e07dc26bSmrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1557e07dc26bSmrgold_postinstall_cmds='chmod 644 $oldlib'
1558e07dc26bSmrgold_postuninstall_cmds=
1559e07dc26bSmrg
1560e07dc26bSmrgif test -n "$RANLIB"; then
1561e07dc26bSmrg  case $host_os in
1562e07dc26bSmrg  bitrig* | openbsd*)
1563e07dc26bSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
1564e07dc26bSmrg    ;;
1565e07dc26bSmrg  *)
1566e07dc26bSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
1567e07dc26bSmrg    ;;
1568e07dc26bSmrg  esac
1569e07dc26bSmrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
1570e07dc26bSmrgfi
1571e07dc26bSmrg
1572e07dc26bSmrgcase $host_os in
1573e07dc26bSmrg  darwin*)
1574e07dc26bSmrg    lock_old_archive_extraction=yes ;;
1575e07dc26bSmrg  *)
1576e07dc26bSmrg    lock_old_archive_extraction=no ;;
1577e07dc26bSmrgesac
1578e07dc26bSmrg_LT_DECL([], [old_postinstall_cmds], [2])
1579e07dc26bSmrg_LT_DECL([], [old_postuninstall_cmds], [2])
1580e07dc26bSmrg_LT_TAGDECL([], [old_archive_cmds], [2],
1581e07dc26bSmrg    [Commands used to build an old-style archive])
1582e07dc26bSmrg_LT_DECL([], [lock_old_archive_extraction], [0],
1583e07dc26bSmrg    [Whether to use a lock for old archive extraction])
1584e07dc26bSmrg])# _LT_CMD_OLD_ARCHIVE
1585e07dc26bSmrg
1586e07dc26bSmrg
1587e07dc26bSmrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1588e07dc26bSmrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1589e07dc26bSmrg# ----------------------------------------------------------------
1590e07dc26bSmrg# Check whether the given compiler option works
1591e07dc26bSmrgAC_DEFUN([_LT_COMPILER_OPTION],
1592e07dc26bSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1593e07dc26bSmrgm4_require([_LT_DECL_SED])dnl
1594e07dc26bSmrgAC_CACHE_CHECK([$1], [$2],
1595e07dc26bSmrg  [$2=no
1596e07dc26bSmrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1597e07dc26bSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1598e07dc26bSmrg   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
1599e07dc26bSmrg   # Insert the option either (1) after the last *FLAGS variable, or
1600e07dc26bSmrg   # (2) before a word containing "conftest.", or (3) at the end.
1601e07dc26bSmrg   # Note that $ac_compile itself does not contain backslashes and begins
1602e07dc26bSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
1603e07dc26bSmrg   # The option is referenced via a variable to avoid confusing sed.
1604e07dc26bSmrg   lt_compile=`echo "$ac_compile" | $SED \
1605e07dc26bSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1606e07dc26bSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1607e07dc26bSmrg   -e 's:$: $lt_compiler_flag:'`
1608e07dc26bSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1609e07dc26bSmrg   (eval "$lt_compile" 2>conftest.err)
1610e07dc26bSmrg   ac_status=$?
1611e07dc26bSmrg   cat conftest.err >&AS_MESSAGE_LOG_FD
1612e07dc26bSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1613e07dc26bSmrg   if (exit $ac_status) && test -s "$ac_outfile"; then
1614e07dc26bSmrg     # The compiler can only warn and ignore the option if not recognized
1615e07dc26bSmrg     # So say no if there are warnings other than the usual output.
1616e07dc26bSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
1617e07dc26bSmrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1618e07dc26bSmrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1619e07dc26bSmrg       $2=yes
1620e07dc26bSmrg     fi
1621e07dc26bSmrg   fi
1622e07dc26bSmrg   $RM conftest*
1623e07dc26bSmrg])
1624e07dc26bSmrg
1625e07dc26bSmrgif test yes = "[$]$2"; then
1626e07dc26bSmrg    m4_if([$5], , :, [$5])
1627e07dc26bSmrgelse
1628e07dc26bSmrg    m4_if([$6], , :, [$6])
1629e07dc26bSmrgfi
1630e07dc26bSmrg])# _LT_COMPILER_OPTION
1631e07dc26bSmrg
1632e07dc26bSmrg# Old name:
1633e07dc26bSmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1634e07dc26bSmrgdnl aclocal-1.4 backwards compatibility:
1635e07dc26bSmrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1636e07dc26bSmrg
1637e07dc26bSmrg
1638e07dc26bSmrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1639e07dc26bSmrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
1640e07dc26bSmrg# ----------------------------------------------------
1641e07dc26bSmrg# Check whether the given linker option works
1642e07dc26bSmrgAC_DEFUN([_LT_LINKER_OPTION],
1643e07dc26bSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1644e07dc26bSmrgm4_require([_LT_DECL_SED])dnl
1645e07dc26bSmrgAC_CACHE_CHECK([$1], [$2],
1646e07dc26bSmrg  [$2=no
1647e07dc26bSmrg   save_LDFLAGS=$LDFLAGS
1648e07dc26bSmrg   LDFLAGS="$LDFLAGS $3"
1649e07dc26bSmrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
1650e07dc26bSmrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1651e07dc26bSmrg     # The linker can only warn and ignore the option if not recognized
1652e07dc26bSmrg     # So say no if there are warnings
1653e07dc26bSmrg     if test -s conftest.err; then
1654e07dc26bSmrg       # Append any errors to the config.log.
1655e07dc26bSmrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
1656e07dc26bSmrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
1657e07dc26bSmrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1658e07dc26bSmrg       if diff conftest.exp conftest.er2 >/dev/null; then
1659e07dc26bSmrg         $2=yes
1660e07dc26bSmrg       fi
1661e07dc26bSmrg     else
1662e07dc26bSmrg       $2=yes
1663e07dc26bSmrg     fi
1664e07dc26bSmrg   fi
1665e07dc26bSmrg   $RM -r conftest*
1666e07dc26bSmrg   LDFLAGS=$save_LDFLAGS
1667e07dc26bSmrg])
1668e07dc26bSmrg
1669e07dc26bSmrgif test yes = "[$]$2"; then
1670e07dc26bSmrg    m4_if([$4], , :, [$4])
1671e07dc26bSmrgelse
1672e07dc26bSmrg    m4_if([$5], , :, [$5])
1673e07dc26bSmrgfi
1674e07dc26bSmrg])# _LT_LINKER_OPTION
1675e07dc26bSmrg
1676e07dc26bSmrg# Old name:
1677e07dc26bSmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1678e07dc26bSmrgdnl aclocal-1.4 backwards compatibility:
1679e07dc26bSmrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1680e07dc26bSmrg
1681e07dc26bSmrg
1682e07dc26bSmrg# LT_CMD_MAX_LEN
1683e07dc26bSmrg#---------------
1684e07dc26bSmrgAC_DEFUN([LT_CMD_MAX_LEN],
1685e07dc26bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1686e07dc26bSmrg# find the maximum length of command line arguments
1687e07dc26bSmrgAC_MSG_CHECKING([the maximum length of command line arguments])
1688e07dc26bSmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1689e07dc26bSmrg  i=0
1690e07dc26bSmrg  teststring=ABCD
1691e07dc26bSmrg
1692e07dc26bSmrg  case $build_os in
1693e07dc26bSmrg  msdosdjgpp*)
1694e07dc26bSmrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
1695e07dc26bSmrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
1696e07dc26bSmrg    # during glob expansion).  Even if it were fixed, the result of this
1697e07dc26bSmrg    # check would be larger than it should be.
1698e07dc26bSmrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
1699e07dc26bSmrg    ;;
1700e07dc26bSmrg
1701e07dc26bSmrg  gnu*)
1702e07dc26bSmrg    # Under GNU Hurd, this test is not required because there is
1703e07dc26bSmrg    # no limit to the length of command line arguments.
1704e07dc26bSmrg    # Libtool will interpret -1 as no limit whatsoever
1705e07dc26bSmrg    lt_cv_sys_max_cmd_len=-1;
1706e07dc26bSmrg    ;;
1707e07dc26bSmrg
1708e07dc26bSmrg  cygwin* | mingw* | cegcc*)
1709e07dc26bSmrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
1710e07dc26bSmrg    # about 5 minutes as the teststring grows exponentially.
1711e07dc26bSmrg    # Worse, since 9x/ME are not pre-emptively multitasking,
1712e07dc26bSmrg    # you end up with a "frozen" computer, even though with patience
1713e07dc26bSmrg    # the test eventually succeeds (with a max line length of 256k).
1714e07dc26bSmrg    # Instead, let's just punt: use the minimum linelength reported by
1715e07dc26bSmrg    # all of the supported platforms: 8192 (on NT/2K/XP).
1716e07dc26bSmrg    lt_cv_sys_max_cmd_len=8192;
1717e07dc26bSmrg    ;;
1718e07dc26bSmrg
1719e07dc26bSmrg  mint*)
1720e07dc26bSmrg    # On MiNT this can take a long time and run out of memory.
1721e07dc26bSmrg    lt_cv_sys_max_cmd_len=8192;
1722e07dc26bSmrg    ;;
1723e07dc26bSmrg
1724e07dc26bSmrg  amigaos*)
1725e07dc26bSmrg    # On AmigaOS with pdksh, this test takes hours, literally.
1726e07dc26bSmrg    # So we just punt and use a minimum line length of 8192.
1727e07dc26bSmrg    lt_cv_sys_max_cmd_len=8192;
1728e07dc26bSmrg    ;;
1729e07dc26bSmrg
1730e07dc26bSmrg  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
1731e07dc26bSmrg    # This has been around since 386BSD, at least.  Likely further.
1732e07dc26bSmrg    if test -x /sbin/sysctl; then
1733e07dc26bSmrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1734e07dc26bSmrg    elif test -x /usr/sbin/sysctl; then
1735e07dc26bSmrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1736e07dc26bSmrg    else
1737e07dc26bSmrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
1738e07dc26bSmrg    fi
1739e07dc26bSmrg    # And add a safety zone
1740e07dc26bSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1741e07dc26bSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1742e07dc26bSmrg    ;;
1743e07dc26bSmrg
1744e07dc26bSmrg  interix*)
1745e07dc26bSmrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
1746e07dc26bSmrg    lt_cv_sys_max_cmd_len=196608
1747e07dc26bSmrg    ;;
1748e07dc26bSmrg
1749e07dc26bSmrg  os2*)
1750e07dc26bSmrg    # The test takes a long time on OS/2.
1751e07dc26bSmrg    lt_cv_sys_max_cmd_len=8192
1752e07dc26bSmrg    ;;
1753e07dc26bSmrg
1754e07dc26bSmrg  osf*)
1755e07dc26bSmrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1756e07dc26bSmrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1757e07dc26bSmrg    # nice to cause kernel panics so lets avoid the loop below.
1758e07dc26bSmrg    # First set a reasonable default.
1759e07dc26bSmrg    lt_cv_sys_max_cmd_len=16384
1760e07dc26bSmrg    #
1761e07dc26bSmrg    if test -x /sbin/sysconfig; then
1762e07dc26bSmrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1763e07dc26bSmrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
1764e07dc26bSmrg      esac
1765e07dc26bSmrg    fi
1766e07dc26bSmrg    ;;
1767e07dc26bSmrg  sco3.2v5*)
1768e07dc26bSmrg    lt_cv_sys_max_cmd_len=102400
1769e07dc26bSmrg    ;;
1770e07dc26bSmrg  sysv5* | sco5v6* | sysv4.2uw2*)
1771e07dc26bSmrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1772e07dc26bSmrg    if test -n "$kargmax"; then
1773e07dc26bSmrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
1774e07dc26bSmrg    else
1775e07dc26bSmrg      lt_cv_sys_max_cmd_len=32768
1776e07dc26bSmrg    fi
1777e07dc26bSmrg    ;;
1778e07dc26bSmrg  *)
1779e07dc26bSmrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1780e07dc26bSmrg    if test -n "$lt_cv_sys_max_cmd_len" && \
1781e07dc26bSmrg       test undefined != "$lt_cv_sys_max_cmd_len"; then
1782e07dc26bSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1783e07dc26bSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1784e07dc26bSmrg    else
1785e07dc26bSmrg      # Make teststring a little bigger before we do anything with it.
1786e07dc26bSmrg      # a 1K string should be a reasonable start.
1787e07dc26bSmrg      for i in 1 2 3 4 5 6 7 8; do
1788e07dc26bSmrg        teststring=$teststring$teststring
1789e07dc26bSmrg      done
1790e07dc26bSmrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1791e07dc26bSmrg      # If test is not a shell built-in, we'll probably end up computing a
1792e07dc26bSmrg      # maximum length that is only half of the actual maximum length, but
1793e07dc26bSmrg      # we can't tell.
1794e07dc26bSmrg      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
1795e07dc26bSmrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
1796e07dc26bSmrg	      test 17 != "$i" # 1/2 MB should be enough
1797e07dc26bSmrg      do
1798e07dc26bSmrg        i=`expr $i + 1`
1799e07dc26bSmrg        teststring=$teststring$teststring
1800e07dc26bSmrg      done
1801e07dc26bSmrg      # Only check the string length outside the loop.
1802e07dc26bSmrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1803e07dc26bSmrg      teststring=
1804e07dc26bSmrg      # Add a significant safety factor because C++ compilers can tack on
1805e07dc26bSmrg      # massive amounts of additional arguments before passing them to the
1806e07dc26bSmrg      # linker.  It appears as though 1/2 is a usable value.
1807e07dc26bSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1808e07dc26bSmrg    fi
1809e07dc26bSmrg    ;;
1810e07dc26bSmrg  esac
1811e07dc26bSmrg])
1812e07dc26bSmrgif test -n "$lt_cv_sys_max_cmd_len"; then
1813e07dc26bSmrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1814e07dc26bSmrgelse
1815e07dc26bSmrg  AC_MSG_RESULT(none)
1816e07dc26bSmrgfi
1817e07dc26bSmrgmax_cmd_len=$lt_cv_sys_max_cmd_len
1818e07dc26bSmrg_LT_DECL([], [max_cmd_len], [0],
1819e07dc26bSmrg    [What is the maximum length of a command?])
1820e07dc26bSmrg])# LT_CMD_MAX_LEN
1821e07dc26bSmrg
1822e07dc26bSmrg# Old name:
1823e07dc26bSmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1824e07dc26bSmrgdnl aclocal-1.4 backwards compatibility:
1825e07dc26bSmrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1826e07dc26bSmrg
1827e07dc26bSmrg
1828e07dc26bSmrg# _LT_HEADER_DLFCN
1829e07dc26bSmrg# ----------------
1830e07dc26bSmrgm4_defun([_LT_HEADER_DLFCN],
1831e07dc26bSmrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1832e07dc26bSmrg])# _LT_HEADER_DLFCN
1833e07dc26bSmrg
1834e07dc26bSmrg
1835e07dc26bSmrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1836e07dc26bSmrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1837e07dc26bSmrg# ----------------------------------------------------------------
1838e07dc26bSmrgm4_defun([_LT_TRY_DLOPEN_SELF],
1839e07dc26bSmrg[m4_require([_LT_HEADER_DLFCN])dnl
1840e07dc26bSmrgif test yes = "$cross_compiling"; then :
1841e07dc26bSmrg  [$4]
1842e07dc26bSmrgelse
1843e07dc26bSmrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1844e07dc26bSmrg  lt_status=$lt_dlunknown
1845e07dc26bSmrg  cat > conftest.$ac_ext <<_LT_EOF
1846e07dc26bSmrg[#line $LINENO "configure"
1847e07dc26bSmrg#include "confdefs.h"
1848e07dc26bSmrg
1849e07dc26bSmrg#if HAVE_DLFCN_H
1850e07dc26bSmrg#include <dlfcn.h>
1851e07dc26bSmrg#endif
1852e07dc26bSmrg
1853e07dc26bSmrg#include <stdio.h>
1854e07dc26bSmrg
1855e07dc26bSmrg#ifdef RTLD_GLOBAL
1856e07dc26bSmrg#  define LT_DLGLOBAL		RTLD_GLOBAL
1857e07dc26bSmrg#else
1858e07dc26bSmrg#  ifdef DL_GLOBAL
1859e07dc26bSmrg#    define LT_DLGLOBAL		DL_GLOBAL
1860e07dc26bSmrg#  else
1861e07dc26bSmrg#    define LT_DLGLOBAL		0
1862e07dc26bSmrg#  endif
1863e07dc26bSmrg#endif
1864e07dc26bSmrg
1865e07dc26bSmrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1866e07dc26bSmrg   find out it does not work in some platform. */
1867e07dc26bSmrg#ifndef LT_DLLAZY_OR_NOW
1868e07dc26bSmrg#  ifdef RTLD_LAZY
1869e07dc26bSmrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
1870e07dc26bSmrg#  else
1871e07dc26bSmrg#    ifdef DL_LAZY
1872e07dc26bSmrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
1873e07dc26bSmrg#    else
1874e07dc26bSmrg#      ifdef RTLD_NOW
1875e07dc26bSmrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
1876e07dc26bSmrg#      else
1877e07dc26bSmrg#        ifdef DL_NOW
1878e07dc26bSmrg#          define LT_DLLAZY_OR_NOW	DL_NOW
1879e07dc26bSmrg#        else
1880e07dc26bSmrg#          define LT_DLLAZY_OR_NOW	0
1881e07dc26bSmrg#        endif
1882e07dc26bSmrg#      endif
1883e07dc26bSmrg#    endif
1884e07dc26bSmrg#  endif
1885e07dc26bSmrg#endif
1886e07dc26bSmrg
1887e07dc26bSmrg/* When -fvisibility=hidden is used, assume the code has been annotated
1888e07dc26bSmrg   correspondingly for the symbols needed.  */
1889e07dc26bSmrg#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1890e07dc26bSmrgint fnord () __attribute__((visibility("default")));
1891e07dc26bSmrg#endif
1892e07dc26bSmrg
1893e07dc26bSmrgint fnord () { return 42; }
1894e07dc26bSmrgint main ()
1895e07dc26bSmrg{
1896e07dc26bSmrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1897e07dc26bSmrg  int status = $lt_dlunknown;
1898e07dc26bSmrg
1899e07dc26bSmrg  if (self)
1900e07dc26bSmrg    {
1901e07dc26bSmrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1902e07dc26bSmrg      else
1903e07dc26bSmrg        {
1904e07dc26bSmrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
1905e07dc26bSmrg          else puts (dlerror ());
1906e07dc26bSmrg	}
1907e07dc26bSmrg      /* dlclose (self); */
1908e07dc26bSmrg    }
1909e07dc26bSmrg  else
1910e07dc26bSmrg    puts (dlerror ());
1911e07dc26bSmrg
1912e07dc26bSmrg  return status;
1913e07dc26bSmrg}]
1914e07dc26bSmrg_LT_EOF
1915e07dc26bSmrg  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
1916e07dc26bSmrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1917e07dc26bSmrg    lt_status=$?
1918e07dc26bSmrg    case x$lt_status in
1919e07dc26bSmrg      x$lt_dlno_uscore) $1 ;;
1920e07dc26bSmrg      x$lt_dlneed_uscore) $2 ;;
1921e07dc26bSmrg      x$lt_dlunknown|x*) $3 ;;
1922e07dc26bSmrg    esac
1923e07dc26bSmrg  else :
1924e07dc26bSmrg    # compilation failed
1925e07dc26bSmrg    $3
1926e07dc26bSmrg  fi
1927e07dc26bSmrgfi
1928e07dc26bSmrgrm -fr conftest*
1929e07dc26bSmrg])# _LT_TRY_DLOPEN_SELF
1930e07dc26bSmrg
1931e07dc26bSmrg
1932e07dc26bSmrg# LT_SYS_DLOPEN_SELF
1933e07dc26bSmrg# ------------------
1934e07dc26bSmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
1935e07dc26bSmrg[m4_require([_LT_HEADER_DLFCN])dnl
1936e07dc26bSmrgif test yes != "$enable_dlopen"; then
1937e07dc26bSmrg  enable_dlopen=unknown
1938e07dc26bSmrg  enable_dlopen_self=unknown
1939e07dc26bSmrg  enable_dlopen_self_static=unknown
1940e07dc26bSmrgelse
1941e07dc26bSmrg  lt_cv_dlopen=no
1942e07dc26bSmrg  lt_cv_dlopen_libs=
1943e07dc26bSmrg
1944e07dc26bSmrg  case $host_os in
1945e07dc26bSmrg  beos*)
1946e07dc26bSmrg    lt_cv_dlopen=load_add_on
1947e07dc26bSmrg    lt_cv_dlopen_libs=
1948e07dc26bSmrg    lt_cv_dlopen_self=yes
1949e07dc26bSmrg    ;;
1950e07dc26bSmrg
1951e07dc26bSmrg  mingw* | pw32* | cegcc*)
1952e07dc26bSmrg    lt_cv_dlopen=LoadLibrary
1953e07dc26bSmrg    lt_cv_dlopen_libs=
1954e07dc26bSmrg    ;;
1955e07dc26bSmrg
1956e07dc26bSmrg  cygwin*)
1957e07dc26bSmrg    lt_cv_dlopen=dlopen
1958e07dc26bSmrg    lt_cv_dlopen_libs=
1959e07dc26bSmrg    ;;
1960e07dc26bSmrg
1961e07dc26bSmrg  darwin*)
1962e07dc26bSmrg    # if libdl is installed we need to link against it
1963e07dc26bSmrg    AC_CHECK_LIB([dl], [dlopen],
1964e07dc26bSmrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
1965e07dc26bSmrg    lt_cv_dlopen=dyld
1966e07dc26bSmrg    lt_cv_dlopen_libs=
1967e07dc26bSmrg    lt_cv_dlopen_self=yes
1968e07dc26bSmrg    ])
1969e07dc26bSmrg    ;;
1970e07dc26bSmrg
1971e07dc26bSmrg  tpf*)
1972e07dc26bSmrg    # Don't try to run any link tests for TPF.  We know it's impossible
1973e07dc26bSmrg    # because TPF is a cross-compiler, and we know how we open DSOs.
1974e07dc26bSmrg    lt_cv_dlopen=dlopen
1975e07dc26bSmrg    lt_cv_dlopen_libs=
1976e07dc26bSmrg    lt_cv_dlopen_self=no
1977e07dc26bSmrg    ;;
1978e07dc26bSmrg
1979e07dc26bSmrg  *)
1980e07dc26bSmrg    AC_CHECK_FUNC([shl_load],
1981e07dc26bSmrg	  [lt_cv_dlopen=shl_load],
1982e07dc26bSmrg      [AC_CHECK_LIB([dld], [shl_load],
1983e07dc26bSmrg	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
1984e07dc26bSmrg	[AC_CHECK_FUNC([dlopen],
1985e07dc26bSmrg	      [lt_cv_dlopen=dlopen],
1986e07dc26bSmrg	  [AC_CHECK_LIB([dl], [dlopen],
1987e07dc26bSmrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
1988e07dc26bSmrg	    [AC_CHECK_LIB([svld], [dlopen],
1989e07dc26bSmrg		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
1990e07dc26bSmrg	      [AC_CHECK_LIB([dld], [dld_link],
1991e07dc26bSmrg		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
1992e07dc26bSmrg	      ])
1993e07dc26bSmrg	    ])
1994e07dc26bSmrg	  ])
1995e07dc26bSmrg	])
1996e07dc26bSmrg      ])
1997e07dc26bSmrg    ;;
1998e07dc26bSmrg  esac
1999e07dc26bSmrg
2000e07dc26bSmrg  if test no = "$lt_cv_dlopen"; then
2001e07dc26bSmrg    enable_dlopen=no
2002e07dc26bSmrg  else
2003e07dc26bSmrg    enable_dlopen=yes
2004e07dc26bSmrg  fi
2005e07dc26bSmrg
2006e07dc26bSmrg  case $lt_cv_dlopen in
2007e07dc26bSmrg  dlopen)
2008e07dc26bSmrg    save_CPPFLAGS=$CPPFLAGS
2009e07dc26bSmrg    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2010e07dc26bSmrg
2011e07dc26bSmrg    save_LDFLAGS=$LDFLAGS
2012e07dc26bSmrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2013e07dc26bSmrg
2014e07dc26bSmrg    save_LIBS=$LIBS
2015e07dc26bSmrg    LIBS="$lt_cv_dlopen_libs $LIBS"
2016e07dc26bSmrg
2017e07dc26bSmrg    AC_CACHE_CHECK([whether a program can dlopen itself],
2018e07dc26bSmrg	  lt_cv_dlopen_self, [dnl
2019e07dc26bSmrg	  _LT_TRY_DLOPEN_SELF(
2020e07dc26bSmrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
2021e07dc26bSmrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
2022e07dc26bSmrg    ])
2023e07dc26bSmrg
2024e07dc26bSmrg    if test yes = "$lt_cv_dlopen_self"; then
2025e07dc26bSmrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
2026e07dc26bSmrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
2027e07dc26bSmrg	  lt_cv_dlopen_self_static, [dnl
2028e07dc26bSmrg	  _LT_TRY_DLOPEN_SELF(
2029e07dc26bSmrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
2030e07dc26bSmrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
2031e07dc26bSmrg      ])
2032e07dc26bSmrg    fi
2033e07dc26bSmrg
2034e07dc26bSmrg    CPPFLAGS=$save_CPPFLAGS
2035e07dc26bSmrg    LDFLAGS=$save_LDFLAGS
2036e07dc26bSmrg    LIBS=$save_LIBS
2037e07dc26bSmrg    ;;
2038e07dc26bSmrg  esac
2039e07dc26bSmrg
2040e07dc26bSmrg  case $lt_cv_dlopen_self in
2041e07dc26bSmrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2042e07dc26bSmrg  *) enable_dlopen_self=unknown ;;
2043e07dc26bSmrg  esac
2044e07dc26bSmrg
2045e07dc26bSmrg  case $lt_cv_dlopen_self_static in
2046e07dc26bSmrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2047e07dc26bSmrg  *) enable_dlopen_self_static=unknown ;;
2048e07dc26bSmrg  esac
2049e07dc26bSmrgfi
2050e07dc26bSmrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
2051e07dc26bSmrg	 [Whether dlopen is supported])
2052e07dc26bSmrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
2053e07dc26bSmrg	 [Whether dlopen of programs is supported])
2054e07dc26bSmrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
2055e07dc26bSmrg	 [Whether dlopen of statically linked programs is supported])
2056e07dc26bSmrg])# LT_SYS_DLOPEN_SELF
2057e07dc26bSmrg
2058e07dc26bSmrg# Old name:
2059e07dc26bSmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
2060e07dc26bSmrgdnl aclocal-1.4 backwards compatibility:
2061e07dc26bSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
2062e07dc26bSmrg
2063e07dc26bSmrg
2064e07dc26bSmrg# _LT_COMPILER_C_O([TAGNAME])
2065e07dc26bSmrg# ---------------------------
2066e07dc26bSmrg# Check to see if options -c and -o are simultaneously supported by compiler.
2067e07dc26bSmrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
2068e07dc26bSmrgm4_defun([_LT_COMPILER_C_O],
2069e07dc26bSmrg[m4_require([_LT_DECL_SED])dnl
2070e07dc26bSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2071e07dc26bSmrgm4_require([_LT_TAG_COMPILER])dnl
2072e07dc26bSmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
2073e07dc26bSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
2074e07dc26bSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
2075e07dc26bSmrg   $RM -r conftest 2>/dev/null
2076e07dc26bSmrg   mkdir conftest
2077e07dc26bSmrg   cd conftest
2078e07dc26bSmrg   mkdir out
2079e07dc26bSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2080e07dc26bSmrg
2081e07dc26bSmrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
2082e07dc26bSmrg   # Insert the option either (1) after the last *FLAGS variable, or
2083e07dc26bSmrg   # (2) before a word containing "conftest.", or (3) at the end.
2084e07dc26bSmrg   # Note that $ac_compile itself does not contain backslashes and begins
2085e07dc26bSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
2086e07dc26bSmrg   lt_compile=`echo "$ac_compile" | $SED \
2087e07dc26bSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2088e07dc26bSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2089e07dc26bSmrg   -e 's:$: $lt_compiler_flag:'`
2090e07dc26bSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2091e07dc26bSmrg   (eval "$lt_compile" 2>out/conftest.err)
2092e07dc26bSmrg   ac_status=$?
2093e07dc26bSmrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
2094e07dc26bSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2095e07dc26bSmrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
2096e07dc26bSmrg   then
2097e07dc26bSmrg     # The compiler can only warn and ignore the option if not recognized
2098e07dc26bSmrg     # So say no if there are warnings
2099e07dc26bSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
2100e07dc26bSmrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
2101e07dc26bSmrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
2102e07dc26bSmrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
2103e07dc26bSmrg     fi
2104e07dc26bSmrg   fi
2105e07dc26bSmrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
2106e07dc26bSmrg   $RM conftest*
2107e07dc26bSmrg   # SGI C++ compiler will create directory out/ii_files/ for
2108e07dc26bSmrg   # template instantiation
2109e07dc26bSmrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
2110e07dc26bSmrg   $RM out/* && rmdir out
2111e07dc26bSmrg   cd ..
2112e07dc26bSmrg   $RM -r conftest
2113e07dc26bSmrg   $RM conftest*
2114e07dc26bSmrg])
2115e07dc26bSmrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
2116e07dc26bSmrg	[Does compiler simultaneously support -c and -o options?])
2117e07dc26bSmrg])# _LT_COMPILER_C_O
2118e07dc26bSmrg
2119e07dc26bSmrg
2120e07dc26bSmrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
2121e07dc26bSmrg# ----------------------------------
2122e07dc26bSmrg# Check to see if we can do hard links to lock some files if needed
2123e07dc26bSmrgm4_defun([_LT_COMPILER_FILE_LOCKS],
2124e07dc26bSmrg[m4_require([_LT_ENABLE_LOCK])dnl
2125e07dc26bSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2126e07dc26bSmrg_LT_COMPILER_C_O([$1])
2127e07dc26bSmrg
2128e07dc26bSmrghard_links=nottested
2129e07dc26bSmrgif test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
2130e07dc26bSmrg  # do not overwrite the value of need_locks provided by the user
2131e07dc26bSmrg  AC_MSG_CHECKING([if we can lock with hard links])
2132e07dc26bSmrg  hard_links=yes
2133e07dc26bSmrg  $RM conftest*
2134e07dc26bSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2135e07dc26bSmrg  touch conftest.a
2136e07dc26bSmrg  ln conftest.a conftest.b 2>&5 || hard_links=no
2137e07dc26bSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2138e07dc26bSmrg  AC_MSG_RESULT([$hard_links])
2139e07dc26bSmrg  if test no = "$hard_links"; then
2140e07dc26bSmrg    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
2141e07dc26bSmrg    need_locks=warn
2142e07dc26bSmrg  fi
2143e07dc26bSmrgelse
2144e07dc26bSmrg  need_locks=no
2145e07dc26bSmrgfi
2146e07dc26bSmrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
2147e07dc26bSmrg])# _LT_COMPILER_FILE_LOCKS
2148e07dc26bSmrg
2149e07dc26bSmrg
2150e07dc26bSmrg# _LT_CHECK_OBJDIR
2151e07dc26bSmrg# ----------------
2152e07dc26bSmrgm4_defun([_LT_CHECK_OBJDIR],
2153e07dc26bSmrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
2154e07dc26bSmrg[rm -f .libs 2>/dev/null
2155e07dc26bSmrgmkdir .libs 2>/dev/null
2156e07dc26bSmrgif test -d .libs; then
2157e07dc26bSmrg  lt_cv_objdir=.libs
2158e07dc26bSmrgelse
2159e07dc26bSmrg  # MS-DOS does not allow filenames that begin with a dot.
2160e07dc26bSmrg  lt_cv_objdir=_libs
2161e07dc26bSmrgfi
2162e07dc26bSmrgrmdir .libs 2>/dev/null])
2163e07dc26bSmrgobjdir=$lt_cv_objdir
2164e07dc26bSmrg_LT_DECL([], [objdir], [0],
2165e07dc26bSmrg         [The name of the directory that contains temporary libtool files])dnl
2166e07dc26bSmrgm4_pattern_allow([LT_OBJDIR])dnl
2167e07dc26bSmrgAC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
2168e07dc26bSmrg  [Define to the sub-directory where libtool stores uninstalled libraries.])
2169e07dc26bSmrg])# _LT_CHECK_OBJDIR
2170e07dc26bSmrg
2171e07dc26bSmrg
2172e07dc26bSmrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
2173e07dc26bSmrg# --------------------------------------
2174e07dc26bSmrg# Check hardcoding attributes.
2175e07dc26bSmrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
2176e07dc26bSmrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
2177e07dc26bSmrg_LT_TAGVAR(hardcode_action, $1)=
2178e07dc26bSmrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
2179e07dc26bSmrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
2180e07dc26bSmrg   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
2181e07dc26bSmrg
2182e07dc26bSmrg  # We can hardcode non-existent directories.
2183e07dc26bSmrg  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
2184e07dc26bSmrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
2185e07dc26bSmrg     # have to relink, otherwise we might link with an installed library
2186e07dc26bSmrg     # when we should be linking with a yet-to-be-installed one
2187e07dc26bSmrg     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
2188e07dc26bSmrg     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
2189e07dc26bSmrg    # Linking always hardcodes the temporary library directory.
2190e07dc26bSmrg    _LT_TAGVAR(hardcode_action, $1)=relink
2191e07dc26bSmrg  else
2192e07dc26bSmrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
2193e07dc26bSmrg    _LT_TAGVAR(hardcode_action, $1)=immediate
2194e07dc26bSmrg  fi
2195e07dc26bSmrgelse
2196e07dc26bSmrg  # We cannot hardcode anything, or else we can only hardcode existing
2197e07dc26bSmrg  # directories.
2198e07dc26bSmrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
2199e07dc26bSmrgfi
2200e07dc26bSmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2201e07dc26bSmrg
2202e07dc26bSmrgif test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
2203e07dc26bSmrg   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
2204e07dc26bSmrg  # Fast installation is not supported
2205e07dc26bSmrg  enable_fast_install=no
2206e07dc26bSmrgelif test yes = "$shlibpath_overrides_runpath" ||
2207e07dc26bSmrg     test no = "$enable_shared"; then
2208e07dc26bSmrg  # Fast installation is not necessary
2209e07dc26bSmrg  enable_fast_install=needless
2210e07dc26bSmrgfi
2211e07dc26bSmrg_LT_TAGDECL([], [hardcode_action], [0],
2212e07dc26bSmrg    [How to hardcode a shared library path into an executable])
2213e07dc26bSmrg])# _LT_LINKER_HARDCODE_LIBPATH
2214e07dc26bSmrg
2215e07dc26bSmrg
2216e07dc26bSmrg# _LT_CMD_STRIPLIB
2217e07dc26bSmrg# ----------------
2218e07dc26bSmrgm4_defun([_LT_CMD_STRIPLIB],
2219e07dc26bSmrg[m4_require([_LT_DECL_EGREP])
2220e07dc26bSmrgstriplib=
2221e07dc26bSmrgold_striplib=
2222e07dc26bSmrgAC_MSG_CHECKING([whether stripping libraries is possible])
2223e07dc26bSmrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2224e07dc26bSmrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2225e07dc26bSmrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2226e07dc26bSmrg  AC_MSG_RESULT([yes])
2227e07dc26bSmrgelse
2228e07dc26bSmrg# FIXME - insert some real tests, host_os isn't really good enough
2229e07dc26bSmrg  case $host_os in
2230e07dc26bSmrg  darwin*)
2231e07dc26bSmrg    if test -n "$STRIP"; then
2232e07dc26bSmrg      striplib="$STRIP -x"
2233e07dc26bSmrg      old_striplib="$STRIP -S"
2234e07dc26bSmrg      AC_MSG_RESULT([yes])
2235e07dc26bSmrg    else
2236e07dc26bSmrg      AC_MSG_RESULT([no])
2237e07dc26bSmrg    fi
2238e07dc26bSmrg    ;;
2239e07dc26bSmrg  *)
2240e07dc26bSmrg    AC_MSG_RESULT([no])
2241e07dc26bSmrg    ;;
2242e07dc26bSmrg  esac
2243e07dc26bSmrgfi
2244e07dc26bSmrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2245e07dc26bSmrg_LT_DECL([], [striplib], [1])
2246e07dc26bSmrg])# _LT_CMD_STRIPLIB
2247e07dc26bSmrg
2248e07dc26bSmrg
2249e07dc26bSmrg# _LT_PREPARE_MUNGE_PATH_LIST
2250e07dc26bSmrg# ---------------------------
2251e07dc26bSmrg# Make sure func_munge_path_list() is defined correctly.
2252e07dc26bSmrgm4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
2253e07dc26bSmrg[[# func_munge_path_list VARIABLE PATH
2254e07dc26bSmrg# -----------------------------------
2255e07dc26bSmrg# VARIABLE is name of variable containing _space_ separated list of
2256e07dc26bSmrg# directories to be munged by the contents of PATH, which is string
2257e07dc26bSmrg# having a format:
2258e07dc26bSmrg# "DIR[:DIR]:"
2259e07dc26bSmrg#       string "DIR[ DIR]" will be prepended to VARIABLE
2260e07dc26bSmrg# ":DIR[:DIR]"
2261e07dc26bSmrg#       string "DIR[ DIR]" will be appended to VARIABLE
2262e07dc26bSmrg# "DIRP[:DIRP]::[DIRA:]DIRA"
2263e07dc26bSmrg#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
2264e07dc26bSmrg#       "DIRA[ DIRA]" will be appended to VARIABLE
2265e07dc26bSmrg# "DIR[:DIR]"
2266e07dc26bSmrg#       VARIABLE will be replaced by "DIR[ DIR]"
2267e07dc26bSmrgfunc_munge_path_list ()
2268e07dc26bSmrg{
2269e07dc26bSmrg    case x@S|@2 in
2270e07dc26bSmrg    x)
2271e07dc26bSmrg        ;;
2272e07dc26bSmrg    *:)
2273e07dc26bSmrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
2274e07dc26bSmrg        ;;
2275e07dc26bSmrg    x:*)
2276e07dc26bSmrg        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
2277e07dc26bSmrg        ;;
2278e07dc26bSmrg    *::*)
2279e07dc26bSmrg        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
2280e07dc26bSmrg        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
2281e07dc26bSmrg        ;;
2282e07dc26bSmrg    *)
2283e07dc26bSmrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
2284e07dc26bSmrg        ;;
2285e07dc26bSmrg    esac
2286e07dc26bSmrg}
2287e07dc26bSmrg]])# _LT_PREPARE_PATH_LIST
2288e07dc26bSmrg
2289e07dc26bSmrg
2290e07dc26bSmrg# _LT_SYS_DYNAMIC_LINKER([TAG])
2291e07dc26bSmrg# -----------------------------
2292e07dc26bSmrg# PORTME Fill in your ld.so characteristics
2293e07dc26bSmrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
2294e07dc26bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2295e07dc26bSmrgm4_require([_LT_DECL_EGREP])dnl
2296e07dc26bSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2297e07dc26bSmrgm4_require([_LT_DECL_OBJDUMP])dnl
2298e07dc26bSmrgm4_require([_LT_DECL_SED])dnl
2299e07dc26bSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
2300e07dc26bSmrgm4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
2301e07dc26bSmrgAC_MSG_CHECKING([dynamic linker characteristics])
2302e07dc26bSmrgm4_if([$1],
2303e07dc26bSmrg	[], [
2304e07dc26bSmrgif test yes = "$GCC"; then
2305e07dc26bSmrg  case $host_os in
2306e07dc26bSmrg    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
2307e07dc26bSmrg    *) lt_awk_arg='/^libraries:/' ;;
2308e07dc26bSmrg  esac
2309e07dc26bSmrg  case $host_os in
2310e07dc26bSmrg    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
2311e07dc26bSmrg    *) lt_sed_strip_eq='s|=/|/|g' ;;
2312e07dc26bSmrg  esac
2313e07dc26bSmrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
2314e07dc26bSmrg  case $lt_search_path_spec in
2315e07dc26bSmrg  *\;*)
2316e07dc26bSmrg    # if the path contains ";" then we assume it to be the separator
2317e07dc26bSmrg    # otherwise default to the standard path separator (i.e. ":") - it is
2318e07dc26bSmrg    # assumed that no part of a normal pathname contains ";" but that should
2319e07dc26bSmrg    # okay in the real world where ";" in dirpaths is itself problematic.
2320e07dc26bSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
2321e07dc26bSmrg    ;;
2322e07dc26bSmrg  *)
2323e07dc26bSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
2324e07dc26bSmrg    ;;
2325e07dc26bSmrg  esac
2326e07dc26bSmrg  # Ok, now we have the path, separated by spaces, we can step through it
2327e07dc26bSmrg  # and add multilib dir if necessary...
2328e07dc26bSmrg  lt_tmp_lt_search_path_spec=
2329e07dc26bSmrg  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2330e07dc26bSmrg  # ...but if some path component already ends with the multilib dir we assume
2331e07dc26bSmrg  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
2332e07dc26bSmrg  case "$lt_multi_os_dir; $lt_search_path_spec " in
2333e07dc26bSmrg  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
2334e07dc26bSmrg    lt_multi_os_dir=
2335e07dc26bSmrg    ;;
2336e07dc26bSmrg  esac
2337e07dc26bSmrg  for lt_sys_path in $lt_search_path_spec; do
2338e07dc26bSmrg    if test -d "$lt_sys_path$lt_multi_os_dir"; then
2339e07dc26bSmrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
2340e07dc26bSmrg    elif test -n "$lt_multi_os_dir"; then
2341e07dc26bSmrg      test -d "$lt_sys_path" && \
2342e07dc26bSmrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2343e07dc26bSmrg    fi
2344e07dc26bSmrg  done
2345e07dc26bSmrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
2346e07dc26bSmrgBEGIN {RS = " "; FS = "/|\n";} {
2347e07dc26bSmrg  lt_foo = "";
2348e07dc26bSmrg  lt_count = 0;
2349e07dc26bSmrg  for (lt_i = NF; lt_i > 0; lt_i--) {
2350e07dc26bSmrg    if ($lt_i != "" && $lt_i != ".") {
2351e07dc26bSmrg      if ($lt_i == "..") {
2352e07dc26bSmrg        lt_count++;
2353e07dc26bSmrg      } else {
2354e07dc26bSmrg        if (lt_count == 0) {
2355e07dc26bSmrg          lt_foo = "/" $lt_i lt_foo;
2356e07dc26bSmrg        } else {
2357e07dc26bSmrg          lt_count--;
2358e07dc26bSmrg        }
2359e07dc26bSmrg      }
2360e07dc26bSmrg    }
2361e07dc26bSmrg  }
2362e07dc26bSmrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2363e07dc26bSmrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2364e07dc26bSmrg}'`
2365e07dc26bSmrg  # AWK program above erroneously prepends '/' to C:/dos/paths
2366e07dc26bSmrg  # for these hosts.
2367e07dc26bSmrg  case $host_os in
2368e07dc26bSmrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
2369e07dc26bSmrg      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
2370e07dc26bSmrg  esac
2371e07dc26bSmrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
2372e07dc26bSmrgelse
2373e07dc26bSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2374e07dc26bSmrgfi])
2375e07dc26bSmrglibrary_names_spec=
2376e07dc26bSmrglibname_spec='lib$name'
2377e07dc26bSmrgsoname_spec=
2378e07dc26bSmrgshrext_cmds=.so
2379e07dc26bSmrgpostinstall_cmds=
2380e07dc26bSmrgpostuninstall_cmds=
2381e07dc26bSmrgfinish_cmds=
2382e07dc26bSmrgfinish_eval=
2383e07dc26bSmrgshlibpath_var=
2384e07dc26bSmrgshlibpath_overrides_runpath=unknown
2385e07dc26bSmrgversion_type=none
2386e07dc26bSmrgdynamic_linker="$host_os ld.so"
2387e07dc26bSmrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
2388e07dc26bSmrgneed_lib_prefix=unknown
2389e07dc26bSmrghardcode_into_libs=no
2390e07dc26bSmrg
2391e07dc26bSmrg# when you set need_version to no, make sure it does not cause -set_version
2392e07dc26bSmrg# flags to be left without arguments
2393e07dc26bSmrgneed_version=unknown
2394e07dc26bSmrg
2395e07dc26bSmrgAC_ARG_VAR([LT_SYS_LIBRARY_PATH],
2396e07dc26bSmrg[User-defined run-time library search path.])
2397e07dc26bSmrg
2398e07dc26bSmrgcase $host_os in
2399e07dc26bSmrgaix3*)
2400e07dc26bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2401e07dc26bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
2402e07dc26bSmrg  shlibpath_var=LIBPATH
2403e07dc26bSmrg
2404e07dc26bSmrg  # AIX 3 has no versioning support, so we append a major version to the name.
2405e07dc26bSmrg  soname_spec='$libname$release$shared_ext$major'
2406e07dc26bSmrg  ;;
2407e07dc26bSmrg
2408e07dc26bSmrgaix[[4-9]]*)
2409e07dc26bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2410e07dc26bSmrg  need_lib_prefix=no
2411e07dc26bSmrg  need_version=no
2412e07dc26bSmrg  hardcode_into_libs=yes
2413e07dc26bSmrg  if test ia64 = "$host_cpu"; then
2414e07dc26bSmrg    # AIX 5 supports IA64
2415e07dc26bSmrg    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
2416e07dc26bSmrg    shlibpath_var=LD_LIBRARY_PATH
2417e07dc26bSmrg  else
2418e07dc26bSmrg    # With GCC up to 2.95.x, collect2 would create an import file
2419e07dc26bSmrg    # for dependence libraries.  The import file would start with
2420e07dc26bSmrg    # the line '#! .'.  This would cause the generated library to
2421e07dc26bSmrg    # depend on '.', always an invalid library.  This was fixed in
2422e07dc26bSmrg    # development snapshots of GCC prior to 3.0.
2423e07dc26bSmrg    case $host_os in
2424e07dc26bSmrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
2425e07dc26bSmrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2426e07dc26bSmrg	   echo ' yes '
2427e07dc26bSmrg	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
2428e07dc26bSmrg	:
2429e07dc26bSmrg      else
2430e07dc26bSmrg	can_build_shared=no
2431e07dc26bSmrg      fi
2432e07dc26bSmrg      ;;
2433e07dc26bSmrg    esac
2434e07dc26bSmrg    # Using Import Files as archive members, it is possible to support
2435e07dc26bSmrg    # filename-based versioning of shared library archives on AIX. While
2436e07dc26bSmrg    # this would work for both with and without runtime linking, it will
2437e07dc26bSmrg    # prevent static linking of such archives. So we do filename-based
2438e07dc26bSmrg    # shared library versioning with .so extension only, which is used
2439e07dc26bSmrg    # when both runtime linking and shared linking is enabled.
2440e07dc26bSmrg    # Unfortunately, runtime linking may impact performance, so we do
2441e07dc26bSmrg    # not want this to be the default eventually. Also, we use the
2442e07dc26bSmrg    # versioned .so libs for executables only if there is the -brtl
2443e07dc26bSmrg    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
2444e07dc26bSmrg    # To allow for filename-based versioning support, we need to create
2445e07dc26bSmrg    # libNAME.so.V as an archive file, containing:
2446e07dc26bSmrg    # *) an Import File, referring to the versioned filename of the
2447e07dc26bSmrg    #    archive as well as the shared archive member, telling the
2448e07dc26bSmrg    #    bitwidth (32 or 64) of that shared object, and providing the
2449e07dc26bSmrg    #    list of exported symbols of that shared object, eventually
2450e07dc26bSmrg    #    decorated with the 'weak' keyword
2451e07dc26bSmrg    # *) the shared object with the F_LOADONLY flag set, to really avoid
2452e07dc26bSmrg    #    it being seen by the linker.
2453e07dc26bSmrg    # At run time we better use the real file rather than another symlink,
2454e07dc26bSmrg    # but for link time we create the symlink libNAME.so -> libNAME.so.V
2455e07dc26bSmrg
2456e07dc26bSmrg    case $with_aix_soname,$aix_use_runtimelinking in
2457e07dc26bSmrg    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
2458e07dc26bSmrg    # soname into executable. Probably we can add versioning support to
2459e07dc26bSmrg    # collect2, so additional links can be useful in future.
2460e07dc26bSmrg    aix,yes) # traditional libtool
2461e07dc26bSmrg      dynamic_linker='AIX unversionable lib.so'
2462e07dc26bSmrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2463e07dc26bSmrg      # instead of lib<name>.a to let people know that these are not
2464e07dc26bSmrg      # typical AIX shared libraries.
2465e07dc26bSmrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2466e07dc26bSmrg      ;;
2467e07dc26bSmrg    aix,no) # traditional AIX only
2468e07dc26bSmrg      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
2469e07dc26bSmrg      # We preserve .a as extension for shared libraries through AIX4.2
2470e07dc26bSmrg      # and later when we are not doing run time linking.
2471e07dc26bSmrg      library_names_spec='$libname$release.a $libname.a'
2472e07dc26bSmrg      soname_spec='$libname$release$shared_ext$major'
2473e07dc26bSmrg      ;;
2474e07dc26bSmrg    svr4,*) # full svr4 only
2475e07dc26bSmrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
2476e07dc26bSmrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2477e07dc26bSmrg      # We do not specify a path in Import Files, so LIBPATH fires.
2478e07dc26bSmrg      shlibpath_overrides_runpath=yes
2479e07dc26bSmrg      ;;
2480e07dc26bSmrg    *,yes) # both, prefer svr4
2481e07dc26bSmrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
2482e07dc26bSmrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2483e07dc26bSmrg      # unpreferred sharedlib libNAME.a needs extra handling
2484e07dc26bSmrg      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"'
2485e07dc26bSmrg      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"'
2486e07dc26bSmrg      # We do not specify a path in Import Files, so LIBPATH fires.
2487e07dc26bSmrg      shlibpath_overrides_runpath=yes
2488e07dc26bSmrg      ;;
2489e07dc26bSmrg    *,no) # both, prefer aix
2490e07dc26bSmrg      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
2491e07dc26bSmrg      library_names_spec='$libname$release.a $libname.a'
2492e07dc26bSmrg      soname_spec='$libname$release$shared_ext$major'
2493e07dc26bSmrg      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
2494e07dc26bSmrg      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)'
2495e07dc26bSmrg      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"'
2496e07dc26bSmrg      ;;
2497e07dc26bSmrg    esac
2498e07dc26bSmrg    shlibpath_var=LIBPATH
2499e07dc26bSmrg  fi
2500e07dc26bSmrg  ;;
2501e07dc26bSmrg
2502e07dc26bSmrgamigaos*)
2503e07dc26bSmrg  case $host_cpu in
2504e07dc26bSmrg  powerpc)
2505e07dc26bSmrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
2506e07dc26bSmrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2507e07dc26bSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2508e07dc26bSmrg    ;;
2509e07dc26bSmrg  m68k)
2510e07dc26bSmrg    library_names_spec='$libname.ixlibrary $libname.a'
2511e07dc26bSmrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
2512e07dc26bSmrg    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'
2513e07dc26bSmrg    ;;
2514e07dc26bSmrg  esac
2515e07dc26bSmrg  ;;
2516e07dc26bSmrg
2517e07dc26bSmrgbeos*)
2518e07dc26bSmrg  library_names_spec='$libname$shared_ext'
2519e07dc26bSmrg  dynamic_linker="$host_os ld.so"
2520e07dc26bSmrg  shlibpath_var=LIBRARY_PATH
2521e07dc26bSmrg  ;;
2522e07dc26bSmrg
2523e07dc26bSmrgbsdi[[45]]*)
2524e07dc26bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2525e07dc26bSmrg  need_version=no
2526e07dc26bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2527e07dc26bSmrg  soname_spec='$libname$release$shared_ext$major'
2528e07dc26bSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2529e07dc26bSmrg  shlibpath_var=LD_LIBRARY_PATH
2530e07dc26bSmrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2531e07dc26bSmrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2532e07dc26bSmrg  # the default ld.so.conf also contains /usr/contrib/lib and
2533e07dc26bSmrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2534e07dc26bSmrg  # libtool to hard-code these into programs
2535e07dc26bSmrg  ;;
2536e07dc26bSmrg
2537e07dc26bSmrgcygwin* | mingw* | pw32* | cegcc*)
2538e07dc26bSmrg  version_type=windows
2539e07dc26bSmrg  shrext_cmds=.dll
2540e07dc26bSmrg  need_version=no
2541e07dc26bSmrg  need_lib_prefix=no
2542e07dc26bSmrg
2543e07dc26bSmrg  case $GCC,$cc_basename in
2544e07dc26bSmrg  yes,*)
2545e07dc26bSmrg    # gcc
2546e07dc26bSmrg    library_names_spec='$libname.dll.a'
2547e07dc26bSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2548e07dc26bSmrg    postinstall_cmds='base_file=`basename \$file`~
2549e07dc26bSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2550e07dc26bSmrg      dldir=$destdir/`dirname \$dlpath`~
2551e07dc26bSmrg      test -d \$dldir || mkdir -p \$dldir~
2552e07dc26bSmrg      $install_prog $dir/$dlname \$dldir/$dlname~
2553e07dc26bSmrg      chmod a+x \$dldir/$dlname~
2554e07dc26bSmrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2555e07dc26bSmrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2556e07dc26bSmrg      fi'
2557e07dc26bSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2558e07dc26bSmrg      dlpath=$dir/\$dldll~
2559e07dc26bSmrg       $RM \$dlpath'
2560e07dc26bSmrg    shlibpath_overrides_runpath=yes
2561e07dc26bSmrg
2562e07dc26bSmrg    case $host_os in
2563e07dc26bSmrg    cygwin*)
2564e07dc26bSmrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2565e07dc26bSmrg      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2566e07dc26bSmrgm4_if([$1], [],[
2567e07dc26bSmrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
2568e07dc26bSmrg      ;;
2569e07dc26bSmrg    mingw* | cegcc*)
2570e07dc26bSmrg      # MinGW DLLs use traditional 'lib' prefix
2571e07dc26bSmrg      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2572e07dc26bSmrg      ;;
2573e07dc26bSmrg    pw32*)
2574e07dc26bSmrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
2575e07dc26bSmrg      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2576e07dc26bSmrg      ;;
2577e07dc26bSmrg    esac
2578e07dc26bSmrg    dynamic_linker='Win32 ld.exe'
2579e07dc26bSmrg    ;;
2580e07dc26bSmrg
2581e07dc26bSmrg  *,cl*)
2582e07dc26bSmrg    # Native MSVC
2583e07dc26bSmrg    libname_spec='$name'
2584e07dc26bSmrg    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2585e07dc26bSmrg    library_names_spec='$libname.dll.lib'
2586e07dc26bSmrg
2587e07dc26bSmrg    case $build_os in
2588e07dc26bSmrg    mingw*)
2589e07dc26bSmrg      sys_lib_search_path_spec=
2590e07dc26bSmrg      lt_save_ifs=$IFS
2591e07dc26bSmrg      IFS=';'
2592e07dc26bSmrg      for lt_path in $LIB
2593e07dc26bSmrg      do
2594e07dc26bSmrg        IFS=$lt_save_ifs
2595e07dc26bSmrg        # Let DOS variable expansion print the short 8.3 style file name.
2596e07dc26bSmrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
2597e07dc26bSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
2598e07dc26bSmrg      done
2599e07dc26bSmrg      IFS=$lt_save_ifs
2600e07dc26bSmrg      # Convert to MSYS style.
2601e07dc26bSmrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
2602e07dc26bSmrg      ;;
2603e07dc26bSmrg    cygwin*)
2604e07dc26bSmrg      # Convert to unix form, then to dos form, then back to unix form
2605e07dc26bSmrg      # but this time dos style (no spaces!) so that the unix form looks
2606e07dc26bSmrg      # like /cygdrive/c/PROGRA~1:/cygdr...
2607e07dc26bSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
2608e07dc26bSmrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
2609e07dc26bSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2610e07dc26bSmrg      ;;
2611e07dc26bSmrg    *)
2612e07dc26bSmrg      sys_lib_search_path_spec=$LIB
2613e07dc26bSmrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2614e07dc26bSmrg        # It is most probably a Windows format PATH.
2615e07dc26bSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2616e07dc26bSmrg      else
2617e07dc26bSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2618e07dc26bSmrg      fi
2619e07dc26bSmrg      # FIXME: find the short name or the path components, as spaces are
2620e07dc26bSmrg      # common. (e.g. "Program Files" -> "PROGRA~1")
2621e07dc26bSmrg      ;;
2622e07dc26bSmrg    esac
2623e07dc26bSmrg
2624e07dc26bSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2625e07dc26bSmrg    postinstall_cmds='base_file=`basename \$file`~
2626e07dc26bSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2627e07dc26bSmrg      dldir=$destdir/`dirname \$dlpath`~
2628e07dc26bSmrg      test -d \$dldir || mkdir -p \$dldir~
2629e07dc26bSmrg      $install_prog $dir/$dlname \$dldir/$dlname'
2630e07dc26bSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2631e07dc26bSmrg      dlpath=$dir/\$dldll~
2632e07dc26bSmrg       $RM \$dlpath'
2633e07dc26bSmrg    shlibpath_overrides_runpath=yes
2634e07dc26bSmrg    dynamic_linker='Win32 link.exe'
2635e07dc26bSmrg    ;;
2636e07dc26bSmrg
2637e07dc26bSmrg  *)
2638e07dc26bSmrg    # Assume MSVC wrapper
2639e07dc26bSmrg    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
2640e07dc26bSmrg    dynamic_linker='Win32 ld.exe'
2641e07dc26bSmrg    ;;
2642e07dc26bSmrg  esac
2643e07dc26bSmrg  # FIXME: first we should search . and the directory the executable is in
2644e07dc26bSmrg  shlibpath_var=PATH
2645e07dc26bSmrg  ;;
2646e07dc26bSmrg
2647e07dc26bSmrgdarwin* | rhapsody*)
2648e07dc26bSmrg  dynamic_linker="$host_os dyld"
2649e07dc26bSmrg  version_type=darwin
2650e07dc26bSmrg  need_lib_prefix=no
2651e07dc26bSmrg  need_version=no
2652e07dc26bSmrg  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
2653e07dc26bSmrg  soname_spec='$libname$release$major$shared_ext'
2654e07dc26bSmrg  shlibpath_overrides_runpath=yes
2655e07dc26bSmrg  shlibpath_var=DYLD_LIBRARY_PATH
2656e07dc26bSmrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2657e07dc26bSmrgm4_if([$1], [],[
2658e07dc26bSmrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2659e07dc26bSmrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2660e07dc26bSmrg  ;;
2661e07dc26bSmrg
2662e07dc26bSmrgdgux*)
2663e07dc26bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2664e07dc26bSmrg  need_lib_prefix=no
2665e07dc26bSmrg  need_version=no
2666e07dc26bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2667e07dc26bSmrg  soname_spec='$libname$release$shared_ext$major'
2668e07dc26bSmrg  shlibpath_var=LD_LIBRARY_PATH
2669e07dc26bSmrg  ;;
2670e07dc26bSmrg
2671e07dc26bSmrgfreebsd* | dragonfly*)
2672e07dc26bSmrg  # DragonFly does not have aout.  When/if they implement a new
2673e07dc26bSmrg  # versioning mechanism, adjust this.
2674e07dc26bSmrg  if test -x /usr/bin/objformat; then
2675e07dc26bSmrg    objformat=`/usr/bin/objformat`
2676e07dc26bSmrg  else
2677e07dc26bSmrg    case $host_os in
2678e07dc26bSmrg    freebsd[[23]].*) objformat=aout ;;
2679e07dc26bSmrg    *) objformat=elf ;;
2680e07dc26bSmrg    esac
2681e07dc26bSmrg  fi
2682e07dc26bSmrg  version_type=freebsd-$objformat
2683e07dc26bSmrg  case $version_type in
2684e07dc26bSmrg    freebsd-elf*)
2685e07dc26bSmrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2686e07dc26bSmrg      soname_spec='$libname$release$shared_ext$major'
2687e07dc26bSmrg      need_version=no
2688e07dc26bSmrg      need_lib_prefix=no
2689e07dc26bSmrg      ;;
2690e07dc26bSmrg    freebsd-*)
2691e07dc26bSmrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2692e07dc26bSmrg      need_version=yes
2693e07dc26bSmrg      ;;
2694e07dc26bSmrg  esac
2695e07dc26bSmrg  shlibpath_var=LD_LIBRARY_PATH
2696e07dc26bSmrg  case $host_os in
2697e07dc26bSmrg  freebsd2.*)
2698e07dc26bSmrg    shlibpath_overrides_runpath=yes
2699e07dc26bSmrg    ;;
2700e07dc26bSmrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2701e07dc26bSmrg    shlibpath_overrides_runpath=yes
2702e07dc26bSmrg    hardcode_into_libs=yes
2703e07dc26bSmrg    ;;
2704e07dc26bSmrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2705e07dc26bSmrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2706e07dc26bSmrg    shlibpath_overrides_runpath=no
2707e07dc26bSmrg    hardcode_into_libs=yes
2708e07dc26bSmrg    ;;
2709e07dc26bSmrg  *) # from 4.6 on, and DragonFly
2710e07dc26bSmrg    shlibpath_overrides_runpath=yes
2711e07dc26bSmrg    hardcode_into_libs=yes
2712e07dc26bSmrg    ;;
2713e07dc26bSmrg  esac
2714e07dc26bSmrg  ;;
2715e07dc26bSmrg
2716e07dc26bSmrghaiku*)
2717e07dc26bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2718e07dc26bSmrg  need_lib_prefix=no
2719e07dc26bSmrg  need_version=no
2720e07dc26bSmrg  dynamic_linker="$host_os runtime_loader"
2721e07dc26bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2722e07dc26bSmrg  soname_spec='$libname$release$shared_ext$major'
2723e07dc26bSmrg  shlibpath_var=LIBRARY_PATH
2724e07dc26bSmrg  shlibpath_overrides_runpath=no
2725e07dc26bSmrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
2726e07dc26bSmrg  hardcode_into_libs=yes
2727e07dc26bSmrg  ;;
2728e07dc26bSmrg
2729e07dc26bSmrghpux9* | hpux10* | hpux11*)
2730e07dc26bSmrg  # Give a soname corresponding to the major version so that dld.sl refuses to
2731e07dc26bSmrg  # link against other versions.
2732e07dc26bSmrg  version_type=sunos
2733e07dc26bSmrg  need_lib_prefix=no
2734e07dc26bSmrg  need_version=no
2735e07dc26bSmrg  case $host_cpu in
2736e07dc26bSmrg  ia64*)
2737e07dc26bSmrg    shrext_cmds='.so'
2738e07dc26bSmrg    hardcode_into_libs=yes
2739e07dc26bSmrg    dynamic_linker="$host_os dld.so"
2740e07dc26bSmrg    shlibpath_var=LD_LIBRARY_PATH
2741e07dc26bSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2742e07dc26bSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2743e07dc26bSmrg    soname_spec='$libname$release$shared_ext$major'
2744e07dc26bSmrg    if test 32 = "$HPUX_IA64_MODE"; then
2745e07dc26bSmrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2746e07dc26bSmrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
2747e07dc26bSmrg    else
2748e07dc26bSmrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2749e07dc26bSmrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
2750e07dc26bSmrg    fi
2751e07dc26bSmrg    ;;
2752e07dc26bSmrg  hppa*64*)
2753e07dc26bSmrg    shrext_cmds='.sl'
2754e07dc26bSmrg    hardcode_into_libs=yes
2755e07dc26bSmrg    dynamic_linker="$host_os dld.sl"
2756e07dc26bSmrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2757e07dc26bSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2758e07dc26bSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2759e07dc26bSmrg    soname_spec='$libname$release$shared_ext$major'
2760e07dc26bSmrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2761e07dc26bSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2762e07dc26bSmrg    ;;
2763e07dc26bSmrg  *)
2764e07dc26bSmrg    shrext_cmds='.sl'
2765e07dc26bSmrg    dynamic_linker="$host_os dld.sl"
2766e07dc26bSmrg    shlibpath_var=SHLIB_PATH
2767e07dc26bSmrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2768e07dc26bSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2769e07dc26bSmrg    soname_spec='$libname$release$shared_ext$major'
2770e07dc26bSmrg    ;;
2771e07dc26bSmrg  esac
2772e07dc26bSmrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
2773e07dc26bSmrg  postinstall_cmds='chmod 555 $lib'
2774e07dc26bSmrg  # or fails outright, so override atomically:
2775e07dc26bSmrg  install_override_mode=555
2776e07dc26bSmrg  ;;
2777e07dc26bSmrg
2778e07dc26bSmrginterix[[3-9]]*)
2779e07dc26bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2780e07dc26bSmrg  need_lib_prefix=no
2781e07dc26bSmrg  need_version=no
2782e07dc26bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2783e07dc26bSmrg  soname_spec='$libname$release$shared_ext$major'
2784e07dc26bSmrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2785e07dc26bSmrg  shlibpath_var=LD_LIBRARY_PATH
2786e07dc26bSmrg  shlibpath_overrides_runpath=no
2787e07dc26bSmrg  hardcode_into_libs=yes
2788e07dc26bSmrg  ;;
2789e07dc26bSmrg
2790e07dc26bSmrgirix5* | irix6* | nonstopux*)
2791e07dc26bSmrg  case $host_os in
2792e07dc26bSmrg    nonstopux*) version_type=nonstopux ;;
2793e07dc26bSmrg    *)
2794e07dc26bSmrg	if test yes = "$lt_cv_prog_gnu_ld"; then
2795e07dc26bSmrg		version_type=linux # correct to gnu/linux during the next big refactor
2796e07dc26bSmrg	else
2797e07dc26bSmrg		version_type=irix
2798e07dc26bSmrg	fi ;;
2799e07dc26bSmrg  esac
2800e07dc26bSmrg  need_lib_prefix=no
2801e07dc26bSmrg  need_version=no
2802e07dc26bSmrg  soname_spec='$libname$release$shared_ext$major'
2803e07dc26bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
2804e07dc26bSmrg  case $host_os in
2805e07dc26bSmrg  irix5* | nonstopux*)
2806e07dc26bSmrg    libsuff= shlibsuff=
2807e07dc26bSmrg    ;;
2808e07dc26bSmrg  *)
2809e07dc26bSmrg    case $LD in # libtool.m4 will add one of these switches to LD
2810e07dc26bSmrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2811e07dc26bSmrg      libsuff= shlibsuff= libmagic=32-bit;;
2812e07dc26bSmrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2813e07dc26bSmrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
2814e07dc26bSmrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2815e07dc26bSmrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
2816e07dc26bSmrg    *) libsuff= shlibsuff= libmagic=never-match;;
2817e07dc26bSmrg    esac
2818e07dc26bSmrg    ;;
2819e07dc26bSmrg  esac
2820e07dc26bSmrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2821e07dc26bSmrg  shlibpath_overrides_runpath=no
2822e07dc26bSmrg  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
2823e07dc26bSmrg  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
2824e07dc26bSmrg  hardcode_into_libs=yes
2825e07dc26bSmrg  ;;
2826e07dc26bSmrg
2827e07dc26bSmrg# No shared lib support for Linux oldld, aout, or coff.
2828e07dc26bSmrglinux*oldld* | linux*aout* | linux*coff*)
2829e07dc26bSmrg  dynamic_linker=no
2830e07dc26bSmrg  ;;
2831e07dc26bSmrg
2832e07dc26bSmrglinux*android*)
2833e07dc26bSmrg  version_type=none # Android doesn't support versioned libraries.
2834e07dc26bSmrg  need_lib_prefix=no
2835e07dc26bSmrg  need_version=no
2836e07dc26bSmrg  library_names_spec='$libname$release$shared_ext'
2837e07dc26bSmrg  soname_spec='$libname$release$shared_ext'
2838e07dc26bSmrg  finish_cmds=
2839e07dc26bSmrg  shlibpath_var=LD_LIBRARY_PATH
2840e07dc26bSmrg  shlibpath_overrides_runpath=yes
2841e07dc26bSmrg
2842e07dc26bSmrg  # This implies no fast_install, which is unacceptable.
2843e07dc26bSmrg  # Some rework will be needed to allow for fast_install
2844e07dc26bSmrg  # before this can be enabled.
2845e07dc26bSmrg  hardcode_into_libs=yes
2846e07dc26bSmrg
2847e07dc26bSmrg  dynamic_linker='Android linker'
2848e07dc26bSmrg  # Don't embed -rpath directories since the linker doesn't support them.
2849e07dc26bSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
2850e07dc26bSmrg  ;;
2851e07dc26bSmrg
2852e07dc26bSmrg# This must be glibc/ELF.
2853e07dc26bSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
2854e07dc26bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2855e07dc26bSmrg  need_lib_prefix=no
2856e07dc26bSmrg  need_version=no
2857e07dc26bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2858e07dc26bSmrg  soname_spec='$libname$release$shared_ext$major'
2859e07dc26bSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2860e07dc26bSmrg  shlibpath_var=LD_LIBRARY_PATH
2861e07dc26bSmrg  shlibpath_overrides_runpath=no
2862e07dc26bSmrg
2863e07dc26bSmrg  # Some binutils ld are patched to set DT_RUNPATH
2864e07dc26bSmrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
2865e07dc26bSmrg    [lt_cv_shlibpath_overrides_runpath=no
2866e07dc26bSmrg    save_LDFLAGS=$LDFLAGS
2867e07dc26bSmrg    save_libdir=$libdir
2868e07dc26bSmrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2869e07dc26bSmrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2870e07dc26bSmrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2871e07dc26bSmrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2872e07dc26bSmrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
2873e07dc26bSmrg    LDFLAGS=$save_LDFLAGS
2874e07dc26bSmrg    libdir=$save_libdir
2875e07dc26bSmrg    ])
2876e07dc26bSmrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
2877e07dc26bSmrg
2878e07dc26bSmrg  # This implies no fast_install, which is unacceptable.
2879e07dc26bSmrg  # Some rework will be needed to allow for fast_install
2880e07dc26bSmrg  # before this can be enabled.
2881e07dc26bSmrg  hardcode_into_libs=yes
2882e07dc26bSmrg
2883e07dc26bSmrg  # Ideally, we could use ldconfig to report *all* directores which are
2884e07dc26bSmrg  # searched for libraries, however this is still not possible.  Aside from not
2885e07dc26bSmrg  # being certain /sbin/ldconfig is available, command
2886e07dc26bSmrg  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
2887e07dc26bSmrg  # even though it is searched at run-time.  Try to do the best guess by
2888e07dc26bSmrg  # appending ld.so.conf contents (and includes) to the search path.
2889e07dc26bSmrg  if test -f /etc/ld.so.conf; then
2890e07dc26bSmrg    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' ' '`
2891e07dc26bSmrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
2892e07dc26bSmrg  fi
2893e07dc26bSmrg
2894e07dc26bSmrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
2895e07dc26bSmrg  # powerpc, because MkLinux only supported shared libraries with the
2896e07dc26bSmrg  # GNU dynamic linker.  Since this was broken with cross compilers,
2897e07dc26bSmrg  # most powerpc-linux boxes support dynamic linking these days and
2898e07dc26bSmrg  # people can always --disable-shared, the test was removed, and we
2899e07dc26bSmrg  # assume the GNU/Linux dynamic linker is in use.
2900e07dc26bSmrg  dynamic_linker='GNU/Linux ld.so'
2901e07dc26bSmrg  ;;
2902e07dc26bSmrg
2903e07dc26bSmrgnetbsdelf*-gnu)
2904e07dc26bSmrg  version_type=linux
2905e07dc26bSmrg  need_lib_prefix=no
2906e07dc26bSmrg  need_version=no
2907e07dc26bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2908e07dc26bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2909e07dc26bSmrg  shlibpath_var=LD_LIBRARY_PATH
2910e07dc26bSmrg  shlibpath_overrides_runpath=no
2911e07dc26bSmrg  hardcode_into_libs=yes
2912e07dc26bSmrg  dynamic_linker='NetBSD ld.elf_so'
2913e07dc26bSmrg  ;;
2914e07dc26bSmrg
2915e07dc26bSmrgnetbsd*)
2916e07dc26bSmrg  version_type=sunos
2917e07dc26bSmrg  need_lib_prefix=no
2918e07dc26bSmrg  need_version=no
2919e07dc26bSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2920e07dc26bSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2921e07dc26bSmrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2922e07dc26bSmrg    dynamic_linker='NetBSD (a.out) ld.so'
2923e07dc26bSmrg  else
2924e07dc26bSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2925e07dc26bSmrg    soname_spec='$libname$release$shared_ext$major'
2926e07dc26bSmrg    dynamic_linker='NetBSD ld.elf_so'
2927e07dc26bSmrg  fi
2928e07dc26bSmrg  shlibpath_var=LD_LIBRARY_PATH
2929e07dc26bSmrg  shlibpath_overrides_runpath=yes
2930e07dc26bSmrg  hardcode_into_libs=yes
2931e07dc26bSmrg  ;;
2932e07dc26bSmrg
2933e07dc26bSmrgnewsos6)
2934e07dc26bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2935e07dc26bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2936e07dc26bSmrg  shlibpath_var=LD_LIBRARY_PATH
2937e07dc26bSmrg  shlibpath_overrides_runpath=yes
2938e07dc26bSmrg  ;;
2939e07dc26bSmrg
2940e07dc26bSmrg*nto* | *qnx*)
2941e07dc26bSmrg  version_type=qnx
2942e07dc26bSmrg  need_lib_prefix=no
2943e07dc26bSmrg  need_version=no
2944e07dc26bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2945e07dc26bSmrg  soname_spec='$libname$release$shared_ext$major'
2946e07dc26bSmrg  shlibpath_var=LD_LIBRARY_PATH
2947e07dc26bSmrg  shlibpath_overrides_runpath=no
2948e07dc26bSmrg  hardcode_into_libs=yes
2949e07dc26bSmrg  dynamic_linker='ldqnx.so'
2950e07dc26bSmrg  ;;
2951e07dc26bSmrg
2952e07dc26bSmrgopenbsd* | bitrig*)
2953e07dc26bSmrg  version_type=sunos
2954e07dc26bSmrg  sys_lib_dlsearch_path_spec=/usr/lib
2955e07dc26bSmrg  need_lib_prefix=no
2956e07dc26bSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
2957e07dc26bSmrg    need_version=no
2958e07dc26bSmrg  else
2959e07dc26bSmrg    need_version=yes
2960e07dc26bSmrg  fi
2961e07dc26bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2962e07dc26bSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2963e07dc26bSmrg  shlibpath_var=LD_LIBRARY_PATH
2964e07dc26bSmrg  shlibpath_overrides_runpath=yes
2965e07dc26bSmrg  ;;
2966e07dc26bSmrg
2967e07dc26bSmrgos2*)
2968e07dc26bSmrg  libname_spec='$name'
2969e07dc26bSmrg  version_type=windows
2970e07dc26bSmrg  shrext_cmds=.dll
2971e07dc26bSmrg  need_version=no
2972e07dc26bSmrg  need_lib_prefix=no
2973e07dc26bSmrg  # OS/2 can only load a DLL with a base name of 8 characters or less.
2974e07dc26bSmrg  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
2975e07dc26bSmrg    v=$($ECHO $release$versuffix | tr -d .-);
2976e07dc26bSmrg    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
2977e07dc26bSmrg    $ECHO $n$v`$shared_ext'
2978e07dc26bSmrg  library_names_spec='${libname}_dll.$libext'
2979e07dc26bSmrg  dynamic_linker='OS/2 ld.exe'
2980e07dc26bSmrg  shlibpath_var=BEGINLIBPATH
2981e07dc26bSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2982e07dc26bSmrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2983e07dc26bSmrg  postinstall_cmds='base_file=`basename \$file`~
2984e07dc26bSmrg    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
2985e07dc26bSmrg    dldir=$destdir/`dirname \$dlpath`~
2986e07dc26bSmrg    test -d \$dldir || mkdir -p \$dldir~
2987e07dc26bSmrg    $install_prog $dir/$dlname \$dldir/$dlname~
2988e07dc26bSmrg    chmod a+x \$dldir/$dlname~
2989e07dc26bSmrg    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2990e07dc26bSmrg      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2991e07dc26bSmrg    fi'
2992e07dc26bSmrg  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
2993e07dc26bSmrg    dlpath=$dir/\$dldll~
2994e07dc26bSmrg    $RM \$dlpath'
2995e07dc26bSmrg  ;;
2996e07dc26bSmrg
2997e07dc26bSmrgosf3* | osf4* | osf5*)
2998e07dc26bSmrg  version_type=osf
2999e07dc26bSmrg  need_lib_prefix=no
3000e07dc26bSmrg  need_version=no
3001e07dc26bSmrg  soname_spec='$libname$release$shared_ext$major'
3002e07dc26bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3003e07dc26bSmrg  shlibpath_var=LD_LIBRARY_PATH
3004e07dc26bSmrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
3005e07dc26bSmrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3006e07dc26bSmrg  ;;
3007e07dc26bSmrg
3008e07dc26bSmrgrdos*)
3009e07dc26bSmrg  dynamic_linker=no
3010e07dc26bSmrg  ;;
3011e07dc26bSmrg
3012e07dc26bSmrgsolaris*)
3013e07dc26bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3014e07dc26bSmrg  need_lib_prefix=no
3015e07dc26bSmrg  need_version=no
3016e07dc26bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3017e07dc26bSmrg  soname_spec='$libname$release$shared_ext$major'
3018e07dc26bSmrg  shlibpath_var=LD_LIBRARY_PATH
3019e07dc26bSmrg  shlibpath_overrides_runpath=yes
3020e07dc26bSmrg  hardcode_into_libs=yes
3021e07dc26bSmrg  # ldd complains unless libraries are executable
3022e07dc26bSmrg  postinstall_cmds='chmod +x $lib'
3023e07dc26bSmrg  ;;
3024e07dc26bSmrg
3025e07dc26bSmrgsunos4*)
3026e07dc26bSmrg  version_type=sunos
3027e07dc26bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
3028e07dc26bSmrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3029e07dc26bSmrg  shlibpath_var=LD_LIBRARY_PATH
3030e07dc26bSmrg  shlibpath_overrides_runpath=yes
3031e07dc26bSmrg  if test yes = "$with_gnu_ld"; then
3032e07dc26bSmrg    need_lib_prefix=no
3033e07dc26bSmrg  fi
3034e07dc26bSmrg  need_version=yes
3035e07dc26bSmrg  ;;
3036e07dc26bSmrg
3037e07dc26bSmrgsysv4 | sysv4.3*)
3038e07dc26bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3039e07dc26bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3040e07dc26bSmrg  soname_spec='$libname$release$shared_ext$major'
3041e07dc26bSmrg  shlibpath_var=LD_LIBRARY_PATH
3042e07dc26bSmrg  case $host_vendor in
3043e07dc26bSmrg    sni)
3044e07dc26bSmrg      shlibpath_overrides_runpath=no
3045e07dc26bSmrg      need_lib_prefix=no
3046e07dc26bSmrg      runpath_var=LD_RUN_PATH
3047e07dc26bSmrg      ;;
3048e07dc26bSmrg    siemens)
3049e07dc26bSmrg      need_lib_prefix=no
3050e07dc26bSmrg      ;;
3051e07dc26bSmrg    motorola)
3052e07dc26bSmrg      need_lib_prefix=no
3053e07dc26bSmrg      need_version=no
3054e07dc26bSmrg      shlibpath_overrides_runpath=no
3055e07dc26bSmrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3056e07dc26bSmrg      ;;
3057e07dc26bSmrg  esac
3058e07dc26bSmrg  ;;
3059e07dc26bSmrg
3060e07dc26bSmrgsysv4*MP*)
3061e07dc26bSmrg  if test -d /usr/nec; then
3062e07dc26bSmrg    version_type=linux # correct to gnu/linux during the next big refactor
3063e07dc26bSmrg    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
3064e07dc26bSmrg    soname_spec='$libname$shared_ext.$major'
3065e07dc26bSmrg    shlibpath_var=LD_LIBRARY_PATH
3066e07dc26bSmrg  fi
3067e07dc26bSmrg  ;;
3068e07dc26bSmrg
3069e07dc26bSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3070e07dc26bSmrg  version_type=sco
3071e07dc26bSmrg  need_lib_prefix=no
3072e07dc26bSmrg  need_version=no
3073e07dc26bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
3074e07dc26bSmrg  soname_spec='$libname$release$shared_ext$major'
3075e07dc26bSmrg  shlibpath_var=LD_LIBRARY_PATH
3076e07dc26bSmrg  shlibpath_overrides_runpath=yes
3077e07dc26bSmrg  hardcode_into_libs=yes
3078e07dc26bSmrg  if test yes = "$with_gnu_ld"; then
3079e07dc26bSmrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3080e07dc26bSmrg  else
3081e07dc26bSmrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
3082e07dc26bSmrg    case $host_os in
3083e07dc26bSmrg      sco3.2v5*)
3084e07dc26bSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3085e07dc26bSmrg	;;
3086e07dc26bSmrg    esac
3087e07dc26bSmrg  fi
3088e07dc26bSmrg  sys_lib_dlsearch_path_spec='/usr/lib'
3089e07dc26bSmrg  ;;
3090e07dc26bSmrg
3091e07dc26bSmrgtpf*)
3092e07dc26bSmrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
3093e07dc26bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3094e07dc26bSmrg  need_lib_prefix=no
3095e07dc26bSmrg  need_version=no
3096e07dc26bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3097e07dc26bSmrg  shlibpath_var=LD_LIBRARY_PATH
3098e07dc26bSmrg  shlibpath_overrides_runpath=no
3099e07dc26bSmrg  hardcode_into_libs=yes
3100e07dc26bSmrg  ;;
3101e07dc26bSmrg
3102e07dc26bSmrguts4*)
3103e07dc26bSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3104e07dc26bSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3105e07dc26bSmrg  soname_spec='$libname$release$shared_ext$major'
3106e07dc26bSmrg  shlibpath_var=LD_LIBRARY_PATH
3107e07dc26bSmrg  ;;
3108e07dc26bSmrg
3109e07dc26bSmrg*)
3110e07dc26bSmrg  dynamic_linker=no
3111e07dc26bSmrg  ;;
3112e07dc26bSmrgesac
3113e07dc26bSmrgAC_MSG_RESULT([$dynamic_linker])
3114e07dc26bSmrgtest no = "$dynamic_linker" && can_build_shared=no
3115e07dc26bSmrg
3116e07dc26bSmrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3117e07dc26bSmrgif test yes = "$GCC"; then
3118e07dc26bSmrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3119e07dc26bSmrgfi
3120e07dc26bSmrg
3121e07dc26bSmrgif test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
3122e07dc26bSmrg  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
3123e07dc26bSmrgfi
3124e07dc26bSmrg
3125e07dc26bSmrgif test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
3126e07dc26bSmrg  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
3127e07dc26bSmrgfi
3128e07dc26bSmrg
3129e07dc26bSmrg# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
3130e07dc26bSmrgconfigure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
3131e07dc26bSmrg
3132e07dc26bSmrg# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
3133e07dc26bSmrgfunc_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
3134e07dc26bSmrg
3135e07dc26bSmrg# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
3136e07dc26bSmrgconfigure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
3137e07dc26bSmrg
3138e07dc26bSmrg_LT_DECL([], [variables_saved_for_relink], [1],
3139e07dc26bSmrg    [Variables whose values should be saved in libtool wrapper scripts and
3140e07dc26bSmrg    restored at link time])
3141e07dc26bSmrg_LT_DECL([], [need_lib_prefix], [0],
3142e07dc26bSmrg    [Do we need the "lib" prefix for modules?])
3143e07dc26bSmrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
3144e07dc26bSmrg_LT_DECL([], [version_type], [0], [Library versioning type])
3145e07dc26bSmrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
3146e07dc26bSmrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
3147e07dc26bSmrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
3148e07dc26bSmrg    [Is shlibpath searched before the hard-coded library search path?])
3149e07dc26bSmrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
3150e07dc26bSmrg_LT_DECL([], [library_names_spec], [1],
3151e07dc26bSmrg    [[List of archive names.  First name is the real one, the rest are links.
3152e07dc26bSmrg    The last name is the one that the linker finds with -lNAME]])
3153e07dc26bSmrg_LT_DECL([], [soname_spec], [1],
3154e07dc26bSmrg    [[The coded name of the library, if different from the real name]])
3155e07dc26bSmrg_LT_DECL([], [install_override_mode], [1],
3156e07dc26bSmrg    [Permission mode override for installation of shared libraries])
3157e07dc26bSmrg_LT_DECL([], [postinstall_cmds], [2],
3158e07dc26bSmrg    [Command to use after installation of a shared archive])
3159e07dc26bSmrg_LT_DECL([], [postuninstall_cmds], [2],
3160e07dc26bSmrg    [Command to use after uninstallation of a shared archive])
3161e07dc26bSmrg_LT_DECL([], [finish_cmds], [2],
3162e07dc26bSmrg    [Commands used to finish a libtool library installation in a directory])
3163e07dc26bSmrg_LT_DECL([], [finish_eval], [1],
3164e07dc26bSmrg    [[As "finish_cmds", except a single script fragment to be evaled but
3165e07dc26bSmrg    not shown]])
3166e07dc26bSmrg_LT_DECL([], [hardcode_into_libs], [0],
3167e07dc26bSmrg    [Whether we should hardcode library paths into libraries])
3168e07dc26bSmrg_LT_DECL([], [sys_lib_search_path_spec], [2],
3169e07dc26bSmrg    [Compile-time system search path for libraries])
3170e07dc26bSmrg_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
3171e07dc26bSmrg    [Detected run-time system search path for libraries])
3172e07dc26bSmrg_LT_DECL([], [configure_time_lt_sys_library_path], [2],
3173e07dc26bSmrg    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
3174e07dc26bSmrg])# _LT_SYS_DYNAMIC_LINKER
3175e07dc26bSmrg
3176e07dc26bSmrg
3177e07dc26bSmrg# _LT_PATH_TOOL_PREFIX(TOOL)
3178e07dc26bSmrg# --------------------------
3179e07dc26bSmrg# find a file program that can recognize shared library
3180e07dc26bSmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
3181e07dc26bSmrg[m4_require([_LT_DECL_EGREP])dnl
3182e07dc26bSmrgAC_MSG_CHECKING([for $1])
3183e07dc26bSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3184e07dc26bSmrg[case $MAGIC_CMD in
3185e07dc26bSmrg[[\\/*] |  ?:[\\/]*])
3186e07dc26bSmrg  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
3187e07dc26bSmrg  ;;
3188e07dc26bSmrg*)
3189e07dc26bSmrg  lt_save_MAGIC_CMD=$MAGIC_CMD
3190e07dc26bSmrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3191e07dc26bSmrgdnl $ac_dummy forces splitting on constant user-supplied paths.
3192e07dc26bSmrgdnl POSIX.2 word splitting is done only on the output of word expansions,
3193e07dc26bSmrgdnl not every word.  This closes a longstanding sh security hole.
3194e07dc26bSmrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
3195e07dc26bSmrg  for ac_dir in $ac_dummy; do
3196e07dc26bSmrg    IFS=$lt_save_ifs
3197e07dc26bSmrg    test -z "$ac_dir" && ac_dir=.
3198e07dc26bSmrg    if test -f "$ac_dir/$1"; then
3199e07dc26bSmrg      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
3200e07dc26bSmrg      if test -n "$file_magic_test_file"; then
3201e07dc26bSmrg	case $deplibs_check_method in
3202e07dc26bSmrg	"file_magic "*)
3203e07dc26bSmrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
3204e07dc26bSmrg	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
3205e07dc26bSmrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3206e07dc26bSmrg	    $EGREP "$file_magic_regex" > /dev/null; then
3207e07dc26bSmrg	    :
3208e07dc26bSmrg	  else
3209e07dc26bSmrg	    cat <<_LT_EOF 1>&2
3210e07dc26bSmrg
3211e07dc26bSmrg*** Warning: the command libtool uses to detect shared libraries,
3212e07dc26bSmrg*** $file_magic_cmd, produces output that libtool cannot recognize.
3213e07dc26bSmrg*** The result is that libtool may fail to recognize shared libraries
3214e07dc26bSmrg*** as such.  This will affect the creation of libtool libraries that
3215e07dc26bSmrg*** depend on shared libraries, but programs linked with such libtool
3216e07dc26bSmrg*** libraries will work regardless of this problem.  Nevertheless, you
3217e07dc26bSmrg*** may want to report the problem to your system manager and/or to
3218e07dc26bSmrg*** bug-libtool@gnu.org
3219e07dc26bSmrg
3220e07dc26bSmrg_LT_EOF
3221e07dc26bSmrg	  fi ;;
3222e07dc26bSmrg	esac
3223e07dc26bSmrg      fi
3224e07dc26bSmrg      break
3225e07dc26bSmrg    fi
3226e07dc26bSmrg  done
3227e07dc26bSmrg  IFS=$lt_save_ifs
3228e07dc26bSmrg  MAGIC_CMD=$lt_save_MAGIC_CMD
3229e07dc26bSmrg  ;;
3230e07dc26bSmrgesac])
3231e07dc26bSmrgMAGIC_CMD=$lt_cv_path_MAGIC_CMD
3232e07dc26bSmrgif test -n "$MAGIC_CMD"; then
3233e07dc26bSmrg  AC_MSG_RESULT($MAGIC_CMD)
3234e07dc26bSmrgelse
3235e07dc26bSmrg  AC_MSG_RESULT(no)
3236e07dc26bSmrgfi
3237e07dc26bSmrg_LT_DECL([], [MAGIC_CMD], [0],
3238e07dc26bSmrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
3239e07dc26bSmrg])# _LT_PATH_TOOL_PREFIX
3240e07dc26bSmrg
3241e07dc26bSmrg# Old name:
3242e07dc26bSmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
3243e07dc26bSmrgdnl aclocal-1.4 backwards compatibility:
3244e07dc26bSmrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3245e07dc26bSmrg
3246e07dc26bSmrg
3247e07dc26bSmrg# _LT_PATH_MAGIC
3248e07dc26bSmrg# --------------
3249e07dc26bSmrg# find a file program that can recognize a shared library
3250e07dc26bSmrgm4_defun([_LT_PATH_MAGIC],
3251e07dc26bSmrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
3252e07dc26bSmrgif test -z "$lt_cv_path_MAGIC_CMD"; then
3253e07dc26bSmrg  if test -n "$ac_tool_prefix"; then
3254e07dc26bSmrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
3255e07dc26bSmrg  else
3256e07dc26bSmrg    MAGIC_CMD=:
3257e07dc26bSmrg  fi
3258e07dc26bSmrgfi
3259e07dc26bSmrg])# _LT_PATH_MAGIC
3260e07dc26bSmrg
3261e07dc26bSmrg
3262e07dc26bSmrg# LT_PATH_LD
3263e07dc26bSmrg# ----------
3264e07dc26bSmrg# find the pathname to the GNU or non-GNU linker
3265e07dc26bSmrgAC_DEFUN([LT_PATH_LD],
3266e07dc26bSmrg[AC_REQUIRE([AC_PROG_CC])dnl
3267e07dc26bSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
3268e07dc26bSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
3269e07dc26bSmrgm4_require([_LT_DECL_SED])dnl
3270e07dc26bSmrgm4_require([_LT_DECL_EGREP])dnl
3271e07dc26bSmrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3272e07dc26bSmrg
3273e07dc26bSmrgAC_ARG_WITH([gnu-ld],
3274e07dc26bSmrg    [AS_HELP_STRING([--with-gnu-ld],
3275e07dc26bSmrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
3276e07dc26bSmrg    [test no = "$withval" || with_gnu_ld=yes],
3277e07dc26bSmrg    [with_gnu_ld=no])dnl
3278e07dc26bSmrg
3279e07dc26bSmrgac_prog=ld
3280e07dc26bSmrgif test yes = "$GCC"; then
3281e07dc26bSmrg  # Check if gcc -print-prog-name=ld gives a path.
3282e07dc26bSmrg  AC_MSG_CHECKING([for ld used by $CC])
3283e07dc26bSmrg  case $host in
3284e07dc26bSmrg  *-*-mingw*)
3285e07dc26bSmrg    # gcc leaves a trailing carriage return, which upsets mingw
3286e07dc26bSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3287e07dc26bSmrg  *)
3288e07dc26bSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3289e07dc26bSmrg  esac
3290e07dc26bSmrg  case $ac_prog in
3291e07dc26bSmrg    # Accept absolute paths.
3292e07dc26bSmrg    [[\\/]]* | ?:[[\\/]]*)
3293e07dc26bSmrg      re_direlt='/[[^/]][[^/]]*/\.\./'
3294e07dc26bSmrg      # Canonicalize the pathname of ld
3295e07dc26bSmrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
3296e07dc26bSmrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
3297e07dc26bSmrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
3298e07dc26bSmrg      done
3299e07dc26bSmrg      test -z "$LD" && LD=$ac_prog
3300e07dc26bSmrg      ;;
3301e07dc26bSmrg  "")
3302e07dc26bSmrg    # If it fails, then pretend we aren't using GCC.
3303e07dc26bSmrg    ac_prog=ld
3304e07dc26bSmrg    ;;
3305e07dc26bSmrg  *)
3306e07dc26bSmrg    # If it is relative, then search for the first ld in PATH.
3307e07dc26bSmrg    with_gnu_ld=unknown
3308e07dc26bSmrg    ;;
3309e07dc26bSmrg  esac
3310e07dc26bSmrgelif test yes = "$with_gnu_ld"; then
3311e07dc26bSmrg  AC_MSG_CHECKING([for GNU ld])
3312e07dc26bSmrgelse
3313e07dc26bSmrg  AC_MSG_CHECKING([for non-GNU ld])
3314e07dc26bSmrgfi
3315e07dc26bSmrgAC_CACHE_VAL(lt_cv_path_LD,
3316e07dc26bSmrg[if test -z "$LD"; then
3317e07dc26bSmrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3318e07dc26bSmrg  for ac_dir in $PATH; do
3319e07dc26bSmrg    IFS=$lt_save_ifs
3320e07dc26bSmrg    test -z "$ac_dir" && ac_dir=.
3321e07dc26bSmrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3322e07dc26bSmrg      lt_cv_path_LD=$ac_dir/$ac_prog
3323e07dc26bSmrg      # Check to see if the program is GNU ld.  I'd rather use --version,
3324e07dc26bSmrg      # but apparently some variants of GNU ld only accept -v.
3325e07dc26bSmrg      # Break only if it was the GNU/non-GNU ld that we prefer.
3326e07dc26bSmrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
3327e07dc26bSmrg      *GNU* | *'with BFD'*)
3328e07dc26bSmrg	test no != "$with_gnu_ld" && break
3329e07dc26bSmrg	;;
3330e07dc26bSmrg      *)
3331e07dc26bSmrg	test yes != "$with_gnu_ld" && break
3332e07dc26bSmrg	;;
3333e07dc26bSmrg      esac
3334e07dc26bSmrg    fi
3335e07dc26bSmrg  done
3336e07dc26bSmrg  IFS=$lt_save_ifs
3337e07dc26bSmrgelse
3338e07dc26bSmrg  lt_cv_path_LD=$LD # Let the user override the test with a path.
3339e07dc26bSmrgfi])
3340e07dc26bSmrgLD=$lt_cv_path_LD
3341e07dc26bSmrgif test -n "$LD"; then
3342e07dc26bSmrg  AC_MSG_RESULT($LD)
3343e07dc26bSmrgelse
3344e07dc26bSmrg  AC_MSG_RESULT(no)
3345e07dc26bSmrgfi
3346e07dc26bSmrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3347e07dc26bSmrg_LT_PATH_LD_GNU
3348e07dc26bSmrgAC_SUBST([LD])
3349e07dc26bSmrg
3350e07dc26bSmrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
3351e07dc26bSmrg])# LT_PATH_LD
3352e07dc26bSmrg
3353e07dc26bSmrg# Old names:
3354e07dc26bSmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
3355e07dc26bSmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
3356e07dc26bSmrgdnl aclocal-1.4 backwards compatibility:
3357e07dc26bSmrgdnl AC_DEFUN([AM_PROG_LD], [])
3358e07dc26bSmrgdnl AC_DEFUN([AC_PROG_LD], [])
3359e07dc26bSmrg
3360e07dc26bSmrg
3361e07dc26bSmrg# _LT_PATH_LD_GNU
3362e07dc26bSmrg#- --------------
3363e07dc26bSmrgm4_defun([_LT_PATH_LD_GNU],
3364e07dc26bSmrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3365e07dc26bSmrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
3366e07dc26bSmrgcase `$LD -v 2>&1 </dev/null` in
3367e07dc26bSmrg*GNU* | *'with BFD'*)
3368e07dc26bSmrg  lt_cv_prog_gnu_ld=yes
3369e07dc26bSmrg  ;;
3370e07dc26bSmrg*)
3371e07dc26bSmrg  lt_cv_prog_gnu_ld=no
3372e07dc26bSmrg  ;;
3373e07dc26bSmrgesac])
3374e07dc26bSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
3375e07dc26bSmrg])# _LT_PATH_LD_GNU
3376e07dc26bSmrg
3377e07dc26bSmrg
3378e07dc26bSmrg# _LT_CMD_RELOAD
3379e07dc26bSmrg# --------------
3380e07dc26bSmrg# find reload flag for linker
3381e07dc26bSmrg#   -- PORTME Some linkers may need a different reload flag.
3382e07dc26bSmrgm4_defun([_LT_CMD_RELOAD],
3383e07dc26bSmrg[AC_CACHE_CHECK([for $LD option to reload object files],
3384e07dc26bSmrg  lt_cv_ld_reload_flag,
3385e07dc26bSmrg  [lt_cv_ld_reload_flag='-r'])
3386e07dc26bSmrgreload_flag=$lt_cv_ld_reload_flag
3387e07dc26bSmrgcase $reload_flag in
3388e07dc26bSmrg"" | " "*) ;;
3389e07dc26bSmrg*) reload_flag=" $reload_flag" ;;
3390e07dc26bSmrgesac
3391e07dc26bSmrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
3392e07dc26bSmrgcase $host_os in
3393e07dc26bSmrg  cygwin* | mingw* | pw32* | cegcc*)
3394e07dc26bSmrg    if test yes != "$GCC"; then
3395e07dc26bSmrg      reload_cmds=false
3396e07dc26bSmrg    fi
3397e07dc26bSmrg    ;;
3398e07dc26bSmrg  darwin*)
3399e07dc26bSmrg    if test yes = "$GCC"; then
3400e07dc26bSmrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
3401e07dc26bSmrg    else
3402e07dc26bSmrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
3403e07dc26bSmrg    fi
3404e07dc26bSmrg    ;;
3405e07dc26bSmrgesac
3406e07dc26bSmrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
3407e07dc26bSmrg_LT_TAGDECL([], [reload_cmds], [2])dnl
3408e07dc26bSmrg])# _LT_CMD_RELOAD
3409e07dc26bSmrg
3410e07dc26bSmrg
3411e07dc26bSmrg# _LT_PATH_DD
3412e07dc26bSmrg# -----------
3413e07dc26bSmrg# find a working dd
3414e07dc26bSmrgm4_defun([_LT_PATH_DD],
3415e07dc26bSmrg[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
3416e07dc26bSmrg[printf 0123456789abcdef0123456789abcdef >conftest.i
3417e07dc26bSmrgcat conftest.i conftest.i >conftest2.i
3418e07dc26bSmrg: ${lt_DD:=$DD}
3419e07dc26bSmrgAC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
3420e07dc26bSmrg[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3421e07dc26bSmrg  cmp -s conftest.i conftest.out \
3422e07dc26bSmrg  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
3423e07dc26bSmrgfi])
3424e07dc26bSmrgrm -f conftest.i conftest2.i conftest.out])
3425e07dc26bSmrg])# _LT_PATH_DD
3426e07dc26bSmrg
3427e07dc26bSmrg
3428e07dc26bSmrg# _LT_CMD_TRUNCATE
3429e07dc26bSmrg# ----------------
3430e07dc26bSmrg# find command to truncate a binary pipe
3431e07dc26bSmrgm4_defun([_LT_CMD_TRUNCATE],
3432e07dc26bSmrg[m4_require([_LT_PATH_DD])
3433e07dc26bSmrgAC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
3434e07dc26bSmrg[printf 0123456789abcdef0123456789abcdef >conftest.i
3435e07dc26bSmrgcat conftest.i conftest.i >conftest2.i
3436e07dc26bSmrglt_cv_truncate_bin=
3437e07dc26bSmrgif "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3438e07dc26bSmrg  cmp -s conftest.i conftest.out \
3439e07dc26bSmrg  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
3440e07dc26bSmrgfi
3441e07dc26bSmrgrm -f conftest.i conftest2.i conftest.out
3442e07dc26bSmrgtest -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
3443e07dc26bSmrg_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
3444e07dc26bSmrg  [Command to truncate a binary pipe])
3445e07dc26bSmrg])# _LT_CMD_TRUNCATE
3446e07dc26bSmrg
3447e07dc26bSmrg
3448e07dc26bSmrg# _LT_CHECK_MAGIC_METHOD
3449e07dc26bSmrg# ----------------------
3450e07dc26bSmrg# how to check for library dependencies
3451e07dc26bSmrg#  -- PORTME fill in with the dynamic library characteristics
3452e07dc26bSmrgm4_defun([_LT_CHECK_MAGIC_METHOD],
3453e07dc26bSmrg[m4_require([_LT_DECL_EGREP])
3454e07dc26bSmrgm4_require([_LT_DECL_OBJDUMP])
3455e07dc26bSmrgAC_CACHE_CHECK([how to recognize dependent libraries],
3456e07dc26bSmrglt_cv_deplibs_check_method,
3457e07dc26bSmrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
3458e07dc26bSmrglt_cv_file_magic_test_file=
3459e07dc26bSmrglt_cv_deplibs_check_method='unknown'
3460e07dc26bSmrg# Need to set the preceding variable on all platforms that support
3461e07dc26bSmrg# interlibrary dependencies.
3462e07dc26bSmrg# 'none' -- dependencies not supported.
3463e07dc26bSmrg# 'unknown' -- same as none, but documents that we really don't know.
3464e07dc26bSmrg# 'pass_all' -- all dependencies passed with no checks.
3465e07dc26bSmrg# 'test_compile' -- check by making test program.
3466e07dc26bSmrg# 'file_magic [[regex]]' -- check by looking for files in library path
3467e07dc26bSmrg# that responds to the $file_magic_cmd with a given extended regex.
3468e07dc26bSmrg# If you have 'file' or equivalent on your system and you're not sure
3469e07dc26bSmrg# whether 'pass_all' will *always* work, you probably want this one.
3470e07dc26bSmrg
3471e07dc26bSmrgcase $host_os in
3472e07dc26bSmrgaix[[4-9]]*)
3473e07dc26bSmrg  lt_cv_deplibs_check_method=pass_all
3474e07dc26bSmrg  ;;
3475e07dc26bSmrg
3476e07dc26bSmrgbeos*)
3477e07dc26bSmrg  lt_cv_deplibs_check_method=pass_all
3478e07dc26bSmrg  ;;
3479e07dc26bSmrg
3480e07dc26bSmrgbsdi[[45]]*)
3481e07dc26bSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3482e07dc26bSmrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
3483e07dc26bSmrg  lt_cv_file_magic_test_file=/shlib/libc.so
3484e07dc26bSmrg  ;;
3485e07dc26bSmrg
3486e07dc26bSmrgcygwin*)
3487e07dc26bSmrg  # func_win32_libid is a shell function defined in ltmain.sh
3488e07dc26bSmrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3489e07dc26bSmrg  lt_cv_file_magic_cmd='func_win32_libid'
3490e07dc26bSmrg  ;;
3491e07dc26bSmrg
3492e07dc26bSmrgmingw* | pw32*)
3493e07dc26bSmrg  # Base MSYS/MinGW do not provide the 'file' command needed by
3494e07dc26bSmrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
3495e07dc26bSmrg  # unless we find 'file', for example because we are cross-compiling.
3496e07dc26bSmrg  if ( file / ) >/dev/null 2>&1; then
3497e07dc26bSmrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3498e07dc26bSmrg    lt_cv_file_magic_cmd='func_win32_libid'
3499e07dc26bSmrg  else
3500e07dc26bSmrg    # Keep this pattern in sync with the one in func_win32_libid.
3501e07dc26bSmrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
3502e07dc26bSmrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
3503e07dc26bSmrg  fi
3504e07dc26bSmrg  ;;
3505e07dc26bSmrg
3506e07dc26bSmrgcegcc*)
3507e07dc26bSmrg  # use the weaker test based on 'objdump'. See mingw*.
3508e07dc26bSmrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3509e07dc26bSmrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
3510e07dc26bSmrg  ;;
3511e07dc26bSmrg
3512e07dc26bSmrgdarwin* | rhapsody*)
3513e07dc26bSmrg  lt_cv_deplibs_check_method=pass_all
3514e07dc26bSmrg  ;;
3515e07dc26bSmrg
3516e07dc26bSmrgfreebsd* | dragonfly*)
3517e07dc26bSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3518e07dc26bSmrg    case $host_cpu in
3519e07dc26bSmrg    i*86 )
3520e07dc26bSmrg      # Not sure whether the presence of OpenBSD here was a mistake.
3521e07dc26bSmrg      # Let's accept both of them until this is cleared up.
3522e07dc26bSmrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3523e07dc26bSmrg      lt_cv_file_magic_cmd=/usr/bin/file
3524e07dc26bSmrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3525e07dc26bSmrg      ;;
3526e07dc26bSmrg    esac
3527e07dc26bSmrg  else
3528e07dc26bSmrg    lt_cv_deplibs_check_method=pass_all
3529e07dc26bSmrg  fi
3530e07dc26bSmrg  ;;
3531e07dc26bSmrg
3532e07dc26bSmrghaiku*)
3533e07dc26bSmrg  lt_cv_deplibs_check_method=pass_all
3534e07dc26bSmrg  ;;
3535e07dc26bSmrg
3536e07dc26bSmrghpux10.20* | hpux11*)
3537e07dc26bSmrg  lt_cv_file_magic_cmd=/usr/bin/file
3538e07dc26bSmrg  case $host_cpu in
3539e07dc26bSmrg  ia64*)
3540e07dc26bSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3541e07dc26bSmrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3542e07dc26bSmrg    ;;
3543e07dc26bSmrg  hppa*64*)
3544e07dc26bSmrg    [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]']
3545e07dc26bSmrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3546e07dc26bSmrg    ;;
3547e07dc26bSmrg  *)
3548e07dc26bSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
3549e07dc26bSmrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3550e07dc26bSmrg    ;;
3551e07dc26bSmrg  esac
3552e07dc26bSmrg  ;;
3553e07dc26bSmrg
3554e07dc26bSmrginterix[[3-9]]*)
3555e07dc26bSmrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3556e07dc26bSmrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3557e07dc26bSmrg  ;;
3558e07dc26bSmrg
3559e07dc26bSmrgirix5* | irix6* | nonstopux*)
3560e07dc26bSmrg  case $LD in
3561e07dc26bSmrg  *-32|*"-32 ") libmagic=32-bit;;
3562e07dc26bSmrg  *-n32|*"-n32 ") libmagic=N32;;
3563e07dc26bSmrg  *-64|*"-64 ") libmagic=64-bit;;
3564e07dc26bSmrg  *) libmagic=never-match;;
3565e07dc26bSmrg  esac
3566e07dc26bSmrg  lt_cv_deplibs_check_method=pass_all
3567e07dc26bSmrg  ;;
3568e07dc26bSmrg
3569e07dc26bSmrg# This must be glibc/ELF.
3570e07dc26bSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
3571e07dc26bSmrg  lt_cv_deplibs_check_method=pass_all
3572e07dc26bSmrg  ;;
3573e07dc26bSmrg
3574e07dc26bSmrgnetbsd* | netbsdelf*-gnu)
3575e07dc26bSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3576e07dc26bSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3577e07dc26bSmrg  else
3578e07dc26bSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3579e07dc26bSmrg  fi
3580e07dc26bSmrg  ;;
3581e07dc26bSmrg
3582e07dc26bSmrgnewos6*)
3583e07dc26bSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3584e07dc26bSmrg  lt_cv_file_magic_cmd=/usr/bin/file
3585e07dc26bSmrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3586e07dc26bSmrg  ;;
3587e07dc26bSmrg
3588e07dc26bSmrg*nto* | *qnx*)
3589e07dc26bSmrg  lt_cv_deplibs_check_method=pass_all
3590e07dc26bSmrg  ;;
3591e07dc26bSmrg
3592e07dc26bSmrgopenbsd* | bitrig*)
3593e07dc26bSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
3594e07dc26bSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3595e07dc26bSmrg  else
3596e07dc26bSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3597e07dc26bSmrg  fi
3598e07dc26bSmrg  ;;
3599e07dc26bSmrg
3600e07dc26bSmrgosf3* | osf4* | osf5*)
3601e07dc26bSmrg  lt_cv_deplibs_check_method=pass_all
3602e07dc26bSmrg  ;;
3603e07dc26bSmrg
3604e07dc26bSmrgrdos*)
3605e07dc26bSmrg  lt_cv_deplibs_check_method=pass_all
3606e07dc26bSmrg  ;;
3607e07dc26bSmrg
3608e07dc26bSmrgsolaris*)
3609e07dc26bSmrg  lt_cv_deplibs_check_method=pass_all
3610e07dc26bSmrg  ;;
3611e07dc26bSmrg
3612e07dc26bSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3613e07dc26bSmrg  lt_cv_deplibs_check_method=pass_all
3614e07dc26bSmrg  ;;
3615e07dc26bSmrg
3616e07dc26bSmrgsysv4 | sysv4.3*)
3617e07dc26bSmrg  case $host_vendor in
3618e07dc26bSmrg  motorola)
3619e07dc26bSmrg    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]]'
3620e07dc26bSmrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3621e07dc26bSmrg    ;;
3622e07dc26bSmrg  ncr)
3623e07dc26bSmrg    lt_cv_deplibs_check_method=pass_all
3624e07dc26bSmrg    ;;
3625e07dc26bSmrg  sequent)
3626e07dc26bSmrg    lt_cv_file_magic_cmd='/bin/file'
3627e07dc26bSmrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3628e07dc26bSmrg    ;;
3629e07dc26bSmrg  sni)
3630e07dc26bSmrg    lt_cv_file_magic_cmd='/bin/file'
3631e07dc26bSmrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3632e07dc26bSmrg    lt_cv_file_magic_test_file=/lib/libc.so
3633e07dc26bSmrg    ;;
3634e07dc26bSmrg  siemens)
3635e07dc26bSmrg    lt_cv_deplibs_check_method=pass_all
3636e07dc26bSmrg    ;;
3637e07dc26bSmrg  pc)
3638e07dc26bSmrg    lt_cv_deplibs_check_method=pass_all
3639e07dc26bSmrg    ;;
3640e07dc26bSmrg  esac
3641e07dc26bSmrg  ;;
3642e07dc26bSmrg
3643e07dc26bSmrgtpf*)
3644e07dc26bSmrg  lt_cv_deplibs_check_method=pass_all
3645e07dc26bSmrg  ;;
3646e07dc26bSmrgos2*)
3647e07dc26bSmrg  lt_cv_deplibs_check_method=pass_all
3648e07dc26bSmrg  ;;
3649e07dc26bSmrgesac
3650e07dc26bSmrg])
3651e07dc26bSmrg
3652e07dc26bSmrgfile_magic_glob=
3653e07dc26bSmrgwant_nocaseglob=no
3654e07dc26bSmrgif test "$build" = "$host"; then
3655e07dc26bSmrg  case $host_os in
3656e07dc26bSmrg  mingw* | pw32*)
3657e07dc26bSmrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
3658e07dc26bSmrg      want_nocaseglob=yes
3659e07dc26bSmrg    else
3660e07dc26bSmrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
3661e07dc26bSmrg    fi
3662e07dc26bSmrg    ;;
3663e07dc26bSmrg  esac
3664e07dc26bSmrgfi
3665e07dc26bSmrg
3666e07dc26bSmrgfile_magic_cmd=$lt_cv_file_magic_cmd
3667e07dc26bSmrgdeplibs_check_method=$lt_cv_deplibs_check_method
3668e07dc26bSmrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
3669e07dc26bSmrg
3670e07dc26bSmrg_LT_DECL([], [deplibs_check_method], [1],
3671e07dc26bSmrg    [Method to check whether dependent libraries are shared objects])
3672e07dc26bSmrg_LT_DECL([], [file_magic_cmd], [1],
3673e07dc26bSmrg    [Command to use when deplibs_check_method = "file_magic"])
3674e07dc26bSmrg_LT_DECL([], [file_magic_glob], [1],
3675e07dc26bSmrg    [How to find potential files when deplibs_check_method = "file_magic"])
3676e07dc26bSmrg_LT_DECL([], [want_nocaseglob], [1],
3677e07dc26bSmrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
3678e07dc26bSmrg])# _LT_CHECK_MAGIC_METHOD
3679e07dc26bSmrg
3680e07dc26bSmrg
3681e07dc26bSmrg# LT_PATH_NM
3682e07dc26bSmrg# ----------
3683e07dc26bSmrg# find the pathname to a BSD- or MS-compatible name lister
3684e07dc26bSmrgAC_DEFUN([LT_PATH_NM],
3685e07dc26bSmrg[AC_REQUIRE([AC_PROG_CC])dnl
3686e07dc26bSmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3687e07dc26bSmrg[if test -n "$NM"; then
3688e07dc26bSmrg  # Let the user override the test.
3689e07dc26bSmrg  lt_cv_path_NM=$NM
3690e07dc26bSmrgelse
3691e07dc26bSmrg  lt_nm_to_check=${ac_tool_prefix}nm
3692e07dc26bSmrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3693e07dc26bSmrg    lt_nm_to_check="$lt_nm_to_check nm"
3694e07dc26bSmrg  fi
3695e07dc26bSmrg  for lt_tmp_nm in $lt_nm_to_check; do
3696e07dc26bSmrg    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3697e07dc26bSmrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3698e07dc26bSmrg      IFS=$lt_save_ifs
3699e07dc26bSmrg      test -z "$ac_dir" && ac_dir=.
3700e07dc26bSmrg      tmp_nm=$ac_dir/$lt_tmp_nm
3701e07dc26bSmrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
3702e07dc26bSmrg	# Check to see if the nm accepts a BSD-compat flag.
3703e07dc26bSmrg	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
3704e07dc26bSmrg	#   nm: unknown option "B" ignored
3705e07dc26bSmrg	# Tru64's nm complains that /dev/null is an invalid object file
3706e07dc26bSmrg	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
3707e07dc26bSmrg	case $build_os in
3708e07dc26bSmrg	mingw*) lt_bad_file=conftest.nm/nofile ;;
3709e07dc26bSmrg	*) lt_bad_file=/dev/null ;;
3710e07dc26bSmrg	esac
3711e07dc26bSmrg	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
3712e07dc26bSmrg	*$lt_bad_file* | *'Invalid file or object type'*)
3713e07dc26bSmrg	  lt_cv_path_NM="$tmp_nm -B"
3714e07dc26bSmrg	  break 2
3715e07dc26bSmrg	  ;;
3716e07dc26bSmrg	*)
3717e07dc26bSmrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3718e07dc26bSmrg	  */dev/null*)
3719e07dc26bSmrg	    lt_cv_path_NM="$tmp_nm -p"
3720e07dc26bSmrg	    break 2
3721e07dc26bSmrg	    ;;
3722e07dc26bSmrg	  *)
3723e07dc26bSmrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3724e07dc26bSmrg	    continue # so that we can try to find one that supports BSD flags
3725e07dc26bSmrg	    ;;
3726e07dc26bSmrg	  esac
3727e07dc26bSmrg	  ;;
3728e07dc26bSmrg	esac
3729e07dc26bSmrg      fi
3730e07dc26bSmrg    done
3731e07dc26bSmrg    IFS=$lt_save_ifs
3732e07dc26bSmrg  done
3733e07dc26bSmrg  : ${lt_cv_path_NM=no}
3734e07dc26bSmrgfi])
3735e07dc26bSmrgif test no != "$lt_cv_path_NM"; then
3736e07dc26bSmrg  NM=$lt_cv_path_NM
3737e07dc26bSmrgelse
3738e07dc26bSmrg  # Didn't find any BSD compatible name lister, look for dumpbin.
3739e07dc26bSmrg  if test -n "$DUMPBIN"; then :
3740e07dc26bSmrg    # Let the user override the test.
3741e07dc26bSmrg  else
3742e07dc26bSmrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
3743e07dc26bSmrg    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
3744e07dc26bSmrg    *COFF*)
3745e07dc26bSmrg      DUMPBIN="$DUMPBIN -symbols -headers"
3746e07dc26bSmrg      ;;
3747e07dc26bSmrg    *)
3748e07dc26bSmrg      DUMPBIN=:
3749e07dc26bSmrg      ;;
3750e07dc26bSmrg    esac
3751e07dc26bSmrg  fi
3752e07dc26bSmrg  AC_SUBST([DUMPBIN])
3753e07dc26bSmrg  if test : != "$DUMPBIN"; then
3754e07dc26bSmrg    NM=$DUMPBIN
3755e07dc26bSmrg  fi
3756e07dc26bSmrgfi
3757e07dc26bSmrgtest -z "$NM" && NM=nm
3758e07dc26bSmrgAC_SUBST([NM])
3759e07dc26bSmrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3760e07dc26bSmrg
3761e07dc26bSmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3762e07dc26bSmrg  [lt_cv_nm_interface="BSD nm"
3763e07dc26bSmrg  echo "int some_variable = 0;" > conftest.$ac_ext
3764e07dc26bSmrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3765e07dc26bSmrg  (eval "$ac_compile" 2>conftest.err)
3766e07dc26bSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3767e07dc26bSmrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3768e07dc26bSmrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3769e07dc26bSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3770e07dc26bSmrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
3771e07dc26bSmrg  cat conftest.out >&AS_MESSAGE_LOG_FD
3772e07dc26bSmrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3773e07dc26bSmrg    lt_cv_nm_interface="MS dumpbin"
3774e07dc26bSmrg  fi
3775e07dc26bSmrg  rm -f conftest*])
3776e07dc26bSmrg])# LT_PATH_NM
3777e07dc26bSmrg
3778e07dc26bSmrg# Old names:
3779e07dc26bSmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3780e07dc26bSmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3781e07dc26bSmrgdnl aclocal-1.4 backwards compatibility:
3782e07dc26bSmrgdnl AC_DEFUN([AM_PROG_NM], [])
3783e07dc26bSmrgdnl AC_DEFUN([AC_PROG_NM], [])
3784e07dc26bSmrg
3785e07dc26bSmrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3786e07dc26bSmrg# --------------------------------
3787e07dc26bSmrg# how to determine the name of the shared library
3788e07dc26bSmrg# associated with a specific link library.
3789e07dc26bSmrg#  -- PORTME fill in with the dynamic library characteristics
3790e07dc26bSmrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
3791e07dc26bSmrg[m4_require([_LT_DECL_EGREP])
3792e07dc26bSmrgm4_require([_LT_DECL_OBJDUMP])
3793e07dc26bSmrgm4_require([_LT_DECL_DLLTOOL])
3794e07dc26bSmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
3795e07dc26bSmrglt_cv_sharedlib_from_linklib_cmd,
3796e07dc26bSmrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
3797e07dc26bSmrg
3798e07dc26bSmrgcase $host_os in
3799e07dc26bSmrgcygwin* | mingw* | pw32* | cegcc*)
3800e07dc26bSmrg  # two different shell functions defined in ltmain.sh;
3801e07dc26bSmrg  # decide which one to use based on capabilities of $DLLTOOL
3802e07dc26bSmrg  case `$DLLTOOL --help 2>&1` in
3803e07dc26bSmrg  *--identify-strict*)
3804e07dc26bSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
3805e07dc26bSmrg    ;;
3806e07dc26bSmrg  *)
3807e07dc26bSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
3808e07dc26bSmrg    ;;
3809e07dc26bSmrg  esac
3810e07dc26bSmrg  ;;
3811e07dc26bSmrg*)
3812e07dc26bSmrg  # fallback: assume linklib IS sharedlib
3813e07dc26bSmrg  lt_cv_sharedlib_from_linklib_cmd=$ECHO
3814e07dc26bSmrg  ;;
3815e07dc26bSmrgesac
3816e07dc26bSmrg])
3817e07dc26bSmrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
3818e07dc26bSmrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3819e07dc26bSmrg
3820e07dc26bSmrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
3821e07dc26bSmrg    [Command to associate shared and link libraries])
3822e07dc26bSmrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3823e07dc26bSmrg
3824e07dc26bSmrg
3825e07dc26bSmrg# _LT_PATH_MANIFEST_TOOL
3826e07dc26bSmrg# ----------------------
3827e07dc26bSmrg# locate the manifest tool
3828e07dc26bSmrgm4_defun([_LT_PATH_MANIFEST_TOOL],
3829e07dc26bSmrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
3830e07dc26bSmrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
3831e07dc26bSmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
3832e07dc26bSmrg  [lt_cv_path_mainfest_tool=no
3833e07dc26bSmrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
3834e07dc26bSmrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
3835e07dc26bSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3836e07dc26bSmrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
3837e07dc26bSmrg    lt_cv_path_mainfest_tool=yes
3838e07dc26bSmrg  fi
3839e07dc26bSmrg  rm -f conftest*])
3840e07dc26bSmrgif test yes != "$lt_cv_path_mainfest_tool"; then
3841e07dc26bSmrg  MANIFEST_TOOL=:
3842e07dc26bSmrgfi
3843e07dc26bSmrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
3844e07dc26bSmrg])# _LT_PATH_MANIFEST_TOOL
3845e07dc26bSmrg
3846e07dc26bSmrg
3847e07dc26bSmrg# _LT_DLL_DEF_P([FILE])
3848e07dc26bSmrg# ---------------------
3849e07dc26bSmrg# True iff FILE is a Windows DLL '.def' file.
3850e07dc26bSmrg# Keep in sync with func_dll_def_p in the libtool script
3851e07dc26bSmrgAC_DEFUN([_LT_DLL_DEF_P],
3852e07dc26bSmrg[dnl
3853e07dc26bSmrg  test DEF = "`$SED -n dnl
3854e07dc26bSmrg    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
3855e07dc26bSmrg    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
3856e07dc26bSmrg    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
3857e07dc26bSmrg    -e q dnl                          Only consider the first "real" line
3858e07dc26bSmrg    $1`" dnl
3859e07dc26bSmrg])# _LT_DLL_DEF_P
3860e07dc26bSmrg
3861e07dc26bSmrg
3862e07dc26bSmrg# LT_LIB_M
3863e07dc26bSmrg# --------
3864e07dc26bSmrg# check for math library
3865e07dc26bSmrgAC_DEFUN([LT_LIB_M],
3866e07dc26bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3867e07dc26bSmrgLIBM=
3868e07dc26bSmrgcase $host in
3869e07dc26bSmrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
3870e07dc26bSmrg  # These system don't have libm, or don't need it
3871e07dc26bSmrg  ;;
3872e07dc26bSmrg*-ncr-sysv4.3*)
3873e07dc26bSmrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
3874e07dc26bSmrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3875e07dc26bSmrg  ;;
3876e07dc26bSmrg*)
3877e07dc26bSmrg  AC_CHECK_LIB(m, cos, LIBM=-lm)
3878e07dc26bSmrg  ;;
3879e07dc26bSmrgesac
3880e07dc26bSmrgAC_SUBST([LIBM])
3881e07dc26bSmrg])# LT_LIB_M
3882e07dc26bSmrg
3883e07dc26bSmrg# Old name:
3884e07dc26bSmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3885e07dc26bSmrgdnl aclocal-1.4 backwards compatibility:
3886e07dc26bSmrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3887e07dc26bSmrg
3888e07dc26bSmrg
3889e07dc26bSmrg# _LT_COMPILER_NO_RTTI([TAGNAME])
3890e07dc26bSmrg# -------------------------------
3891e07dc26bSmrgm4_defun([_LT_COMPILER_NO_RTTI],
3892e07dc26bSmrg[m4_require([_LT_TAG_COMPILER])dnl
3893e07dc26bSmrg
3894e07dc26bSmrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3895e07dc26bSmrg
3896e07dc26bSmrgif test yes = "$GCC"; then
3897e07dc26bSmrg  case $cc_basename in
3898e07dc26bSmrg  nvcc*)
3899e07dc26bSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
3900e07dc26bSmrg  *)
3901e07dc26bSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
3902e07dc26bSmrg  esac
3903e07dc26bSmrg
3904e07dc26bSmrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3905e07dc26bSmrg    lt_cv_prog_compiler_rtti_exceptions,
3906e07dc26bSmrg    [-fno-rtti -fno-exceptions], [],
3907e07dc26bSmrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3908e07dc26bSmrgfi
3909e07dc26bSmrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3910e07dc26bSmrg	[Compiler flag to turn off builtin functions])
3911e07dc26bSmrg])# _LT_COMPILER_NO_RTTI
3912e07dc26bSmrg
3913e07dc26bSmrg
3914e07dc26bSmrg# _LT_CMD_GLOBAL_SYMBOLS
3915e07dc26bSmrg# ----------------------
3916e07dc26bSmrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3917e07dc26bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3918e07dc26bSmrgAC_REQUIRE([AC_PROG_CC])dnl
3919e07dc26bSmrgAC_REQUIRE([AC_PROG_AWK])dnl
3920e07dc26bSmrgAC_REQUIRE([LT_PATH_NM])dnl
3921e07dc26bSmrgAC_REQUIRE([LT_PATH_LD])dnl
3922e07dc26bSmrgm4_require([_LT_DECL_SED])dnl
3923e07dc26bSmrgm4_require([_LT_DECL_EGREP])dnl
3924e07dc26bSmrgm4_require([_LT_TAG_COMPILER])dnl
3925e07dc26bSmrg
3926e07dc26bSmrg# Check for command to grab the raw symbol name followed by C symbol from nm.
3927e07dc26bSmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
3928e07dc26bSmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3929e07dc26bSmrg[
3930e07dc26bSmrg# These are sane defaults that work on at least a few old systems.
3931e07dc26bSmrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3932e07dc26bSmrg
3933e07dc26bSmrg# Character class describing NM global symbol codes.
3934e07dc26bSmrgsymcode='[[BCDEGRST]]'
3935e07dc26bSmrg
3936e07dc26bSmrg# Regexp to match symbols that can be accessed directly from C.
3937e07dc26bSmrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3938e07dc26bSmrg
3939e07dc26bSmrg# Define system-specific variables.
3940e07dc26bSmrgcase $host_os in
3941e07dc26bSmrgaix*)
3942e07dc26bSmrg  symcode='[[BCDT]]'
3943e07dc26bSmrg  ;;
3944e07dc26bSmrgcygwin* | mingw* | pw32* | cegcc*)
3945e07dc26bSmrg  symcode='[[ABCDGISTW]]'
3946e07dc26bSmrg  ;;
3947e07dc26bSmrghpux*)
3948e07dc26bSmrg  if test ia64 = "$host_cpu"; then
3949e07dc26bSmrg    symcode='[[ABCDEGRST]]'
3950e07dc26bSmrg  fi
3951e07dc26bSmrg  ;;
3952e07dc26bSmrgirix* | nonstopux*)
3953e07dc26bSmrg  symcode='[[BCDEGRST]]'
3954e07dc26bSmrg  ;;
3955e07dc26bSmrgosf*)
3956e07dc26bSmrg  symcode='[[BCDEGQRST]]'
3957e07dc26bSmrg  ;;
3958e07dc26bSmrgsolaris*)
3959e07dc26bSmrg  symcode='[[BDRT]]'
3960e07dc26bSmrg  ;;
3961e07dc26bSmrgsco3.2v5*)
3962e07dc26bSmrg  symcode='[[DT]]'
3963e07dc26bSmrg  ;;
3964e07dc26bSmrgsysv4.2uw2*)
3965e07dc26bSmrg  symcode='[[DT]]'
3966e07dc26bSmrg  ;;
3967e07dc26bSmrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
3968e07dc26bSmrg  symcode='[[ABDT]]'
3969e07dc26bSmrg  ;;
3970e07dc26bSmrgsysv4)
3971e07dc26bSmrg  symcode='[[DFNSTU]]'
3972e07dc26bSmrg  ;;
3973e07dc26bSmrgesac
3974e07dc26bSmrg
3975e07dc26bSmrg# If we're using GNU nm, then use its standard symbol codes.
3976e07dc26bSmrgcase `$NM -V 2>&1` in
3977e07dc26bSmrg*GNU* | *'with BFD'*)
3978e07dc26bSmrg  symcode='[[ABCDGIRSTW]]' ;;
3979e07dc26bSmrgesac
3980e07dc26bSmrg
3981e07dc26bSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
3982e07dc26bSmrg  # Gets list of data symbols to import.
3983e07dc26bSmrg  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
3984e07dc26bSmrg  # Adjust the below global symbol transforms to fixup imported variables.
3985e07dc26bSmrg  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
3986e07dc26bSmrg  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
3987e07dc26bSmrg  lt_c_name_lib_hook="\
3988e07dc26bSmrg  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
3989e07dc26bSmrg  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
3990e07dc26bSmrgelse
3991e07dc26bSmrg  # Disable hooks by default.
3992e07dc26bSmrg  lt_cv_sys_global_symbol_to_import=
3993e07dc26bSmrg  lt_cdecl_hook=
3994e07dc26bSmrg  lt_c_name_hook=
3995e07dc26bSmrg  lt_c_name_lib_hook=
3996e07dc26bSmrgfi
3997e07dc26bSmrg
3998e07dc26bSmrg# Transform an extracted symbol line into a proper C declaration.
3999e07dc26bSmrg# Some systems (esp. on ia64) link data and code symbols differently,
4000e07dc26bSmrg# so use this general approach.
4001e07dc26bSmrglt_cv_sys_global_symbol_to_cdecl="sed -n"\
4002e07dc26bSmrg$lt_cdecl_hook\
4003e07dc26bSmrg" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
4004e07dc26bSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
4005e07dc26bSmrg
4006e07dc26bSmrg# Transform an extracted symbol line into symbol name and symbol address
4007e07dc26bSmrglt_cv_sys_global_symbol_to_c_name_address="sed -n"\
4008e07dc26bSmrg$lt_c_name_hook\
4009e07dc26bSmrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
4010e07dc26bSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
4011e07dc26bSmrg
4012e07dc26bSmrg# Transform an extracted symbol line into symbol name with lib prefix and
4013e07dc26bSmrg# symbol address.
4014e07dc26bSmrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
4015e07dc26bSmrg$lt_c_name_lib_hook\
4016e07dc26bSmrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
4017e07dc26bSmrg" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
4018e07dc26bSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
4019e07dc26bSmrg
4020e07dc26bSmrg# Handle CRLF in mingw tool chain
4021e07dc26bSmrgopt_cr=
4022e07dc26bSmrgcase $build_os in
4023e07dc26bSmrgmingw*)
4024e07dc26bSmrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4025e07dc26bSmrg  ;;
4026e07dc26bSmrgesac
4027e07dc26bSmrg
4028e07dc26bSmrg# Try without a prefix underscore, then with it.
4029e07dc26bSmrgfor ac_symprfx in "" "_"; do
4030e07dc26bSmrg
4031e07dc26bSmrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4032e07dc26bSmrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
4033e07dc26bSmrg
4034e07dc26bSmrg  # Write the raw and C identifiers.
4035e07dc26bSmrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4036e07dc26bSmrg    # Fake it for dumpbin and say T for any non-static function,
4037e07dc26bSmrg    # D for any global variable and I for any imported variable.
4038e07dc26bSmrg    # Also find C++ and __fastcall symbols from MSVC++,
4039e07dc26bSmrg    # which start with @ or ?.
4040e07dc26bSmrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
4041e07dc26bSmrg"     {last_section=section; section=\$ 3};"\
4042e07dc26bSmrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
4043e07dc26bSmrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
4044e07dc26bSmrg"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
4045e07dc26bSmrg"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
4046e07dc26bSmrg"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
4047e07dc26bSmrg"     \$ 0!~/External *\|/{next};"\
4048e07dc26bSmrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
4049e07dc26bSmrg"     {if(hide[section]) next};"\
4050e07dc26bSmrg"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
4051e07dc26bSmrg"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
4052e07dc26bSmrg"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
4053e07dc26bSmrg"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
4054e07dc26bSmrg"     ' prfx=^$ac_symprfx]"
4055e07dc26bSmrg  else
4056e07dc26bSmrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4057e07dc26bSmrg  fi
4058e07dc26bSmrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4059e07dc26bSmrg
4060e07dc26bSmrg  # Check to see that the pipe works correctly.
4061e07dc26bSmrg  pipe_works=no
4062e07dc26bSmrg
4063e07dc26bSmrg  rm -f conftest*
4064e07dc26bSmrg  cat > conftest.$ac_ext <<_LT_EOF
4065e07dc26bSmrg#ifdef __cplusplus
4066e07dc26bSmrgextern "C" {
4067e07dc26bSmrg#endif
4068e07dc26bSmrgchar nm_test_var;
4069e07dc26bSmrgvoid nm_test_func(void);
4070e07dc26bSmrgvoid nm_test_func(void){}
4071e07dc26bSmrg#ifdef __cplusplus
4072e07dc26bSmrg}
4073e07dc26bSmrg#endif
4074e07dc26bSmrgint main(){nm_test_var='a';nm_test_func();return(0);}
4075e07dc26bSmrg_LT_EOF
4076e07dc26bSmrg
4077e07dc26bSmrg  if AC_TRY_EVAL(ac_compile); then
4078e07dc26bSmrg    # Now try to grab the symbols.
4079e07dc26bSmrg    nlist=conftest.nm
4080e07dc26bSmrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
4081e07dc26bSmrg      # Try sorting and uniquifying the output.
4082e07dc26bSmrg      if sort "$nlist" | uniq > "$nlist"T; then
4083e07dc26bSmrg	mv -f "$nlist"T "$nlist"
4084e07dc26bSmrg      else
4085e07dc26bSmrg	rm -f "$nlist"T
4086e07dc26bSmrg      fi
4087e07dc26bSmrg
4088e07dc26bSmrg      # Make sure that we snagged all the symbols we need.
4089e07dc26bSmrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
4090e07dc26bSmrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
4091e07dc26bSmrg	  cat <<_LT_EOF > conftest.$ac_ext
4092e07dc26bSmrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
4093e07dc26bSmrg#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
4094e07dc26bSmrg/* DATA imports from DLLs on WIN32 can't be const, because runtime
4095e07dc26bSmrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
4096e07dc26bSmrg# define LT@&t@_DLSYM_CONST
4097e07dc26bSmrg#elif defined __osf__
4098e07dc26bSmrg/* This system does not cope well with relocations in const data.  */
4099e07dc26bSmrg# define LT@&t@_DLSYM_CONST
4100e07dc26bSmrg#else
4101e07dc26bSmrg# define LT@&t@_DLSYM_CONST const
4102e07dc26bSmrg#endif
4103e07dc26bSmrg
4104e07dc26bSmrg#ifdef __cplusplus
4105e07dc26bSmrgextern "C" {
4106e07dc26bSmrg#endif
4107e07dc26bSmrg
4108e07dc26bSmrg_LT_EOF
4109e07dc26bSmrg	  # Now generate the symbol file.
4110e07dc26bSmrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4111e07dc26bSmrg
4112e07dc26bSmrg	  cat <<_LT_EOF >> conftest.$ac_ext
4113e07dc26bSmrg
4114e07dc26bSmrg/* The mapping between symbol names and symbols.  */
4115e07dc26bSmrgLT@&t@_DLSYM_CONST struct {
4116e07dc26bSmrg  const char *name;
4117e07dc26bSmrg  void       *address;
4118e07dc26bSmrg}
4119e07dc26bSmrglt__PROGRAM__LTX_preloaded_symbols[[]] =
4120e07dc26bSmrg{
4121e07dc26bSmrg  { "@PROGRAM@", (void *) 0 },
4122e07dc26bSmrg_LT_EOF
4123e07dc26bSmrg	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4124e07dc26bSmrg	  cat <<\_LT_EOF >> conftest.$ac_ext
4125e07dc26bSmrg  {0, (void *) 0}
4126e07dc26bSmrg};
4127e07dc26bSmrg
4128e07dc26bSmrg/* This works around a problem in FreeBSD linker */
4129e07dc26bSmrg#ifdef FREEBSD_WORKAROUND
4130e07dc26bSmrgstatic const void *lt_preloaded_setup() {
4131e07dc26bSmrg  return lt__PROGRAM__LTX_preloaded_symbols;
4132e07dc26bSmrg}
4133e07dc26bSmrg#endif
4134e07dc26bSmrg
4135e07dc26bSmrg#ifdef __cplusplus
4136e07dc26bSmrg}
4137e07dc26bSmrg#endif
4138e07dc26bSmrg_LT_EOF
4139e07dc26bSmrg	  # Now try linking the two files.
4140e07dc26bSmrg	  mv conftest.$ac_objext conftstm.$ac_objext
4141e07dc26bSmrg	  lt_globsym_save_LIBS=$LIBS
4142e07dc26bSmrg	  lt_globsym_save_CFLAGS=$CFLAGS
4143e07dc26bSmrg	  LIBS=conftstm.$ac_objext
4144e07dc26bSmrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4145e07dc26bSmrg	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
4146e07dc26bSmrg	    pipe_works=yes
4147e07dc26bSmrg	  fi
4148e07dc26bSmrg	  LIBS=$lt_globsym_save_LIBS
4149e07dc26bSmrg	  CFLAGS=$lt_globsym_save_CFLAGS
4150e07dc26bSmrg	else
4151e07dc26bSmrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4152e07dc26bSmrg	fi
4153e07dc26bSmrg      else
4154e07dc26bSmrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4155e07dc26bSmrg      fi
4156e07dc26bSmrg    else
4157e07dc26bSmrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4158e07dc26bSmrg    fi
4159e07dc26bSmrg  else
4160e07dc26bSmrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4161e07dc26bSmrg    cat conftest.$ac_ext >&5
4162e07dc26bSmrg  fi
4163e07dc26bSmrg  rm -rf conftest* conftst*
4164e07dc26bSmrg
4165e07dc26bSmrg  # Do not use the global_symbol_pipe unless it works.
4166e07dc26bSmrg  if test yes = "$pipe_works"; then
4167e07dc26bSmrg    break
4168e07dc26bSmrg  else
4169e07dc26bSmrg    lt_cv_sys_global_symbol_pipe=
4170e07dc26bSmrg  fi
4171e07dc26bSmrgdone
4172e07dc26bSmrg])
4173e07dc26bSmrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
4174e07dc26bSmrg  lt_cv_sys_global_symbol_to_cdecl=
4175e07dc26bSmrgfi
4176e07dc26bSmrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4177e07dc26bSmrg  AC_MSG_RESULT(failed)
4178e07dc26bSmrgelse
4179e07dc26bSmrg  AC_MSG_RESULT(ok)
4180e07dc26bSmrgfi
4181e07dc26bSmrg
4182e07dc26bSmrg# Response file support.
4183e07dc26bSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
4184e07dc26bSmrg  nm_file_list_spec='@'
4185e07dc26bSmrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
4186e07dc26bSmrg  nm_file_list_spec='@'
4187e07dc26bSmrgfi
4188e07dc26bSmrg
4189e07dc26bSmrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
4190e07dc26bSmrg    [Take the output of nm and produce a listing of raw symbols and C names])
4191e07dc26bSmrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
4192e07dc26bSmrg    [Transform the output of nm in a proper C declaration])
4193e07dc26bSmrg_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
4194e07dc26bSmrg    [Transform the output of nm into a list of symbols to manually relocate])
4195e07dc26bSmrg_LT_DECL([global_symbol_to_c_name_address],
4196e07dc26bSmrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
4197e07dc26bSmrg    [Transform the output of nm in a C name address pair])
4198e07dc26bSmrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
4199e07dc26bSmrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
4200e07dc26bSmrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
4201e07dc26bSmrg_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
4202e07dc26bSmrg    [The name lister interface])
4203e07dc26bSmrg_LT_DECL([], [nm_file_list_spec], [1],
4204e07dc26bSmrg    [Specify filename containing input files for $NM])
4205e07dc26bSmrg]) # _LT_CMD_GLOBAL_SYMBOLS
4206e07dc26bSmrg
4207e07dc26bSmrg
4208e07dc26bSmrg# _LT_COMPILER_PIC([TAGNAME])
4209e07dc26bSmrg# ---------------------------
4210e07dc26bSmrgm4_defun([_LT_COMPILER_PIC],
4211e07dc26bSmrg[m4_require([_LT_TAG_COMPILER])dnl
4212e07dc26bSmrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
4213e07dc26bSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4214e07dc26bSmrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
4215e07dc26bSmrg
4216e07dc26bSmrgm4_if([$1], [CXX], [
4217e07dc26bSmrg  # C++ specific cases for pic, static, wl, etc.
4218e07dc26bSmrg  if test yes = "$GXX"; then
4219e07dc26bSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4220e07dc26bSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4221e07dc26bSmrg
4222e07dc26bSmrg    case $host_os in
4223e07dc26bSmrg    aix*)
4224e07dc26bSmrg      # All AIX code is PIC.
4225e07dc26bSmrg      if test ia64 = "$host_cpu"; then
4226e07dc26bSmrg	# AIX 5 now supports IA64 processor
4227e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4228e07dc26bSmrg      fi
4229e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4230e07dc26bSmrg      ;;
4231e07dc26bSmrg
4232e07dc26bSmrg    amigaos*)
4233e07dc26bSmrg      case $host_cpu in
4234e07dc26bSmrg      powerpc)
4235e07dc26bSmrg            # see comment about AmigaOS4 .so support
4236e07dc26bSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4237e07dc26bSmrg        ;;
4238e07dc26bSmrg      m68k)
4239e07dc26bSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
4240e07dc26bSmrg            # adding the '-m68020' flag to GCC prevents building anything better,
4241e07dc26bSmrg            # like '-m68040'.
4242e07dc26bSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4243e07dc26bSmrg        ;;
4244e07dc26bSmrg      esac
4245e07dc26bSmrg      ;;
4246e07dc26bSmrg
4247e07dc26bSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4248e07dc26bSmrg      # PIC is the default for these OSes.
4249e07dc26bSmrg      ;;
4250e07dc26bSmrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
4251e07dc26bSmrg      # This hack is so that the source file can tell whether it is being
4252e07dc26bSmrg      # built for inclusion in a dll (and should export symbols for example).
4253e07dc26bSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4254e07dc26bSmrg      # (--disable-auto-import) libraries
4255e07dc26bSmrg      m4_if([$1], [GCJ], [],
4256e07dc26bSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4257e07dc26bSmrg      case $host_os in
4258e07dc26bSmrg      os2*)
4259e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4260e07dc26bSmrg	;;
4261e07dc26bSmrg      esac
4262e07dc26bSmrg      ;;
4263e07dc26bSmrg    darwin* | rhapsody*)
4264e07dc26bSmrg      # PIC is the default on this platform
4265e07dc26bSmrg      # Common symbols not allowed in MH_DYLIB files
4266e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4267e07dc26bSmrg      ;;
4268e07dc26bSmrg    *djgpp*)
4269e07dc26bSmrg      # DJGPP does not support shared libraries at all
4270e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4271e07dc26bSmrg      ;;
4272e07dc26bSmrg    haiku*)
4273e07dc26bSmrg      # PIC is the default for Haiku.
4274e07dc26bSmrg      # The "-static" flag exists, but is broken.
4275e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4276e07dc26bSmrg      ;;
4277e07dc26bSmrg    interix[[3-9]]*)
4278e07dc26bSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4279e07dc26bSmrg      # Instead, we relocate shared libraries at runtime.
4280e07dc26bSmrg      ;;
4281e07dc26bSmrg    sysv4*MP*)
4282e07dc26bSmrg      if test -d /usr/nec; then
4283e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4284e07dc26bSmrg      fi
4285e07dc26bSmrg      ;;
4286e07dc26bSmrg    hpux*)
4287e07dc26bSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4288e07dc26bSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4289e07dc26bSmrg      # sets the default TLS model and affects inlining.
4290e07dc26bSmrg      case $host_cpu in
4291e07dc26bSmrg      hppa*64*)
4292e07dc26bSmrg	;;
4293e07dc26bSmrg      *)
4294e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4295e07dc26bSmrg	;;
4296e07dc26bSmrg      esac
4297e07dc26bSmrg      ;;
4298e07dc26bSmrg    *qnx* | *nto*)
4299e07dc26bSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4300e07dc26bSmrg      # it will coredump.
4301e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4302e07dc26bSmrg      ;;
4303e07dc26bSmrg    *)
4304e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4305e07dc26bSmrg      ;;
4306e07dc26bSmrg    esac
4307e07dc26bSmrg  else
4308e07dc26bSmrg    case $host_os in
4309e07dc26bSmrg      aix[[4-9]]*)
4310e07dc26bSmrg	# All AIX code is PIC.
4311e07dc26bSmrg	if test ia64 = "$host_cpu"; then
4312e07dc26bSmrg	  # AIX 5 now supports IA64 processor
4313e07dc26bSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4314e07dc26bSmrg	else
4315e07dc26bSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4316e07dc26bSmrg	fi
4317e07dc26bSmrg	;;
4318e07dc26bSmrg      chorus*)
4319e07dc26bSmrg	case $cc_basename in
4320e07dc26bSmrg	cxch68*)
4321e07dc26bSmrg	  # Green Hills C++ Compiler
4322e07dc26bSmrg	  # _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"
4323e07dc26bSmrg	  ;;
4324e07dc26bSmrg	esac
4325e07dc26bSmrg	;;
4326e07dc26bSmrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
4327e07dc26bSmrg	# This hack is so that the source file can tell whether it is being
4328e07dc26bSmrg	# built for inclusion in a dll (and should export symbols for example).
4329e07dc26bSmrg	m4_if([$1], [GCJ], [],
4330e07dc26bSmrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4331e07dc26bSmrg	;;
4332e07dc26bSmrg      dgux*)
4333e07dc26bSmrg	case $cc_basename in
4334e07dc26bSmrg	  ec++*)
4335e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4336e07dc26bSmrg	    ;;
4337e07dc26bSmrg	  ghcx*)
4338e07dc26bSmrg	    # Green Hills C++ Compiler
4339e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4340e07dc26bSmrg	    ;;
4341e07dc26bSmrg	  *)
4342e07dc26bSmrg	    ;;
4343e07dc26bSmrg	esac
4344e07dc26bSmrg	;;
4345e07dc26bSmrg      freebsd* | dragonfly*)
4346e07dc26bSmrg	# FreeBSD uses GNU C++
4347e07dc26bSmrg	;;
4348e07dc26bSmrg      hpux9* | hpux10* | hpux11*)
4349e07dc26bSmrg	case $cc_basename in
4350e07dc26bSmrg	  CC*)
4351e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4352e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4353e07dc26bSmrg	    if test ia64 != "$host_cpu"; then
4354e07dc26bSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4355e07dc26bSmrg	    fi
4356e07dc26bSmrg	    ;;
4357e07dc26bSmrg	  aCC*)
4358e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4359e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4360e07dc26bSmrg	    case $host_cpu in
4361e07dc26bSmrg	    hppa*64*|ia64*)
4362e07dc26bSmrg	      # +Z the default
4363e07dc26bSmrg	      ;;
4364e07dc26bSmrg	    *)
4365e07dc26bSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4366e07dc26bSmrg	      ;;
4367e07dc26bSmrg	    esac
4368e07dc26bSmrg	    ;;
4369e07dc26bSmrg	  *)
4370e07dc26bSmrg	    ;;
4371e07dc26bSmrg	esac
4372e07dc26bSmrg	;;
4373e07dc26bSmrg      interix*)
4374e07dc26bSmrg	# This is c89, which is MS Visual C++ (no shared libs)
4375e07dc26bSmrg	# Anyone wants to do a port?
4376e07dc26bSmrg	;;
4377e07dc26bSmrg      irix5* | irix6* | nonstopux*)
4378e07dc26bSmrg	case $cc_basename in
4379e07dc26bSmrg	  CC*)
4380e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4381e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4382e07dc26bSmrg	    # CC pic flag -KPIC is the default.
4383e07dc26bSmrg	    ;;
4384e07dc26bSmrg	  *)
4385e07dc26bSmrg	    ;;
4386e07dc26bSmrg	esac
4387e07dc26bSmrg	;;
4388e07dc26bSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
4389e07dc26bSmrg	case $cc_basename in
4390e07dc26bSmrg	  KCC*)
4391e07dc26bSmrg	    # KAI C++ Compiler
4392e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4393e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4394e07dc26bSmrg	    ;;
4395e07dc26bSmrg	  ecpc* )
4396e07dc26bSmrg	    # old Intel C++ for x86_64, which still supported -KPIC.
4397e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4398e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4399e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4400e07dc26bSmrg	    ;;
4401e07dc26bSmrg	  icpc* )
4402e07dc26bSmrg	    # Intel C++, used to be incompatible with GCC.
4403e07dc26bSmrg	    # ICC 10 doesn't accept -KPIC any more.
4404e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4405e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4406e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4407e07dc26bSmrg	    ;;
4408e07dc26bSmrg	  pgCC* | pgcpp*)
4409e07dc26bSmrg	    # Portland Group C++ compiler
4410e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4411e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4412e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4413e07dc26bSmrg	    ;;
4414e07dc26bSmrg	  cxx*)
4415e07dc26bSmrg	    # Compaq C++
4416e07dc26bSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
4417e07dc26bSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
4418e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4419e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4420e07dc26bSmrg	    ;;
4421e07dc26bSmrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
4422e07dc26bSmrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
4423e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4424e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4425e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4426e07dc26bSmrg	    ;;
4427e07dc26bSmrg	  *)
4428e07dc26bSmrg	    case `$CC -V 2>&1 | sed 5q` in
4429e07dc26bSmrg	    *Sun\ C*)
4430e07dc26bSmrg	      # Sun C++ 5.9
4431e07dc26bSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4432e07dc26bSmrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4433e07dc26bSmrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4434e07dc26bSmrg	      ;;
4435e07dc26bSmrg	    esac
4436e07dc26bSmrg	    ;;
4437e07dc26bSmrg	esac
4438e07dc26bSmrg	;;
4439e07dc26bSmrg      lynxos*)
4440e07dc26bSmrg	;;
4441e07dc26bSmrg      m88k*)
4442e07dc26bSmrg	;;
4443e07dc26bSmrg      mvs*)
4444e07dc26bSmrg	case $cc_basename in
4445e07dc26bSmrg	  cxx*)
4446e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
4447e07dc26bSmrg	    ;;
4448e07dc26bSmrg	  *)
4449e07dc26bSmrg	    ;;
4450e07dc26bSmrg	esac
4451e07dc26bSmrg	;;
4452e07dc26bSmrg      netbsd* | netbsdelf*-gnu)
4453e07dc26bSmrg	;;
4454e07dc26bSmrg      *qnx* | *nto*)
4455e07dc26bSmrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
4456e07dc26bSmrg        # it will coredump.
4457e07dc26bSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4458e07dc26bSmrg        ;;
4459e07dc26bSmrg      osf3* | osf4* | osf5*)
4460e07dc26bSmrg	case $cc_basename in
4461e07dc26bSmrg	  KCC*)
4462e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4463e07dc26bSmrg	    ;;
4464e07dc26bSmrg	  RCC*)
4465e07dc26bSmrg	    # Rational C++ 2.4.1
4466e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4467e07dc26bSmrg	    ;;
4468e07dc26bSmrg	  cxx*)
4469e07dc26bSmrg	    # Digital/Compaq C++
4470e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4471e07dc26bSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
4472e07dc26bSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
4473e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4474e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4475e07dc26bSmrg	    ;;
4476e07dc26bSmrg	  *)
4477e07dc26bSmrg	    ;;
4478e07dc26bSmrg	esac
4479e07dc26bSmrg	;;
4480e07dc26bSmrg      psos*)
4481e07dc26bSmrg	;;
4482e07dc26bSmrg      solaris*)
4483e07dc26bSmrg	case $cc_basename in
4484e07dc26bSmrg	  CC* | sunCC*)
4485e07dc26bSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
4486e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4487e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4488e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4489e07dc26bSmrg	    ;;
4490e07dc26bSmrg	  gcx*)
4491e07dc26bSmrg	    # Green Hills C++ Compiler
4492e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4493e07dc26bSmrg	    ;;
4494e07dc26bSmrg	  *)
4495e07dc26bSmrg	    ;;
4496e07dc26bSmrg	esac
4497e07dc26bSmrg	;;
4498e07dc26bSmrg      sunos4*)
4499e07dc26bSmrg	case $cc_basename in
4500e07dc26bSmrg	  CC*)
4501e07dc26bSmrg	    # Sun C++ 4.x
4502e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4503e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4504e07dc26bSmrg	    ;;
4505e07dc26bSmrg	  lcc*)
4506e07dc26bSmrg	    # Lucid
4507e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4508e07dc26bSmrg	    ;;
4509e07dc26bSmrg	  *)
4510e07dc26bSmrg	    ;;
4511e07dc26bSmrg	esac
4512e07dc26bSmrg	;;
4513e07dc26bSmrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4514e07dc26bSmrg	case $cc_basename in
4515e07dc26bSmrg	  CC*)
4516e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4517e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4518e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4519e07dc26bSmrg	    ;;
4520e07dc26bSmrg	esac
4521e07dc26bSmrg	;;
4522e07dc26bSmrg      tandem*)
4523e07dc26bSmrg	case $cc_basename in
4524e07dc26bSmrg	  NCC*)
4525e07dc26bSmrg	    # NonStop-UX NCC 3.20
4526e07dc26bSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4527e07dc26bSmrg	    ;;
4528e07dc26bSmrg	  *)
4529e07dc26bSmrg	    ;;
4530e07dc26bSmrg	esac
4531e07dc26bSmrg	;;
4532e07dc26bSmrg      vxworks*)
4533e07dc26bSmrg	;;
4534e07dc26bSmrg      *)
4535e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4536e07dc26bSmrg	;;
4537e07dc26bSmrg    esac
4538e07dc26bSmrg  fi
4539e07dc26bSmrg],
4540e07dc26bSmrg[
4541e07dc26bSmrg  if test yes = "$GCC"; then
4542e07dc26bSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4543e07dc26bSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4544e07dc26bSmrg
4545e07dc26bSmrg    case $host_os in
4546e07dc26bSmrg      aix*)
4547e07dc26bSmrg      # All AIX code is PIC.
4548e07dc26bSmrg      if test ia64 = "$host_cpu"; then
4549e07dc26bSmrg	# AIX 5 now supports IA64 processor
4550e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4551e07dc26bSmrg      fi
4552e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4553e07dc26bSmrg      ;;
4554e07dc26bSmrg
4555e07dc26bSmrg    amigaos*)
4556e07dc26bSmrg      case $host_cpu in
4557e07dc26bSmrg      powerpc)
4558e07dc26bSmrg            # see comment about AmigaOS4 .so support
4559e07dc26bSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4560e07dc26bSmrg        ;;
4561e07dc26bSmrg      m68k)
4562e07dc26bSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
4563e07dc26bSmrg            # adding the '-m68020' flag to GCC prevents building anything better,
4564e07dc26bSmrg            # like '-m68040'.
4565e07dc26bSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4566e07dc26bSmrg        ;;
4567e07dc26bSmrg      esac
4568e07dc26bSmrg      ;;
4569e07dc26bSmrg
4570e07dc26bSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4571e07dc26bSmrg      # PIC is the default for these OSes.
4572e07dc26bSmrg      ;;
4573e07dc26bSmrg
4574e07dc26bSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
4575e07dc26bSmrg      # This hack is so that the source file can tell whether it is being
4576e07dc26bSmrg      # built for inclusion in a dll (and should export symbols for example).
4577e07dc26bSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4578e07dc26bSmrg      # (--disable-auto-import) libraries
4579e07dc26bSmrg      m4_if([$1], [GCJ], [],
4580e07dc26bSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4581e07dc26bSmrg      case $host_os in
4582e07dc26bSmrg      os2*)
4583e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4584e07dc26bSmrg	;;
4585e07dc26bSmrg      esac
4586e07dc26bSmrg      ;;
4587e07dc26bSmrg
4588e07dc26bSmrg    darwin* | rhapsody*)
4589e07dc26bSmrg      # PIC is the default on this platform
4590e07dc26bSmrg      # Common symbols not allowed in MH_DYLIB files
4591e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4592e07dc26bSmrg      ;;
4593e07dc26bSmrg
4594e07dc26bSmrg    haiku*)
4595e07dc26bSmrg      # PIC is the default for Haiku.
4596e07dc26bSmrg      # The "-static" flag exists, but is broken.
4597e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4598e07dc26bSmrg      ;;
4599e07dc26bSmrg
4600e07dc26bSmrg    hpux*)
4601e07dc26bSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4602e07dc26bSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4603e07dc26bSmrg      # sets the default TLS model and affects inlining.
4604e07dc26bSmrg      case $host_cpu in
4605e07dc26bSmrg      hppa*64*)
4606e07dc26bSmrg	# +Z the default
4607e07dc26bSmrg	;;
4608e07dc26bSmrg      *)
4609e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4610e07dc26bSmrg	;;
4611e07dc26bSmrg      esac
4612e07dc26bSmrg      ;;
4613e07dc26bSmrg
4614e07dc26bSmrg    interix[[3-9]]*)
4615e07dc26bSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4616e07dc26bSmrg      # Instead, we relocate shared libraries at runtime.
4617e07dc26bSmrg      ;;
4618e07dc26bSmrg
4619e07dc26bSmrg    msdosdjgpp*)
4620e07dc26bSmrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
4621e07dc26bSmrg      # on systems that don't support them.
4622e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4623e07dc26bSmrg      enable_shared=no
4624e07dc26bSmrg      ;;
4625e07dc26bSmrg
4626e07dc26bSmrg    *nto* | *qnx*)
4627e07dc26bSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4628e07dc26bSmrg      # it will coredump.
4629e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4630e07dc26bSmrg      ;;
4631e07dc26bSmrg
4632e07dc26bSmrg    sysv4*MP*)
4633e07dc26bSmrg      if test -d /usr/nec; then
4634e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4635e07dc26bSmrg      fi
4636e07dc26bSmrg      ;;
4637e07dc26bSmrg
4638e07dc26bSmrg    *)
4639e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4640e07dc26bSmrg      ;;
4641e07dc26bSmrg    esac
4642e07dc26bSmrg
4643e07dc26bSmrg    case $cc_basename in
4644e07dc26bSmrg    nvcc*) # Cuda Compiler Driver 2.2
4645e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
4646e07dc26bSmrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4647e07dc26bSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
4648e07dc26bSmrg      fi
4649e07dc26bSmrg      ;;
4650e07dc26bSmrg    esac
4651e07dc26bSmrg  else
4652e07dc26bSmrg    # PORTME Check for flag to pass linker flags through the system compiler.
4653e07dc26bSmrg    case $host_os in
4654e07dc26bSmrg    aix*)
4655e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4656e07dc26bSmrg      if test ia64 = "$host_cpu"; then
4657e07dc26bSmrg	# AIX 5 now supports IA64 processor
4658e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4659e07dc26bSmrg      else
4660e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4661e07dc26bSmrg      fi
4662e07dc26bSmrg      ;;
4663e07dc26bSmrg
4664e07dc26bSmrg    darwin* | rhapsody*)
4665e07dc26bSmrg      # PIC is the default on this platform
4666e07dc26bSmrg      # Common symbols not allowed in MH_DYLIB files
4667e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4668e07dc26bSmrg      case $cc_basename in
4669e07dc26bSmrg      nagfor*)
4670e07dc26bSmrg        # NAG Fortran compiler
4671e07dc26bSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4672e07dc26bSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4673e07dc26bSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4674e07dc26bSmrg        ;;
4675e07dc26bSmrg      esac
4676e07dc26bSmrg      ;;
4677e07dc26bSmrg
4678e07dc26bSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
4679e07dc26bSmrg      # This hack is so that the source file can tell whether it is being
4680e07dc26bSmrg      # built for inclusion in a dll (and should export symbols for example).
4681e07dc26bSmrg      m4_if([$1], [GCJ], [],
4682e07dc26bSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4683e07dc26bSmrg      case $host_os in
4684e07dc26bSmrg      os2*)
4685e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4686e07dc26bSmrg	;;
4687e07dc26bSmrg      esac
4688e07dc26bSmrg      ;;
4689e07dc26bSmrg
4690e07dc26bSmrg    hpux9* | hpux10* | hpux11*)
4691e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4692e07dc26bSmrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
4693e07dc26bSmrg      # not for PA HP-UX.
4694e07dc26bSmrg      case $host_cpu in
4695e07dc26bSmrg      hppa*64*|ia64*)
4696e07dc26bSmrg	# +Z the default
4697e07dc26bSmrg	;;
4698e07dc26bSmrg      *)
4699e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4700e07dc26bSmrg	;;
4701e07dc26bSmrg      esac
4702e07dc26bSmrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
4703e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4704e07dc26bSmrg      ;;
4705e07dc26bSmrg
4706e07dc26bSmrg    irix5* | irix6* | nonstopux*)
4707e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4708e07dc26bSmrg      # PIC (with -KPIC) is the default.
4709e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4710e07dc26bSmrg      ;;
4711e07dc26bSmrg
4712e07dc26bSmrg    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
4713e07dc26bSmrg      case $cc_basename in
4714e07dc26bSmrg      # old Intel for x86_64, which still supported -KPIC.
4715e07dc26bSmrg      ecc*)
4716e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4717e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4718e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4719e07dc26bSmrg        ;;
4720e07dc26bSmrg      # icc used to be incompatible with GCC.
4721e07dc26bSmrg      # ICC 10 doesn't accept -KPIC any more.
4722e07dc26bSmrg      icc* | ifort*)
4723e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4724e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4725e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4726e07dc26bSmrg        ;;
4727e07dc26bSmrg      # Lahey Fortran 8.1.
4728e07dc26bSmrg      lf95*)
4729e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4730e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4731e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4732e07dc26bSmrg	;;
4733e07dc26bSmrg      nagfor*)
4734e07dc26bSmrg	# NAG Fortran compiler
4735e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4736e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4737e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4738e07dc26bSmrg	;;
4739e07dc26bSmrg      tcc*)
4740e07dc26bSmrg	# Fabrice Bellard et al's Tiny C Compiler
4741e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4742e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4743e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4744e07dc26bSmrg	;;
4745e07dc26bSmrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
4746e07dc26bSmrg        # Portland Group compilers (*not* the Pentium gcc compiler,
4747e07dc26bSmrg	# which looks to be a dead project)
4748e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4749e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4750e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4751e07dc26bSmrg        ;;
4752e07dc26bSmrg      ccc*)
4753e07dc26bSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4754e07dc26bSmrg        # All Alpha code is PIC.
4755e07dc26bSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4756e07dc26bSmrg        ;;
4757e07dc26bSmrg      xl* | bgxl* | bgf* | mpixl*)
4758e07dc26bSmrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
4759e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4760e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4761e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4762e07dc26bSmrg	;;
4763e07dc26bSmrg      *)
4764e07dc26bSmrg	case `$CC -V 2>&1 | sed 5q` in
4765e07dc26bSmrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
4766e07dc26bSmrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
4767e07dc26bSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4768e07dc26bSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4769e07dc26bSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4770e07dc26bSmrg	  ;;
4771e07dc26bSmrg	*Sun\ F* | *Sun*Fortran*)
4772e07dc26bSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4773e07dc26bSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4774e07dc26bSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4775e07dc26bSmrg	  ;;
4776e07dc26bSmrg	*Sun\ C*)
4777e07dc26bSmrg	  # Sun C 5.9
4778e07dc26bSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4779e07dc26bSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4780e07dc26bSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4781e07dc26bSmrg	  ;;
4782e07dc26bSmrg        *Intel*\ [[CF]]*Compiler*)
4783e07dc26bSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4784e07dc26bSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4785e07dc26bSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4786e07dc26bSmrg	  ;;
4787e07dc26bSmrg	*Portland\ Group*)
4788e07dc26bSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4789e07dc26bSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4790e07dc26bSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4791e07dc26bSmrg	  ;;
4792e07dc26bSmrg	esac
4793e07dc26bSmrg	;;
4794e07dc26bSmrg      esac
4795e07dc26bSmrg      ;;
4796e07dc26bSmrg
4797e07dc26bSmrg    newsos6)
4798e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4799e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4800e07dc26bSmrg      ;;
4801e07dc26bSmrg
4802e07dc26bSmrg    *nto* | *qnx*)
4803e07dc26bSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4804e07dc26bSmrg      # it will coredump.
4805e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4806e07dc26bSmrg      ;;
4807e07dc26bSmrg
4808e07dc26bSmrg    osf3* | osf4* | osf5*)
4809e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4810e07dc26bSmrg      # All OSF/1 code is PIC.
4811e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4812e07dc26bSmrg      ;;
4813e07dc26bSmrg
4814e07dc26bSmrg    rdos*)
4815e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4816e07dc26bSmrg      ;;
4817e07dc26bSmrg
4818e07dc26bSmrg    solaris*)
4819e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4820e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4821e07dc26bSmrg      case $cc_basename in
4822e07dc26bSmrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
4823e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4824e07dc26bSmrg      *)
4825e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4826e07dc26bSmrg      esac
4827e07dc26bSmrg      ;;
4828e07dc26bSmrg
4829e07dc26bSmrg    sunos4*)
4830e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4831e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4832e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4833e07dc26bSmrg      ;;
4834e07dc26bSmrg
4835e07dc26bSmrg    sysv4 | sysv4.2uw2* | sysv4.3*)
4836e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4837e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4838e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4839e07dc26bSmrg      ;;
4840e07dc26bSmrg
4841e07dc26bSmrg    sysv4*MP*)
4842e07dc26bSmrg      if test -d /usr/nec; then
4843e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4844e07dc26bSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4845e07dc26bSmrg      fi
4846e07dc26bSmrg      ;;
4847e07dc26bSmrg
4848e07dc26bSmrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4849e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4850e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4851e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4852e07dc26bSmrg      ;;
4853e07dc26bSmrg
4854e07dc26bSmrg    unicos*)
4855e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4856e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4857e07dc26bSmrg      ;;
4858e07dc26bSmrg
4859e07dc26bSmrg    uts4*)
4860e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4861e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4862e07dc26bSmrg      ;;
4863e07dc26bSmrg
4864e07dc26bSmrg    *)
4865e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4866e07dc26bSmrg      ;;
4867e07dc26bSmrg    esac
4868e07dc26bSmrg  fi
4869e07dc26bSmrg])
4870e07dc26bSmrgcase $host_os in
4871e07dc26bSmrg  # For platforms that do not support PIC, -DPIC is meaningless:
4872e07dc26bSmrg  *djgpp*)
4873e07dc26bSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4874e07dc26bSmrg    ;;
4875e07dc26bSmrg  *)
4876e07dc26bSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4877e07dc26bSmrg    ;;
4878e07dc26bSmrgesac
4879e07dc26bSmrg
4880e07dc26bSmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
4881e07dc26bSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
4882e07dc26bSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4883e07dc26bSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
4884e07dc26bSmrg
4885e07dc26bSmrg#
4886e07dc26bSmrg# Check to make sure the PIC flag actually works.
4887e07dc26bSmrg#
4888e07dc26bSmrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4889e07dc26bSmrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4890e07dc26bSmrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4891e07dc26bSmrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4892e07dc26bSmrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4893e07dc26bSmrg     "" | " "*) ;;
4894e07dc26bSmrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4895e07dc26bSmrg     esac],
4896e07dc26bSmrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4897e07dc26bSmrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4898e07dc26bSmrgfi
4899e07dc26bSmrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4900e07dc26bSmrg	[Additional compiler flags for building library objects])
4901e07dc26bSmrg
4902e07dc26bSmrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4903e07dc26bSmrg	[How to pass a linker flag through the compiler])
4904e07dc26bSmrg#
4905e07dc26bSmrg# Check to make sure the static flag actually works.
4906e07dc26bSmrg#
4907e07dc26bSmrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4908e07dc26bSmrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4909e07dc26bSmrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4910e07dc26bSmrg  $lt_tmp_static_flag,
4911e07dc26bSmrg  [],
4912e07dc26bSmrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4913e07dc26bSmrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4914e07dc26bSmrg	[Compiler flag to prevent dynamic linking])
4915e07dc26bSmrg])# _LT_COMPILER_PIC
4916e07dc26bSmrg
4917e07dc26bSmrg
4918e07dc26bSmrg# _LT_LINKER_SHLIBS([TAGNAME])
4919e07dc26bSmrg# ----------------------------
4920e07dc26bSmrg# See if the linker supports building shared libraries.
4921e07dc26bSmrgm4_defun([_LT_LINKER_SHLIBS],
4922e07dc26bSmrg[AC_REQUIRE([LT_PATH_LD])dnl
4923e07dc26bSmrgAC_REQUIRE([LT_PATH_NM])dnl
4924e07dc26bSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
4925e07dc26bSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4926e07dc26bSmrgm4_require([_LT_DECL_EGREP])dnl
4927e07dc26bSmrgm4_require([_LT_DECL_SED])dnl
4928e07dc26bSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4929e07dc26bSmrgm4_require([_LT_TAG_COMPILER])dnl
4930e07dc26bSmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4931e07dc26bSmrgm4_if([$1], [CXX], [
4932e07dc26bSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4933e07dc26bSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4934e07dc26bSmrg  case $host_os in
4935e07dc26bSmrg  aix[[4-9]]*)
4936e07dc26bSmrg    # If we're using GNU nm, then we don't want the "-C" option.
4937e07dc26bSmrg    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
4938e07dc26bSmrg    # Without the "-l" option, or with the "-B" option, AIX nm treats
4939e07dc26bSmrg    # weak defined symbols like other global defined symbols, whereas
4940e07dc26bSmrg    # GNU nm marks them as "W".
4941e07dc26bSmrg    # While the 'weak' keyword is ignored in the Export File, we need
4942e07dc26bSmrg    # it in the Import File for the 'aix-soname' feature, so we have
4943e07dc26bSmrg    # to replace the "-B" option with "-P" for AIX nm.
4944e07dc26bSmrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4945e07dc26bSmrg      _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'
4946e07dc26bSmrg    else
4947e07dc26bSmrg      _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'
4948e07dc26bSmrg    fi
4949e07dc26bSmrg    ;;
4950e07dc26bSmrg  pw32*)
4951e07dc26bSmrg    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
4952e07dc26bSmrg    ;;
4953e07dc26bSmrg  cygwin* | mingw* | cegcc*)
4954e07dc26bSmrg    case $cc_basename in
4955e07dc26bSmrg    cl*)
4956e07dc26bSmrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
4957e07dc26bSmrg      ;;
4958e07dc26bSmrg    *)
4959e07dc26bSmrg      _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'
4960e07dc26bSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4961e07dc26bSmrg      ;;
4962e07dc26bSmrg    esac
4963e07dc26bSmrg    ;;
4964e07dc26bSmrg  linux* | k*bsd*-gnu | gnu*)
4965e07dc26bSmrg    _LT_TAGVAR(link_all_deplibs, $1)=no
4966e07dc26bSmrg    ;;
4967e07dc26bSmrg  *)
4968e07dc26bSmrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4969e07dc26bSmrg    ;;
4970e07dc26bSmrg  esac
4971e07dc26bSmrg], [
4972e07dc26bSmrg  runpath_var=
4973e07dc26bSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=
4974e07dc26bSmrg  _LT_TAGVAR(always_export_symbols, $1)=no
4975e07dc26bSmrg  _LT_TAGVAR(archive_cmds, $1)=
4976e07dc26bSmrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
4977e07dc26bSmrg  _LT_TAGVAR(compiler_needs_object, $1)=no
4978e07dc26bSmrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4979e07dc26bSmrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4980e07dc26bSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4981e07dc26bSmrg  _LT_TAGVAR(hardcode_automatic, $1)=no
4982e07dc26bSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
4983e07dc26bSmrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4984e07dc26bSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4985e07dc26bSmrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4986e07dc26bSmrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
4987e07dc26bSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4988e07dc26bSmrg  _LT_TAGVAR(inherit_rpath, $1)=no
4989e07dc26bSmrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
4990e07dc26bSmrg  _LT_TAGVAR(module_cmds, $1)=
4991e07dc26bSmrg  _LT_TAGVAR(module_expsym_cmds, $1)=
4992e07dc26bSmrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4993e07dc26bSmrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4994e07dc26bSmrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
4995e07dc26bSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4996e07dc26bSmrg  # include_expsyms should be a list of space-separated symbols to be *always*
4997e07dc26bSmrg  # included in the symbol list
4998e07dc26bSmrg  _LT_TAGVAR(include_expsyms, $1)=
4999e07dc26bSmrg  # exclude_expsyms can be an extended regexp of symbols to exclude
5000e07dc26bSmrg  # it will be wrapped by ' (' and ')$', so one must not match beginning or
5001e07dc26bSmrg  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
5002e07dc26bSmrg  # as well as any symbol that contains 'd'.
5003e07dc26bSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5004e07dc26bSmrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5005e07dc26bSmrg  # platforms (ab)use it in PIC code, but their linkers get confused if
5006e07dc26bSmrg  # the symbol is explicitly referenced.  Since portable code cannot
5007e07dc26bSmrg  # rely on this symbol name, it's probably fine to never include it in
5008e07dc26bSmrg  # preloaded symbol tables.
5009e07dc26bSmrg  # Exclude shared library initialization/finalization symbols.
5010e07dc26bSmrgdnl Note also adjust exclude_expsyms for C++ above.
5011e07dc26bSmrg  extract_expsyms_cmds=
5012e07dc26bSmrg
5013e07dc26bSmrg  case $host_os in
5014e07dc26bSmrg  cygwin* | mingw* | pw32* | cegcc*)
5015e07dc26bSmrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
5016e07dc26bSmrg    # When not using gcc, we currently assume that we are using
5017e07dc26bSmrg    # Microsoft Visual C++.
5018e07dc26bSmrg    if test yes != "$GCC"; then
5019e07dc26bSmrg      with_gnu_ld=no
5020e07dc26bSmrg    fi
5021e07dc26bSmrg    ;;
5022e07dc26bSmrg  interix*)
5023e07dc26bSmrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
5024e07dc26bSmrg    with_gnu_ld=yes
5025e07dc26bSmrg    ;;
5026e07dc26bSmrg  openbsd* | bitrig*)
5027e07dc26bSmrg    with_gnu_ld=no
5028e07dc26bSmrg    ;;
5029e07dc26bSmrg  linux* | k*bsd*-gnu | gnu*)
5030e07dc26bSmrg    _LT_TAGVAR(link_all_deplibs, $1)=no
5031e07dc26bSmrg    ;;
5032e07dc26bSmrg  esac
5033e07dc26bSmrg
5034e07dc26bSmrg  _LT_TAGVAR(ld_shlibs, $1)=yes
5035e07dc26bSmrg
5036e07dc26bSmrg  # On some targets, GNU ld is compatible enough with the native linker
5037e07dc26bSmrg  # that we're better off using the native interface for both.
5038e07dc26bSmrg  lt_use_gnu_ld_interface=no
5039e07dc26bSmrg  if test yes = "$with_gnu_ld"; then
5040e07dc26bSmrg    case $host_os in
5041e07dc26bSmrg      aix*)
5042e07dc26bSmrg	# The AIX port of GNU ld has always aspired to compatibility
5043e07dc26bSmrg	# with the native linker.  However, as the warning in the GNU ld
5044e07dc26bSmrg	# block says, versions before 2.19.5* couldn't really create working
5045e07dc26bSmrg	# shared libraries, regardless of the interface used.
5046e07dc26bSmrg	case `$LD -v 2>&1` in
5047e07dc26bSmrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
5048e07dc26bSmrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
5049e07dc26bSmrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
5050e07dc26bSmrg	  *)
5051e07dc26bSmrg	    lt_use_gnu_ld_interface=yes
5052e07dc26bSmrg	    ;;
5053e07dc26bSmrg	esac
5054e07dc26bSmrg	;;
5055e07dc26bSmrg      *)
5056e07dc26bSmrg	lt_use_gnu_ld_interface=yes
5057e07dc26bSmrg	;;
5058e07dc26bSmrg    esac
5059e07dc26bSmrg  fi
5060e07dc26bSmrg
5061e07dc26bSmrg  if test yes = "$lt_use_gnu_ld_interface"; then
5062e07dc26bSmrg    # If archive_cmds runs LD, not CC, wlarc should be empty
5063e07dc26bSmrg    wlarc='$wl'
5064e07dc26bSmrg
5065e07dc26bSmrg    # Set some defaults for GNU ld with shared library support. These
5066e07dc26bSmrg    # are reset later if shared libraries are not supported. Putting them
5067e07dc26bSmrg    # here allows them to be overridden if necessary.
5068e07dc26bSmrg    runpath_var=LD_RUN_PATH
5069e07dc26bSmrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5070e07dc26bSmrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
5071e07dc26bSmrg    # ancient GNU ld didn't support --whole-archive et. al.
5072e07dc26bSmrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
5073e07dc26bSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
5074e07dc26bSmrg    else
5075e07dc26bSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5076e07dc26bSmrg    fi
5077e07dc26bSmrg    supports_anon_versioning=no
5078e07dc26bSmrg    case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
5079e07dc26bSmrg      *GNU\ gold*) supports_anon_versioning=yes ;;
5080e07dc26bSmrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5081e07dc26bSmrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5082e07dc26bSmrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5083e07dc26bSmrg      *\ 2.11.*) ;; # other 2.11 versions
5084e07dc26bSmrg      *) supports_anon_versioning=yes ;;
5085e07dc26bSmrg    esac
5086e07dc26bSmrg
5087e07dc26bSmrg    # See if GNU ld supports shared libraries.
5088e07dc26bSmrg    case $host_os in
5089e07dc26bSmrg    aix[[3-9]]*)
5090e07dc26bSmrg      # On AIX/PPC, the GNU linker is very broken
5091e07dc26bSmrg      if test ia64 != "$host_cpu"; then
5092e07dc26bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5093e07dc26bSmrg	cat <<_LT_EOF 1>&2
5094e07dc26bSmrg
5095e07dc26bSmrg*** Warning: the GNU linker, at least up to release 2.19, is reported
5096e07dc26bSmrg*** to be unable to reliably create shared libraries on AIX.
5097e07dc26bSmrg*** Therefore, libtool is disabling shared libraries support.  If you
5098e07dc26bSmrg*** really care for shared libraries, you may want to install binutils
5099e07dc26bSmrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
5100e07dc26bSmrg*** You will then need to restart the configuration process.
5101e07dc26bSmrg
5102e07dc26bSmrg_LT_EOF
5103e07dc26bSmrg      fi
5104e07dc26bSmrg      ;;
5105e07dc26bSmrg
5106e07dc26bSmrg    amigaos*)
5107e07dc26bSmrg      case $host_cpu in
5108e07dc26bSmrg      powerpc)
5109e07dc26bSmrg            # see comment about AmigaOS4 .so support
5110e07dc26bSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5111e07dc26bSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5112e07dc26bSmrg        ;;
5113e07dc26bSmrg      m68k)
5114e07dc26bSmrg            _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)'
5115e07dc26bSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5116e07dc26bSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5117e07dc26bSmrg        ;;
5118e07dc26bSmrg      esac
5119e07dc26bSmrg      ;;
5120e07dc26bSmrg
5121e07dc26bSmrg    beos*)
5122e07dc26bSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5123e07dc26bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5124e07dc26bSmrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5125e07dc26bSmrg	# support --undefined.  This deserves some investigation.  FIXME
5126e07dc26bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5127e07dc26bSmrg      else
5128e07dc26bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5129e07dc26bSmrg      fi
5130e07dc26bSmrg      ;;
5131e07dc26bSmrg
5132e07dc26bSmrg    cygwin* | mingw* | pw32* | cegcc*)
5133e07dc26bSmrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5134e07dc26bSmrg      # as there is no search path for DLLs.
5135e07dc26bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5136e07dc26bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
5137e07dc26bSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5138e07dc26bSmrg      _LT_TAGVAR(always_export_symbols, $1)=no
5139e07dc26bSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5140e07dc26bSmrg      _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'
5141e07dc26bSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5142e07dc26bSmrg
5143e07dc26bSmrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5144e07dc26bSmrg        _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'
5145e07dc26bSmrg	# If the export-symbols file already is a .def file, use it as
5146e07dc26bSmrg	# is; otherwise, prepend EXPORTS...
5147e07dc26bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5148e07dc26bSmrg          cp $export_symbols $output_objdir/$soname.def;
5149e07dc26bSmrg        else
5150e07dc26bSmrg          echo EXPORTS > $output_objdir/$soname.def;
5151e07dc26bSmrg          cat $export_symbols >> $output_objdir/$soname.def;
5152e07dc26bSmrg        fi~
5153e07dc26bSmrg        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5154e07dc26bSmrg      else
5155e07dc26bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5156e07dc26bSmrg      fi
5157e07dc26bSmrg      ;;
5158e07dc26bSmrg
5159e07dc26bSmrg    haiku*)
5160e07dc26bSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5161e07dc26bSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5162e07dc26bSmrg      ;;
5163e07dc26bSmrg
5164e07dc26bSmrg    os2*)
5165e07dc26bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5166e07dc26bSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5167e07dc26bSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5168e07dc26bSmrg      shrext_cmds=.dll
5169e07dc26bSmrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5170e07dc26bSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5171e07dc26bSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5172e07dc26bSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5173e07dc26bSmrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5174e07dc26bSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5175e07dc26bSmrg	emximp -o $lib $output_objdir/$libname.def'
5176e07dc26bSmrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5177e07dc26bSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5178e07dc26bSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5179e07dc26bSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5180e07dc26bSmrg	prefix_cmds="$SED"~
5181e07dc26bSmrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
5182e07dc26bSmrg	  prefix_cmds="$prefix_cmds -e 1d";
5183e07dc26bSmrg	fi~
5184e07dc26bSmrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5185e07dc26bSmrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5186e07dc26bSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5187e07dc26bSmrg	emximp -o $lib $output_objdir/$libname.def'
5188e07dc26bSmrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5189e07dc26bSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5190e07dc26bSmrg      ;;
5191e07dc26bSmrg
5192e07dc26bSmrg    interix[[3-9]]*)
5193e07dc26bSmrg      _LT_TAGVAR(hardcode_direct, $1)=no
5194e07dc26bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5195e07dc26bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5196e07dc26bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5197e07dc26bSmrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5198e07dc26bSmrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
5199e07dc26bSmrg      # default) and relocated if they conflict, which is a slow very memory
5200e07dc26bSmrg      # consuming and fragmenting process.  To avoid this, we pick a random,
5201e07dc26bSmrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5202e07dc26bSmrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5203e07dc26bSmrg      _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'
5204e07dc26bSmrg      _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'
5205e07dc26bSmrg      ;;
5206e07dc26bSmrg
5207e07dc26bSmrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
5208e07dc26bSmrg      tmp_diet=no
5209e07dc26bSmrg      if test linux-dietlibc = "$host_os"; then
5210e07dc26bSmrg	case $cc_basename in
5211e07dc26bSmrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
5212e07dc26bSmrg	esac
5213e07dc26bSmrg      fi
5214e07dc26bSmrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
5215e07dc26bSmrg	 && test no = "$tmp_diet"
5216e07dc26bSmrg      then
5217e07dc26bSmrg	tmp_addflag=' $pic_flag'
5218e07dc26bSmrg	tmp_sharedflag='-shared'
5219e07dc26bSmrg	case $cc_basename,$host_cpu in
5220e07dc26bSmrg        pgcc*)				# Portland Group C compiler
5221e07dc26bSmrg	  _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'
5222e07dc26bSmrg	  tmp_addflag=' $pic_flag'
5223e07dc26bSmrg	  ;;
5224e07dc26bSmrg	pgf77* | pgf90* | pgf95* | pgfortran*)
5225e07dc26bSmrg					# Portland Group f77 and f90 compilers
5226e07dc26bSmrg	  _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'
5227e07dc26bSmrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
5228e07dc26bSmrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
5229e07dc26bSmrg	  tmp_addflag=' -i_dynamic' ;;
5230e07dc26bSmrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
5231e07dc26bSmrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
5232e07dc26bSmrg	ifc* | ifort*)			# Intel Fortran compiler
5233e07dc26bSmrg	  tmp_addflag=' -nofor_main' ;;
5234e07dc26bSmrg	lf95*)				# Lahey Fortran 8.1
5235e07dc26bSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5236e07dc26bSmrg	  tmp_sharedflag='--shared' ;;
5237e07dc26bSmrg        nagfor*)                        # NAGFOR 5.3
5238e07dc26bSmrg          tmp_sharedflag='-Wl,-shared' ;;
5239e07dc26bSmrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
5240e07dc26bSmrg	  tmp_sharedflag='-qmkshrobj'
5241e07dc26bSmrg	  tmp_addflag= ;;
5242e07dc26bSmrg	nvcc*)	# Cuda Compiler Driver 2.2
5243e07dc26bSmrg	  _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'
5244e07dc26bSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5245e07dc26bSmrg	  ;;
5246e07dc26bSmrg	esac
5247e07dc26bSmrg	case `$CC -V 2>&1 | sed 5q` in
5248e07dc26bSmrg	*Sun\ C*)			# Sun C 5.9
5249e07dc26bSmrg	  _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'
5250e07dc26bSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5251e07dc26bSmrg	  tmp_sharedflag='-G' ;;
5252e07dc26bSmrg	*Sun\ F*)			# Sun Fortran 8.3
5253e07dc26bSmrg	  tmp_sharedflag='-G' ;;
5254e07dc26bSmrg	esac
5255e07dc26bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5256e07dc26bSmrg
5257e07dc26bSmrg        if test yes = "$supports_anon_versioning"; then
5258e07dc26bSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5259e07dc26bSmrg            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5260e07dc26bSmrg            echo "local: *; };" >> $output_objdir/$libname.ver~
5261e07dc26bSmrg            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
5262e07dc26bSmrg        fi
5263e07dc26bSmrg
5264e07dc26bSmrg	case $cc_basename in
5265e07dc26bSmrg	tcc*)
5266e07dc26bSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
5267e07dc26bSmrg	  ;;
5268e07dc26bSmrg	xlf* | bgf* | bgxlf* | mpixlf*)
5269e07dc26bSmrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
5270e07dc26bSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
5271e07dc26bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5272e07dc26bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
5273e07dc26bSmrg	  if test yes = "$supports_anon_versioning"; then
5274e07dc26bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5275e07dc26bSmrg              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5276e07dc26bSmrg              echo "local: *; };" >> $output_objdir/$libname.ver~
5277e07dc26bSmrg              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
5278e07dc26bSmrg	  fi
5279e07dc26bSmrg	  ;;
5280e07dc26bSmrg	esac
5281e07dc26bSmrg      else
5282e07dc26bSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
5283e07dc26bSmrg      fi
5284e07dc26bSmrg      ;;
5285e07dc26bSmrg
5286e07dc26bSmrg    netbsd* | netbsdelf*-gnu)
5287e07dc26bSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5288e07dc26bSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5289e07dc26bSmrg	wlarc=
5290e07dc26bSmrg      else
5291e07dc26bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5292e07dc26bSmrg	_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'
5293e07dc26bSmrg      fi
5294e07dc26bSmrg      ;;
5295e07dc26bSmrg
5296e07dc26bSmrg    solaris*)
5297e07dc26bSmrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
5298e07dc26bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5299e07dc26bSmrg	cat <<_LT_EOF 1>&2
5300e07dc26bSmrg
5301e07dc26bSmrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
5302e07dc26bSmrg*** create shared libraries on Solaris systems.  Therefore, libtool
5303e07dc26bSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
5304e07dc26bSmrg*** binutils to release 2.9.1 or newer.  Another option is to modify
5305e07dc26bSmrg*** your PATH or compiler configuration so that the native linker is
5306e07dc26bSmrg*** used, and then restart.
5307e07dc26bSmrg
5308e07dc26bSmrg_LT_EOF
5309e07dc26bSmrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5310e07dc26bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5311e07dc26bSmrg	_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'
5312e07dc26bSmrg      else
5313e07dc26bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5314e07dc26bSmrg      fi
5315e07dc26bSmrg      ;;
5316e07dc26bSmrg
5317e07dc26bSmrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5318e07dc26bSmrg      case `$LD -v 2>&1` in
5319e07dc26bSmrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
5320e07dc26bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5321e07dc26bSmrg	cat <<_LT_EOF 1>&2
5322e07dc26bSmrg
5323e07dc26bSmrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
5324e07dc26bSmrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
5325e07dc26bSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
5326e07dc26bSmrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
5327e07dc26bSmrg*** your PATH or compiler configuration so that the native linker is
5328e07dc26bSmrg*** used, and then restart.
5329e07dc26bSmrg
5330e07dc26bSmrg_LT_EOF
5331e07dc26bSmrg	;;
5332e07dc26bSmrg	*)
5333e07dc26bSmrg	  # For security reasons, it is highly recommended that you always
5334e07dc26bSmrg	  # use absolute paths for naming shared libraries, and exclude the
5335e07dc26bSmrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
5336e07dc26bSmrg	  # requires that you compile everything twice, which is a pain.
5337e07dc26bSmrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5338e07dc26bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5339e07dc26bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5340e07dc26bSmrg	    _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'
5341e07dc26bSmrg	  else
5342e07dc26bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5343e07dc26bSmrg	  fi
5344e07dc26bSmrg	;;
5345e07dc26bSmrg      esac
5346e07dc26bSmrg      ;;
5347e07dc26bSmrg
5348e07dc26bSmrg    sunos4*)
5349e07dc26bSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5350e07dc26bSmrg      wlarc=
5351e07dc26bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5352e07dc26bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5353e07dc26bSmrg      ;;
5354e07dc26bSmrg
5355e07dc26bSmrg    *)
5356e07dc26bSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5357e07dc26bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5358e07dc26bSmrg	_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'
5359e07dc26bSmrg      else
5360e07dc26bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5361e07dc26bSmrg      fi
5362e07dc26bSmrg      ;;
5363e07dc26bSmrg    esac
5364e07dc26bSmrg
5365e07dc26bSmrg    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
5366e07dc26bSmrg      runpath_var=
5367e07dc26bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5368e07dc26bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5369e07dc26bSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5370e07dc26bSmrg    fi
5371e07dc26bSmrg  else
5372e07dc26bSmrg    # PORTME fill in a description of your system's linker (not GNU ld)
5373e07dc26bSmrg    case $host_os in
5374e07dc26bSmrg    aix3*)
5375e07dc26bSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5376e07dc26bSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
5377e07dc26bSmrg      _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'
5378e07dc26bSmrg      # Note: this linker hardcodes the directories in LIBPATH if there
5379e07dc26bSmrg      # are no directories specified by -L.
5380e07dc26bSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5381e07dc26bSmrg      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
5382e07dc26bSmrg	# Neither direct hardcoding nor static linking is supported with a
5383e07dc26bSmrg	# broken collect2.
5384e07dc26bSmrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
5385e07dc26bSmrg      fi
5386e07dc26bSmrg      ;;
5387e07dc26bSmrg
5388e07dc26bSmrg    aix[[4-9]]*)
5389e07dc26bSmrg      if test ia64 = "$host_cpu"; then
5390e07dc26bSmrg	# On IA64, the linker does run time linking by default, so we don't
5391e07dc26bSmrg	# have to do anything special.
5392e07dc26bSmrg	aix_use_runtimelinking=no
5393e07dc26bSmrg	exp_sym_flag='-Bexport'
5394e07dc26bSmrg	no_entry_flag=
5395e07dc26bSmrg      else
5396e07dc26bSmrg	# If we're using GNU nm, then we don't want the "-C" option.
5397e07dc26bSmrg	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
5398e07dc26bSmrg	# Without the "-l" option, or with the "-B" option, AIX nm treats
5399e07dc26bSmrg	# weak defined symbols like other global defined symbols, whereas
5400e07dc26bSmrg	# GNU nm marks them as "W".
5401e07dc26bSmrg	# While the 'weak' keyword is ignored in the Export File, we need
5402e07dc26bSmrg	# it in the Import File for the 'aix-soname' feature, so we have
5403e07dc26bSmrg	# to replace the "-B" option with "-P" for AIX nm.
5404e07dc26bSmrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5405e07dc26bSmrg	  _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'
5406e07dc26bSmrg	else
5407e07dc26bSmrg	  _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'
5408e07dc26bSmrg	fi
5409e07dc26bSmrg	aix_use_runtimelinking=no
5410e07dc26bSmrg
5411e07dc26bSmrg	# Test if we are trying to use run time linking or normal
5412e07dc26bSmrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
5413e07dc26bSmrg	# have runtime linking enabled, and use it for executables.
5414e07dc26bSmrg	# For shared libraries, we enable/disable runtime linking
5415e07dc26bSmrg	# depending on the kind of the shared library created -
5416e07dc26bSmrg	# when "with_aix_soname,aix_use_runtimelinking" is:
5417e07dc26bSmrg	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
5418e07dc26bSmrg	# "aix,yes"  lib.so          shared, rtl:yes, for executables
5419e07dc26bSmrg	#            lib.a           static archive
5420e07dc26bSmrg	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
5421e07dc26bSmrg	#            lib.a(lib.so.V) shared, rtl:no,  for executables
5422e07dc26bSmrg	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
5423e07dc26bSmrg	#            lib.a(lib.so.V) shared, rtl:no
5424e07dc26bSmrg	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
5425e07dc26bSmrg	#            lib.a           static archive
5426e07dc26bSmrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5427e07dc26bSmrg	  for ld_flag in $LDFLAGS; do
5428e07dc26bSmrg	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
5429e07dc26bSmrg	    aix_use_runtimelinking=yes
5430e07dc26bSmrg	    break
5431e07dc26bSmrg	  fi
5432e07dc26bSmrg	  done
5433e07dc26bSmrg	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
5434e07dc26bSmrg	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
5435e07dc26bSmrg	    # so we don't have lib.a shared libs to link our executables.
5436e07dc26bSmrg	    # We have to force runtime linking in this case.
5437e07dc26bSmrg	    aix_use_runtimelinking=yes
5438e07dc26bSmrg	    LDFLAGS="$LDFLAGS -Wl,-brtl"
5439e07dc26bSmrg	  fi
5440e07dc26bSmrg	  ;;
5441e07dc26bSmrg	esac
5442e07dc26bSmrg
5443e07dc26bSmrg	exp_sym_flag='-bexport'
5444e07dc26bSmrg	no_entry_flag='-bnoentry'
5445e07dc26bSmrg      fi
5446e07dc26bSmrg
5447e07dc26bSmrg      # When large executables or shared objects are built, AIX ld can
5448e07dc26bSmrg      # have problems creating the table of contents.  If linking a library
5449e07dc26bSmrg      # or program results in "error TOC overflow" add -mminimal-toc to
5450e07dc26bSmrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5451e07dc26bSmrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5452e07dc26bSmrg
5453e07dc26bSmrg      _LT_TAGVAR(archive_cmds, $1)=''
5454e07dc26bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5455e07dc26bSmrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5456e07dc26bSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5457e07dc26bSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5458e07dc26bSmrg      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
5459e07dc26bSmrg      case $with_aix_soname,$aix_use_runtimelinking in
5460e07dc26bSmrg      aix,*) ;; # traditional, no import file
5461e07dc26bSmrg      svr4,* | *,yes) # use import file
5462e07dc26bSmrg	# The Import File defines what to hardcode.
5463e07dc26bSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
5464e07dc26bSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5465e07dc26bSmrg	;;
5466e07dc26bSmrg      esac
5467e07dc26bSmrg
5468e07dc26bSmrg      if test yes = "$GCC"; then
5469e07dc26bSmrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
5470e07dc26bSmrg	# We only want to do this on AIX 4.2 and lower, the check
5471e07dc26bSmrg	# below for broken collect2 doesn't work under 4.3+
5472e07dc26bSmrg	  collect2name=`$CC -print-prog-name=collect2`
5473e07dc26bSmrg	  if test -f "$collect2name" &&
5474e07dc26bSmrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5475e07dc26bSmrg	  then
5476e07dc26bSmrg	  # We have reworked collect2
5477e07dc26bSmrg	  :
5478e07dc26bSmrg	  else
5479e07dc26bSmrg	  # We have old collect2
5480e07dc26bSmrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
5481e07dc26bSmrg	  # It fails to find uninstalled libraries when the uninstalled
5482e07dc26bSmrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
5483e07dc26bSmrg	  # to unsupported forces relinking
5484e07dc26bSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5485e07dc26bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5486e07dc26bSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5487e07dc26bSmrg	  fi
5488e07dc26bSmrg	  ;;
5489e07dc26bSmrg	esac
5490e07dc26bSmrg	shared_flag='-shared'
5491e07dc26bSmrg	if test yes = "$aix_use_runtimelinking"; then
5492e07dc26bSmrg	  shared_flag="$shared_flag "'$wl-G'
5493e07dc26bSmrg	fi
5494e07dc26bSmrg	# Need to ensure runtime linking is disabled for the traditional
5495e07dc26bSmrg	# shared library, or the linker may eventually find shared libraries
5496e07dc26bSmrg	# /with/ Import File - we do not want to mix them.
5497e07dc26bSmrg	shared_flag_aix='-shared'
5498e07dc26bSmrg	shared_flag_svr4='-shared $wl-G'
5499e07dc26bSmrg      else
5500e07dc26bSmrg	# not using gcc
5501e07dc26bSmrg	if test ia64 = "$host_cpu"; then
5502e07dc26bSmrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5503e07dc26bSmrg	# chokes on -Wl,-G. The following line is correct:
5504e07dc26bSmrg	  shared_flag='-G'
5505e07dc26bSmrg	else
5506e07dc26bSmrg	  if test yes = "$aix_use_runtimelinking"; then
5507e07dc26bSmrg	    shared_flag='$wl-G'
5508e07dc26bSmrg	  else
5509e07dc26bSmrg	    shared_flag='$wl-bM:SRE'
5510e07dc26bSmrg	  fi
5511e07dc26bSmrg	  shared_flag_aix='$wl-bM:SRE'
5512e07dc26bSmrg	  shared_flag_svr4='$wl-G'
5513e07dc26bSmrg	fi
5514e07dc26bSmrg      fi
5515e07dc26bSmrg
5516e07dc26bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
5517e07dc26bSmrg      # It seems that -bexpall does not export symbols beginning with
5518e07dc26bSmrg      # underscore (_), so it is better to generate a list of symbols to export.
5519e07dc26bSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
5520e07dc26bSmrg      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
5521e07dc26bSmrg	# Warning - without using the other runtime loading flags (-brtl),
5522e07dc26bSmrg	# -berok will link without error, but may produce a broken library.
5523e07dc26bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5524e07dc26bSmrg        # Determine the default libpath from the value encoded in an
5525e07dc26bSmrg        # empty executable.
5526e07dc26bSmrg        _LT_SYS_MODULE_PATH_AIX([$1])
5527e07dc26bSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5528e07dc26bSmrg        _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
5529e07dc26bSmrg      else
5530e07dc26bSmrg	if test ia64 = "$host_cpu"; then
5531e07dc26bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
5532e07dc26bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5533e07dc26bSmrg	  _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"
5534e07dc26bSmrg	else
5535e07dc26bSmrg	 # Determine the default libpath from the value encoded in an
5536e07dc26bSmrg	 # empty executable.
5537e07dc26bSmrg	 _LT_SYS_MODULE_PATH_AIX([$1])
5538e07dc26bSmrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5539e07dc26bSmrg	  # Warning - without using the other run time loading flags,
5540e07dc26bSmrg	  # -berok will link without error, but may produce a broken library.
5541e07dc26bSmrg	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
5542e07dc26bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
5543e07dc26bSmrg	  if test yes = "$with_gnu_ld"; then
5544e07dc26bSmrg	    # We only use this code for GNU lds that support --whole-archive.
5545e07dc26bSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
5546e07dc26bSmrg	  else
5547e07dc26bSmrg	    # Exported symbols can be pulled into shared objects from archives
5548e07dc26bSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5549e07dc26bSmrg	  fi
5550e07dc26bSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5551e07dc26bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
5552e07dc26bSmrg	  # -brtl affects multiple linker settings, -berok does not and is overridden later
5553e07dc26bSmrg	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
5554e07dc26bSmrg	  if test svr4 != "$with_aix_soname"; then
5555e07dc26bSmrg	    # This is similar to how AIX traditionally builds its shared libraries.
5556e07dc26bSmrg	    _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'
5557e07dc26bSmrg	  fi
5558e07dc26bSmrg	  if test aix != "$with_aix_soname"; then
5559e07dc26bSmrg	    _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'
5560e07dc26bSmrg	  else
5561e07dc26bSmrg	    # used by -dlpreopen to get the symbols
5562e07dc26bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
5563e07dc26bSmrg	  fi
5564e07dc26bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
5565e07dc26bSmrg	fi
5566e07dc26bSmrg      fi
5567e07dc26bSmrg      ;;
5568e07dc26bSmrg
5569e07dc26bSmrg    amigaos*)
5570e07dc26bSmrg      case $host_cpu in
5571e07dc26bSmrg      powerpc)
5572e07dc26bSmrg            # see comment about AmigaOS4 .so support
5573e07dc26bSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5574e07dc26bSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5575e07dc26bSmrg        ;;
5576e07dc26bSmrg      m68k)
5577e07dc26bSmrg            _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)'
5578e07dc26bSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5579e07dc26bSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5580e07dc26bSmrg        ;;
5581e07dc26bSmrg      esac
5582e07dc26bSmrg      ;;
5583e07dc26bSmrg
5584e07dc26bSmrg    bsdi[[45]]*)
5585e07dc26bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
5586e07dc26bSmrg      ;;
5587e07dc26bSmrg
5588e07dc26bSmrg    cygwin* | mingw* | pw32* | cegcc*)
5589e07dc26bSmrg      # When not using gcc, we currently assume that we are using
5590e07dc26bSmrg      # Microsoft Visual C++.
5591e07dc26bSmrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
5592e07dc26bSmrg      # no search path for DLLs.
5593e07dc26bSmrg      case $cc_basename in
5594e07dc26bSmrg      cl*)
5595e07dc26bSmrg	# Native MSVC
5596e07dc26bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5597e07dc26bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5598e07dc26bSmrg	_LT_TAGVAR(always_export_symbols, $1)=yes
5599e07dc26bSmrg	_LT_TAGVAR(file_list_spec, $1)='@'
5600e07dc26bSmrg	# Tell ltmain to make .lib files, not .a files.
5601e07dc26bSmrg	libext=lib
5602e07dc26bSmrg	# Tell ltmain to make .dll files, not .so files.
5603e07dc26bSmrg	shrext_cmds=.dll
5604e07dc26bSmrg	# FIXME: Setting linknames here is a bad hack.
5605e07dc26bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
5606e07dc26bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5607e07dc26bSmrg            cp "$export_symbols" "$output_objdir/$soname.def";
5608e07dc26bSmrg            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
5609e07dc26bSmrg          else
5610e07dc26bSmrg            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
5611e07dc26bSmrg          fi~
5612e07dc26bSmrg          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5613e07dc26bSmrg          linknames='
5614e07dc26bSmrg	# The linker will not automatically build a static lib if we build a DLL.
5615e07dc26bSmrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5616e07dc26bSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5617e07dc26bSmrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5618e07dc26bSmrg	_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'
5619e07dc26bSmrg	# Don't use ranlib
5620e07dc26bSmrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
5621e07dc26bSmrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
5622e07dc26bSmrg          lt_tool_outputfile="@TOOL_OUTPUT@"~
5623e07dc26bSmrg          case $lt_outputfile in
5624e07dc26bSmrg            *.exe|*.EXE) ;;
5625e07dc26bSmrg            *)
5626e07dc26bSmrg              lt_outputfile=$lt_outputfile.exe
5627e07dc26bSmrg              lt_tool_outputfile=$lt_tool_outputfile.exe
5628e07dc26bSmrg              ;;
5629e07dc26bSmrg          esac~
5630e07dc26bSmrg          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
5631e07dc26bSmrg            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5632e07dc26bSmrg            $RM "$lt_outputfile.manifest";
5633e07dc26bSmrg          fi'
5634e07dc26bSmrg	;;
5635e07dc26bSmrg      *)
5636e07dc26bSmrg	# Assume MSVC wrapper
5637e07dc26bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5638e07dc26bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5639e07dc26bSmrg	# Tell ltmain to make .lib files, not .a files.
5640e07dc26bSmrg	libext=lib
5641e07dc26bSmrg	# Tell ltmain to make .dll files, not .so files.
5642e07dc26bSmrg	shrext_cmds=.dll
5643e07dc26bSmrg	# FIXME: Setting linknames here is a bad hack.
5644e07dc26bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
5645e07dc26bSmrg	# The linker will automatically build a .lib file if we build a DLL.
5646e07dc26bSmrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5647e07dc26bSmrg	# FIXME: Should let the user specify the lib program.
5648e07dc26bSmrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
5649e07dc26bSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5650e07dc26bSmrg	;;
5651e07dc26bSmrg      esac
5652e07dc26bSmrg      ;;
5653e07dc26bSmrg
5654e07dc26bSmrg    darwin* | rhapsody*)
5655e07dc26bSmrg      _LT_DARWIN_LINKER_FEATURES($1)
5656e07dc26bSmrg      ;;
5657e07dc26bSmrg
5658e07dc26bSmrg    dgux*)
5659e07dc26bSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5660e07dc26bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5661e07dc26bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5662e07dc26bSmrg      ;;
5663e07dc26bSmrg
5664e07dc26bSmrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5665e07dc26bSmrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
5666e07dc26bSmrg    # does not break anything, and helps significantly (at the cost of a little
5667e07dc26bSmrg    # extra space).
5668e07dc26bSmrg    freebsd2.2*)
5669e07dc26bSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5670e07dc26bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5671e07dc26bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5672e07dc26bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5673e07dc26bSmrg      ;;
5674e07dc26bSmrg
5675e07dc26bSmrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5676e07dc26bSmrg    freebsd2.*)
5677e07dc26bSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5678e07dc26bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5679e07dc26bSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5680e07dc26bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5681e07dc26bSmrg      ;;
5682e07dc26bSmrg
5683e07dc26bSmrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5684e07dc26bSmrg    freebsd* | dragonfly*)
5685e07dc26bSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5686e07dc26bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5687e07dc26bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5688e07dc26bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5689e07dc26bSmrg      ;;
5690e07dc26bSmrg
5691e07dc26bSmrg    hpux9*)
5692e07dc26bSmrg      if test yes = "$GCC"; then
5693e07dc26bSmrg	_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'
5694e07dc26bSmrg      else
5695e07dc26bSmrg	_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'
5696e07dc26bSmrg      fi
5697e07dc26bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5698e07dc26bSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5699e07dc26bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5700e07dc26bSmrg
5701e07dc26bSmrg      # hardcode_minus_L: Not really in the search PATH,
5702e07dc26bSmrg      # but as the default location of the library.
5703e07dc26bSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5704e07dc26bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5705e07dc26bSmrg      ;;
5706e07dc26bSmrg
5707e07dc26bSmrg    hpux10*)
5708e07dc26bSmrg      if test yes,no = "$GCC,$with_gnu_ld"; then
5709e07dc26bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5710e07dc26bSmrg      else
5711e07dc26bSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
5712e07dc26bSmrg      fi
5713e07dc26bSmrg      if test no = "$with_gnu_ld"; then
5714e07dc26bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5715e07dc26bSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5716e07dc26bSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
5717e07dc26bSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5718e07dc26bSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5719e07dc26bSmrg	# hardcode_minus_L: Not really in the search PATH,
5720e07dc26bSmrg	# but as the default location of the library.
5721e07dc26bSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
5722e07dc26bSmrg      fi
5723e07dc26bSmrg      ;;
5724e07dc26bSmrg
5725e07dc26bSmrg    hpux11*)
5726e07dc26bSmrg      if test yes,no = "$GCC,$with_gnu_ld"; then
5727e07dc26bSmrg	case $host_cpu in
5728e07dc26bSmrg	hppa*64*)
5729e07dc26bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5730e07dc26bSmrg	  ;;
5731e07dc26bSmrg	ia64*)
5732e07dc26bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5733e07dc26bSmrg	  ;;
5734e07dc26bSmrg	*)
5735e07dc26bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5736e07dc26bSmrg	  ;;
5737e07dc26bSmrg	esac
5738e07dc26bSmrg      else
5739e07dc26bSmrg	case $host_cpu in
5740e07dc26bSmrg	hppa*64*)
5741e07dc26bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5742e07dc26bSmrg	  ;;
5743e07dc26bSmrg	ia64*)
5744e07dc26bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5745e07dc26bSmrg	  ;;
5746e07dc26bSmrg	*)
5747e07dc26bSmrg	m4_if($1, [], [
5748e07dc26bSmrg	  # Older versions of the 11.00 compiler do not understand -b yet
5749e07dc26bSmrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
5750e07dc26bSmrg	  _LT_LINKER_OPTION([if $CC understands -b],
5751e07dc26bSmrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
5752e07dc26bSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
5753e07dc26bSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
5754e07dc26bSmrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
5755e07dc26bSmrg	  ;;
5756e07dc26bSmrg	esac
5757e07dc26bSmrg      fi
5758e07dc26bSmrg      if test no = "$with_gnu_ld"; then
5759e07dc26bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5760e07dc26bSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5761e07dc26bSmrg
5762e07dc26bSmrg	case $host_cpu in
5763e07dc26bSmrg	hppa*64*|ia64*)
5764e07dc26bSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
5765e07dc26bSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5766e07dc26bSmrg	  ;;
5767e07dc26bSmrg	*)
5768e07dc26bSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
5769e07dc26bSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5770e07dc26bSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5771e07dc26bSmrg
5772e07dc26bSmrg	  # hardcode_minus_L: Not really in the search PATH,
5773e07dc26bSmrg	  # but as the default location of the library.
5774e07dc26bSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5775e07dc26bSmrg	  ;;
5776e07dc26bSmrg	esac
5777e07dc26bSmrg      fi
5778e07dc26bSmrg      ;;
5779e07dc26bSmrg
5780e07dc26bSmrg    irix5* | irix6* | nonstopux*)
5781e07dc26bSmrg      if test yes = "$GCC"; then
5782e07dc26bSmrg	_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'
5783e07dc26bSmrg	# Try to use the -exported_symbol ld option, if it does not
5784e07dc26bSmrg	# work, assume that -exports_file does not work either and
5785e07dc26bSmrg	# implicitly export all symbols.
5786e07dc26bSmrg	# This should be the same for all languages, so no per-tag cache variable.
5787e07dc26bSmrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
5788e07dc26bSmrg	  [lt_cv_irix_exported_symbol],
5789e07dc26bSmrg	  [save_LDFLAGS=$LDFLAGS
5790e07dc26bSmrg	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
5791e07dc26bSmrg	   AC_LINK_IFELSE(
5792e07dc26bSmrg	     [AC_LANG_SOURCE(
5793e07dc26bSmrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
5794e07dc26bSmrg			      [C++], [[int foo (void) { return 0; }]],
5795e07dc26bSmrg			      [Fortran 77], [[
5796e07dc26bSmrg      subroutine foo
5797e07dc26bSmrg      end]],
5798e07dc26bSmrg			      [Fortran], [[
5799e07dc26bSmrg      subroutine foo
5800e07dc26bSmrg      end]])])],
5801e07dc26bSmrg	      [lt_cv_irix_exported_symbol=yes],
5802e07dc26bSmrg	      [lt_cv_irix_exported_symbol=no])
5803e07dc26bSmrg           LDFLAGS=$save_LDFLAGS])
5804e07dc26bSmrg	if test yes = "$lt_cv_irix_exported_symbol"; then
5805e07dc26bSmrg          _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'
5806e07dc26bSmrg	fi
5807e07dc26bSmrg	_LT_TAGVAR(link_all_deplibs, $1)=no
5808e07dc26bSmrg      else
5809e07dc26bSmrg	_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'
5810e07dc26bSmrg	_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'
5811e07dc26bSmrg      fi
5812e07dc26bSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5813e07dc26bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5814e07dc26bSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5815e07dc26bSmrg      _LT_TAGVAR(inherit_rpath, $1)=yes
5816e07dc26bSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5817e07dc26bSmrg      ;;
5818e07dc26bSmrg
5819e07dc26bSmrg    linux*)
5820e07dc26bSmrg      case $cc_basename in
5821e07dc26bSmrg      tcc*)
5822e07dc26bSmrg	# Fabrice Bellard et al's Tiny C Compiler
5823e07dc26bSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
5824e07dc26bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5825e07dc26bSmrg	;;
5826e07dc26bSmrg      esac
5827e07dc26bSmrg      ;;
5828e07dc26bSmrg
5829e07dc26bSmrg    netbsd* | netbsdelf*-gnu)
5830e07dc26bSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5831e07dc26bSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
5832e07dc26bSmrg      else
5833e07dc26bSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
5834e07dc26bSmrg      fi
5835e07dc26bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5836e07dc26bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5837e07dc26bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5838e07dc26bSmrg      ;;
5839e07dc26bSmrg
5840e07dc26bSmrg    newsos6)
5841e07dc26bSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5842e07dc26bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5843e07dc26bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5844e07dc26bSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5845e07dc26bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5846e07dc26bSmrg      ;;
5847e07dc26bSmrg
5848e07dc26bSmrg    *nto* | *qnx*)
5849e07dc26bSmrg      ;;
5850e07dc26bSmrg
5851e07dc26bSmrg    openbsd* | bitrig*)
5852e07dc26bSmrg      if test -f /usr/libexec/ld.so; then
5853e07dc26bSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
5854e07dc26bSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5855e07dc26bSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5856e07dc26bSmrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
5857e07dc26bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5858e07dc26bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
5859e07dc26bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5860e07dc26bSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5861e07dc26bSmrg	else
5862e07dc26bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5863e07dc26bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5864e07dc26bSmrg	fi
5865e07dc26bSmrg      else
5866e07dc26bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5867e07dc26bSmrg      fi
5868e07dc26bSmrg      ;;
5869e07dc26bSmrg
5870e07dc26bSmrg    os2*)
5871e07dc26bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5872e07dc26bSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5873e07dc26bSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5874e07dc26bSmrg      shrext_cmds=.dll
5875e07dc26bSmrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5876e07dc26bSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5877e07dc26bSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5878e07dc26bSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5879e07dc26bSmrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5880e07dc26bSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5881e07dc26bSmrg	emximp -o $lib $output_objdir/$libname.def'
5882e07dc26bSmrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5883e07dc26bSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5884e07dc26bSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5885e07dc26bSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5886e07dc26bSmrg	prefix_cmds="$SED"~
5887e07dc26bSmrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
5888e07dc26bSmrg	  prefix_cmds="$prefix_cmds -e 1d";
5889e07dc26bSmrg	fi~
5890e07dc26bSmrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5891e07dc26bSmrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5892e07dc26bSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5893e07dc26bSmrg	emximp -o $lib $output_objdir/$libname.def'
5894e07dc26bSmrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5895e07dc26bSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5896e07dc26bSmrg      ;;
5897e07dc26bSmrg
5898e07dc26bSmrg    osf3*)
5899e07dc26bSmrg      if test yes = "$GCC"; then
5900e07dc26bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5901e07dc26bSmrg	_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'
5902e07dc26bSmrg      else
5903e07dc26bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5904e07dc26bSmrg	_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'
5905e07dc26bSmrg      fi
5906e07dc26bSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5907e07dc26bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5908e07dc26bSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5909e07dc26bSmrg      ;;
5910e07dc26bSmrg
5911e07dc26bSmrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
5912e07dc26bSmrg      if test yes = "$GCC"; then
5913e07dc26bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5914e07dc26bSmrg	_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'
5915e07dc26bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5916e07dc26bSmrg      else
5917e07dc26bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5918e07dc26bSmrg	_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'
5919e07dc26bSmrg	_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~
5920e07dc26bSmrg          $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'
5921e07dc26bSmrg
5922e07dc26bSmrg	# Both c and cxx compiler support -rpath directly
5923e07dc26bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5924e07dc26bSmrg      fi
5925e07dc26bSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5926e07dc26bSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5927e07dc26bSmrg      ;;
5928e07dc26bSmrg
5929e07dc26bSmrg    solaris*)
5930e07dc26bSmrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
5931e07dc26bSmrg      if test yes = "$GCC"; then
5932e07dc26bSmrg	wlarc='$wl'
5933e07dc26bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5934e07dc26bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5935e07dc26bSmrg          $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'
5936e07dc26bSmrg      else
5937e07dc26bSmrg	case `$CC -V 2>&1` in
5938e07dc26bSmrg	*"Compilers 5.0"*)
5939e07dc26bSmrg	  wlarc=''
5940e07dc26bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
5941e07dc26bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5942e07dc26bSmrg            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
5943e07dc26bSmrg	  ;;
5944e07dc26bSmrg	*)
5945e07dc26bSmrg	  wlarc='$wl'
5946e07dc26bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
5947e07dc26bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5948e07dc26bSmrg            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5949e07dc26bSmrg	  ;;
5950e07dc26bSmrg	esac
5951e07dc26bSmrg      fi
5952e07dc26bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5953e07dc26bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5954e07dc26bSmrg      case $host_os in
5955e07dc26bSmrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
5956e07dc26bSmrg      *)
5957e07dc26bSmrg	# The compiler driver will combine and reorder linker options,
5958e07dc26bSmrg	# but understands '-z linker_flag'.  GCC discards it without '$wl',
5959e07dc26bSmrg	# but is careful enough not to reorder.
5960e07dc26bSmrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
5961e07dc26bSmrg	if test yes = "$GCC"; then
5962e07dc26bSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
5963e07dc26bSmrg	else
5964e07dc26bSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
5965e07dc26bSmrg	fi
5966e07dc26bSmrg	;;
5967e07dc26bSmrg      esac
5968e07dc26bSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5969e07dc26bSmrg      ;;
5970e07dc26bSmrg
5971e07dc26bSmrg    sunos4*)
5972e07dc26bSmrg      if test sequent = "$host_vendor"; then
5973e07dc26bSmrg	# Use $CC to link under sequent, because it throws in some extra .o
5974e07dc26bSmrg	# files that make .init and .fini sections work.
5975e07dc26bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5976e07dc26bSmrg      else
5977e07dc26bSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5978e07dc26bSmrg      fi
5979e07dc26bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5980e07dc26bSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5981e07dc26bSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5982e07dc26bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5983e07dc26bSmrg      ;;
5984e07dc26bSmrg
5985e07dc26bSmrg    sysv4)
5986e07dc26bSmrg      case $host_vendor in
5987e07dc26bSmrg	sni)
5988e07dc26bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5989e07dc26bSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5990e07dc26bSmrg	;;
5991e07dc26bSmrg	siemens)
5992e07dc26bSmrg	  ## LD is ld it makes a PLAMLIB
5993e07dc26bSmrg	  ## CC just makes a GrossModule.
5994e07dc26bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5995e07dc26bSmrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5996e07dc26bSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
5997e07dc26bSmrg        ;;
5998e07dc26bSmrg	motorola)
5999e07dc26bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6000e07dc26bSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
6001e07dc26bSmrg	;;
6002e07dc26bSmrg      esac
6003e07dc26bSmrg      runpath_var='LD_RUN_PATH'
6004e07dc26bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6005e07dc26bSmrg      ;;
6006e07dc26bSmrg
6007e07dc26bSmrg    sysv4.3*)
6008e07dc26bSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6009e07dc26bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6010e07dc26bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
6011e07dc26bSmrg      ;;
6012e07dc26bSmrg
6013e07dc26bSmrg    sysv4*MP*)
6014e07dc26bSmrg      if test -d /usr/nec; then
6015e07dc26bSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6016e07dc26bSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6017e07dc26bSmrg	runpath_var=LD_RUN_PATH
6018e07dc26bSmrg	hardcode_runpath_var=yes
6019e07dc26bSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
6020e07dc26bSmrg      fi
6021e07dc26bSmrg      ;;
6022e07dc26bSmrg
6023e07dc26bSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6024e07dc26bSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
6025e07dc26bSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6026e07dc26bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6027e07dc26bSmrg      runpath_var='LD_RUN_PATH'
6028e07dc26bSmrg
6029e07dc26bSmrg      if test yes = "$GCC"; then
6030e07dc26bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6031e07dc26bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6032e07dc26bSmrg      else
6033e07dc26bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6034e07dc26bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6035e07dc26bSmrg      fi
6036e07dc26bSmrg      ;;
6037e07dc26bSmrg
6038e07dc26bSmrg    sysv5* | sco3.2v5* | sco5v6*)
6039e07dc26bSmrg      # Note: We CANNOT use -z defs as we might desire, because we do not
6040e07dc26bSmrg      # link with -lc, and that would cause any symbols used from libc to
6041e07dc26bSmrg      # always be unresolved, which means just about no library would
6042e07dc26bSmrg      # ever link correctly.  If we're not using GNU ld we use -z text
6043e07dc26bSmrg      # though, which does catch some bad symbols but isn't as heavy-handed
6044e07dc26bSmrg      # as -z defs.
6045e07dc26bSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
6046e07dc26bSmrg      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
6047e07dc26bSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6048e07dc26bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6049e07dc26bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
6050e07dc26bSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6051e07dc26bSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
6052e07dc26bSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
6053e07dc26bSmrg      runpath_var='LD_RUN_PATH'
6054e07dc26bSmrg
6055e07dc26bSmrg      if test yes = "$GCC"; then
6056e07dc26bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6057e07dc26bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6058e07dc26bSmrg      else
6059e07dc26bSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6060e07dc26bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6061e07dc26bSmrg      fi
6062e07dc26bSmrg      ;;
6063e07dc26bSmrg
6064e07dc26bSmrg    uts4*)
6065e07dc26bSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6066e07dc26bSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6067e07dc26bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6068e07dc26bSmrg      ;;
6069e07dc26bSmrg
6070e07dc26bSmrg    *)
6071e07dc26bSmrg      _LT_TAGVAR(ld_shlibs, $1)=no
6072e07dc26bSmrg      ;;
6073e07dc26bSmrg    esac
6074e07dc26bSmrg
6075e07dc26bSmrg    if test sni = "$host_vendor"; then
6076e07dc26bSmrg      case $host in
6077e07dc26bSmrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6078e07dc26bSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
6079e07dc26bSmrg	;;
6080e07dc26bSmrg      esac
6081e07dc26bSmrg    fi
6082e07dc26bSmrg  fi
6083e07dc26bSmrg])
6084e07dc26bSmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6085e07dc26bSmrgtest no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
6086e07dc26bSmrg
6087e07dc26bSmrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
6088e07dc26bSmrg
6089e07dc26bSmrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
6090e07dc26bSmrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
6091e07dc26bSmrg_LT_DECL([], [extract_expsyms_cmds], [2],
6092e07dc26bSmrg    [The commands to extract the exported symbol list from a shared archive])
6093e07dc26bSmrg
6094e07dc26bSmrg#
6095e07dc26bSmrg# Do we need to explicitly link libc?
6096e07dc26bSmrg#
6097e07dc26bSmrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
6098e07dc26bSmrgx|xyes)
6099e07dc26bSmrg  # Assume -lc should be added
6100e07dc26bSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6101e07dc26bSmrg
6102e07dc26bSmrg  if test yes,yes = "$GCC,$enable_shared"; then
6103e07dc26bSmrg    case $_LT_TAGVAR(archive_cmds, $1) in
6104e07dc26bSmrg    *'~'*)
6105e07dc26bSmrg      # FIXME: we may have to deal with multi-command sequences.
6106e07dc26bSmrg      ;;
6107e07dc26bSmrg    '$CC '*)
6108e07dc26bSmrg      # Test whether the compiler implicitly links with -lc since on some
6109e07dc26bSmrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
6110e07dc26bSmrg      # to ld, don't add -lc before -lgcc.
6111e07dc26bSmrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
6112e07dc26bSmrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
6113e07dc26bSmrg	[$RM conftest*
6114e07dc26bSmrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6115e07dc26bSmrg
6116e07dc26bSmrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6117e07dc26bSmrg	  soname=conftest
6118e07dc26bSmrg	  lib=conftest
6119e07dc26bSmrg	  libobjs=conftest.$ac_objext
6120e07dc26bSmrg	  deplibs=
6121e07dc26bSmrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
6122e07dc26bSmrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
6123e07dc26bSmrg	  compiler_flags=-v
6124e07dc26bSmrg	  linker_flags=-v
6125e07dc26bSmrg	  verstring=
6126e07dc26bSmrg	  output_objdir=.
6127e07dc26bSmrg	  libname=conftest
6128e07dc26bSmrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
6129e07dc26bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
6130e07dc26bSmrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
6131e07dc26bSmrg	  then
6132e07dc26bSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6133e07dc26bSmrg	  else
6134e07dc26bSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6135e07dc26bSmrg	  fi
6136e07dc26bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6137e07dc26bSmrg	else
6138e07dc26bSmrg	  cat conftest.err 1>&5
6139e07dc26bSmrg	fi
6140e07dc26bSmrg	$RM conftest*
6141e07dc26bSmrg	])
6142e07dc26bSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
6143e07dc26bSmrg      ;;
6144e07dc26bSmrg    esac
6145e07dc26bSmrg  fi
6146e07dc26bSmrg  ;;
6147e07dc26bSmrgesac
6148e07dc26bSmrg
6149e07dc26bSmrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
6150e07dc26bSmrg    [Whether or not to add -lc for building shared libraries])
6151e07dc26bSmrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
6152e07dc26bSmrg    [enable_shared_with_static_runtimes], [0],
6153e07dc26bSmrg    [Whether or not to disallow shared libs when runtime libs are static])
6154e07dc26bSmrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
6155e07dc26bSmrg    [Compiler flag to allow reflexive dlopens])
6156e07dc26bSmrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
6157e07dc26bSmrg    [Compiler flag to generate shared objects directly from archives])
6158e07dc26bSmrg_LT_TAGDECL([], [compiler_needs_object], [1],
6159e07dc26bSmrg    [Whether the compiler copes with passing no objects directly])
6160e07dc26bSmrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
6161e07dc26bSmrg    [Create an old-style archive from a shared archive])
6162e07dc26bSmrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
6163e07dc26bSmrg    [Create a temporary old-style archive to link instead of a shared archive])
6164e07dc26bSmrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
6165e07dc26bSmrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
6166e07dc26bSmrg_LT_TAGDECL([], [module_cmds], [2],
6167e07dc26bSmrg    [Commands used to build a loadable module if different from building
6168e07dc26bSmrg    a shared archive.])
6169e07dc26bSmrg_LT_TAGDECL([], [module_expsym_cmds], [2])
6170e07dc26bSmrg_LT_TAGDECL([], [with_gnu_ld], [1],
6171e07dc26bSmrg    [Whether we are building with GNU ld or not])
6172e07dc26bSmrg_LT_TAGDECL([], [allow_undefined_flag], [1],
6173e07dc26bSmrg    [Flag that allows shared libraries with undefined symbols to be built])
6174e07dc26bSmrg_LT_TAGDECL([], [no_undefined_flag], [1],
6175e07dc26bSmrg    [Flag that enforces no undefined symbols])
6176e07dc26bSmrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
6177e07dc26bSmrg    [Flag to hardcode $libdir into a binary during linking.
6178e07dc26bSmrg    This must work even if $libdir does not exist])
6179e07dc26bSmrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
6180e07dc26bSmrg    [Whether we need a single "-rpath" flag with a separated argument])
6181e07dc26bSmrg_LT_TAGDECL([], [hardcode_direct], [0],
6182e07dc26bSmrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
6183e07dc26bSmrg    DIR into the resulting binary])
6184e07dc26bSmrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
6185e07dc26bSmrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
6186e07dc26bSmrg    DIR into the resulting binary and the resulting library dependency is
6187e07dc26bSmrg    "absolute", i.e impossible to change by setting $shlibpath_var if the
6188e07dc26bSmrg    library is relocated])
6189e07dc26bSmrg_LT_TAGDECL([], [hardcode_minus_L], [0],
6190e07dc26bSmrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
6191e07dc26bSmrg    into the resulting binary])
6192e07dc26bSmrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
6193e07dc26bSmrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
6194e07dc26bSmrg    into the resulting binary])
6195e07dc26bSmrg_LT_TAGDECL([], [hardcode_automatic], [0],
6196e07dc26bSmrg    [Set to "yes" if building a shared library automatically hardcodes DIR
6197e07dc26bSmrg    into the library and all subsequent libraries and executables linked
6198e07dc26bSmrg    against it])
6199e07dc26bSmrg_LT_TAGDECL([], [inherit_rpath], [0],
6200e07dc26bSmrg    [Set to yes if linker adds runtime paths of dependent libraries
6201e07dc26bSmrg    to runtime path list])
6202e07dc26bSmrg_LT_TAGDECL([], [link_all_deplibs], [0],
6203e07dc26bSmrg    [Whether libtool must link a program against all its dependency libraries])
6204e07dc26bSmrg_LT_TAGDECL([], [always_export_symbols], [0],
6205e07dc26bSmrg    [Set to "yes" if exported symbols are required])
6206e07dc26bSmrg_LT_TAGDECL([], [export_symbols_cmds], [2],
6207e07dc26bSmrg    [The commands to list exported symbols])
6208e07dc26bSmrg_LT_TAGDECL([], [exclude_expsyms], [1],
6209e07dc26bSmrg    [Symbols that should not be listed in the preloaded symbols])
6210e07dc26bSmrg_LT_TAGDECL([], [include_expsyms], [1],
6211e07dc26bSmrg    [Symbols that must always be exported])
6212e07dc26bSmrg_LT_TAGDECL([], [prelink_cmds], [2],
6213e07dc26bSmrg    [Commands necessary for linking programs (against libraries) with templates])
6214e07dc26bSmrg_LT_TAGDECL([], [postlink_cmds], [2],
6215e07dc26bSmrg    [Commands necessary for finishing linking programs])
6216e07dc26bSmrg_LT_TAGDECL([], [file_list_spec], [1],
6217e07dc26bSmrg    [Specify filename containing input files])
6218e07dc26bSmrgdnl FIXME: Not yet implemented
6219e07dc26bSmrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
6220e07dc26bSmrgdnl    [Compiler flag to generate thread safe objects])
6221e07dc26bSmrg])# _LT_LINKER_SHLIBS
6222e07dc26bSmrg
6223e07dc26bSmrg
6224e07dc26bSmrg# _LT_LANG_C_CONFIG([TAG])
6225e07dc26bSmrg# ------------------------
6226e07dc26bSmrg# Ensure that the configuration variables for a C compiler are suitably
6227e07dc26bSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
6228e07dc26bSmrg# the compiler configuration to 'libtool'.
6229e07dc26bSmrgm4_defun([_LT_LANG_C_CONFIG],
6230e07dc26bSmrg[m4_require([_LT_DECL_EGREP])dnl
6231e07dc26bSmrglt_save_CC=$CC
6232e07dc26bSmrgAC_LANG_PUSH(C)
6233e07dc26bSmrg
6234e07dc26bSmrg# Source file extension for C test sources.
6235e07dc26bSmrgac_ext=c
6236e07dc26bSmrg
6237e07dc26bSmrg# Object file extension for compiled C test sources.
6238e07dc26bSmrgobjext=o
6239e07dc26bSmrg_LT_TAGVAR(objext, $1)=$objext
6240e07dc26bSmrg
6241e07dc26bSmrg# Code to be used in simple compile tests
6242e07dc26bSmrglt_simple_compile_test_code="int some_variable = 0;"
6243e07dc26bSmrg
6244e07dc26bSmrg# Code to be used in simple link tests
6245e07dc26bSmrglt_simple_link_test_code='int main(){return(0);}'
6246e07dc26bSmrg
6247e07dc26bSmrg_LT_TAG_COMPILER
6248e07dc26bSmrg# Save the default compiler, since it gets overwritten when the other
6249e07dc26bSmrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
6250e07dc26bSmrgcompiler_DEFAULT=$CC
6251e07dc26bSmrg
6252e07dc26bSmrg# save warnings/boilerplate of simple test code
6253e07dc26bSmrg_LT_COMPILER_BOILERPLATE
6254e07dc26bSmrg_LT_LINKER_BOILERPLATE
6255e07dc26bSmrg
6256e07dc26bSmrgif test -n "$compiler"; then
6257e07dc26bSmrg  _LT_COMPILER_NO_RTTI($1)
6258e07dc26bSmrg  _LT_COMPILER_PIC($1)
6259e07dc26bSmrg  _LT_COMPILER_C_O($1)
6260e07dc26bSmrg  _LT_COMPILER_FILE_LOCKS($1)
6261e07dc26bSmrg  _LT_LINKER_SHLIBS($1)
6262e07dc26bSmrg  _LT_SYS_DYNAMIC_LINKER($1)
6263e07dc26bSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
6264e07dc26bSmrg  LT_SYS_DLOPEN_SELF
6265e07dc26bSmrg  _LT_CMD_STRIPLIB
6266e07dc26bSmrg
6267e07dc26bSmrg  # Report what library types will actually be built
6268e07dc26bSmrg  AC_MSG_CHECKING([if libtool supports shared libraries])
6269e07dc26bSmrg  AC_MSG_RESULT([$can_build_shared])
6270e07dc26bSmrg
6271e07dc26bSmrg  AC_MSG_CHECKING([whether to build shared libraries])
6272e07dc26bSmrg  test no = "$can_build_shared" && enable_shared=no
6273e07dc26bSmrg
6274e07dc26bSmrg  # On AIX, shared libraries and static libraries use the same namespace, and
6275e07dc26bSmrg  # are all built from PIC.
6276e07dc26bSmrg  case $host_os in
6277e07dc26bSmrg  aix3*)
6278e07dc26bSmrg    test yes = "$enable_shared" && enable_static=no
6279e07dc26bSmrg    if test -n "$RANLIB"; then
6280e07dc26bSmrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
6281e07dc26bSmrg      postinstall_cmds='$RANLIB $lib'
6282e07dc26bSmrg    fi
6283e07dc26bSmrg    ;;
6284e07dc26bSmrg
6285e07dc26bSmrg  aix[[4-9]]*)
6286e07dc26bSmrg    if test ia64 != "$host_cpu"; then
6287e07dc26bSmrg      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
6288e07dc26bSmrg      yes,aix,yes) ;;			# shared object as lib.so file only
6289e07dc26bSmrg      yes,svr4,*) ;;			# shared object as lib.so archive member only
6290e07dc26bSmrg      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
6291e07dc26bSmrg      esac
6292e07dc26bSmrg    fi
6293e07dc26bSmrg    ;;
6294e07dc26bSmrg  esac
6295e07dc26bSmrg  AC_MSG_RESULT([$enable_shared])
6296e07dc26bSmrg
6297e07dc26bSmrg  AC_MSG_CHECKING([whether to build static libraries])
6298e07dc26bSmrg  # Make sure either enable_shared or enable_static is yes.
6299e07dc26bSmrg  test yes = "$enable_shared" || enable_static=yes
6300e07dc26bSmrg  AC_MSG_RESULT([$enable_static])
6301e07dc26bSmrg
6302e07dc26bSmrg  _LT_CONFIG($1)
6303e07dc26bSmrgfi
6304e07dc26bSmrgAC_LANG_POP
6305e07dc26bSmrgCC=$lt_save_CC
6306e07dc26bSmrg])# _LT_LANG_C_CONFIG
6307e07dc26bSmrg
6308e07dc26bSmrg
6309e07dc26bSmrg# _LT_LANG_CXX_CONFIG([TAG])
6310e07dc26bSmrg# --------------------------
6311e07dc26bSmrg# Ensure that the configuration variables for a C++ compiler are suitably
6312e07dc26bSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
6313e07dc26bSmrg# the compiler configuration to 'libtool'.
6314e07dc26bSmrgm4_defun([_LT_LANG_CXX_CONFIG],
6315e07dc26bSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6316e07dc26bSmrgm4_require([_LT_DECL_EGREP])dnl
6317e07dc26bSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
6318e07dc26bSmrgif test -n "$CXX" && ( test no != "$CXX" &&
6319e07dc26bSmrg    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
6320e07dc26bSmrg    (test g++ != "$CXX"))); then
6321e07dc26bSmrg  AC_PROG_CXXCPP
6322e07dc26bSmrgelse
6323e07dc26bSmrg  _lt_caught_CXX_error=yes
6324e07dc26bSmrgfi
6325e07dc26bSmrg
6326e07dc26bSmrgAC_LANG_PUSH(C++)
6327e07dc26bSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6328e07dc26bSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
6329e07dc26bSmrg_LT_TAGVAR(always_export_symbols, $1)=no
6330e07dc26bSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
6331e07dc26bSmrg_LT_TAGVAR(compiler_needs_object, $1)=no
6332e07dc26bSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6333e07dc26bSmrg_LT_TAGVAR(hardcode_direct, $1)=no
6334e07dc26bSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6335e07dc26bSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6336e07dc26bSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
6337e07dc26bSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
6338e07dc26bSmrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6339e07dc26bSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
6340e07dc26bSmrg_LT_TAGVAR(inherit_rpath, $1)=no
6341e07dc26bSmrg_LT_TAGVAR(module_cmds, $1)=
6342e07dc26bSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
6343e07dc26bSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
6344e07dc26bSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6345e07dc26bSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
6346e07dc26bSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6347e07dc26bSmrg_LT_TAGVAR(no_undefined_flag, $1)=
6348e07dc26bSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
6349e07dc26bSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6350e07dc26bSmrg
6351e07dc26bSmrg# Source file extension for C++ test sources.
6352e07dc26bSmrgac_ext=cpp
6353e07dc26bSmrg
6354e07dc26bSmrg# Object file extension for compiled C++ test sources.
6355e07dc26bSmrgobjext=o
6356e07dc26bSmrg_LT_TAGVAR(objext, $1)=$objext
6357e07dc26bSmrg
6358e07dc26bSmrg# No sense in running all these tests if we already determined that
6359e07dc26bSmrg# the CXX compiler isn't working.  Some variables (like enable_shared)
6360e07dc26bSmrg# are currently assumed to apply to all compilers on this platform,
6361e07dc26bSmrg# and will be corrupted by setting them based on a non-working compiler.
6362e07dc26bSmrgif test yes != "$_lt_caught_CXX_error"; then
6363e07dc26bSmrg  # Code to be used in simple compile tests
6364e07dc26bSmrg  lt_simple_compile_test_code="int some_variable = 0;"
6365e07dc26bSmrg
6366e07dc26bSmrg  # Code to be used in simple link tests
6367e07dc26bSmrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
6368e07dc26bSmrg
6369e07dc26bSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6370e07dc26bSmrg  _LT_TAG_COMPILER
6371e07dc26bSmrg
6372e07dc26bSmrg  # save warnings/boilerplate of simple test code
6373e07dc26bSmrg  _LT_COMPILER_BOILERPLATE
6374e07dc26bSmrg  _LT_LINKER_BOILERPLATE
6375e07dc26bSmrg
6376e07dc26bSmrg  # Allow CC to be a program name with arguments.
6377e07dc26bSmrg  lt_save_CC=$CC
6378e07dc26bSmrg  lt_save_CFLAGS=$CFLAGS
6379e07dc26bSmrg  lt_save_LD=$LD
6380e07dc26bSmrg  lt_save_GCC=$GCC
6381e07dc26bSmrg  GCC=$GXX
6382e07dc26bSmrg  lt_save_with_gnu_ld=$with_gnu_ld
6383e07dc26bSmrg  lt_save_path_LD=$lt_cv_path_LD
6384e07dc26bSmrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
6385e07dc26bSmrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
6386e07dc26bSmrg  else
6387e07dc26bSmrg    $as_unset lt_cv_prog_gnu_ld
6388e07dc26bSmrg  fi
6389e07dc26bSmrg  if test -n "${lt_cv_path_LDCXX+set}"; then
6390e07dc26bSmrg    lt_cv_path_LD=$lt_cv_path_LDCXX
6391e07dc26bSmrg  else
6392e07dc26bSmrg    $as_unset lt_cv_path_LD
6393e07dc26bSmrg  fi
6394e07dc26bSmrg  test -z "${LDCXX+set}" || LD=$LDCXX
6395e07dc26bSmrg  CC=${CXX-"c++"}
6396e07dc26bSmrg  CFLAGS=$CXXFLAGS
6397e07dc26bSmrg  compiler=$CC
6398e07dc26bSmrg  _LT_TAGVAR(compiler, $1)=$CC
6399e07dc26bSmrg  _LT_CC_BASENAME([$compiler])
6400e07dc26bSmrg
6401e07dc26bSmrg  if test -n "$compiler"; then
6402e07dc26bSmrg    # We don't want -fno-exception when compiling C++ code, so set the
6403e07dc26bSmrg    # no_builtin_flag separately
6404e07dc26bSmrg    if test yes = "$GXX"; then
6405e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
6406e07dc26bSmrg    else
6407e07dc26bSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
6408e07dc26bSmrg    fi
6409e07dc26bSmrg
6410e07dc26bSmrg    if test yes = "$GXX"; then
6411e07dc26bSmrg      # Set up default GNU C++ configuration
6412e07dc26bSmrg
6413e07dc26bSmrg      LT_PATH_LD
6414e07dc26bSmrg
6415e07dc26bSmrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
6416e07dc26bSmrg      # archiving commands below assume that GNU ld is being used.
6417e07dc26bSmrg      if test yes = "$with_gnu_ld"; then
6418e07dc26bSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6419e07dc26bSmrg        _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'
6420e07dc26bSmrg
6421e07dc26bSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6422e07dc26bSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6423e07dc26bSmrg
6424e07dc26bSmrg        # If archive_cmds runs LD, not CC, wlarc should be empty
6425e07dc26bSmrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
6426e07dc26bSmrg        #     investigate it a little bit more. (MM)
6427e07dc26bSmrg        wlarc='$wl'
6428e07dc26bSmrg
6429e07dc26bSmrg        # ancient GNU ld didn't support --whole-archive et. al.
6430e07dc26bSmrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
6431e07dc26bSmrg	  $GREP 'no-whole-archive' > /dev/null; then
6432e07dc26bSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
6433e07dc26bSmrg        else
6434e07dc26bSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
6435e07dc26bSmrg        fi
6436e07dc26bSmrg      else
6437e07dc26bSmrg        with_gnu_ld=no
6438e07dc26bSmrg        wlarc=
6439e07dc26bSmrg
6440e07dc26bSmrg        # A generic and very simple default shared library creation
6441e07dc26bSmrg        # command for GNU C++ for the case where it uses the native
6442e07dc26bSmrg        # linker, instead of GNU ld.  If possible, this setting should
6443e07dc26bSmrg        # overridden to take advantage of the native linker features on
6444e07dc26bSmrg        # the platform it is being used on.
6445e07dc26bSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6446e07dc26bSmrg      fi
6447e07dc26bSmrg
6448e07dc26bSmrg      # Commands to make compiler produce verbose output that lists
6449e07dc26bSmrg      # what "hidden" libraries, object files and flags are used when
6450e07dc26bSmrg      # linking a shared library.
6451e07dc26bSmrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6452e07dc26bSmrg
6453e07dc26bSmrg    else
6454e07dc26bSmrg      GXX=no
6455e07dc26bSmrg      with_gnu_ld=no
6456e07dc26bSmrg      wlarc=
6457e07dc26bSmrg    fi
6458e07dc26bSmrg
6459e07dc26bSmrg    # PORTME: fill in a description of your system's C++ link characteristics
6460e07dc26bSmrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
6461e07dc26bSmrg    _LT_TAGVAR(ld_shlibs, $1)=yes
6462e07dc26bSmrg    case $host_os in
6463e07dc26bSmrg      aix3*)
6464e07dc26bSmrg        # FIXME: insert proper C++ library support
6465e07dc26bSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6466e07dc26bSmrg        ;;
6467e07dc26bSmrg      aix[[4-9]]*)
6468e07dc26bSmrg        if test ia64 = "$host_cpu"; then
6469e07dc26bSmrg          # On IA64, the linker does run time linking by default, so we don't
6470e07dc26bSmrg          # have to do anything special.
6471e07dc26bSmrg          aix_use_runtimelinking=no
6472e07dc26bSmrg          exp_sym_flag='-Bexport'
6473e07dc26bSmrg          no_entry_flag=
6474e07dc26bSmrg        else
6475e07dc26bSmrg          aix_use_runtimelinking=no
6476e07dc26bSmrg
6477e07dc26bSmrg          # Test if we are trying to use run time linking or normal
6478e07dc26bSmrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
6479e07dc26bSmrg          # have runtime linking enabled, and use it for executables.
6480e07dc26bSmrg          # For shared libraries, we enable/disable runtime linking
6481e07dc26bSmrg          # depending on the kind of the shared library created -
6482e07dc26bSmrg          # when "with_aix_soname,aix_use_runtimelinking" is:
6483e07dc26bSmrg          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
6484e07dc26bSmrg          # "aix,yes"  lib.so          shared, rtl:yes, for executables
6485e07dc26bSmrg          #            lib.a           static archive
6486e07dc26bSmrg          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
6487e07dc26bSmrg          #            lib.a(lib.so.V) shared, rtl:no,  for executables
6488e07dc26bSmrg          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
6489e07dc26bSmrg          #            lib.a(lib.so.V) shared, rtl:no
6490e07dc26bSmrg          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
6491e07dc26bSmrg          #            lib.a           static archive
6492e07dc26bSmrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6493e07dc26bSmrg	    for ld_flag in $LDFLAGS; do
6494e07dc26bSmrg	      case $ld_flag in
6495e07dc26bSmrg	      *-brtl*)
6496e07dc26bSmrg	        aix_use_runtimelinking=yes
6497e07dc26bSmrg	        break
6498e07dc26bSmrg	        ;;
6499e07dc26bSmrg	      esac
6500e07dc26bSmrg	    done
6501e07dc26bSmrg	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
6502e07dc26bSmrg	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
6503e07dc26bSmrg	      # so we don't have lib.a shared libs to link our executables.
6504e07dc26bSmrg	      # We have to force runtime linking in this case.
6505e07dc26bSmrg	      aix_use_runtimelinking=yes
6506e07dc26bSmrg	      LDFLAGS="$LDFLAGS -Wl,-brtl"
6507e07dc26bSmrg	    fi
6508e07dc26bSmrg	    ;;
6509e07dc26bSmrg          esac
6510e07dc26bSmrg
6511e07dc26bSmrg          exp_sym_flag='-bexport'
6512e07dc26bSmrg          no_entry_flag='-bnoentry'
6513e07dc26bSmrg        fi
6514e07dc26bSmrg
6515e07dc26bSmrg        # When large executables or shared objects are built, AIX ld can
6516e07dc26bSmrg        # have problems creating the table of contents.  If linking a library
6517e07dc26bSmrg        # or program results in "error TOC overflow" add -mminimal-toc to
6518e07dc26bSmrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6519e07dc26bSmrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6520e07dc26bSmrg
6521e07dc26bSmrg        _LT_TAGVAR(archive_cmds, $1)=''
6522e07dc26bSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
6523e07dc26bSmrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6524e07dc26bSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6525e07dc26bSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
6526e07dc26bSmrg        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
6527e07dc26bSmrg        case $with_aix_soname,$aix_use_runtimelinking in
6528e07dc26bSmrg        aix,*) ;;	# no import file
6529e07dc26bSmrg        svr4,* | *,yes) # use import file
6530e07dc26bSmrg          # The Import File defines what to hardcode.
6531e07dc26bSmrg          _LT_TAGVAR(hardcode_direct, $1)=no
6532e07dc26bSmrg          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6533e07dc26bSmrg          ;;
6534e07dc26bSmrg        esac
6535e07dc26bSmrg
6536e07dc26bSmrg        if test yes = "$GXX"; then
6537e07dc26bSmrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
6538e07dc26bSmrg          # We only want to do this on AIX 4.2 and lower, the check
6539e07dc26bSmrg          # below for broken collect2 doesn't work under 4.3+
6540e07dc26bSmrg	  collect2name=`$CC -print-prog-name=collect2`
6541e07dc26bSmrg	  if test -f "$collect2name" &&
6542e07dc26bSmrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6543e07dc26bSmrg	  then
6544e07dc26bSmrg	    # We have reworked collect2
6545e07dc26bSmrg	    :
6546e07dc26bSmrg	  else
6547e07dc26bSmrg	    # We have old collect2
6548e07dc26bSmrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
6549e07dc26bSmrg	    # It fails to find uninstalled libraries when the uninstalled
6550e07dc26bSmrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
6551e07dc26bSmrg	    # to unsupported forces relinking
6552e07dc26bSmrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
6553e07dc26bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6554e07dc26bSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
6555e07dc26bSmrg	  fi
6556e07dc26bSmrg          esac
6557e07dc26bSmrg          shared_flag='-shared'
6558e07dc26bSmrg	  if test yes = "$aix_use_runtimelinking"; then
6559e07dc26bSmrg	    shared_flag=$shared_flag' $wl-G'
6560e07dc26bSmrg	  fi
6561e07dc26bSmrg	  # Need to ensure runtime linking is disabled for the traditional
6562e07dc26bSmrg	  # shared library, or the linker may eventually find shared libraries
6563e07dc26bSmrg	  # /with/ Import File - we do not want to mix them.
6564e07dc26bSmrg	  shared_flag_aix='-shared'
6565e07dc26bSmrg	  shared_flag_svr4='-shared $wl-G'
6566e07dc26bSmrg        else
6567e07dc26bSmrg          # not using gcc
6568e07dc26bSmrg          if test ia64 = "$host_cpu"; then
6569e07dc26bSmrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6570e07dc26bSmrg	  # chokes on -Wl,-G. The following line is correct:
6571e07dc26bSmrg	  shared_flag='-G'
6572e07dc26bSmrg          else
6573e07dc26bSmrg	    if test yes = "$aix_use_runtimelinking"; then
6574e07dc26bSmrg	      shared_flag='$wl-G'
6575e07dc26bSmrg	    else
6576e07dc26bSmrg	      shared_flag='$wl-bM:SRE'
6577e07dc26bSmrg	    fi
6578e07dc26bSmrg	    shared_flag_aix='$wl-bM:SRE'
6579e07dc26bSmrg	    shared_flag_svr4='$wl-G'
6580e07dc26bSmrg          fi
6581e07dc26bSmrg        fi
6582e07dc26bSmrg
6583e07dc26bSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
6584e07dc26bSmrg        # It seems that -bexpall does not export symbols beginning with
6585e07dc26bSmrg        # underscore (_), so it is better to generate a list of symbols to
6586e07dc26bSmrg	# export.
6587e07dc26bSmrg        _LT_TAGVAR(always_export_symbols, $1)=yes
6588e07dc26bSmrg	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
6589e07dc26bSmrg          # Warning - without using the other runtime loading flags (-brtl),
6590e07dc26bSmrg          # -berok will link without error, but may produce a broken library.
6591e07dc26bSmrg          # The "-G" linker flag allows undefined symbols.
6592e07dc26bSmrg          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
6593e07dc26bSmrg          # Determine the default libpath from the value encoded in an empty
6594e07dc26bSmrg          # executable.
6595e07dc26bSmrg          _LT_SYS_MODULE_PATH_AIX([$1])
6596e07dc26bSmrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
6597e07dc26bSmrg
6598e07dc26bSmrg          _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
6599e07dc26bSmrg        else
6600e07dc26bSmrg          if test ia64 = "$host_cpu"; then
6601e07dc26bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
6602e07dc26bSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6603e07dc26bSmrg	    _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"
6604e07dc26bSmrg          else
6605e07dc26bSmrg	    # Determine the default libpath from the value encoded in an
6606e07dc26bSmrg	    # empty executable.
6607e07dc26bSmrg	    _LT_SYS_MODULE_PATH_AIX([$1])
6608e07dc26bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
6609e07dc26bSmrg	    # Warning - without using the other run time loading flags,
6610e07dc26bSmrg	    # -berok will link without error, but may produce a broken library.
6611e07dc26bSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
6612e07dc26bSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
6613e07dc26bSmrg	    if test yes = "$with_gnu_ld"; then
6614e07dc26bSmrg	      # We only use this code for GNU lds that support --whole-archive.
6615e07dc26bSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
6616e07dc26bSmrg	    else
6617e07dc26bSmrg	      # Exported symbols can be pulled into shared objects from archives
6618e07dc26bSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6619e07dc26bSmrg	    fi
6620e07dc26bSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6621e07dc26bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
6622e07dc26bSmrg	    # -brtl affects multiple linker settings, -berok does not and is overridden later
6623e07dc26bSmrg	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
6624e07dc26bSmrg	    if test svr4 != "$with_aix_soname"; then
6625e07dc26bSmrg	      # This is similar to how AIX traditionally builds its shared
6626e07dc26bSmrg	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
6627e07dc26bSmrg	      _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'
6628e07dc26bSmrg	    fi
6629e07dc26bSmrg	    if test aix != "$with_aix_soname"; then
6630e07dc26bSmrg	      _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'
6631e07dc26bSmrg	    else
6632e07dc26bSmrg	      # used by -dlpreopen to get the symbols
6633e07dc26bSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
6634e07dc26bSmrg	    fi
6635e07dc26bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
6636e07dc26bSmrg          fi
6637e07dc26bSmrg        fi
6638e07dc26bSmrg        ;;
6639e07dc26bSmrg
6640e07dc26bSmrg      beos*)
6641e07dc26bSmrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6642e07dc26bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6643e07dc26bSmrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
6644e07dc26bSmrg	  # support --undefined.  This deserves some investigation.  FIXME
6645e07dc26bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6646e07dc26bSmrg	else
6647e07dc26bSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6648e07dc26bSmrg	fi
6649e07dc26bSmrg	;;
6650e07dc26bSmrg
6651e07dc26bSmrg      chorus*)
6652e07dc26bSmrg        case $cc_basename in
6653e07dc26bSmrg          *)
6654e07dc26bSmrg	  # FIXME: insert proper C++ library support
6655e07dc26bSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6656e07dc26bSmrg	  ;;
6657e07dc26bSmrg        esac
6658e07dc26bSmrg        ;;
6659e07dc26bSmrg
6660e07dc26bSmrg      cygwin* | mingw* | pw32* | cegcc*)
6661e07dc26bSmrg	case $GXX,$cc_basename in
6662e07dc26bSmrg	,cl* | no,cl*)
6663e07dc26bSmrg	  # Native MSVC
6664e07dc26bSmrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
6665e07dc26bSmrg	  # no search path for DLLs.
6666e07dc26bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6667e07dc26bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6668e07dc26bSmrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
6669e07dc26bSmrg	  _LT_TAGVAR(file_list_spec, $1)='@'
6670e07dc26bSmrg	  # Tell ltmain to make .lib files, not .a files.
6671e07dc26bSmrg	  libext=lib
6672e07dc26bSmrg	  # Tell ltmain to make .dll files, not .so files.
6673e07dc26bSmrg	  shrext_cmds=.dll
6674e07dc26bSmrg	  # FIXME: Setting linknames here is a bad hack.
6675e07dc26bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
6676e07dc26bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6677e07dc26bSmrg              cp "$export_symbols" "$output_objdir/$soname.def";
6678e07dc26bSmrg              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
6679e07dc26bSmrg            else
6680e07dc26bSmrg              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
6681e07dc26bSmrg            fi~
6682e07dc26bSmrg            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6683e07dc26bSmrg            linknames='
6684e07dc26bSmrg	  # The linker will not automatically build a static lib if we build a DLL.
6685e07dc26bSmrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6686e07dc26bSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6687e07dc26bSmrg	  # Don't use ranlib
6688e07dc26bSmrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6689e07dc26bSmrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6690e07dc26bSmrg            lt_tool_outputfile="@TOOL_OUTPUT@"~
6691e07dc26bSmrg            case $lt_outputfile in
6692e07dc26bSmrg              *.exe|*.EXE) ;;
6693e07dc26bSmrg              *)
6694e07dc26bSmrg                lt_outputfile=$lt_outputfile.exe
6695e07dc26bSmrg                lt_tool_outputfile=$lt_tool_outputfile.exe
6696e07dc26bSmrg                ;;
6697e07dc26bSmrg            esac~
6698e07dc26bSmrg            func_to_tool_file "$lt_outputfile"~
6699e07dc26bSmrg            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
6700e07dc26bSmrg              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6701e07dc26bSmrg              $RM "$lt_outputfile.manifest";
6702e07dc26bSmrg            fi'
6703e07dc26bSmrg	  ;;
6704e07dc26bSmrg	*)
6705e07dc26bSmrg	  # g++
6706e07dc26bSmrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6707e07dc26bSmrg	  # as there is no search path for DLLs.
6708e07dc26bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6709e07dc26bSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
6710e07dc26bSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6711e07dc26bSmrg	  _LT_TAGVAR(always_export_symbols, $1)=no
6712e07dc26bSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6713e07dc26bSmrg
6714e07dc26bSmrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6715e07dc26bSmrg	    _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'
6716e07dc26bSmrg	    # If the export-symbols file already is a .def file, use it as
6717e07dc26bSmrg	    # is; otherwise, prepend EXPORTS...
6718e07dc26bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6719e07dc26bSmrg              cp $export_symbols $output_objdir/$soname.def;
6720e07dc26bSmrg            else
6721e07dc26bSmrg              echo EXPORTS > $output_objdir/$soname.def;
6722e07dc26bSmrg              cat $export_symbols >> $output_objdir/$soname.def;
6723e07dc26bSmrg            fi~
6724e07dc26bSmrg            $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'
6725e07dc26bSmrg	  else
6726e07dc26bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6727e07dc26bSmrg	  fi
6728e07dc26bSmrg	  ;;
6729e07dc26bSmrg	esac
6730e07dc26bSmrg	;;
6731e07dc26bSmrg      darwin* | rhapsody*)
6732e07dc26bSmrg        _LT_DARWIN_LINKER_FEATURES($1)
6733e07dc26bSmrg	;;
6734e07dc26bSmrg
6735e07dc26bSmrg      os2*)
6736e07dc26bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6737e07dc26bSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
6738e07dc26bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6739e07dc26bSmrg	shrext_cmds=.dll
6740e07dc26bSmrg	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6741e07dc26bSmrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6742e07dc26bSmrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6743e07dc26bSmrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
6744e07dc26bSmrg	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
6745e07dc26bSmrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6746e07dc26bSmrg	  emximp -o $lib $output_objdir/$libname.def'
6747e07dc26bSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6748e07dc26bSmrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6749e07dc26bSmrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6750e07dc26bSmrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
6751e07dc26bSmrg	  prefix_cmds="$SED"~
6752e07dc26bSmrg	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
6753e07dc26bSmrg	    prefix_cmds="$prefix_cmds -e 1d";
6754e07dc26bSmrg	  fi~
6755e07dc26bSmrg	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
6756e07dc26bSmrg	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
6757e07dc26bSmrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6758e07dc26bSmrg	  emximp -o $lib $output_objdir/$libname.def'
6759e07dc26bSmrg	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
6760e07dc26bSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6761e07dc26bSmrg	;;
6762e07dc26bSmrg
6763e07dc26bSmrg      dgux*)
6764e07dc26bSmrg        case $cc_basename in
6765e07dc26bSmrg          ec++*)
6766e07dc26bSmrg	    # FIXME: insert proper C++ library support
6767e07dc26bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6768e07dc26bSmrg	    ;;
6769e07dc26bSmrg          ghcx*)
6770e07dc26bSmrg	    # Green Hills C++ Compiler
6771e07dc26bSmrg	    # FIXME: insert proper C++ library support
6772e07dc26bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6773e07dc26bSmrg	    ;;
6774e07dc26bSmrg          *)
6775e07dc26bSmrg	    # FIXME: insert proper C++ library support
6776e07dc26bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6777e07dc26bSmrg	    ;;
6778e07dc26bSmrg        esac
6779e07dc26bSmrg        ;;
6780e07dc26bSmrg
6781e07dc26bSmrg      freebsd2.*)
6782e07dc26bSmrg        # C++ shared libraries reported to be fairly broken before
6783e07dc26bSmrg	# switch to ELF
6784e07dc26bSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6785e07dc26bSmrg        ;;
6786e07dc26bSmrg
6787e07dc26bSmrg      freebsd-elf*)
6788e07dc26bSmrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6789e07dc26bSmrg        ;;
6790e07dc26bSmrg
6791e07dc26bSmrg      freebsd* | dragonfly*)
6792e07dc26bSmrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
6793e07dc26bSmrg        # conventions
6794e07dc26bSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
6795e07dc26bSmrg        ;;
6796e07dc26bSmrg
6797e07dc26bSmrg      haiku*)
6798e07dc26bSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6799e07dc26bSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
6800e07dc26bSmrg        ;;
6801e07dc26bSmrg
6802e07dc26bSmrg      hpux9*)
6803e07dc26bSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
6804e07dc26bSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6805e07dc26bSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6806e07dc26bSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
6807e07dc26bSmrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6808e07dc26bSmrg				             # but as the default
6809e07dc26bSmrg				             # location of the library.
6810e07dc26bSmrg
6811e07dc26bSmrg        case $cc_basename in
6812e07dc26bSmrg          CC*)
6813e07dc26bSmrg            # FIXME: insert proper C++ library support
6814e07dc26bSmrg            _LT_TAGVAR(ld_shlibs, $1)=no
6815e07dc26bSmrg            ;;
6816e07dc26bSmrg          aCC*)
6817e07dc26bSmrg            _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'
6818e07dc26bSmrg            # Commands to make compiler produce verbose output that lists
6819e07dc26bSmrg            # what "hidden" libraries, object files and flags are used when
6820e07dc26bSmrg            # linking a shared library.
6821e07dc26bSmrg            #
6822e07dc26bSmrg            # There doesn't appear to be a way to prevent this compiler from
6823e07dc26bSmrg            # explicitly linking system object files so we need to strip them
6824e07dc26bSmrg            # from the output so that they don't get included in the library
6825e07dc26bSmrg            # dependencies.
6826e07dc26bSmrg            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"'
6827e07dc26bSmrg            ;;
6828e07dc26bSmrg          *)
6829e07dc26bSmrg            if test yes = "$GXX"; then
6830e07dc26bSmrg              _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'
6831e07dc26bSmrg            else
6832e07dc26bSmrg              # FIXME: insert proper C++ library support
6833e07dc26bSmrg              _LT_TAGVAR(ld_shlibs, $1)=no
6834e07dc26bSmrg            fi
6835e07dc26bSmrg            ;;
6836e07dc26bSmrg        esac
6837e07dc26bSmrg        ;;
6838e07dc26bSmrg
6839e07dc26bSmrg      hpux10*|hpux11*)
6840e07dc26bSmrg        if test no = "$with_gnu_ld"; then
6841e07dc26bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
6842e07dc26bSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6843e07dc26bSmrg
6844e07dc26bSmrg          case $host_cpu in
6845e07dc26bSmrg            hppa*64*|ia64*)
6846e07dc26bSmrg              ;;
6847e07dc26bSmrg            *)
6848e07dc26bSmrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6849e07dc26bSmrg              ;;
6850e07dc26bSmrg          esac
6851e07dc26bSmrg        fi
6852e07dc26bSmrg        case $host_cpu in
6853e07dc26bSmrg          hppa*64*|ia64*)
6854e07dc26bSmrg            _LT_TAGVAR(hardcode_direct, $1)=no
6855e07dc26bSmrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6856e07dc26bSmrg            ;;
6857e07dc26bSmrg          *)
6858e07dc26bSmrg            _LT_TAGVAR(hardcode_direct, $1)=yes
6859e07dc26bSmrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6860e07dc26bSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6861e07dc26bSmrg					         # but as the default
6862e07dc26bSmrg					         # location of the library.
6863e07dc26bSmrg            ;;
6864e07dc26bSmrg        esac
6865e07dc26bSmrg
6866e07dc26bSmrg        case $cc_basename in
6867e07dc26bSmrg          CC*)
6868e07dc26bSmrg	    # FIXME: insert proper C++ library support
6869e07dc26bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6870e07dc26bSmrg	    ;;
6871e07dc26bSmrg          aCC*)
6872e07dc26bSmrg	    case $host_cpu in
6873e07dc26bSmrg	      hppa*64*)
6874e07dc26bSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6875e07dc26bSmrg	        ;;
6876e07dc26bSmrg	      ia64*)
6877e07dc26bSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6878e07dc26bSmrg	        ;;
6879e07dc26bSmrg	      *)
6880e07dc26bSmrg	        _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'
6881e07dc26bSmrg	        ;;
6882e07dc26bSmrg	    esac
6883e07dc26bSmrg	    # Commands to make compiler produce verbose output that lists
6884e07dc26bSmrg	    # what "hidden" libraries, object files and flags are used when
6885e07dc26bSmrg	    # linking a shared library.
6886e07dc26bSmrg	    #
6887e07dc26bSmrg	    # There doesn't appear to be a way to prevent this compiler from
6888e07dc26bSmrg	    # explicitly linking system object files so we need to strip them
6889e07dc26bSmrg	    # from the output so that they don't get included in the library
6890e07dc26bSmrg	    # dependencies.
6891e07dc26bSmrg	    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"'
6892e07dc26bSmrg	    ;;
6893e07dc26bSmrg          *)
6894e07dc26bSmrg	    if test yes = "$GXX"; then
6895e07dc26bSmrg	      if test no = "$with_gnu_ld"; then
6896e07dc26bSmrg	        case $host_cpu in
6897e07dc26bSmrg	          hppa*64*)
6898e07dc26bSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6899e07dc26bSmrg	            ;;
6900e07dc26bSmrg	          ia64*)
6901e07dc26bSmrg	            _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'
6902e07dc26bSmrg	            ;;
6903e07dc26bSmrg	          *)
6904e07dc26bSmrg	            _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'
6905e07dc26bSmrg	            ;;
6906e07dc26bSmrg	        esac
6907e07dc26bSmrg	      fi
6908e07dc26bSmrg	    else
6909e07dc26bSmrg	      # FIXME: insert proper C++ library support
6910e07dc26bSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
6911e07dc26bSmrg	    fi
6912e07dc26bSmrg	    ;;
6913e07dc26bSmrg        esac
6914e07dc26bSmrg        ;;
6915e07dc26bSmrg
6916e07dc26bSmrg      interix[[3-9]]*)
6917e07dc26bSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
6918e07dc26bSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6919e07dc26bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6920e07dc26bSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6921e07dc26bSmrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
6922e07dc26bSmrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
6923e07dc26bSmrg	# default) and relocated if they conflict, which is a slow very memory
6924e07dc26bSmrg	# consuming and fragmenting process.  To avoid this, we pick a random,
6925e07dc26bSmrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
6926e07dc26bSmrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
6927e07dc26bSmrg	_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'
6928e07dc26bSmrg	_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'
6929e07dc26bSmrg	;;
6930e07dc26bSmrg      irix5* | irix6*)
6931e07dc26bSmrg        case $cc_basename in
6932e07dc26bSmrg          CC*)
6933e07dc26bSmrg	    # SGI C++
6934e07dc26bSmrg	    _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'
6935e07dc26bSmrg
6936e07dc26bSmrg	    # Archives containing C++ object files must be created using
6937e07dc26bSmrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
6938e07dc26bSmrg	    # necessary to make sure instantiated templates are included
6939e07dc26bSmrg	    # in the archive.
6940e07dc26bSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
6941e07dc26bSmrg	    ;;
6942e07dc26bSmrg          *)
6943e07dc26bSmrg	    if test yes = "$GXX"; then
6944e07dc26bSmrg	      if test no = "$with_gnu_ld"; then
6945e07dc26bSmrg	        _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'
6946e07dc26bSmrg	      else
6947e07dc26bSmrg	        _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'
6948e07dc26bSmrg	      fi
6949e07dc26bSmrg	    fi
6950e07dc26bSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6951e07dc26bSmrg	    ;;
6952e07dc26bSmrg        esac
6953e07dc26bSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6954e07dc26bSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6955e07dc26bSmrg        _LT_TAGVAR(inherit_rpath, $1)=yes
6956e07dc26bSmrg        ;;
6957e07dc26bSmrg
6958e07dc26bSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
6959e07dc26bSmrg        case $cc_basename in
6960e07dc26bSmrg          KCC*)
6961e07dc26bSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6962e07dc26bSmrg
6963e07dc26bSmrg	    # KCC will only create a shared library if the output file
6964e07dc26bSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6965e07dc26bSmrg	    # to its proper name (with version) after linking.
6966e07dc26bSmrg	    _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'
6967e07dc26bSmrg	    _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'
6968e07dc26bSmrg	    # Commands to make compiler produce verbose output that lists
6969e07dc26bSmrg	    # what "hidden" libraries, object files and flags are used when
6970e07dc26bSmrg	    # linking a shared library.
6971e07dc26bSmrg	    #
6972e07dc26bSmrg	    # There doesn't appear to be a way to prevent this compiler from
6973e07dc26bSmrg	    # explicitly linking system object files so we need to strip them
6974e07dc26bSmrg	    # from the output so that they don't get included in the library
6975e07dc26bSmrg	    # dependencies.
6976e07dc26bSmrg	    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"'
6977e07dc26bSmrg
6978e07dc26bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6979e07dc26bSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6980e07dc26bSmrg
6981e07dc26bSmrg	    # Archives containing C++ object files must be created using
6982e07dc26bSmrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
6983e07dc26bSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
6984e07dc26bSmrg	    ;;
6985e07dc26bSmrg	  icpc* | ecpc* )
6986e07dc26bSmrg	    # Intel C++
6987e07dc26bSmrg	    with_gnu_ld=yes
6988e07dc26bSmrg	    # version 8.0 and above of icpc choke on multiply defined symbols
6989e07dc26bSmrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
6990e07dc26bSmrg	    # earlier do not add the objects themselves.
6991e07dc26bSmrg	    case `$CC -V 2>&1` in
6992e07dc26bSmrg	      *"Version 7."*)
6993e07dc26bSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6994e07dc26bSmrg		_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'
6995e07dc26bSmrg		;;
6996e07dc26bSmrg	      *)  # Version 8.0 or newer
6997e07dc26bSmrg	        tmp_idyn=
6998e07dc26bSmrg	        case $host_cpu in
6999e07dc26bSmrg		  ia64*) tmp_idyn=' -i_dynamic';;
7000e07dc26bSmrg		esac
7001e07dc26bSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
7002e07dc26bSmrg		_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'
7003e07dc26bSmrg		;;
7004e07dc26bSmrg	    esac
7005e07dc26bSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7006e07dc26bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7007e07dc26bSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7008e07dc26bSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
7009e07dc26bSmrg	    ;;
7010e07dc26bSmrg          pgCC* | pgcpp*)
7011e07dc26bSmrg            # Portland Group C++ compiler
7012e07dc26bSmrg	    case `$CC -V` in
7013e07dc26bSmrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
7014e07dc26bSmrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
7015e07dc26bSmrg               rm -rf $tpldir~
7016e07dc26bSmrg               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
7017e07dc26bSmrg               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
7018e07dc26bSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
7019e07dc26bSmrg                rm -rf $tpldir~
7020e07dc26bSmrg                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
7021e07dc26bSmrg                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
7022e07dc26bSmrg                $RANLIB $oldlib'
7023e07dc26bSmrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
7024e07dc26bSmrg                rm -rf $tpldir~
7025e07dc26bSmrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7026e07dc26bSmrg                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7027e07dc26bSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
7028e07dc26bSmrg                rm -rf $tpldir~
7029e07dc26bSmrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7030e07dc26bSmrg                $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'
7031e07dc26bSmrg	      ;;
7032e07dc26bSmrg	    *) # Version 6 and above use weak symbols
7033e07dc26bSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7034e07dc26bSmrg	      _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'
7035e07dc26bSmrg	      ;;
7036e07dc26bSmrg	    esac
7037e07dc26bSmrg
7038e07dc26bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
7039e07dc26bSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7040e07dc26bSmrg	    _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'
7041e07dc26bSmrg            ;;
7042e07dc26bSmrg	  cxx*)
7043e07dc26bSmrg	    # Compaq C++
7044e07dc26bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7045e07dc26bSmrg	    _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'
7046e07dc26bSmrg
7047e07dc26bSmrg	    runpath_var=LD_RUN_PATH
7048e07dc26bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7049e07dc26bSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7050e07dc26bSmrg
7051e07dc26bSmrg	    # Commands to make compiler produce verbose output that lists
7052e07dc26bSmrg	    # what "hidden" libraries, object files and flags are used when
7053e07dc26bSmrg	    # linking a shared library.
7054e07dc26bSmrg	    #
7055e07dc26bSmrg	    # There doesn't appear to be a way to prevent this compiler from
7056e07dc26bSmrg	    # explicitly linking system object files so we need to strip them
7057e07dc26bSmrg	    # from the output so that they don't get included in the library
7058e07dc26bSmrg	    # dependencies.
7059e07dc26bSmrg	    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'
7060e07dc26bSmrg	    ;;
7061e07dc26bSmrg	  xl* | mpixl* | bgxl*)
7062e07dc26bSmrg	    # IBM XL 8.0 on PPC, with GNU ld
7063e07dc26bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7064e07dc26bSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7065e07dc26bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
7066e07dc26bSmrg	    if test yes = "$supports_anon_versioning"; then
7067e07dc26bSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
7068e07dc26bSmrg                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7069e07dc26bSmrg                echo "local: *; };" >> $output_objdir/$libname.ver~
7070e07dc26bSmrg                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
7071e07dc26bSmrg	    fi
7072e07dc26bSmrg	    ;;
7073e07dc26bSmrg	  *)
7074e07dc26bSmrg	    case `$CC -V 2>&1 | sed 5q` in
7075e07dc26bSmrg	    *Sun\ C*)
7076e07dc26bSmrg	      # Sun C++ 5.9
7077e07dc26bSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7078e07dc26bSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7079e07dc26bSmrg	      _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'
7080e07dc26bSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7081e07dc26bSmrg	      _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'
7082e07dc26bSmrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
7083e07dc26bSmrg
7084e07dc26bSmrg	      # Not sure whether something based on
7085e07dc26bSmrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
7086e07dc26bSmrg	      # would be better.
7087e07dc26bSmrg	      output_verbose_link_cmd='func_echo_all'
7088e07dc26bSmrg
7089e07dc26bSmrg	      # Archives containing C++ object files must be created using
7090e07dc26bSmrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7091e07dc26bSmrg	      # necessary to make sure instantiated templates are included
7092e07dc26bSmrg	      # in the archive.
7093e07dc26bSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7094e07dc26bSmrg	      ;;
7095e07dc26bSmrg	    esac
7096e07dc26bSmrg	    ;;
7097e07dc26bSmrg	esac
7098e07dc26bSmrg	;;
7099e07dc26bSmrg
7100e07dc26bSmrg      lynxos*)
7101e07dc26bSmrg        # FIXME: insert proper C++ library support
7102e07dc26bSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
7103e07dc26bSmrg	;;
7104e07dc26bSmrg
7105e07dc26bSmrg      m88k*)
7106e07dc26bSmrg        # FIXME: insert proper C++ library support
7107e07dc26bSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7108e07dc26bSmrg	;;
7109e07dc26bSmrg
7110e07dc26bSmrg      mvs*)
7111e07dc26bSmrg        case $cc_basename in
7112e07dc26bSmrg          cxx*)
7113e07dc26bSmrg	    # FIXME: insert proper C++ library support
7114e07dc26bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7115e07dc26bSmrg	    ;;
7116e07dc26bSmrg	  *)
7117e07dc26bSmrg	    # FIXME: insert proper C++ library support
7118e07dc26bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7119e07dc26bSmrg	    ;;
7120e07dc26bSmrg	esac
7121e07dc26bSmrg	;;
7122e07dc26bSmrg
7123e07dc26bSmrg      netbsd*)
7124e07dc26bSmrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7125e07dc26bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
7126e07dc26bSmrg	  wlarc=
7127e07dc26bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7128e07dc26bSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
7129e07dc26bSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7130e07dc26bSmrg	fi
7131e07dc26bSmrg	# Workaround some broken pre-1.5 toolchains
7132e07dc26bSmrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
7133e07dc26bSmrg	;;
7134e07dc26bSmrg
7135e07dc26bSmrg      *nto* | *qnx*)
7136e07dc26bSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
7137e07dc26bSmrg	;;
7138e07dc26bSmrg
7139e07dc26bSmrg      openbsd* | bitrig*)
7140e07dc26bSmrg	if test -f /usr/libexec/ld.so; then
7141e07dc26bSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
7142e07dc26bSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7143e07dc26bSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7144e07dc26bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7145e07dc26bSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7146e07dc26bSmrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
7147e07dc26bSmrg	    _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'
7148e07dc26bSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
7149e07dc26bSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
7150e07dc26bSmrg	  fi
7151e07dc26bSmrg	  output_verbose_link_cmd=func_echo_all
7152e07dc26bSmrg	else
7153e07dc26bSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
7154e07dc26bSmrg	fi
7155e07dc26bSmrg	;;
7156e07dc26bSmrg
7157e07dc26bSmrg      osf3* | osf4* | osf5*)
7158e07dc26bSmrg        case $cc_basename in
7159e07dc26bSmrg          KCC*)
7160e07dc26bSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7161e07dc26bSmrg
7162e07dc26bSmrg	    # KCC will only create a shared library if the output file
7163e07dc26bSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7164e07dc26bSmrg	    # to its proper name (with version) after linking.
7165e07dc26bSmrg	    _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'
7166e07dc26bSmrg
7167e07dc26bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7168e07dc26bSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7169e07dc26bSmrg
7170e07dc26bSmrg	    # Archives containing C++ object files must be created using
7171e07dc26bSmrg	    # the KAI C++ compiler.
7172e07dc26bSmrg	    case $host in
7173e07dc26bSmrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
7174e07dc26bSmrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
7175e07dc26bSmrg	    esac
7176e07dc26bSmrg	    ;;
7177e07dc26bSmrg          RCC*)
7178e07dc26bSmrg	    # Rational C++ 2.4.1
7179e07dc26bSmrg	    # FIXME: insert proper C++ library support
7180e07dc26bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7181e07dc26bSmrg	    ;;
7182e07dc26bSmrg          cxx*)
7183e07dc26bSmrg	    case $host in
7184e07dc26bSmrg	      osf3*)
7185e07dc26bSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7186e07dc26bSmrg	        _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'
7187e07dc26bSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7188e07dc26bSmrg		;;
7189e07dc26bSmrg	      *)
7190e07dc26bSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7191e07dc26bSmrg	        _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'
7192e07dc26bSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7193e07dc26bSmrg                  echo "-hidden">> $lib.exp~
7194e07dc26bSmrg                  $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~
7195e07dc26bSmrg                  $RM $lib.exp'
7196e07dc26bSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7197e07dc26bSmrg		;;
7198e07dc26bSmrg	    esac
7199e07dc26bSmrg
7200e07dc26bSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7201e07dc26bSmrg
7202e07dc26bSmrg	    # Commands to make compiler produce verbose output that lists
7203e07dc26bSmrg	    # what "hidden" libraries, object files and flags are used when
7204e07dc26bSmrg	    # linking a shared library.
7205e07dc26bSmrg	    #
7206e07dc26bSmrg	    # There doesn't appear to be a way to prevent this compiler from
7207e07dc26bSmrg	    # explicitly linking system object files so we need to strip them
7208e07dc26bSmrg	    # from the output so that they don't get included in the library
7209e07dc26bSmrg	    # dependencies.
7210e07dc26bSmrg	    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"'
7211e07dc26bSmrg	    ;;
7212e07dc26bSmrg	  *)
7213e07dc26bSmrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
7214e07dc26bSmrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7215e07dc26bSmrg	      case $host in
7216e07dc26bSmrg	        osf3*)
7217e07dc26bSmrg	          _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'
7218e07dc26bSmrg		  ;;
7219e07dc26bSmrg	        *)
7220e07dc26bSmrg	          _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'
7221e07dc26bSmrg		  ;;
7222e07dc26bSmrg	      esac
7223e07dc26bSmrg
7224e07dc26bSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7225e07dc26bSmrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7226e07dc26bSmrg
7227e07dc26bSmrg	      # Commands to make compiler produce verbose output that lists
7228e07dc26bSmrg	      # what "hidden" libraries, object files and flags are used when
7229e07dc26bSmrg	      # linking a shared library.
7230e07dc26bSmrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7231e07dc26bSmrg
7232e07dc26bSmrg	    else
7233e07dc26bSmrg	      # FIXME: insert proper C++ library support
7234e07dc26bSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
7235e07dc26bSmrg	    fi
7236e07dc26bSmrg	    ;;
7237e07dc26bSmrg        esac
7238e07dc26bSmrg        ;;
7239e07dc26bSmrg
7240e07dc26bSmrg      psos*)
7241e07dc26bSmrg        # FIXME: insert proper C++ library support
7242e07dc26bSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7243e07dc26bSmrg        ;;
7244e07dc26bSmrg
7245e07dc26bSmrg      sunos4*)
7246e07dc26bSmrg        case $cc_basename in
7247e07dc26bSmrg          CC*)
7248e07dc26bSmrg	    # Sun C++ 4.x
7249e07dc26bSmrg	    # FIXME: insert proper C++ library support
7250e07dc26bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7251e07dc26bSmrg	    ;;
7252e07dc26bSmrg          lcc*)
7253e07dc26bSmrg	    # Lucid
7254e07dc26bSmrg	    # FIXME: insert proper C++ library support
7255e07dc26bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7256e07dc26bSmrg	    ;;
7257e07dc26bSmrg          *)
7258e07dc26bSmrg	    # FIXME: insert proper C++ library support
7259e07dc26bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7260e07dc26bSmrg	    ;;
7261e07dc26bSmrg        esac
7262e07dc26bSmrg        ;;
7263e07dc26bSmrg
7264e07dc26bSmrg      solaris*)
7265e07dc26bSmrg        case $cc_basename in
7266e07dc26bSmrg          CC* | sunCC*)
7267e07dc26bSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
7268e07dc26bSmrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
7269e07dc26bSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7270e07dc26bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7271e07dc26bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7272e07dc26bSmrg              $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'
7273e07dc26bSmrg
7274e07dc26bSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7275e07dc26bSmrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7276e07dc26bSmrg	    case $host_os in
7277e07dc26bSmrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7278e07dc26bSmrg	      *)
7279e07dc26bSmrg		# The compiler driver will combine and reorder linker options,
7280e07dc26bSmrg		# but understands '-z linker_flag'.
7281e07dc26bSmrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
7282e07dc26bSmrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
7283e07dc26bSmrg	        ;;
7284e07dc26bSmrg	    esac
7285e07dc26bSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7286e07dc26bSmrg
7287e07dc26bSmrg	    output_verbose_link_cmd='func_echo_all'
7288e07dc26bSmrg
7289e07dc26bSmrg	    # Archives containing C++ object files must be created using
7290e07dc26bSmrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7291e07dc26bSmrg	    # necessary to make sure instantiated templates are included
7292e07dc26bSmrg	    # in the archive.
7293e07dc26bSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7294e07dc26bSmrg	    ;;
7295e07dc26bSmrg          gcx*)
7296e07dc26bSmrg	    # Green Hills C++ Compiler
7297e07dc26bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7298e07dc26bSmrg
7299e07dc26bSmrg	    # The C++ compiler must be used to create the archive.
7300e07dc26bSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
7301e07dc26bSmrg	    ;;
7302e07dc26bSmrg          *)
7303e07dc26bSmrg	    # GNU C++ compiler with Solaris linker
7304e07dc26bSmrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
7305e07dc26bSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
7306e07dc26bSmrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
7307e07dc26bSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7308e07dc26bSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7309e07dc26bSmrg                  $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'
7310e07dc26bSmrg
7311e07dc26bSmrg	        # Commands to make compiler produce verbose output that lists
7312e07dc26bSmrg	        # what "hidden" libraries, object files and flags are used when
7313e07dc26bSmrg	        # linking a shared library.
7314e07dc26bSmrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7315e07dc26bSmrg	      else
7316e07dc26bSmrg	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
7317e07dc26bSmrg	        # platform.
7318e07dc26bSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7319e07dc26bSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7320e07dc26bSmrg                  $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'
7321e07dc26bSmrg
7322e07dc26bSmrg	        # Commands to make compiler produce verbose output that lists
7323e07dc26bSmrg	        # what "hidden" libraries, object files and flags are used when
7324e07dc26bSmrg	        # linking a shared library.
7325e07dc26bSmrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7326e07dc26bSmrg	      fi
7327e07dc26bSmrg
7328e07dc26bSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
7329e07dc26bSmrg	      case $host_os in
7330e07dc26bSmrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7331e07dc26bSmrg		*)
7332e07dc26bSmrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
7333e07dc26bSmrg		  ;;
7334e07dc26bSmrg	      esac
7335e07dc26bSmrg	    fi
7336e07dc26bSmrg	    ;;
7337e07dc26bSmrg        esac
7338e07dc26bSmrg        ;;
7339e07dc26bSmrg
7340e07dc26bSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7341e07dc26bSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7342e07dc26bSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7343e07dc26bSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7344e07dc26bSmrg      runpath_var='LD_RUN_PATH'
7345e07dc26bSmrg
7346e07dc26bSmrg      case $cc_basename in
7347e07dc26bSmrg        CC*)
7348e07dc26bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7349e07dc26bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7350e07dc26bSmrg	  ;;
7351e07dc26bSmrg	*)
7352e07dc26bSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7353e07dc26bSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7354e07dc26bSmrg	  ;;
7355e07dc26bSmrg      esac
7356e07dc26bSmrg      ;;
7357e07dc26bSmrg
7358e07dc26bSmrg      sysv5* | sco3.2v5* | sco5v6*)
7359e07dc26bSmrg	# Note: We CANNOT use -z defs as we might desire, because we do not
7360e07dc26bSmrg	# link with -lc, and that would cause any symbols used from libc to
7361e07dc26bSmrg	# always be unresolved, which means just about no library would
7362e07dc26bSmrg	# ever link correctly.  If we're not using GNU ld we use -z text
7363e07dc26bSmrg	# though, which does catch some bad symbols but isn't as heavy-handed
7364e07dc26bSmrg	# as -z defs.
7365e07dc26bSmrg	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7366e07dc26bSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
7367e07dc26bSmrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7368e07dc26bSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7369e07dc26bSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
7370e07dc26bSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7371e07dc26bSmrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
7372e07dc26bSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
7373e07dc26bSmrg	runpath_var='LD_RUN_PATH'
7374e07dc26bSmrg
7375e07dc26bSmrg	case $cc_basename in
7376e07dc26bSmrg          CC*)
7377e07dc26bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7378e07dc26bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7379e07dc26bSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
7380e07dc26bSmrg              '"$_LT_TAGVAR(old_archive_cmds, $1)"
7381e07dc26bSmrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
7382e07dc26bSmrg              '"$_LT_TAGVAR(reload_cmds, $1)"
7383e07dc26bSmrg	    ;;
7384e07dc26bSmrg	  *)
7385e07dc26bSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7386e07dc26bSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7387e07dc26bSmrg	    ;;
7388e07dc26bSmrg	esac
7389e07dc26bSmrg      ;;
7390e07dc26bSmrg
7391e07dc26bSmrg      tandem*)
7392e07dc26bSmrg        case $cc_basename in
7393e07dc26bSmrg          NCC*)
7394e07dc26bSmrg	    # NonStop-UX NCC 3.20
7395e07dc26bSmrg	    # FIXME: insert proper C++ library support
7396e07dc26bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7397e07dc26bSmrg	    ;;
7398e07dc26bSmrg          *)
7399e07dc26bSmrg	    # FIXME: insert proper C++ library support
7400e07dc26bSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7401e07dc26bSmrg	    ;;
7402e07dc26bSmrg        esac
7403e07dc26bSmrg        ;;
7404e07dc26bSmrg
7405e07dc26bSmrg      vxworks*)
7406e07dc26bSmrg        # FIXME: insert proper C++ library support
7407e07dc26bSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7408e07dc26bSmrg        ;;
7409e07dc26bSmrg
7410e07dc26bSmrg      *)
7411e07dc26bSmrg        # FIXME: insert proper C++ library support
7412e07dc26bSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7413e07dc26bSmrg        ;;
7414e07dc26bSmrg    esac
7415e07dc26bSmrg
7416e07dc26bSmrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7417e07dc26bSmrg    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
7418e07dc26bSmrg
7419e07dc26bSmrg    _LT_TAGVAR(GCC, $1)=$GXX
7420e07dc26bSmrg    _LT_TAGVAR(LD, $1)=$LD
7421e07dc26bSmrg
7422e07dc26bSmrg    ## CAVEAT EMPTOR:
7423e07dc26bSmrg    ## There is no encapsulation within the following macros, do not change
7424e07dc26bSmrg    ## the running order or otherwise move them around unless you know exactly
7425e07dc26bSmrg    ## what you are doing...
7426e07dc26bSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
7427e07dc26bSmrg    _LT_COMPILER_PIC($1)
7428e07dc26bSmrg    _LT_COMPILER_C_O($1)
7429e07dc26bSmrg    _LT_COMPILER_FILE_LOCKS($1)
7430e07dc26bSmrg    _LT_LINKER_SHLIBS($1)
7431e07dc26bSmrg    _LT_SYS_DYNAMIC_LINKER($1)
7432e07dc26bSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7433e07dc26bSmrg
7434e07dc26bSmrg    _LT_CONFIG($1)
7435e07dc26bSmrg  fi # test -n "$compiler"
7436e07dc26bSmrg
7437e07dc26bSmrg  CC=$lt_save_CC
7438e07dc26bSmrg  CFLAGS=$lt_save_CFLAGS
7439e07dc26bSmrg  LDCXX=$LD
7440e07dc26bSmrg  LD=$lt_save_LD
7441e07dc26bSmrg  GCC=$lt_save_GCC
7442e07dc26bSmrg  with_gnu_ld=$lt_save_with_gnu_ld
7443e07dc26bSmrg  lt_cv_path_LDCXX=$lt_cv_path_LD
7444e07dc26bSmrg  lt_cv_path_LD=$lt_save_path_LD
7445e07dc26bSmrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
7446e07dc26bSmrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
7447e07dc26bSmrgfi # test yes != "$_lt_caught_CXX_error"
7448e07dc26bSmrg
7449e07dc26bSmrgAC_LANG_POP
7450e07dc26bSmrg])# _LT_LANG_CXX_CONFIG
7451e07dc26bSmrg
7452e07dc26bSmrg
7453e07dc26bSmrg# _LT_FUNC_STRIPNAME_CNF
7454e07dc26bSmrg# ----------------------
7455e07dc26bSmrg# func_stripname_cnf prefix suffix name
7456e07dc26bSmrg# strip PREFIX and SUFFIX off of NAME.
7457e07dc26bSmrg# PREFIX and SUFFIX must not contain globbing or regex special
7458e07dc26bSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
7459e07dc26bSmrg# dot (in which case that matches only a dot).
7460e07dc26bSmrg#
7461e07dc26bSmrg# This function is identical to the (non-XSI) version of func_stripname,
7462e07dc26bSmrg# except this one can be used by m4 code that may be executed by configure,
7463e07dc26bSmrg# rather than the libtool script.
7464e07dc26bSmrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
7465e07dc26bSmrgAC_REQUIRE([_LT_DECL_SED])
7466e07dc26bSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
7467e07dc26bSmrgfunc_stripname_cnf ()
7468e07dc26bSmrg{
7469e07dc26bSmrg  case @S|@2 in
7470e07dc26bSmrg  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
7471e07dc26bSmrg  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
7472e07dc26bSmrg  esac
7473e07dc26bSmrg} # func_stripname_cnf
7474e07dc26bSmrg])# _LT_FUNC_STRIPNAME_CNF
7475e07dc26bSmrg
7476e07dc26bSmrg
7477e07dc26bSmrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
7478e07dc26bSmrg# ---------------------------------
7479e07dc26bSmrg# Figure out "hidden" library dependencies from verbose
7480e07dc26bSmrg# compiler output when linking a shared library.
7481e07dc26bSmrg# Parse the compiler output and extract the necessary
7482e07dc26bSmrg# objects, libraries and library flags.
7483e07dc26bSmrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
7484e07dc26bSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7485e07dc26bSmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
7486e07dc26bSmrg# Dependencies to place before and after the object being linked:
7487e07dc26bSmrg_LT_TAGVAR(predep_objects, $1)=
7488e07dc26bSmrg_LT_TAGVAR(postdep_objects, $1)=
7489e07dc26bSmrg_LT_TAGVAR(predeps, $1)=
7490e07dc26bSmrg_LT_TAGVAR(postdeps, $1)=
7491e07dc26bSmrg_LT_TAGVAR(compiler_lib_search_path, $1)=
7492e07dc26bSmrg
7493e07dc26bSmrgdnl we can't use the lt_simple_compile_test_code here,
7494e07dc26bSmrgdnl because it contains code intended for an executable,
7495e07dc26bSmrgdnl not a library.  It's possible we should let each
7496e07dc26bSmrgdnl tag define a new lt_????_link_test_code variable,
7497e07dc26bSmrgdnl but it's only used here...
7498e07dc26bSmrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
7499e07dc26bSmrgint a;
7500e07dc26bSmrgvoid foo (void) { a = 0; }
7501e07dc26bSmrg_LT_EOF
7502e07dc26bSmrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
7503e07dc26bSmrgclass Foo
7504e07dc26bSmrg{
7505e07dc26bSmrgpublic:
7506e07dc26bSmrg  Foo (void) { a = 0; }
7507e07dc26bSmrgprivate:
7508e07dc26bSmrg  int a;
7509e07dc26bSmrg};
7510e07dc26bSmrg_LT_EOF
7511e07dc26bSmrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
7512e07dc26bSmrg      subroutine foo
7513e07dc26bSmrg      implicit none
7514e07dc26bSmrg      integer*4 a
7515e07dc26bSmrg      a=0
7516e07dc26bSmrg      return
7517e07dc26bSmrg      end
7518e07dc26bSmrg_LT_EOF
7519e07dc26bSmrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
7520e07dc26bSmrg      subroutine foo
7521e07dc26bSmrg      implicit none
7522e07dc26bSmrg      integer a
7523e07dc26bSmrg      a=0
7524e07dc26bSmrg      return
7525e07dc26bSmrg      end
7526e07dc26bSmrg_LT_EOF
7527e07dc26bSmrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
7528e07dc26bSmrgpublic class foo {
7529e07dc26bSmrg  private int a;
7530e07dc26bSmrg  public void bar (void) {
7531e07dc26bSmrg    a = 0;
7532e07dc26bSmrg  }
7533e07dc26bSmrg};
7534e07dc26bSmrg_LT_EOF
7535e07dc26bSmrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
7536e07dc26bSmrgpackage foo
7537e07dc26bSmrgfunc foo() {
7538e07dc26bSmrg}
7539e07dc26bSmrg_LT_EOF
7540e07dc26bSmrg])
7541e07dc26bSmrg
7542e07dc26bSmrg_lt_libdeps_save_CFLAGS=$CFLAGS
7543e07dc26bSmrgcase "$CC $CFLAGS " in #(
7544e07dc26bSmrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
7545e07dc26bSmrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
7546e07dc26bSmrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
7547e07dc26bSmrgesac
7548e07dc26bSmrg
7549e07dc26bSmrgdnl Parse the compiler output and extract the necessary
7550e07dc26bSmrgdnl objects, libraries and library flags.
7551e07dc26bSmrgif AC_TRY_EVAL(ac_compile); then
7552e07dc26bSmrg  # Parse the compiler output and extract the necessary
7553e07dc26bSmrg  # objects, libraries and library flags.
7554e07dc26bSmrg
7555e07dc26bSmrg  # Sentinel used to keep track of whether or not we are before
7556e07dc26bSmrg  # the conftest object file.
7557e07dc26bSmrg  pre_test_object_deps_done=no
7558e07dc26bSmrg
7559e07dc26bSmrg  for p in `eval "$output_verbose_link_cmd"`; do
7560e07dc26bSmrg    case $prev$p in
7561e07dc26bSmrg
7562e07dc26bSmrg    -L* | -R* | -l*)
7563e07dc26bSmrg       # Some compilers place space between "-{L,R}" and the path.
7564e07dc26bSmrg       # Remove the space.
7565e07dc26bSmrg       if test x-L = "$p" ||
7566e07dc26bSmrg          test x-R = "$p"; then
7567e07dc26bSmrg	 prev=$p
7568e07dc26bSmrg	 continue
7569e07dc26bSmrg       fi
7570e07dc26bSmrg
7571e07dc26bSmrg       # Expand the sysroot to ease extracting the directories later.
7572e07dc26bSmrg       if test -z "$prev"; then
7573e07dc26bSmrg         case $p in
7574e07dc26bSmrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
7575e07dc26bSmrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
7576e07dc26bSmrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
7577e07dc26bSmrg         esac
7578e07dc26bSmrg       fi
7579e07dc26bSmrg       case $p in
7580e07dc26bSmrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
7581e07dc26bSmrg       esac
7582e07dc26bSmrg       if test no = "$pre_test_object_deps_done"; then
7583e07dc26bSmrg	 case $prev in
7584e07dc26bSmrg	 -L | -R)
7585e07dc26bSmrg	   # Internal compiler library paths should come after those
7586e07dc26bSmrg	   # provided the user.  The postdeps already come after the
7587e07dc26bSmrg	   # user supplied libs so there is no need to process them.
7588e07dc26bSmrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
7589e07dc26bSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
7590e07dc26bSmrg	   else
7591e07dc26bSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
7592e07dc26bSmrg	   fi
7593e07dc26bSmrg	   ;;
7594e07dc26bSmrg	 # The "-l" case would never come before the object being
7595e07dc26bSmrg	 # linked, so don't bother handling this case.
7596e07dc26bSmrg	 esac
7597e07dc26bSmrg       else
7598e07dc26bSmrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
7599e07dc26bSmrg	   _LT_TAGVAR(postdeps, $1)=$prev$p
7600e07dc26bSmrg	 else
7601e07dc26bSmrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
7602e07dc26bSmrg	 fi
7603e07dc26bSmrg       fi
7604e07dc26bSmrg       prev=
7605e07dc26bSmrg       ;;
7606e07dc26bSmrg
7607e07dc26bSmrg    *.lto.$objext) ;; # Ignore GCC LTO objects
7608e07dc26bSmrg    *.$objext)
7609e07dc26bSmrg       # This assumes that the test object file only shows up
7610e07dc26bSmrg       # once in the compiler output.
7611e07dc26bSmrg       if test "$p" = "conftest.$objext"; then
7612e07dc26bSmrg	 pre_test_object_deps_done=yes
7613e07dc26bSmrg	 continue
7614e07dc26bSmrg       fi
7615e07dc26bSmrg
7616e07dc26bSmrg       if test no = "$pre_test_object_deps_done"; then
7617e07dc26bSmrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
7618e07dc26bSmrg	   _LT_TAGVAR(predep_objects, $1)=$p
7619e07dc26bSmrg	 else
7620e07dc26bSmrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
7621e07dc26bSmrg	 fi
7622e07dc26bSmrg       else
7623e07dc26bSmrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
7624e07dc26bSmrg	   _LT_TAGVAR(postdep_objects, $1)=$p
7625e07dc26bSmrg	 else
7626e07dc26bSmrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
7627e07dc26bSmrg	 fi
7628e07dc26bSmrg       fi
7629e07dc26bSmrg       ;;
7630e07dc26bSmrg
7631e07dc26bSmrg    *) ;; # Ignore the rest.
7632e07dc26bSmrg
7633e07dc26bSmrg    esac
7634e07dc26bSmrg  done
7635e07dc26bSmrg
7636e07dc26bSmrg  # Clean up.
7637e07dc26bSmrg  rm -f a.out a.exe
7638e07dc26bSmrgelse
7639e07dc26bSmrg  echo "libtool.m4: error: problem compiling $1 test program"
7640e07dc26bSmrgfi
7641e07dc26bSmrg
7642e07dc26bSmrg$RM -f confest.$objext
7643e07dc26bSmrgCFLAGS=$_lt_libdeps_save_CFLAGS
7644e07dc26bSmrg
7645e07dc26bSmrg# PORTME: override above test on systems where it is broken
7646e07dc26bSmrgm4_if([$1], [CXX],
7647e07dc26bSmrg[case $host_os in
7648e07dc26bSmrginterix[[3-9]]*)
7649e07dc26bSmrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
7650e07dc26bSmrg  # hack all around it, let's just trust "g++" to DTRT.
7651e07dc26bSmrg  _LT_TAGVAR(predep_objects,$1)=
7652e07dc26bSmrg  _LT_TAGVAR(postdep_objects,$1)=
7653e07dc26bSmrg  _LT_TAGVAR(postdeps,$1)=
7654e07dc26bSmrg  ;;
7655e07dc26bSmrgesac
7656e07dc26bSmrg])
7657e07dc26bSmrg
7658e07dc26bSmrgcase " $_LT_TAGVAR(postdeps, $1) " in
7659e07dc26bSmrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
7660e07dc26bSmrgesac
7661e07dc26bSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
7662e07dc26bSmrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
7663e07dc26bSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
7664e07dc26bSmrgfi
7665e07dc26bSmrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
7666e07dc26bSmrg    [The directories searched by this compiler when creating a shared library])
7667e07dc26bSmrg_LT_TAGDECL([], [predep_objects], [1],
7668e07dc26bSmrg    [Dependencies to place before and after the objects being linked to
7669e07dc26bSmrg    create a shared library])
7670e07dc26bSmrg_LT_TAGDECL([], [postdep_objects], [1])
7671e07dc26bSmrg_LT_TAGDECL([], [predeps], [1])
7672e07dc26bSmrg_LT_TAGDECL([], [postdeps], [1])
7673e07dc26bSmrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
7674e07dc26bSmrg    [The library search path used internally by the compiler when linking
7675e07dc26bSmrg    a shared library])
7676e07dc26bSmrg])# _LT_SYS_HIDDEN_LIBDEPS
7677e07dc26bSmrg
7678e07dc26bSmrg
7679e07dc26bSmrg# _LT_LANG_F77_CONFIG([TAG])
7680e07dc26bSmrg# --------------------------
7681e07dc26bSmrg# Ensure that the configuration variables for a Fortran 77 compiler are
7682e07dc26bSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7683e07dc26bSmrg# to write the compiler configuration to 'libtool'.
7684e07dc26bSmrgm4_defun([_LT_LANG_F77_CONFIG],
7685e07dc26bSmrg[AC_LANG_PUSH(Fortran 77)
7686e07dc26bSmrgif test -z "$F77" || test no = "$F77"; then
7687e07dc26bSmrg  _lt_disable_F77=yes
7688e07dc26bSmrgfi
7689e07dc26bSmrg
7690e07dc26bSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7691e07dc26bSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
7692e07dc26bSmrg_LT_TAGVAR(always_export_symbols, $1)=no
7693e07dc26bSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
7694e07dc26bSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7695e07dc26bSmrg_LT_TAGVAR(hardcode_direct, $1)=no
7696e07dc26bSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7697e07dc26bSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7698e07dc26bSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
7699e07dc26bSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
7700e07dc26bSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
7701e07dc26bSmrg_LT_TAGVAR(inherit_rpath, $1)=no
7702e07dc26bSmrg_LT_TAGVAR(module_cmds, $1)=
7703e07dc26bSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
7704e07dc26bSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
7705e07dc26bSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7706e07dc26bSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7707e07dc26bSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7708e07dc26bSmrg_LT_TAGVAR(no_undefined_flag, $1)=
7709e07dc26bSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
7710e07dc26bSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7711e07dc26bSmrg
7712e07dc26bSmrg# Source file extension for f77 test sources.
7713e07dc26bSmrgac_ext=f
7714e07dc26bSmrg
7715e07dc26bSmrg# Object file extension for compiled f77 test sources.
7716e07dc26bSmrgobjext=o
7717e07dc26bSmrg_LT_TAGVAR(objext, $1)=$objext
7718e07dc26bSmrg
7719e07dc26bSmrg# No sense in running all these tests if we already determined that
7720e07dc26bSmrg# the F77 compiler isn't working.  Some variables (like enable_shared)
7721e07dc26bSmrg# are currently assumed to apply to all compilers on this platform,
7722e07dc26bSmrg# and will be corrupted by setting them based on a non-working compiler.
7723e07dc26bSmrgif test yes != "$_lt_disable_F77"; then
7724e07dc26bSmrg  # Code to be used in simple compile tests
7725e07dc26bSmrg  lt_simple_compile_test_code="\
7726e07dc26bSmrg      subroutine t
7727e07dc26bSmrg      return
7728e07dc26bSmrg      end
7729e07dc26bSmrg"
7730e07dc26bSmrg
7731e07dc26bSmrg  # Code to be used in simple link tests
7732e07dc26bSmrg  lt_simple_link_test_code="\
7733e07dc26bSmrg      program t
7734e07dc26bSmrg      end
7735e07dc26bSmrg"
7736e07dc26bSmrg
7737e07dc26bSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7738e07dc26bSmrg  _LT_TAG_COMPILER
7739e07dc26bSmrg
7740e07dc26bSmrg  # save warnings/boilerplate of simple test code
7741e07dc26bSmrg  _LT_COMPILER_BOILERPLATE
7742e07dc26bSmrg  _LT_LINKER_BOILERPLATE
7743e07dc26bSmrg
7744e07dc26bSmrg  # Allow CC to be a program name with arguments.
7745e07dc26bSmrg  lt_save_CC=$CC
7746e07dc26bSmrg  lt_save_GCC=$GCC
7747e07dc26bSmrg  lt_save_CFLAGS=$CFLAGS
7748e07dc26bSmrg  CC=${F77-"f77"}
7749e07dc26bSmrg  CFLAGS=$FFLAGS
7750e07dc26bSmrg  compiler=$CC
7751e07dc26bSmrg  _LT_TAGVAR(compiler, $1)=$CC
7752e07dc26bSmrg  _LT_CC_BASENAME([$compiler])
7753e07dc26bSmrg  GCC=$G77
7754e07dc26bSmrg  if test -n "$compiler"; then
7755e07dc26bSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
7756e07dc26bSmrg    AC_MSG_RESULT([$can_build_shared])
7757e07dc26bSmrg
7758e07dc26bSmrg    AC_MSG_CHECKING([whether to build shared libraries])
7759e07dc26bSmrg    test no = "$can_build_shared" && enable_shared=no
7760e07dc26bSmrg
7761e07dc26bSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
7762e07dc26bSmrg    # are all built from PIC.
7763e07dc26bSmrg    case $host_os in
7764e07dc26bSmrg      aix3*)
7765e07dc26bSmrg        test yes = "$enable_shared" && enable_static=no
7766e07dc26bSmrg        if test -n "$RANLIB"; then
7767e07dc26bSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7768e07dc26bSmrg          postinstall_cmds='$RANLIB $lib'
7769e07dc26bSmrg        fi
7770e07dc26bSmrg        ;;
7771e07dc26bSmrg      aix[[4-9]]*)
7772e07dc26bSmrg	if test ia64 != "$host_cpu"; then
7773e07dc26bSmrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7774e07dc26bSmrg	  yes,aix,yes) ;;		# shared object as lib.so file only
7775e07dc26bSmrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
7776e07dc26bSmrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
7777e07dc26bSmrg	  esac
7778e07dc26bSmrg	fi
7779e07dc26bSmrg        ;;
7780e07dc26bSmrg    esac
7781e07dc26bSmrg    AC_MSG_RESULT([$enable_shared])
7782e07dc26bSmrg
7783e07dc26bSmrg    AC_MSG_CHECKING([whether to build static libraries])
7784e07dc26bSmrg    # Make sure either enable_shared or enable_static is yes.
7785e07dc26bSmrg    test yes = "$enable_shared" || enable_static=yes
7786e07dc26bSmrg    AC_MSG_RESULT([$enable_static])
7787e07dc26bSmrg
7788e07dc26bSmrg    _LT_TAGVAR(GCC, $1)=$G77
7789e07dc26bSmrg    _LT_TAGVAR(LD, $1)=$LD
7790e07dc26bSmrg
7791e07dc26bSmrg    ## CAVEAT EMPTOR:
7792e07dc26bSmrg    ## There is no encapsulation within the following macros, do not change
7793e07dc26bSmrg    ## the running order or otherwise move them around unless you know exactly
7794e07dc26bSmrg    ## what you are doing...
7795e07dc26bSmrg    _LT_COMPILER_PIC($1)
7796e07dc26bSmrg    _LT_COMPILER_C_O($1)
7797e07dc26bSmrg    _LT_COMPILER_FILE_LOCKS($1)
7798e07dc26bSmrg    _LT_LINKER_SHLIBS($1)
7799e07dc26bSmrg    _LT_SYS_DYNAMIC_LINKER($1)
7800e07dc26bSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7801e07dc26bSmrg
7802e07dc26bSmrg    _LT_CONFIG($1)
7803e07dc26bSmrg  fi # test -n "$compiler"
7804e07dc26bSmrg
7805e07dc26bSmrg  GCC=$lt_save_GCC
7806e07dc26bSmrg  CC=$lt_save_CC
7807e07dc26bSmrg  CFLAGS=$lt_save_CFLAGS
7808e07dc26bSmrgfi # test yes != "$_lt_disable_F77"
7809e07dc26bSmrg
7810e07dc26bSmrgAC_LANG_POP
7811e07dc26bSmrg])# _LT_LANG_F77_CONFIG
7812e07dc26bSmrg
7813e07dc26bSmrg
7814e07dc26bSmrg# _LT_LANG_FC_CONFIG([TAG])
7815e07dc26bSmrg# -------------------------
7816e07dc26bSmrg# Ensure that the configuration variables for a Fortran compiler are
7817e07dc26bSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7818e07dc26bSmrg# to write the compiler configuration to 'libtool'.
7819e07dc26bSmrgm4_defun([_LT_LANG_FC_CONFIG],
7820e07dc26bSmrg[AC_LANG_PUSH(Fortran)
7821e07dc26bSmrg
7822e07dc26bSmrgif test -z "$FC" || test no = "$FC"; then
7823e07dc26bSmrg  _lt_disable_FC=yes
7824e07dc26bSmrgfi
7825e07dc26bSmrg
7826e07dc26bSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7827e07dc26bSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
7828e07dc26bSmrg_LT_TAGVAR(always_export_symbols, $1)=no
7829e07dc26bSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
7830e07dc26bSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7831e07dc26bSmrg_LT_TAGVAR(hardcode_direct, $1)=no
7832e07dc26bSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7833e07dc26bSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7834e07dc26bSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
7835e07dc26bSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
7836e07dc26bSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
7837e07dc26bSmrg_LT_TAGVAR(inherit_rpath, $1)=no
7838e07dc26bSmrg_LT_TAGVAR(module_cmds, $1)=
7839e07dc26bSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
7840e07dc26bSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
7841e07dc26bSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7842e07dc26bSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7843e07dc26bSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7844e07dc26bSmrg_LT_TAGVAR(no_undefined_flag, $1)=
7845e07dc26bSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
7846e07dc26bSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7847e07dc26bSmrg
7848e07dc26bSmrg# Source file extension for fc test sources.
7849e07dc26bSmrgac_ext=${ac_fc_srcext-f}
7850e07dc26bSmrg
7851e07dc26bSmrg# Object file extension for compiled fc test sources.
7852e07dc26bSmrgobjext=o
7853e07dc26bSmrg_LT_TAGVAR(objext, $1)=$objext
7854e07dc26bSmrg
7855e07dc26bSmrg# No sense in running all these tests if we already determined that
7856e07dc26bSmrg# the FC compiler isn't working.  Some variables (like enable_shared)
7857e07dc26bSmrg# are currently assumed to apply to all compilers on this platform,
7858e07dc26bSmrg# and will be corrupted by setting them based on a non-working compiler.
7859e07dc26bSmrgif test yes != "$_lt_disable_FC"; then
7860e07dc26bSmrg  # Code to be used in simple compile tests
7861e07dc26bSmrg  lt_simple_compile_test_code="\
7862e07dc26bSmrg      subroutine t
7863e07dc26bSmrg      return
7864e07dc26bSmrg      end
7865e07dc26bSmrg"
7866e07dc26bSmrg
7867e07dc26bSmrg  # Code to be used in simple link tests
7868e07dc26bSmrg  lt_simple_link_test_code="\
7869e07dc26bSmrg      program t
7870e07dc26bSmrg      end
7871e07dc26bSmrg"
7872e07dc26bSmrg
7873e07dc26bSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7874e07dc26bSmrg  _LT_TAG_COMPILER
7875e07dc26bSmrg
7876e07dc26bSmrg  # save warnings/boilerplate of simple test code
7877e07dc26bSmrg  _LT_COMPILER_BOILERPLATE
7878e07dc26bSmrg  _LT_LINKER_BOILERPLATE
7879e07dc26bSmrg
7880e07dc26bSmrg  # Allow CC to be a program name with arguments.
7881e07dc26bSmrg  lt_save_CC=$CC
7882e07dc26bSmrg  lt_save_GCC=$GCC
7883e07dc26bSmrg  lt_save_CFLAGS=$CFLAGS
7884e07dc26bSmrg  CC=${FC-"f95"}
7885e07dc26bSmrg  CFLAGS=$FCFLAGS
7886e07dc26bSmrg  compiler=$CC
7887e07dc26bSmrg  GCC=$ac_cv_fc_compiler_gnu
7888e07dc26bSmrg
7889e07dc26bSmrg  _LT_TAGVAR(compiler, $1)=$CC
7890e07dc26bSmrg  _LT_CC_BASENAME([$compiler])
7891e07dc26bSmrg
7892e07dc26bSmrg  if test -n "$compiler"; then
7893e07dc26bSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
7894e07dc26bSmrg    AC_MSG_RESULT([$can_build_shared])
7895e07dc26bSmrg
7896e07dc26bSmrg    AC_MSG_CHECKING([whether to build shared libraries])
7897e07dc26bSmrg    test no = "$can_build_shared" && enable_shared=no
7898e07dc26bSmrg
7899e07dc26bSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
7900e07dc26bSmrg    # are all built from PIC.
7901e07dc26bSmrg    case $host_os in
7902e07dc26bSmrg      aix3*)
7903e07dc26bSmrg        test yes = "$enable_shared" && enable_static=no
7904e07dc26bSmrg        if test -n "$RANLIB"; then
7905e07dc26bSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7906e07dc26bSmrg          postinstall_cmds='$RANLIB $lib'
7907e07dc26bSmrg        fi
7908e07dc26bSmrg        ;;
7909e07dc26bSmrg      aix[[4-9]]*)
7910e07dc26bSmrg	if test ia64 != "$host_cpu"; then
7911e07dc26bSmrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7912e07dc26bSmrg	  yes,aix,yes) ;;		# shared object as lib.so file only
7913e07dc26bSmrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
7914e07dc26bSmrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
7915e07dc26bSmrg	  esac
7916e07dc26bSmrg	fi
7917e07dc26bSmrg        ;;
7918e07dc26bSmrg    esac
7919e07dc26bSmrg    AC_MSG_RESULT([$enable_shared])
7920e07dc26bSmrg
7921e07dc26bSmrg    AC_MSG_CHECKING([whether to build static libraries])
7922e07dc26bSmrg    # Make sure either enable_shared or enable_static is yes.
7923e07dc26bSmrg    test yes = "$enable_shared" || enable_static=yes
7924e07dc26bSmrg    AC_MSG_RESULT([$enable_static])
7925e07dc26bSmrg
7926e07dc26bSmrg    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
7927e07dc26bSmrg    _LT_TAGVAR(LD, $1)=$LD
7928e07dc26bSmrg
7929e07dc26bSmrg    ## CAVEAT EMPTOR:
7930e07dc26bSmrg    ## There is no encapsulation within the following macros, do not change
7931e07dc26bSmrg    ## the running order or otherwise move them around unless you know exactly
7932e07dc26bSmrg    ## what you are doing...
7933e07dc26bSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
7934e07dc26bSmrg    _LT_COMPILER_PIC($1)
7935e07dc26bSmrg    _LT_COMPILER_C_O($1)
7936e07dc26bSmrg    _LT_COMPILER_FILE_LOCKS($1)
7937e07dc26bSmrg    _LT_LINKER_SHLIBS($1)
7938e07dc26bSmrg    _LT_SYS_DYNAMIC_LINKER($1)
7939e07dc26bSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7940e07dc26bSmrg
7941e07dc26bSmrg    _LT_CONFIG($1)
7942e07dc26bSmrg  fi # test -n "$compiler"
7943e07dc26bSmrg
7944e07dc26bSmrg  GCC=$lt_save_GCC
7945e07dc26bSmrg  CC=$lt_save_CC
7946e07dc26bSmrg  CFLAGS=$lt_save_CFLAGS
7947e07dc26bSmrgfi # test yes != "$_lt_disable_FC"
7948e07dc26bSmrg
7949e07dc26bSmrgAC_LANG_POP
7950e07dc26bSmrg])# _LT_LANG_FC_CONFIG
7951e07dc26bSmrg
7952e07dc26bSmrg
7953e07dc26bSmrg# _LT_LANG_GCJ_CONFIG([TAG])
7954e07dc26bSmrg# --------------------------
7955e07dc26bSmrg# Ensure that the configuration variables for the GNU Java Compiler compiler
7956e07dc26bSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7957e07dc26bSmrg# to write the compiler configuration to 'libtool'.
7958e07dc26bSmrgm4_defun([_LT_LANG_GCJ_CONFIG],
7959e07dc26bSmrg[AC_REQUIRE([LT_PROG_GCJ])dnl
7960e07dc26bSmrgAC_LANG_SAVE
7961e07dc26bSmrg
7962e07dc26bSmrg# Source file extension for Java test sources.
7963e07dc26bSmrgac_ext=java
7964e07dc26bSmrg
7965e07dc26bSmrg# Object file extension for compiled Java test sources.
7966e07dc26bSmrgobjext=o
7967e07dc26bSmrg_LT_TAGVAR(objext, $1)=$objext
7968e07dc26bSmrg
7969e07dc26bSmrg# Code to be used in simple compile tests
7970e07dc26bSmrglt_simple_compile_test_code="class foo {}"
7971e07dc26bSmrg
7972e07dc26bSmrg# Code to be used in simple link tests
7973e07dc26bSmrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
7974e07dc26bSmrg
7975e07dc26bSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7976e07dc26bSmrg_LT_TAG_COMPILER
7977e07dc26bSmrg
7978e07dc26bSmrg# save warnings/boilerplate of simple test code
7979e07dc26bSmrg_LT_COMPILER_BOILERPLATE
7980e07dc26bSmrg_LT_LINKER_BOILERPLATE
7981e07dc26bSmrg
7982e07dc26bSmrg# Allow CC to be a program name with arguments.
7983e07dc26bSmrglt_save_CC=$CC
7984e07dc26bSmrglt_save_CFLAGS=$CFLAGS
7985e07dc26bSmrglt_save_GCC=$GCC
7986e07dc26bSmrgGCC=yes
7987e07dc26bSmrgCC=${GCJ-"gcj"}
7988e07dc26bSmrgCFLAGS=$GCJFLAGS
7989e07dc26bSmrgcompiler=$CC
7990e07dc26bSmrg_LT_TAGVAR(compiler, $1)=$CC
7991e07dc26bSmrg_LT_TAGVAR(LD, $1)=$LD
7992e07dc26bSmrg_LT_CC_BASENAME([$compiler])
7993e07dc26bSmrg
7994e07dc26bSmrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
7995e07dc26bSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7996e07dc26bSmrg
7997e07dc26bSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7998e07dc26bSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7999e07dc26bSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8000e07dc26bSmrg
8001e07dc26bSmrgif test -n "$compiler"; then
8002e07dc26bSmrg  _LT_COMPILER_NO_RTTI($1)
8003e07dc26bSmrg  _LT_COMPILER_PIC($1)
8004e07dc26bSmrg  _LT_COMPILER_C_O($1)
8005e07dc26bSmrg  _LT_COMPILER_FILE_LOCKS($1)
8006e07dc26bSmrg  _LT_LINKER_SHLIBS($1)
8007e07dc26bSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8008e07dc26bSmrg
8009e07dc26bSmrg  _LT_CONFIG($1)
8010e07dc26bSmrgfi
8011e07dc26bSmrg
8012e07dc26bSmrgAC_LANG_RESTORE
8013e07dc26bSmrg
8014e07dc26bSmrgGCC=$lt_save_GCC
8015e07dc26bSmrgCC=$lt_save_CC
8016e07dc26bSmrgCFLAGS=$lt_save_CFLAGS
8017e07dc26bSmrg])# _LT_LANG_GCJ_CONFIG
8018e07dc26bSmrg
8019e07dc26bSmrg
8020e07dc26bSmrg# _LT_LANG_GO_CONFIG([TAG])
8021e07dc26bSmrg# --------------------------
8022e07dc26bSmrg# Ensure that the configuration variables for the GNU Go compiler
8023e07dc26bSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8024e07dc26bSmrg# to write the compiler configuration to 'libtool'.
8025e07dc26bSmrgm4_defun([_LT_LANG_GO_CONFIG],
8026e07dc26bSmrg[AC_REQUIRE([LT_PROG_GO])dnl
8027e07dc26bSmrgAC_LANG_SAVE
8028e07dc26bSmrg
8029e07dc26bSmrg# Source file extension for Go test sources.
8030e07dc26bSmrgac_ext=go
8031e07dc26bSmrg
8032e07dc26bSmrg# Object file extension for compiled Go test sources.
8033e07dc26bSmrgobjext=o
8034e07dc26bSmrg_LT_TAGVAR(objext, $1)=$objext
8035e07dc26bSmrg
8036e07dc26bSmrg# Code to be used in simple compile tests
8037e07dc26bSmrglt_simple_compile_test_code="package main; func main() { }"
8038e07dc26bSmrg
8039e07dc26bSmrg# Code to be used in simple link tests
8040e07dc26bSmrglt_simple_link_test_code='package main; func main() { }'
8041e07dc26bSmrg
8042e07dc26bSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8043e07dc26bSmrg_LT_TAG_COMPILER
8044e07dc26bSmrg
8045e07dc26bSmrg# save warnings/boilerplate of simple test code
8046e07dc26bSmrg_LT_COMPILER_BOILERPLATE
8047e07dc26bSmrg_LT_LINKER_BOILERPLATE
8048e07dc26bSmrg
8049e07dc26bSmrg# Allow CC to be a program name with arguments.
8050e07dc26bSmrglt_save_CC=$CC
8051e07dc26bSmrglt_save_CFLAGS=$CFLAGS
8052e07dc26bSmrglt_save_GCC=$GCC
8053e07dc26bSmrgGCC=yes
8054e07dc26bSmrgCC=${GOC-"gccgo"}
8055e07dc26bSmrgCFLAGS=$GOFLAGS
8056e07dc26bSmrgcompiler=$CC
8057e07dc26bSmrg_LT_TAGVAR(compiler, $1)=$CC
8058e07dc26bSmrg_LT_TAGVAR(LD, $1)=$LD
8059e07dc26bSmrg_LT_CC_BASENAME([$compiler])
8060e07dc26bSmrg
8061e07dc26bSmrg# Go did not exist at the time GCC didn't implicitly link libc in.
8062e07dc26bSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8063e07dc26bSmrg
8064e07dc26bSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8065e07dc26bSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
8066e07dc26bSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8067e07dc26bSmrg
8068e07dc26bSmrgif test -n "$compiler"; then
8069e07dc26bSmrg  _LT_COMPILER_NO_RTTI($1)
8070e07dc26bSmrg  _LT_COMPILER_PIC($1)
8071e07dc26bSmrg  _LT_COMPILER_C_O($1)
8072e07dc26bSmrg  _LT_COMPILER_FILE_LOCKS($1)
8073e07dc26bSmrg  _LT_LINKER_SHLIBS($1)
8074e07dc26bSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8075e07dc26bSmrg
8076e07dc26bSmrg  _LT_CONFIG($1)
8077e07dc26bSmrgfi
8078e07dc26bSmrg
8079e07dc26bSmrgAC_LANG_RESTORE
8080e07dc26bSmrg
8081e07dc26bSmrgGCC=$lt_save_GCC
8082e07dc26bSmrgCC=$lt_save_CC
8083e07dc26bSmrgCFLAGS=$lt_save_CFLAGS
8084e07dc26bSmrg])# _LT_LANG_GO_CONFIG
8085e07dc26bSmrg
8086e07dc26bSmrg
8087e07dc26bSmrg# _LT_LANG_RC_CONFIG([TAG])
8088e07dc26bSmrg# -------------------------
8089e07dc26bSmrg# Ensure that the configuration variables for the Windows resource compiler
8090e07dc26bSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8091e07dc26bSmrg# to write the compiler configuration to 'libtool'.
8092e07dc26bSmrgm4_defun([_LT_LANG_RC_CONFIG],
8093e07dc26bSmrg[AC_REQUIRE([LT_PROG_RC])dnl
8094e07dc26bSmrgAC_LANG_SAVE
8095e07dc26bSmrg
8096e07dc26bSmrg# Source file extension for RC test sources.
8097e07dc26bSmrgac_ext=rc
8098e07dc26bSmrg
8099e07dc26bSmrg# Object file extension for compiled RC test sources.
8100e07dc26bSmrgobjext=o
8101e07dc26bSmrg_LT_TAGVAR(objext, $1)=$objext
8102e07dc26bSmrg
8103e07dc26bSmrg# Code to be used in simple compile tests
8104e07dc26bSmrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8105e07dc26bSmrg
8106e07dc26bSmrg# Code to be used in simple link tests
8107e07dc26bSmrglt_simple_link_test_code=$lt_simple_compile_test_code
8108e07dc26bSmrg
8109e07dc26bSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8110e07dc26bSmrg_LT_TAG_COMPILER
8111e07dc26bSmrg
8112e07dc26bSmrg# save warnings/boilerplate of simple test code
8113e07dc26bSmrg_LT_COMPILER_BOILERPLATE
8114e07dc26bSmrg_LT_LINKER_BOILERPLATE
8115e07dc26bSmrg
8116e07dc26bSmrg# Allow CC to be a program name with arguments.
8117e07dc26bSmrglt_save_CC=$CC
8118e07dc26bSmrglt_save_CFLAGS=$CFLAGS
8119e07dc26bSmrglt_save_GCC=$GCC
8120e07dc26bSmrgGCC=
8121e07dc26bSmrgCC=${RC-"windres"}
8122e07dc26bSmrgCFLAGS=
8123e07dc26bSmrgcompiler=$CC
8124e07dc26bSmrg_LT_TAGVAR(compiler, $1)=$CC
8125e07dc26bSmrg_LT_CC_BASENAME([$compiler])
8126e07dc26bSmrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8127e07dc26bSmrg
8128e07dc26bSmrgif test -n "$compiler"; then
8129e07dc26bSmrg  :
8130e07dc26bSmrg  _LT_CONFIG($1)
8131e07dc26bSmrgfi
8132e07dc26bSmrg
8133e07dc26bSmrgGCC=$lt_save_GCC
8134e07dc26bSmrgAC_LANG_RESTORE
8135e07dc26bSmrgCC=$lt_save_CC
8136e07dc26bSmrgCFLAGS=$lt_save_CFLAGS
8137e07dc26bSmrg])# _LT_LANG_RC_CONFIG
8138e07dc26bSmrg
8139e07dc26bSmrg
8140e07dc26bSmrg# LT_PROG_GCJ
8141e07dc26bSmrg# -----------
8142e07dc26bSmrgAC_DEFUN([LT_PROG_GCJ],
8143e07dc26bSmrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
8144e07dc26bSmrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
8145e07dc26bSmrg    [AC_CHECK_TOOL(GCJ, gcj,)
8146e07dc26bSmrg      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
8147e07dc26bSmrg      AC_SUBST(GCJFLAGS)])])[]dnl
8148e07dc26bSmrg])
8149e07dc26bSmrg
8150e07dc26bSmrg# Old name:
8151e07dc26bSmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
8152e07dc26bSmrgdnl aclocal-1.4 backwards compatibility:
8153e07dc26bSmrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8154e07dc26bSmrg
8155e07dc26bSmrg
8156e07dc26bSmrg# LT_PROG_GO
8157e07dc26bSmrg# ----------
8158e07dc26bSmrgAC_DEFUN([LT_PROG_GO],
8159e07dc26bSmrg[AC_CHECK_TOOL(GOC, gccgo,)
8160e07dc26bSmrg])
8161e07dc26bSmrg
8162e07dc26bSmrg
8163e07dc26bSmrg# LT_PROG_RC
8164e07dc26bSmrg# ----------
8165e07dc26bSmrgAC_DEFUN([LT_PROG_RC],
8166e07dc26bSmrg[AC_CHECK_TOOL(RC, windres,)
8167e07dc26bSmrg])
8168e07dc26bSmrg
8169e07dc26bSmrg# Old name:
8170e07dc26bSmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
8171e07dc26bSmrgdnl aclocal-1.4 backwards compatibility:
8172e07dc26bSmrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
8173e07dc26bSmrg
8174e07dc26bSmrg
8175e07dc26bSmrg# _LT_DECL_EGREP
8176e07dc26bSmrg# --------------
8177e07dc26bSmrg# If we don't have a new enough Autoconf to choose the best grep
8178e07dc26bSmrg# available, choose the one first in the user's PATH.
8179e07dc26bSmrgm4_defun([_LT_DECL_EGREP],
8180e07dc26bSmrg[AC_REQUIRE([AC_PROG_EGREP])dnl
8181e07dc26bSmrgAC_REQUIRE([AC_PROG_FGREP])dnl
8182e07dc26bSmrgtest -z "$GREP" && GREP=grep
8183e07dc26bSmrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
8184e07dc26bSmrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
8185e07dc26bSmrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
8186e07dc26bSmrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
8187e07dc26bSmrgAC_SUBST([GREP])
8188e07dc26bSmrg])
8189e07dc26bSmrg
8190e07dc26bSmrg
8191e07dc26bSmrg# _LT_DECL_OBJDUMP
8192e07dc26bSmrg# --------------
8193e07dc26bSmrg# If we don't have a new enough Autoconf to choose the best objdump
8194e07dc26bSmrg# available, choose the one first in the user's PATH.
8195e07dc26bSmrgm4_defun([_LT_DECL_OBJDUMP],
8196e07dc26bSmrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
8197e07dc26bSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
8198e07dc26bSmrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
8199e07dc26bSmrgAC_SUBST([OBJDUMP])
8200e07dc26bSmrg])
8201e07dc26bSmrg
8202e07dc26bSmrg# _LT_DECL_DLLTOOL
8203e07dc26bSmrg# ----------------
8204e07dc26bSmrg# Ensure DLLTOOL variable is set.
8205e07dc26bSmrgm4_defun([_LT_DECL_DLLTOOL],
8206e07dc26bSmrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8207e07dc26bSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
8208e07dc26bSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
8209e07dc26bSmrgAC_SUBST([DLLTOOL])
8210e07dc26bSmrg])
8211e07dc26bSmrg
8212e07dc26bSmrg# _LT_DECL_SED
8213e07dc26bSmrg# ------------
8214e07dc26bSmrg# Check for a fully-functional sed program, that truncates
8215e07dc26bSmrg# as few characters as possible.  Prefer GNU sed if found.
8216e07dc26bSmrgm4_defun([_LT_DECL_SED],
8217e07dc26bSmrg[AC_PROG_SED
8218e07dc26bSmrgtest -z "$SED" && SED=sed
8219e07dc26bSmrgXsed="$SED -e 1s/^X//"
8220e07dc26bSmrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
8221e07dc26bSmrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
8222e07dc26bSmrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
8223e07dc26bSmrg])# _LT_DECL_SED
8224e07dc26bSmrg
8225e07dc26bSmrgm4_ifndef([AC_PROG_SED], [
8226e07dc26bSmrg# NOTE: This macro has been submitted for inclusion into   #
8227e07dc26bSmrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
8228e07dc26bSmrg#  a released version of Autoconf we should remove this    #
8229e07dc26bSmrg#  macro and use it instead.                               #
8230e07dc26bSmrg
8231e07dc26bSmrgm4_defun([AC_PROG_SED],
8232e07dc26bSmrg[AC_MSG_CHECKING([for a sed that does not truncate output])
8233e07dc26bSmrgAC_CACHE_VAL(lt_cv_path_SED,
8234e07dc26bSmrg[# Loop through the user's path and test for sed and gsed.
8235e07dc26bSmrg# Then use that list of sed's as ones to test for truncation.
8236e07dc26bSmrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8237e07dc26bSmrgfor as_dir in $PATH
8238e07dc26bSmrgdo
8239e07dc26bSmrg  IFS=$as_save_IFS
8240e07dc26bSmrg  test -z "$as_dir" && as_dir=.
8241e07dc26bSmrg  for lt_ac_prog in sed gsed; do
8242e07dc26bSmrg    for ac_exec_ext in '' $ac_executable_extensions; do
8243e07dc26bSmrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8244e07dc26bSmrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
8245e07dc26bSmrg      fi
8246e07dc26bSmrg    done
8247e07dc26bSmrg  done
8248e07dc26bSmrgdone
8249e07dc26bSmrgIFS=$as_save_IFS
8250e07dc26bSmrglt_ac_max=0
8251e07dc26bSmrglt_ac_count=0
8252e07dc26bSmrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
8253e07dc26bSmrg# along with /bin/sed that truncates output.
8254e07dc26bSmrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8255e07dc26bSmrg  test ! -f "$lt_ac_sed" && continue
8256e07dc26bSmrg  cat /dev/null > conftest.in
8257e07dc26bSmrg  lt_ac_count=0
8258e07dc26bSmrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8259e07dc26bSmrg  # Check for GNU sed and select it if it is found.
8260e07dc26bSmrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8261e07dc26bSmrg    lt_cv_path_SED=$lt_ac_sed
8262e07dc26bSmrg    break
8263e07dc26bSmrg  fi
8264e07dc26bSmrg  while true; do
8265e07dc26bSmrg    cat conftest.in conftest.in >conftest.tmp
8266e07dc26bSmrg    mv conftest.tmp conftest.in
8267e07dc26bSmrg    cp conftest.in conftest.nl
8268e07dc26bSmrg    echo >>conftest.nl
8269e07dc26bSmrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8270e07dc26bSmrg    cmp -s conftest.out conftest.nl || break
8271e07dc26bSmrg    # 10000 chars as input seems more than enough
8272e07dc26bSmrg    test 10 -lt "$lt_ac_count" && break
8273e07dc26bSmrg    lt_ac_count=`expr $lt_ac_count + 1`
8274e07dc26bSmrg    if test "$lt_ac_count" -gt "$lt_ac_max"; then
8275e07dc26bSmrg      lt_ac_max=$lt_ac_count
8276e07dc26bSmrg      lt_cv_path_SED=$lt_ac_sed
8277e07dc26bSmrg    fi
8278e07dc26bSmrg  done
8279e07dc26bSmrgdone
8280e07dc26bSmrg])
8281e07dc26bSmrgSED=$lt_cv_path_SED
8282e07dc26bSmrgAC_SUBST([SED])
8283e07dc26bSmrgAC_MSG_RESULT([$SED])
8284e07dc26bSmrg])#AC_PROG_SED
8285e07dc26bSmrg])#m4_ifndef
8286e07dc26bSmrg
8287e07dc26bSmrg# Old name:
8288e07dc26bSmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
8289e07dc26bSmrgdnl aclocal-1.4 backwards compatibility:
8290e07dc26bSmrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
8291e07dc26bSmrg
8292e07dc26bSmrg
8293e07dc26bSmrg# _LT_CHECK_SHELL_FEATURES
8294e07dc26bSmrg# ------------------------
8295e07dc26bSmrg# Find out whether the shell is Bourne or XSI compatible,
8296e07dc26bSmrg# or has some other useful features.
8297e07dc26bSmrgm4_defun([_LT_CHECK_SHELL_FEATURES],
8298e07dc26bSmrg[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8299e07dc26bSmrg  lt_unset=unset
8300e07dc26bSmrgelse
8301e07dc26bSmrg  lt_unset=false
8302e07dc26bSmrgfi
8303e07dc26bSmrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8304e07dc26bSmrg
8305e07dc26bSmrg# test EBCDIC or ASCII
8306e07dc26bSmrgcase `echo X|tr X '\101'` in
8307e07dc26bSmrg A) # ASCII based system
8308e07dc26bSmrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8309e07dc26bSmrg  lt_SP2NL='tr \040 \012'
8310e07dc26bSmrg  lt_NL2SP='tr \015\012 \040\040'
8311e07dc26bSmrg  ;;
8312e07dc26bSmrg *) # EBCDIC based system
8313e07dc26bSmrg  lt_SP2NL='tr \100 \n'
8314e07dc26bSmrg  lt_NL2SP='tr \r\n \100\100'
8315e07dc26bSmrg  ;;
8316e07dc26bSmrgesac
8317e07dc26bSmrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8318e07dc26bSmrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8319e07dc26bSmrg])# _LT_CHECK_SHELL_FEATURES
8320e07dc26bSmrg
8321e07dc26bSmrg
8322e07dc26bSmrg# _LT_PATH_CONVERSION_FUNCTIONS
8323e07dc26bSmrg# -----------------------------
8324e07dc26bSmrg# Determine what file name conversion functions should be used by
8325e07dc26bSmrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
8326e07dc26bSmrg# for certain cross-compile configurations and native mingw.
8327e07dc26bSmrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
8328e07dc26bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8329e07dc26bSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
8330e07dc26bSmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
8331e07dc26bSmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
8332e07dc26bSmrg[case $host in
8333e07dc26bSmrg  *-*-mingw* )
8334e07dc26bSmrg    case $build in
8335e07dc26bSmrg      *-*-mingw* ) # actually msys
8336e07dc26bSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
8337e07dc26bSmrg        ;;
8338e07dc26bSmrg      *-*-cygwin* )
8339e07dc26bSmrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
8340e07dc26bSmrg        ;;
8341e07dc26bSmrg      * ) # otherwise, assume *nix
8342e07dc26bSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
8343e07dc26bSmrg        ;;
8344e07dc26bSmrg    esac
8345e07dc26bSmrg    ;;
8346e07dc26bSmrg  *-*-cygwin* )
8347e07dc26bSmrg    case $build in
8348e07dc26bSmrg      *-*-mingw* ) # actually msys
8349e07dc26bSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
8350e07dc26bSmrg        ;;
8351e07dc26bSmrg      *-*-cygwin* )
8352e07dc26bSmrg        lt_cv_to_host_file_cmd=func_convert_file_noop
8353e07dc26bSmrg        ;;
8354e07dc26bSmrg      * ) # otherwise, assume *nix
8355e07dc26bSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
8356e07dc26bSmrg        ;;
8357e07dc26bSmrg    esac
8358e07dc26bSmrg    ;;
8359e07dc26bSmrg  * ) # unhandled hosts (and "normal" native builds)
8360e07dc26bSmrg    lt_cv_to_host_file_cmd=func_convert_file_noop
8361e07dc26bSmrg    ;;
8362e07dc26bSmrgesac
8363e07dc26bSmrg])
8364e07dc26bSmrgto_host_file_cmd=$lt_cv_to_host_file_cmd
8365e07dc26bSmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
8366e07dc26bSmrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
8367e07dc26bSmrg         [0], [convert $build file names to $host format])dnl
8368e07dc26bSmrg
8369e07dc26bSmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
8370e07dc26bSmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
8371e07dc26bSmrg[#assume ordinary cross tools, or native build.
8372e07dc26bSmrglt_cv_to_tool_file_cmd=func_convert_file_noop
8373e07dc26bSmrgcase $host in
8374e07dc26bSmrg  *-*-mingw* )
8375e07dc26bSmrg    case $build in
8376e07dc26bSmrg      *-*-mingw* ) # actually msys
8377e07dc26bSmrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
8378e07dc26bSmrg        ;;
8379e07dc26bSmrg    esac
8380e07dc26bSmrg    ;;
8381e07dc26bSmrgesac
8382e07dc26bSmrg])
8383e07dc26bSmrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
8384e07dc26bSmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
8385e07dc26bSmrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
8386e07dc26bSmrg         [0], [convert $build files to toolchain format])dnl
8387e07dc26bSmrg])# _LT_PATH_CONVERSION_FUNCTIONS
8388e07dc26bSmrg
8389e07dc26bSmrg# Helper functions for option handling.                    -*- Autoconf -*-
8390e07dc26bSmrg#
8391e07dc26bSmrg#   Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
8392e07dc26bSmrg#   Foundation, Inc.
8393e07dc26bSmrg#   Written by Gary V. Vaughan, 2004
8394e07dc26bSmrg#
8395e07dc26bSmrg# This file is free software; the Free Software Foundation gives
8396e07dc26bSmrg# unlimited permission to copy and/or distribute it, with or without
8397e07dc26bSmrg# modifications, as long as this notice is preserved.
8398e07dc26bSmrg
8399e07dc26bSmrg# serial 8 ltoptions.m4
8400e07dc26bSmrg
8401e07dc26bSmrg# This is to help aclocal find these macros, as it can't see m4_define.
8402e07dc26bSmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
8403e07dc26bSmrg
8404e07dc26bSmrg
8405e07dc26bSmrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
8406e07dc26bSmrg# ------------------------------------------
8407e07dc26bSmrgm4_define([_LT_MANGLE_OPTION],
8408e07dc26bSmrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
8409e07dc26bSmrg
8410e07dc26bSmrg
8411e07dc26bSmrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
8412e07dc26bSmrg# ---------------------------------------
8413e07dc26bSmrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
8414e07dc26bSmrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
8415e07dc26bSmrg# saved as a flag.
8416e07dc26bSmrgm4_define([_LT_SET_OPTION],
8417e07dc26bSmrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
8418e07dc26bSmrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
8419e07dc26bSmrg        _LT_MANGLE_DEFUN([$1], [$2]),
8420e07dc26bSmrg    [m4_warning([Unknown $1 option '$2'])])[]dnl
8421e07dc26bSmrg])
8422e07dc26bSmrg
8423e07dc26bSmrg
8424e07dc26bSmrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
8425e07dc26bSmrg# ------------------------------------------------------------
8426e07dc26bSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
8427e07dc26bSmrgm4_define([_LT_IF_OPTION],
8428e07dc26bSmrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
8429e07dc26bSmrg
8430e07dc26bSmrg
8431e07dc26bSmrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
8432e07dc26bSmrg# -------------------------------------------------------
8433e07dc26bSmrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
8434e07dc26bSmrg# are set.
8435e07dc26bSmrgm4_define([_LT_UNLESS_OPTIONS],
8436e07dc26bSmrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8437e07dc26bSmrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
8438e07dc26bSmrg		      [m4_define([$0_found])])])[]dnl
8439e07dc26bSmrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
8440e07dc26bSmrg])[]dnl
8441e07dc26bSmrg])
8442e07dc26bSmrg
8443e07dc26bSmrg
8444e07dc26bSmrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
8445e07dc26bSmrg# ----------------------------------------
8446e07dc26bSmrg# OPTION-LIST is a space-separated list of Libtool options associated
8447e07dc26bSmrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
8448e07dc26bSmrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
8449e07dc26bSmrg# the unknown option and exit.
8450e07dc26bSmrgm4_defun([_LT_SET_OPTIONS],
8451e07dc26bSmrg[# Set options
8452e07dc26bSmrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8453e07dc26bSmrg    [_LT_SET_OPTION([$1], _LT_Option)])
8454e07dc26bSmrg
8455e07dc26bSmrgm4_if([$1],[LT_INIT],[
8456e07dc26bSmrg  dnl
8457e07dc26bSmrg  dnl Simply set some default values (i.e off) if boolean options were not
8458e07dc26bSmrg  dnl specified:
8459e07dc26bSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
8460e07dc26bSmrg  ])
8461e07dc26bSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
8462e07dc26bSmrg  ])
8463e07dc26bSmrg  dnl
8464e07dc26bSmrg  dnl If no reference was made to various pairs of opposing options, then
8465e07dc26bSmrg  dnl we run the default mode handler for the pair.  For example, if neither
8466e07dc26bSmrg  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
8467e07dc26bSmrg  dnl archives by default:
8468e07dc26bSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
8469e07dc26bSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
8470e07dc26bSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
8471e07dc26bSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
8472e07dc26bSmrg		   [_LT_ENABLE_FAST_INSTALL])
8473e07dc26bSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
8474e07dc26bSmrg		   [_LT_WITH_AIX_SONAME([aix])])
8475e07dc26bSmrg  ])
8476e07dc26bSmrg])# _LT_SET_OPTIONS
8477e07dc26bSmrg
8478e07dc26bSmrg
8479e07dc26bSmrg
8480e07dc26bSmrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
8481e07dc26bSmrg# -----------------------------------------
8482e07dc26bSmrgm4_define([_LT_MANGLE_DEFUN],
8483e07dc26bSmrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
8484e07dc26bSmrg
8485e07dc26bSmrg
8486e07dc26bSmrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
8487e07dc26bSmrg# -----------------------------------------------
8488e07dc26bSmrgm4_define([LT_OPTION_DEFINE],
8489e07dc26bSmrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
8490e07dc26bSmrg])# LT_OPTION_DEFINE
8491e07dc26bSmrg
8492e07dc26bSmrg
8493e07dc26bSmrg# dlopen
8494e07dc26bSmrg# ------
8495e07dc26bSmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
8496e07dc26bSmrg])
8497e07dc26bSmrg
8498e07dc26bSmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
8499e07dc26bSmrg[_LT_SET_OPTION([LT_INIT], [dlopen])
8500e07dc26bSmrgAC_DIAGNOSE([obsolete],
8501e07dc26bSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8502e07dc26bSmrgput the 'dlopen' option into LT_INIT's first parameter.])
8503e07dc26bSmrg])
8504e07dc26bSmrg
8505e07dc26bSmrgdnl aclocal-1.4 backwards compatibility:
8506e07dc26bSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
8507e07dc26bSmrg
8508e07dc26bSmrg
8509e07dc26bSmrg# win32-dll
8510e07dc26bSmrg# ---------
8511e07dc26bSmrg# Declare package support for building win32 dll's.
8512e07dc26bSmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
8513e07dc26bSmrg[enable_win32_dll=yes
8514e07dc26bSmrg
8515e07dc26bSmrgcase $host in
8516e07dc26bSmrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
8517e07dc26bSmrg  AC_CHECK_TOOL(AS, as, false)
8518e07dc26bSmrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8519e07dc26bSmrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
8520e07dc26bSmrg  ;;
8521e07dc26bSmrgesac
8522e07dc26bSmrg
8523e07dc26bSmrgtest -z "$AS" && AS=as
8524e07dc26bSmrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
8525e07dc26bSmrg
8526e07dc26bSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
8527e07dc26bSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
8528e07dc26bSmrg
8529e07dc26bSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
8530e07dc26bSmrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
8531e07dc26bSmrg])# win32-dll
8532e07dc26bSmrg
8533e07dc26bSmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
8534e07dc26bSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8535e07dc26bSmrg_LT_SET_OPTION([LT_INIT], [win32-dll])
8536e07dc26bSmrgAC_DIAGNOSE([obsolete],
8537e07dc26bSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8538e07dc26bSmrgput the 'win32-dll' option into LT_INIT's first parameter.])
8539e07dc26bSmrg])
8540e07dc26bSmrg
8541e07dc26bSmrgdnl aclocal-1.4 backwards compatibility:
8542e07dc26bSmrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
8543e07dc26bSmrg
8544e07dc26bSmrg
8545e07dc26bSmrg# _LT_ENABLE_SHARED([DEFAULT])
8546e07dc26bSmrg# ----------------------------
8547e07dc26bSmrg# implement the --enable-shared flag, and supports the 'shared' and
8548e07dc26bSmrg# 'disable-shared' LT_INIT options.
8549e07dc26bSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
8550e07dc26bSmrgm4_define([_LT_ENABLE_SHARED],
8551e07dc26bSmrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
8552e07dc26bSmrgAC_ARG_ENABLE([shared],
8553e07dc26bSmrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
8554e07dc26bSmrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
8555e07dc26bSmrg    [p=${PACKAGE-default}
8556e07dc26bSmrg    case $enableval in
8557e07dc26bSmrg    yes) enable_shared=yes ;;
8558e07dc26bSmrg    no) enable_shared=no ;;
8559e07dc26bSmrg    *)
8560e07dc26bSmrg      enable_shared=no
8561e07dc26bSmrg      # Look at the argument we got.  We use all the common list separators.
8562e07dc26bSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8563e07dc26bSmrg      for pkg in $enableval; do
8564e07dc26bSmrg	IFS=$lt_save_ifs
8565e07dc26bSmrg	if test "X$pkg" = "X$p"; then
8566e07dc26bSmrg	  enable_shared=yes
8567e07dc26bSmrg	fi
8568e07dc26bSmrg      done
8569e07dc26bSmrg      IFS=$lt_save_ifs
8570e07dc26bSmrg      ;;
8571e07dc26bSmrg    esac],
8572e07dc26bSmrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
8573e07dc26bSmrg
8574e07dc26bSmrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
8575e07dc26bSmrg	[Whether or not to build shared libraries])
8576e07dc26bSmrg])# _LT_ENABLE_SHARED
8577e07dc26bSmrg
8578e07dc26bSmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
8579e07dc26bSmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
8580e07dc26bSmrg
8581e07dc26bSmrg# Old names:
8582e07dc26bSmrgAC_DEFUN([AC_ENABLE_SHARED],
8583e07dc26bSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
8584e07dc26bSmrg])
8585e07dc26bSmrg
8586e07dc26bSmrgAC_DEFUN([AC_DISABLE_SHARED],
8587e07dc26bSmrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
8588e07dc26bSmrg])
8589e07dc26bSmrg
8590e07dc26bSmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
8591e07dc26bSmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
8592e07dc26bSmrg
8593e07dc26bSmrgdnl aclocal-1.4 backwards compatibility:
8594e07dc26bSmrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
8595e07dc26bSmrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
8596e07dc26bSmrg
8597e07dc26bSmrg
8598e07dc26bSmrg
8599e07dc26bSmrg# _LT_ENABLE_STATIC([DEFAULT])
8600e07dc26bSmrg# ----------------------------
8601e07dc26bSmrg# implement the --enable-static flag, and support the 'static' and
8602e07dc26bSmrg# 'disable-static' LT_INIT options.
8603e07dc26bSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
8604e07dc26bSmrgm4_define([_LT_ENABLE_STATIC],
8605e07dc26bSmrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
8606e07dc26bSmrgAC_ARG_ENABLE([static],
8607e07dc26bSmrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
8608e07dc26bSmrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
8609e07dc26bSmrg    [p=${PACKAGE-default}
8610e07dc26bSmrg    case $enableval in
8611e07dc26bSmrg    yes) enable_static=yes ;;
8612e07dc26bSmrg    no) enable_static=no ;;
8613e07dc26bSmrg    *)
8614e07dc26bSmrg     enable_static=no
8615e07dc26bSmrg      # Look at the argument we got.  We use all the common list separators.
8616e07dc26bSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8617e07dc26bSmrg      for pkg in $enableval; do
8618e07dc26bSmrg	IFS=$lt_save_ifs
8619e07dc26bSmrg	if test "X$pkg" = "X$p"; then
8620e07dc26bSmrg	  enable_static=yes
8621e07dc26bSmrg	fi
8622e07dc26bSmrg      done
8623e07dc26bSmrg      IFS=$lt_save_ifs
8624e07dc26bSmrg      ;;
8625e07dc26bSmrg    esac],
8626e07dc26bSmrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
8627e07dc26bSmrg
8628e07dc26bSmrg    _LT_DECL([build_old_libs], [enable_static], [0],
8629e07dc26bSmrg	[Whether or not to build static libraries])
8630e07dc26bSmrg])# _LT_ENABLE_STATIC
8631e07dc26bSmrg
8632e07dc26bSmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
8633e07dc26bSmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
8634e07dc26bSmrg
8635e07dc26bSmrg# Old names:
8636e07dc26bSmrgAC_DEFUN([AC_ENABLE_STATIC],
8637e07dc26bSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
8638e07dc26bSmrg])
8639e07dc26bSmrg
8640e07dc26bSmrgAC_DEFUN([AC_DISABLE_STATIC],
8641e07dc26bSmrg[_LT_SET_OPTION([LT_INIT], [disable-static])
8642e07dc26bSmrg])
8643e07dc26bSmrg
8644e07dc26bSmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
8645e07dc26bSmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
8646e07dc26bSmrg
8647e07dc26bSmrgdnl aclocal-1.4 backwards compatibility:
8648e07dc26bSmrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
8649e07dc26bSmrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
8650e07dc26bSmrg
8651e07dc26bSmrg
8652e07dc26bSmrg
8653e07dc26bSmrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
8654e07dc26bSmrg# ----------------------------------
8655e07dc26bSmrg# implement the --enable-fast-install flag, and support the 'fast-install'
8656e07dc26bSmrg# and 'disable-fast-install' LT_INIT options.
8657e07dc26bSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
8658e07dc26bSmrgm4_define([_LT_ENABLE_FAST_INSTALL],
8659e07dc26bSmrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
8660e07dc26bSmrgAC_ARG_ENABLE([fast-install],
8661e07dc26bSmrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
8662e07dc26bSmrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
8663e07dc26bSmrg    [p=${PACKAGE-default}
8664e07dc26bSmrg    case $enableval in
8665e07dc26bSmrg    yes) enable_fast_install=yes ;;
8666e07dc26bSmrg    no) enable_fast_install=no ;;
8667e07dc26bSmrg    *)
8668e07dc26bSmrg      enable_fast_install=no
8669e07dc26bSmrg      # Look at the argument we got.  We use all the common list separators.
8670e07dc26bSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8671e07dc26bSmrg      for pkg in $enableval; do
8672e07dc26bSmrg	IFS=$lt_save_ifs
8673e07dc26bSmrg	if test "X$pkg" = "X$p"; then
8674e07dc26bSmrg	  enable_fast_install=yes
8675e07dc26bSmrg	fi
8676e07dc26bSmrg      done
8677e07dc26bSmrg      IFS=$lt_save_ifs
8678e07dc26bSmrg      ;;
8679e07dc26bSmrg    esac],
8680e07dc26bSmrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
8681e07dc26bSmrg
8682e07dc26bSmrg_LT_DECL([fast_install], [enable_fast_install], [0],
8683e07dc26bSmrg	 [Whether or not to optimize for fast installation])dnl
8684e07dc26bSmrg])# _LT_ENABLE_FAST_INSTALL
8685e07dc26bSmrg
8686e07dc26bSmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
8687e07dc26bSmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
8688e07dc26bSmrg
8689e07dc26bSmrg# Old names:
8690e07dc26bSmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
8691e07dc26bSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
8692e07dc26bSmrgAC_DIAGNOSE([obsolete],
8693e07dc26bSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8694e07dc26bSmrgthe 'fast-install' option into LT_INIT's first parameter.])
8695e07dc26bSmrg])
8696e07dc26bSmrg
8697e07dc26bSmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
8698e07dc26bSmrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
8699e07dc26bSmrgAC_DIAGNOSE([obsolete],
8700e07dc26bSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8701e07dc26bSmrgthe 'disable-fast-install' option into LT_INIT's first parameter.])
8702e07dc26bSmrg])
8703e07dc26bSmrg
8704e07dc26bSmrgdnl aclocal-1.4 backwards compatibility:
8705e07dc26bSmrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
8706e07dc26bSmrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
8707e07dc26bSmrg
8708e07dc26bSmrg
8709e07dc26bSmrg# _LT_WITH_AIX_SONAME([DEFAULT])
8710e07dc26bSmrg# ----------------------------------
8711e07dc26bSmrg# implement the --with-aix-soname flag, and support the `aix-soname=aix'
8712e07dc26bSmrg# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
8713e07dc26bSmrg# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
8714e07dc26bSmrgm4_define([_LT_WITH_AIX_SONAME],
8715e07dc26bSmrg[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
8716e07dc26bSmrgshared_archive_member_spec=
8717e07dc26bSmrgcase $host,$enable_shared in
8718e07dc26bSmrgpower*-*-aix[[5-9]]*,yes)
8719e07dc26bSmrg  AC_MSG_CHECKING([which variant of shared library versioning to provide])
8720e07dc26bSmrg  AC_ARG_WITH([aix-soname],
8721e07dc26bSmrg    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
8722e07dc26bSmrg      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
8723e07dc26bSmrg    [case $withval in
8724e07dc26bSmrg    aix|svr4|both)
8725e07dc26bSmrg      ;;
8726e07dc26bSmrg    *)
8727e07dc26bSmrg      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
8728e07dc26bSmrg      ;;
8729e07dc26bSmrg    esac
8730e07dc26bSmrg    lt_cv_with_aix_soname=$with_aix_soname],
8731e07dc26bSmrg    [AC_CACHE_VAL([lt_cv_with_aix_soname],
8732e07dc26bSmrg      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
8733e07dc26bSmrg    with_aix_soname=$lt_cv_with_aix_soname])
8734e07dc26bSmrg  AC_MSG_RESULT([$with_aix_soname])
8735e07dc26bSmrg  if test aix != "$with_aix_soname"; then
8736e07dc26bSmrg    # For the AIX way of multilib, we name the shared archive member
8737e07dc26bSmrg    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
8738e07dc26bSmrg    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
8739e07dc26bSmrg    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
8740e07dc26bSmrg    # the AIX toolchain works better with OBJECT_MODE set (default 32).
8741e07dc26bSmrg    if test 64 = "${OBJECT_MODE-32}"; then
8742e07dc26bSmrg      shared_archive_member_spec=shr_64
8743e07dc26bSmrg    else
8744e07dc26bSmrg      shared_archive_member_spec=shr
8745e07dc26bSmrg    fi
8746e07dc26bSmrg  fi
8747e07dc26bSmrg  ;;
8748e07dc26bSmrg*)
8749e07dc26bSmrg  with_aix_soname=aix
8750e07dc26bSmrg  ;;
8751e07dc26bSmrgesac
8752e07dc26bSmrg
8753e07dc26bSmrg_LT_DECL([], [shared_archive_member_spec], [0],
8754e07dc26bSmrg    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
8755e07dc26bSmrg])# _LT_WITH_AIX_SONAME
8756e07dc26bSmrg
8757e07dc26bSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
8758e07dc26bSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
8759e07dc26bSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
8760e07dc26bSmrg
8761e07dc26bSmrg
8762e07dc26bSmrg# _LT_WITH_PIC([MODE])
8763e07dc26bSmrg# --------------------
8764e07dc26bSmrg# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
8765e07dc26bSmrg# LT_INIT options.
8766e07dc26bSmrg# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
8767e07dc26bSmrgm4_define([_LT_WITH_PIC],
8768e07dc26bSmrg[AC_ARG_WITH([pic],
8769e07dc26bSmrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
8770e07dc26bSmrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
8771e07dc26bSmrg    [lt_p=${PACKAGE-default}
8772e07dc26bSmrg    case $withval in
8773e07dc26bSmrg    yes|no) pic_mode=$withval ;;
8774e07dc26bSmrg    *)
8775e07dc26bSmrg      pic_mode=default
8776e07dc26bSmrg      # Look at the argument we got.  We use all the common list separators.
8777e07dc26bSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8778e07dc26bSmrg      for lt_pkg in $withval; do
8779e07dc26bSmrg	IFS=$lt_save_ifs
8780e07dc26bSmrg	if test "X$lt_pkg" = "X$lt_p"; then
8781e07dc26bSmrg	  pic_mode=yes
8782e07dc26bSmrg	fi
8783e07dc26bSmrg      done
8784e07dc26bSmrg      IFS=$lt_save_ifs
8785e07dc26bSmrg      ;;
8786e07dc26bSmrg    esac],
8787e07dc26bSmrg    [pic_mode=m4_default([$1], [default])])
8788e07dc26bSmrg
8789e07dc26bSmrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
8790e07dc26bSmrg])# _LT_WITH_PIC
8791e07dc26bSmrg
8792e07dc26bSmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
8793e07dc26bSmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
8794e07dc26bSmrg
8795e07dc26bSmrg# Old name:
8796e07dc26bSmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
8797e07dc26bSmrg[_LT_SET_OPTION([LT_INIT], [pic-only])
8798e07dc26bSmrgAC_DIAGNOSE([obsolete],
8799e07dc26bSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8800e07dc26bSmrgput the 'pic-only' option into LT_INIT's first parameter.])
8801e07dc26bSmrg])
8802e07dc26bSmrg
8803e07dc26bSmrgdnl aclocal-1.4 backwards compatibility:
8804e07dc26bSmrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
8805e07dc26bSmrg
8806e07dc26bSmrg
8807e07dc26bSmrgm4_define([_LTDL_MODE], [])
8808e07dc26bSmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
8809e07dc26bSmrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
8810e07dc26bSmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
8811e07dc26bSmrg		 [m4_define([_LTDL_MODE], [recursive])])
8812e07dc26bSmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
8813e07dc26bSmrg		 [m4_define([_LTDL_MODE], [subproject])])
8814e07dc26bSmrg
8815e07dc26bSmrgm4_define([_LTDL_TYPE], [])
8816e07dc26bSmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
8817e07dc26bSmrg		 [m4_define([_LTDL_TYPE], [installable])])
8818e07dc26bSmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
8819e07dc26bSmrg		 [m4_define([_LTDL_TYPE], [convenience])])
8820e07dc26bSmrg
8821e07dc26bSmrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
8822e07dc26bSmrg#
8823e07dc26bSmrg# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
8824e07dc26bSmrg# Foundation, Inc.
8825e07dc26bSmrg# Written by Gary V. Vaughan, 2004
8826e07dc26bSmrg#
8827e07dc26bSmrg# This file is free software; the Free Software Foundation gives
8828e07dc26bSmrg# unlimited permission to copy and/or distribute it, with or without
8829e07dc26bSmrg# modifications, as long as this notice is preserved.
8830e07dc26bSmrg
8831e07dc26bSmrg# serial 6 ltsugar.m4
8832e07dc26bSmrg
8833e07dc26bSmrg# This is to help aclocal find these macros, as it can't see m4_define.
8834e07dc26bSmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
8835e07dc26bSmrg
8836e07dc26bSmrg
8837e07dc26bSmrg# lt_join(SEP, ARG1, [ARG2...])
8838e07dc26bSmrg# -----------------------------
8839e07dc26bSmrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
8840e07dc26bSmrg# associated separator.
8841e07dc26bSmrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
8842e07dc26bSmrg# versions in m4sugar had bugs.
8843e07dc26bSmrgm4_define([lt_join],
8844e07dc26bSmrg[m4_if([$#], [1], [],
8845e07dc26bSmrg       [$#], [2], [[$2]],
8846e07dc26bSmrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
8847e07dc26bSmrgm4_define([_lt_join],
8848e07dc26bSmrg[m4_if([$#$2], [2], [],
8849e07dc26bSmrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
8850e07dc26bSmrg
8851e07dc26bSmrg
8852e07dc26bSmrg# lt_car(LIST)
8853e07dc26bSmrg# lt_cdr(LIST)
8854e07dc26bSmrg# ------------
8855e07dc26bSmrg# Manipulate m4 lists.
8856e07dc26bSmrg# These macros are necessary as long as will still need to support
8857e07dc26bSmrg# Autoconf-2.59, which quotes differently.
8858e07dc26bSmrgm4_define([lt_car], [[$1]])
8859e07dc26bSmrgm4_define([lt_cdr],
8860e07dc26bSmrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
8861e07dc26bSmrg       [$#], 1, [],
8862e07dc26bSmrg       [m4_dquote(m4_shift($@))])])
8863e07dc26bSmrgm4_define([lt_unquote], $1)
8864e07dc26bSmrg
8865e07dc26bSmrg
8866e07dc26bSmrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
8867e07dc26bSmrg# ------------------------------------------
8868e07dc26bSmrg# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
8869e07dc26bSmrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
8870e07dc26bSmrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
8871e07dc26bSmrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
8872e07dc26bSmrg# than defined and empty).
8873e07dc26bSmrg#
8874e07dc26bSmrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
8875e07dc26bSmrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
8876e07dc26bSmrgm4_define([lt_append],
8877e07dc26bSmrg[m4_define([$1],
8878e07dc26bSmrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
8879e07dc26bSmrg
8880e07dc26bSmrg
8881e07dc26bSmrg
8882e07dc26bSmrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
8883e07dc26bSmrg# ----------------------------------------------------------
8884e07dc26bSmrg# Produce a SEP delimited list of all paired combinations of elements of
8885e07dc26bSmrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
8886e07dc26bSmrg# has the form PREFIXmINFIXSUFFIXn.
8887e07dc26bSmrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
8888e07dc26bSmrgm4_define([lt_combine],
8889e07dc26bSmrg[m4_if(m4_eval([$# > 3]), [1],
8890e07dc26bSmrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
8891e07dc26bSmrg[[m4_foreach([_Lt_prefix], [$2],
8892e07dc26bSmrg	     [m4_foreach([_Lt_suffix],
8893e07dc26bSmrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
8894e07dc26bSmrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
8895e07dc26bSmrg
8896e07dc26bSmrg
8897e07dc26bSmrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
8898e07dc26bSmrg# -----------------------------------------------------------------------
8899e07dc26bSmrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
8900e07dc26bSmrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
8901e07dc26bSmrgm4_define([lt_if_append_uniq],
8902e07dc26bSmrg[m4_ifdef([$1],
8903e07dc26bSmrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
8904e07dc26bSmrg		 [lt_append([$1], [$2], [$3])$4],
8905e07dc26bSmrg		 [$5])],
8906e07dc26bSmrg	  [lt_append([$1], [$2], [$3])$4])])
8907e07dc26bSmrg
8908e07dc26bSmrg
8909e07dc26bSmrg# lt_dict_add(DICT, KEY, VALUE)
8910e07dc26bSmrg# -----------------------------
8911e07dc26bSmrgm4_define([lt_dict_add],
8912e07dc26bSmrg[m4_define([$1($2)], [$3])])
8913e07dc26bSmrg
8914e07dc26bSmrg
8915e07dc26bSmrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
8916e07dc26bSmrg# --------------------------------------------
8917e07dc26bSmrgm4_define([lt_dict_add_subkey],
8918e07dc26bSmrg[m4_define([$1($2:$3)], [$4])])
8919e07dc26bSmrg
8920e07dc26bSmrg
8921e07dc26bSmrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
8922e07dc26bSmrg# ----------------------------------
8923e07dc26bSmrgm4_define([lt_dict_fetch],
8924e07dc26bSmrg[m4_ifval([$3],
8925e07dc26bSmrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
8926e07dc26bSmrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
8927e07dc26bSmrg
8928e07dc26bSmrg
8929e07dc26bSmrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
8930e07dc26bSmrg# -----------------------------------------------------------------
8931e07dc26bSmrgm4_define([lt_if_dict_fetch],
8932e07dc26bSmrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
8933e07dc26bSmrg	[$5],
8934e07dc26bSmrg    [$6])])
8935e07dc26bSmrg
8936e07dc26bSmrg
8937e07dc26bSmrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
8938e07dc26bSmrg# --------------------------------------------------------------
8939e07dc26bSmrgm4_define([lt_dict_filter],
8940e07dc26bSmrg[m4_if([$5], [], [],
8941e07dc26bSmrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
8942e07dc26bSmrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
8943e07dc26bSmrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
8944e07dc26bSmrg])
8945e07dc26bSmrg
8946e07dc26bSmrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
8947e07dc26bSmrg#
8948e07dc26bSmrg#   Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
8949e07dc26bSmrg#   Written by Scott James Remnant, 2004
8950e07dc26bSmrg#
8951e07dc26bSmrg# This file is free software; the Free Software Foundation gives
8952e07dc26bSmrg# unlimited permission to copy and/or distribute it, with or without
8953e07dc26bSmrg# modifications, as long as this notice is preserved.
8954e07dc26bSmrg
8955e07dc26bSmrg# @configure_input@
8956e07dc26bSmrg
8957e07dc26bSmrg# serial 4179 ltversion.m4
8958e07dc26bSmrg# This file is part of GNU Libtool
8959e07dc26bSmrg
8960e07dc26bSmrgm4_define([LT_PACKAGE_VERSION], [2.4.6])
8961e07dc26bSmrgm4_define([LT_PACKAGE_REVISION], [2.4.6])
8962e07dc26bSmrg
8963e07dc26bSmrgAC_DEFUN([LTVERSION_VERSION],
8964e07dc26bSmrg[macro_version='2.4.6'
8965e07dc26bSmrgmacro_revision='2.4.6'
8966e07dc26bSmrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
8967e07dc26bSmrg_LT_DECL(, macro_revision, 0)
8968e07dc26bSmrg])
8969e07dc26bSmrg
8970e07dc26bSmrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
8971e07dc26bSmrg#
8972e07dc26bSmrg#   Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
8973e07dc26bSmrg#   Foundation, Inc.
8974e07dc26bSmrg#   Written by Scott James Remnant, 2004.
8975e07dc26bSmrg#
8976e07dc26bSmrg# This file is free software; the Free Software Foundation gives
8977e07dc26bSmrg# unlimited permission to copy and/or distribute it, with or without
8978e07dc26bSmrg# modifications, as long as this notice is preserved.
8979e07dc26bSmrg
8980e07dc26bSmrg# serial 5 lt~obsolete.m4
8981e07dc26bSmrg
8982e07dc26bSmrg# These exist entirely to fool aclocal when bootstrapping libtool.
8983e07dc26bSmrg#
8984e07dc26bSmrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
8985e07dc26bSmrg# which have later been changed to m4_define as they aren't part of the
8986e07dc26bSmrg# exported API, or moved to Autoconf or Automake where they belong.
8987e07dc26bSmrg#
8988e07dc26bSmrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
8989e07dc26bSmrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
8990e07dc26bSmrg# using a macro with the same name in our local m4/libtool.m4 it'll
8991e07dc26bSmrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
8992e07dc26bSmrg# and doesn't know about Autoconf macros at all.)
8993e07dc26bSmrg#
8994e07dc26bSmrg# So we provide this file, which has a silly filename so it's always
8995e07dc26bSmrg# included after everything else.  This provides aclocal with the
8996e07dc26bSmrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
8997e07dc26bSmrg# because those macros already exist, or will be overwritten later.
8998e07dc26bSmrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
8999e07dc26bSmrg#
9000e07dc26bSmrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
9001e07dc26bSmrg# Yes, that means every name once taken will need to remain here until
9002e07dc26bSmrg# we give up compatibility with versions before 1.7, at which point
9003e07dc26bSmrg# we need to keep only those names which we still refer to.
9004e07dc26bSmrg
9005e07dc26bSmrg# This is to help aclocal find these macros, as it can't see m4_define.
9006e07dc26bSmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
9007e07dc26bSmrg
9008e07dc26bSmrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
9009e07dc26bSmrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
9010e07dc26bSmrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
9011e07dc26bSmrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
9012e07dc26bSmrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
9013e07dc26bSmrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
9014e07dc26bSmrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
9015e07dc26bSmrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
9016e07dc26bSmrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
9017e07dc26bSmrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
9018e07dc26bSmrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
9019e07dc26bSmrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
9020e07dc26bSmrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
9021e07dc26bSmrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
9022e07dc26bSmrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
9023e07dc26bSmrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
9024e07dc26bSmrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
9025e07dc26bSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
9026e07dc26bSmrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
9027e07dc26bSmrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
9028e07dc26bSmrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
9029e07dc26bSmrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
9030e07dc26bSmrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
9031e07dc26bSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
9032e07dc26bSmrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
9033e07dc26bSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
9034e07dc26bSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
9035e07dc26bSmrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
9036e07dc26bSmrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
9037e07dc26bSmrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
9038e07dc26bSmrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
9039e07dc26bSmrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
9040e07dc26bSmrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
9041e07dc26bSmrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
9042e07dc26bSmrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
9043e07dc26bSmrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
9044e07dc26bSmrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
9045e07dc26bSmrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
9046e07dc26bSmrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
9047e07dc26bSmrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
9048e07dc26bSmrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
9049e07dc26bSmrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
9050e07dc26bSmrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
9051e07dc26bSmrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
9052e07dc26bSmrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
9053e07dc26bSmrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
9054e07dc26bSmrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
9055e07dc26bSmrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
9056e07dc26bSmrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
9057e07dc26bSmrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
9058e07dc26bSmrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
9059e07dc26bSmrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
9060e07dc26bSmrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
9061e07dc26bSmrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
9062e07dc26bSmrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
9063e07dc26bSmrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
9064e07dc26bSmrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
9065e07dc26bSmrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
9066e07dc26bSmrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
9067e07dc26bSmrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
9068e07dc26bSmrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
9069e07dc26bSmrg
9070e07dc26bSmrgdnl pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
9071e07dc26bSmrgdnl serial 11 (pkg-config-0.29.1)
9072e07dc26bSmrgdnl
9073e07dc26bSmrgdnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
9074e07dc26bSmrgdnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
9075e07dc26bSmrgdnl
9076e07dc26bSmrgdnl This program is free software; you can redistribute it and/or modify
9077e07dc26bSmrgdnl it under the terms of the GNU General Public License as published by
9078e07dc26bSmrgdnl the Free Software Foundation; either version 2 of the License, or
9079e07dc26bSmrgdnl (at your option) any later version.
9080e07dc26bSmrgdnl
9081e07dc26bSmrgdnl This program is distributed in the hope that it will be useful, but
9082e07dc26bSmrgdnl WITHOUT ANY WARRANTY; without even the implied warranty of
9083e07dc26bSmrgdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9084e07dc26bSmrgdnl General Public License for more details.
9085e07dc26bSmrgdnl
9086e07dc26bSmrgdnl You should have received a copy of the GNU General Public License
9087e07dc26bSmrgdnl along with this program; if not, write to the Free Software
9088e07dc26bSmrgdnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
9089e07dc26bSmrgdnl 02111-1307, USA.
9090e07dc26bSmrgdnl
9091e07dc26bSmrgdnl As a special exception to the GNU General Public License, if you
9092e07dc26bSmrgdnl distribute this file as part of a program that contains a
9093e07dc26bSmrgdnl configuration script generated by Autoconf, you may include it under
9094e07dc26bSmrgdnl the same distribution terms that you use for the rest of that
9095e07dc26bSmrgdnl program.
9096e07dc26bSmrg
9097e07dc26bSmrgdnl PKG_PREREQ(MIN-VERSION)
9098e07dc26bSmrgdnl -----------------------
9099e07dc26bSmrgdnl Since: 0.29
9100e07dc26bSmrgdnl
9101e07dc26bSmrgdnl Verify that the version of the pkg-config macros are at least
9102e07dc26bSmrgdnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
9103e07dc26bSmrgdnl installed version of pkg-config, this checks the developer's version
9104e07dc26bSmrgdnl of pkg.m4 when generating configure.
9105e07dc26bSmrgdnl
9106e07dc26bSmrgdnl To ensure that this macro is defined, also add:
9107e07dc26bSmrgdnl m4_ifndef([PKG_PREREQ],
9108e07dc26bSmrgdnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
9109e07dc26bSmrgdnl
9110e07dc26bSmrgdnl See the "Since" comment for each macro you use to see what version
9111e07dc26bSmrgdnl of the macros you require.
9112e07dc26bSmrgm4_defun([PKG_PREREQ],
9113e07dc26bSmrg[m4_define([PKG_MACROS_VERSION], [0.29.1])
9114e07dc26bSmrgm4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
9115e07dc26bSmrg    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
9116e07dc26bSmrg])dnl PKG_PREREQ
9117e07dc26bSmrg
9118e07dc26bSmrgdnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
9119e07dc26bSmrgdnl ----------------------------------
9120e07dc26bSmrgdnl Since: 0.16
9121e07dc26bSmrgdnl
9122e07dc26bSmrgdnl Search for the pkg-config tool and set the PKG_CONFIG variable to
9123e07dc26bSmrgdnl first found in the path. Checks that the version of pkg-config found
9124e07dc26bSmrgdnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
9125e07dc26bSmrgdnl used since that's the first version where most current features of
9126e07dc26bSmrgdnl pkg-config existed.
9127e07dc26bSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
9128e07dc26bSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
9129e07dc26bSmrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
9130e07dc26bSmrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
9131e07dc26bSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
9132e07dc26bSmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
9133e07dc26bSmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
9134e07dc26bSmrg
9135e07dc26bSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
9136e07dc26bSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
9137e07dc26bSmrgfi
9138e07dc26bSmrgif test -n "$PKG_CONFIG"; then
9139e07dc26bSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
9140e07dc26bSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
9141e07dc26bSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
9142e07dc26bSmrg		AC_MSG_RESULT([yes])
9143e07dc26bSmrg	else
9144e07dc26bSmrg		AC_MSG_RESULT([no])
9145e07dc26bSmrg		PKG_CONFIG=""
9146e07dc26bSmrg	fi
9147e07dc26bSmrgfi[]dnl
9148e07dc26bSmrg])dnl PKG_PROG_PKG_CONFIG
9149e07dc26bSmrg
9150e07dc26bSmrgdnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
9151e07dc26bSmrgdnl -------------------------------------------------------------------
9152e07dc26bSmrgdnl Since: 0.18
9153e07dc26bSmrgdnl
9154e07dc26bSmrgdnl Check to see whether a particular set of modules exists. Similar to
9155e07dc26bSmrgdnl PKG_CHECK_MODULES(), but does not set variables or print errors.
9156e07dc26bSmrgdnl
9157e07dc26bSmrgdnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9158e07dc26bSmrgdnl only at the first occurence in configure.ac, so if the first place
9159e07dc26bSmrgdnl it's called might be skipped (such as if it is within an "if", you
9160e07dc26bSmrgdnl have to call PKG_CHECK_EXISTS manually
9161e07dc26bSmrgAC_DEFUN([PKG_CHECK_EXISTS],
9162e07dc26bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9163e07dc26bSmrgif test -n "$PKG_CONFIG" && \
9164e07dc26bSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
9165e07dc26bSmrg  m4_default([$2], [:])
9166e07dc26bSmrgm4_ifvaln([$3], [else
9167e07dc26bSmrg  $3])dnl
9168e07dc26bSmrgfi])
9169e07dc26bSmrg
9170e07dc26bSmrgdnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
9171e07dc26bSmrgdnl ---------------------------------------------
9172e07dc26bSmrgdnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
9173e07dc26bSmrgdnl pkg_failed based on the result.
9174e07dc26bSmrgm4_define([_PKG_CONFIG],
9175e07dc26bSmrg[if test -n "$$1"; then
9176e07dc26bSmrg    pkg_cv_[]$1="$$1"
9177e07dc26bSmrg elif test -n "$PKG_CONFIG"; then
9178e07dc26bSmrg    PKG_CHECK_EXISTS([$3],
9179e07dc26bSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
9180e07dc26bSmrg		      test "x$?" != "x0" && pkg_failed=yes ],
9181e07dc26bSmrg		     [pkg_failed=yes])
9182e07dc26bSmrg else
9183e07dc26bSmrg    pkg_failed=untried
9184e07dc26bSmrgfi[]dnl
9185e07dc26bSmrg])dnl _PKG_CONFIG
9186e07dc26bSmrg
9187e07dc26bSmrgdnl _PKG_SHORT_ERRORS_SUPPORTED
9188e07dc26bSmrgdnl ---------------------------
9189e07dc26bSmrgdnl Internal check to see if pkg-config supports short errors.
9190e07dc26bSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
9191e07dc26bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9192e07dc26bSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
9193e07dc26bSmrg        _pkg_short_errors_supported=yes
9194e07dc26bSmrgelse
9195e07dc26bSmrg        _pkg_short_errors_supported=no
9196e07dc26bSmrgfi[]dnl
9197e07dc26bSmrg])dnl _PKG_SHORT_ERRORS_SUPPORTED
9198e07dc26bSmrg
9199e07dc26bSmrg
9200e07dc26bSmrgdnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
9201e07dc26bSmrgdnl   [ACTION-IF-NOT-FOUND])
9202e07dc26bSmrgdnl --------------------------------------------------------------
9203e07dc26bSmrgdnl Since: 0.4.0
9204e07dc26bSmrgdnl
9205e07dc26bSmrgdnl Note that if there is a possibility the first call to
9206e07dc26bSmrgdnl PKG_CHECK_MODULES might not happen, you should be sure to include an
9207e07dc26bSmrgdnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
9208e07dc26bSmrgAC_DEFUN([PKG_CHECK_MODULES],
9209e07dc26bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9210e07dc26bSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
9211e07dc26bSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
9212e07dc26bSmrg
9213e07dc26bSmrgpkg_failed=no
9214e07dc26bSmrgAC_MSG_CHECKING([for $1])
9215e07dc26bSmrg
9216e07dc26bSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
9217e07dc26bSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
9218e07dc26bSmrg
9219e07dc26bSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
9220e07dc26bSmrgand $1[]_LIBS to avoid the need to call pkg-config.
9221e07dc26bSmrgSee the pkg-config man page for more details.])
9222e07dc26bSmrg
9223e07dc26bSmrgif test $pkg_failed = yes; then
9224e07dc26bSmrg   	AC_MSG_RESULT([no])
9225e07dc26bSmrg        _PKG_SHORT_ERRORS_SUPPORTED
9226e07dc26bSmrg        if test $_pkg_short_errors_supported = yes; then
9227e07dc26bSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
9228e07dc26bSmrg        else 
9229e07dc26bSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
9230e07dc26bSmrg        fi
9231e07dc26bSmrg	# Put the nasty error message in config.log where it belongs
9232e07dc26bSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
9233e07dc26bSmrg
9234e07dc26bSmrg	m4_default([$4], [AC_MSG_ERROR(
9235e07dc26bSmrg[Package requirements ($2) were not met:
9236e07dc26bSmrg
9237e07dc26bSmrg$$1_PKG_ERRORS
9238e07dc26bSmrg
9239e07dc26bSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
9240e07dc26bSmrginstalled software in a non-standard prefix.
9241e07dc26bSmrg
9242e07dc26bSmrg_PKG_TEXT])[]dnl
9243e07dc26bSmrg        ])
9244e07dc26bSmrgelif test $pkg_failed = untried; then
9245e07dc26bSmrg     	AC_MSG_RESULT([no])
9246e07dc26bSmrg	m4_default([$4], [AC_MSG_FAILURE(
9247e07dc26bSmrg[The pkg-config script could not be found or is too old.  Make sure it
9248e07dc26bSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
9249e07dc26bSmrgpath to pkg-config.
9250e07dc26bSmrg
9251e07dc26bSmrg_PKG_TEXT
9252e07dc26bSmrg
9253e07dc26bSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
9254e07dc26bSmrg        ])
9255e07dc26bSmrgelse
9256e07dc26bSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
9257e07dc26bSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
9258e07dc26bSmrg        AC_MSG_RESULT([yes])
9259e07dc26bSmrg	$3
9260e07dc26bSmrgfi[]dnl
9261e07dc26bSmrg])dnl PKG_CHECK_MODULES
9262e07dc26bSmrg
9263e07dc26bSmrg
9264e07dc26bSmrgdnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
9265e07dc26bSmrgdnl   [ACTION-IF-NOT-FOUND])
9266e07dc26bSmrgdnl ---------------------------------------------------------------------
9267e07dc26bSmrgdnl Since: 0.29
9268e07dc26bSmrgdnl
9269e07dc26bSmrgdnl Checks for existence of MODULES and gathers its build flags with
9270e07dc26bSmrgdnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
9271e07dc26bSmrgdnl and VARIABLE-PREFIX_LIBS from --libs.
9272e07dc26bSmrgdnl
9273e07dc26bSmrgdnl Note that if there is a possibility the first call to
9274e07dc26bSmrgdnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
9275e07dc26bSmrgdnl include an explicit call to PKG_PROG_PKG_CONFIG in your
9276e07dc26bSmrgdnl configure.ac.
9277e07dc26bSmrgAC_DEFUN([PKG_CHECK_MODULES_STATIC],
9278e07dc26bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9279e07dc26bSmrg_save_PKG_CONFIG=$PKG_CONFIG
9280e07dc26bSmrgPKG_CONFIG="$PKG_CONFIG --static"
9281e07dc26bSmrgPKG_CHECK_MODULES($@)
9282e07dc26bSmrgPKG_CONFIG=$_save_PKG_CONFIG[]dnl
9283e07dc26bSmrg])dnl PKG_CHECK_MODULES_STATIC
9284e07dc26bSmrg
9285e07dc26bSmrg
9286e07dc26bSmrgdnl PKG_INSTALLDIR([DIRECTORY])
9287e07dc26bSmrgdnl -------------------------
9288e07dc26bSmrgdnl Since: 0.27
9289e07dc26bSmrgdnl
9290e07dc26bSmrgdnl Substitutes the variable pkgconfigdir as the location where a module
9291e07dc26bSmrgdnl should install pkg-config .pc files. By default the directory is
9292e07dc26bSmrgdnl $libdir/pkgconfig, but the default can be changed by passing
9293e07dc26bSmrgdnl DIRECTORY. The user can override through the --with-pkgconfigdir
9294e07dc26bSmrgdnl parameter.
9295e07dc26bSmrgAC_DEFUN([PKG_INSTALLDIR],
9296e07dc26bSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
9297e07dc26bSmrgm4_pushdef([pkg_description],
9298e07dc26bSmrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
9299e07dc26bSmrgAC_ARG_WITH([pkgconfigdir],
9300e07dc26bSmrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
9301e07dc26bSmrg    [with_pkgconfigdir=]pkg_default)
9302e07dc26bSmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
9303e07dc26bSmrgm4_popdef([pkg_default])
9304e07dc26bSmrgm4_popdef([pkg_description])
9305e07dc26bSmrg])dnl PKG_INSTALLDIR
9306e07dc26bSmrg
9307e07dc26bSmrg
9308e07dc26bSmrgdnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
9309e07dc26bSmrgdnl --------------------------------
9310e07dc26bSmrgdnl Since: 0.27
9311e07dc26bSmrgdnl
9312e07dc26bSmrgdnl Substitutes the variable noarch_pkgconfigdir as the location where a
9313e07dc26bSmrgdnl module should install arch-independent pkg-config .pc files. By
9314e07dc26bSmrgdnl default the directory is $datadir/pkgconfig, but the default can be
9315e07dc26bSmrgdnl changed by passing DIRECTORY. The user can override through the
9316e07dc26bSmrgdnl --with-noarch-pkgconfigdir parameter.
9317e07dc26bSmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
9318e07dc26bSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
9319e07dc26bSmrgm4_pushdef([pkg_description],
9320e07dc26bSmrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
9321e07dc26bSmrgAC_ARG_WITH([noarch-pkgconfigdir],
9322e07dc26bSmrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
9323e07dc26bSmrg    [with_noarch_pkgconfigdir=]pkg_default)
9324e07dc26bSmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
9325e07dc26bSmrgm4_popdef([pkg_default])
9326e07dc26bSmrgm4_popdef([pkg_description])
9327e07dc26bSmrg])dnl PKG_NOARCH_INSTALLDIR
9328e07dc26bSmrg
9329e07dc26bSmrg
9330e07dc26bSmrgdnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
9331e07dc26bSmrgdnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
9332e07dc26bSmrgdnl -------------------------------------------
9333e07dc26bSmrgdnl Since: 0.28
9334e07dc26bSmrgdnl
9335e07dc26bSmrgdnl Retrieves the value of the pkg-config variable for the given module.
9336e07dc26bSmrgAC_DEFUN([PKG_CHECK_VAR],
9337e07dc26bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9338e07dc26bSmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
9339e07dc26bSmrg
9340e07dc26bSmrg_PKG_CONFIG([$1], [variable="][$3]["], [$2])
9341e07dc26bSmrgAS_VAR_COPY([$1], [pkg_cv_][$1])
9342e07dc26bSmrg
9343e07dc26bSmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl
9344e07dc26bSmrg])dnl PKG_CHECK_VAR
9345e07dc26bSmrg
9346e07dc26bSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
9347e07dc26bSmrgdnl
9348e07dc26bSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
9349e07dc26bSmrgdnl
9350e07dc26bSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
9351e07dc26bSmrgdnl copy of this software and associated documentation files (the "Software"),
9352e07dc26bSmrgdnl to deal in the Software without restriction, including without limitation
9353e07dc26bSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
9354e07dc26bSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
9355e07dc26bSmrgdnl Software is furnished to do so, subject to the following conditions:
9356e07dc26bSmrgdnl
9357e07dc26bSmrgdnl The above copyright notice and this permission notice (including the next
9358e07dc26bSmrgdnl paragraph) shall be included in all copies or substantial portions of the
9359e07dc26bSmrgdnl Software.
9360e07dc26bSmrgdnl
9361e07dc26bSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9362e07dc26bSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9363e07dc26bSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
9364e07dc26bSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9365e07dc26bSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9366e07dc26bSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
9367e07dc26bSmrgdnl DEALINGS IN THE SOFTWARE.
9368e07dc26bSmrg
9369e07dc26bSmrg# XORG_MACROS_VERSION(required-version)
9370e07dc26bSmrg# -------------------------------------
9371e07dc26bSmrg# Minimum version: 1.1.0
9372e07dc26bSmrg#
9373e07dc26bSmrg# If you're using a macro added in Version 1.1 or newer, include this in
9374e07dc26bSmrg# your configure.ac with the minimum required version, such as:
9375e07dc26bSmrg# XORG_MACROS_VERSION(1.1)
9376e07dc26bSmrg#
9377e07dc26bSmrg# To ensure that this macro is defined, also add:
9378e07dc26bSmrg# m4_ifndef([XORG_MACROS_VERSION],
9379e07dc26bSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9380e07dc26bSmrg#
9381e07dc26bSmrg#
9382e07dc26bSmrg# See the "minimum version" comment for each macro you use to see what
9383e07dc26bSmrg# version you require.
9384e07dc26bSmrgm4_defun([XORG_MACROS_VERSION],[
9385e07dc26bSmrgm4_define([vers_have], [1.19.0])
9386e07dc26bSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
9387e07dc26bSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
9388e07dc26bSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
9389e07dc26bSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
9390e07dc26bSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
9391e07dc26bSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
9392e07dc26bSmrgm4_undefine([vers_have])
9393e07dc26bSmrgm4_undefine([maj_have])
9394e07dc26bSmrgm4_undefine([maj_needed])
9395e07dc26bSmrg]) # XORG_MACROS_VERSION
9396e07dc26bSmrg
9397e07dc26bSmrg# XORG_PROG_RAWCPP()
9398e07dc26bSmrg# ------------------
9399e07dc26bSmrg# Minimum version: 1.0.0
9400e07dc26bSmrg#
9401e07dc26bSmrg# Find cpp program and necessary flags for use in pre-processing text files
9402e07dc26bSmrg# such as man pages and config files
9403e07dc26bSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
9404e07dc26bSmrgAC_REQUIRE([AC_PROG_CPP])
9405e07dc26bSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
9406e07dc26bSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9407e07dc26bSmrg
9408e07dc26bSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
9409e07dc26bSmrg# which is not the best choice for supporting other OS'es, but covers most
9410e07dc26bSmrg# of the ones we need for now.
9411e07dc26bSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
9412e07dc26bSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
9413e07dc26bSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9414e07dc26bSmrg	AC_MSG_RESULT([no])
9415e07dc26bSmrgelse
9416e07dc26bSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9417e07dc26bSmrg		RAWCPPFLAGS=-undef
9418e07dc26bSmrg		AC_MSG_RESULT([yes])
9419e07dc26bSmrg	# under Cygwin unix is still defined even with -undef
9420e07dc26bSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9421e07dc26bSmrg		RAWCPPFLAGS="-undef -ansi"
9422e07dc26bSmrg		AC_MSG_RESULT([yes, with -ansi])
9423e07dc26bSmrg	else
9424e07dc26bSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9425e07dc26bSmrg	fi
9426e07dc26bSmrgfi
9427e07dc26bSmrgrm -f conftest.$ac_ext
9428e07dc26bSmrg
9429e07dc26bSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
9430e07dc26bSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
9431e07dc26bSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9432e07dc26bSmrg	AC_MSG_RESULT([no])
9433e07dc26bSmrgelse
9434e07dc26bSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9435e07dc26bSmrg		TRADITIONALCPPFLAGS="-traditional"
9436e07dc26bSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
9437e07dc26bSmrg		AC_MSG_RESULT([yes])
9438e07dc26bSmrg	else
9439e07dc26bSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
9440e07dc26bSmrg	fi
9441e07dc26bSmrgfi
9442e07dc26bSmrgrm -f conftest.$ac_ext
9443e07dc26bSmrgAC_SUBST(RAWCPPFLAGS)
9444e07dc26bSmrgAC_SUBST(TRADITIONALCPPFLAGS)
9445e07dc26bSmrg]) # XORG_PROG_RAWCPP
9446e07dc26bSmrg
9447e07dc26bSmrg# XORG_MANPAGE_SECTIONS()
9448e07dc26bSmrg# -----------------------
9449e07dc26bSmrg# Minimum version: 1.0.0
9450e07dc26bSmrg#
9451e07dc26bSmrg# Determine which sections man pages go in for the different man page types
9452e07dc26bSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
9453e07dc26bSmrg# Not sure if there's any better way than just hardcoding by OS name.
9454e07dc26bSmrg# Override default settings by setting environment variables
9455e07dc26bSmrg# Added MAN_SUBSTS in version 1.8
9456e07dc26bSmrg# Added AC_PROG_SED in version 1.8
9457e07dc26bSmrg
9458e07dc26bSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
9459e07dc26bSmrgAC_REQUIRE([AC_CANONICAL_HOST])
9460e07dc26bSmrgAC_REQUIRE([AC_PROG_SED])
9461e07dc26bSmrg
9462e07dc26bSmrgif test x$APP_MAN_SUFFIX = x    ; then
9463e07dc26bSmrg    APP_MAN_SUFFIX=1
9464e07dc26bSmrgfi
9465e07dc26bSmrgif test x$APP_MAN_DIR = x    ; then
9466e07dc26bSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
9467e07dc26bSmrgfi
9468e07dc26bSmrg
9469e07dc26bSmrgif test x$LIB_MAN_SUFFIX = x    ; then
9470e07dc26bSmrg    LIB_MAN_SUFFIX=3
9471e07dc26bSmrgfi
9472e07dc26bSmrgif test x$LIB_MAN_DIR = x    ; then
9473e07dc26bSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
9474e07dc26bSmrgfi
9475e07dc26bSmrg
9476e07dc26bSmrgif test x$FILE_MAN_SUFFIX = x    ; then
9477e07dc26bSmrg    case $host_os in
9478e07dc26bSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
9479e07dc26bSmrg	*)		FILE_MAN_SUFFIX=5  ;;
9480e07dc26bSmrg    esac
9481e07dc26bSmrgfi
9482e07dc26bSmrgif test x$FILE_MAN_DIR = x    ; then
9483e07dc26bSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
9484e07dc26bSmrgfi
9485e07dc26bSmrg
9486e07dc26bSmrgif test x$MISC_MAN_SUFFIX = x    ; then
9487e07dc26bSmrg    case $host_os in
9488e07dc26bSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
9489e07dc26bSmrg	*)		MISC_MAN_SUFFIX=7  ;;
9490e07dc26bSmrg    esac
9491e07dc26bSmrgfi
9492e07dc26bSmrgif test x$MISC_MAN_DIR = x    ; then
9493e07dc26bSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
9494e07dc26bSmrgfi
9495e07dc26bSmrg
9496e07dc26bSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
9497e07dc26bSmrg    case $host_os in
9498e07dc26bSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
9499e07dc26bSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
9500e07dc26bSmrg    esac
9501e07dc26bSmrgfi
9502e07dc26bSmrgif test x$DRIVER_MAN_DIR = x    ; then
9503e07dc26bSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
9504e07dc26bSmrgfi
9505e07dc26bSmrg
9506e07dc26bSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
9507e07dc26bSmrg    case $host_os in
9508e07dc26bSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
9509e07dc26bSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
9510e07dc26bSmrg    esac
9511e07dc26bSmrgfi
9512e07dc26bSmrgif test x$ADMIN_MAN_DIR = x    ; then
9513e07dc26bSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
9514e07dc26bSmrgfi
9515e07dc26bSmrg
9516e07dc26bSmrg
9517e07dc26bSmrgAC_SUBST([APP_MAN_SUFFIX])
9518e07dc26bSmrgAC_SUBST([LIB_MAN_SUFFIX])
9519e07dc26bSmrgAC_SUBST([FILE_MAN_SUFFIX])
9520e07dc26bSmrgAC_SUBST([MISC_MAN_SUFFIX])
9521e07dc26bSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
9522e07dc26bSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
9523e07dc26bSmrgAC_SUBST([APP_MAN_DIR])
9524e07dc26bSmrgAC_SUBST([LIB_MAN_DIR])
9525e07dc26bSmrgAC_SUBST([FILE_MAN_DIR])
9526e07dc26bSmrgAC_SUBST([MISC_MAN_DIR])
9527e07dc26bSmrgAC_SUBST([DRIVER_MAN_DIR])
9528e07dc26bSmrgAC_SUBST([ADMIN_MAN_DIR])
9529e07dc26bSmrg
9530e07dc26bSmrgXORG_MAN_PAGE="X Version 11"
9531e07dc26bSmrgAC_SUBST([XORG_MAN_PAGE])
9532e07dc26bSmrgMAN_SUBSTS="\
9533e07dc26bSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9534e07dc26bSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9535e07dc26bSmrg	-e 's|__xservername__|Xorg|g' \
9536e07dc26bSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
9537e07dc26bSmrg	-e 's|__projectroot__|\$(prefix)|g' \
9538e07dc26bSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
9539e07dc26bSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
9540e07dc26bSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
9541e07dc26bSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
9542e07dc26bSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
9543e07dc26bSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
9544e07dc26bSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
9545e07dc26bSmrgAC_SUBST([MAN_SUBSTS])
9546e07dc26bSmrg
9547e07dc26bSmrg]) # XORG_MANPAGE_SECTIONS
9548e07dc26bSmrg
9549e07dc26bSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
9550e07dc26bSmrg# ------------------------
9551e07dc26bSmrg# Minimum version: 1.7.0
9552e07dc26bSmrg#
9553e07dc26bSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
9554e07dc26bSmrg# provided by xorg-sgml-doctools, if installed.
9555e07dc26bSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
9556e07dc26bSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
9557e07dc26bSmrgXORG_SGML_PATH=
9558e07dc26bSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
9559e07dc26bSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
9560e07dc26bSmrg    [m4_ifval([$1],[:],
9561e07dc26bSmrg        [if test x"$cross_compiling" != x"yes" ; then
9562e07dc26bSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
9563e07dc26bSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
9564e07dc26bSmrg         fi])
9565e07dc26bSmrg    ])
9566e07dc26bSmrg
9567e07dc26bSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
9568e07dc26bSmrg# the path and the name of the doc stylesheet
9569e07dc26bSmrgif test "x$XORG_SGML_PATH" != "x" ; then
9570e07dc26bSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
9571e07dc26bSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
9572e07dc26bSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
9573e07dc26bSmrgelse
9574e07dc26bSmrg   AC_MSG_RESULT([no])
9575e07dc26bSmrgfi
9576e07dc26bSmrg
9577e07dc26bSmrgAC_SUBST(XORG_SGML_PATH)
9578e07dc26bSmrgAC_SUBST(STYLESHEET_SRCDIR)
9579e07dc26bSmrgAC_SUBST(XSL_STYLESHEET)
9580e07dc26bSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
9581e07dc26bSmrg]) # XORG_CHECK_SGML_DOCTOOLS
9582e07dc26bSmrg
9583e07dc26bSmrg# XORG_CHECK_LINUXDOC
9584e07dc26bSmrg# -------------------
9585e07dc26bSmrg# Minimum version: 1.0.0
9586e07dc26bSmrg#
9587e07dc26bSmrg# Defines the variable MAKE_TEXT if the necessary tools and
9588e07dc26bSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
9589e07dc26bSmrg# Whether or not the necessary tools and files are found can be checked
9590e07dc26bSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
9591e07dc26bSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
9592e07dc26bSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9593e07dc26bSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
9594e07dc26bSmrg
9595e07dc26bSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
9596e07dc26bSmrg
9597e07dc26bSmrgAC_MSG_CHECKING([whether to build documentation])
9598e07dc26bSmrg
9599e07dc26bSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
9600e07dc26bSmrg   BUILDDOC=yes
9601e07dc26bSmrgelse
9602e07dc26bSmrg   BUILDDOC=no
9603e07dc26bSmrgfi
9604e07dc26bSmrg
9605e07dc26bSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
9606e07dc26bSmrg
9607e07dc26bSmrgAC_MSG_RESULT([$BUILDDOC])
9608e07dc26bSmrg
9609e07dc26bSmrgAC_MSG_CHECKING([whether to build pdf documentation])
9610e07dc26bSmrg
9611e07dc26bSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
9612e07dc26bSmrg   BUILDPDFDOC=yes
9613e07dc26bSmrgelse
9614e07dc26bSmrg   BUILDPDFDOC=no
9615e07dc26bSmrgfi
9616e07dc26bSmrg
9617e07dc26bSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9618e07dc26bSmrg
9619e07dc26bSmrgAC_MSG_RESULT([$BUILDPDFDOC])
9620e07dc26bSmrg
9621e07dc26bSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
9622e07dc26bSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
9623e07dc26bSmrgMAKE_PDF="$PS2PDF"
9624e07dc26bSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
9625e07dc26bSmrg
9626e07dc26bSmrgAC_SUBST(MAKE_TEXT)
9627e07dc26bSmrgAC_SUBST(MAKE_PS)
9628e07dc26bSmrgAC_SUBST(MAKE_PDF)
9629e07dc26bSmrgAC_SUBST(MAKE_HTML)
9630e07dc26bSmrg]) # XORG_CHECK_LINUXDOC
9631e07dc26bSmrg
9632e07dc26bSmrg# XORG_CHECK_DOCBOOK
9633e07dc26bSmrg# -------------------
9634e07dc26bSmrg# Minimum version: 1.0.0
9635e07dc26bSmrg#
9636e07dc26bSmrg# Checks for the ability to build output formats from SGML DocBook source.
9637e07dc26bSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
9638e07dc26bSmrg# indicates whether the necessary tools and files are found and, if set,
9639e07dc26bSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
9640e07dc26bSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
9641e07dc26bSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9642e07dc26bSmrg
9643e07dc26bSmrgBUILDTXTDOC=no
9644e07dc26bSmrgBUILDPDFDOC=no
9645e07dc26bSmrgBUILDPSDOC=no
9646e07dc26bSmrgBUILDHTMLDOC=no
9647e07dc26bSmrg
9648e07dc26bSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
9649e07dc26bSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
9650e07dc26bSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
9651e07dc26bSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
9652e07dc26bSmrg
9653e07dc26bSmrgAC_MSG_CHECKING([whether to build text documentation])
9654e07dc26bSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
9655e07dc26bSmrg   test x$BUILD_TXTDOC != xno; then
9656e07dc26bSmrg	BUILDTXTDOC=yes
9657e07dc26bSmrgfi
9658e07dc26bSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
9659e07dc26bSmrgAC_MSG_RESULT([$BUILDTXTDOC])
9660e07dc26bSmrg
9661e07dc26bSmrgAC_MSG_CHECKING([whether to build PDF documentation])
9662e07dc26bSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
9663e07dc26bSmrg   test x$BUILD_PDFDOC != xno; then
9664e07dc26bSmrg	BUILDPDFDOC=yes
9665e07dc26bSmrgfi
9666e07dc26bSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9667e07dc26bSmrgAC_MSG_RESULT([$BUILDPDFDOC])
9668e07dc26bSmrg
9669e07dc26bSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
9670e07dc26bSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
9671e07dc26bSmrg   test x$BUILD_PSDOC != xno; then
9672e07dc26bSmrg	BUILDPSDOC=yes
9673e07dc26bSmrgfi
9674e07dc26bSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
9675e07dc26bSmrgAC_MSG_RESULT([$BUILDPSDOC])
9676e07dc26bSmrg
9677e07dc26bSmrgAC_MSG_CHECKING([whether to build HTML documentation])
9678e07dc26bSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
9679e07dc26bSmrg   test x$BUILD_HTMLDOC != xno; then
9680e07dc26bSmrg	BUILDHTMLDOC=yes
9681e07dc26bSmrgfi
9682e07dc26bSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
9683e07dc26bSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
9684e07dc26bSmrg
9685e07dc26bSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
9686e07dc26bSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
9687e07dc26bSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
9688e07dc26bSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
9689e07dc26bSmrg
9690e07dc26bSmrgAC_SUBST(MAKE_TEXT)
9691e07dc26bSmrgAC_SUBST(MAKE_PS)
9692e07dc26bSmrgAC_SUBST(MAKE_PDF)
9693e07dc26bSmrgAC_SUBST(MAKE_HTML)
9694e07dc26bSmrg]) # XORG_CHECK_DOCBOOK
9695e07dc26bSmrg
9696e07dc26bSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
9697e07dc26bSmrg# ----------------
9698e07dc26bSmrg# Minimum version: 1.5.0
9699e07dc26bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
9700e07dc26bSmrg#
9701e07dc26bSmrg# Documentation tools are not always available on all platforms and sometimes
9702e07dc26bSmrg# not at the appropriate level. This macro enables a module to test for the
9703e07dc26bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
9704e07dc26bSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
9705e07dc26bSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
9706e07dc26bSmrg# --with-xmlto assumes 'auto'.
9707e07dc26bSmrg#
9708e07dc26bSmrg# Interface to module:
9709e07dc26bSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
9710e07dc26bSmrg# XMLTO:	returns the path of the xmlto program found
9711e07dc26bSmrg#		returns the path set by the user in the environment
9712e07dc26bSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
9713e07dc26bSmrg#		'no' user instructs the module not to use xmlto
9714e07dc26bSmrg#
9715e07dc26bSmrg# Added in version 1.10.0
9716e07dc26bSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
9717e07dc26bSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
9718e07dc26bSmrg#
9719e07dc26bSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
9720e07dc26bSmrg#
9721e07dc26bSmrgAC_DEFUN([XORG_WITH_XMLTO],[
9722e07dc26bSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
9723e07dc26bSmrgm4_define([_defopt], m4_default([$2], [auto]))
9724e07dc26bSmrgAC_ARG_WITH(xmlto,
9725e07dc26bSmrg	AS_HELP_STRING([--with-xmlto],
9726e07dc26bSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
9727e07dc26bSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
9728e07dc26bSmrgm4_undefine([_defopt])
9729e07dc26bSmrg
9730e07dc26bSmrgif test "x$use_xmlto" = x"auto"; then
9731e07dc26bSmrg   AC_PATH_PROG([XMLTO], [xmlto])
9732e07dc26bSmrg   if test "x$XMLTO" = "x"; then
9733e07dc26bSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
9734e07dc26bSmrg	have_xmlto=no
9735e07dc26bSmrg   else
9736e07dc26bSmrg        have_xmlto=yes
9737e07dc26bSmrg   fi
9738e07dc26bSmrgelif test "x$use_xmlto" = x"yes" ; then
9739e07dc26bSmrg   AC_PATH_PROG([XMLTO], [xmlto])
9740e07dc26bSmrg   if test "x$XMLTO" = "x"; then
9741e07dc26bSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
9742e07dc26bSmrg   fi
9743e07dc26bSmrg   have_xmlto=yes
9744e07dc26bSmrgelif test "x$use_xmlto" = x"no" ; then
9745e07dc26bSmrg   if test "x$XMLTO" != "x"; then
9746e07dc26bSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
9747e07dc26bSmrg   fi
9748e07dc26bSmrg   have_xmlto=no
9749e07dc26bSmrgelse
9750e07dc26bSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
9751e07dc26bSmrgfi
9752e07dc26bSmrg
9753e07dc26bSmrg# Test for a minimum version of xmlto, if provided.
9754e07dc26bSmrgm4_ifval([$1],
9755e07dc26bSmrg[if test "$have_xmlto" = yes; then
9756e07dc26bSmrg    # scrape the xmlto version
9757e07dc26bSmrg    AC_MSG_CHECKING([the xmlto version])
9758e07dc26bSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
9759e07dc26bSmrg    AC_MSG_RESULT([$xmlto_version])
9760e07dc26bSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
9761e07dc26bSmrg        [if test "x$use_xmlto" = xauto; then
9762e07dc26bSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
9763e07dc26bSmrg            have_xmlto=no
9764e07dc26bSmrg        else
9765e07dc26bSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
9766e07dc26bSmrg        fi])
9767e07dc26bSmrgfi])
9768e07dc26bSmrg
9769e07dc26bSmrg# Test for the ability of xmlto to generate a text target
9770e07dc26bSmrg#
9771e07dc26bSmrg# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the
9772e07dc26bSmrg# following test for empty XML docbook files.
9773e07dc26bSmrg# For compatibility reasons use the following empty XML docbook file and if
9774e07dc26bSmrg# it fails try it again with a non-empty XML file.
9775e07dc26bSmrghave_xmlto_text=no
9776e07dc26bSmrgcat > conftest.xml << "EOF"
9777e07dc26bSmrgEOF
9778e07dc26bSmrgAS_IF([test "$have_xmlto" = yes],
9779e07dc26bSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
9780e07dc26bSmrg             [have_xmlto_text=yes],
9781e07dc26bSmrg             [# Try it again with a non-empty XML file.
9782e07dc26bSmrg              cat > conftest.xml << "EOF"
9783e07dc26bSmrg<x></x>
9784e07dc26bSmrgEOF
9785e07dc26bSmrg              AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
9786e07dc26bSmrg                    [have_xmlto_text=yes],
9787e07dc26bSmrg                    [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])])
9788e07dc26bSmrgrm -f conftest.xml
9789e07dc26bSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
9790e07dc26bSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
9791e07dc26bSmrg]) # XORG_WITH_XMLTO
9792e07dc26bSmrg
9793e07dc26bSmrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
9794e07dc26bSmrg# --------------------------------------------
9795e07dc26bSmrg# Minimum version: 1.12.0
9796e07dc26bSmrg# Minimum version for optional DEFAULT argument: 1.12.0
9797e07dc26bSmrg#
9798e07dc26bSmrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
9799e07dc26bSmrg# XML-based language used for the transformation of XML documents.
9800e07dc26bSmrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
9801e07dc26bSmrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
9802e07dc26bSmrg# The XSLT processor is often used as a standalone tool for transformations.
9803e07dc26bSmrg# It should not be assumed that this tool is used only to work with documnetation.
9804e07dc26bSmrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
9805e07dc26bSmrg#
9806e07dc26bSmrg# Interface to module:
9807e07dc26bSmrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
9808e07dc26bSmrg# XSLTPROC:	 returns the path of the xsltproc program found
9809e07dc26bSmrg#		 returns the path set by the user in the environment
9810e07dc26bSmrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
9811e07dc26bSmrg#		  'no' user instructs the module not to use xsltproc
9812e07dc26bSmrg# have_xsltproc: returns yes if xsltproc found in PATH or no
9813e07dc26bSmrg#
9814e07dc26bSmrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
9815e07dc26bSmrg#
9816e07dc26bSmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
9817e07dc26bSmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
9818e07dc26bSmrg# Preserves the interface, should it be implemented later
9819e07dc26bSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
9820e07dc26bSmrgm4_define([_defopt], m4_default([$2], [auto]))
9821e07dc26bSmrgAC_ARG_WITH(xsltproc,
9822e07dc26bSmrg	AS_HELP_STRING([--with-xsltproc],
9823e07dc26bSmrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
9824e07dc26bSmrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
9825e07dc26bSmrgm4_undefine([_defopt])
9826e07dc26bSmrg
9827e07dc26bSmrgif test "x$use_xsltproc" = x"auto"; then
9828e07dc26bSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
9829e07dc26bSmrg   if test "x$XSLTPROC" = "x"; then
9830e07dc26bSmrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
9831e07dc26bSmrg	have_xsltproc=no
9832e07dc26bSmrg   else
9833e07dc26bSmrg        have_xsltproc=yes
9834e07dc26bSmrg   fi
9835e07dc26bSmrgelif test "x$use_xsltproc" = x"yes" ; then
9836e07dc26bSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
9837e07dc26bSmrg   if test "x$XSLTPROC" = "x"; then
9838e07dc26bSmrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
9839e07dc26bSmrg   fi
9840e07dc26bSmrg   have_xsltproc=yes
9841e07dc26bSmrgelif test "x$use_xsltproc" = x"no" ; then
9842e07dc26bSmrg   if test "x$XSLTPROC" != "x"; then
9843e07dc26bSmrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
9844e07dc26bSmrg   fi
9845e07dc26bSmrg   have_xsltproc=no
9846e07dc26bSmrgelse
9847e07dc26bSmrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
9848e07dc26bSmrgfi
9849e07dc26bSmrg
9850e07dc26bSmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
9851e07dc26bSmrg]) # XORG_WITH_XSLTPROC
9852e07dc26bSmrg
9853e07dc26bSmrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
9854e07dc26bSmrg# ----------------------------------------
9855e07dc26bSmrg# Minimum version: 1.15.0
9856e07dc26bSmrg#
9857e07dc26bSmrg# PERL (Practical Extraction and Report Language) is a language optimized for
9858e07dc26bSmrg# scanning arbitrary text files, extracting information from those text files,
9859e07dc26bSmrg# and printing reports based on that information.
9860e07dc26bSmrg#
9861e07dc26bSmrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
9862e07dc26bSmrg#
9863e07dc26bSmrg# Interface to module:
9864e07dc26bSmrg# HAVE_PERL: used in makefiles to conditionally scan text files
9865e07dc26bSmrg# PERL:	     returns the path of the perl program found
9866e07dc26bSmrg#	     returns the path set by the user in the environment
9867e07dc26bSmrg# --with-perl: 'yes' user instructs the module to use perl
9868e07dc26bSmrg#	       'no' user instructs the module not to use perl
9869e07dc26bSmrg# have_perl: returns yes if perl found in PATH or no
9870e07dc26bSmrg#
9871e07dc26bSmrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
9872e07dc26bSmrg#
9873e07dc26bSmrgAC_DEFUN([XORG_WITH_PERL],[
9874e07dc26bSmrgAC_ARG_VAR([PERL], [Path to perl command])
9875e07dc26bSmrg# Preserves the interface, should it be implemented later
9876e07dc26bSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
9877e07dc26bSmrgm4_define([_defopt], m4_default([$2], [auto]))
9878e07dc26bSmrgAC_ARG_WITH(perl,
9879e07dc26bSmrg	AS_HELP_STRING([--with-perl],
9880e07dc26bSmrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
9881e07dc26bSmrg	   [use_perl=$withval], [use_perl=]_defopt)
9882e07dc26bSmrgm4_undefine([_defopt])
9883e07dc26bSmrg
9884e07dc26bSmrgif test "x$use_perl" = x"auto"; then
9885e07dc26bSmrg   AC_PATH_PROG([PERL], [perl])
9886e07dc26bSmrg   if test "x$PERL" = "x"; then
9887e07dc26bSmrg        AC_MSG_WARN([perl not found - cannot extract information and report])
9888e07dc26bSmrg	have_perl=no
9889e07dc26bSmrg   else
9890e07dc26bSmrg        have_perl=yes
9891e07dc26bSmrg   fi
9892e07dc26bSmrgelif test "x$use_perl" = x"yes" ; then
9893e07dc26bSmrg   AC_PATH_PROG([PERL], [perl])
9894e07dc26bSmrg   if test "x$PERL" = "x"; then
9895e07dc26bSmrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
9896e07dc26bSmrg   fi
9897e07dc26bSmrg   have_perl=yes
9898e07dc26bSmrgelif test "x$use_perl" = x"no" ; then
9899e07dc26bSmrg   if test "x$PERL" != "x"; then
9900e07dc26bSmrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
9901e07dc26bSmrg   fi
9902e07dc26bSmrg   have_perl=no
9903e07dc26bSmrgelse
9904e07dc26bSmrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
9905e07dc26bSmrgfi
9906e07dc26bSmrg
9907e07dc26bSmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
9908e07dc26bSmrg]) # XORG_WITH_PERL
9909e07dc26bSmrg
9910e07dc26bSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
9911e07dc26bSmrg# ----------------
9912e07dc26bSmrg# Minimum version: 1.5.0
9913e07dc26bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
9914e07dc26bSmrg#
9915e07dc26bSmrg# Documentation tools are not always available on all platforms and sometimes
9916e07dc26bSmrg# not at the appropriate level. This macro enables a module to test for the
9917e07dc26bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
9918e07dc26bSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
9919e07dc26bSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
9920e07dc26bSmrg# --with-asciidoc assumes 'auto'.
9921e07dc26bSmrg#
9922e07dc26bSmrg# Interface to module:
9923e07dc26bSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
9924e07dc26bSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
9925e07dc26bSmrg#		 returns the path set by the user in the environment
9926e07dc26bSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
9927e07dc26bSmrg#		  'no' user instructs the module not to use asciidoc
9928e07dc26bSmrg#
9929e07dc26bSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
9930e07dc26bSmrg#
9931e07dc26bSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
9932e07dc26bSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
9933e07dc26bSmrgm4_define([_defopt], m4_default([$2], [auto]))
9934e07dc26bSmrgAC_ARG_WITH(asciidoc,
9935e07dc26bSmrg	AS_HELP_STRING([--with-asciidoc],
9936e07dc26bSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
9937e07dc26bSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
9938e07dc26bSmrgm4_undefine([_defopt])
9939e07dc26bSmrg
9940e07dc26bSmrgif test "x$use_asciidoc" = x"auto"; then
9941e07dc26bSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
9942e07dc26bSmrg   if test "x$ASCIIDOC" = "x"; then
9943e07dc26bSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
9944e07dc26bSmrg	have_asciidoc=no
9945e07dc26bSmrg   else
9946e07dc26bSmrg        have_asciidoc=yes
9947e07dc26bSmrg   fi
9948e07dc26bSmrgelif test "x$use_asciidoc" = x"yes" ; then
9949e07dc26bSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
9950e07dc26bSmrg   if test "x$ASCIIDOC" = "x"; then
9951e07dc26bSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
9952e07dc26bSmrg   fi
9953e07dc26bSmrg   have_asciidoc=yes
9954e07dc26bSmrgelif test "x$use_asciidoc" = x"no" ; then
9955e07dc26bSmrg   if test "x$ASCIIDOC" != "x"; then
9956e07dc26bSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
9957e07dc26bSmrg   fi
9958e07dc26bSmrg   have_asciidoc=no
9959e07dc26bSmrgelse
9960e07dc26bSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
9961e07dc26bSmrgfi
9962e07dc26bSmrgm4_ifval([$1],
9963e07dc26bSmrg[if test "$have_asciidoc" = yes; then
9964e07dc26bSmrg    # scrape the asciidoc version
9965e07dc26bSmrg    AC_MSG_CHECKING([the asciidoc version])
9966e07dc26bSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
9967e07dc26bSmrg    AC_MSG_RESULT([$asciidoc_version])
9968e07dc26bSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
9969e07dc26bSmrg        [if test "x$use_asciidoc" = xauto; then
9970e07dc26bSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
9971e07dc26bSmrg            have_asciidoc=no
9972e07dc26bSmrg        else
9973e07dc26bSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
9974e07dc26bSmrg        fi])
9975e07dc26bSmrgfi])
9976e07dc26bSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
9977e07dc26bSmrg]) # XORG_WITH_ASCIIDOC
9978e07dc26bSmrg
9979e07dc26bSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
9980e07dc26bSmrg# -------------------------------------------
9981e07dc26bSmrg# Minimum version: 1.5.0
9982e07dc26bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
9983e07dc26bSmrg# Minimum version for optional DOT checking: 1.18.0
9984e07dc26bSmrg#
9985e07dc26bSmrg# Documentation tools are not always available on all platforms and sometimes
9986e07dc26bSmrg# not at the appropriate level. This macro enables a module to test for the
9987e07dc26bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
9988e07dc26bSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
9989e07dc26bSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
9990e07dc26bSmrg# --with-doxygen assumes 'auto'.
9991e07dc26bSmrg#
9992e07dc26bSmrg# Interface to module:
9993e07dc26bSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
9994e07dc26bSmrg# DOXYGEN:	 returns the path of the doxygen program found
9995e07dc26bSmrg#		 returns the path set by the user in the environment
9996e07dc26bSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
9997e07dc26bSmrg#		  'no' user instructs the module not to use doxygen
9998e07dc26bSmrg#
9999e07dc26bSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
10000e07dc26bSmrg#
10001e07dc26bSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
10002e07dc26bSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
10003e07dc26bSmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
10004e07dc26bSmrgm4_define([_defopt], m4_default([$2], [auto]))
10005e07dc26bSmrgAC_ARG_WITH(doxygen,
10006e07dc26bSmrg	AS_HELP_STRING([--with-doxygen],
10007e07dc26bSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
10008e07dc26bSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
10009e07dc26bSmrgm4_undefine([_defopt])
10010e07dc26bSmrg
10011e07dc26bSmrgif test "x$use_doxygen" = x"auto"; then
10012e07dc26bSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
10013e07dc26bSmrg   if test "x$DOXYGEN" = "x"; then
10014e07dc26bSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
10015e07dc26bSmrg	have_doxygen=no
10016e07dc26bSmrg   else
10017e07dc26bSmrg        have_doxygen=yes
10018e07dc26bSmrg   fi
10019e07dc26bSmrgelif test "x$use_doxygen" = x"yes" ; then
10020e07dc26bSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
10021e07dc26bSmrg   if test "x$DOXYGEN" = "x"; then
10022e07dc26bSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
10023e07dc26bSmrg   fi
10024e07dc26bSmrg   have_doxygen=yes
10025e07dc26bSmrgelif test "x$use_doxygen" = x"no" ; then
10026e07dc26bSmrg   if test "x$DOXYGEN" != "x"; then
10027e07dc26bSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
10028e07dc26bSmrg   fi
10029e07dc26bSmrg   have_doxygen=no
10030e07dc26bSmrgelse
10031e07dc26bSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
10032e07dc26bSmrgfi
10033e07dc26bSmrgm4_ifval([$1],
10034e07dc26bSmrg[if test "$have_doxygen" = yes; then
10035e07dc26bSmrg    # scrape the doxygen version
10036e07dc26bSmrg    AC_MSG_CHECKING([the doxygen version])
10037e07dc26bSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
10038e07dc26bSmrg    AC_MSG_RESULT([$doxygen_version])
10039e07dc26bSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
10040e07dc26bSmrg        [if test "x$use_doxygen" = xauto; then
10041e07dc26bSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
10042e07dc26bSmrg            have_doxygen=no
10043e07dc26bSmrg        else
10044e07dc26bSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
10045e07dc26bSmrg        fi])
10046e07dc26bSmrgfi])
10047e07dc26bSmrg
10048e07dc26bSmrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
10049e07dc26bSmrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
10050e07dc26bSmrgdnl 	HAVE_DOT = @HAVE_DOT@
10051e07dc26bSmrgHAVE_DOT=no
10052e07dc26bSmrgif test "x$have_doxygen" = "xyes"; then
10053e07dc26bSmrg  AC_PATH_PROG([DOT], [dot])
10054e07dc26bSmrg    if test "x$DOT" != "x"; then
10055e07dc26bSmrg      HAVE_DOT=yes
10056e07dc26bSmrg    fi
10057e07dc26bSmrgfi
10058e07dc26bSmrg
10059e07dc26bSmrgAC_SUBST([HAVE_DOT])
10060e07dc26bSmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
10061e07dc26bSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
10062e07dc26bSmrg]) # XORG_WITH_DOXYGEN
10063e07dc26bSmrg
10064e07dc26bSmrg# XORG_WITH_GROFF([DEFAULT])
10065e07dc26bSmrg# ----------------
10066e07dc26bSmrg# Minimum version: 1.6.0
10067e07dc26bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
10068e07dc26bSmrg#
10069e07dc26bSmrg# Documentation tools are not always available on all platforms and sometimes
10070e07dc26bSmrg# not at the appropriate level. This macro enables a module to test for the
10071e07dc26bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10072e07dc26bSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
10073e07dc26bSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
10074e07dc26bSmrg# --with-groff assumes 'auto'.
10075e07dc26bSmrg#
10076e07dc26bSmrg# Interface to module:
10077e07dc26bSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
10078e07dc26bSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
10079e07dc26bSmrg# HAVE_GROFF_MS: the -ms macros package
10080e07dc26bSmrg# GROFF:	 returns the path of the groff program found
10081e07dc26bSmrg#		 returns the path set by the user in the environment
10082e07dc26bSmrg# --with-groff:	 'yes' user instructs the module to use groff
10083e07dc26bSmrg#		 'no' user instructs the module not to use groff
10084e07dc26bSmrg#
10085e07dc26bSmrg# Added in version 1.9.0:
10086e07dc26bSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
10087e07dc26bSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
10088e07dc26bSmrg#		   psselect from the psutils package.
10089e07dc26bSmrg#		   the ghostcript package. Refer to the grohtml man pages
10090e07dc26bSmrg#
10091e07dc26bSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
10092e07dc26bSmrg#
10093e07dc26bSmrg# OS and distros often splits groff in a basic and full package, the former
10094e07dc26bSmrg# having the groff program and the later having devices, fonts and macros
10095e07dc26bSmrg# Checking for the groff executable is not enough.
10096e07dc26bSmrg#
10097e07dc26bSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
10098e07dc26bSmrg# unset HAVE_GROFF or GROFF env variables.
10099e07dc26bSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
10100e07dc26bSmrg#
10101e07dc26bSmrgAC_DEFUN([XORG_WITH_GROFF],[
10102e07dc26bSmrgAC_ARG_VAR([GROFF], [Path to groff command])
10103e07dc26bSmrgm4_define([_defopt], m4_default([$1], [auto]))
10104e07dc26bSmrgAC_ARG_WITH(groff,
10105e07dc26bSmrg	AS_HELP_STRING([--with-groff],
10106e07dc26bSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
10107e07dc26bSmrg	   [use_groff=$withval], [use_groff=]_defopt)
10108e07dc26bSmrgm4_undefine([_defopt])
10109e07dc26bSmrg
10110e07dc26bSmrgif test "x$use_groff" = x"auto"; then
10111e07dc26bSmrg   AC_PATH_PROG([GROFF], [groff])
10112e07dc26bSmrg   if test "x$GROFF" = "x"; then
10113e07dc26bSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
10114e07dc26bSmrg	have_groff=no
10115e07dc26bSmrg   else
10116e07dc26bSmrg        have_groff=yes
10117e07dc26bSmrg   fi
10118e07dc26bSmrgelif test "x$use_groff" = x"yes" ; then
10119e07dc26bSmrg   AC_PATH_PROG([GROFF], [groff])
10120e07dc26bSmrg   if test "x$GROFF" = "x"; then
10121e07dc26bSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
10122e07dc26bSmrg   fi
10123e07dc26bSmrg   have_groff=yes
10124e07dc26bSmrgelif test "x$use_groff" = x"no" ; then
10125e07dc26bSmrg   if test "x$GROFF" != "x"; then
10126e07dc26bSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
10127e07dc26bSmrg   fi
10128e07dc26bSmrg   have_groff=no
10129e07dc26bSmrgelse
10130e07dc26bSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
10131e07dc26bSmrgfi
10132e07dc26bSmrg
10133e07dc26bSmrg# We have groff, test for the presence of the macro packages
10134e07dc26bSmrgif test "x$have_groff" = x"yes"; then
10135e07dc26bSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
10136e07dc26bSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
10137e07dc26bSmrg        groff_ms_works=yes
10138e07dc26bSmrg    else
10139e07dc26bSmrg        groff_ms_works=no
10140e07dc26bSmrg    fi
10141e07dc26bSmrg    AC_MSG_RESULT([$groff_ms_works])
10142e07dc26bSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
10143e07dc26bSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
10144e07dc26bSmrg        groff_mm_works=yes
10145e07dc26bSmrg    else
10146e07dc26bSmrg        groff_mm_works=no
10147e07dc26bSmrg    fi
10148e07dc26bSmrg    AC_MSG_RESULT([$groff_mm_works])
10149e07dc26bSmrgfi
10150e07dc26bSmrg
10151e07dc26bSmrg# We have groff, test for HTML dependencies, one command per package
10152e07dc26bSmrgif test "x$have_groff" = x"yes"; then
10153e07dc26bSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
10154e07dc26bSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
10155e07dc26bSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
10156e07dc26bSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
10157e07dc26bSmrg      have_groff_html=yes
10158e07dc26bSmrg   else
10159e07dc26bSmrg      have_groff_html=no
10160e07dc26bSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
10161e07dc26bSmrg   fi
10162e07dc26bSmrgfi
10163e07dc26bSmrg
10164e07dc26bSmrg# Set Automake conditionals for Makefiles
10165e07dc26bSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
10166e07dc26bSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
10167e07dc26bSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
10168e07dc26bSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
10169e07dc26bSmrg]) # XORG_WITH_GROFF
10170e07dc26bSmrg
10171e07dc26bSmrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
10172e07dc26bSmrg# ---------------------------------------
10173e07dc26bSmrg# Minimum version: 1.6.0
10174e07dc26bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
10175e07dc26bSmrg# Minimum version for optional MIN-VERSION argument: 1.15.0
10176e07dc26bSmrg#
10177e07dc26bSmrg# Documentation tools are not always available on all platforms and sometimes
10178e07dc26bSmrg# not at the appropriate level. This macro enables a module to test for the
10179e07dc26bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10180e07dc26bSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
10181e07dc26bSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
10182e07dc26bSmrg# --with-fop assumes 'auto'.
10183e07dc26bSmrg#
10184e07dc26bSmrg# Interface to module:
10185e07dc26bSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
10186e07dc26bSmrg# FOP:	 	returns the path of the fop program found
10187e07dc26bSmrg#		returns the path set by the user in the environment
10188e07dc26bSmrg# --with-fop: 	'yes' user instructs the module to use fop
10189e07dc26bSmrg#		'no' user instructs the module not to use fop
10190e07dc26bSmrg#
10191e07dc26bSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
10192e07dc26bSmrg#
10193e07dc26bSmrgAC_DEFUN([XORG_WITH_FOP],[
10194e07dc26bSmrgAC_ARG_VAR([FOP], [Path to fop command])
10195e07dc26bSmrgm4_define([_defopt], m4_default([$2], [auto]))
10196e07dc26bSmrgAC_ARG_WITH(fop,
10197e07dc26bSmrg	AS_HELP_STRING([--with-fop],
10198e07dc26bSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
10199e07dc26bSmrg	   [use_fop=$withval], [use_fop=]_defopt)
10200e07dc26bSmrgm4_undefine([_defopt])
10201e07dc26bSmrg
10202e07dc26bSmrgif test "x$use_fop" = x"auto"; then
10203e07dc26bSmrg   AC_PATH_PROG([FOP], [fop])
10204e07dc26bSmrg   if test "x$FOP" = "x"; then
10205e07dc26bSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
10206e07dc26bSmrg	have_fop=no
10207e07dc26bSmrg   else
10208e07dc26bSmrg        have_fop=yes
10209e07dc26bSmrg   fi
10210e07dc26bSmrgelif test "x$use_fop" = x"yes" ; then
10211e07dc26bSmrg   AC_PATH_PROG([FOP], [fop])
10212e07dc26bSmrg   if test "x$FOP" = "x"; then
10213e07dc26bSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
10214e07dc26bSmrg   fi
10215e07dc26bSmrg   have_fop=yes
10216e07dc26bSmrgelif test "x$use_fop" = x"no" ; then
10217e07dc26bSmrg   if test "x$FOP" != "x"; then
10218e07dc26bSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
10219e07dc26bSmrg   fi
10220e07dc26bSmrg   have_fop=no
10221e07dc26bSmrgelse
10222e07dc26bSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
10223e07dc26bSmrgfi
10224e07dc26bSmrg
10225e07dc26bSmrg# Test for a minimum version of fop, if provided.
10226e07dc26bSmrgm4_ifval([$1],
10227e07dc26bSmrg[if test "$have_fop" = yes; then
10228e07dc26bSmrg    # scrape the fop version
10229e07dc26bSmrg    AC_MSG_CHECKING([for fop minimum version])
10230e07dc26bSmrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
10231e07dc26bSmrg    AC_MSG_RESULT([$fop_version])
10232e07dc26bSmrg    AS_VERSION_COMPARE([$fop_version], [$1],
10233e07dc26bSmrg        [if test "x$use_fop" = xauto; then
10234e07dc26bSmrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
10235e07dc26bSmrg            have_fop=no
10236e07dc26bSmrg        else
10237e07dc26bSmrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
10238e07dc26bSmrg        fi])
10239e07dc26bSmrgfi])
10240e07dc26bSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
10241e07dc26bSmrg]) # XORG_WITH_FOP
10242e07dc26bSmrg
10243e07dc26bSmrg# XORG_WITH_M4([MIN-VERSION])
10244e07dc26bSmrg# ---------------------------
10245e07dc26bSmrg# Minimum version: 1.19.0
10246e07dc26bSmrg#
10247e07dc26bSmrg# This macro attempts to locate an m4 macro processor which supports
10248e07dc26bSmrg# -I option and is only useful for modules relying on M4 in order to
10249e07dc26bSmrg# expand macros in source code files.
10250e07dc26bSmrg#
10251e07dc26bSmrg# Interface to module:
10252e07dc26bSmrg# M4:	 	returns the path of the m4 program found
10253e07dc26bSmrg#		returns the path set by the user in the environment
10254e07dc26bSmrg#
10255e07dc26bSmrgAC_DEFUN([XORG_WITH_M4], [
10256e07dc26bSmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
10257e07dc26bSmrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
10258e07dc26bSmrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
10259e07dc26bSmrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
10260e07dc26bSmrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
10261e07dc26bSmrg   [$PATH:/usr/gnu/bin])])
10262e07dc26bSmrg
10263e07dc26bSmrgAC_SUBST([M4], [$ac_cv_path_M4])
10264e07dc26bSmrg]) # XORG_WITH_M4
10265e07dc26bSmrg
10266e07dc26bSmrg# XORG_WITH_PS2PDF([DEFAULT])
10267e07dc26bSmrg# ----------------
10268e07dc26bSmrg# Minimum version: 1.6.0
10269e07dc26bSmrg# Minimum version for optional DEFAULT argument: 1.11.0
10270e07dc26bSmrg#
10271e07dc26bSmrg# Documentation tools are not always available on all platforms and sometimes
10272e07dc26bSmrg# not at the appropriate level. This macro enables a module to test for the
10273e07dc26bSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10274e07dc26bSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
10275e07dc26bSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
10276e07dc26bSmrg# --with-ps2pdf assumes 'auto'.
10277e07dc26bSmrg#
10278e07dc26bSmrg# Interface to module:
10279e07dc26bSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
10280e07dc26bSmrg# PS2PDF:	returns the path of the ps2pdf program found
10281e07dc26bSmrg#		returns the path set by the user in the environment
10282e07dc26bSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
10283e07dc26bSmrg#		 'no' user instructs the module not to use ps2pdf
10284e07dc26bSmrg#
10285e07dc26bSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
10286e07dc26bSmrg#
10287e07dc26bSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
10288e07dc26bSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
10289e07dc26bSmrgm4_define([_defopt], m4_default([$1], [auto]))
10290e07dc26bSmrgAC_ARG_WITH(ps2pdf,
10291e07dc26bSmrg	AS_HELP_STRING([--with-ps2pdf],
10292e07dc26bSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
10293e07dc26bSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
10294e07dc26bSmrgm4_undefine([_defopt])
10295e07dc26bSmrg
10296e07dc26bSmrgif test "x$use_ps2pdf" = x"auto"; then
10297e07dc26bSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
10298e07dc26bSmrg   if test "x$PS2PDF" = "x"; then
10299e07dc26bSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
10300e07dc26bSmrg	have_ps2pdf=no
10301e07dc26bSmrg   else
10302e07dc26bSmrg        have_ps2pdf=yes
10303e07dc26bSmrg   fi
10304e07dc26bSmrgelif test "x$use_ps2pdf" = x"yes" ; then
10305e07dc26bSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
10306e07dc26bSmrg   if test "x$PS2PDF" = "x"; then
10307e07dc26bSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
10308e07dc26bSmrg   fi
10309e07dc26bSmrg   have_ps2pdf=yes
10310e07dc26bSmrgelif test "x$use_ps2pdf" = x"no" ; then
10311e07dc26bSmrg   if test "x$PS2PDF" != "x"; then
10312e07dc26bSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
10313e07dc26bSmrg   fi
10314e07dc26bSmrg   have_ps2pdf=no
10315e07dc26bSmrgelse
10316e07dc26bSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
10317e07dc26bSmrgfi
10318e07dc26bSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
10319e07dc26bSmrg]) # XORG_WITH_PS2PDF
10320e07dc26bSmrg
10321e07dc26bSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
10322e07dc26bSmrg# ----------------
10323e07dc26bSmrg# Minimum version: 1.6.0
10324e07dc26bSmrg#
10325e07dc26bSmrg# Documentation tools are not always available on all platforms and sometimes
10326e07dc26bSmrg# not at the appropriate level. This macro enables a builder to skip all
10327e07dc26bSmrg# documentation targets except traditional man pages.
10328e07dc26bSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10329e07dc26bSmrg# maximum flexibilty in controlling documentation building.
10330e07dc26bSmrg# Refer to:
10331e07dc26bSmrg# XORG_WITH_XMLTO         --with-xmlto
10332e07dc26bSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10333e07dc26bSmrg# XORG_WITH_DOXYGEN       --with-doxygen
10334e07dc26bSmrg# XORG_WITH_FOP           --with-fop
10335e07dc26bSmrg# XORG_WITH_GROFF         --with-groff
10336e07dc26bSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
10337e07dc26bSmrg#
10338e07dc26bSmrg# Interface to module:
10339e07dc26bSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
10340e07dc26bSmrg# --enable-docs: 'yes' user instructs the module to generate docs
10341e07dc26bSmrg#		 'no' user instructs the module not to generate docs
10342e07dc26bSmrg# parm1:	specify the default value, yes or no.
10343e07dc26bSmrg#
10344e07dc26bSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
10345e07dc26bSmrgm4_define([docs_default], m4_default([$1], [yes]))
10346e07dc26bSmrgAC_ARG_ENABLE(docs,
10347e07dc26bSmrg	AS_HELP_STRING([--enable-docs],
10348e07dc26bSmrg	   [Enable building the documentation (default: ]docs_default[)]),
10349e07dc26bSmrg	   [build_docs=$enableval], [build_docs=]docs_default)
10350e07dc26bSmrgm4_undefine([docs_default])
10351e07dc26bSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
10352e07dc26bSmrgAC_MSG_CHECKING([whether to build documentation])
10353e07dc26bSmrgAC_MSG_RESULT([$build_docs])
10354e07dc26bSmrg]) # XORG_ENABLE_DOCS
10355e07dc26bSmrg
10356e07dc26bSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
10357e07dc26bSmrg# ----------------
10358e07dc26bSmrg# Minimum version: 1.6.0
10359e07dc26bSmrg#
10360e07dc26bSmrg# This macro enables a builder to skip all developer documentation.
10361e07dc26bSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10362e07dc26bSmrg# maximum flexibilty in controlling documentation building.
10363e07dc26bSmrg# Refer to:
10364e07dc26bSmrg# XORG_WITH_XMLTO         --with-xmlto
10365e07dc26bSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10366e07dc26bSmrg# XORG_WITH_DOXYGEN       --with-doxygen
10367e07dc26bSmrg# XORG_WITH_FOP           --with-fop
10368e07dc26bSmrg# XORG_WITH_GROFF         --with-groff
10369e07dc26bSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
10370e07dc26bSmrg#
10371e07dc26bSmrg# Interface to module:
10372e07dc26bSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
10373e07dc26bSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
10374e07dc26bSmrg#			'no' user instructs the module not to generate developer docs
10375e07dc26bSmrg# parm1:		specify the default value, yes or no.
10376e07dc26bSmrg#
10377e07dc26bSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
10378e07dc26bSmrgm4_define([devel_default], m4_default([$1], [yes]))
10379e07dc26bSmrgAC_ARG_ENABLE(devel-docs,
10380e07dc26bSmrg	AS_HELP_STRING([--enable-devel-docs],
10381e07dc26bSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
10382e07dc26bSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
10383e07dc26bSmrgm4_undefine([devel_default])
10384e07dc26bSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
10385e07dc26bSmrgAC_MSG_CHECKING([whether to build developer documentation])
10386e07dc26bSmrgAC_MSG_RESULT([$build_devel_docs])
10387e07dc26bSmrg]) # XORG_ENABLE_DEVEL_DOCS
10388e07dc26bSmrg
10389e07dc26bSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
10390e07dc26bSmrg# ----------------
10391e07dc26bSmrg# Minimum version: 1.6.0
10392e07dc26bSmrg#
10393e07dc26bSmrg# This macro enables a builder to skip all functional specification targets.
10394e07dc26bSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10395e07dc26bSmrg# maximum flexibilty in controlling documentation building.
10396e07dc26bSmrg# Refer to:
10397e07dc26bSmrg# XORG_WITH_XMLTO         --with-xmlto
10398e07dc26bSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10399e07dc26bSmrg# XORG_WITH_DOXYGEN       --with-doxygen
10400e07dc26bSmrg# XORG_WITH_FOP           --with-fop
10401e07dc26bSmrg# XORG_WITH_GROFF         --with-groff
10402e07dc26bSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
10403e07dc26bSmrg#
10404e07dc26bSmrg# Interface to module:
10405e07dc26bSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
10406e07dc26bSmrg# --enable-specs:	'yes' user instructs the module to generate specs
10407e07dc26bSmrg#			'no' user instructs the module not to generate specs
10408e07dc26bSmrg# parm1:		specify the default value, yes or no.
10409e07dc26bSmrg#
10410e07dc26bSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
10411e07dc26bSmrgm4_define([spec_default], m4_default([$1], [yes]))
10412e07dc26bSmrgAC_ARG_ENABLE(specs,
10413e07dc26bSmrg	AS_HELP_STRING([--enable-specs],
10414e07dc26bSmrg	   [Enable building the specs (default: ]spec_default[)]),
10415e07dc26bSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
10416e07dc26bSmrgm4_undefine([spec_default])
10417e07dc26bSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
10418e07dc26bSmrgAC_MSG_CHECKING([whether to build functional specifications])
10419e07dc26bSmrgAC_MSG_RESULT([$build_specs])
10420e07dc26bSmrg]) # XORG_ENABLE_SPECS
10421e07dc26bSmrg
10422e07dc26bSmrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
10423e07dc26bSmrg# ----------------------------------------------
10424e07dc26bSmrg# Minimum version: 1.13.0
10425e07dc26bSmrg#
10426e07dc26bSmrg# This macro enables a builder to enable/disable unit testing
10427e07dc26bSmrg# It makes no assumption about the test cases implementation
10428e07dc26bSmrg# Test cases may or may not use Automake "Support for test suites"
10429e07dc26bSmrg# They may or may not use the software utility library GLib
10430e07dc26bSmrg#
10431e07dc26bSmrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
10432e07dc26bSmrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
10433e07dc26bSmrg# The variable enable_unit_tests is used by other macros in this file.
10434e07dc26bSmrg#
10435e07dc26bSmrg# Interface to module:
10436e07dc26bSmrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
10437e07dc26bSmrg# enable_unit_tests:    used in configure.ac for additional configuration
10438e07dc26bSmrg# --enable-unit-tests:	'yes' user instructs the module to build tests
10439e07dc26bSmrg#			'no' user instructs the module not to build tests
10440e07dc26bSmrg# parm1:		specify the default value, yes or no.
10441e07dc26bSmrg#
10442e07dc26bSmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
10443e07dc26bSmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
10444e07dc26bSmrgAC_BEFORE([$0], [XORG_LD_WRAP])
10445e07dc26bSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10446e07dc26bSmrgm4_define([_defopt], m4_default([$1], [auto]))
10447e07dc26bSmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
10448e07dc26bSmrg	[Enable building unit test cases (default: ]_defopt[)]),
10449e07dc26bSmrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
10450e07dc26bSmrgm4_undefine([_defopt])
10451e07dc26bSmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
10452e07dc26bSmrgAC_MSG_CHECKING([whether to build unit test cases])
10453e07dc26bSmrgAC_MSG_RESULT([$enable_unit_tests])
10454e07dc26bSmrg]) # XORG_ENABLE_UNIT_TESTS
10455e07dc26bSmrg
10456e07dc26bSmrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
10457e07dc26bSmrg# ------------------------------------------------------
10458e07dc26bSmrg# Minimum version: 1.17.0
10459e07dc26bSmrg#
10460e07dc26bSmrg# This macro enables a builder to enable/disable integration testing
10461e07dc26bSmrg# It makes no assumption about the test cases' implementation
10462e07dc26bSmrg# Test cases may or may not use Automake "Support for test suites"
10463e07dc26bSmrg#
10464e07dc26bSmrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
10465e07dc26bSmrg# usually requires less dependencies and may be built and run under less
10466e07dc26bSmrg# stringent environments than integration tests.
10467e07dc26bSmrg#
10468e07dc26bSmrg# Interface to module:
10469e07dc26bSmrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
10470e07dc26bSmrg# enable_integration_tests:   used in configure.ac for additional configuration
10471e07dc26bSmrg# --enable-integration-tests: 'yes' user instructs the module to build tests
10472e07dc26bSmrg#                             'no' user instructs the module not to build tests
10473e07dc26bSmrg# parm1:                      specify the default value, yes or no.
10474e07dc26bSmrg#
10475e07dc26bSmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
10476e07dc26bSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10477e07dc26bSmrgm4_define([_defopt], m4_default([$1], [auto]))
10478e07dc26bSmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
10479e07dc26bSmrg	[Enable building integration test cases (default: ]_defopt[)]),
10480e07dc26bSmrg	[enable_integration_tests=$enableval],
10481e07dc26bSmrg	[enable_integration_tests=]_defopt)
10482e07dc26bSmrgm4_undefine([_defopt])
10483e07dc26bSmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
10484e07dc26bSmrg	[test "x$enable_integration_tests" != xno])
10485e07dc26bSmrgAC_MSG_CHECKING([whether to build unit test cases])
10486e07dc26bSmrgAC_MSG_RESULT([$enable_integration_tests])
10487e07dc26bSmrg]) # XORG_ENABLE_INTEGRATION_TESTS
10488e07dc26bSmrg
10489e07dc26bSmrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
10490e07dc26bSmrg# ----------------------------------------
10491e07dc26bSmrg# Minimum version: 1.13.0
10492e07dc26bSmrg#
10493e07dc26bSmrg# GLib is a library which provides advanced data structures and functions.
10494e07dc26bSmrg# This macro enables a module to test for the presence of Glib.
10495e07dc26bSmrg#
10496e07dc26bSmrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
10497e07dc26bSmrg# Otherwise the value of $enable_unit_tests is blank.
10498e07dc26bSmrg#
10499e07dc26bSmrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
10500e07dc26bSmrg# test support usually requires less dependencies and may be built and run under
10501e07dc26bSmrg# less stringent environments than integration tests.
10502e07dc26bSmrg#
10503e07dc26bSmrg# Interface to module:
10504e07dc26bSmrg# HAVE_GLIB: used in makefiles to conditionally build targets
10505e07dc26bSmrg# with_glib: used in configure.ac to know if GLib has been found
10506e07dc26bSmrg# --with-glib:	'yes' user instructs the module to use glib
10507e07dc26bSmrg#		'no' user instructs the module not to use glib
10508e07dc26bSmrg#
10509e07dc26bSmrgAC_DEFUN([XORG_WITH_GLIB],[
10510e07dc26bSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
10511e07dc26bSmrgm4_define([_defopt], m4_default([$2], [auto]))
10512e07dc26bSmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
10513e07dc26bSmrg	[Use GLib library for unit testing (default: ]_defopt[)]),
10514e07dc26bSmrg	[with_glib=$withval], [with_glib=]_defopt)
10515e07dc26bSmrgm4_undefine([_defopt])
10516e07dc26bSmrg
10517e07dc26bSmrghave_glib=no
10518e07dc26bSmrg# Do not probe GLib if user explicitly disabled unit testing
10519e07dc26bSmrgif test "x$enable_unit_tests" != x"no"; then
10520e07dc26bSmrg  # Do not probe GLib if user explicitly disabled it
10521e07dc26bSmrg  if test "x$with_glib" != x"no"; then
10522e07dc26bSmrg    m4_ifval(
10523e07dc26bSmrg      [$1],
10524e07dc26bSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
10525e07dc26bSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
10526e07dc26bSmrg    )
10527e07dc26bSmrg  fi
10528e07dc26bSmrgfi
10529e07dc26bSmrg
10530e07dc26bSmrg# Not having GLib when unit testing has been explicitly requested is an error
10531e07dc26bSmrgif test "x$enable_unit_tests" = x"yes"; then
10532e07dc26bSmrg  if test "x$have_glib" = x"no"; then
10533e07dc26bSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10534e07dc26bSmrg  fi
10535e07dc26bSmrgfi
10536e07dc26bSmrg
10537e07dc26bSmrg# Having unit testing disabled when GLib has been explicitly requested is an error
10538e07dc26bSmrgif test "x$enable_unit_tests" = x"no"; then
10539e07dc26bSmrg  if test "x$with_glib" = x"yes"; then
10540e07dc26bSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10541e07dc26bSmrg  fi
10542e07dc26bSmrgfi
10543e07dc26bSmrg
10544e07dc26bSmrg# Not having GLib when it has been explicitly requested is an error
10545e07dc26bSmrgif test "x$with_glib" = x"yes"; then
10546e07dc26bSmrg  if test "x$have_glib" = x"no"; then
10547e07dc26bSmrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
10548e07dc26bSmrg  fi
10549e07dc26bSmrgfi
10550e07dc26bSmrg
10551e07dc26bSmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
10552e07dc26bSmrg]) # XORG_WITH_GLIB
10553e07dc26bSmrg
10554e07dc26bSmrg# XORG_LD_WRAP([required|optional])
10555e07dc26bSmrg# ---------------------------------
10556e07dc26bSmrg# Minimum version: 1.13.0
10557e07dc26bSmrg#
10558e07dc26bSmrg# Check if linker supports -wrap, passed via compiler flags
10559e07dc26bSmrg#
10560e07dc26bSmrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
10561e07dc26bSmrg# Otherwise the value of $enable_unit_tests is blank.
10562e07dc26bSmrg#
10563e07dc26bSmrg# Argument added in 1.16.0 - default is "required", to match existing behavior
10564e07dc26bSmrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
10565e07dc26bSmrg# available, an argument of "optional" allows use when some unit tests require
10566e07dc26bSmrg# ld -wrap and others do not.
10567e07dc26bSmrg#
10568e07dc26bSmrgAC_DEFUN([XORG_LD_WRAP],[
10569e07dc26bSmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
10570e07dc26bSmrg    [AC_LANG_PROGRAM([#include <stdlib.h>
10571e07dc26bSmrg                      void __wrap_exit(int status) { return; }],
10572e07dc26bSmrg                     [exit(0);])])
10573e07dc26bSmrg# Not having ld wrap when unit testing has been explicitly requested is an error
10574e07dc26bSmrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
10575e07dc26bSmrg  if test "x$have_ld_wrap" = x"no"; then
10576e07dc26bSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
10577e07dc26bSmrg  fi
10578e07dc26bSmrgfi
10579e07dc26bSmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
10580e07dc26bSmrg#
10581e07dc26bSmrg]) # XORG_LD_WRAP
10582e07dc26bSmrg
10583e07dc26bSmrg# XORG_CHECK_LINKER_FLAGS
10584e07dc26bSmrg# -----------------------
10585e07dc26bSmrg# SYNOPSIS
10586e07dc26bSmrg#
10587e07dc26bSmrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
10588e07dc26bSmrg#
10589e07dc26bSmrg# DESCRIPTION
10590e07dc26bSmrg#
10591e07dc26bSmrg#   Check whether the given linker FLAGS work with the current language's
10592e07dc26bSmrg#   linker, or whether they give an error.
10593e07dc26bSmrg#
10594e07dc26bSmrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
10595e07dc26bSmrg#   success/failure.
10596e07dc26bSmrg#
10597e07dc26bSmrg#   PROGRAM-SOURCE is the program source to link with, if needed
10598e07dc26bSmrg#
10599e07dc26bSmrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
10600e07dc26bSmrg#
10601e07dc26bSmrg# LICENSE
10602e07dc26bSmrg#
10603e07dc26bSmrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
10604e07dc26bSmrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
10605e07dc26bSmrg#   Copyright (c) 2009 Matteo Frigo
10606e07dc26bSmrg#
10607e07dc26bSmrg#   This program is free software: you can redistribute it and/or modify it
10608e07dc26bSmrg#   under the terms of the GNU General Public License as published by the
10609e07dc26bSmrg#   Free Software Foundation, either version 3 of the License, or (at your
10610e07dc26bSmrg#   option) any later version.
10611e07dc26bSmrg#
10612e07dc26bSmrg#   This program is distributed in the hope that it will be useful, but
10613e07dc26bSmrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
10614e07dc26bSmrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
10615e07dc26bSmrg#   Public License for more details.
10616e07dc26bSmrg#
10617e07dc26bSmrg#   You should have received a copy of the GNU General Public License along
10618e07dc26bSmrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
10619e07dc26bSmrg#
10620e07dc26bSmrg#   As a special exception, the respective Autoconf Macro's copyright owner
10621e07dc26bSmrg#   gives unlimited permission to copy, distribute and modify the configure
10622e07dc26bSmrg#   scripts that are the output of Autoconf when processing the Macro. You
10623e07dc26bSmrg#   need not follow the terms of the GNU General Public License when using
10624e07dc26bSmrg#   or distributing such scripts, even though portions of the text of the
10625e07dc26bSmrg#   Macro appear in them. The GNU General Public License (GPL) does govern
10626e07dc26bSmrg#   all other use of the material that constitutes the Autoconf Macro.
10627e07dc26bSmrg#
10628e07dc26bSmrg#   This special exception to the GPL applies to versions of the Autoconf
10629e07dc26bSmrg#   Macro released by the Autoconf Archive. When you make and distribute a
10630e07dc26bSmrg#   modified version of the Autoconf Macro, you may extend this special
10631e07dc26bSmrg#   exception to the GPL to apply to your modified version as well.#
10632e07dc26bSmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
10633e07dc26bSmrg[AC_MSG_CHECKING([whether the linker accepts $1])
10634e07dc26bSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
10635e07dc26bSmrgAS_LITERAL_IF([$1],
10636e07dc26bSmrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
10637e07dc26bSmrg      ax_save_FLAGS=$LDFLAGS
10638e07dc26bSmrg      LDFLAGS="$1"
10639e07dc26bSmrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
10640e07dc26bSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
10641e07dc26bSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
10642e07dc26bSmrg      LDFLAGS=$ax_save_FLAGS])],
10643e07dc26bSmrg  [ax_save_FLAGS=$LDFLAGS
10644e07dc26bSmrg   LDFLAGS="$1"
10645e07dc26bSmrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
10646e07dc26bSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
10647e07dc26bSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
10648e07dc26bSmrg   LDFLAGS=$ax_save_FLAGS])
10649e07dc26bSmrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
10650e07dc26bSmrgAC_MSG_RESULT($xorg_check_linker_flags)
10651e07dc26bSmrgif test "x$xorg_check_linker_flags" = xyes; then
10652e07dc26bSmrg	m4_default([$2], :)
10653e07dc26bSmrgelse
10654e07dc26bSmrg	m4_default([$3], :)
10655e07dc26bSmrgfi
10656e07dc26bSmrg]) # XORG_CHECK_LINKER_FLAGS
10657e07dc26bSmrg
10658e07dc26bSmrg# XORG_MEMORY_CHECK_FLAGS
10659e07dc26bSmrg# -----------------------
10660e07dc26bSmrg# Minimum version: 1.16.0
10661e07dc26bSmrg#
10662e07dc26bSmrg# This macro attempts to find appropriate memory checking functionality
10663e07dc26bSmrg# for various platforms which unit testing code may use to catch various
10664e07dc26bSmrg# forms of memory allocation and access errors in testing.
10665e07dc26bSmrg#
10666e07dc26bSmrg# Interface to module:
10667e07dc26bSmrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
10668e07dc26bSmrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
10669e07dc26bSmrg#
10670e07dc26bSmrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
10671e07dc26bSmrg#
10672e07dc26bSmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
10673e07dc26bSmrg
10674e07dc26bSmrgAC_REQUIRE([AC_CANONICAL_HOST])
10675e07dc26bSmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
10676e07dc26bSmrg           [Environment variables to enable memory checking in tests])
10677e07dc26bSmrg
10678e07dc26bSmrg# Check for different types of support on different platforms
10679e07dc26bSmrgcase $host_os in
10680e07dc26bSmrg    solaris*)
10681e07dc26bSmrg        AC_CHECK_LIB([umem], [umem_alloc],
10682e07dc26bSmrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
10683e07dc26bSmrg        ;;
10684e07dc26bSmrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
10685e07dc26bSmrg        # both directly and inverted, so should not be 0 or 255.
10686e07dc26bSmrg        malloc_debug_env='MALLOC_PERTURB_=15'
10687e07dc26bSmrg        ;;
10688e07dc26bSmrg    darwin*)
10689e07dc26bSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
10690e07dc26bSmrg        ;;
10691e07dc26bSmrg    *bsd*)
10692e07dc26bSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
10693e07dc26bSmrg        ;;
10694e07dc26bSmrgesac
10695e07dc26bSmrg
10696e07dc26bSmrg# User supplied flags override default flags
10697e07dc26bSmrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
10698e07dc26bSmrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
10699e07dc26bSmrgfi
10700e07dc26bSmrg
10701e07dc26bSmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
10702e07dc26bSmrg]) # XORG_WITH_LINT
10703e07dc26bSmrg
10704e07dc26bSmrg# XORG_CHECK_MALLOC_ZERO
10705e07dc26bSmrg# ----------------------
10706e07dc26bSmrg# Minimum version: 1.0.0
10707e07dc26bSmrg#
10708e07dc26bSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
10709e07dc26bSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
10710e07dc26bSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
10711e07dc26bSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
10712e07dc26bSmrgAC_ARG_ENABLE(malloc0returnsnull,
10713e07dc26bSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
10714e07dc26bSmrg		       [malloc(0) returns NULL (default: auto)]),
10715e07dc26bSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
10716e07dc26bSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
10717e07dc26bSmrg
10718e07dc26bSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
10719e07dc26bSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
10720e07dc26bSmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
10721e07dc26bSmrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
10722e07dc26bSmrg#include <stdlib.h>
10723e07dc26bSmrg],[
10724e07dc26bSmrg    char *m0, *r0, *c0, *p;
10725e07dc26bSmrg    m0 = malloc(0);
10726e07dc26bSmrg    p = malloc(10);
10727e07dc26bSmrg    r0 = realloc(p,0);
10728e07dc26bSmrg    c0 = calloc(0,10);
10729e07dc26bSmrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
10730e07dc26bSmrg])],
10731e07dc26bSmrg		[xorg_cv_malloc0_returns_null=yes],
10732e07dc26bSmrg		[xorg_cv_malloc0_returns_null=no])])
10733e07dc26bSmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
10734e07dc26bSmrgfi
10735e07dc26bSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
10736e07dc26bSmrg
10737e07dc26bSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
10738e07dc26bSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
10739e07dc26bSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
10740e07dc26bSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
10741e07dc26bSmrgelse
10742e07dc26bSmrg	MALLOC_ZERO_CFLAGS=""
10743e07dc26bSmrg	XMALLOC_ZERO_CFLAGS=""
10744e07dc26bSmrg	XTMALLOC_ZERO_CFLAGS=""
10745e07dc26bSmrgfi
10746e07dc26bSmrg
10747e07dc26bSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
10748e07dc26bSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
10749e07dc26bSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
10750e07dc26bSmrg]) # XORG_CHECK_MALLOC_ZERO
10751e07dc26bSmrg
10752e07dc26bSmrg# XORG_WITH_LINT()
10753e07dc26bSmrg# ----------------
10754e07dc26bSmrg# Minimum version: 1.1.0
10755e07dc26bSmrg#
10756e07dc26bSmrg# This macro enables the use of a tool that flags some suspicious and
10757e07dc26bSmrg# non-portable constructs (likely to be bugs) in C language source code.
10758e07dc26bSmrg# It will attempt to locate the tool and use appropriate options.
10759e07dc26bSmrg# There are various lint type tools on different platforms.
10760e07dc26bSmrg#
10761e07dc26bSmrg# Interface to module:
10762e07dc26bSmrg# LINT:		returns the path to the tool found on the platform
10763e07dc26bSmrg#		or the value set to LINT on the configure cmd line
10764e07dc26bSmrg#		also an Automake conditional
10765e07dc26bSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
10766e07dc26bSmrg#
10767e07dc26bSmrg# --with-lint:	'yes' user instructs the module to use lint
10768e07dc26bSmrg#		'no' user instructs the module not to use lint (default)
10769e07dc26bSmrg#
10770e07dc26bSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
10771e07dc26bSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
10772e07dc26bSmrg#
10773e07dc26bSmrgAC_DEFUN([XORG_WITH_LINT],[
10774e07dc26bSmrg
10775e07dc26bSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
10776e07dc26bSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
10777e07dc26bSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
10778e07dc26bSmrg		[Use a lint-style source code checker (default: disabled)])],
10779e07dc26bSmrg		[use_lint=$withval], [use_lint=no])
10780e07dc26bSmrg
10781e07dc26bSmrg# Obtain platform specific info like program name and options
10782e07dc26bSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
10783e07dc26bSmrgcase $host_os in
10784e07dc26bSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
10785e07dc26bSmrg	lint_name=splint
10786e07dc26bSmrg	lint_options="-badflag"
10787e07dc26bSmrg	;;
10788e07dc26bSmrg  *freebsd* | *netbsd*)
10789e07dc26bSmrg	lint_name=lint
10790e07dc26bSmrg	lint_options="-u -b"
10791e07dc26bSmrg	;;
10792e07dc26bSmrg  *solaris*)
10793e07dc26bSmrg	lint_name=lint
10794e07dc26bSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
10795e07dc26bSmrg	;;
10796e07dc26bSmrgesac
10797e07dc26bSmrg
10798e07dc26bSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
10799e07dc26bSmrgif test "x$use_lint" = x"yes" ; then
10800e07dc26bSmrg   AC_PATH_PROG([LINT], [$lint_name])
10801e07dc26bSmrg   if test "x$LINT" = "x"; then
10802e07dc26bSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
10803e07dc26bSmrg   fi
10804e07dc26bSmrgelif test "x$use_lint" = x"no" ; then
10805e07dc26bSmrg   if test "x$LINT" != "x"; then
10806e07dc26bSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
10807e07dc26bSmrg   fi
10808e07dc26bSmrgelse
10809e07dc26bSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
10810e07dc26bSmrgfi
10811e07dc26bSmrg
10812e07dc26bSmrg# User supplied flags override default flags
10813e07dc26bSmrgif test "x$LINT_FLAGS" != "x"; then
10814e07dc26bSmrg   lint_options=$LINT_FLAGS
10815e07dc26bSmrgfi
10816e07dc26bSmrg
10817e07dc26bSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
10818e07dc26bSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
10819e07dc26bSmrg
10820e07dc26bSmrg]) # XORG_WITH_LINT
10821e07dc26bSmrg
10822e07dc26bSmrg# XORG_LINT_LIBRARY(LIBNAME)
10823e07dc26bSmrg# --------------------------
10824e07dc26bSmrg# Minimum version: 1.1.0
10825e07dc26bSmrg#
10826e07dc26bSmrg# Sets up flags for building lint libraries for checking programs that call
10827e07dc26bSmrg# functions in the library.
10828e07dc26bSmrg#
10829e07dc26bSmrg# Interface to module:
10830e07dc26bSmrg# LINTLIB		- Automake variable with the name of lint library file to make
10831e07dc26bSmrg# MAKE_LINT_LIB		- Automake conditional
10832e07dc26bSmrg#
10833e07dc26bSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
10834e07dc26bSmrg#			  - 'no' user instructs the module not to create a lint library (default)
10835e07dc26bSmrg
10836e07dc26bSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
10837e07dc26bSmrgAC_REQUIRE([XORG_WITH_LINT])
10838e07dc26bSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
10839e07dc26bSmrg	[Create lint library (default: disabled)])],
10840e07dc26bSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
10841e07dc26bSmrg
10842e07dc26bSmrgif test "x$make_lint_lib" = x"yes" ; then
10843e07dc26bSmrg   LINTLIB=llib-l$1.ln
10844e07dc26bSmrg   if test "x$LINT" = "x"; then
10845e07dc26bSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
10846e07dc26bSmrg   fi
10847e07dc26bSmrgelif test "x$make_lint_lib" != x"no" ; then
10848e07dc26bSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
10849e07dc26bSmrgfi
10850e07dc26bSmrg
10851e07dc26bSmrgAC_SUBST(LINTLIB)
10852e07dc26bSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
10853e07dc26bSmrg
10854e07dc26bSmrg]) # XORG_LINT_LIBRARY
10855e07dc26bSmrg
10856e07dc26bSmrg# XORG_COMPILER_BRAND
10857e07dc26bSmrg# -------------------
10858e07dc26bSmrg# Minimum version: 1.14.0
10859e07dc26bSmrg#
10860e07dc26bSmrg# Checks for various brands of compilers and sets flags as appropriate:
10861e07dc26bSmrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
10862e07dc26bSmrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
10863e07dc26bSmrg#   clang compiler - sets CLANGCC to "yes"
10864e07dc26bSmrg#   Intel compiler - sets INTELCC to "yes"
10865e07dc26bSmrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
10866e07dc26bSmrg#
10867e07dc26bSmrgAC_DEFUN([XORG_COMPILER_BRAND], [
10868e07dc26bSmrgAC_LANG_CASE(
10869e07dc26bSmrg	[C], [
10870e07dc26bSmrg		AC_REQUIRE([AC_PROG_CC_C99])
10871e07dc26bSmrg	],
10872e07dc26bSmrg	[C++], [
10873e07dc26bSmrg		AC_REQUIRE([AC_PROG_CXX])
10874e07dc26bSmrg	]
10875e07dc26bSmrg)
10876e07dc26bSmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
10877e07dc26bSmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
10878e07dc26bSmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
10879e07dc26bSmrg]) # XORG_COMPILER_BRAND
10880e07dc26bSmrg
10881e07dc26bSmrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
10882e07dc26bSmrg# ---------------
10883e07dc26bSmrg# Minimum version: 1.16.0
10884e07dc26bSmrg#
10885e07dc26bSmrg# Test if the compiler works when passed the given flag as a command line argument.
10886e07dc26bSmrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
10887e07dc26bSmrg# next flag in the list until there are no more options.
10888e07dc26bSmrg#
10889e07dc26bSmrg# Note that this does not guarantee that the compiler supports the flag as some
10890e07dc26bSmrg# compilers will simply ignore arguments that they do not understand, but we do
10891e07dc26bSmrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
10892e07dc26bSmrg# -Werror=unused-command-line-argument
10893e07dc26bSmrg#
10894e07dc26bSmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
10895e07dc26bSmrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
10896e07dc26bSmrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
10897e07dc26bSmrg
10898e07dc26bSmrgAC_LANG_COMPILER_REQUIRE
10899e07dc26bSmrg
10900e07dc26bSmrgAC_LANG_CASE(
10901e07dc26bSmrg	[C], [
10902e07dc26bSmrg		AC_REQUIRE([AC_PROG_CC_C99])
10903e07dc26bSmrg		define([PREFIX], [C])
10904e07dc26bSmrg		define([CACHE_PREFIX], [cc])
10905e07dc26bSmrg		define([COMPILER], [$CC])
10906e07dc26bSmrg	],
10907e07dc26bSmrg	[C++], [
10908e07dc26bSmrg		define([PREFIX], [CXX])
10909e07dc26bSmrg		define([CACHE_PREFIX], [cxx])
10910e07dc26bSmrg		define([COMPILER], [$CXX])
10911e07dc26bSmrg	]
10912e07dc26bSmrg)
10913e07dc26bSmrg
10914e07dc26bSmrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
10915e07dc26bSmrg
10916e07dc26bSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
10917e07dc26bSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10918e07dc26bSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
10919e07dc26bSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
10920e07dc26bSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
10921e07dc26bSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
10922e07dc26bSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
10923e07dc26bSmrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
10924e07dc26bSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10925e07dc26bSmrgfi
10926e07dc26bSmrg
10927e07dc26bSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
10928e07dc26bSmrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
10929e07dc26bSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10930e07dc26bSmrg	fi
10931e07dc26bSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
10932e07dc26bSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
10933e07dc26bSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
10934e07dc26bSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
10935e07dc26bSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
10936e07dc26bSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
10937e07dc26bSmrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
10938e07dc26bSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10939e07dc26bSmrgfi
10940e07dc26bSmrg
10941e07dc26bSmrgfound="no"
10942e07dc26bSmrgm4_foreach([flag], m4_cdr($@), [
10943e07dc26bSmrg	if test $found = "no" ; then
10944e07dc26bSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
10945e07dc26bSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10946e07dc26bSmrg		fi
10947e07dc26bSmrg
10948e07dc26bSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
10949e07dc26bSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
10950e07dc26bSmrg		fi
10951e07dc26bSmrg
10952e07dc26bSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
10953e07dc26bSmrg
10954e07dc26bSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
10955e07dc26bSmrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
10956e07dc26bSmrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
10957e07dc26bSmrg		AC_CACHE_VAL($cacheid,
10958e07dc26bSmrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
10959e07dc26bSmrg					     [eval $cacheid=yes],
10960e07dc26bSmrg					     [eval $cacheid=no])])
10961e07dc26bSmrg
10962e07dc26bSmrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10963e07dc26bSmrg
10964e07dc26bSmrg		eval supported=\$$cacheid
10965e07dc26bSmrg		AC_MSG_RESULT([$supported])
10966e07dc26bSmrg		if test "$supported" = "yes" ; then
10967e07dc26bSmrg			$1="$$1 ]flag["
10968e07dc26bSmrg			found="yes"
10969e07dc26bSmrg		fi
10970e07dc26bSmrg	fi
10971e07dc26bSmrg])
10972e07dc26bSmrg]) # XORG_TESTSET_CFLAG
10973e07dc26bSmrg
10974e07dc26bSmrg# XORG_COMPILER_FLAGS
10975e07dc26bSmrg# ---------------
10976e07dc26bSmrg# Minimum version: 1.16.0
10977e07dc26bSmrg#
10978e07dc26bSmrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
10979e07dc26bSmrg# arguments supported by the selected compiler which do NOT alter the generated
10980e07dc26bSmrg# code.  These arguments will cause the compiler to print various warnings
10981e07dc26bSmrg# during compilation AND turn a conservative set of warnings into errors.
10982e07dc26bSmrg#
10983e07dc26bSmrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
10984e07dc26bSmrg# future versions of util-macros as options are added to new compilers.
10985e07dc26bSmrg#
10986e07dc26bSmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
10987e07dc26bSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
10988e07dc26bSmrg
10989e07dc26bSmrgAC_ARG_ENABLE(selective-werror,
10990e07dc26bSmrg              AS_HELP_STRING([--disable-selective-werror],
10991e07dc26bSmrg                             [Turn off selective compiler errors. (default: enabled)]),
10992e07dc26bSmrg              [SELECTIVE_WERROR=$enableval],
10993e07dc26bSmrg              [SELECTIVE_WERROR=yes])
10994e07dc26bSmrg
10995e07dc26bSmrgAC_LANG_CASE(
10996e07dc26bSmrg        [C], [
10997e07dc26bSmrg                define([PREFIX], [C])
10998e07dc26bSmrg        ],
10999e07dc26bSmrg        [C++], [
11000e07dc26bSmrg                define([PREFIX], [CXX])
11001e07dc26bSmrg        ]
11002e07dc26bSmrg)
11003e07dc26bSmrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
11004e07dc26bSmrgif test "x$SUNCC" = "xyes"; then
11005e07dc26bSmrg    [BASE_]PREFIX[FLAGS]="-v"
11006e07dc26bSmrgelse
11007e07dc26bSmrg    [BASE_]PREFIX[FLAGS]=""
11008e07dc26bSmrgfi
11009e07dc26bSmrg
11010e07dc26bSmrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
11011e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
11012e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
11013e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
11014e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
11015e07dc26bSmrg
11016e07dc26bSmrgAC_LANG_CASE(
11017e07dc26bSmrg	[C], [
11018e07dc26bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
11019e07dc26bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
11020e07dc26bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
11021e07dc26bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
11022e07dc26bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
11023e07dc26bSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
11024e07dc26bSmrg	]
11025e07dc26bSmrg)
11026e07dc26bSmrg
11027e07dc26bSmrg# This chunk adds additional warnings that could catch undesired effects.
11028e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
11029e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
11030e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
11031e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
11032e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
11033e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
11034e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
11035e07dc26bSmrg
11036e07dc26bSmrg# These are currently disabled because they are noisy.  They will be enabled
11037e07dc26bSmrg# in the future once the codebase is sufficiently modernized to silence
11038e07dc26bSmrg# them.  For now, I don't want them to drown out the other warnings.
11039e07dc26bSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
11040e07dc26bSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
11041e07dc26bSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
11042e07dc26bSmrg
11043e07dc26bSmrg# Turn some warnings into errors, so we don't accidently get successful builds
11044e07dc26bSmrg# when there are problems that should be fixed.
11045e07dc26bSmrg
11046e07dc26bSmrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
11047e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
11048e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
11049e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
11050e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
11051e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
11052e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
11053e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
11054e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
11055e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
11056e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
11057e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
11058e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
11059e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
11060e07dc26bSmrgelse
11061e07dc26bSmrgAC_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])
11062e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
11063e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
11064e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
11065e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
11066e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
11067e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
11068e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
11069e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
11070e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
11071e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
11072e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
11073e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
11074e07dc26bSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
11075e07dc26bSmrgfi
11076e07dc26bSmrg
11077e07dc26bSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
11078e07dc26bSmrg]) # XORG_COMPILER_FLAGS
11079e07dc26bSmrg
11080e07dc26bSmrg# XORG_CWARNFLAGS
11081e07dc26bSmrg# ---------------
11082e07dc26bSmrg# Minimum version: 1.2.0
11083e07dc26bSmrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
11084e07dc26bSmrg#
11085e07dc26bSmrg# Defines CWARNFLAGS to enable C compiler warnings.
11086e07dc26bSmrg#
11087e07dc26bSmrg# This function is deprecated because it defines -fno-strict-aliasing
11088e07dc26bSmrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
11089e07dc26bSmrg# is needed, then it should be added explicitly in the module when
11090e07dc26bSmrg# it is updated to use BASE_CFLAGS.
11091e07dc26bSmrg#
11092e07dc26bSmrgAC_DEFUN([XORG_CWARNFLAGS], [
11093e07dc26bSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
11094e07dc26bSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
11095e07dc26bSmrgAC_LANG_CASE(
11096e07dc26bSmrg	[C], [
11097e07dc26bSmrg		CWARNFLAGS="$BASE_CFLAGS"
11098e07dc26bSmrg		if  test "x$GCC" = xyes ; then
11099e07dc26bSmrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
11100e07dc26bSmrg		fi
11101e07dc26bSmrg		AC_SUBST(CWARNFLAGS)
11102e07dc26bSmrg	]
11103e07dc26bSmrg)
11104e07dc26bSmrg]) # XORG_CWARNFLAGS
11105e07dc26bSmrg
11106e07dc26bSmrg# XORG_STRICT_OPTION
11107e07dc26bSmrg# -----------------------
11108e07dc26bSmrg# Minimum version: 1.3.0
11109e07dc26bSmrg#
11110e07dc26bSmrg# Add configure option to enable strict compilation flags, such as treating
11111e07dc26bSmrg# warnings as fatal errors.
11112e07dc26bSmrg# If --enable-strict-compilation is passed to configure, adds strict flags to
11113e07dc26bSmrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
11114e07dc26bSmrg#
11115e07dc26bSmrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
11116e07dc26bSmrg# when strict compilation is unconditionally desired.
11117e07dc26bSmrgAC_DEFUN([XORG_STRICT_OPTION], [
11118e07dc26bSmrgAC_REQUIRE([XORG_CWARNFLAGS])
11119e07dc26bSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
11120e07dc26bSmrg
11121e07dc26bSmrgAC_ARG_ENABLE(strict-compilation,
11122e07dc26bSmrg			  AS_HELP_STRING([--enable-strict-compilation],
11123e07dc26bSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
11124e07dc26bSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
11125e07dc26bSmrg
11126e07dc26bSmrgAC_LANG_CASE(
11127e07dc26bSmrg        [C], [
11128e07dc26bSmrg                define([PREFIX], [C])
11129e07dc26bSmrg        ],
11130e07dc26bSmrg        [C++], [
11131e07dc26bSmrg                define([PREFIX], [CXX])
11132e07dc26bSmrg        ]
11133e07dc26bSmrg)
11134e07dc26bSmrg
11135e07dc26bSmrg[STRICT_]PREFIX[FLAGS]=""
11136e07dc26bSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
11137e07dc26bSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
11138e07dc26bSmrg
11139e07dc26bSmrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
11140e07dc26bSmrg# activate it with -Werror, so we add it here explicitly.
11141e07dc26bSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
11142e07dc26bSmrg
11143e07dc26bSmrgif test "x$STRICT_COMPILE" = "xyes"; then
11144e07dc26bSmrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
11145e07dc26bSmrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
11146e07dc26bSmrgfi
11147e07dc26bSmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
11148e07dc26bSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
11149e07dc26bSmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
11150e07dc26bSmrg]) # XORG_STRICT_OPTION
11151e07dc26bSmrg
11152e07dc26bSmrg# XORG_DEFAULT_OPTIONS
11153e07dc26bSmrg# --------------------
11154e07dc26bSmrg# Minimum version: 1.3.0
11155e07dc26bSmrg#
11156e07dc26bSmrg# Defines default options for X.Org modules.
11157e07dc26bSmrg#
11158e07dc26bSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
11159e07dc26bSmrgAC_REQUIRE([AC_PROG_INSTALL])
11160e07dc26bSmrgXORG_COMPILER_FLAGS
11161e07dc26bSmrgXORG_CWARNFLAGS
11162e07dc26bSmrgXORG_STRICT_OPTION
11163e07dc26bSmrgXORG_RELEASE_VERSION
11164e07dc26bSmrgXORG_CHANGELOG
11165e07dc26bSmrgXORG_INSTALL
11166e07dc26bSmrgXORG_MANPAGE_SECTIONS
11167e07dc26bSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
11168e07dc26bSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
11169e07dc26bSmrg]) # XORG_DEFAULT_OPTIONS
11170e07dc26bSmrg
11171e07dc26bSmrg# XORG_INSTALL()
11172e07dc26bSmrg# ----------------
11173e07dc26bSmrg# Minimum version: 1.4.0
11174e07dc26bSmrg#
11175e07dc26bSmrg# Defines the variable INSTALL_CMD as the command to copy
11176e07dc26bSmrg# INSTALL from $prefix/share/util-macros.
11177e07dc26bSmrg#
11178e07dc26bSmrgAC_DEFUN([XORG_INSTALL], [
11179e07dc26bSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
11180e07dc26bSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
11181e07dc26bSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
11182e07dc26bSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
11183e07dc26bSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
11184e07dc26bSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
11185e07dc26bSmrgAC_SUBST([INSTALL_CMD])
11186e07dc26bSmrg]) # XORG_INSTALL
11187e07dc26bSmrgdnl Copyright 2005 Red Hat, Inc
11188e07dc26bSmrgdnl
11189e07dc26bSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
11190e07dc26bSmrgdnl documentation for any purpose is hereby granted without fee, provided that
11191e07dc26bSmrgdnl the above copyright notice appear in all copies and that both that
11192e07dc26bSmrgdnl copyright notice and this permission notice appear in supporting
11193e07dc26bSmrgdnl documentation.
11194e07dc26bSmrgdnl
11195e07dc26bSmrgdnl The above copyright notice and this permission notice shall be included
11196e07dc26bSmrgdnl in all copies or substantial portions of the Software.
11197e07dc26bSmrgdnl
11198e07dc26bSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11199e07dc26bSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11200e07dc26bSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11201e07dc26bSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11202e07dc26bSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11203e07dc26bSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11204e07dc26bSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
11205e07dc26bSmrgdnl
11206e07dc26bSmrgdnl Except as contained in this notice, the name of the copyright holders shall
11207e07dc26bSmrgdnl not be used in advertising or otherwise to promote the sale, use or
11208e07dc26bSmrgdnl other dealings in this Software without prior written authorization
11209e07dc26bSmrgdnl from the copyright holders.
11210e07dc26bSmrgdnl
11211e07dc26bSmrg
11212e07dc26bSmrg# XORG_RELEASE_VERSION
11213e07dc26bSmrg# --------------------
11214e07dc26bSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
11215e07dc26bSmrg
11216e07dc26bSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
11217e07dc26bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
11218e07dc26bSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
11219e07dc26bSmrg		[Major version of this package])
11220e07dc26bSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
11221e07dc26bSmrg	if test "x$PVM" = "x"; then
11222e07dc26bSmrg		PVM="0"
11223e07dc26bSmrg	fi
11224e07dc26bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
11225e07dc26bSmrg		[$PVM],
11226e07dc26bSmrg		[Minor version of this package])
11227e07dc26bSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
11228e07dc26bSmrg	if test "x$PVP" = "x"; then
11229e07dc26bSmrg		PVP="0"
11230e07dc26bSmrg	fi
11231e07dc26bSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
11232e07dc26bSmrg		[$PVP],
11233e07dc26bSmrg		[Patch version of this package])
11234e07dc26bSmrg])
11235e07dc26bSmrg
11236e07dc26bSmrg# XORG_CHANGELOG()
11237e07dc26bSmrg# ----------------
11238e07dc26bSmrg# Minimum version: 1.2.0
11239e07dc26bSmrg#
11240e07dc26bSmrg# Defines the variable CHANGELOG_CMD as the command to generate
11241e07dc26bSmrg# ChangeLog from git.
11242e07dc26bSmrg#
11243e07dc26bSmrg#
11244e07dc26bSmrgAC_DEFUN([XORG_CHANGELOG], [
11245e07dc26bSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
11246e07dc26bSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
11247e07dc26bSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
11248e07dc26bSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
11249e07dc26bSmrgAC_SUBST([CHANGELOG_CMD])
11250e07dc26bSmrg]) # XORG_CHANGELOG
11251e07dc26bSmrg
11252e07dc26bSmrgdnl Copyright 2005 Red Hat, Inc
11253e07dc26bSmrgdnl 
11254e07dc26bSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
11255e07dc26bSmrgdnl documentation for any purpose is hereby granted without fee, provided that
11256e07dc26bSmrgdnl the above copyright notice appear in all copies and that both that
11257e07dc26bSmrgdnl copyright notice and this permission notice appear in supporting
11258e07dc26bSmrgdnl documentation.
11259e07dc26bSmrgdnl 
11260e07dc26bSmrgdnl The above copyright notice and this permission notice shall be included
11261e07dc26bSmrgdnl in all copies or substantial portions of the Software.
11262e07dc26bSmrgdnl 
11263e07dc26bSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11264e07dc26bSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11265e07dc26bSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11266e07dc26bSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11267e07dc26bSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11268e07dc26bSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11269e07dc26bSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
11270e07dc26bSmrgdnl 
11271e07dc26bSmrgdnl Except as contained in this notice, the name of the copyright holders shall
11272e07dc26bSmrgdnl not be used in advertising or otherwise to promote the sale, use or
11273e07dc26bSmrgdnl other dealings in this Software without prior written authorization
11274e07dc26bSmrgdnl from the copyright holders.
11275e07dc26bSmrgdnl 
11276e07dc26bSmrg
11277e07dc26bSmrg# XORG_DRIVER_CHECK_EXT(MACRO, PROTO)
11278e07dc26bSmrg# --------------------------
11279e07dc26bSmrg# Checks for the MACRO define in xorg-server.h (from the sdk).  If it
11280e07dc26bSmrg# is defined, then add the given PROTO to $REQUIRED_MODULES.
11281e07dc26bSmrg
11282e07dc26bSmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
11283e07dc26bSmrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
11284e07dc26bSmrg	SAVE_CFLAGS="$CFLAGS"
11285e07dc26bSmrg	CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
11286e07dc26bSmrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
11287e07dc26bSmrg#include "xorg-server.h"
11288e07dc26bSmrg#if !defined $1
11289e07dc26bSmrg#error $1 not defined
11290e07dc26bSmrg#endif
11291e07dc26bSmrg		]])],
11292e07dc26bSmrg		[_EXT_CHECK=yes],
11293e07dc26bSmrg		[_EXT_CHECK=no])
11294e07dc26bSmrg	CFLAGS="$SAVE_CFLAGS"
11295e07dc26bSmrg	AC_MSG_CHECKING([if $1 is defined])
11296e07dc26bSmrg	AC_MSG_RESULT([$_EXT_CHECK])
11297e07dc26bSmrg	if test "$_EXT_CHECK" != no; then
11298e07dc26bSmrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
11299e07dc26bSmrg	fi
11300e07dc26bSmrg])
11301e07dc26bSmrg
11302e07dc26bSmrg# Copyright (C) 2002-2014 Free Software Foundation, Inc.
11303e07dc26bSmrg#
11304e07dc26bSmrg# This file is free software; the Free Software Foundation
11305e07dc26bSmrg# gives unlimited permission to copy and/or distribute it,
11306e07dc26bSmrg# with or without modifications, as long as this notice is preserved.
11307e07dc26bSmrg
11308e07dc26bSmrg# AM_AUTOMAKE_VERSION(VERSION)
11309e07dc26bSmrg# ----------------------------
11310e07dc26bSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
11311e07dc26bSmrg# generated from the m4 files accompanying Automake X.Y.
11312e07dc26bSmrg# (This private macro should not be called outside this file.)
11313e07dc26bSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
11314e07dc26bSmrg[am__api_version='1.15'
11315e07dc26bSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
11316e07dc26bSmrgdnl require some minimum version.  Point them to the right macro.
11317e07dc26bSmrgm4_if([$1], [1.15], [],
11318e07dc26bSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
11319e07dc26bSmrg])
11320e07dc26bSmrg
11321e07dc26bSmrg# _AM_AUTOCONF_VERSION(VERSION)
11322e07dc26bSmrg# -----------------------------
11323e07dc26bSmrg# aclocal traces this macro to find the Autoconf version.
11324e07dc26bSmrg# This is a private macro too.  Using m4_define simplifies
11325e07dc26bSmrg# the logic in aclocal, which can simply ignore this definition.
11326e07dc26bSmrgm4_define([_AM_AUTOCONF_VERSION], [])
11327e07dc26bSmrg
11328e07dc26bSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
11329e07dc26bSmrg# -------------------------------
11330e07dc26bSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
11331e07dc26bSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
11332e07dc26bSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
11333e07dc26bSmrg[AM_AUTOMAKE_VERSION([1.15])dnl
11334e07dc26bSmrgm4_ifndef([AC_AUTOCONF_VERSION],
11335e07dc26bSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
11336e07dc26bSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
11337e07dc26bSmrg
11338e07dc26bSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
11339e07dc26bSmrg
11340e07dc26bSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
11341e07dc26bSmrg#
11342e07dc26bSmrg# This file is free software; the Free Software Foundation
11343e07dc26bSmrg# gives unlimited permission to copy and/or distribute it,
11344e07dc26bSmrg# with or without modifications, as long as this notice is preserved.
11345e07dc26bSmrg
11346e07dc26bSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
11347e07dc26bSmrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
11348e07dc26bSmrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
11349e07dc26bSmrg#
11350e07dc26bSmrg# Of course, Automake must honor this variable whenever it calls a
11351e07dc26bSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
11352e07dc26bSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
11353e07dc26bSmrg# depending on how configure is run.  This is pretty annoying, since
11354e07dc26bSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
11355e07dc26bSmrg# source directory, any form will work fine, but in subdirectories a
11356e07dc26bSmrg# relative path needs to be adjusted first.
11357e07dc26bSmrg#
11358e07dc26bSmrg# $ac_aux_dir/missing
11359e07dc26bSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
11360e07dc26bSmrg# $top_srcdir/$ac_aux_dir/missing
11361e07dc26bSmrg#    fails if $ac_aux_dir is absolute,
11362e07dc26bSmrg#    fails when called from a subdirectory in a VPATH build with
11363e07dc26bSmrg#          a relative $ac_aux_dir
11364e07dc26bSmrg#
11365e07dc26bSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
11366e07dc26bSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
11367e07dc26bSmrg# harmless because $srcdir is '.', but things will broke when you
11368e07dc26bSmrg# start a VPATH build or use an absolute $srcdir.
11369e07dc26bSmrg#
11370e07dc26bSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
11371e07dc26bSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
11372e07dc26bSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
11373e07dc26bSmrg# and then we would define $MISSING as
11374e07dc26bSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
11375e07dc26bSmrg# This will work as long as MISSING is not called from configure, because
11376e07dc26bSmrg# unfortunately $(top_srcdir) has no meaning in configure.
11377e07dc26bSmrg# However there are other variables, like CC, which are often used in
11378e07dc26bSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
11379e07dc26bSmrg#
11380e07dc26bSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
11381e07dc26bSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
11382e07dc26bSmrg# configured tree to be moved without reconfiguration.
11383e07dc26bSmrg
11384e07dc26bSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
11385e07dc26bSmrg[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
11386e07dc26bSmrg# Expand $ac_aux_dir to an absolute path.
11387e07dc26bSmrgam_aux_dir=`cd "$ac_aux_dir" && pwd`
11388e07dc26bSmrg])
11389e07dc26bSmrg
11390e07dc26bSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
11391e07dc26bSmrg
11392e07dc26bSmrg# Copyright (C) 1997-2014 Free Software Foundation, Inc.
11393e07dc26bSmrg#
11394e07dc26bSmrg# This file is free software; the Free Software Foundation
11395e07dc26bSmrg# gives unlimited permission to copy and/or distribute it,
11396e07dc26bSmrg# with or without modifications, as long as this notice is preserved.
11397e07dc26bSmrg
11398e07dc26bSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
11399e07dc26bSmrg# -------------------------------------
11400e07dc26bSmrg# Define a conditional.
11401e07dc26bSmrgAC_DEFUN([AM_CONDITIONAL],
11402e07dc26bSmrg[AC_PREREQ([2.52])dnl
11403e07dc26bSmrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
11404e07dc26bSmrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
11405e07dc26bSmrgAC_SUBST([$1_TRUE])dnl
11406e07dc26bSmrgAC_SUBST([$1_FALSE])dnl
11407e07dc26bSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
11408e07dc26bSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
11409e07dc26bSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
11410e07dc26bSmrgif $2; then
11411e07dc26bSmrg  $1_TRUE=
11412e07dc26bSmrg  $1_FALSE='#'
11413e07dc26bSmrgelse
11414e07dc26bSmrg  $1_TRUE='#'
11415e07dc26bSmrg  $1_FALSE=
11416e07dc26bSmrgfi
11417e07dc26bSmrgAC_CONFIG_COMMANDS_PRE(
11418e07dc26bSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
11419e07dc26bSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
11420e07dc26bSmrgUsually this means the macro was only invoked conditionally.]])
11421e07dc26bSmrgfi])])
11422e07dc26bSmrg
11423e07dc26bSmrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
11424e07dc26bSmrg#
11425e07dc26bSmrg# This file is free software; the Free Software Foundation
11426e07dc26bSmrg# gives unlimited permission to copy and/or distribute it,
11427e07dc26bSmrg# with or without modifications, as long as this notice is preserved.
11428e07dc26bSmrg
11429e07dc26bSmrg
11430e07dc26bSmrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
11431e07dc26bSmrg# written in clear, in which case automake, when reading aclocal.m4,
11432e07dc26bSmrg# will think it sees a *use*, and therefore will trigger all it's
11433e07dc26bSmrg# C support machinery.  Also note that it means that autoscan, seeing
11434e07dc26bSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
11435e07dc26bSmrg
11436e07dc26bSmrg
11437e07dc26bSmrg# _AM_DEPENDENCIES(NAME)
11438e07dc26bSmrg# ----------------------
11439e07dc26bSmrg# See how the compiler implements dependency checking.
11440e07dc26bSmrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
11441e07dc26bSmrg# We try a few techniques and use that to set a single cache variable.
11442e07dc26bSmrg#
11443e07dc26bSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
11444e07dc26bSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
11445e07dc26bSmrg# dependency, and given that the user is not expected to run this macro,
11446e07dc26bSmrg# just rely on AC_PROG_CC.
11447e07dc26bSmrgAC_DEFUN([_AM_DEPENDENCIES],
11448e07dc26bSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
11449e07dc26bSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
11450e07dc26bSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
11451e07dc26bSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
11452e07dc26bSmrg
11453e07dc26bSmrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
11454e07dc26bSmrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
11455e07dc26bSmrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
11456e07dc26bSmrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
11457e07dc26bSmrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
11458e07dc26bSmrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
11459e07dc26bSmrg                    [depcc="$$1"   am_compiler_list=])
11460e07dc26bSmrg
11461e07dc26bSmrgAC_CACHE_CHECK([dependency style of $depcc],
11462e07dc26bSmrg               [am_cv_$1_dependencies_compiler_type],
11463e07dc26bSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
11464e07dc26bSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
11465e07dc26bSmrg  # making bogus files that we don't know about and never remove.  For
11466e07dc26bSmrg  # instance it was reported that on HP-UX the gcc test will end up
11467e07dc26bSmrg  # making a dummy file named 'D' -- because '-MD' means "put the output
11468e07dc26bSmrg  # in D".
11469e07dc26bSmrg  rm -rf conftest.dir
11470e07dc26bSmrg  mkdir conftest.dir
11471e07dc26bSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
11472e07dc26bSmrg  # using a relative directory.
11473e07dc26bSmrg  cp "$am_depcomp" conftest.dir
11474e07dc26bSmrg  cd conftest.dir
11475e07dc26bSmrg  # We will build objects and dependencies in a subdirectory because
11476e07dc26bSmrg  # it helps to detect inapplicable dependency modes.  For instance
11477e07dc26bSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
11478e07dc26bSmrg  # side effect of compilation, but ICC will put the dependencies in
11479e07dc26bSmrg  # the current directory while Tru64 will put them in the object
11480e07dc26bSmrg  # directory.
11481e07dc26bSmrg  mkdir sub
11482e07dc26bSmrg
11483e07dc26bSmrg  am_cv_$1_dependencies_compiler_type=none
11484e07dc26bSmrg  if test "$am_compiler_list" = ""; then
11485e07dc26bSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
11486e07dc26bSmrg  fi
11487e07dc26bSmrg  am__universal=false
11488e07dc26bSmrg  m4_case([$1], [CC],
11489e07dc26bSmrg    [case " $depcc " in #(
11490e07dc26bSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
11491e07dc26bSmrg     esac],
11492e07dc26bSmrg    [CXX],
11493e07dc26bSmrg    [case " $depcc " in #(
11494e07dc26bSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
11495e07dc26bSmrg     esac])
11496e07dc26bSmrg
11497e07dc26bSmrg  for depmode in $am_compiler_list; do
11498e07dc26bSmrg    # Setup a source with many dependencies, because some compilers
11499e07dc26bSmrg    # like to wrap large dependency lists on column 80 (with \), and
11500e07dc26bSmrg    # we should not choose a depcomp mode which is confused by this.
11501e07dc26bSmrg    #
11502e07dc26bSmrg    # We need to recreate these files for each test, as the compiler may
11503e07dc26bSmrg    # overwrite some of them when testing with obscure command lines.
11504e07dc26bSmrg    # This happens at least with the AIX C compiler.
11505e07dc26bSmrg    : > sub/conftest.c
11506e07dc26bSmrg    for i in 1 2 3 4 5 6; do
11507e07dc26bSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
11508e07dc26bSmrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
11509e07dc26bSmrg      # Solaris 10 /bin/sh.
11510e07dc26bSmrg      echo '/* dummy */' > sub/conftst$i.h
11511e07dc26bSmrg    done
11512e07dc26bSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
11513e07dc26bSmrg
11514e07dc26bSmrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
11515e07dc26bSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
11516e07dc26bSmrg    # handle '-M -o', and we need to detect this.  Also, some Intel
11517e07dc26bSmrg    # versions had trouble with output in subdirs.
11518e07dc26bSmrg    am__obj=sub/conftest.${OBJEXT-o}
11519e07dc26bSmrg    am__minus_obj="-o $am__obj"
11520e07dc26bSmrg    case $depmode in
11521e07dc26bSmrg    gcc)
11522e07dc26bSmrg      # This depmode causes a compiler race in universal mode.
11523e07dc26bSmrg      test "$am__universal" = false || continue
11524e07dc26bSmrg      ;;
11525e07dc26bSmrg    nosideeffect)
11526e07dc26bSmrg      # After this tag, mechanisms are not by side-effect, so they'll
11527e07dc26bSmrg      # only be used when explicitly requested.
11528e07dc26bSmrg      if test "x$enable_dependency_tracking" = xyes; then
11529e07dc26bSmrg	continue
11530e07dc26bSmrg      else
11531e07dc26bSmrg	break
11532e07dc26bSmrg      fi
11533e07dc26bSmrg      ;;
11534e07dc26bSmrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
11535e07dc26bSmrg      # This compiler won't grok '-c -o', but also, the minuso test has
11536e07dc26bSmrg      # not run yet.  These depmodes are late enough in the game, and
11537e07dc26bSmrg      # so weak that their functioning should not be impacted.
11538e07dc26bSmrg      am__obj=conftest.${OBJEXT-o}
11539e07dc26bSmrg      am__minus_obj=
11540e07dc26bSmrg      ;;
11541e07dc26bSmrg    none) break ;;
11542e07dc26bSmrg    esac
11543e07dc26bSmrg    if depmode=$depmode \
11544e07dc26bSmrg       source=sub/conftest.c object=$am__obj \
11545e07dc26bSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
11546e07dc26bSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
11547e07dc26bSmrg         >/dev/null 2>conftest.err &&
11548e07dc26bSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
11549e07dc26bSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
11550e07dc26bSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
11551e07dc26bSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
11552e07dc26bSmrg      # icc doesn't choke on unknown options, it will just issue warnings
11553e07dc26bSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
11554e07dc26bSmrg      # that says an option was ignored or not supported.
11555e07dc26bSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
11556e07dc26bSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
11557e07dc26bSmrg      # The diagnosis changed in icc 8.0:
11558e07dc26bSmrg      #   icc: Command line remark: option '-MP' not supported
11559e07dc26bSmrg      if (grep 'ignoring option' conftest.err ||
11560e07dc26bSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
11561e07dc26bSmrg        am_cv_$1_dependencies_compiler_type=$depmode
11562e07dc26bSmrg        break
11563e07dc26bSmrg      fi
11564e07dc26bSmrg    fi
11565e07dc26bSmrg  done
11566e07dc26bSmrg
11567e07dc26bSmrg  cd ..
11568e07dc26bSmrg  rm -rf conftest.dir
11569e07dc26bSmrgelse
11570e07dc26bSmrg  am_cv_$1_dependencies_compiler_type=none
11571e07dc26bSmrgfi
11572e07dc26bSmrg])
11573e07dc26bSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
11574e07dc26bSmrgAM_CONDITIONAL([am__fastdep$1], [
11575e07dc26bSmrg  test "x$enable_dependency_tracking" != xno \
11576e07dc26bSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
11577e07dc26bSmrg])
11578e07dc26bSmrg
11579e07dc26bSmrg
11580e07dc26bSmrg# AM_SET_DEPDIR
11581e07dc26bSmrg# -------------
11582e07dc26bSmrg# Choose a directory name for dependency files.
11583e07dc26bSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
11584e07dc26bSmrgAC_DEFUN([AM_SET_DEPDIR],
11585e07dc26bSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
11586e07dc26bSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
11587e07dc26bSmrg])
11588e07dc26bSmrg
11589e07dc26bSmrg
11590e07dc26bSmrg# AM_DEP_TRACK
11591e07dc26bSmrg# ------------
11592e07dc26bSmrgAC_DEFUN([AM_DEP_TRACK],
11593e07dc26bSmrg[AC_ARG_ENABLE([dependency-tracking], [dnl
11594e07dc26bSmrgAS_HELP_STRING(
11595e07dc26bSmrg  [--enable-dependency-tracking],
11596e07dc26bSmrg  [do not reject slow dependency extractors])
11597e07dc26bSmrgAS_HELP_STRING(
11598e07dc26bSmrg  [--disable-dependency-tracking],
11599e07dc26bSmrg  [speeds up one-time build])])
11600e07dc26bSmrgif test "x$enable_dependency_tracking" != xno; then
11601e07dc26bSmrg  am_depcomp="$ac_aux_dir/depcomp"
11602e07dc26bSmrg  AMDEPBACKSLASH='\'
11603e07dc26bSmrg  am__nodep='_no'
11604e07dc26bSmrgfi
11605e07dc26bSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
11606e07dc26bSmrgAC_SUBST([AMDEPBACKSLASH])dnl
11607e07dc26bSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
11608e07dc26bSmrgAC_SUBST([am__nodep])dnl
11609e07dc26bSmrg_AM_SUBST_NOTMAKE([am__nodep])dnl
11610e07dc26bSmrg])
11611e07dc26bSmrg
11612e07dc26bSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
11613e07dc26bSmrg
11614e07dc26bSmrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
11615e07dc26bSmrg#
11616e07dc26bSmrg# This file is free software; the Free Software Foundation
11617e07dc26bSmrg# gives unlimited permission to copy and/or distribute it,
11618e07dc26bSmrg# with or without modifications, as long as this notice is preserved.
11619e07dc26bSmrg
11620e07dc26bSmrg
11621e07dc26bSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
11622e07dc26bSmrg# ------------------------------
11623e07dc26bSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
11624e07dc26bSmrg[{
11625e07dc26bSmrg  # Older Autoconf quotes --file arguments for eval, but not when files
11626e07dc26bSmrg  # are listed without --file.  Let's play safe and only enable the eval
11627e07dc26bSmrg  # if we detect the quoting.
11628e07dc26bSmrg  case $CONFIG_FILES in
11629e07dc26bSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
11630e07dc26bSmrg  *)   set x $CONFIG_FILES ;;
11631e07dc26bSmrg  esac
11632e07dc26bSmrg  shift
11633e07dc26bSmrg  for mf
11634e07dc26bSmrg  do
11635e07dc26bSmrg    # Strip MF so we end up with the name of the file.
11636e07dc26bSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
11637e07dc26bSmrg    # Check whether this is an Automake generated Makefile or not.
11638e07dc26bSmrg    # We used to match only the files named 'Makefile.in', but
11639e07dc26bSmrg    # some people rename them; so instead we look at the file content.
11640e07dc26bSmrg    # Grep'ing the first line is not enough: some people post-process
11641e07dc26bSmrg    # each Makefile.in and add a new line on top of each file to say so.
11642e07dc26bSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
11643e07dc26bSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
11644e07dc26bSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
11645e07dc26bSmrg      dirpart=`AS_DIRNAME("$mf")`
11646e07dc26bSmrg    else
11647e07dc26bSmrg      continue
11648e07dc26bSmrg    fi
11649e07dc26bSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
11650e07dc26bSmrg    # from the Makefile without running 'make'.
11651e07dc26bSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
11652e07dc26bSmrg    test -z "$DEPDIR" && continue
11653e07dc26bSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
11654e07dc26bSmrg    test -z "$am__include" && continue
11655e07dc26bSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
11656e07dc26bSmrg    # Find all dependency output files, they are included files with
11657e07dc26bSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
11658e07dc26bSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
11659e07dc26bSmrg    # expansion.
11660e07dc26bSmrg    for file in `sed -n "
11661e07dc26bSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
11662e07dc26bSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
11663e07dc26bSmrg      # Make sure the directory exists.
11664e07dc26bSmrg      test -f "$dirpart/$file" && continue
11665e07dc26bSmrg      fdir=`AS_DIRNAME(["$file"])`
11666e07dc26bSmrg      AS_MKDIR_P([$dirpart/$fdir])
11667e07dc26bSmrg      # echo "creating $dirpart/$file"
11668e07dc26bSmrg      echo '# dummy' > "$dirpart/$file"
11669e07dc26bSmrg    done
11670e07dc26bSmrg  done
11671e07dc26bSmrg}
11672e07dc26bSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
11673e07dc26bSmrg
11674e07dc26bSmrg
11675e07dc26bSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
11676e07dc26bSmrg# -----------------------------
11677e07dc26bSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
11678e07dc26bSmrg#
11679e07dc26bSmrg# This code is only required when automatic dependency tracking
11680e07dc26bSmrg# is enabled.  FIXME.  This creates each '.P' file that we will
11681e07dc26bSmrg# need in order to bootstrap the dependency handling code.
11682e07dc26bSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
11683e07dc26bSmrg[AC_CONFIG_COMMANDS([depfiles],
11684e07dc26bSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
11685e07dc26bSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
11686e07dc26bSmrg])
11687e07dc26bSmrg
11688e07dc26bSmrg# Do all the work for Automake.                             -*- Autoconf -*-
11689e07dc26bSmrg
11690e07dc26bSmrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
11691e07dc26bSmrg#
11692e07dc26bSmrg# This file is free software; the Free Software Foundation
11693e07dc26bSmrg# gives unlimited permission to copy and/or distribute it,
11694e07dc26bSmrg# with or without modifications, as long as this notice is preserved.
11695e07dc26bSmrg
11696e07dc26bSmrg# This macro actually does too much.  Some checks are only needed if
11697e07dc26bSmrg# your package does certain things.  But this isn't really a big deal.
11698e07dc26bSmrg
11699e07dc26bSmrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
11700e07dc26bSmrgm4_define([AC_PROG_CC],
11701e07dc26bSmrgm4_defn([AC_PROG_CC])
11702e07dc26bSmrg[_AM_PROG_CC_C_O
11703e07dc26bSmrg])
11704e07dc26bSmrg
11705e07dc26bSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
11706e07dc26bSmrg# AM_INIT_AUTOMAKE([OPTIONS])
11707e07dc26bSmrg# -----------------------------------------------
11708e07dc26bSmrg# The call with PACKAGE and VERSION arguments is the old style
11709e07dc26bSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
11710e07dc26bSmrg# and VERSION should now be passed to AC_INIT and removed from
11711e07dc26bSmrg# the call to AM_INIT_AUTOMAKE.
11712e07dc26bSmrg# We support both call styles for the transition.  After
11713e07dc26bSmrg# the next Automake release, Autoconf can make the AC_INIT
11714e07dc26bSmrg# arguments mandatory, and then we can depend on a new Autoconf
11715e07dc26bSmrg# release and drop the old call support.
11716e07dc26bSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
11717e07dc26bSmrg[AC_PREREQ([2.65])dnl
11718e07dc26bSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
11719e07dc26bSmrgdnl the ones we care about.
11720e07dc26bSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
11721e07dc26bSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
11722e07dc26bSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
11723e07dc26bSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
11724e07dc26bSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
11725e07dc26bSmrg  # is not polluted with repeated "-I."
11726e07dc26bSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
11727e07dc26bSmrg  # test to see if srcdir already configured
11728e07dc26bSmrg  if test -f $srcdir/config.status; then
11729e07dc26bSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
11730e07dc26bSmrg  fi
11731e07dc26bSmrgfi
11732e07dc26bSmrg
11733e07dc26bSmrg# test whether we have cygpath
11734e07dc26bSmrgif test -z "$CYGPATH_W"; then
11735e07dc26bSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
11736e07dc26bSmrg    CYGPATH_W='cygpath -w'
11737e07dc26bSmrg  else
11738e07dc26bSmrg    CYGPATH_W=echo
11739e07dc26bSmrg  fi
11740e07dc26bSmrgfi
11741e07dc26bSmrgAC_SUBST([CYGPATH_W])
11742e07dc26bSmrg
11743e07dc26bSmrg# Define the identity of the package.
11744e07dc26bSmrgdnl Distinguish between old-style and new-style calls.
11745e07dc26bSmrgm4_ifval([$2],
11746e07dc26bSmrg[AC_DIAGNOSE([obsolete],
11747e07dc26bSmrg             [$0: two- and three-arguments forms are deprecated.])
11748e07dc26bSmrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
11749e07dc26bSmrg AC_SUBST([PACKAGE], [$1])dnl
11750e07dc26bSmrg AC_SUBST([VERSION], [$2])],
11751e07dc26bSmrg[_AM_SET_OPTIONS([$1])dnl
11752e07dc26bSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
11753e07dc26bSmrgm4_if(
11754e07dc26bSmrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
11755e07dc26bSmrg  [ok:ok],,
11756e07dc26bSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
11757e07dc26bSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
11758e07dc26bSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
11759e07dc26bSmrg
11760e07dc26bSmrg_AM_IF_OPTION([no-define],,
11761e07dc26bSmrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
11762e07dc26bSmrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
11763e07dc26bSmrg
11764e07dc26bSmrg# Some tools Automake needs.
11765e07dc26bSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
11766e07dc26bSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
11767e07dc26bSmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
11768e07dc26bSmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
11769e07dc26bSmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
11770e07dc26bSmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
11771e07dc26bSmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
11772e07dc26bSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
11773e07dc26bSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
11774e07dc26bSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
11775e07dc26bSmrg# For better backward compatibility.  To be removed once Automake 1.9.x
11776e07dc26bSmrg# dies out for good.  For more background, see:
11777e07dc26bSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
11778e07dc26bSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
11779e07dc26bSmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
11780e07dc26bSmrg# We need awk for the "check" target (and possibly the TAP driver).  The
11781e07dc26bSmrg# system "awk" is bad on some platforms.
11782e07dc26bSmrgAC_REQUIRE([AC_PROG_AWK])dnl
11783e07dc26bSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
11784e07dc26bSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
11785e07dc26bSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
11786e07dc26bSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
11787e07dc26bSmrg			     [_AM_PROG_TAR([v7])])])
11788e07dc26bSmrg_AM_IF_OPTION([no-dependencies],,
11789e07dc26bSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
11790e07dc26bSmrg		  [_AM_DEPENDENCIES([CC])],
11791e07dc26bSmrg		  [m4_define([AC_PROG_CC],
11792e07dc26bSmrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
11793e07dc26bSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
11794e07dc26bSmrg		  [_AM_DEPENDENCIES([CXX])],
11795e07dc26bSmrg		  [m4_define([AC_PROG_CXX],
11796e07dc26bSmrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
11797e07dc26bSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
11798e07dc26bSmrg		  [_AM_DEPENDENCIES([OBJC])],
11799e07dc26bSmrg		  [m4_define([AC_PROG_OBJC],
11800e07dc26bSmrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
11801e07dc26bSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
11802e07dc26bSmrg		  [_AM_DEPENDENCIES([OBJCXX])],
11803e07dc26bSmrg		  [m4_define([AC_PROG_OBJCXX],
11804e07dc26bSmrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
11805e07dc26bSmrg])
11806e07dc26bSmrgAC_REQUIRE([AM_SILENT_RULES])dnl
11807e07dc26bSmrgdnl The testsuite driver may need to know about EXEEXT, so add the
11808e07dc26bSmrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
11809e07dc26bSmrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
11810e07dc26bSmrgAC_CONFIG_COMMANDS_PRE(dnl
11811e07dc26bSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
11812e07dc26bSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
11813e07dc26bSmrg
11814e07dc26bSmrg# POSIX will say in a future version that running "rm -f" with no argument
11815e07dc26bSmrg# is OK; and we want to be able to make that assumption in our Makefile
11816e07dc26bSmrg# recipes.  So use an aggressive probe to check that the usage we want is
11817e07dc26bSmrg# actually supported "in the wild" to an acceptable degree.
11818e07dc26bSmrg# See automake bug#10828.
11819e07dc26bSmrg# To make any issue more visible, cause the running configure to be aborted
11820e07dc26bSmrg# by default if the 'rm' program in use doesn't match our expectations; the
11821e07dc26bSmrg# user can still override this though.
11822e07dc26bSmrgif rm -f && rm -fr && rm -rf; then : OK; else
11823e07dc26bSmrg  cat >&2 <<'END'
11824e07dc26bSmrgOops!
11825e07dc26bSmrg
11826e07dc26bSmrgYour 'rm' program seems unable to run without file operands specified
11827e07dc26bSmrgon the command line, even when the '-f' option is present.  This is contrary
11828e07dc26bSmrgto the behaviour of most rm programs out there, and not conforming with
11829e07dc26bSmrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
11830e07dc26bSmrg
11831e07dc26bSmrgPlease tell bug-automake@gnu.org about your system, including the value
11832e07dc26bSmrgof your $PATH and any error possibly output before this message.  This
11833e07dc26bSmrgcan help us improve future automake versions.
11834e07dc26bSmrg
11835e07dc26bSmrgEND
11836e07dc26bSmrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
11837e07dc26bSmrg    echo 'Configuration will proceed anyway, since you have set the' >&2
11838e07dc26bSmrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
11839e07dc26bSmrg    echo >&2
11840e07dc26bSmrg  else
11841e07dc26bSmrg    cat >&2 <<'END'
11842e07dc26bSmrgAborting the configuration process, to ensure you take notice of the issue.
11843e07dc26bSmrg
11844e07dc26bSmrgYou can download and install GNU coreutils to get an 'rm' implementation
11845e07dc26bSmrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
11846e07dc26bSmrg
11847e07dc26bSmrgIf you want to complete the configuration process using your problematic
11848e07dc26bSmrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
11849e07dc26bSmrgto "yes", and re-run configure.
11850e07dc26bSmrg
11851e07dc26bSmrgEND
11852e07dc26bSmrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
11853e07dc26bSmrg  fi
11854e07dc26bSmrgfi
11855e07dc26bSmrgdnl The trailing newline in this macro's definition is deliberate, for
11856e07dc26bSmrgdnl backward compatibility and to allow trailing 'dnl'-style comments
11857e07dc26bSmrgdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
11858e07dc26bSmrg])
11859e07dc26bSmrg
11860e07dc26bSmrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
11861e07dc26bSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
11862e07dc26bSmrgdnl mangled by Autoconf and run in a shell conditional statement.
11863e07dc26bSmrgm4_define([_AC_COMPILER_EXEEXT],
11864e07dc26bSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
11865e07dc26bSmrg
11866e07dc26bSmrg# When config.status generates a header, we must update the stamp-h file.
11867e07dc26bSmrg# This file resides in the same directory as the config header
11868e07dc26bSmrg# that is generated.  The stamp files are numbered to have different names.
11869e07dc26bSmrg
11870e07dc26bSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
11871e07dc26bSmrg# loop where config.status creates the headers, so we can generate
11872e07dc26bSmrg# our stamp files there.
11873e07dc26bSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
11874e07dc26bSmrg[# Compute $1's index in $config_headers.
11875e07dc26bSmrg_am_arg=$1
11876e07dc26bSmrg_am_stamp_count=1
11877e07dc26bSmrgfor _am_header in $config_headers :; do
11878e07dc26bSmrg  case $_am_header in
11879e07dc26bSmrg    $_am_arg | $_am_arg:* )
11880e07dc26bSmrg      break ;;
11881e07dc26bSmrg    * )
11882e07dc26bSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
11883e07dc26bSmrg  esac
11884e07dc26bSmrgdone
11885e07dc26bSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
11886e07dc26bSmrg
11887e07dc26bSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
11888e07dc26bSmrg#
11889e07dc26bSmrg# This file is free software; the Free Software Foundation
11890e07dc26bSmrg# gives unlimited permission to copy and/or distribute it,
11891e07dc26bSmrg# with or without modifications, as long as this notice is preserved.
11892e07dc26bSmrg
11893e07dc26bSmrg# AM_PROG_INSTALL_SH
11894e07dc26bSmrg# ------------------
11895e07dc26bSmrg# Define $install_sh.
11896e07dc26bSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
11897e07dc26bSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
11898e07dc26bSmrgif test x"${install_sh+set}" != xset; then
11899e07dc26bSmrg  case $am_aux_dir in
11900e07dc26bSmrg  *\ * | *\	*)
11901e07dc26bSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
11902e07dc26bSmrg  *)
11903e07dc26bSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
11904e07dc26bSmrg  esac
11905e07dc26bSmrgfi
11906e07dc26bSmrgAC_SUBST([install_sh])])
11907e07dc26bSmrg
11908e07dc26bSmrg# Copyright (C) 2003-2014 Free Software Foundation, Inc.
11909e07dc26bSmrg#
11910e07dc26bSmrg# This file is free software; the Free Software Foundation
11911e07dc26bSmrg# gives unlimited permission to copy and/or distribute it,
11912e07dc26bSmrg# with or without modifications, as long as this notice is preserved.
11913e07dc26bSmrg
11914e07dc26bSmrg# Check whether the underlying file-system supports filenames
11915e07dc26bSmrg# with a leading dot.  For instance MS-DOS doesn't.
11916e07dc26bSmrgAC_DEFUN([AM_SET_LEADING_DOT],
11917e07dc26bSmrg[rm -rf .tst 2>/dev/null
11918e07dc26bSmrgmkdir .tst 2>/dev/null
11919e07dc26bSmrgif test -d .tst; then
11920e07dc26bSmrg  am__leading_dot=.
11921e07dc26bSmrgelse
11922e07dc26bSmrg  am__leading_dot=_
11923e07dc26bSmrgfi
11924e07dc26bSmrgrmdir .tst 2>/dev/null
11925e07dc26bSmrgAC_SUBST([am__leading_dot])])
11926e07dc26bSmrg
11927e07dc26bSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
11928e07dc26bSmrg
11929e07dc26bSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
11930e07dc26bSmrg#
11931e07dc26bSmrg# This file is free software; the Free Software Foundation
11932e07dc26bSmrg# gives unlimited permission to copy and/or distribute it,
11933e07dc26bSmrg# with or without modifications, as long as this notice is preserved.
11934e07dc26bSmrg
11935e07dc26bSmrg# AM_MAKE_INCLUDE()
11936e07dc26bSmrg# -----------------
11937e07dc26bSmrg# Check to see how make treats includes.
11938e07dc26bSmrgAC_DEFUN([AM_MAKE_INCLUDE],
11939e07dc26bSmrg[am_make=${MAKE-make}
11940e07dc26bSmrgcat > confinc << 'END'
11941e07dc26bSmrgam__doit:
11942e07dc26bSmrg	@echo this is the am__doit target
11943e07dc26bSmrg.PHONY: am__doit
11944e07dc26bSmrgEND
11945e07dc26bSmrg# If we don't find an include directive, just comment out the code.
11946e07dc26bSmrgAC_MSG_CHECKING([for style of include used by $am_make])
11947e07dc26bSmrgam__include="#"
11948e07dc26bSmrgam__quote=
11949e07dc26bSmrg_am_result=none
11950e07dc26bSmrg# First try GNU make style include.
11951e07dc26bSmrgecho "include confinc" > confmf
11952e07dc26bSmrg# Ignore all kinds of additional output from 'make'.
11953e07dc26bSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
11954e07dc26bSmrg*the\ am__doit\ target*)
11955e07dc26bSmrg  am__include=include
11956e07dc26bSmrg  am__quote=
11957e07dc26bSmrg  _am_result=GNU
11958e07dc26bSmrg  ;;
11959e07dc26bSmrgesac
11960e07dc26bSmrg# Now try BSD make style include.
11961e07dc26bSmrgif test "$am__include" = "#"; then
11962e07dc26bSmrg   echo '.include "confinc"' > confmf
11963e07dc26bSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
11964e07dc26bSmrg   *the\ am__doit\ target*)
11965e07dc26bSmrg     am__include=.include
11966e07dc26bSmrg     am__quote="\""
11967e07dc26bSmrg     _am_result=BSD
11968e07dc26bSmrg     ;;
11969e07dc26bSmrg   esac
11970e07dc26bSmrgfi
11971e07dc26bSmrgAC_SUBST([am__include])
11972e07dc26bSmrgAC_SUBST([am__quote])
11973e07dc26bSmrgAC_MSG_RESULT([$_am_result])
11974e07dc26bSmrgrm -f confinc confmf
11975e07dc26bSmrg])
11976e07dc26bSmrg
11977e07dc26bSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
11978e07dc26bSmrg
11979e07dc26bSmrg# Copyright (C) 1997-2014 Free Software Foundation, Inc.
11980e07dc26bSmrg#
11981e07dc26bSmrg# This file is free software; the Free Software Foundation
11982e07dc26bSmrg# gives unlimited permission to copy and/or distribute it,
11983e07dc26bSmrg# with or without modifications, as long as this notice is preserved.
11984e07dc26bSmrg
11985e07dc26bSmrg# AM_MISSING_PROG(NAME, PROGRAM)
11986e07dc26bSmrg# ------------------------------
11987e07dc26bSmrgAC_DEFUN([AM_MISSING_PROG],
11988e07dc26bSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
11989e07dc26bSmrg$1=${$1-"${am_missing_run}$2"}
11990e07dc26bSmrgAC_SUBST($1)])
11991e07dc26bSmrg
11992e07dc26bSmrg# AM_MISSING_HAS_RUN
11993e07dc26bSmrg# ------------------
11994e07dc26bSmrg# Define MISSING if not defined so far and test if it is modern enough.
11995e07dc26bSmrg# If it is, set am_missing_run to use it, otherwise, to nothing.
11996e07dc26bSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
11997e07dc26bSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
11998e07dc26bSmrgAC_REQUIRE_AUX_FILE([missing])dnl
11999e07dc26bSmrgif test x"${MISSING+set}" != xset; then
12000e07dc26bSmrg  case $am_aux_dir in
12001e07dc26bSmrg  *\ * | *\	*)
12002e07dc26bSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
12003e07dc26bSmrg  *)
12004e07dc26bSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
12005e07dc26bSmrg  esac
12006e07dc26bSmrgfi
12007e07dc26bSmrg# Use eval to expand $SHELL
12008e07dc26bSmrgif eval "$MISSING --is-lightweight"; then
12009e07dc26bSmrg  am_missing_run="$MISSING "
12010e07dc26bSmrgelse
12011e07dc26bSmrg  am_missing_run=
12012e07dc26bSmrg  AC_MSG_WARN(['missing' script is too old or missing])
12013e07dc26bSmrgfi
12014e07dc26bSmrg])
12015e07dc26bSmrg
12016e07dc26bSmrg# Helper functions for option handling.                     -*- Autoconf -*-
12017e07dc26bSmrg
12018e07dc26bSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
12019e07dc26bSmrg#
12020e07dc26bSmrg# This file is free software; the Free Software Foundation
12021e07dc26bSmrg# gives unlimited permission to copy and/or distribute it,
12022e07dc26bSmrg# with or without modifications, as long as this notice is preserved.
12023e07dc26bSmrg
12024e07dc26bSmrg# _AM_MANGLE_OPTION(NAME)
12025e07dc26bSmrg# -----------------------
12026e07dc26bSmrgAC_DEFUN([_AM_MANGLE_OPTION],
12027e07dc26bSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
12028e07dc26bSmrg
12029e07dc26bSmrg# _AM_SET_OPTION(NAME)
12030e07dc26bSmrg# --------------------
12031e07dc26bSmrg# Set option NAME.  Presently that only means defining a flag for this option.
12032e07dc26bSmrgAC_DEFUN([_AM_SET_OPTION],
12033e07dc26bSmrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
12034e07dc26bSmrg
12035e07dc26bSmrg# _AM_SET_OPTIONS(OPTIONS)
12036e07dc26bSmrg# ------------------------
12037e07dc26bSmrg# OPTIONS is a space-separated list of Automake options.
12038e07dc26bSmrgAC_DEFUN([_AM_SET_OPTIONS],
12039e07dc26bSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
12040e07dc26bSmrg
12041e07dc26bSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
12042e07dc26bSmrg# -------------------------------------------
12043e07dc26bSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
12044e07dc26bSmrgAC_DEFUN([_AM_IF_OPTION],
12045e07dc26bSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
12046e07dc26bSmrg
12047e07dc26bSmrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
12048e07dc26bSmrg#
12049e07dc26bSmrg# This file is free software; the Free Software Foundation
12050e07dc26bSmrg# gives unlimited permission to copy and/or distribute it,
12051e07dc26bSmrg# with or without modifications, as long as this notice is preserved.
12052e07dc26bSmrg
12053e07dc26bSmrg# _AM_PROG_CC_C_O
12054e07dc26bSmrg# ---------------
12055e07dc26bSmrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
12056e07dc26bSmrg# to automatically call this.
12057e07dc26bSmrgAC_DEFUN([_AM_PROG_CC_C_O],
12058e07dc26bSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
12059e07dc26bSmrgAC_REQUIRE_AUX_FILE([compile])dnl
12060e07dc26bSmrgAC_LANG_PUSH([C])dnl
12061e07dc26bSmrgAC_CACHE_CHECK(
12062e07dc26bSmrg  [whether $CC understands -c and -o together],
12063e07dc26bSmrg  [am_cv_prog_cc_c_o],
12064e07dc26bSmrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
12065e07dc26bSmrg  # Make sure it works both with $CC and with simple cc.
12066e07dc26bSmrg  # Following AC_PROG_CC_C_O, we do the test twice because some
12067e07dc26bSmrg  # compilers refuse to overwrite an existing .o file with -o,
12068e07dc26bSmrg  # though they will create one.
12069e07dc26bSmrg  am_cv_prog_cc_c_o=yes
12070e07dc26bSmrg  for am_i in 1 2; do
12071e07dc26bSmrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
12072e07dc26bSmrg         && test -f conftest2.$ac_objext; then
12073e07dc26bSmrg      : OK
12074e07dc26bSmrg    else
12075e07dc26bSmrg      am_cv_prog_cc_c_o=no
12076e07dc26bSmrg      break
12077e07dc26bSmrg    fi
12078e07dc26bSmrg  done
12079e07dc26bSmrg  rm -f core conftest*
12080e07dc26bSmrg  unset am_i])
12081e07dc26bSmrgif test "$am_cv_prog_cc_c_o" != yes; then
12082e07dc26bSmrg   # Losing compiler, so override with the script.
12083e07dc26bSmrg   # FIXME: It is wrong to rewrite CC.
12084e07dc26bSmrg   # But if we don't then we get into trouble of one sort or another.
12085e07dc26bSmrg   # A longer-term fix would be to have automake use am__CC in this case,
12086e07dc26bSmrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
12087e07dc26bSmrg   CC="$am_aux_dir/compile $CC"
12088e07dc26bSmrgfi
12089e07dc26bSmrgAC_LANG_POP([C])])
12090e07dc26bSmrg
12091e07dc26bSmrg# For backward compatibility.
12092e07dc26bSmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
12093e07dc26bSmrg
12094e07dc26bSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
12095e07dc26bSmrg#
12096e07dc26bSmrg# This file is free software; the Free Software Foundation
12097e07dc26bSmrg# gives unlimited permission to copy and/or distribute it,
12098e07dc26bSmrg# with or without modifications, as long as this notice is preserved.
12099e07dc26bSmrg
12100e07dc26bSmrg# AM_RUN_LOG(COMMAND)
12101e07dc26bSmrg# -------------------
12102e07dc26bSmrg# Run COMMAND, save the exit status in ac_status, and log it.
12103e07dc26bSmrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
12104e07dc26bSmrgAC_DEFUN([AM_RUN_LOG],
12105e07dc26bSmrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
12106e07dc26bSmrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
12107e07dc26bSmrg   ac_status=$?
12108e07dc26bSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
12109e07dc26bSmrg   (exit $ac_status); }])
12110e07dc26bSmrg
12111e07dc26bSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
12112e07dc26bSmrg
12113e07dc26bSmrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
12114e07dc26bSmrg#
12115e07dc26bSmrg# This file is free software; the Free Software Foundation
12116e07dc26bSmrg# gives unlimited permission to copy and/or distribute it,
12117e07dc26bSmrg# with or without modifications, as long as this notice is preserved.
12118e07dc26bSmrg
12119e07dc26bSmrg# AM_SANITY_CHECK
12120e07dc26bSmrg# ---------------
12121e07dc26bSmrgAC_DEFUN([AM_SANITY_CHECK],
12122e07dc26bSmrg[AC_MSG_CHECKING([whether build environment is sane])
12123e07dc26bSmrg# Reject unsafe characters in $srcdir or the absolute working directory
12124e07dc26bSmrg# name.  Accept space and tab only in the latter.
12125e07dc26bSmrgam_lf='
12126e07dc26bSmrg'
12127e07dc26bSmrgcase `pwd` in
12128e07dc26bSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
12129e07dc26bSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
12130e07dc26bSmrgesac
12131e07dc26bSmrgcase $srcdir in
12132e07dc26bSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
12133e07dc26bSmrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
12134e07dc26bSmrgesac
12135e07dc26bSmrg
12136e07dc26bSmrg# Do 'set' in a subshell so we don't clobber the current shell's
12137e07dc26bSmrg# arguments.  Must try -L first in case configure is actually a
12138e07dc26bSmrg# symlink; some systems play weird games with the mod time of symlinks
12139e07dc26bSmrg# (eg FreeBSD returns the mod time of the symlink's containing
12140e07dc26bSmrg# directory).
12141e07dc26bSmrgif (
12142e07dc26bSmrg   am_has_slept=no
12143e07dc26bSmrg   for am_try in 1 2; do
12144e07dc26bSmrg     echo "timestamp, slept: $am_has_slept" > conftest.file
12145e07dc26bSmrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
12146e07dc26bSmrg     if test "$[*]" = "X"; then
12147e07dc26bSmrg	# -L didn't work.
12148e07dc26bSmrg	set X `ls -t "$srcdir/configure" conftest.file`
12149e07dc26bSmrg     fi
12150e07dc26bSmrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
12151e07dc26bSmrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
12152e07dc26bSmrg
12153e07dc26bSmrg	# If neither matched, then we have a broken ls.  This can happen
12154e07dc26bSmrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
12155e07dc26bSmrg	# broken ls alias from the environment.  This has actually
12156e07dc26bSmrg	# happened.  Such a system could not be considered "sane".
12157e07dc26bSmrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
12158e07dc26bSmrg  alias in your environment])
12159e07dc26bSmrg     fi
12160e07dc26bSmrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
12161e07dc26bSmrg       break
12162e07dc26bSmrg     fi
12163e07dc26bSmrg     # Just in case.
12164e07dc26bSmrg     sleep 1
12165e07dc26bSmrg     am_has_slept=yes
12166e07dc26bSmrg   done
12167e07dc26bSmrg   test "$[2]" = conftest.file
12168e07dc26bSmrg   )
12169e07dc26bSmrgthen
12170e07dc26bSmrg   # Ok.
12171e07dc26bSmrg   :
12172e07dc26bSmrgelse
12173e07dc26bSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
12174e07dc26bSmrgCheck your system clock])
12175e07dc26bSmrgfi
12176e07dc26bSmrgAC_MSG_RESULT([yes])
12177e07dc26bSmrg# If we didn't sleep, we still need to ensure time stamps of config.status and
12178e07dc26bSmrg# generated files are strictly newer.
12179e07dc26bSmrgam_sleep_pid=
12180e07dc26bSmrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
12181e07dc26bSmrg  ( sleep 1 ) &
12182e07dc26bSmrg  am_sleep_pid=$!
12183e07dc26bSmrgfi
12184e07dc26bSmrgAC_CONFIG_COMMANDS_PRE(
12185e07dc26bSmrg  [AC_MSG_CHECKING([that generated files are newer than configure])
12186e07dc26bSmrg   if test -n "$am_sleep_pid"; then
12187e07dc26bSmrg     # Hide warnings about reused PIDs.
12188e07dc26bSmrg     wait $am_sleep_pid 2>/dev/null
12189e07dc26bSmrg   fi
12190e07dc26bSmrg   AC_MSG_RESULT([done])])
12191e07dc26bSmrgrm -f conftest.file
12192e07dc26bSmrg])
12193e07dc26bSmrg
12194e07dc26bSmrg# Copyright (C) 2009-2014 Free Software Foundation, Inc.
12195e07dc26bSmrg#
12196e07dc26bSmrg# This file is free software; the Free Software Foundation
12197e07dc26bSmrg# gives unlimited permission to copy and/or distribute it,
12198e07dc26bSmrg# with or without modifications, as long as this notice is preserved.
12199e07dc26bSmrg
12200e07dc26bSmrg# AM_SILENT_RULES([DEFAULT])
12201e07dc26bSmrg# --------------------------
12202e07dc26bSmrg# Enable less verbose build rules; with the default set to DEFAULT
12203e07dc26bSmrg# ("yes" being less verbose, "no" or empty being verbose).
12204e07dc26bSmrgAC_DEFUN([AM_SILENT_RULES],
12205e07dc26bSmrg[AC_ARG_ENABLE([silent-rules], [dnl
12206e07dc26bSmrgAS_HELP_STRING(
12207e07dc26bSmrg  [--enable-silent-rules],
12208e07dc26bSmrg  [less verbose build output (undo: "make V=1")])
12209e07dc26bSmrgAS_HELP_STRING(
12210e07dc26bSmrg  [--disable-silent-rules],
12211e07dc26bSmrg  [verbose build output (undo: "make V=0")])dnl
12212e07dc26bSmrg])
12213e07dc26bSmrgcase $enable_silent_rules in @%:@ (((
12214e07dc26bSmrg  yes) AM_DEFAULT_VERBOSITY=0;;
12215e07dc26bSmrg   no) AM_DEFAULT_VERBOSITY=1;;
12216e07dc26bSmrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
12217e07dc26bSmrgesac
12218e07dc26bSmrgdnl
12219e07dc26bSmrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
12220e07dc26bSmrgdnl do not support nested variable expansions.
12221e07dc26bSmrgdnl See automake bug#9928 and bug#10237.
12222e07dc26bSmrgam_make=${MAKE-make}
12223e07dc26bSmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
12224e07dc26bSmrg   [am_cv_make_support_nested_variables],
12225e07dc26bSmrg   [if AS_ECHO([['TRUE=$(BAR$(V))
12226e07dc26bSmrgBAR0=false
12227e07dc26bSmrgBAR1=true
12228e07dc26bSmrgV=1
12229e07dc26bSmrgam__doit:
12230e07dc26bSmrg	@$(TRUE)
12231e07dc26bSmrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
12232e07dc26bSmrg  am_cv_make_support_nested_variables=yes
12233e07dc26bSmrgelse
12234e07dc26bSmrg  am_cv_make_support_nested_variables=no
12235e07dc26bSmrgfi])
12236e07dc26bSmrgif test $am_cv_make_support_nested_variables = yes; then
12237e07dc26bSmrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
12238e07dc26bSmrg  AM_V='$(V)'
12239e07dc26bSmrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
12240e07dc26bSmrgelse
12241e07dc26bSmrg  AM_V=$AM_DEFAULT_VERBOSITY
12242e07dc26bSmrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
12243e07dc26bSmrgfi
12244e07dc26bSmrgAC_SUBST([AM_V])dnl
12245e07dc26bSmrgAM_SUBST_NOTMAKE([AM_V])dnl
12246e07dc26bSmrgAC_SUBST([AM_DEFAULT_V])dnl
12247e07dc26bSmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
12248e07dc26bSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
12249e07dc26bSmrgAM_BACKSLASH='\'
12250e07dc26bSmrgAC_SUBST([AM_BACKSLASH])dnl
12251e07dc26bSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
12252e07dc26bSmrg])
12253e07dc26bSmrg
12254e07dc26bSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
12255e07dc26bSmrg#
12256e07dc26bSmrg# This file is free software; the Free Software Foundation
12257e07dc26bSmrg# gives unlimited permission to copy and/or distribute it,
12258e07dc26bSmrg# with or without modifications, as long as this notice is preserved.
12259e07dc26bSmrg
12260e07dc26bSmrg# AM_PROG_INSTALL_STRIP
12261e07dc26bSmrg# ---------------------
12262e07dc26bSmrg# One issue with vendor 'install' (even GNU) is that you can't
12263e07dc26bSmrg# specify the program used to strip binaries.  This is especially
12264e07dc26bSmrg# annoying in cross-compiling environments, where the build's strip
12265e07dc26bSmrg# is unlikely to handle the host's binaries.
12266e07dc26bSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
12267e07dc26bSmrg# always use install-sh in "make install-strip", and initialize
12268e07dc26bSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
12269e07dc26bSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
12270e07dc26bSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
12271e07dc26bSmrg# Installed binaries are usually stripped using 'strip' when the user
12272e07dc26bSmrg# run "make install-strip".  However 'strip' might not be the right
12273e07dc26bSmrg# tool to use in cross-compilation environments, therefore Automake
12274e07dc26bSmrg# will honor the 'STRIP' environment variable to overrule this program.
12275e07dc26bSmrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
12276e07dc26bSmrgif test "$cross_compiling" != no; then
12277e07dc26bSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
12278e07dc26bSmrgfi
12279e07dc26bSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
12280e07dc26bSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
12281e07dc26bSmrg
12282e07dc26bSmrg# Copyright (C) 2006-2014 Free Software Foundation, Inc.
12283e07dc26bSmrg#
12284e07dc26bSmrg# This file is free software; the Free Software Foundation
12285e07dc26bSmrg# gives unlimited permission to copy and/or distribute it,
12286e07dc26bSmrg# with or without modifications, as long as this notice is preserved.
12287e07dc26bSmrg
12288e07dc26bSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
12289e07dc26bSmrg# ---------------------------
12290e07dc26bSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
12291e07dc26bSmrg# This macro is traced by Automake.
12292e07dc26bSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
12293e07dc26bSmrg
12294e07dc26bSmrg# AM_SUBST_NOTMAKE(VARIABLE)
12295e07dc26bSmrg# --------------------------
12296e07dc26bSmrg# Public sister of _AM_SUBST_NOTMAKE.
12297e07dc26bSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
12298e07dc26bSmrg
12299e07dc26bSmrg# Check how to create a tarball.                            -*- Autoconf -*-
12300e07dc26bSmrg
12301e07dc26bSmrg# Copyright (C) 2004-2014 Free Software Foundation, Inc.
12302e07dc26bSmrg#
12303e07dc26bSmrg# This file is free software; the Free Software Foundation
12304e07dc26bSmrg# gives unlimited permission to copy and/or distribute it,
12305e07dc26bSmrg# with or without modifications, as long as this notice is preserved.
12306e07dc26bSmrg
12307e07dc26bSmrg# _AM_PROG_TAR(FORMAT)
12308e07dc26bSmrg# --------------------
12309e07dc26bSmrg# Check how to create a tarball in format FORMAT.
12310e07dc26bSmrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
12311e07dc26bSmrg#
12312e07dc26bSmrg# Substitute a variable $(am__tar) that is a command
12313e07dc26bSmrg# writing to stdout a FORMAT-tarball containing the directory
12314e07dc26bSmrg# $tardir.
12315e07dc26bSmrg#     tardir=directory && $(am__tar) > result.tar
12316e07dc26bSmrg#
12317e07dc26bSmrg# Substitute a variable $(am__untar) that extract such
12318e07dc26bSmrg# a tarball read from stdin.
12319e07dc26bSmrg#     $(am__untar) < result.tar
12320e07dc26bSmrg#
12321e07dc26bSmrgAC_DEFUN([_AM_PROG_TAR],
12322e07dc26bSmrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
12323e07dc26bSmrg# in the wild :-(  We should find a proper way to deprecate it ...
12324e07dc26bSmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
12325e07dc26bSmrg
12326e07dc26bSmrg# We'll loop over all known methods to create a tar archive until one works.
12327e07dc26bSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
12328e07dc26bSmrg
12329e07dc26bSmrgm4_if([$1], [v7],
12330e07dc26bSmrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
12331e07dc26bSmrg
12332e07dc26bSmrg  [m4_case([$1],
12333e07dc26bSmrg    [ustar],
12334e07dc26bSmrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
12335e07dc26bSmrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
12336e07dc26bSmrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
12337e07dc26bSmrg      # and bug#13588).
12338e07dc26bSmrg      am_max_uid=2097151 # 2^21 - 1
12339e07dc26bSmrg      am_max_gid=$am_max_uid
12340e07dc26bSmrg      # The $UID and $GID variables are not portable, so we need to resort
12341e07dc26bSmrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
12342e07dc26bSmrg      # below are definitely unexpected, so allow the users to see them
12343e07dc26bSmrg      # (that is, avoid stderr redirection).
12344e07dc26bSmrg      am_uid=`id -u || echo unknown`
12345e07dc26bSmrg      am_gid=`id -g || echo unknown`
12346e07dc26bSmrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
12347e07dc26bSmrg      if test $am_uid -le $am_max_uid; then
12348e07dc26bSmrg         AC_MSG_RESULT([yes])
12349e07dc26bSmrg      else
12350e07dc26bSmrg         AC_MSG_RESULT([no])
12351e07dc26bSmrg         _am_tools=none
12352e07dc26bSmrg      fi
12353e07dc26bSmrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
12354e07dc26bSmrg      if test $am_gid -le $am_max_gid; then
12355e07dc26bSmrg         AC_MSG_RESULT([yes])
12356e07dc26bSmrg      else
12357e07dc26bSmrg        AC_MSG_RESULT([no])
12358e07dc26bSmrg        _am_tools=none
12359e07dc26bSmrg      fi],
12360e07dc26bSmrg
12361e07dc26bSmrg  [pax],
12362e07dc26bSmrg    [],
12363e07dc26bSmrg
12364e07dc26bSmrg  [m4_fatal([Unknown tar format])])
12365e07dc26bSmrg
12366e07dc26bSmrg  AC_MSG_CHECKING([how to create a $1 tar archive])
12367e07dc26bSmrg
12368e07dc26bSmrg  # Go ahead even if we have the value already cached.  We do so because we
12369e07dc26bSmrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
12370e07dc26bSmrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
12371e07dc26bSmrg
12372e07dc26bSmrg  for _am_tool in $_am_tools; do
12373e07dc26bSmrg    case $_am_tool in
12374e07dc26bSmrg    gnutar)
12375e07dc26bSmrg      for _am_tar in tar gnutar gtar; do
12376e07dc26bSmrg        AM_RUN_LOG([$_am_tar --version]) && break
12377e07dc26bSmrg      done
12378e07dc26bSmrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
12379e07dc26bSmrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
12380e07dc26bSmrg      am__untar="$_am_tar -xf -"
12381e07dc26bSmrg      ;;
12382e07dc26bSmrg    plaintar)
12383e07dc26bSmrg      # Must skip GNU tar: if it does not support --format= it doesn't create
12384e07dc26bSmrg      # ustar tarball either.
12385e07dc26bSmrg      (tar --version) >/dev/null 2>&1 && continue
12386e07dc26bSmrg      am__tar='tar chf - "$$tardir"'
12387e07dc26bSmrg      am__tar_='tar chf - "$tardir"'
12388e07dc26bSmrg      am__untar='tar xf -'
12389e07dc26bSmrg      ;;
12390e07dc26bSmrg    pax)
12391e07dc26bSmrg      am__tar='pax -L -x $1 -w "$$tardir"'
12392e07dc26bSmrg      am__tar_='pax -L -x $1 -w "$tardir"'
12393e07dc26bSmrg      am__untar='pax -r'
12394e07dc26bSmrg      ;;
12395e07dc26bSmrg    cpio)
12396e07dc26bSmrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
12397e07dc26bSmrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
12398e07dc26bSmrg      am__untar='cpio -i -H $1 -d'
12399e07dc26bSmrg      ;;
12400e07dc26bSmrg    none)
12401e07dc26bSmrg      am__tar=false
12402e07dc26bSmrg      am__tar_=false
12403e07dc26bSmrg      am__untar=false
12404e07dc26bSmrg      ;;
12405e07dc26bSmrg    esac
12406e07dc26bSmrg
12407e07dc26bSmrg    # If the value was cached, stop now.  We just wanted to have am__tar
12408e07dc26bSmrg    # and am__untar set.
12409e07dc26bSmrg    test -n "${am_cv_prog_tar_$1}" && break
12410e07dc26bSmrg
12411e07dc26bSmrg    # tar/untar a dummy directory, and stop if the command works.
12412e07dc26bSmrg    rm -rf conftest.dir
12413e07dc26bSmrg    mkdir conftest.dir
12414e07dc26bSmrg    echo GrepMe > conftest.dir/file
12415e07dc26bSmrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
12416e07dc26bSmrg    rm -rf conftest.dir
12417e07dc26bSmrg    if test -s conftest.tar; then
12418e07dc26bSmrg      AM_RUN_LOG([$am__untar <conftest.tar])
12419e07dc26bSmrg      AM_RUN_LOG([cat conftest.dir/file])
12420e07dc26bSmrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
12421e07dc26bSmrg    fi
12422e07dc26bSmrg  done
12423e07dc26bSmrg  rm -rf conftest.dir
12424e07dc26bSmrg
12425e07dc26bSmrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
12426e07dc26bSmrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
12427e07dc26bSmrg
12428e07dc26bSmrgAC_SUBST([am__tar])
12429e07dc26bSmrgAC_SUBST([am__untar])
12430e07dc26bSmrg]) # _AM_PROG_TAR
12431e07dc26bSmrg
12432