aclocal.m4 revision e5383a99
1e5383a99Smrg# generated automatically by aclocal 1.13.4 -*- Autoconf -*-
2af9a7ee5Smrg
3af9a7ee5Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
4caade7ccSmrg
5caade7ccSmrg# This file is free software; the Free Software Foundation
6caade7ccSmrg# gives unlimited permission to copy and/or distribute it,
7caade7ccSmrg# with or without modifications, as long as this notice is preserved.
8caade7ccSmrg
9caade7ccSmrg# This program is distributed in the hope that it will be useful,
10caade7ccSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11caade7ccSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12caade7ccSmrg# PARTICULAR PURPOSE.
13caade7ccSmrg
14af9a7ee5Smrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15485f0483Smrgm4_ifndef([AC_AUTOCONF_VERSION],
16485f0483Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17e5383a99Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
18e5383a99Smrg[m4_warning([this file was generated for autoconf 2.69.
19485f0483SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
20485f0483SmrgIf you have problems, you may need to regenerate the build system entirely.
21af9a7ee5SmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22caade7ccSmrg
23e5383a99Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
24caade7ccSmrg#
25e5383a99Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
26e5383a99Smrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
27e5383a99Smrg#                 Foundation, Inc.
28e5383a99Smrg#   Written by Gordon Matzigkeit, 1996
29caade7ccSmrg#
30e5383a99Smrg# This file is free software; the Free Software Foundation gives
31e5383a99Smrg# unlimited permission to copy and/or distribute it, with or without
32e5383a99Smrg# modifications, as long as this notice is preserved.
33caade7ccSmrg
34e5383a99Smrgm4_define([_LT_COPYING], [dnl
35e5383a99Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
36e5383a99Smrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
37e5383a99Smrg#                 Foundation, Inc.
38e5383a99Smrg#   Written by Gordon Matzigkeit, 1996
39caade7ccSmrg#
40e5383a99Smrg#   This file is part of GNU Libtool.
41caade7ccSmrg#
42e5383a99Smrg# GNU Libtool is free software; you can redistribute it and/or
43e5383a99Smrg# modify it under the terms of the GNU General Public License as
44e5383a99Smrg# published by the Free Software Foundation; either version 2 of
45e5383a99Smrg# the License, or (at your option) any later version.
46caade7ccSmrg#
47e5383a99Smrg# As a special exception to the GNU General Public License,
48e5383a99Smrg# if you distribute this file as part of a program or library that
49e5383a99Smrg# is built using GNU Libtool, you may include this file under the
50e5383a99Smrg# same distribution terms that you use for the rest of that program.
51caade7ccSmrg#
52e5383a99Smrg# GNU Libtool is distributed in the hope that it will be useful,
53e5383a99Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
54e5383a99Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
55e5383a99Smrg# GNU General Public License for more details.
56caade7ccSmrg#
57e5383a99Smrg# You should have received a copy of the GNU General Public License
58e5383a99Smrg# along with GNU Libtool; see the file COPYING.  If not, a copy
59e5383a99Smrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
60e5383a99Smrg# obtained by writing to the Free Software Foundation, Inc.,
61e5383a99Smrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
62caade7ccSmrg])
63caade7ccSmrg
64e5383a99Smrg# serial 57 LT_INIT
65caade7ccSmrg
66caade7ccSmrg
67e5383a99Smrg# LT_PREREQ(VERSION)
68e5383a99Smrg# ------------------
69e5383a99Smrg# Complain and exit if this libtool version is less that VERSION.
70e5383a99Smrgm4_defun([LT_PREREQ],
71e5383a99Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
72e5383a99Smrg       [m4_default([$3],
73e5383a99Smrg		   [m4_fatal([Libtool version $1 or higher is required],
74e5383a99Smrg		             63)])],
75e5383a99Smrg       [$2])])
76caade7ccSmrg
77caade7ccSmrg
78e5383a99Smrg# _LT_CHECK_BUILDDIR
79e5383a99Smrg# ------------------
80e5383a99Smrg# Complain if the absolute build directory name contains unusual characters
81e5383a99Smrgm4_defun([_LT_CHECK_BUILDDIR],
82e5383a99Smrg[case `pwd` in
83e5383a99Smrg  *\ * | *\	*)
84e5383a99Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
85e5383a99Smrgesac
86e5383a99Smrg])
87caade7ccSmrg
88caade7ccSmrg
89e5383a99Smrg# LT_INIT([OPTIONS])
90e5383a99Smrg# ------------------
91e5383a99SmrgAC_DEFUN([LT_INIT],
92e5383a99Smrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
93e5383a99SmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
94e5383a99SmrgAC_BEFORE([$0], [LT_LANG])dnl
95e5383a99SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
96e5383a99SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
97e5383a99Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
98caade7ccSmrg
99e5383a99Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
100e5383a99Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
101e5383a99Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
102e5383a99Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
103e5383a99Smrgdnl unless we require an AC_DEFUNed macro:
104e5383a99SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
105e5383a99SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
106e5383a99SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
107e5383a99SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
108e5383a99Smrgm4_require([_LT_PROG_LTMAIN])dnl
109caade7ccSmrg
110e5383a99Smrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
111caade7ccSmrg
112e5383a99Smrgdnl Parse OPTIONS
113e5383a99Smrg_LT_SET_OPTIONS([$0], [$1])
114caade7ccSmrg
115e5383a99Smrg# This can be used to rebuild libtool when needed
116e5383a99SmrgLIBTOOL_DEPS="$ltmain"
117485f0483Smrg
118e5383a99Smrg# Always use our own libtool.
119e5383a99SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
120e5383a99SmrgAC_SUBST(LIBTOOL)dnl
121caade7ccSmrg
122e5383a99Smrg_LT_SETUP
123caade7ccSmrg
124e5383a99Smrg# Only expand once:
125e5383a99Smrgm4_define([LT_INIT])
126e5383a99Smrg])# LT_INIT
127caade7ccSmrg
128e5383a99Smrg# Old names:
129e5383a99SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
130e5383a99SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
131e5383a99Smrgdnl aclocal-1.4 backwards compatibility:
132e5383a99Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
133e5383a99Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
134caade7ccSmrg
135caade7ccSmrg
136e5383a99Smrg# _LT_CC_BASENAME(CC)
137e5383a99Smrg# -------------------
138e5383a99Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
139e5383a99Smrgm4_defun([_LT_CC_BASENAME],
140e5383a99Smrg[for cc_temp in $1""; do
141e5383a99Smrg  case $cc_temp in
142e5383a99Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
143e5383a99Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
144e5383a99Smrg    \-*) ;;
145e5383a99Smrg    *) break;;
146e5383a99Smrg  esac
147e5383a99Smrgdone
148e5383a99Smrgcc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
149caade7ccSmrg])
150caade7ccSmrg
151caade7ccSmrg
152e5383a99Smrg# _LT_FILEUTILS_DEFAULTS
153e5383a99Smrg# ----------------------
154e5383a99Smrg# It is okay to use these file commands and assume they have been set
155e5383a99Smrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
156e5383a99Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
157e5383a99Smrg[: ${CP="cp -f"}
158e5383a99Smrg: ${MV="mv -f"}
159e5383a99Smrg: ${RM="rm -f"}
160e5383a99Smrg])# _LT_FILEUTILS_DEFAULTS
161caade7ccSmrg
162caade7ccSmrg
163e5383a99Smrg# _LT_SETUP
164e5383a99Smrg# ---------
165e5383a99Smrgm4_defun([_LT_SETUP],
166e5383a99Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
167e5383a99SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
168e5383a99SmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
169e5383a99SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
170caade7ccSmrg
171e5383a99Smrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
172e5383a99Smrgdnl
173e5383a99Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
174e5383a99Smrg_LT_DECL([], [host], [0])dnl
175e5383a99Smrg_LT_DECL([], [host_os], [0])dnl
176e5383a99Smrgdnl
177e5383a99Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
178e5383a99Smrg_LT_DECL([], [build], [0])dnl
179e5383a99Smrg_LT_DECL([], [build_os], [0])dnl
180e5383a99Smrgdnl
181e5383a99SmrgAC_REQUIRE([AC_PROG_CC])dnl
182e5383a99SmrgAC_REQUIRE([LT_PATH_LD])dnl
183e5383a99SmrgAC_REQUIRE([LT_PATH_NM])dnl
184e5383a99Smrgdnl
185e5383a99SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
186e5383a99Smrgtest -z "$LN_S" && LN_S="ln -s"
187e5383a99Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
188e5383a99Smrgdnl
189e5383a99SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
190e5383a99Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
191e5383a99Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
192e5383a99Smrgdnl
193e5383a99Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
194e5383a99Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
195e5383a99Smrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
196e5383a99Smrgm4_require([_LT_CMD_RELOAD])dnl
197e5383a99Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
198e5383a99Smrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
199e5383a99Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
200e5383a99Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
201e5383a99Smrgm4_require([_LT_WITH_SYSROOT])dnl
202caade7ccSmrg
203e5383a99Smrg_LT_CONFIG_LIBTOOL_INIT([
204e5383a99Smrg# See if we are running on zsh, and set the options which allow our
205e5383a99Smrg# commands through without removal of \ escapes INIT.
206e5383a99Smrgif test -n "\${ZSH_VERSION+set}" ; then
207e5383a99Smrg   setopt NO_GLOB_SUBST
208e5383a99Smrgfi
209caade7ccSmrg])
210e5383a99Smrgif test -n "${ZSH_VERSION+set}" ; then
211e5383a99Smrg   setopt NO_GLOB_SUBST
212e5383a99Smrgfi
213caade7ccSmrg
214e5383a99Smrg_LT_CHECK_OBJDIR
215caade7ccSmrg
216e5383a99Smrgm4_require([_LT_TAG_COMPILER])dnl
217caade7ccSmrg
218e5383a99Smrgcase $host_os in
219e5383a99Smrgaix3*)
220e5383a99Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
221e5383a99Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
222e5383a99Smrg  # vanish in a puff of smoke.
223e5383a99Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
224e5383a99Smrg    COLLECT_NAMES=
225e5383a99Smrg    export COLLECT_NAMES
226caade7ccSmrg  fi
227e5383a99Smrg  ;;
228e5383a99Smrgesac
229caade7ccSmrg
230e5383a99Smrg# Global variables:
231e5383a99Smrgofile=libtool
232e5383a99Smrgcan_build_shared=yes
233caade7ccSmrg
234e5383a99Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
235e5383a99Smrg# which needs '.lib').
236e5383a99Smrglibext=a
237caade7ccSmrg
238e5383a99Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
239caade7ccSmrg
240e5383a99Smrgold_CC="$CC"
241e5383a99Smrgold_CFLAGS="$CFLAGS"
242caade7ccSmrg
243e5383a99Smrg# Set sane defaults for various variables
244e5383a99Smrgtest -z "$CC" && CC=cc
245e5383a99Smrgtest -z "$LTCC" && LTCC=$CC
246e5383a99Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
247e5383a99Smrgtest -z "$LD" && LD=ld
248e5383a99Smrgtest -z "$ac_objext" && ac_objext=o
249485f0483Smrg
250e5383a99Smrg_LT_CC_BASENAME([$compiler])
251caade7ccSmrg
252e5383a99Smrg# Only perform the check for file, if the check method requires it
253e5383a99Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
254e5383a99Smrgcase $deplibs_check_method in
255e5383a99Smrgfile_magic*)
256e5383a99Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
257e5383a99Smrg    _LT_PATH_MAGIC
258e5383a99Smrg  fi
259e5383a99Smrg  ;;
260e5383a99Smrgesac
261caade7ccSmrg
262e5383a99Smrg# Use C for the default configuration in the libtool script
263e5383a99SmrgLT_SUPPORTED_TAG([CC])
264e5383a99Smrg_LT_LANG_C_CONFIG
265e5383a99Smrg_LT_LANG_DEFAULT_CONFIG
266e5383a99Smrg_LT_CONFIG_COMMANDS
267e5383a99Smrg])# _LT_SETUP
268caade7ccSmrg
269caade7ccSmrg
270e5383a99Smrg# _LT_PREPARE_SED_QUOTE_VARS
271e5383a99Smrg# --------------------------
272e5383a99Smrg# Define a few sed substitution that help us do robust quoting.
273e5383a99Smrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
274e5383a99Smrg[# Backslashify metacharacters that are still active within
275e5383a99Smrg# double-quoted strings.
276e5383a99Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
277caade7ccSmrg
278e5383a99Smrg# Same as above, but do not quote variable references.
279e5383a99Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
280caade7ccSmrg
281e5383a99Smrg# Sed substitution to delay expansion of an escaped shell variable in a
282e5383a99Smrg# double_quote_subst'ed string.
283e5383a99Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
284caade7ccSmrg
285e5383a99Smrg# Sed substitution to delay expansion of an escaped single quote.
286e5383a99Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
287caade7ccSmrg
288e5383a99Smrg# Sed substitution to avoid accidental globbing in evaled expressions
289e5383a99Smrgno_glob_subst='s/\*/\\\*/g'
290e5383a99Smrg])
291caade7ccSmrg
292e5383a99Smrg# _LT_PROG_LTMAIN
293e5383a99Smrg# ---------------
294e5383a99Smrg# Note that this code is called both from `configure', and `config.status'
295e5383a99Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
296e5383a99Smrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
297e5383a99Smrg# so we pass a copy along to make sure it has a sensible value anyway.
298e5383a99Smrgm4_defun([_LT_PROG_LTMAIN],
299e5383a99Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
300e5383a99Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
301e5383a99Smrgltmain="$ac_aux_dir/ltmain.sh"
302e5383a99Smrg])# _LT_PROG_LTMAIN
303caade7ccSmrg
304caade7ccSmrg
305caade7ccSmrg
306e5383a99Smrg# So that we can recreate a full libtool script including additional
307e5383a99Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
308e5383a99Smrg# in macros and then make a single call at the end using the `libtool'
309e5383a99Smrg# label.
310e5383a99Smrg
311e5383a99Smrg
312e5383a99Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
313e5383a99Smrg# ----------------------------------------
314e5383a99Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
315e5383a99Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
316e5383a99Smrg[m4_ifval([$1],
317e5383a99Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
318e5383a99Smrg                     [$1
319e5383a99Smrg])])])
320e5383a99Smrg
321e5383a99Smrg# Initialize.
322e5383a99Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
323e5383a99Smrg
324e5383a99Smrg
325e5383a99Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
326caade7ccSmrg# ------------------------------
327e5383a99Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
328e5383a99Smrgm4_define([_LT_CONFIG_LIBTOOL],
329e5383a99Smrg[m4_ifval([$1],
330e5383a99Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
331e5383a99Smrg                     [$1
332e5383a99Smrg])])])
333caade7ccSmrg
334e5383a99Smrg# Initialize.
335e5383a99Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
336e5383a99Smrg
337e5383a99Smrg
338e5383a99Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
339e5383a99Smrg# -----------------------------------------------------
340e5383a99Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
341e5383a99Smrg[_LT_CONFIG_LIBTOOL([$1])
342e5383a99Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
343caade7ccSmrg])
344caade7ccSmrg
345caade7ccSmrg
346e5383a99Smrg# _LT_FORMAT_COMMENT([COMMENT])
347e5383a99Smrg# -----------------------------
348e5383a99Smrg# Add leading comment marks to the start of each line, and a trailing
349e5383a99Smrg# full-stop to the whole comment if one is not present already.
350e5383a99Smrgm4_define([_LT_FORMAT_COMMENT],
351e5383a99Smrg[m4_ifval([$1], [
352e5383a99Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
353e5383a99Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
354e5383a99Smrg)])
355caade7ccSmrg
356caade7ccSmrg
357caade7ccSmrg
358caade7ccSmrg
359caade7ccSmrg
360e5383a99Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
361e5383a99Smrg# -------------------------------------------------------------------
362e5383a99Smrg# CONFIGNAME is the name given to the value in the libtool script.
363e5383a99Smrg# VARNAME is the (base) name used in the configure script.
364e5383a99Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
365e5383a99Smrg# VARNAME.  Any other value will be used directly.
366e5383a99Smrgm4_define([_LT_DECL],
367e5383a99Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
368e5383a99Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
369e5383a99Smrg	[m4_ifval([$1], [$1], [$2])])
370e5383a99Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
371e5383a99Smrg    m4_ifval([$4],
372e5383a99Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
373e5383a99Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
374e5383a99Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
375e5383a99Smrg])
376caade7ccSmrg
377caade7ccSmrg
378e5383a99Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
379e5383a99Smrg# --------------------------------------------------------
380e5383a99Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
381485f0483Smrg
382af9a7ee5Smrg
383e5383a99Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
384e5383a99Smrg# ------------------------------------------------
385e5383a99Smrgm4_define([lt_decl_tag_varnames],
386e5383a99Smrg[_lt_decl_filter([tagged?], [yes], $@)])
387e5383a99Smrg
388e5383a99Smrg
389e5383a99Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
390e5383a99Smrg# ---------------------------------------------------------
391e5383a99Smrgm4_define([_lt_decl_filter],
392e5383a99Smrg[m4_case([$#],
393e5383a99Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
394e5383a99Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
395e5383a99Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
396e5383a99Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
397e5383a99Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
398af9a7ee5Smrg])
399caade7ccSmrg
400485f0483Smrg
401e5383a99Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
402e5383a99Smrg# --------------------------------------------------
403e5383a99Smrgm4_define([lt_decl_quote_varnames],
404e5383a99Smrg[_lt_decl_filter([value], [1], $@)])
405e5383a99Smrg
406e5383a99Smrg
407e5383a99Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
408e5383a99Smrg# ---------------------------------------------------
409e5383a99Smrgm4_define([lt_decl_dquote_varnames],
410e5383a99Smrg[_lt_decl_filter([value], [2], $@)])
411e5383a99Smrg
412e5383a99Smrg
413e5383a99Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
414e5383a99Smrg# ---------------------------------------------------
415e5383a99Smrgm4_define([lt_decl_varnames_tagged],
416e5383a99Smrg[m4_assert([$# <= 2])dnl
417e5383a99Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
418e5383a99Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
419e5383a99Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
420e5383a99Smrgm4_define([_lt_decl_varnames_tagged],
421e5383a99Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
422e5383a99Smrg
423e5383a99Smrg
424e5383a99Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
425e5383a99Smrg# ------------------------------------------------
426e5383a99Smrgm4_define([lt_decl_all_varnames],
427e5383a99Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
428e5383a99Smrg     m4_if([$2], [],
429e5383a99Smrg	   m4_quote(lt_decl_varnames),
430e5383a99Smrg	m4_quote(m4_shift($@))))[]dnl
431af9a7ee5Smrg])
432e5383a99Smrgm4_define([_lt_decl_all_varnames],
433e5383a99Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
434e5383a99Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
435485f0483Smrg])
436485f0483Smrg
437caade7ccSmrg
438e5383a99Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
439e5383a99Smrg# ------------------------------------
440e5383a99Smrg# Quote a variable value, and forward it to `config.status' so that its
441e5383a99Smrg# declaration there will have the same value as in `configure'.  VARNAME
442e5383a99Smrg# must have a single quote delimited value for this to work.
443e5383a99Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
444e5383a99Smrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
445caade7ccSmrg
446caade7ccSmrg
447e5383a99Smrg# _LT_CONFIG_STATUS_DECLARATIONS
448e5383a99Smrg# ------------------------------
449e5383a99Smrg# We delimit libtool config variables with single quotes, so when
450e5383a99Smrg# we write them to config.status, we have to be sure to quote all
451e5383a99Smrg# embedded single quotes properly.  In configure, this macro expands
452e5383a99Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
453e5383a99Smrg#
454e5383a99Smrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
455e5383a99Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
456e5383a99Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
457e5383a99Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
458caade7ccSmrg
459485f0483Smrg
460e5383a99Smrg# _LT_LIBTOOL_TAGS
461e5383a99Smrg# ----------------
462e5383a99Smrg# Output comment and list of tags supported by the script
463e5383a99Smrgm4_defun([_LT_LIBTOOL_TAGS],
464e5383a99Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
465e5383a99Smrgavailable_tags="_LT_TAGS"dnl
466e5383a99Smrg])
467caade7ccSmrg
468caade7ccSmrg
469e5383a99Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
470e5383a99Smrg# -----------------------------------
471e5383a99Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
472e5383a99Smrg# expand to a commented shell variable setting:
473af9a7ee5Smrg#
474e5383a99Smrg#    # Some comment about what VAR is for.
475e5383a99Smrg#    visible_name=$lt_internal_name
476e5383a99Smrgm4_define([_LT_LIBTOOL_DECLARE],
477e5383a99Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
478e5383a99Smrg					   [description])))[]dnl
479e5383a99Smrgm4_pushdef([_libtool_name],
480e5383a99Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
481e5383a99Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
482e5383a99Smrg    [0], [_libtool_name=[$]$1],
483e5383a99Smrg    [1], [_libtool_name=$lt_[]$1],
484e5383a99Smrg    [2], [_libtool_name=$lt_[]$1],
485e5383a99Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
486e5383a99Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
487e5383a99Smrg])
488af9a7ee5Smrg
489caade7ccSmrg
490e5383a99Smrg# _LT_LIBTOOL_CONFIG_VARS
491e5383a99Smrg# -----------------------
492e5383a99Smrg# Produce commented declarations of non-tagged libtool config variables
493e5383a99Smrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
494e5383a99Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
495e5383a99Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
496e5383a99Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
497e5383a99Smrg[m4_foreach([_lt_var],
498e5383a99Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
499e5383a99Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
500af9a7ee5Smrg
501af9a7ee5Smrg
502e5383a99Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
503e5383a99Smrg# -------------------------
504e5383a99Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
505e5383a99Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
506e5383a99Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
507caade7ccSmrg
508af9a7ee5Smrg
509e5383a99Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
510e5383a99Smrg# ------------------------------
511e5383a99Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
512af9a7ee5Smrg
513af9a7ee5Smrg
514e5383a99Smrg# _LT_CONFIG_COMMANDS
515e5383a99Smrg# -------------------
516e5383a99Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
517e5383a99Smrg# variables for single and double quote escaping we saved from calls
518e5383a99Smrg# to _LT_DECL, we can put quote escaped variables declarations
519e5383a99Smrg# into `config.status', and then the shell code to quote escape them in
520e5383a99Smrg# for loops in `config.status'.  Finally, any additional code accumulated
521e5383a99Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
522e5383a99Smrgm4_defun([_LT_CONFIG_COMMANDS],
523e5383a99Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
524e5383a99Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
525e5383a99Smrg	dnl instead of duplicating it all over again into config.status,
526e5383a99Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
527e5383a99Smrg	dnl needs to know what name is stored there:
528e5383a99Smrg        [AC_CONFIG_COMMANDS([libtool],
529e5383a99Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
530e5383a99Smrg    dnl If the libtool generation code is destined for config.status,
531e5383a99Smrg    dnl expand the accumulated commands and init code now:
532e5383a99Smrg    [AC_CONFIG_COMMANDS([libtool],
533e5383a99Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
534e5383a99Smrg])#_LT_CONFIG_COMMANDS
535af9a7ee5Smrg
536caade7ccSmrg
537e5383a99Smrg# Initialize.
538e5383a99Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
539e5383a99Smrg[
540caade7ccSmrg
541e5383a99Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
542e5383a99Smrg# if CDPATH is set.
543e5383a99Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
544caade7ccSmrg
545e5383a99Smrgsed_quote_subst='$sed_quote_subst'
546e5383a99Smrgdouble_quote_subst='$double_quote_subst'
547e5383a99Smrgdelay_variable_subst='$delay_variable_subst'
548e5383a99Smrg_LT_CONFIG_STATUS_DECLARATIONS
549e5383a99SmrgLTCC='$LTCC'
550e5383a99SmrgLTCFLAGS='$LTCFLAGS'
551e5383a99Smrgcompiler='$compiler_DEFAULT'
552caade7ccSmrg
553e5383a99Smrg# A function that is used when there is no print builtin or printf.
554e5383a99Smrgfunc_fallback_echo ()
555e5383a99Smrg{
556e5383a99Smrg  eval 'cat <<_LTECHO_EOF
557e5383a99Smrg\$[]1
558e5383a99Smrg_LTECHO_EOF'
559e5383a99Smrg}
560caade7ccSmrg
561e5383a99Smrg# Quote evaled strings.
562e5383a99Smrgfor var in lt_decl_all_varnames([[ \
563e5383a99Smrg]], lt_decl_quote_varnames); do
564e5383a99Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
565e5383a99Smrg    *[[\\\\\\\`\\"\\\$]]*)
566e5383a99Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
567e5383a99Smrg      ;;
568e5383a99Smrg    *)
569e5383a99Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
570e5383a99Smrg      ;;
571e5383a99Smrg    esac
572e5383a99Smrgdone
573caade7ccSmrg
574e5383a99Smrg# Double-quote double-evaled strings.
575e5383a99Smrgfor var in lt_decl_all_varnames([[ \
576e5383a99Smrg]], lt_decl_dquote_varnames); do
577e5383a99Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
578e5383a99Smrg    *[[\\\\\\\`\\"\\\$]]*)
579e5383a99Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
580e5383a99Smrg      ;;
581e5383a99Smrg    *)
582e5383a99Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
583e5383a99Smrg      ;;
584e5383a99Smrg    esac
585e5383a99Smrgdone
586caade7ccSmrg
587e5383a99Smrg_LT_OUTPUT_LIBTOOL_INIT
588af9a7ee5Smrg])
589caade7ccSmrg
590e5383a99Smrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
591e5383a99Smrg# ------------------------------------
592e5383a99Smrg# Generate a child script FILE with all initialization necessary to
593e5383a99Smrg# reuse the environment learned by the parent script, and make the
594e5383a99Smrg# file executable.  If COMMENT is supplied, it is inserted after the
595e5383a99Smrg# `#!' sequence but before initialization text begins.  After this
596e5383a99Smrg# macro, additional text can be appended to FILE to form the body of
597e5383a99Smrg# the child script.  The macro ends with non-zero status if the
598e5383a99Smrg# file could not be fully written (such as if the disk is full).
599e5383a99Smrgm4_ifdef([AS_INIT_GENERATED],
600e5383a99Smrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
601e5383a99Smrg[m4_defun([_LT_GENERATED_FILE_INIT],
602e5383a99Smrg[m4_require([AS_PREPARE])]dnl
603e5383a99Smrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
604e5383a99Smrg[lt_write_fail=0
605e5383a99Smrgcat >$1 <<_ASEOF || lt_write_fail=1
606e5383a99Smrg#! $SHELL
607e5383a99Smrg# Generated by $as_me.
608e5383a99Smrg$2
609e5383a99SmrgSHELL=\${CONFIG_SHELL-$SHELL}
610e5383a99Smrgexport SHELL
611e5383a99Smrg_ASEOF
612e5383a99Smrgcat >>$1 <<\_ASEOF || lt_write_fail=1
613e5383a99SmrgAS_SHELL_SANITIZE
614e5383a99Smrg_AS_PREPARE
615e5383a99Smrgexec AS_MESSAGE_FD>&1
616e5383a99Smrg_ASEOF
617e5383a99Smrgtest $lt_write_fail = 0 && chmod +x $1[]dnl
618e5383a99Smrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
619caade7ccSmrg
620e5383a99Smrg# LT_OUTPUT
621e5383a99Smrg# ---------
622e5383a99Smrg# This macro allows early generation of the libtool script (before
623e5383a99Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
624e5383a99Smrg# tests.
625e5383a99SmrgAC_DEFUN([LT_OUTPUT],
626e5383a99Smrg[: ${CONFIG_LT=./config.lt}
627e5383a99SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
628e5383a99Smrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
629e5383a99Smrg[# Run this file to recreate a libtool stub with the current configuration.])
630caade7ccSmrg
631e5383a99Smrgcat >>"$CONFIG_LT" <<\_LTEOF
632e5383a99Smrglt_cl_silent=false
633e5383a99Smrgexec AS_MESSAGE_LOG_FD>>config.log
634e5383a99Smrg{
635e5383a99Smrg  echo
636e5383a99Smrg  AS_BOX([Running $as_me.])
637e5383a99Smrg} >&AS_MESSAGE_LOG_FD
638caade7ccSmrg
639e5383a99Smrglt_cl_help="\
640e5383a99Smrg\`$as_me' creates a local libtool stub from the current configuration,
641e5383a99Smrgfor use in further configure time tests before the real libtool is
642e5383a99Smrggenerated.
643caade7ccSmrg
644e5383a99SmrgUsage: $[0] [[OPTIONS]]
645b9b4fd27Smrg
646e5383a99Smrg  -h, --help      print this help, then exit
647e5383a99Smrg  -V, --version   print version number, then exit
648e5383a99Smrg  -q, --quiet     do not print progress messages
649e5383a99Smrg  -d, --debug     don't remove temporary files
650b9b4fd27Smrg
651e5383a99SmrgReport bugs to <bug-libtool@gnu.org>."
652caade7ccSmrg
653e5383a99Smrglt_cl_version="\
654e5383a99Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
655e5383a99Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
656e5383a99Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
657b9b4fd27Smrg
658e5383a99SmrgCopyright (C) 2011 Free Software Foundation, Inc.
659e5383a99SmrgThis config.lt script is free software; the Free Software Foundation
660e5383a99Smrggives unlimited permision to copy, distribute and modify it."
661e5383a99Smrg
662e5383a99Smrgwhile test $[#] != 0
663e5383a99Smrgdo
664e5383a99Smrg  case $[1] in
665e5383a99Smrg    --version | --v* | -V )
666e5383a99Smrg      echo "$lt_cl_version"; exit 0 ;;
667e5383a99Smrg    --help | --h* | -h )
668e5383a99Smrg      echo "$lt_cl_help"; exit 0 ;;
669e5383a99Smrg    --debug | --d* | -d )
670e5383a99Smrg      debug=: ;;
671e5383a99Smrg    --quiet | --q* | --silent | --s* | -q )
672e5383a99Smrg      lt_cl_silent=: ;;
673b9b4fd27Smrg
674e5383a99Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
675e5383a99SmrgTry \`$[0] --help' for more information.]) ;;
676b9b4fd27Smrg
677e5383a99Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
678e5383a99SmrgTry \`$[0] --help' for more information.]) ;;
679af9a7ee5Smrg  esac
680e5383a99Smrg  shift
681af9a7ee5Smrgdone
682caade7ccSmrg
683e5383a99Smrgif $lt_cl_silent; then
684e5383a99Smrg  exec AS_MESSAGE_FD>/dev/null
685e5383a99Smrgfi
686e5383a99Smrg_LTEOF
687caade7ccSmrg
688e5383a99Smrgcat >>"$CONFIG_LT" <<_LTEOF
689e5383a99Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
690e5383a99Smrg_LTEOF
691caade7ccSmrg
692e5383a99Smrgcat >>"$CONFIG_LT" <<\_LTEOF
693e5383a99SmrgAC_MSG_NOTICE([creating $ofile])
694e5383a99Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
695e5383a99SmrgAS_EXIT(0)
696e5383a99Smrg_LTEOF
697e5383a99Smrgchmod +x "$CONFIG_LT"
698caade7ccSmrg
699e5383a99Smrg# configure is writing to config.log, but config.lt does its own redirection,
700e5383a99Smrg# appending to config.log, which fails on DOS, as config.log is still kept
701e5383a99Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
702e5383a99Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
703e5383a99Smrglt_cl_success=:
704e5383a99Smrgtest "$silent" = yes &&
705e5383a99Smrg  lt_config_lt_args="$lt_config_lt_args --quiet"
706e5383a99Smrgexec AS_MESSAGE_LOG_FD>/dev/null
707e5383a99Smrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
708e5383a99Smrgexec AS_MESSAGE_LOG_FD>>config.log
709e5383a99Smrg$lt_cl_success || AS_EXIT(1)
710e5383a99Smrg])# LT_OUTPUT
711caade7ccSmrg
712caade7ccSmrg
713e5383a99Smrg# _LT_CONFIG(TAG)
714e5383a99Smrg# ---------------
715e5383a99Smrg# If TAG is the built-in tag, create an initial libtool script with a
716e5383a99Smrg# default configuration from the untagged config vars.  Otherwise add code
717e5383a99Smrg# to config.status for appending the configuration named by TAG from the
718e5383a99Smrg# matching tagged config vars.
719e5383a99Smrgm4_defun([_LT_CONFIG],
720e5383a99Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
721e5383a99Smrg_LT_CONFIG_SAVE_COMMANDS([
722e5383a99Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
723e5383a99Smrg  m4_if(_LT_TAG, [C], [
724e5383a99Smrg    # See if we are running on zsh, and set the options which allow our
725e5383a99Smrg    # commands through without removal of \ escapes.
726e5383a99Smrg    if test -n "${ZSH_VERSION+set}" ; then
727e5383a99Smrg      setopt NO_GLOB_SUBST
728e5383a99Smrg    fi
729caade7ccSmrg
730e5383a99Smrg    cfgfile="${ofile}T"
731e5383a99Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
732e5383a99Smrg    $RM "$cfgfile"
733caade7ccSmrg
734e5383a99Smrg    cat <<_LT_EOF >> "$cfgfile"
735e5383a99Smrg#! $SHELL
736caade7ccSmrg
737e5383a99Smrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
738e5383a99Smrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
739e5383a99Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
740e5383a99Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
741e5383a99Smrg#
742e5383a99Smrg_LT_COPYING
743e5383a99Smrg_LT_LIBTOOL_TAGS
744caade7ccSmrg
745e5383a99Smrg# ### BEGIN LIBTOOL CONFIG
746e5383a99Smrg_LT_LIBTOOL_CONFIG_VARS
747e5383a99Smrg_LT_LIBTOOL_TAG_VARS
748e5383a99Smrg# ### END LIBTOOL CONFIG
749caade7ccSmrg
750e5383a99Smrg_LT_EOF
751b9b4fd27Smrg
752e5383a99Smrg  case $host_os in
753e5383a99Smrg  aix3*)
754e5383a99Smrg    cat <<\_LT_EOF >> "$cfgfile"
755e5383a99Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
756e5383a99Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
757e5383a99Smrg# vanish in a puff of smoke.
758e5383a99Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
759e5383a99Smrg  COLLECT_NAMES=
760e5383a99Smrg  export COLLECT_NAMES
761e5383a99Smrgfi
762e5383a99Smrg_LT_EOF
763e5383a99Smrg    ;;
764e5383a99Smrg  esac
765caade7ccSmrg
766e5383a99Smrg  _LT_PROG_LTMAIN
767caade7ccSmrg
768e5383a99Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
769e5383a99Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
770e5383a99Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
771e5383a99Smrg  # is reportedly fixed, but why not run on old versions too?
772e5383a99Smrg  sed '$q' "$ltmain" >> "$cfgfile" \
773e5383a99Smrg     || (rm -f "$cfgfile"; exit 1)
774caade7ccSmrg
775e5383a99Smrg  _LT_PROG_REPLACE_SHELLFNS
776caade7ccSmrg
777e5383a99Smrg   mv -f "$cfgfile" "$ofile" ||
778e5383a99Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
779e5383a99Smrg  chmod +x "$ofile"
780e5383a99Smrg],
781e5383a99Smrg[cat <<_LT_EOF >> "$ofile"
782caade7ccSmrg
783e5383a99Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
784e5383a99Smrgdnl in a comment (ie after a #).
785e5383a99Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
786e5383a99Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
787e5383a99Smrg# ### END LIBTOOL TAG CONFIG: $1
788e5383a99Smrg_LT_EOF
789e5383a99Smrg])dnl /m4_if
790e5383a99Smrg],
791e5383a99Smrg[m4_if([$1], [], [
792e5383a99Smrg    PACKAGE='$PACKAGE'
793e5383a99Smrg    VERSION='$VERSION'
794e5383a99Smrg    TIMESTAMP='$TIMESTAMP'
795e5383a99Smrg    RM='$RM'
796e5383a99Smrg    ofile='$ofile'], [])
797e5383a99Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
798e5383a99Smrg])# _LT_CONFIG
799caade7ccSmrg
800caade7ccSmrg
801e5383a99Smrg# LT_SUPPORTED_TAG(TAG)
802e5383a99Smrg# ---------------------
803e5383a99Smrg# Trace this macro to discover what tags are supported by the libtool
804e5383a99Smrg# --tag option, using:
805e5383a99Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
806e5383a99SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
807caade7ccSmrg
808b9b4fd27Smrg
809e5383a99Smrg# C support is built-in for now
810e5383a99Smrgm4_define([_LT_LANG_C_enabled], [])
811e5383a99Smrgm4_define([_LT_TAGS], [])
812a5602400Smrg
813a5602400Smrg
814e5383a99Smrg# LT_LANG(LANG)
815e5383a99Smrg# -------------
816e5383a99Smrg# Enable libtool support for the given language if not already enabled.
817e5383a99SmrgAC_DEFUN([LT_LANG],
818e5383a99Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
819e5383a99Smrgm4_case([$1],
820e5383a99Smrg  [C],			[_LT_LANG(C)],
821e5383a99Smrg  [C++],		[_LT_LANG(CXX)],
822e5383a99Smrg  [Go],			[_LT_LANG(GO)],
823e5383a99Smrg  [Java],		[_LT_LANG(GCJ)],
824e5383a99Smrg  [Fortran 77],		[_LT_LANG(F77)],
825e5383a99Smrg  [Fortran],		[_LT_LANG(FC)],
826e5383a99Smrg  [Windows Resource],	[_LT_LANG(RC)],
827e5383a99Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
828e5383a99Smrg    [_LT_LANG($1)],
829e5383a99Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
830e5383a99Smrg])# LT_LANG
831b9b4fd27Smrg
832b9b4fd27Smrg
833e5383a99Smrg# _LT_LANG(LANGNAME)
834e5383a99Smrg# ------------------
835e5383a99Smrgm4_defun([_LT_LANG],
836e5383a99Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
837e5383a99Smrg  [LT_SUPPORTED_TAG([$1])dnl
838e5383a99Smrg  m4_append([_LT_TAGS], [$1 ])dnl
839e5383a99Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
840e5383a99Smrg  _LT_LANG_$1_CONFIG($1)])dnl
841e5383a99Smrg])# _LT_LANG
842b9b4fd27Smrg
843b9b4fd27Smrg
844e5383a99Smrgm4_ifndef([AC_PROG_GO], [
845e5383a99Smrg# NOTE: This macro has been submitted for inclusion into   #
846e5383a99Smrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
847e5383a99Smrg#  a released version of Autoconf we should remove this    #
848e5383a99Smrg#  macro and use it instead.                               #
849e5383a99Smrgm4_defun([AC_PROG_GO],
850e5383a99Smrg[AC_LANG_PUSH(Go)dnl
851e5383a99SmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
852e5383a99SmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
853e5383a99Smrg_AC_ARG_VAR_LDFLAGS()dnl
854e5383a99SmrgAC_CHECK_TOOL(GOC, gccgo)
855e5383a99Smrgif test -z "$GOC"; then
856e5383a99Smrg  if test -n "$ac_tool_prefix"; then
857e5383a99Smrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
858e5383a99Smrg  fi
859e5383a99Smrgfi
860e5383a99Smrgif test -z "$GOC"; then
861e5383a99Smrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
862e5383a99Smrgfi
863e5383a99Smrg])#m4_defun
864e5383a99Smrg])#m4_ifndef
865e8a5466aSmrg
866e8a5466aSmrg
867e5383a99Smrg# _LT_LANG_DEFAULT_CONFIG
868e5383a99Smrg# -----------------------
869e5383a99Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
870e5383a99Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
871e5383a99Smrg  [LT_LANG(CXX)],
872e5383a99Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
873e8a5466aSmrg
874e5383a99SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
875e5383a99Smrg  [LT_LANG(F77)],
876e5383a99Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
877b9b4fd27Smrg
878e5383a99SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
879e5383a99Smrg  [LT_LANG(FC)],
880e5383a99Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
881b9b4fd27Smrg
882e5383a99Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
883e5383a99Smrgdnl pulling things in needlessly.
884e5383a99SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
885e5383a99Smrg  [LT_LANG(GCJ)],
886e5383a99Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
887e5383a99Smrg    [LT_LANG(GCJ)],
888e5383a99Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
889e5383a99Smrg      [LT_LANG(GCJ)],
890e5383a99Smrg      [m4_ifdef([AC_PROG_GCJ],
891e5383a99Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
892e5383a99Smrg       m4_ifdef([A][M_PROG_GCJ],
893e5383a99Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
894e5383a99Smrg       m4_ifdef([LT_PROG_GCJ],
895e5383a99Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
896b9b4fd27Smrg
897e5383a99SmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
898e5383a99Smrg  [LT_LANG(GO)],
899e5383a99Smrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
900b9b4fd27Smrg
901e5383a99SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
902e5383a99Smrg  [LT_LANG(RC)],
903e5383a99Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
904e5383a99Smrg])# _LT_LANG_DEFAULT_CONFIG
905b9b4fd27Smrg
906e5383a99Smrg# Obsolete macros:
907e5383a99SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
908e5383a99SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
909e5383a99SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
910e5383a99SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
911e5383a99SmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
912e5383a99Smrgdnl aclocal-1.4 backwards compatibility:
913e5383a99Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
914e5383a99Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
915e5383a99Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
916e5383a99Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
917e5383a99Smrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
918b9b4fd27Smrg
919b9b4fd27Smrg
920e5383a99Smrg# _LT_TAG_COMPILER
921e5383a99Smrg# ----------------
922e5383a99Smrgm4_defun([_LT_TAG_COMPILER],
923e5383a99Smrg[AC_REQUIRE([AC_PROG_CC])dnl
924b9b4fd27Smrg
925e5383a99Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
926e5383a99Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
927e5383a99Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
928e5383a99Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
929a5602400Smrg
930e5383a99Smrg# If no C compiler was specified, use CC.
931e5383a99SmrgLTCC=${LTCC-"$CC"}
932a5602400Smrg
933e5383a99Smrg# If no C compiler flags were specified, use CFLAGS.
934e5383a99SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
935a5602400Smrg
936e5383a99Smrg# Allow CC to be a program name with arguments.
937e5383a99Smrgcompiler=$CC
938e5383a99Smrg])# _LT_TAG_COMPILER
939a5602400Smrg
940a5602400Smrg
941e5383a99Smrg# _LT_COMPILER_BOILERPLATE
942e5383a99Smrg# ------------------------
943e5383a99Smrg# Check for compiler boilerplate output or warnings with
944e5383a99Smrg# the simple compiler test code.
945e5383a99Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
946e5383a99Smrg[m4_require([_LT_DECL_SED])dnl
947e5383a99Smrgac_outfile=conftest.$ac_objext
948e5383a99Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
949e5383a99Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
950e5383a99Smrg_lt_compiler_boilerplate=`cat conftest.err`
951e5383a99Smrg$RM conftest*
952e5383a99Smrg])# _LT_COMPILER_BOILERPLATE
953a5602400Smrg
954a5602400Smrg
955e5383a99Smrg# _LT_LINKER_BOILERPLATE
956e5383a99Smrg# ----------------------
957e5383a99Smrg# Check for linker boilerplate output or warnings with
958e5383a99Smrg# the simple link test code.
959e5383a99Smrgm4_defun([_LT_LINKER_BOILERPLATE],
960e5383a99Smrg[m4_require([_LT_DECL_SED])dnl
961e5383a99Smrgac_outfile=conftest.$ac_objext
962e5383a99Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
963e5383a99Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
964e5383a99Smrg_lt_linker_boilerplate=`cat conftest.err`
965e5383a99Smrg$RM -r conftest*
966e5383a99Smrg])# _LT_LINKER_BOILERPLATE
967a5602400Smrg
968e5383a99Smrg# _LT_REQUIRED_DARWIN_CHECKS
969e5383a99Smrg# -------------------------
970e5383a99Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
971e5383a99Smrg  case $host_os in
972e5383a99Smrg    rhapsody* | darwin*)
973e5383a99Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
974e5383a99Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
975e5383a99Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
976e5383a99Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
977e5383a99Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
978e5383a99Smrg    _LT_DECL([], [DSYMUTIL], [1],
979e5383a99Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
980e5383a99Smrg    _LT_DECL([], [NMEDIT], [1],
981e5383a99Smrg      [Tool to change global to local symbols on Mac OS X])
982e5383a99Smrg    _LT_DECL([], [LIPO], [1],
983e5383a99Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
984e5383a99Smrg    _LT_DECL([], [OTOOL], [1],
985e5383a99Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
986e5383a99Smrg    _LT_DECL([], [OTOOL64], [1],
987e5383a99Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
988a5602400Smrg
989e5383a99Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
990e5383a99Smrg      [lt_cv_apple_cc_single_mod=no
991e5383a99Smrg      if test -z "${LT_MULTI_MODULE}"; then
992e5383a99Smrg	# By default we will add the -single_module flag. You can override
993e5383a99Smrg	# by either setting the environment variable LT_MULTI_MODULE
994e5383a99Smrg	# non-empty at configure time, or by adding -multi_module to the
995e5383a99Smrg	# link flags.
996e5383a99Smrg	rm -rf libconftest.dylib*
997e5383a99Smrg	echo "int foo(void){return 1;}" > conftest.c
998e5383a99Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
999e5383a99Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
1000e5383a99Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1001e5383a99Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
1002e5383a99Smrg        _lt_result=$?
1003e5383a99Smrg	# If there is a non-empty error log, and "single_module"
1004e5383a99Smrg	# appears in it, assume the flag caused a linker warning
1005e5383a99Smrg        if test -s conftest.err && $GREP single_module conftest.err; then
1006e5383a99Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
1007e5383a99Smrg	# Otherwise, if the output was created with a 0 exit code from
1008e5383a99Smrg	# the compiler, it worked.
1009e5383a99Smrg	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
1010e5383a99Smrg	  lt_cv_apple_cc_single_mod=yes
1011e5383a99Smrg	else
1012e5383a99Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
1013e5383a99Smrg	fi
1014e5383a99Smrg	rm -rf libconftest.dylib*
1015e5383a99Smrg	rm -f conftest.*
1016e5383a99Smrg      fi])
1017caade7ccSmrg
1018e5383a99Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
1019e5383a99Smrg      [lt_cv_ld_exported_symbols_list],
1020e5383a99Smrg      [lt_cv_ld_exported_symbols_list=no
1021e5383a99Smrg      save_LDFLAGS=$LDFLAGS
1022e5383a99Smrg      echo "_main" > conftest.sym
1023e5383a99Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
1024e5383a99Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
1025e5383a99Smrg	[lt_cv_ld_exported_symbols_list=yes],
1026e5383a99Smrg	[lt_cv_ld_exported_symbols_list=no])
1027e5383a99Smrg	LDFLAGS="$save_LDFLAGS"
1028e5383a99Smrg    ])
1029caade7ccSmrg
1030e5383a99Smrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
1031e5383a99Smrg      [lt_cv_ld_force_load=no
1032e5383a99Smrg      cat > conftest.c << _LT_EOF
1033e5383a99Smrgint forced_loaded() { return 2;}
1034e5383a99Smrg_LT_EOF
1035e5383a99Smrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
1036e5383a99Smrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
1037e5383a99Smrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
1038e5383a99Smrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
1039e5383a99Smrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
1040e5383a99Smrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
1041e5383a99Smrg      cat > conftest.c << _LT_EOF
1042e5383a99Smrgint main() { return 0;}
1043e5383a99Smrg_LT_EOF
1044e5383a99Smrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
1045e5383a99Smrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
1046e5383a99Smrg      _lt_result=$?
1047e5383a99Smrg      if test -s conftest.err && $GREP force_load conftest.err; then
1048e5383a99Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
1049e5383a99Smrg      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
1050e5383a99Smrg	lt_cv_ld_force_load=yes
1051e5383a99Smrg      else
1052e5383a99Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
1053e5383a99Smrg      fi
1054e5383a99Smrg        rm -f conftest.err libconftest.a conftest conftest.c
1055e5383a99Smrg        rm -rf conftest.dSYM
1056e5383a99Smrg    ])
1057e5383a99Smrg    case $host_os in
1058e5383a99Smrg    rhapsody* | darwin1.[[012]])
1059e5383a99Smrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
1060e5383a99Smrg    darwin1.*)
1061e5383a99Smrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
1062e5383a99Smrg    darwin*) # darwin 5.x on
1063e5383a99Smrg      # if running on 10.5 or later, the deployment target defaults
1064e5383a99Smrg      # to the OS version, if on x86, and 10.4, the deployment
1065e5383a99Smrg      # target defaults to 10.4. Don't you love it?
1066e5383a99Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
1067e5383a99Smrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
1068e5383a99Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
1069e5383a99Smrg	10.[[012]]*)
1070e5383a99Smrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
1071e5383a99Smrg	10.*)
1072e5383a99Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
1073e5383a99Smrg      esac
1074e5383a99Smrg    ;;
1075e5383a99Smrg  esac
1076e5383a99Smrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
1077e5383a99Smrg      _lt_dar_single_mod='$single_module'
1078e5383a99Smrg    fi
1079e5383a99Smrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
1080e5383a99Smrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
1081e5383a99Smrg    else
1082e5383a99Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
1083e5383a99Smrg    fi
1084e5383a99Smrg    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
1085e5383a99Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
1086e5383a99Smrg    else
1087e5383a99Smrg      _lt_dsymutil=
1088e5383a99Smrg    fi
1089e5383a99Smrg    ;;
1090e5383a99Smrg  esac
1091af9a7ee5Smrg])
1092caade7ccSmrg
1093caade7ccSmrg
1094e5383a99Smrg# _LT_DARWIN_LINKER_FEATURES([TAG])
1095e5383a99Smrg# ---------------------------------
1096e5383a99Smrg# Checks for linker and compiler features on darwin
1097e5383a99Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
1098e5383a99Smrg[
1099e5383a99Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1100e5383a99Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1101e5383a99Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
1102e5383a99Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
1103e5383a99Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1104e5383a99Smrg  if test "$lt_cv_ld_force_load" = "yes"; then
1105e5383a99Smrg    _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\"`'
1106e5383a99Smrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
1107e5383a99Smrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
1108e5383a99Smrg  else
1109e5383a99Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1110e5383a99Smrg  fi
1111e5383a99Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
1112e5383a99Smrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
1113e5383a99Smrg  case $cc_basename in
1114e5383a99Smrg     ifort*) _lt_dar_can_shared=yes ;;
1115e5383a99Smrg     *) _lt_dar_can_shared=$GCC ;;
1116e5383a99Smrg  esac
1117e5383a99Smrg  if test "$_lt_dar_can_shared" = "yes"; then
1118e5383a99Smrg    output_verbose_link_cmd=func_echo_all
1119e5383a99Smrg    _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}"
1120e5383a99Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
1121e5383a99Smrg    _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}"
1122e5383a99Smrg    _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}"
1123e5383a99Smrg    m4_if([$1], [CXX],
1124e5383a99Smrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
1125e5383a99Smrg      _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}"
1126e5383a99Smrg      _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}"
1127e5383a99Smrg    fi
1128e5383a99Smrg],[])
1129e5383a99Smrg  else
1130e5383a99Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
1131e5383a99Smrg  fi
1132e5383a99Smrg])
1133e8a5466aSmrg
1134e5383a99Smrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
1135e5383a99Smrg# ----------------------------------
1136e5383a99Smrg# Links a minimal program and checks the executable
1137e5383a99Smrg# for the system default hardcoded library path. In most cases,
1138e5383a99Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
1139e5383a99Smrg# the location of the communication and MPI libs are included too.
1140e5383a99Smrg# If we don't find anything, use the default library path according
1141e5383a99Smrg# to the aix ld manual.
1142e5383a99Smrg# Store the results from the different compilers for each TAGNAME.
1143e5383a99Smrg# Allow to override them for all tags through lt_cv_aix_libpath.
1144e5383a99Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
1145e5383a99Smrg[m4_require([_LT_DECL_SED])dnl
1146e5383a99Smrgif test "${lt_cv_aix_libpath+set}" = set; then
1147e5383a99Smrg  aix_libpath=$lt_cv_aix_libpath
1148e5383a99Smrgelse
1149e5383a99Smrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
1150e5383a99Smrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
1151e5383a99Smrg  lt_aix_libpath_sed='[
1152e5383a99Smrg      /Import File Strings/,/^$/ {
1153e5383a99Smrg	  /^0/ {
1154e5383a99Smrg	      s/^0  *\([^ ]*\) *$/\1/
1155e5383a99Smrg	      p
1156e5383a99Smrg	  }
1157e5383a99Smrg      }]'
1158e5383a99Smrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1159e5383a99Smrg  # Check for a 64-bit object if we didn't find anything.
1160e5383a99Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1161e5383a99Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1162e5383a99Smrg  fi],[])
1163e5383a99Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1164e5383a99Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
1165e5383a99Smrg  fi
1166e5383a99Smrg  ])
1167e5383a99Smrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
1168e5383a99Smrgfi
1169e5383a99Smrg])# _LT_SYS_MODULE_PATH_AIX
1170caade7ccSmrg
1171caade7ccSmrg
1172e5383a99Smrg# _LT_SHELL_INIT(ARG)
1173e5383a99Smrg# -------------------
1174e5383a99Smrgm4_define([_LT_SHELL_INIT],
1175e5383a99Smrg[m4_divert_text([M4SH-INIT], [$1
1176e5383a99Smrg])])# _LT_SHELL_INIT
1177caade7ccSmrg
1178caade7ccSmrg
1179e8a5466aSmrg
1180e5383a99Smrg# _LT_PROG_ECHO_BACKSLASH
1181af9a7ee5Smrg# -----------------------
1182e5383a99Smrg# Find how we can fake an echo command that does not interpret backslash.
1183e5383a99Smrg# In particular, with Autoconf 2.60 or later we add some code to the start
1184e5383a99Smrg# of the generated configure script which will find a shell with a builtin
1185e5383a99Smrg# printf (which we can use as an echo command).
1186e5383a99Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
1187e5383a99Smrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1188e5383a99SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1189e5383a99SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1190caade7ccSmrg
1191e5383a99SmrgAC_MSG_CHECKING([how to print strings])
1192e5383a99Smrg# Test print first, because it will be a builtin if present.
1193e5383a99Smrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
1194e5383a99Smrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
1195e5383a99Smrg  ECHO='print -r --'
1196e5383a99Smrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
1197e5383a99Smrg  ECHO='printf %s\n'
1198e5383a99Smrgelse
1199e5383a99Smrg  # Use this function as a fallback that always works.
1200e5383a99Smrg  func_fallback_echo ()
1201e5383a99Smrg  {
1202e5383a99Smrg    eval 'cat <<_LTECHO_EOF
1203e5383a99Smrg$[]1
1204e5383a99Smrg_LTECHO_EOF'
1205e5383a99Smrg  }
1206e5383a99Smrg  ECHO='func_fallback_echo'
1207e5383a99Smrgfi
1208caade7ccSmrg
1209e5383a99Smrg# func_echo_all arg...
1210e5383a99Smrg# Invoke $ECHO with all args, space-separated.
1211e5383a99Smrgfunc_echo_all ()
1212e5383a99Smrg{
1213e5383a99Smrg    $ECHO "$*" 
1214e5383a99Smrg}
1215af9a7ee5Smrg
1216e5383a99Smrgcase "$ECHO" in
1217e5383a99Smrg  printf*) AC_MSG_RESULT([printf]) ;;
1218e5383a99Smrg  print*) AC_MSG_RESULT([print -r]) ;;
1219e5383a99Smrg  *) AC_MSG_RESULT([cat]) ;;
1220e5383a99Smrgesac
1221af9a7ee5Smrg
1222e5383a99Smrgm4_ifdef([_AS_DETECT_SUGGESTED],
1223e5383a99Smrg[_AS_DETECT_SUGGESTED([
1224e5383a99Smrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
1225e5383a99Smrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1226e5383a99Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1227e5383a99Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1228e5383a99Smrg    PATH=/empty FPATH=/empty; export PATH FPATH
1229e5383a99Smrg    test "X`printf %s $ECHO`" = "X$ECHO" \
1230e5383a99Smrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
1231af9a7ee5Smrg
1232e5383a99Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1233e5383a99Smrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
1234e5383a99Smrg])# _LT_PROG_ECHO_BACKSLASH
1235a5602400Smrg
1236485f0483Smrg
1237e5383a99Smrg# _LT_WITH_SYSROOT
1238e5383a99Smrg# ----------------
1239e5383a99SmrgAC_DEFUN([_LT_WITH_SYSROOT],
1240e5383a99Smrg[AC_MSG_CHECKING([for sysroot])
1241e5383a99SmrgAC_ARG_WITH([sysroot],
1242e5383a99Smrg[  --with-sysroot[=DIR] Search for dependent libraries within DIR
1243e5383a99Smrg                        (or the compiler's sysroot if not specified).],
1244e5383a99Smrg[], [with_sysroot=no])
1245485f0483Smrg
1246e5383a99Smrgdnl lt_sysroot will always be passed unquoted.  We quote it here
1247e5383a99Smrgdnl in case the user passed a directory name.
1248e5383a99Smrglt_sysroot=
1249e5383a99Smrgcase ${with_sysroot} in #(
1250e5383a99Smrg yes)
1251e5383a99Smrg   if test "$GCC" = yes; then
1252e5383a99Smrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
1253e5383a99Smrg   fi
1254e5383a99Smrg   ;; #(
1255e5383a99Smrg /*)
1256e5383a99Smrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
1257e5383a99Smrg   ;; #(
1258e5383a99Smrg no|'')
1259e5383a99Smrg   ;; #(
1260e5383a99Smrg *)
1261e5383a99Smrg   AC_MSG_RESULT([${with_sysroot}])
1262e5383a99Smrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
1263e5383a99Smrg   ;;
1264e5383a99Smrgesac
1265485f0483Smrg
1266e5383a99Smrg AC_MSG_RESULT([${lt_sysroot:-no}])
1267e5383a99Smrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
1268e5383a99Smrg[dependent libraries, and in which our libraries should be installed.])])
1269b9b4fd27Smrg
1270e5383a99Smrg# _LT_ENABLE_LOCK
1271e5383a99Smrg# ---------------
1272e5383a99Smrgm4_defun([_LT_ENABLE_LOCK],
1273e5383a99Smrg[AC_ARG_ENABLE([libtool-lock],
1274e5383a99Smrg  [AS_HELP_STRING([--disable-libtool-lock],
1275e5383a99Smrg    [avoid locking (might break parallel builds)])])
1276e5383a99Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1277caade7ccSmrg
1278e5383a99Smrg# Some flags need to be propagated to the compiler or linker for good
1279e5383a99Smrg# libtool support.
1280e5383a99Smrgcase $host in
1281e5383a99Smrgia64-*-hpux*)
1282e5383a99Smrg  # Find out which ABI we are using.
1283e5383a99Smrg  echo 'int i;' > conftest.$ac_ext
1284e5383a99Smrg  if AC_TRY_EVAL(ac_compile); then
1285e5383a99Smrg    case `/usr/bin/file conftest.$ac_objext` in
1286e5383a99Smrg      *ELF-32*)
1287e5383a99Smrg	HPUX_IA64_MODE="32"
1288e5383a99Smrg	;;
1289e5383a99Smrg      *ELF-64*)
1290e5383a99Smrg	HPUX_IA64_MODE="64"
1291e5383a99Smrg	;;
1292af9a7ee5Smrg    esac
1293e5383a99Smrg  fi
1294e5383a99Smrg  rm -rf conftest*
1295e5383a99Smrg  ;;
1296e5383a99Smrg*-*-irix6*)
1297e5383a99Smrg  # Find out which ABI we are using.
1298e5383a99Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1299e5383a99Smrg  if AC_TRY_EVAL(ac_compile); then
1300e5383a99Smrg    if test "$lt_cv_prog_gnu_ld" = yes; then
1301e5383a99Smrg      case `/usr/bin/file conftest.$ac_objext` in
1302e5383a99Smrg	*32-bit*)
1303e5383a99Smrg	  LD="${LD-ld} -melf32bsmip"
1304e5383a99Smrg	  ;;
1305e5383a99Smrg	*N32*)
1306e5383a99Smrg	  LD="${LD-ld} -melf32bmipn32"
1307e5383a99Smrg	  ;;
1308e5383a99Smrg	*64-bit*)
1309e5383a99Smrg	  LD="${LD-ld} -melf64bmip"
1310e5383a99Smrg	;;
1311e5383a99Smrg      esac
1312e5383a99Smrg    else
1313e5383a99Smrg      case `/usr/bin/file conftest.$ac_objext` in
1314e5383a99Smrg	*32-bit*)
1315e5383a99Smrg	  LD="${LD-ld} -32"
1316e5383a99Smrg	  ;;
1317e5383a99Smrg	*N32*)
1318e5383a99Smrg	  LD="${LD-ld} -n32"
1319e5383a99Smrg	  ;;
1320e5383a99Smrg	*64-bit*)
1321e5383a99Smrg	  LD="${LD-ld} -64"
1322e5383a99Smrg	  ;;
1323e5383a99Smrg      esac
1324e5383a99Smrg    fi
1325e5383a99Smrg  fi
1326e5383a99Smrg  rm -rf conftest*
1327e5383a99Smrg  ;;
1328485f0483Smrg
1329e5383a99Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
1330e5383a99Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1331e5383a99Smrg  # Find out which ABI we are using.
1332e5383a99Smrg  echo 'int i;' > conftest.$ac_ext
1333e5383a99Smrg  if AC_TRY_EVAL(ac_compile); then
1334e5383a99Smrg    case `/usr/bin/file conftest.o` in
1335e5383a99Smrg      *32-bit*)
1336e5383a99Smrg	case $host in
1337e5383a99Smrg	  x86_64-*kfreebsd*-gnu)
1338e5383a99Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
1339e5383a99Smrg	    ;;
1340e5383a99Smrg	  x86_64-*linux*)
1341e5383a99Smrg	    LD="${LD-ld} -m elf_i386"
1342e5383a99Smrg	    ;;
1343e5383a99Smrg	  powerpc64le-*linux*)
1344e5383a99Smrg	    LD="${LD-ld} -m elf32lppclinux"
1345e5383a99Smrg	    ;;
1346e5383a99Smrg	  powerpc64-*linux*)
1347e5383a99Smrg	    LD="${LD-ld} -m elf32ppclinux"
1348e5383a99Smrg	    ;;
1349e5383a99Smrg	  s390x-*linux*)
1350e5383a99Smrg	    LD="${LD-ld} -m elf_s390"
1351e5383a99Smrg	    ;;
1352e5383a99Smrg	  sparc64-*linux*)
1353e5383a99Smrg	    LD="${LD-ld} -m elf32_sparc"
1354e5383a99Smrg	    ;;
1355e5383a99Smrg	esac
1356e5383a99Smrg	;;
1357e5383a99Smrg      *64-bit*)
1358e5383a99Smrg	case $host in
1359e5383a99Smrg	  x86_64-*kfreebsd*-gnu)
1360e5383a99Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
1361e5383a99Smrg	    ;;
1362e5383a99Smrg	  x86_64-*linux*)
1363e5383a99Smrg	    LD="${LD-ld} -m elf_x86_64"
1364e5383a99Smrg	    ;;
1365e5383a99Smrg	  powerpcle-*linux*)
1366e5383a99Smrg	    LD="${LD-ld} -m elf64lppc"
1367e5383a99Smrg	    ;;
1368e5383a99Smrg	  powerpc-*linux*)
1369e5383a99Smrg	    LD="${LD-ld} -m elf64ppc"
1370e5383a99Smrg	    ;;
1371e5383a99Smrg	  s390*-*linux*|s390*-*tpf*)
1372e5383a99Smrg	    LD="${LD-ld} -m elf64_s390"
1373e5383a99Smrg	    ;;
1374e5383a99Smrg	  sparc*-*linux*)
1375e5383a99Smrg	    LD="${LD-ld} -m elf64_sparc"
1376e5383a99Smrg	    ;;
1377e5383a99Smrg	esac
1378e5383a99Smrg	;;
1379af9a7ee5Smrg    esac
1380e5383a99Smrg  fi
1381e5383a99Smrg  rm -rf conftest*
1382e5383a99Smrg  ;;
1383caade7ccSmrg
1384e5383a99Smrg*-*-sco3.2v5*)
1385e5383a99Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1386e5383a99Smrg  SAVE_CFLAGS="$CFLAGS"
1387e5383a99Smrg  CFLAGS="$CFLAGS -belf"
1388e5383a99Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1389e5383a99Smrg    [AC_LANG_PUSH(C)
1390e5383a99Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1391e5383a99Smrg     AC_LANG_POP])
1392e5383a99Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1393e5383a99Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1394e5383a99Smrg    CFLAGS="$SAVE_CFLAGS"
1395e5383a99Smrg  fi
1396e5383a99Smrg  ;;
1397e5383a99Smrg*-*solaris*)
1398e5383a99Smrg  # Find out which ABI we are using.
1399e5383a99Smrg  echo 'int i;' > conftest.$ac_ext
1400e5383a99Smrg  if AC_TRY_EVAL(ac_compile); then
1401e5383a99Smrg    case `/usr/bin/file conftest.o` in
1402e5383a99Smrg    *64-bit*)
1403e5383a99Smrg      case $lt_cv_prog_gnu_ld in
1404e5383a99Smrg      yes*)
1405e5383a99Smrg        case $host in
1406e5383a99Smrg        i?86-*-solaris*)
1407e5383a99Smrg          LD="${LD-ld} -m elf_x86_64"
1408e5383a99Smrg          ;;
1409e5383a99Smrg        sparc*-*-solaris*)
1410e5383a99Smrg          LD="${LD-ld} -m elf64_sparc"
1411e5383a99Smrg          ;;
1412e5383a99Smrg        esac
1413e5383a99Smrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
1414e5383a99Smrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
1415e5383a99Smrg          LD="${LD-ld}_sol2"
1416e5383a99Smrg        fi
1417e5383a99Smrg        ;;
1418e5383a99Smrg      *)
1419e5383a99Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1420e5383a99Smrg	  LD="${LD-ld} -64"
1421e5383a99Smrg	fi
1422e5383a99Smrg	;;
1423e5383a99Smrg      esac
1424e5383a99Smrg      ;;
1425e5383a99Smrg    esac
1426e5383a99Smrg  fi
1427e5383a99Smrg  rm -rf conftest*
1428e5383a99Smrg  ;;
1429e5383a99Smrgesac
1430caade7ccSmrg
1431e5383a99Smrgneed_locks="$enable_libtool_lock"
1432e5383a99Smrg])# _LT_ENABLE_LOCK
1433caade7ccSmrg
1434caade7ccSmrg
1435e5383a99Smrg# _LT_PROG_AR
1436e5383a99Smrg# -----------
1437e5383a99Smrgm4_defun([_LT_PROG_AR],
1438e5383a99Smrg[AC_CHECK_TOOLS(AR, [ar], false)
1439e5383a99Smrg: ${AR=ar}
1440e5383a99Smrg: ${AR_FLAGS=cru}
1441e5383a99Smrg_LT_DECL([], [AR], [1], [The archiver])
1442e5383a99Smrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
1443caade7ccSmrg
1444e5383a99SmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
1445e5383a99Smrg  [lt_cv_ar_at_file=no
1446e5383a99Smrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
1447e5383a99Smrg     [echo conftest.$ac_objext > conftest.lst
1448e5383a99Smrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
1449e5383a99Smrg      AC_TRY_EVAL([lt_ar_try])
1450e5383a99Smrg      if test "$ac_status" -eq 0; then
1451e5383a99Smrg	# Ensure the archiver fails upon bogus file names.
1452e5383a99Smrg	rm -f conftest.$ac_objext libconftest.a
1453e5383a99Smrg	AC_TRY_EVAL([lt_ar_try])
1454e5383a99Smrg	if test "$ac_status" -ne 0; then
1455e5383a99Smrg          lt_cv_ar_at_file=@
1456e5383a99Smrg        fi
1457e5383a99Smrg      fi
1458e5383a99Smrg      rm -f conftest.* libconftest.a
1459e5383a99Smrg     ])
1460e5383a99Smrg  ])
1461caade7ccSmrg
1462e5383a99Smrgif test "x$lt_cv_ar_at_file" = xno; then
1463e5383a99Smrg  archiver_list_spec=
1464e5383a99Smrgelse
1465e5383a99Smrg  archiver_list_spec=$lt_cv_ar_at_file
1466e5383a99Smrgfi
1467e5383a99Smrg_LT_DECL([], [archiver_list_spec], [1],
1468e5383a99Smrg  [How to feed a file listing to the archiver])
1469e5383a99Smrg])# _LT_PROG_AR
1470caade7ccSmrg
1471caade7ccSmrg
1472e5383a99Smrg# _LT_CMD_OLD_ARCHIVE
1473e5383a99Smrg# -------------------
1474e5383a99Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
1475e5383a99Smrg[_LT_PROG_AR
1476caade7ccSmrg
1477e5383a99SmrgAC_CHECK_TOOL(STRIP, strip, :)
1478e5383a99Smrgtest -z "$STRIP" && STRIP=:
1479e5383a99Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1480caade7ccSmrg
1481e5383a99SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
1482e5383a99Smrgtest -z "$RANLIB" && RANLIB=:
1483e5383a99Smrg_LT_DECL([], [RANLIB], [1],
1484e5383a99Smrg    [Commands used to install an old-style archive])
1485caade7ccSmrg
1486e5383a99Smrg# Determine commands to create old-style static archives.
1487e5383a99Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1488e5383a99Smrgold_postinstall_cmds='chmod 644 $oldlib'
1489e5383a99Smrgold_postuninstall_cmds=
1490caade7ccSmrg
1491e5383a99Smrgif test -n "$RANLIB"; then
1492e5383a99Smrg  case $host_os in
1493e5383a99Smrg  openbsd*)
1494e5383a99Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
1495e5383a99Smrg    ;;
1496e5383a99Smrg  *)
1497e5383a99Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
1498e5383a99Smrg    ;;
1499af9a7ee5Smrg  esac
1500e5383a99Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
1501af9a7ee5Smrgfi
1502b9b4fd27Smrg
1503e5383a99Smrgcase $host_os in
1504e5383a99Smrg  darwin*)
1505e5383a99Smrg    lock_old_archive_extraction=yes ;;
1506e5383a99Smrg  *)
1507e5383a99Smrg    lock_old_archive_extraction=no ;;
1508e5383a99Smrgesac
1509e5383a99Smrg_LT_DECL([], [old_postinstall_cmds], [2])
1510e5383a99Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
1511e5383a99Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
1512e5383a99Smrg    [Commands used to build an old-style archive])
1513e5383a99Smrg_LT_DECL([], [lock_old_archive_extraction], [0],
1514e5383a99Smrg    [Whether to use a lock for old archive extraction])
1515e5383a99Smrg])# _LT_CMD_OLD_ARCHIVE
1516b9b4fd27Smrg
1517b9b4fd27Smrg
1518e5383a99Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1519e5383a99Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1520e5383a99Smrg# ----------------------------------------------------------------
1521e5383a99Smrg# Check whether the given compiler option works
1522e5383a99SmrgAC_DEFUN([_LT_COMPILER_OPTION],
1523af9a7ee5Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1524e5383a99Smrgm4_require([_LT_DECL_SED])dnl
1525e5383a99SmrgAC_CACHE_CHECK([$1], [$2],
1526e5383a99Smrg  [$2=no
1527e5383a99Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1528e5383a99Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1529e5383a99Smrg   lt_compiler_flag="$3"
1530e5383a99Smrg   # Insert the option either (1) after the last *FLAGS variable, or
1531e5383a99Smrg   # (2) before a word containing "conftest.", or (3) at the end.
1532e5383a99Smrg   # Note that $ac_compile itself does not contain backslashes and begins
1533e5383a99Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
1534e5383a99Smrg   # The option is referenced via a variable to avoid confusing sed.
1535e5383a99Smrg   lt_compile=`echo "$ac_compile" | $SED \
1536e5383a99Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1537e5383a99Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1538e5383a99Smrg   -e 's:$: $lt_compiler_flag:'`
1539e5383a99Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1540e5383a99Smrg   (eval "$lt_compile" 2>conftest.err)
1541e5383a99Smrg   ac_status=$?
1542e5383a99Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
1543e5383a99Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1544e5383a99Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
1545e5383a99Smrg     # The compiler can only warn and ignore the option if not recognized
1546e5383a99Smrg     # So say no if there are warnings other than the usual output.
1547e5383a99Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
1548e5383a99Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1549e5383a99Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1550e5383a99Smrg       $2=yes
1551e5383a99Smrg     fi
1552e5383a99Smrg   fi
1553e5383a99Smrg   $RM conftest*
1554e5383a99Smrg])
1555b9b4fd27Smrg
1556e5383a99Smrgif test x"[$]$2" = xyes; then
1557e5383a99Smrg    m4_if([$5], , :, [$5])
1558e5383a99Smrgelse
1559e5383a99Smrg    m4_if([$6], , :, [$6])
1560af9a7ee5Smrgfi
1561e5383a99Smrg])# _LT_COMPILER_OPTION
1562b9b4fd27Smrg
1563e5383a99Smrg# Old name:
1564e5383a99SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1565e5383a99Smrgdnl aclocal-1.4 backwards compatibility:
1566e5383a99Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1567b9b4fd27Smrg
1568e8a5466aSmrg
1569e5383a99Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1570e5383a99Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
1571e5383a99Smrg# ----------------------------------------------------
1572e5383a99Smrg# Check whether the given linker option works
1573e5383a99SmrgAC_DEFUN([_LT_LINKER_OPTION],
1574e5383a99Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1575e5383a99Smrgm4_require([_LT_DECL_SED])dnl
1576e5383a99SmrgAC_CACHE_CHECK([$1], [$2],
1577e5383a99Smrg  [$2=no
1578e5383a99Smrg   save_LDFLAGS="$LDFLAGS"
1579e5383a99Smrg   LDFLAGS="$LDFLAGS $3"
1580e5383a99Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
1581e5383a99Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1582e5383a99Smrg     # The linker can only warn and ignore the option if not recognized
1583e5383a99Smrg     # So say no if there are warnings
1584e5383a99Smrg     if test -s conftest.err; then
1585e5383a99Smrg       # Append any errors to the config.log.
1586e5383a99Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
1587e5383a99Smrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
1588e5383a99Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1589e5383a99Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
1590e5383a99Smrg         $2=yes
1591e5383a99Smrg       fi
1592e5383a99Smrg     else
1593e5383a99Smrg       $2=yes
1594e5383a99Smrg     fi
1595e5383a99Smrg   fi
1596e5383a99Smrg   $RM -r conftest*
1597e5383a99Smrg   LDFLAGS="$save_LDFLAGS"
1598e5383a99Smrg])
1599b9b4fd27Smrg
1600e5383a99Smrgif test x"[$]$2" = xyes; then
1601e5383a99Smrg    m4_if([$4], , :, [$4])
1602e5383a99Smrgelse
1603e5383a99Smrg    m4_if([$5], , :, [$5])
1604e5383a99Smrgfi
1605e5383a99Smrg])# _LT_LINKER_OPTION
1606b9b4fd27Smrg
1607e5383a99Smrg# Old name:
1608e5383a99SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1609e5383a99Smrgdnl aclocal-1.4 backwards compatibility:
1610e5383a99Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1611b9b4fd27Smrg
1612b9b4fd27Smrg
1613e5383a99Smrg# LT_CMD_MAX_LEN
1614e5383a99Smrg#---------------
1615e5383a99SmrgAC_DEFUN([LT_CMD_MAX_LEN],
1616e5383a99Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1617e5383a99Smrg# find the maximum length of command line arguments
1618e5383a99SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
1619e5383a99SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1620e5383a99Smrg  i=0
1621e5383a99Smrg  teststring="ABCD"
1622b9b4fd27Smrg
1623e5383a99Smrg  case $build_os in
1624e5383a99Smrg  msdosdjgpp*)
1625e5383a99Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
1626e5383a99Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
1627e5383a99Smrg    # during glob expansion).  Even if it were fixed, the result of this
1628e5383a99Smrg    # check would be larger than it should be.
1629e5383a99Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
1630e5383a99Smrg    ;;
1631b9b4fd27Smrg
1632e5383a99Smrg  gnu*)
1633e5383a99Smrg    # Under GNU Hurd, this test is not required because there is
1634e5383a99Smrg    # no limit to the length of command line arguments.
1635e5383a99Smrg    # Libtool will interpret -1 as no limit whatsoever
1636e5383a99Smrg    lt_cv_sys_max_cmd_len=-1;
1637e5383a99Smrg    ;;
1638b9b4fd27Smrg
1639e5383a99Smrg  cygwin* | mingw* | cegcc*)
1640e5383a99Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
1641e5383a99Smrg    # about 5 minutes as the teststring grows exponentially.
1642e5383a99Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
1643e5383a99Smrg    # you end up with a "frozen" computer, even though with patience
1644e5383a99Smrg    # the test eventually succeeds (with a max line length of 256k).
1645e5383a99Smrg    # Instead, let's just punt: use the minimum linelength reported by
1646e5383a99Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
1647e5383a99Smrg    lt_cv_sys_max_cmd_len=8192;
1648e5383a99Smrg    ;;
1649b9b4fd27Smrg
1650e5383a99Smrg  mint*)
1651e5383a99Smrg    # On MiNT this can take a long time and run out of memory.
1652e5383a99Smrg    lt_cv_sys_max_cmd_len=8192;
1653e5383a99Smrg    ;;
1654b9b4fd27Smrg
1655e5383a99Smrg  amigaos*)
1656e5383a99Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
1657e5383a99Smrg    # So we just punt and use a minimum line length of 8192.
1658e5383a99Smrg    lt_cv_sys_max_cmd_len=8192;
1659e5383a99Smrg    ;;
1660e8a5466aSmrg
1661e5383a99Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
1662e5383a99Smrg    # This has been around since 386BSD, at least.  Likely further.
1663e5383a99Smrg    if test -x /sbin/sysctl; then
1664e5383a99Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1665e5383a99Smrg    elif test -x /usr/sbin/sysctl; then
1666e5383a99Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1667e5383a99Smrg    else
1668e5383a99Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
1669e5383a99Smrg    fi
1670e5383a99Smrg    # And add a safety zone
1671e5383a99Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1672e5383a99Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1673e5383a99Smrg    ;;
1674b9b4fd27Smrg
1675e5383a99Smrg  interix*)
1676e5383a99Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
1677e5383a99Smrg    lt_cv_sys_max_cmd_len=196608
1678e5383a99Smrg    ;;
1679b9b4fd27Smrg
1680e5383a99Smrg  os2*)
1681e5383a99Smrg    # The test takes a long time on OS/2.
1682e5383a99Smrg    lt_cv_sys_max_cmd_len=8192
1683e5383a99Smrg    ;;
1684caade7ccSmrg
1685e5383a99Smrg  osf*)
1686e5383a99Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1687e5383a99Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1688e5383a99Smrg    # nice to cause kernel panics so lets avoid the loop below.
1689e5383a99Smrg    # First set a reasonable default.
1690e5383a99Smrg    lt_cv_sys_max_cmd_len=16384
1691e5383a99Smrg    #
1692e5383a99Smrg    if test -x /sbin/sysconfig; then
1693e5383a99Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1694e5383a99Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
1695e5383a99Smrg      esac
1696e5383a99Smrg    fi
1697e5383a99Smrg    ;;
1698e5383a99Smrg  sco3.2v5*)
1699e5383a99Smrg    lt_cv_sys_max_cmd_len=102400
1700e5383a99Smrg    ;;
1701e5383a99Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
1702e5383a99Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1703e5383a99Smrg    if test -n "$kargmax"; then
1704e5383a99Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
1705e5383a99Smrg    else
1706e5383a99Smrg      lt_cv_sys_max_cmd_len=32768
1707e5383a99Smrg    fi
1708e5383a99Smrg    ;;
1709e5383a99Smrg  *)
1710e5383a99Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1711e5383a99Smrg    if test -n "$lt_cv_sys_max_cmd_len"; then
1712e5383a99Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1713e5383a99Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1714e5383a99Smrg    else
1715e5383a99Smrg      # Make teststring a little bigger before we do anything with it.
1716e5383a99Smrg      # a 1K string should be a reasonable start.
1717e5383a99Smrg      for i in 1 2 3 4 5 6 7 8 ; do
1718e5383a99Smrg        teststring=$teststring$teststring
1719e5383a99Smrg      done
1720e5383a99Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1721e5383a99Smrg      # If test is not a shell built-in, we'll probably end up computing a
1722e5383a99Smrg      # maximum length that is only half of the actual maximum length, but
1723e5383a99Smrg      # we can't tell.
1724e5383a99Smrg      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
1725e5383a99Smrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
1726e5383a99Smrg	      test $i != 17 # 1/2 MB should be enough
1727e5383a99Smrg      do
1728e5383a99Smrg        i=`expr $i + 1`
1729e5383a99Smrg        teststring=$teststring$teststring
1730e5383a99Smrg      done
1731e5383a99Smrg      # Only check the string length outside the loop.
1732e5383a99Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1733e5383a99Smrg      teststring=
1734e5383a99Smrg      # Add a significant safety factor because C++ compilers can tack on
1735e5383a99Smrg      # massive amounts of additional arguments before passing them to the
1736e5383a99Smrg      # linker.  It appears as though 1/2 is a usable value.
1737e5383a99Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1738e5383a99Smrg    fi
1739e5383a99Smrg    ;;
1740e5383a99Smrg  esac
1741e5383a99Smrg])
1742e5383a99Smrgif test -n $lt_cv_sys_max_cmd_len ; then
1743e5383a99Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1744e5383a99Smrgelse
1745e5383a99Smrg  AC_MSG_RESULT(none)
1746e5383a99Smrgfi
1747e5383a99Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
1748e5383a99Smrg_LT_DECL([], [max_cmd_len], [0],
1749e5383a99Smrg    [What is the maximum length of a command?])
1750e5383a99Smrg])# LT_CMD_MAX_LEN
1751caade7ccSmrg
1752e5383a99Smrg# Old name:
1753e5383a99SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1754e5383a99Smrgdnl aclocal-1.4 backwards compatibility:
1755e5383a99Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1756caade7ccSmrg
1757caade7ccSmrg
1758e5383a99Smrg# _LT_HEADER_DLFCN
1759e5383a99Smrg# ----------------
1760e5383a99Smrgm4_defun([_LT_HEADER_DLFCN],
1761e5383a99Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1762e5383a99Smrg])# _LT_HEADER_DLFCN
1763caade7ccSmrg
1764485f0483Smrg
1765e5383a99Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1766e5383a99Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1767e5383a99Smrg# ----------------------------------------------------------------
1768e5383a99Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
1769e5383a99Smrg[m4_require([_LT_HEADER_DLFCN])dnl
1770e5383a99Smrgif test "$cross_compiling" = yes; then :
1771e5383a99Smrg  [$4]
1772e5383a99Smrgelse
1773e5383a99Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1774e5383a99Smrg  lt_status=$lt_dlunknown
1775e5383a99Smrg  cat > conftest.$ac_ext <<_LT_EOF
1776e5383a99Smrg[#line $LINENO "configure"
1777e5383a99Smrg#include "confdefs.h"
1778caade7ccSmrg
1779e5383a99Smrg#if HAVE_DLFCN_H
1780e5383a99Smrg#include <dlfcn.h>
1781e5383a99Smrg#endif
1782e8a5466aSmrg
1783e5383a99Smrg#include <stdio.h>
1784e8a5466aSmrg
1785e5383a99Smrg#ifdef RTLD_GLOBAL
1786e5383a99Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
1787e5383a99Smrg#else
1788e5383a99Smrg#  ifdef DL_GLOBAL
1789e5383a99Smrg#    define LT_DLGLOBAL		DL_GLOBAL
1790e5383a99Smrg#  else
1791e5383a99Smrg#    define LT_DLGLOBAL		0
1792e5383a99Smrg#  endif
1793e5383a99Smrg#endif
1794e8a5466aSmrg
1795e5383a99Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1796e5383a99Smrg   find out it does not work in some platform. */
1797e5383a99Smrg#ifndef LT_DLLAZY_OR_NOW
1798e5383a99Smrg#  ifdef RTLD_LAZY
1799e5383a99Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
1800e5383a99Smrg#  else
1801e5383a99Smrg#    ifdef DL_LAZY
1802e5383a99Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
1803e5383a99Smrg#    else
1804e5383a99Smrg#      ifdef RTLD_NOW
1805e5383a99Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
1806e5383a99Smrg#      else
1807e5383a99Smrg#        ifdef DL_NOW
1808e5383a99Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
1809e5383a99Smrg#        else
1810e5383a99Smrg#          define LT_DLLAZY_OR_NOW	0
1811e5383a99Smrg#        endif
1812e5383a99Smrg#      endif
1813e5383a99Smrg#    endif
1814e5383a99Smrg#  endif
1815e5383a99Smrg#endif
1816e8a5466aSmrg
1817e5383a99Smrg/* When -fvisbility=hidden is used, assume the code has been annotated
1818e5383a99Smrg   correspondingly for the symbols needed.  */
1819e5383a99Smrg#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1820e5383a99Smrgint fnord () __attribute__((visibility("default")));
1821e5383a99Smrg#endif
1822e8a5466aSmrg
1823e5383a99Smrgint fnord () { return 42; }
1824e5383a99Smrgint main ()
1825e5383a99Smrg{
1826e5383a99Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1827e5383a99Smrg  int status = $lt_dlunknown;
1828caade7ccSmrg
1829e5383a99Smrg  if (self)
1830e5383a99Smrg    {
1831e5383a99Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1832e5383a99Smrg      else
1833e5383a99Smrg        {
1834e5383a99Smrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
1835e5383a99Smrg          else puts (dlerror ());
1836e5383a99Smrg	}
1837e5383a99Smrg      /* dlclose (self); */
1838e5383a99Smrg    }
1839e5383a99Smrg  else
1840e5383a99Smrg    puts (dlerror ());
1841caade7ccSmrg
1842e5383a99Smrg  return status;
1843e5383a99Smrg}]
1844e5383a99Smrg_LT_EOF
1845e5383a99Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1846e5383a99Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1847e5383a99Smrg    lt_status=$?
1848e5383a99Smrg    case x$lt_status in
1849e5383a99Smrg      x$lt_dlno_uscore) $1 ;;
1850e5383a99Smrg      x$lt_dlneed_uscore) $2 ;;
1851e5383a99Smrg      x$lt_dlunknown|x*) $3 ;;
1852e5383a99Smrg    esac
1853e5383a99Smrg  else :
1854e5383a99Smrg    # compilation failed
1855e5383a99Smrg    $3
1856e5383a99Smrg  fi
1857e5383a99Smrgfi
1858e5383a99Smrgrm -fr conftest*
1859e5383a99Smrg])# _LT_TRY_DLOPEN_SELF
1860caade7ccSmrg
1861caade7ccSmrg
1862e5383a99Smrg# LT_SYS_DLOPEN_SELF
1863e5383a99Smrg# ------------------
1864e5383a99SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
1865e5383a99Smrg[m4_require([_LT_HEADER_DLFCN])dnl
1866e5383a99Smrgif test "x$enable_dlopen" != xyes; then
1867e5383a99Smrg  enable_dlopen=unknown
1868e5383a99Smrg  enable_dlopen_self=unknown
1869e5383a99Smrg  enable_dlopen_self_static=unknown
1870e5383a99Smrgelse
1871e5383a99Smrg  lt_cv_dlopen=no
1872e5383a99Smrg  lt_cv_dlopen_libs=
1873caade7ccSmrg
1874af9a7ee5Smrg  case $host_os in
1875e5383a99Smrg  beos*)
1876e5383a99Smrg    lt_cv_dlopen="load_add_on"
1877e5383a99Smrg    lt_cv_dlopen_libs=
1878e5383a99Smrg    lt_cv_dlopen_self=yes
1879e5383a99Smrg    ;;
1880b9b4fd27Smrg
1881e5383a99Smrg  mingw* | pw32* | cegcc*)
1882e5383a99Smrg    lt_cv_dlopen="LoadLibrary"
1883e5383a99Smrg    lt_cv_dlopen_libs=
1884e5383a99Smrg    ;;
1885b9b4fd27Smrg
1886e5383a99Smrg  cygwin*)
1887e5383a99Smrg    lt_cv_dlopen="dlopen"
1888e5383a99Smrg    lt_cv_dlopen_libs=
1889e5383a99Smrg    ;;
1890b9b4fd27Smrg
1891e5383a99Smrg  darwin*)
1892e5383a99Smrg  # if libdl is installed we need to link against it
1893e5383a99Smrg    AC_CHECK_LIB([dl], [dlopen],
1894e5383a99Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
1895e5383a99Smrg    lt_cv_dlopen="dyld"
1896e5383a99Smrg    lt_cv_dlopen_libs=
1897e5383a99Smrg    lt_cv_dlopen_self=yes
1898af9a7ee5Smrg    ])
1899af9a7ee5Smrg    ;;
1900e5383a99Smrg
1901e5383a99Smrg  *)
1902e5383a99Smrg    AC_CHECK_FUNC([shl_load],
1903e5383a99Smrg	  [lt_cv_dlopen="shl_load"],
1904e5383a99Smrg      [AC_CHECK_LIB([dld], [shl_load],
1905e5383a99Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
1906e5383a99Smrg	[AC_CHECK_FUNC([dlopen],
1907e5383a99Smrg	      [lt_cv_dlopen="dlopen"],
1908e5383a99Smrg	  [AC_CHECK_LIB([dl], [dlopen],
1909e5383a99Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1910e5383a99Smrg	    [AC_CHECK_LIB([svld], [dlopen],
1911e5383a99Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1912e5383a99Smrg	      [AC_CHECK_LIB([dld], [dld_link],
1913e5383a99Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
1914e5383a99Smrg	      ])
1915e5383a99Smrg	    ])
1916e5383a99Smrg	  ])
1917e5383a99Smrg	])
1918e5383a99Smrg      ])
1919af9a7ee5Smrg    ;;
1920af9a7ee5Smrg  esac
1921b9b4fd27Smrg
1922e5383a99Smrg  if test "x$lt_cv_dlopen" != xno; then
1923e5383a99Smrg    enable_dlopen=yes
1924af9a7ee5Smrg  else
1925e5383a99Smrg    enable_dlopen=no
1926af9a7ee5Smrg  fi
1927caade7ccSmrg
1928e5383a99Smrg  case $lt_cv_dlopen in
1929e5383a99Smrg  dlopen)
1930e5383a99Smrg    save_CPPFLAGS="$CPPFLAGS"
1931e5383a99Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1932caade7ccSmrg
1933e5383a99Smrg    save_LDFLAGS="$LDFLAGS"
1934e5383a99Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1935caade7ccSmrg
1936e5383a99Smrg    save_LIBS="$LIBS"
1937e5383a99Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
1938caade7ccSmrg
1939e5383a99Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
1940e5383a99Smrg	  lt_cv_dlopen_self, [dnl
1941e5383a99Smrg	  _LT_TRY_DLOPEN_SELF(
1942e5383a99Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1943e5383a99Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1944e5383a99Smrg    ])
1945485f0483Smrg
1946e5383a99Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
1947e5383a99Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
1948e5383a99Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1949e5383a99Smrg	  lt_cv_dlopen_self_static, [dnl
1950e5383a99Smrg	  _LT_TRY_DLOPEN_SELF(
1951e5383a99Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1952e5383a99Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
1953e5383a99Smrg      ])
1954e5383a99Smrg    fi
1955caade7ccSmrg
1956e5383a99Smrg    CPPFLAGS="$save_CPPFLAGS"
1957e5383a99Smrg    LDFLAGS="$save_LDFLAGS"
1958e5383a99Smrg    LIBS="$save_LIBS"
1959e5383a99Smrg    ;;
1960e5383a99Smrg  esac
1961caade7ccSmrg
1962e5383a99Smrg  case $lt_cv_dlopen_self in
1963e5383a99Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1964e5383a99Smrg  *) enable_dlopen_self=unknown ;;
1965e5383a99Smrg  esac
1966caade7ccSmrg
1967e5383a99Smrg  case $lt_cv_dlopen_self_static in
1968e5383a99Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1969e5383a99Smrg  *) enable_dlopen_self_static=unknown ;;
1970e5383a99Smrg  esac
1971e5383a99Smrgfi
1972e5383a99Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
1973e5383a99Smrg	 [Whether dlopen is supported])
1974e5383a99Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
1975e5383a99Smrg	 [Whether dlopen of programs is supported])
1976e5383a99Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
1977e5383a99Smrg	 [Whether dlopen of statically linked programs is supported])
1978e5383a99Smrg])# LT_SYS_DLOPEN_SELF
1979caade7ccSmrg
1980e5383a99Smrg# Old name:
1981e5383a99SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
1982e5383a99Smrgdnl aclocal-1.4 backwards compatibility:
1983e5383a99Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1984caade7ccSmrg
1985caade7ccSmrg
1986e5383a99Smrg# _LT_COMPILER_C_O([TAGNAME])
1987e5383a99Smrg# ---------------------------
1988e5383a99Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
1989e5383a99Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
1990e5383a99Smrgm4_defun([_LT_COMPILER_C_O],
1991e5383a99Smrg[m4_require([_LT_DECL_SED])dnl
1992e5383a99Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
1993e5383a99Smrgm4_require([_LT_TAG_COMPILER])dnl
1994e5383a99SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1995e5383a99Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1996e5383a99Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
1997e5383a99Smrg   $RM -r conftest 2>/dev/null
1998e5383a99Smrg   mkdir conftest
1999e5383a99Smrg   cd conftest
2000e5383a99Smrg   mkdir out
2001e5383a99Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2002caade7ccSmrg
2003e5383a99Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
2004e5383a99Smrg   # Insert the option either (1) after the last *FLAGS variable, or
2005e5383a99Smrg   # (2) before a word containing "conftest.", or (3) at the end.
2006e5383a99Smrg   # Note that $ac_compile itself does not contain backslashes and begins
2007e5383a99Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
2008e5383a99Smrg   lt_compile=`echo "$ac_compile" | $SED \
2009e5383a99Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2010e5383a99Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2011e5383a99Smrg   -e 's:$: $lt_compiler_flag:'`
2012e5383a99Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2013e5383a99Smrg   (eval "$lt_compile" 2>out/conftest.err)
2014e5383a99Smrg   ac_status=$?
2015e5383a99Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
2016e5383a99Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2017e5383a99Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
2018e5383a99Smrg   then
2019e5383a99Smrg     # The compiler can only warn and ignore the option if not recognized
2020e5383a99Smrg     # So say no if there are warnings
2021e5383a99Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
2022e5383a99Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
2023e5383a99Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
2024e5383a99Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
2025e5383a99Smrg     fi
2026af9a7ee5Smrg   fi
2027e5383a99Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
2028e5383a99Smrg   $RM conftest*
2029e5383a99Smrg   # SGI C++ compiler will create directory out/ii_files/ for
2030e5383a99Smrg   # template instantiation
2031e5383a99Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
2032e5383a99Smrg   $RM out/* && rmdir out
2033e5383a99Smrg   cd ..
2034e5383a99Smrg   $RM -r conftest
2035e5383a99Smrg   $RM conftest*
2036e5383a99Smrg])
2037e5383a99Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
2038e5383a99Smrg	[Does compiler simultaneously support -c and -o options?])
2039e5383a99Smrg])# _LT_COMPILER_C_O
2040caade7ccSmrg
2041b9b4fd27Smrg
2042e5383a99Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
2043e5383a99Smrg# ----------------------------------
2044e5383a99Smrg# Check to see if we can do hard links to lock some files if needed
2045e5383a99Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
2046e5383a99Smrg[m4_require([_LT_ENABLE_LOCK])dnl
2047e5383a99Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2048e5383a99Smrg_LT_COMPILER_C_O([$1])
2049b9b4fd27Smrg
2050e5383a99Smrghard_links="nottested"
2051e5383a99Smrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
2052e5383a99Smrg  # do not overwrite the value of need_locks provided by the user
2053e5383a99Smrg  AC_MSG_CHECKING([if we can lock with hard links])
2054e5383a99Smrg  hard_links=yes
2055e5383a99Smrg  $RM conftest*
2056e5383a99Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2057e5383a99Smrg  touch conftest.a
2058e5383a99Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
2059e5383a99Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2060e5383a99Smrg  AC_MSG_RESULT([$hard_links])
2061e5383a99Smrg  if test "$hard_links" = no; then
2062e5383a99Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
2063e5383a99Smrg    need_locks=warn
2064af9a7ee5Smrg  fi
2065e5383a99Smrgelse
2066e5383a99Smrg  need_locks=no
2067e5383a99Smrgfi
2068e5383a99Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
2069e5383a99Smrg])# _LT_COMPILER_FILE_LOCKS
2070b9b4fd27Smrg
2071caade7ccSmrg
2072e5383a99Smrg# _LT_CHECK_OBJDIR
2073e5383a99Smrg# ----------------
2074e5383a99Smrgm4_defun([_LT_CHECK_OBJDIR],
2075e5383a99Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
2076e5383a99Smrg[rm -f .libs 2>/dev/null
2077e5383a99Smrgmkdir .libs 2>/dev/null
2078e5383a99Smrgif test -d .libs; then
2079e5383a99Smrg  lt_cv_objdir=.libs
2080af9a7ee5Smrgelse
2081e5383a99Smrg  # MS-DOS does not allow filenames that begin with a dot.
2082e5383a99Smrg  lt_cv_objdir=_libs
2083af9a7ee5Smrgfi
2084e5383a99Smrgrmdir .libs 2>/dev/null])
2085e5383a99Smrgobjdir=$lt_cv_objdir
2086e5383a99Smrg_LT_DECL([], [objdir], [0],
2087e5383a99Smrg         [The name of the directory that contains temporary libtool files])dnl
2088e5383a99Smrgm4_pattern_allow([LT_OBJDIR])dnl
2089e5383a99SmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
2090e5383a99Smrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
2091e5383a99Smrg])# _LT_CHECK_OBJDIR
2092caade7ccSmrg
2093caade7ccSmrg
2094e5383a99Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
2095e5383a99Smrg# --------------------------------------
2096e5383a99Smrg# Check hardcoding attributes.
2097e5383a99Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
2098e5383a99Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
2099e5383a99Smrg_LT_TAGVAR(hardcode_action, $1)=
2100e5383a99Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
2101e5383a99Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
2102e5383a99Smrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
2103caade7ccSmrg
2104e5383a99Smrg  # We can hardcode non-existent directories.
2105e5383a99Smrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
2106e5383a99Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
2107e5383a99Smrg     # have to relink, otherwise we might link with an installed library
2108e5383a99Smrg     # when we should be linking with a yet-to-be-installed one
2109e5383a99Smrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
2110e5383a99Smrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
2111e5383a99Smrg    # Linking always hardcodes the temporary library directory.
2112e5383a99Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
2113e5383a99Smrg  else
2114e5383a99Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
2115e5383a99Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
2116e5383a99Smrg  fi
2117e5383a99Smrgelse
2118e5383a99Smrg  # We cannot hardcode anything, or else we can only hardcode existing
2119e5383a99Smrg  # directories.
2120e5383a99Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
2121e5383a99Smrgfi
2122e5383a99SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2123caade7ccSmrg
2124e5383a99Smrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
2125e5383a99Smrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
2126e5383a99Smrg  # Fast installation is not supported
2127e5383a99Smrg  enable_fast_install=no
2128e5383a99Smrgelif test "$shlibpath_overrides_runpath" = yes ||
2129e5383a99Smrg     test "$enable_shared" = no; then
2130e5383a99Smrg  # Fast installation is not necessary
2131e5383a99Smrg  enable_fast_install=needless
2132e5383a99Smrgfi
2133e5383a99Smrg_LT_TAGDECL([], [hardcode_action], [0],
2134e5383a99Smrg    [How to hardcode a shared library path into an executable])
2135e5383a99Smrg])# _LT_LINKER_HARDCODE_LIBPATH
2136b9b4fd27Smrg
2137b9b4fd27Smrg
2138e5383a99Smrg# _LT_CMD_STRIPLIB
2139e5383a99Smrg# ----------------
2140e5383a99Smrgm4_defun([_LT_CMD_STRIPLIB],
2141e5383a99Smrg[m4_require([_LT_DECL_EGREP])
2142e5383a99Smrgstriplib=
2143e5383a99Smrgold_striplib=
2144e5383a99SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
2145e5383a99Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2146e5383a99Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2147e5383a99Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2148e5383a99Smrg  AC_MSG_RESULT([yes])
2149e5383a99Smrgelse
2150e5383a99Smrg# FIXME - insert some real tests, host_os isn't really good enough
2151af9a7ee5Smrg  case $host_os in
2152e5383a99Smrg  darwin*)
2153e5383a99Smrg    if test -n "$STRIP" ; then
2154e5383a99Smrg      striplib="$STRIP -x"
2155e5383a99Smrg      old_striplib="$STRIP -S"
2156e5383a99Smrg      AC_MSG_RESULT([yes])
2157e5383a99Smrg    else
2158e5383a99Smrg      AC_MSG_RESULT([no])
2159e5383a99Smrg    fi
2160af9a7ee5Smrg    ;;
2161af9a7ee5Smrg  *)
2162e5383a99Smrg    AC_MSG_RESULT([no])
2163af9a7ee5Smrg    ;;
2164b9b4fd27Smrg  esac
2165b9b4fd27Smrgfi
2166e5383a99Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2167e5383a99Smrg_LT_DECL([], [striplib], [1])
2168e5383a99Smrg])# _LT_CMD_STRIPLIB
2169b9b4fd27Smrg
2170b9b4fd27Smrg
2171e5383a99Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
2172e5383a99Smrg# -----------------------------
2173e5383a99Smrg# PORTME Fill in your ld.so characteristics
2174e5383a99Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
2175e5383a99Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2176e5383a99Smrgm4_require([_LT_DECL_EGREP])dnl
2177e5383a99Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2178e5383a99Smrgm4_require([_LT_DECL_OBJDUMP])dnl
2179af9a7ee5Smrgm4_require([_LT_DECL_SED])dnl
2180e5383a99Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
2181e5383a99SmrgAC_MSG_CHECKING([dynamic linker characteristics])
2182e5383a99Smrgm4_if([$1],
2183e5383a99Smrg	[], [
2184e5383a99Smrgif test "$GCC" = yes; then
2185e5383a99Smrg  case $host_os in
2186e5383a99Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
2187e5383a99Smrg    *) lt_awk_arg="/^libraries:/" ;;
2188e5383a99Smrg  esac
2189e5383a99Smrg  case $host_os in
2190e5383a99Smrg    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
2191e5383a99Smrg    *) lt_sed_strip_eq="s,=/,/,g" ;;
2192e5383a99Smrg  esac
2193e5383a99Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
2194e5383a99Smrg  case $lt_search_path_spec in
2195e5383a99Smrg  *\;*)
2196e5383a99Smrg    # if the path contains ";" then we assume it to be the separator
2197e5383a99Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
2198e5383a99Smrg    # assumed that no part of a normal pathname contains ";" but that should
2199e5383a99Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
2200e5383a99Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
2201e5383a99Smrg    ;;
2202e5383a99Smrg  *)
2203e5383a99Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
2204e5383a99Smrg    ;;
2205e5383a99Smrg  esac
2206e5383a99Smrg  # Ok, now we have the path, separated by spaces, we can step through it
2207e5383a99Smrg  # and add multilib dir if necessary.
2208e5383a99Smrg  lt_tmp_lt_search_path_spec=
2209e5383a99Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2210e5383a99Smrg  for lt_sys_path in $lt_search_path_spec; do
2211e5383a99Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
2212e5383a99Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
2213e5383a99Smrg    else
2214e5383a99Smrg      test -d "$lt_sys_path" && \
2215e5383a99Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2216e5383a99Smrg    fi
2217e5383a99Smrg  done
2218e5383a99Smrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
2219e5383a99SmrgBEGIN {RS=" "; FS="/|\n";} {
2220e5383a99Smrg  lt_foo="";
2221e5383a99Smrg  lt_count=0;
2222e5383a99Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
2223e5383a99Smrg    if ($lt_i != "" && $lt_i != ".") {
2224e5383a99Smrg      if ($lt_i == "..") {
2225e5383a99Smrg        lt_count++;
2226e5383a99Smrg      } else {
2227e5383a99Smrg        if (lt_count == 0) {
2228e5383a99Smrg          lt_foo="/" $lt_i lt_foo;
2229e5383a99Smrg        } else {
2230e5383a99Smrg          lt_count--;
2231e5383a99Smrg        }
2232e5383a99Smrg      }
2233e5383a99Smrg    }
2234e5383a99Smrg  }
2235e5383a99Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2236e5383a99Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2237e5383a99Smrg}'`
2238e5383a99Smrg  # AWK program above erroneously prepends '/' to C:/dos/paths
2239e5383a99Smrg  # for these hosts.
2240e5383a99Smrg  case $host_os in
2241e5383a99Smrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
2242e5383a99Smrg      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
2243e5383a99Smrg  esac
2244e5383a99Smrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
2245af9a7ee5Smrgelse
2246e5383a99Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2247e5383a99Smrgfi])
2248e5383a99Smrglibrary_names_spec=
2249e5383a99Smrglibname_spec='lib$name'
2250e5383a99Smrgsoname_spec=
2251e5383a99Smrgshrext_cmds=".so"
2252e5383a99Smrgpostinstall_cmds=
2253e5383a99Smrgpostuninstall_cmds=
2254e5383a99Smrgfinish_cmds=
2255e5383a99Smrgfinish_eval=
2256e5383a99Smrgshlibpath_var=
2257e5383a99Smrgshlibpath_overrides_runpath=unknown
2258e5383a99Smrgversion_type=none
2259e5383a99Smrgdynamic_linker="$host_os ld.so"
2260e5383a99Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
2261e5383a99Smrgneed_lib_prefix=unknown
2262e5383a99Smrghardcode_into_libs=no
2263caade7ccSmrg
2264e5383a99Smrg# when you set need_version to no, make sure it does not cause -set_version
2265e5383a99Smrg# flags to be left without arguments
2266e5383a99Smrgneed_version=unknown
2267caade7ccSmrg
2268e5383a99Smrgcase $host_os in
2269e5383a99Smrgaix3*)
2270e5383a99Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2271e5383a99Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
2272e5383a99Smrg  shlibpath_var=LIBPATH
2273caade7ccSmrg
2274e5383a99Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
2275e5383a99Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2276e5383a99Smrg  ;;
2277caade7ccSmrg
2278e5383a99Smrgaix[[4-9]]*)
2279e5383a99Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2280e5383a99Smrg  need_lib_prefix=no
2281e5383a99Smrg  need_version=no
2282e5383a99Smrg  hardcode_into_libs=yes
2283e5383a99Smrg  if test "$host_cpu" = ia64; then
2284e5383a99Smrg    # AIX 5 supports IA64
2285e5383a99Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
2286e5383a99Smrg    shlibpath_var=LD_LIBRARY_PATH
2287e5383a99Smrg  else
2288e5383a99Smrg    # With GCC up to 2.95.x, collect2 would create an import file
2289e5383a99Smrg    # for dependence libraries.  The import file would start with
2290e5383a99Smrg    # the line `#! .'.  This would cause the generated library to
2291e5383a99Smrg    # depend on `.', always an invalid library.  This was fixed in
2292e5383a99Smrg    # development snapshots of GCC prior to 3.0.
2293e5383a99Smrg    case $host_os in
2294e5383a99Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
2295e5383a99Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2296e5383a99Smrg	   echo ' yes '
2297e5383a99Smrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
2298e5383a99Smrg	:
2299e5383a99Smrg      else
2300e5383a99Smrg	can_build_shared=no
2301e5383a99Smrg      fi
2302e5383a99Smrg      ;;
2303e5383a99Smrg    esac
2304e5383a99Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
2305e5383a99Smrg    # soname into executable. Probably we can add versioning support to
2306e5383a99Smrg    # collect2, so additional links can be useful in future.
2307e5383a99Smrg    if test "$aix_use_runtimelinking" = yes; then
2308e5383a99Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2309e5383a99Smrg      # instead of lib<name>.a to let people know that these are not
2310e5383a99Smrg      # typical AIX shared libraries.
2311e5383a99Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2312e5383a99Smrg    else
2313e5383a99Smrg      # We preserve .a as extension for shared libraries through AIX4.2
2314e5383a99Smrg      # and later when we are not doing run time linking.
2315e5383a99Smrg      library_names_spec='${libname}${release}.a $libname.a'
2316e5383a99Smrg      soname_spec='${libname}${release}${shared_ext}$major'
2317e5383a99Smrg    fi
2318e5383a99Smrg    shlibpath_var=LIBPATH
2319e5383a99Smrg  fi
2320e5383a99Smrg  ;;
2321caade7ccSmrg
2322e5383a99Smrgamigaos*)
2323e5383a99Smrg  case $host_cpu in
2324e5383a99Smrg  powerpc)
2325e5383a99Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
2326e5383a99Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2327e5383a99Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2328caade7ccSmrg    ;;
2329e5383a99Smrg  m68k)
2330e5383a99Smrg    library_names_spec='$libname.ixlibrary $libname.a'
2331e5383a99Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
2332e5383a99Smrg    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
2333af9a7ee5Smrg    ;;
2334e5383a99Smrg  esac
2335e5383a99Smrg  ;;
2336caade7ccSmrg
2337e5383a99Smrgbeos*)
2338e5383a99Smrg  library_names_spec='${libname}${shared_ext}'
2339e5383a99Smrg  dynamic_linker="$host_os ld.so"
2340e5383a99Smrg  shlibpath_var=LIBRARY_PATH
2341e5383a99Smrg  ;;
2342caade7ccSmrg
2343e5383a99Smrgbsdi[[45]]*)
2344e5383a99Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2345e5383a99Smrg  need_version=no
2346e5383a99Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2347e5383a99Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2348e5383a99Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2349e5383a99Smrg  shlibpath_var=LD_LIBRARY_PATH
2350e5383a99Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2351e5383a99Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2352e5383a99Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
2353e5383a99Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2354e5383a99Smrg  # libtool to hard-code these into programs
2355e5383a99Smrg  ;;
2356caade7ccSmrg
2357e5383a99Smrgcygwin* | mingw* | pw32* | cegcc*)
2358e5383a99Smrg  version_type=windows
2359e5383a99Smrg  shrext_cmds=".dll"
2360e5383a99Smrg  need_version=no
2361e5383a99Smrg  need_lib_prefix=no
2362caade7ccSmrg
2363e5383a99Smrg  case $GCC,$cc_basename in
2364e5383a99Smrg  yes,*)
2365e5383a99Smrg    # gcc
2366e5383a99Smrg    library_names_spec='$libname.dll.a'
2367e5383a99Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2368e5383a99Smrg    postinstall_cmds='base_file=`basename \${file}`~
2369e5383a99Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2370e5383a99Smrg      dldir=$destdir/`dirname \$dlpath`~
2371e5383a99Smrg      test -d \$dldir || mkdir -p \$dldir~
2372e5383a99Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
2373e5383a99Smrg      chmod a+x \$dldir/$dlname~
2374e5383a99Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2375e5383a99Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2376e5383a99Smrg      fi'
2377e5383a99Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2378e5383a99Smrg      dlpath=$dir/\$dldll~
2379e5383a99Smrg       $RM \$dlpath'
2380e5383a99Smrg    shlibpath_overrides_runpath=yes
2381caade7ccSmrg
2382e5383a99Smrg    case $host_os in
2383e5383a99Smrg    cygwin*)
2384e5383a99Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2385e5383a99Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2386e5383a99Smrgm4_if([$1], [],[
2387e5383a99Smrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
2388e5383a99Smrg      ;;
2389e5383a99Smrg    mingw* | cegcc*)
2390e5383a99Smrg      # MinGW DLLs use traditional 'lib' prefix
2391e5383a99Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2392e5383a99Smrg      ;;
2393e5383a99Smrg    pw32*)
2394e5383a99Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
2395e5383a99Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2396e5383a99Smrg      ;;
2397e5383a99Smrg    esac
2398e5383a99Smrg    dynamic_linker='Win32 ld.exe'
2399af9a7ee5Smrg    ;;
2400caade7ccSmrg
2401e5383a99Smrg  *,cl*)
2402e5383a99Smrg    # Native MSVC
2403e5383a99Smrg    libname_spec='$name'
2404e5383a99Smrg    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2405e5383a99Smrg    library_names_spec='${libname}.dll.lib'
2406e5383a99Smrg
2407e5383a99Smrg    case $build_os in
2408e5383a99Smrg    mingw*)
2409e5383a99Smrg      sys_lib_search_path_spec=
2410e5383a99Smrg      lt_save_ifs=$IFS
2411e5383a99Smrg      IFS=';'
2412e5383a99Smrg      for lt_path in $LIB
2413af9a7ee5Smrg      do
2414e5383a99Smrg        IFS=$lt_save_ifs
2415e5383a99Smrg        # Let DOS variable expansion print the short 8.3 style file name.
2416e5383a99Smrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
2417e5383a99Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
2418af9a7ee5Smrg      done
2419e5383a99Smrg      IFS=$lt_save_ifs
2420e5383a99Smrg      # Convert to MSYS style.
2421e5383a99Smrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
2422e5383a99Smrg      ;;
2423e5383a99Smrg    cygwin*)
2424e5383a99Smrg      # Convert to unix form, then to dos form, then back to unix form
2425e5383a99Smrg      # but this time dos style (no spaces!) so that the unix form looks
2426e5383a99Smrg      # like /cygdrive/c/PROGRA~1:/cygdr...
2427e5383a99Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
2428e5383a99Smrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
2429e5383a99Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2430e5383a99Smrg      ;;
2431e5383a99Smrg    *)
2432e5383a99Smrg      sys_lib_search_path_spec="$LIB"
2433e5383a99Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2434e5383a99Smrg        # It is most probably a Windows format PATH.
2435e5383a99Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2436e5383a99Smrg      else
2437e5383a99Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2438e5383a99Smrg      fi
2439e5383a99Smrg      # FIXME: find the short name or the path components, as spaces are
2440e5383a99Smrg      # common. (e.g. "Program Files" -> "PROGRA~1")
2441e5383a99Smrg      ;;
2442e5383a99Smrg    esac
2443caade7ccSmrg
2444e5383a99Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2445e5383a99Smrg    postinstall_cmds='base_file=`basename \${file}`~
2446e5383a99Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2447e5383a99Smrg      dldir=$destdir/`dirname \$dlpath`~
2448e5383a99Smrg      test -d \$dldir || mkdir -p \$dldir~
2449e5383a99Smrg      $install_prog $dir/$dlname \$dldir/$dlname'
2450e5383a99Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2451e5383a99Smrg      dlpath=$dir/\$dldll~
2452e5383a99Smrg       $RM \$dlpath'
2453e5383a99Smrg    shlibpath_overrides_runpath=yes
2454e5383a99Smrg    dynamic_linker='Win32 link.exe'
2455e5383a99Smrg    ;;
2456caade7ccSmrg
2457e5383a99Smrg  *)
2458e5383a99Smrg    # Assume MSVC wrapper
2459e5383a99Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
2460e5383a99Smrg    dynamic_linker='Win32 ld.exe'
2461e5383a99Smrg    ;;
2462e5383a99Smrg  esac
2463e5383a99Smrg  # FIXME: first we should search . and the directory the executable is in
2464e5383a99Smrg  shlibpath_var=PATH
2465e5383a99Smrg  ;;
2466caade7ccSmrg
2467e5383a99Smrgdarwin* | rhapsody*)
2468e5383a99Smrg  dynamic_linker="$host_os dyld"
2469e5383a99Smrg  version_type=darwin
2470e5383a99Smrg  need_lib_prefix=no
2471e5383a99Smrg  need_version=no
2472e5383a99Smrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
2473e5383a99Smrg  soname_spec='${libname}${release}${major}$shared_ext'
2474e5383a99Smrg  shlibpath_overrides_runpath=yes
2475e5383a99Smrg  shlibpath_var=DYLD_LIBRARY_PATH
2476e5383a99Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2477e5383a99Smrgm4_if([$1], [],[
2478e5383a99Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2479e5383a99Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2480e5383a99Smrg  ;;
2481b9b4fd27Smrg
2482e5383a99Smrgdgux*)
2483e5383a99Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2484e5383a99Smrg  need_lib_prefix=no
2485e5383a99Smrg  need_version=no
2486e5383a99Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
2487e5383a99Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2488e5383a99Smrg  shlibpath_var=LD_LIBRARY_PATH
2489e5383a99Smrg  ;;
2490b9b4fd27Smrg
2491e5383a99Smrgfreebsd* | dragonfly*)
2492e5383a99Smrg  # DragonFly does not have aout.  When/if they implement a new
2493e5383a99Smrg  # versioning mechanism, adjust this.
2494e5383a99Smrg  if test -x /usr/bin/objformat; then
2495e5383a99Smrg    objformat=`/usr/bin/objformat`
2496af9a7ee5Smrg  else
2497e5383a99Smrg    case $host_os in
2498e5383a99Smrg    freebsd[[23]].*) objformat=aout ;;
2499e5383a99Smrg    *) objformat=elf ;;
2500af9a7ee5Smrg    esac
2501af9a7ee5Smrg  fi
2502e5383a99Smrg  version_type=freebsd-$objformat
2503e5383a99Smrg  case $version_type in
2504e5383a99Smrg    freebsd-elf*)
2505e5383a99Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2506e5383a99Smrg      need_version=no
2507e5383a99Smrg      need_lib_prefix=no
2508e5383a99Smrg      ;;
2509e5383a99Smrg    freebsd-*)
2510e5383a99Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
2511e5383a99Smrg      need_version=yes
2512e5383a99Smrg      ;;
2513e5383a99Smrg  esac
2514e5383a99Smrg  shlibpath_var=LD_LIBRARY_PATH
2515af9a7ee5Smrg  case $host_os in
2516e5383a99Smrg  freebsd2.*)
2517e5383a99Smrg    shlibpath_overrides_runpath=yes
2518af9a7ee5Smrg    ;;
2519e5383a99Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2520e5383a99Smrg    shlibpath_overrides_runpath=yes
2521e5383a99Smrg    hardcode_into_libs=yes
2522af9a7ee5Smrg    ;;
2523e5383a99Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2524e5383a99Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2525e5383a99Smrg    shlibpath_overrides_runpath=no
2526e5383a99Smrg    hardcode_into_libs=yes
2527af9a7ee5Smrg    ;;
2528e5383a99Smrg  *) # from 4.6 on, and DragonFly
2529e5383a99Smrg    shlibpath_overrides_runpath=yes
2530e5383a99Smrg    hardcode_into_libs=yes
2531af9a7ee5Smrg    ;;
2532af9a7ee5Smrg  esac
2533e5383a99Smrg  ;;
2534caade7ccSmrg
2535e5383a99Smrggnu*)
2536e5383a99Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2537e5383a99Smrg  need_lib_prefix=no
2538e5383a99Smrg  need_version=no
2539e5383a99Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2540e5383a99Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2541e5383a99Smrg  shlibpath_var=LD_LIBRARY_PATH
2542e5383a99Smrg  shlibpath_overrides_runpath=no
2543e5383a99Smrg  hardcode_into_libs=yes
2544e5383a99Smrg  ;;
2545caade7ccSmrg
2546e5383a99Smrghaiku*)
2547e5383a99Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2548e5383a99Smrg  need_lib_prefix=no
2549e5383a99Smrg  need_version=no
2550e5383a99Smrg  dynamic_linker="$host_os runtime_loader"
2551e5383a99Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2552e5383a99Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2553e5383a99Smrg  shlibpath_var=LIBRARY_PATH
2554e5383a99Smrg  shlibpath_overrides_runpath=yes
2555e5383a99Smrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
2556e5383a99Smrg  hardcode_into_libs=yes
2557e5383a99Smrg  ;;
2558af9a7ee5Smrg
2559e5383a99Smrghpux9* | hpux10* | hpux11*)
2560e5383a99Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
2561e5383a99Smrg  # link against other versions.
2562e5383a99Smrg  version_type=sunos
2563e5383a99Smrg  need_lib_prefix=no
2564e5383a99Smrg  need_version=no
2565e5383a99Smrg  case $host_cpu in
2566e5383a99Smrg  ia64*)
2567e5383a99Smrg    shrext_cmds='.so'
2568e5383a99Smrg    hardcode_into_libs=yes
2569e5383a99Smrg    dynamic_linker="$host_os dld.so"
2570e5383a99Smrg    shlibpath_var=LD_LIBRARY_PATH
2571e5383a99Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2572e5383a99Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2573e5383a99Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2574e5383a99Smrg    if test "X$HPUX_IA64_MODE" = X32; then
2575e5383a99Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2576e5383a99Smrg    else
2577e5383a99Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2578b9b4fd27Smrg    fi
2579e5383a99Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2580b9b4fd27Smrg    ;;
2581e5383a99Smrg  hppa*64*)
2582e5383a99Smrg    shrext_cmds='.sl'
2583e5383a99Smrg    hardcode_into_libs=yes
2584e5383a99Smrg    dynamic_linker="$host_os dld.sl"
2585e5383a99Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2586e5383a99Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2587e5383a99Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2588e5383a99Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2589e5383a99Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2590e5383a99Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2591e5383a99Smrg    ;;
2592e5383a99Smrg  *)
2593e5383a99Smrg    shrext_cmds='.sl'
2594e5383a99Smrg    dynamic_linker="$host_os dld.sl"
2595e5383a99Smrg    shlibpath_var=SHLIB_PATH
2596e5383a99Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2597e5383a99Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2598e5383a99Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2599e5383a99Smrg    ;;
2600e5383a99Smrg  esac
2601e5383a99Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
2602e5383a99Smrg  postinstall_cmds='chmod 555 $lib'
2603e5383a99Smrg  # or fails outright, so override atomically:
2604e5383a99Smrg  install_override_mode=555
2605e5383a99Smrg  ;;
2606caade7ccSmrg
2607e5383a99Smrginterix[[3-9]]*)
2608e5383a99Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2609e5383a99Smrg  need_lib_prefix=no
2610e5383a99Smrg  need_version=no
2611e5383a99Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2612e5383a99Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2613e5383a99Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2614e5383a99Smrg  shlibpath_var=LD_LIBRARY_PATH
2615e5383a99Smrg  shlibpath_overrides_runpath=no
2616e5383a99Smrg  hardcode_into_libs=yes
2617e5383a99Smrg  ;;
2618e8a5466aSmrg
2619e5383a99Smrgirix5* | irix6* | nonstopux*)
2620e5383a99Smrg  case $host_os in
2621e5383a99Smrg    nonstopux*) version_type=nonstopux ;;
2622e5383a99Smrg    *)
2623e5383a99Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
2624e5383a99Smrg		version_type=linux # correct to gnu/linux during the next big refactor
2625e5383a99Smrg	else
2626e5383a99Smrg		version_type=irix
2627e5383a99Smrg	fi ;;
2628e5383a99Smrg  esac
2629e5383a99Smrg  need_lib_prefix=no
2630e5383a99Smrg  need_version=no
2631e5383a99Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2632e5383a99Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
2633e5383a99Smrg  case $host_os in
2634e5383a99Smrg  irix5* | nonstopux*)
2635e5383a99Smrg    libsuff= shlibsuff=
2636e5383a99Smrg    ;;
2637e5383a99Smrg  *)
2638e5383a99Smrg    case $LD in # libtool.m4 will add one of these switches to LD
2639e5383a99Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2640e5383a99Smrg      libsuff= shlibsuff= libmagic=32-bit;;
2641e5383a99Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2642e5383a99Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
2643e5383a99Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2644e5383a99Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
2645e5383a99Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
2646e5383a99Smrg    esac
2647e5383a99Smrg    ;;
2648e5383a99Smrg  esac
2649e5383a99Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2650e5383a99Smrg  shlibpath_overrides_runpath=no
2651e5383a99Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2652e5383a99Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2653e5383a99Smrg  hardcode_into_libs=yes
2654e5383a99Smrg  ;;
2655caade7ccSmrg
2656e5383a99Smrg# No shared lib support for Linux oldld, aout, or coff.
2657e5383a99Smrglinux*oldld* | linux*aout* | linux*coff*)
2658e5383a99Smrg  dynamic_linker=no
2659e5383a99Smrg  ;;
2660caade7ccSmrg
2661e5383a99Smrg# This must be glibc/ELF.
2662e5383a99Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
2663e5383a99Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2664e5383a99Smrg  need_lib_prefix=no
2665e5383a99Smrg  need_version=no
2666e5383a99Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2667e5383a99Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2668e5383a99Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2669e5383a99Smrg  shlibpath_var=LD_LIBRARY_PATH
2670e5383a99Smrg  shlibpath_overrides_runpath=no
2671e8a5466aSmrg
2672e5383a99Smrg  # Some binutils ld are patched to set DT_RUNPATH
2673e5383a99Smrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
2674e5383a99Smrg    [lt_cv_shlibpath_overrides_runpath=no
2675e5383a99Smrg    save_LDFLAGS=$LDFLAGS
2676e5383a99Smrg    save_libdir=$libdir
2677e5383a99Smrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2678e5383a99Smrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2679e5383a99Smrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2680e5383a99Smrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2681e5383a99Smrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
2682e5383a99Smrg    LDFLAGS=$save_LDFLAGS
2683e5383a99Smrg    libdir=$save_libdir
2684e5383a99Smrg    ])
2685e5383a99Smrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
2686af9a7ee5Smrg
2687e5383a99Smrg  # This implies no fast_install, which is unacceptable.
2688e5383a99Smrg  # Some rework will be needed to allow for fast_install
2689e5383a99Smrg  # before this can be enabled.
2690e5383a99Smrg  hardcode_into_libs=yes
2691caade7ccSmrg
2692e5383a99Smrg  # Add ABI-specific directories to the system library path.
2693e5383a99Smrg  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
2694b9b4fd27Smrg
2695e5383a99Smrg  # Append ld.so.conf contents to the search path
2696e5383a99Smrg  if test -f /etc/ld.so.conf; then
2697e5383a99Smrg    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' ' '`
2698e5383a99Smrg    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
2699caade7ccSmrg
2700e5383a99Smrg  fi
2701caade7ccSmrg
2702e5383a99Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
2703e5383a99Smrg  # powerpc, because MkLinux only supported shared libraries with the
2704e5383a99Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
2705e5383a99Smrg  # most powerpc-linux boxes support dynamic linking these days and
2706e5383a99Smrg  # people can always --disable-shared, the test was removed, and we
2707e5383a99Smrg  # assume the GNU/Linux dynamic linker is in use.
2708e5383a99Smrg  dynamic_linker='GNU/Linux ld.so'
2709e5383a99Smrg  ;;
2710caade7ccSmrg
2711e5383a99Smrgnetbsd*)
2712e5383a99Smrg  version_type=sunos
2713e5383a99Smrg  need_lib_prefix=no
2714e5383a99Smrg  need_version=no
2715e5383a99Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2716e5383a99Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2717e5383a99Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2718e5383a99Smrg    dynamic_linker='NetBSD (a.out) ld.so'
2719af9a7ee5Smrg  else
2720e5383a99Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2721e5383a99Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2722e5383a99Smrg    dynamic_linker='NetBSD ld.elf_so'
2723e5383a99Smrg  fi
2724e5383a99Smrg  shlibpath_var=LD_LIBRARY_PATH
2725e5383a99Smrg  shlibpath_overrides_runpath=yes
2726e5383a99Smrg  hardcode_into_libs=yes
2727e5383a99Smrg  ;;
2728caade7ccSmrg
2729e5383a99Smrgnewsos6)
2730e5383a99Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2731e5383a99Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2732e5383a99Smrg  shlibpath_var=LD_LIBRARY_PATH
2733e5383a99Smrg  shlibpath_overrides_runpath=yes
2734e5383a99Smrg  ;;
2735caade7ccSmrg
2736e5383a99Smrg*nto* | *qnx*)
2737e5383a99Smrg  version_type=qnx
2738e5383a99Smrg  need_lib_prefix=no
2739e5383a99Smrg  need_version=no
2740e5383a99Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2741e5383a99Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2742e5383a99Smrg  shlibpath_var=LD_LIBRARY_PATH
2743e5383a99Smrg  shlibpath_overrides_runpath=no
2744e5383a99Smrg  hardcode_into_libs=yes
2745e5383a99Smrg  dynamic_linker='ldqnx.so'
2746e5383a99Smrg  ;;
2747caade7ccSmrg
2748e5383a99Smrgopenbsd*)
2749e5383a99Smrg  version_type=sunos
2750e5383a99Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
2751e5383a99Smrg  need_lib_prefix=no
2752e5383a99Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
2753af9a7ee5Smrg  case $host_os in
2754e5383a99Smrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
2755e5383a99Smrg    *)				need_version=no  ;;
2756af9a7ee5Smrg  esac
2757e5383a99Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2758e5383a99Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2759e5383a99Smrg  shlibpath_var=LD_LIBRARY_PATH
2760e5383a99Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2761e5383a99Smrg    case $host_os in
2762e5383a99Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
2763e5383a99Smrg	shlibpath_overrides_runpath=no
2764e5383a99Smrg	;;
2765e5383a99Smrg      *)
2766e5383a99Smrg	shlibpath_overrides_runpath=yes
2767e5383a99Smrg	;;
2768e5383a99Smrg      esac
2769e5383a99Smrg  else
2770e5383a99Smrg    shlibpath_overrides_runpath=yes
2771e5383a99Smrg  fi
2772e5383a99Smrg  ;;
2773caade7ccSmrg
2774e5383a99Smrgos2*)
2775e5383a99Smrg  libname_spec='$name'
2776e5383a99Smrg  shrext_cmds=".dll"
2777e5383a99Smrg  need_lib_prefix=no
2778e5383a99Smrg  library_names_spec='$libname${shared_ext} $libname.a'
2779e5383a99Smrg  dynamic_linker='OS/2 ld.exe'
2780af9a7ee5Smrg  shlibpath_var=LIBPATH
2781e5383a99Smrg  ;;
2782caade7ccSmrg
2783e5383a99Smrgosf3* | osf4* | osf5*)
2784e5383a99Smrg  version_type=osf
2785e5383a99Smrg  need_lib_prefix=no
2786e5383a99Smrg  need_version=no
2787af9a7ee5Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2788e5383a99Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2789e5383a99Smrg  shlibpath_var=LD_LIBRARY_PATH
2790e5383a99Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2791e5383a99Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2792af9a7ee5Smrg  ;;
2793caade7ccSmrg
2794e5383a99Smrgrdos*)
2795e5383a99Smrg  dynamic_linker=no
2796e5383a99Smrg  ;;
2797e5383a99Smrg
2798e5383a99Smrgsolaris*)
2799af9a7ee5Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2800af9a7ee5Smrg  need_lib_prefix=no
2801af9a7ee5Smrg  need_version=no
2802e5383a99Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2803e5383a99Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2804e5383a99Smrg  shlibpath_var=LD_LIBRARY_PATH
2805e5383a99Smrg  shlibpath_overrides_runpath=yes
2806af9a7ee5Smrg  hardcode_into_libs=yes
2807e5383a99Smrg  # ldd complains unless libraries are executable
2808e5383a99Smrg  postinstall_cmds='chmod +x $lib'
2809af9a7ee5Smrg  ;;
2810caade7ccSmrg
2811e5383a99Smrgsunos4*)
2812e5383a99Smrg  version_type=sunos
2813e5383a99Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2814e5383a99Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2815e5383a99Smrg  shlibpath_var=LD_LIBRARY_PATH
2816e5383a99Smrg  shlibpath_overrides_runpath=yes
2817e5383a99Smrg  if test "$with_gnu_ld" = yes; then
2818e5383a99Smrg    need_lib_prefix=no
2819e5383a99Smrg  fi
2820e5383a99Smrg  need_version=yes
2821af9a7ee5Smrg  ;;
2822caade7ccSmrg
2823e5383a99Smrgsysv4 | sysv4.3*)
2824af9a7ee5Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2825af9a7ee5Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2826af9a7ee5Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2827af9a7ee5Smrg  shlibpath_var=LD_LIBRARY_PATH
2828e5383a99Smrg  case $host_vendor in
2829e5383a99Smrg    sni)
2830e5383a99Smrg      shlibpath_overrides_runpath=no
2831e5383a99Smrg      need_lib_prefix=no
2832e5383a99Smrg      runpath_var=LD_RUN_PATH
2833af9a7ee5Smrg      ;;
2834e5383a99Smrg    siemens)
2835e5383a99Smrg      need_lib_prefix=no
2836af9a7ee5Smrg      ;;
2837e5383a99Smrg    motorola)
2838e5383a99Smrg      need_lib_prefix=no
2839e5383a99Smrg      need_version=no
2840e5383a99Smrg      shlibpath_overrides_runpath=no
2841e5383a99Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2842af9a7ee5Smrg      ;;
2843caade7ccSmrg  esac
2844af9a7ee5Smrg  ;;
2845caade7ccSmrg
2846e5383a99Smrgsysv4*MP*)
2847e5383a99Smrg  if test -d /usr/nec ;then
2848e5383a99Smrg    version_type=linux # correct to gnu/linux during the next big refactor
2849e5383a99Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
2850e5383a99Smrg    soname_spec='$libname${shared_ext}.$major'
2851e5383a99Smrg    shlibpath_var=LD_LIBRARY_PATH
2852e5383a99Smrg  fi
2853af9a7ee5Smrg  ;;
2854caade7ccSmrg
2855e5383a99Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
2856e5383a99Smrg  version_type=freebsd-elf
2857af9a7ee5Smrg  need_lib_prefix=no
2858af9a7ee5Smrg  need_version=no
2859e5383a99Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2860af9a7ee5Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2861af9a7ee5Smrg  shlibpath_var=LD_LIBRARY_PATH
2862e5383a99Smrg  shlibpath_overrides_runpath=yes
2863e5383a99Smrg  hardcode_into_libs=yes
2864e5383a99Smrg  if test "$with_gnu_ld" = yes; then
2865e5383a99Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
2866b9b4fd27Smrg  else
2867e5383a99Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
2868af9a7ee5Smrg    case $host_os in
2869e5383a99Smrg      sco3.2v5*)
2870e5383a99Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
2871e5383a99Smrg	;;
2872b9b4fd27Smrg    esac
2873b9b4fd27Smrg  fi
2874e5383a99Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
2875af9a7ee5Smrg  ;;
2876af9a7ee5Smrg
2877e5383a99Smrgtpf*)
2878e5383a99Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
2879af9a7ee5Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2880af9a7ee5Smrg  need_lib_prefix=no
2881af9a7ee5Smrg  need_version=no
2882e5383a99Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2883af9a7ee5Smrg  shlibpath_var=LD_LIBRARY_PATH
2884af9a7ee5Smrg  shlibpath_overrides_runpath=no
2885af9a7ee5Smrg  hardcode_into_libs=yes
2886af9a7ee5Smrg  ;;
2887af9a7ee5Smrg
2888e5383a99Smrguts4*)
2889af9a7ee5Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2890e5383a99Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2891af9a7ee5Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2892e5383a99Smrg  shlibpath_var=LD_LIBRARY_PATH
2893af9a7ee5Smrg  ;;
2894caade7ccSmrg
2895e5383a99Smrg*)
2896af9a7ee5Smrg  dynamic_linker=no
2897af9a7ee5Smrg  ;;
2898e5383a99Smrgesac
2899e5383a99SmrgAC_MSG_RESULT([$dynamic_linker])
2900e5383a99Smrgtest "$dynamic_linker" = no && can_build_shared=no
2901caade7ccSmrg
2902e5383a99Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2903e5383a99Smrgif test "$GCC" = yes; then
2904e5383a99Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2905e5383a99Smrgfi
2906caade7ccSmrg
2907e5383a99Smrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
2908e5383a99Smrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
2909e5383a99Smrgfi
2910e5383a99Smrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
2911e5383a99Smrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
2912e5383a99Smrgfi
2913caade7ccSmrg
2914e5383a99Smrg_LT_DECL([], [variables_saved_for_relink], [1],
2915e5383a99Smrg    [Variables whose values should be saved in libtool wrapper scripts and
2916e5383a99Smrg    restored at link time])
2917e5383a99Smrg_LT_DECL([], [need_lib_prefix], [0],
2918e5383a99Smrg    [Do we need the "lib" prefix for modules?])
2919e5383a99Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
2920e5383a99Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
2921e5383a99Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
2922e5383a99Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
2923e5383a99Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
2924e5383a99Smrg    [Is shlibpath searched before the hard-coded library search path?])
2925e5383a99Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
2926e5383a99Smrg_LT_DECL([], [library_names_spec], [1],
2927e5383a99Smrg    [[List of archive names.  First name is the real one, the rest are links.
2928e5383a99Smrg    The last name is the one that the linker finds with -lNAME]])
2929e5383a99Smrg_LT_DECL([], [soname_spec], [1],
2930e5383a99Smrg    [[The coded name of the library, if different from the real name]])
2931e5383a99Smrg_LT_DECL([], [install_override_mode], [1],
2932e5383a99Smrg    [Permission mode override for installation of shared libraries])
2933e5383a99Smrg_LT_DECL([], [postinstall_cmds], [2],
2934e5383a99Smrg    [Command to use after installation of a shared archive])
2935e5383a99Smrg_LT_DECL([], [postuninstall_cmds], [2],
2936e5383a99Smrg    [Command to use after uninstallation of a shared archive])
2937e5383a99Smrg_LT_DECL([], [finish_cmds], [2],
2938e5383a99Smrg    [Commands used to finish a libtool library installation in a directory])
2939e5383a99Smrg_LT_DECL([], [finish_eval], [1],
2940e5383a99Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
2941e5383a99Smrg    not shown]])
2942e5383a99Smrg_LT_DECL([], [hardcode_into_libs], [0],
2943e5383a99Smrg    [Whether we should hardcode library paths into libraries])
2944e5383a99Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
2945e5383a99Smrg    [Compile-time system search path for libraries])
2946e5383a99Smrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
2947e5383a99Smrg    [Run-time system search path for libraries])
2948e5383a99Smrg])# _LT_SYS_DYNAMIC_LINKER
2949caade7ccSmrg
2950caade7ccSmrg
2951e5383a99Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
2952e5383a99Smrg# --------------------------
2953e5383a99Smrg# find a file program which can recognize shared library
2954e5383a99SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
2955e5383a99Smrg[m4_require([_LT_DECL_EGREP])dnl
2956e5383a99SmrgAC_MSG_CHECKING([for $1])
2957e5383a99SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
2958e5383a99Smrg[case $MAGIC_CMD in
2959e5383a99Smrg[[\\/*] |  ?:[\\/]*])
2960e5383a99Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
2961af9a7ee5Smrg  ;;
2962e5383a99Smrg*)
2963e5383a99Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
2964e5383a99Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2965e5383a99Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
2966e5383a99Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
2967e5383a99Smrgdnl not every word.  This closes a longstanding sh security hole.
2968e5383a99Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
2969e5383a99Smrg  for ac_dir in $ac_dummy; do
2970e5383a99Smrg    IFS="$lt_save_ifs"
2971e5383a99Smrg    test -z "$ac_dir" && ac_dir=.
2972e5383a99Smrg    if test -f $ac_dir/$1; then
2973e5383a99Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
2974e5383a99Smrg      if test -n "$file_magic_test_file"; then
2975e5383a99Smrg	case $deplibs_check_method in
2976e5383a99Smrg	"file_magic "*)
2977e5383a99Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
2978e5383a99Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2979e5383a99Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
2980e5383a99Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
2981e5383a99Smrg	    :
2982e5383a99Smrg	  else
2983e5383a99Smrg	    cat <<_LT_EOF 1>&2
2984caade7ccSmrg
2985e5383a99Smrg*** Warning: the command libtool uses to detect shared libraries,
2986e5383a99Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
2987e5383a99Smrg*** The result is that libtool may fail to recognize shared libraries
2988e5383a99Smrg*** as such.  This will affect the creation of libtool libraries that
2989e5383a99Smrg*** depend on shared libraries, but programs linked with such libtool
2990e5383a99Smrg*** libraries will work regardless of this problem.  Nevertheless, you
2991e5383a99Smrg*** may want to report the problem to your system manager and/or to
2992e5383a99Smrg*** bug-libtool@gnu.org
2993caade7ccSmrg
2994e5383a99Smrg_LT_EOF
2995e5383a99Smrg	  fi ;;
2996e5383a99Smrg	esac
2997e5383a99Smrg      fi
2998e5383a99Smrg      break
2999e5383a99Smrg    fi
3000e5383a99Smrg  done
3001e5383a99Smrg  IFS="$lt_save_ifs"
3002e5383a99Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
3003af9a7ee5Smrg  ;;
3004e5383a99Smrgesac])
3005e5383a99SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3006e5383a99Smrgif test -n "$MAGIC_CMD"; then
3007e5383a99Smrg  AC_MSG_RESULT($MAGIC_CMD)
3008e5383a99Smrgelse
3009e5383a99Smrg  AC_MSG_RESULT(no)
3010e5383a99Smrgfi
3011e5383a99Smrg_LT_DECL([], [MAGIC_CMD], [0],
3012e5383a99Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
3013e5383a99Smrg])# _LT_PATH_TOOL_PREFIX
3014caade7ccSmrg
3015e5383a99Smrg# Old name:
3016e5383a99SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
3017e5383a99Smrgdnl aclocal-1.4 backwards compatibility:
3018e5383a99Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3019caade7ccSmrg
3020e5383a99Smrg
3021e5383a99Smrg# _LT_PATH_MAGIC
3022e5383a99Smrg# --------------
3023e5383a99Smrg# find a file program which can recognize a shared library
3024e5383a99Smrgm4_defun([_LT_PATH_MAGIC],
3025e5383a99Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
3026e5383a99Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
3027e5383a99Smrg  if test -n "$ac_tool_prefix"; then
3028e5383a99Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
3029e5383a99Smrg  else
3030e5383a99Smrg    MAGIC_CMD=:
3031e5383a99Smrg  fi
3032e5383a99Smrgfi
3033e5383a99Smrg])# _LT_PATH_MAGIC
3034e5383a99Smrg
3035e5383a99Smrg
3036e5383a99Smrg# LT_PATH_LD
3037e5383a99Smrg# ----------
3038e5383a99Smrg# find the pathname to the GNU or non-GNU linker
3039e5383a99SmrgAC_DEFUN([LT_PATH_LD],
3040e5383a99Smrg[AC_REQUIRE([AC_PROG_CC])dnl
3041e5383a99SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
3042e5383a99SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
3043e5383a99Smrgm4_require([_LT_DECL_SED])dnl
3044e5383a99Smrgm4_require([_LT_DECL_EGREP])dnl
3045e5383a99Smrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3046e5383a99Smrg
3047e5383a99SmrgAC_ARG_WITH([gnu-ld],
3048e5383a99Smrg    [AS_HELP_STRING([--with-gnu-ld],
3049e5383a99Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
3050e5383a99Smrg    [test "$withval" = no || with_gnu_ld=yes],
3051e5383a99Smrg    [with_gnu_ld=no])dnl
3052e5383a99Smrg
3053e5383a99Smrgac_prog=ld
3054e5383a99Smrgif test "$GCC" = yes; then
3055e5383a99Smrg  # Check if gcc -print-prog-name=ld gives a path.
3056e5383a99Smrg  AC_MSG_CHECKING([for ld used by $CC])
3057e5383a99Smrg  case $host in
3058e5383a99Smrg  *-*-mingw*)
3059e5383a99Smrg    # gcc leaves a trailing carriage return which upsets mingw
3060e5383a99Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3061e5383a99Smrg  *)
3062e5383a99Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3063af9a7ee5Smrg  esac
3064e5383a99Smrg  case $ac_prog in
3065e5383a99Smrg    # Accept absolute paths.
3066e5383a99Smrg    [[\\/]]* | ?:[[\\/]]*)
3067e5383a99Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
3068e5383a99Smrg      # Canonicalize the pathname of ld
3069e5383a99Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
3070e5383a99Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
3071e5383a99Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
3072e5383a99Smrg      done
3073e5383a99Smrg      test -z "$LD" && LD="$ac_prog"
3074e5383a99Smrg      ;;
3075e5383a99Smrg  "")
3076e5383a99Smrg    # If it fails, then pretend we aren't using GCC.
3077e5383a99Smrg    ac_prog=ld
3078e5383a99Smrg    ;;
3079e5383a99Smrg  *)
3080e5383a99Smrg    # If it is relative, then search for the first ld in PATH.
3081e5383a99Smrg    with_gnu_ld=unknown
3082e5383a99Smrg    ;;
3083e5383a99Smrg  esac
3084e5383a99Smrgelif test "$with_gnu_ld" = yes; then
3085e5383a99Smrg  AC_MSG_CHECKING([for GNU ld])
3086e5383a99Smrgelse
3087e5383a99Smrg  AC_MSG_CHECKING([for non-GNU ld])
3088e5383a99Smrgfi
3089e5383a99SmrgAC_CACHE_VAL(lt_cv_path_LD,
3090e5383a99Smrg[if test -z "$LD"; then
3091e5383a99Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3092e5383a99Smrg  for ac_dir in $PATH; do
3093e5383a99Smrg    IFS="$lt_save_ifs"
3094e5383a99Smrg    test -z "$ac_dir" && ac_dir=.
3095e5383a99Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3096e5383a99Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
3097e5383a99Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
3098e5383a99Smrg      # but apparently some variants of GNU ld only accept -v.
3099e5383a99Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
3100e5383a99Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
3101e5383a99Smrg      *GNU* | *'with BFD'*)
3102e5383a99Smrg	test "$with_gnu_ld" != no && break
3103af9a7ee5Smrg	;;
3104af9a7ee5Smrg      *)
3105e5383a99Smrg	test "$with_gnu_ld" != yes && break
3106af9a7ee5Smrg	;;
3107af9a7ee5Smrg      esac
3108e5383a99Smrg    fi
3109e5383a99Smrg  done
3110e5383a99Smrg  IFS="$lt_save_ifs"
3111e5383a99Smrgelse
3112e5383a99Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
3113e5383a99Smrgfi])
3114e5383a99SmrgLD="$lt_cv_path_LD"
3115e5383a99Smrgif test -n "$LD"; then
3116e5383a99Smrg  AC_MSG_RESULT($LD)
3117e5383a99Smrgelse
3118e5383a99Smrg  AC_MSG_RESULT(no)
3119e5383a99Smrgfi
3120e5383a99Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3121e5383a99Smrg_LT_PATH_LD_GNU
3122e5383a99SmrgAC_SUBST([LD])
3123caade7ccSmrg
3124e5383a99Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
3125e5383a99Smrg])# LT_PATH_LD
3126caade7ccSmrg
3127e5383a99Smrg# Old names:
3128e5383a99SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
3129e5383a99SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
3130e5383a99Smrgdnl aclocal-1.4 backwards compatibility:
3131e5383a99Smrgdnl AC_DEFUN([AM_PROG_LD], [])
3132e5383a99Smrgdnl AC_DEFUN([AC_PROG_LD], [])
3133caade7ccSmrg
3134caade7ccSmrg
3135e5383a99Smrg# _LT_PATH_LD_GNU
3136e5383a99Smrg#- --------------
3137e5383a99Smrgm4_defun([_LT_PATH_LD_GNU],
3138e5383a99Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3139e5383a99Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
3140e5383a99Smrgcase `$LD -v 2>&1 </dev/null` in
3141e5383a99Smrg*GNU* | *'with BFD'*)
3142e5383a99Smrg  lt_cv_prog_gnu_ld=yes
3143af9a7ee5Smrg  ;;
3144e5383a99Smrg*)
3145e5383a99Smrg  lt_cv_prog_gnu_ld=no
3146af9a7ee5Smrg  ;;
3147e5383a99Smrgesac])
3148e5383a99Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
3149e5383a99Smrg])# _LT_PATH_LD_GNU
3150caade7ccSmrg
3151b9b4fd27Smrg
3152e5383a99Smrg# _LT_CMD_RELOAD
3153e5383a99Smrg# --------------
3154e5383a99Smrg# find reload flag for linker
3155e5383a99Smrg#   -- PORTME Some linkers may need a different reload flag.
3156e5383a99Smrgm4_defun([_LT_CMD_RELOAD],
3157e5383a99Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
3158e5383a99Smrg  lt_cv_ld_reload_flag,
3159e5383a99Smrg  [lt_cv_ld_reload_flag='-r'])
3160e5383a99Smrgreload_flag=$lt_cv_ld_reload_flag
3161e5383a99Smrgcase $reload_flag in
3162e5383a99Smrg"" | " "*) ;;
3163e5383a99Smrg*) reload_flag=" $reload_flag" ;;
3164af9a7ee5Smrgesac
3165e5383a99Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
3166e5383a99Smrgcase $host_os in
3167e5383a99Smrg  cygwin* | mingw* | pw32* | cegcc*)
3168e5383a99Smrg    if test "$GCC" != yes; then
3169e5383a99Smrg      reload_cmds=false
3170e5383a99Smrg    fi
3171e5383a99Smrg    ;;
3172e5383a99Smrg  darwin*)
3173e5383a99Smrg    if test "$GCC" = yes; then
3174e5383a99Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
3175e5383a99Smrg    else
3176e5383a99Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
3177e5383a99Smrg    fi
3178e5383a99Smrg    ;;
3179e5383a99Smrgesac
3180e5383a99Smrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
3181e5383a99Smrg_LT_TAGDECL([], [reload_cmds], [2])dnl
3182e5383a99Smrg])# _LT_CMD_RELOAD
3183af9a7ee5Smrg
3184caade7ccSmrg
3185e5383a99Smrg# _LT_CHECK_MAGIC_METHOD
3186e5383a99Smrg# ----------------------
3187e5383a99Smrg# how to check for library dependencies
3188e5383a99Smrg#  -- PORTME fill in with the dynamic library characteristics
3189e5383a99Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
3190e5383a99Smrg[m4_require([_LT_DECL_EGREP])
3191e5383a99Smrgm4_require([_LT_DECL_OBJDUMP])
3192e5383a99SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
3193e5383a99Smrglt_cv_deplibs_check_method,
3194e5383a99Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
3195e5383a99Smrglt_cv_file_magic_test_file=
3196e5383a99Smrglt_cv_deplibs_check_method='unknown'
3197e5383a99Smrg# Need to set the preceding variable on all platforms that support
3198e5383a99Smrg# interlibrary dependencies.
3199e5383a99Smrg# 'none' -- dependencies not supported.
3200e5383a99Smrg# `unknown' -- same as none, but documents that we really don't know.
3201e5383a99Smrg# 'pass_all' -- all dependencies passed with no checks.
3202e5383a99Smrg# 'test_compile' -- check by making test program.
3203e5383a99Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
3204e5383a99Smrg# which responds to the $file_magic_cmd with a given extended regex.
3205e5383a99Smrg# If you have `file' or equivalent on your system and you're not sure
3206e5383a99Smrg# whether `pass_all' will *always* work, you probably want this one.
3207caade7ccSmrg
3208e5383a99Smrgcase $host_os in
3209e5383a99Smrgaix[[4-9]]*)
3210e5383a99Smrg  lt_cv_deplibs_check_method=pass_all
3211e5383a99Smrg  ;;
3212caade7ccSmrg
3213e5383a99Smrgbeos*)
3214e5383a99Smrg  lt_cv_deplibs_check_method=pass_all
3215e5383a99Smrg  ;;
3216caade7ccSmrg
3217e5383a99Smrgbsdi[[45]]*)
3218e5383a99Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3219e5383a99Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
3220e5383a99Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
3221caade7ccSmrg  ;;
3222caade7ccSmrg
3223e5383a99Smrgcygwin*)
3224e5383a99Smrg  # func_win32_libid is a shell function defined in ltmain.sh
3225e5383a99Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3226e5383a99Smrg  lt_cv_file_magic_cmd='func_win32_libid'
3227e5383a99Smrg  ;;
3228af9a7ee5Smrg
3229e5383a99Smrgmingw* | pw32*)
3230e5383a99Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
3231e5383a99Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
3232e5383a99Smrg  # unless we find 'file', for example because we are cross-compiling.
3233e5383a99Smrg  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
3234e5383a99Smrg  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
3235e5383a99Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3236e5383a99Smrg    lt_cv_file_magic_cmd='func_win32_libid'
3237e5383a99Smrg  else
3238e5383a99Smrg    # Keep this pattern in sync with the one in func_win32_libid.
3239e5383a99Smrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
3240e5383a99Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
3241e5383a99Smrg  fi
3242caade7ccSmrg  ;;
3243caade7ccSmrg
3244e5383a99Smrgcegcc*)
3245e5383a99Smrg  # use the weaker test based on 'objdump'. See mingw*.
3246e5383a99Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3247e5383a99Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
3248e5383a99Smrg  ;;
3249caade7ccSmrg
3250e5383a99Smrgdarwin* | rhapsody*)
3251e5383a99Smrg  lt_cv_deplibs_check_method=pass_all
3252e5383a99Smrg  ;;
3253caade7ccSmrg
3254e5383a99Smrgfreebsd* | dragonfly*)
3255e5383a99Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3256e5383a99Smrg    case $host_cpu in
3257e5383a99Smrg    i*86 )
3258e5383a99Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
3259e5383a99Smrg      # Let's accept both of them until this is cleared up.
3260e5383a99Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3261e5383a99Smrg      lt_cv_file_magic_cmd=/usr/bin/file
3262e5383a99Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3263e5383a99Smrg      ;;
3264e5383a99Smrg    esac
3265af9a7ee5Smrg  else
3266e5383a99Smrg    lt_cv_deplibs_check_method=pass_all
3267af9a7ee5Smrg  fi
3268e5383a99Smrg  ;;
3269caade7ccSmrg
3270e5383a99Smrggnu*)
3271e5383a99Smrg  lt_cv_deplibs_check_method=pass_all
3272e5383a99Smrg  ;;
3273caade7ccSmrg
3274e8a5466aSmrghaiku*)
3275af9a7ee5Smrg  lt_cv_deplibs_check_method=pass_all
3276e8a5466aSmrg  ;;
3277e8a5466aSmrg
3278af9a7ee5Smrghpux10.20* | hpux11*)
3279af9a7ee5Smrg  lt_cv_file_magic_cmd=/usr/bin/file
3280b9b4fd27Smrg  case $host_cpu in
3281b9b4fd27Smrg  ia64*)
3282af9a7ee5Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3283af9a7ee5Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3284b9b4fd27Smrg    ;;
3285b9b4fd27Smrg  hppa*64*)
3286af9a7ee5Smrg    [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]']
3287af9a7ee5Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3288b9b4fd27Smrg    ;;
3289b9b4fd27Smrg  *)
3290af9a7ee5Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
3291af9a7ee5Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3292b9b4fd27Smrg    ;;
3293b9b4fd27Smrg  esac
3294caade7ccSmrg  ;;
3295caade7ccSmrg
3296b9b4fd27Smrginterix[[3-9]]*)
3297af9a7ee5Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3298af9a7ee5Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3299b9b4fd27Smrg  ;;
3300caade7ccSmrg
3301b9b4fd27Smrgirix5* | irix6* | nonstopux*)
3302af9a7ee5Smrg  case $LD in
3303af9a7ee5Smrg  *-32|*"-32 ") libmagic=32-bit;;
3304af9a7ee5Smrg  *-n32|*"-n32 ") libmagic=N32;;
3305af9a7ee5Smrg  *-64|*"-64 ") libmagic=64-bit;;
3306af9a7ee5Smrg  *) libmagic=never-match;;
3307b9b4fd27Smrg  esac
3308af9a7ee5Smrg  lt_cv_deplibs_check_method=pass_all
3309b9b4fd27Smrg  ;;
3310caade7ccSmrg
3311af9a7ee5Smrg# This must be glibc/ELF.
3312af9a7ee5Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
3313af9a7ee5Smrg  lt_cv_deplibs_check_method=pass_all
3314b9b4fd27Smrg  ;;
3315caade7ccSmrg
3316af9a7ee5Smrgnetbsd*)
3317af9a7ee5Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3318af9a7ee5Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3319af9a7ee5Smrg  else
3320af9a7ee5Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3321af9a7ee5Smrg  fi
3322af9a7ee5Smrg  ;;
3323e8a5466aSmrg
3324af9a7ee5Smrgnewos6*)
3325af9a7ee5Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3326af9a7ee5Smrg  lt_cv_file_magic_cmd=/usr/bin/file
3327af9a7ee5Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3328b9b4fd27Smrg  ;;
3329caade7ccSmrg
3330b9b4fd27Smrg*nto* | *qnx*)
3331af9a7ee5Smrg  lt_cv_deplibs_check_method=pass_all
3332b9b4fd27Smrg  ;;
3333caade7ccSmrg
3334b9b4fd27Smrgopenbsd*)
3335b9b4fd27Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3336af9a7ee5Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3337b9b4fd27Smrg  else
3338af9a7ee5Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3339b9b4fd27Smrg  fi
3340b9b4fd27Smrg  ;;
3341caade7ccSmrg
3342b9b4fd27Smrgosf3* | osf4* | osf5*)
3343af9a7ee5Smrg  lt_cv_deplibs_check_method=pass_all
3344b9b4fd27Smrg  ;;
3345caade7ccSmrg
3346b9b4fd27Smrgrdos*)
3347af9a7ee5Smrg  lt_cv_deplibs_check_method=pass_all
3348b9b4fd27Smrg  ;;
3349caade7ccSmrg
3350b9b4fd27Smrgsolaris*)
3351af9a7ee5Smrg  lt_cv_deplibs_check_method=pass_all
3352b9b4fd27Smrg  ;;
3353caade7ccSmrg
3354af9a7ee5Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3355af9a7ee5Smrg  lt_cv_deplibs_check_method=pass_all
3356b9b4fd27Smrg  ;;
3357caade7ccSmrg
3358b9b4fd27Smrgsysv4 | sysv4.3*)
3359b9b4fd27Smrg  case $host_vendor in
3360af9a7ee5Smrg  motorola)
3361af9a7ee5Smrg    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]]'
3362af9a7ee5Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3363af9a7ee5Smrg    ;;
3364af9a7ee5Smrg  ncr)
3365af9a7ee5Smrg    lt_cv_deplibs_check_method=pass_all
3366af9a7ee5Smrg    ;;
3367af9a7ee5Smrg  sequent)
3368af9a7ee5Smrg    lt_cv_file_magic_cmd='/bin/file'
3369af9a7ee5Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3370af9a7ee5Smrg    ;;
3371af9a7ee5Smrg  sni)
3372af9a7ee5Smrg    lt_cv_file_magic_cmd='/bin/file'
3373af9a7ee5Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3374af9a7ee5Smrg    lt_cv_file_magic_test_file=/lib/libc.so
3375af9a7ee5Smrg    ;;
3376af9a7ee5Smrg  siemens)
3377af9a7ee5Smrg    lt_cv_deplibs_check_method=pass_all
3378af9a7ee5Smrg    ;;
3379af9a7ee5Smrg  pc)
3380af9a7ee5Smrg    lt_cv_deplibs_check_method=pass_all
3381af9a7ee5Smrg    ;;
3382b9b4fd27Smrg  esac
3383b9b4fd27Smrg  ;;
3384caade7ccSmrg
3385b9b4fd27Smrgtpf*)
3386af9a7ee5Smrg  lt_cv_deplibs_check_method=pass_all
3387b9b4fd27Smrg  ;;
3388b9b4fd27Smrgesac
3389af9a7ee5Smrg])
3390b9b4fd27Smrg
3391af9a7ee5Smrgfile_magic_glob=
3392af9a7ee5Smrgwant_nocaseglob=no
3393af9a7ee5Smrgif test "$build" = "$host"; then
3394af9a7ee5Smrg  case $host_os in
3395af9a7ee5Smrg  mingw* | pw32*)
3396af9a7ee5Smrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
3397af9a7ee5Smrg      want_nocaseglob=yes
3398af9a7ee5Smrg    else
3399af9a7ee5Smrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
3400af9a7ee5Smrg    fi
3401af9a7ee5Smrg    ;;
3402af9a7ee5Smrg  esac
3403b9b4fd27Smrgfi
3404caade7ccSmrg
3405af9a7ee5Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
3406af9a7ee5Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
3407af9a7ee5Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
3408caade7ccSmrg
3409af9a7ee5Smrg_LT_DECL([], [deplibs_check_method], [1],
3410af9a7ee5Smrg    [Method to check whether dependent libraries are shared objects])
3411af9a7ee5Smrg_LT_DECL([], [file_magic_cmd], [1],
3412af9a7ee5Smrg    [Command to use when deplibs_check_method = "file_magic"])
3413af9a7ee5Smrg_LT_DECL([], [file_magic_glob], [1],
3414af9a7ee5Smrg    [How to find potential files when deplibs_check_method = "file_magic"])
3415af9a7ee5Smrg_LT_DECL([], [want_nocaseglob], [1],
3416af9a7ee5Smrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
3417af9a7ee5Smrg])# _LT_CHECK_MAGIC_METHOD
3418caade7ccSmrg
3419caade7ccSmrg
3420af9a7ee5Smrg# LT_PATH_NM
3421af9a7ee5Smrg# ----------
3422af9a7ee5Smrg# find the pathname to a BSD- or MS-compatible name lister
3423af9a7ee5SmrgAC_DEFUN([LT_PATH_NM],
3424af9a7ee5Smrg[AC_REQUIRE([AC_PROG_CC])dnl
3425af9a7ee5SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3426af9a7ee5Smrg[if test -n "$NM"; then
3427af9a7ee5Smrg  # Let the user override the test.
3428af9a7ee5Smrg  lt_cv_path_NM="$NM"
3429af9a7ee5Smrgelse
3430af9a7ee5Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
3431af9a7ee5Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3432af9a7ee5Smrg    lt_nm_to_check="$lt_nm_to_check nm"
3433af9a7ee5Smrg  fi
3434af9a7ee5Smrg  for lt_tmp_nm in $lt_nm_to_check; do
3435af9a7ee5Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3436af9a7ee5Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3437af9a7ee5Smrg      IFS="$lt_save_ifs"
3438af9a7ee5Smrg      test -z "$ac_dir" && ac_dir=.
3439af9a7ee5Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
3440af9a7ee5Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
3441af9a7ee5Smrg	# Check to see if the nm accepts a BSD-compat flag.
3442af9a7ee5Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
3443af9a7ee5Smrg	#   nm: unknown option "B" ignored
3444af9a7ee5Smrg	# Tru64's nm complains that /dev/null is an invalid object file
3445af9a7ee5Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
3446af9a7ee5Smrg	*/dev/null* | *'Invalid file or object type'*)
3447af9a7ee5Smrg	  lt_cv_path_NM="$tmp_nm -B"
3448af9a7ee5Smrg	  break
3449af9a7ee5Smrg	  ;;
3450af9a7ee5Smrg	*)
3451af9a7ee5Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3452af9a7ee5Smrg	  */dev/null*)
3453af9a7ee5Smrg	    lt_cv_path_NM="$tmp_nm -p"
3454af9a7ee5Smrg	    break
3455af9a7ee5Smrg	    ;;
3456af9a7ee5Smrg	  *)
3457af9a7ee5Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3458af9a7ee5Smrg	    continue # so that we can try to find one that supports BSD flags
3459af9a7ee5Smrg	    ;;
3460af9a7ee5Smrg	  esac
3461af9a7ee5Smrg	  ;;
3462b9b4fd27Smrg	esac
3463b9b4fd27Smrg      fi
3464af9a7ee5Smrg    done
3465af9a7ee5Smrg    IFS="$lt_save_ifs"
3466b9b4fd27Smrg  done
3467af9a7ee5Smrg  : ${lt_cv_path_NM=no}
3468af9a7ee5Smrgfi])
3469af9a7ee5Smrgif test "$lt_cv_path_NM" != "no"; then
3470af9a7ee5Smrg  NM="$lt_cv_path_NM"
3471b9b4fd27Smrgelse
3472af9a7ee5Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
3473af9a7ee5Smrg  if test -n "$DUMPBIN"; then :
3474af9a7ee5Smrg    # Let the user override the test.
3475b9b4fd27Smrg  else
3476af9a7ee5Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
3477af9a7ee5Smrg    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
3478af9a7ee5Smrg    *COFF*)
3479af9a7ee5Smrg      DUMPBIN="$DUMPBIN -symbols"
3480af9a7ee5Smrg      ;;
3481af9a7ee5Smrg    *)
3482af9a7ee5Smrg      DUMPBIN=:
3483af9a7ee5Smrg      ;;
3484af9a7ee5Smrg    esac
3485af9a7ee5Smrg  fi
3486af9a7ee5Smrg  AC_SUBST([DUMPBIN])
3487af9a7ee5Smrg  if test "$DUMPBIN" != ":"; then
3488af9a7ee5Smrg    NM="$DUMPBIN"
3489b9b4fd27Smrg  fi
3490b9b4fd27Smrgfi
3491af9a7ee5Smrgtest -z "$NM" && NM=nm
3492af9a7ee5SmrgAC_SUBST([NM])
3493af9a7ee5Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3494caade7ccSmrg
3495af9a7ee5SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3496af9a7ee5Smrg  [lt_cv_nm_interface="BSD nm"
3497af9a7ee5Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
3498af9a7ee5Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3499af9a7ee5Smrg  (eval "$ac_compile" 2>conftest.err)
3500af9a7ee5Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3501af9a7ee5Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3502af9a7ee5Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3503af9a7ee5Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3504af9a7ee5Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
3505af9a7ee5Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
3506af9a7ee5Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3507af9a7ee5Smrg    lt_cv_nm_interface="MS dumpbin"
3508af9a7ee5Smrg  fi
3509af9a7ee5Smrg  rm -f conftest*])
3510af9a7ee5Smrg])# LT_PATH_NM
3511caade7ccSmrg
3512af9a7ee5Smrg# Old names:
3513af9a7ee5SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3514af9a7ee5SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3515af9a7ee5Smrgdnl aclocal-1.4 backwards compatibility:
3516af9a7ee5Smrgdnl AC_DEFUN([AM_PROG_NM], [])
3517af9a7ee5Smrgdnl AC_DEFUN([AC_PROG_NM], [])
3518caade7ccSmrg
3519af9a7ee5Smrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3520af9a7ee5Smrg# --------------------------------
3521af9a7ee5Smrg# how to determine the name of the shared library
3522af9a7ee5Smrg# associated with a specific link library.
3523af9a7ee5Smrg#  -- PORTME fill in with the dynamic library characteristics
3524af9a7ee5Smrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
3525af9a7ee5Smrg[m4_require([_LT_DECL_EGREP])
3526af9a7ee5Smrgm4_require([_LT_DECL_OBJDUMP])
3527af9a7ee5Smrgm4_require([_LT_DECL_DLLTOOL])
3528af9a7ee5SmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
3529af9a7ee5Smrglt_cv_sharedlib_from_linklib_cmd,
3530af9a7ee5Smrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
3531b9b4fd27Smrg
3532af9a7ee5Smrgcase $host_os in
3533af9a7ee5Smrgcygwin* | mingw* | pw32* | cegcc*)
3534af9a7ee5Smrg  # two different shell functions defined in ltmain.sh
3535af9a7ee5Smrg  # decide which to use based on capabilities of $DLLTOOL
3536af9a7ee5Smrg  case `$DLLTOOL --help 2>&1` in
3537af9a7ee5Smrg  *--identify-strict*)
3538af9a7ee5Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
3539af9a7ee5Smrg    ;;
3540b9b4fd27Smrg  *)
3541af9a7ee5Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
3542af9a7ee5Smrg    ;;
3543b9b4fd27Smrg  esac
3544b9b4fd27Smrg  ;;
3545b9b4fd27Smrg*)
3546af9a7ee5Smrg  # fallback: assume linklib IS sharedlib
3547af9a7ee5Smrg  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
3548b9b4fd27Smrg  ;;
3549b9b4fd27Smrgesac
3550af9a7ee5Smrg])
3551af9a7ee5Smrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
3552af9a7ee5Smrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3553caade7ccSmrg
3554af9a7ee5Smrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
3555af9a7ee5Smrg    [Command to associate shared and link libraries])
3556af9a7ee5Smrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3557caade7ccSmrg
3558af9a7ee5Smrg
3559af9a7ee5Smrg# _LT_PATH_MANIFEST_TOOL
3560b9b4fd27Smrg# ----------------------
3561af9a7ee5Smrg# locate the manifest tool
3562af9a7ee5Smrgm4_defun([_LT_PATH_MANIFEST_TOOL],
3563af9a7ee5Smrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
3564af9a7ee5Smrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
3565af9a7ee5SmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
3566af9a7ee5Smrg  [lt_cv_path_mainfest_tool=no
3567af9a7ee5Smrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
3568af9a7ee5Smrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
3569af9a7ee5Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3570af9a7ee5Smrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
3571af9a7ee5Smrg    lt_cv_path_mainfest_tool=yes
3572af9a7ee5Smrg  fi
3573af9a7ee5Smrg  rm -f conftest*])
3574af9a7ee5Smrgif test "x$lt_cv_path_mainfest_tool" != xyes; then
3575af9a7ee5Smrg  MANIFEST_TOOL=:
3576af9a7ee5Smrgfi
3577af9a7ee5Smrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
3578af9a7ee5Smrg])# _LT_PATH_MANIFEST_TOOL
3579caade7ccSmrg
3580caade7ccSmrg
3581af9a7ee5Smrg# LT_LIB_M
3582af9a7ee5Smrg# --------
3583af9a7ee5Smrg# check for math library
3584af9a7ee5SmrgAC_DEFUN([LT_LIB_M],
3585af9a7ee5Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3586af9a7ee5SmrgLIBM=
3587af9a7ee5Smrgcase $host in
3588af9a7ee5Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
3589af9a7ee5Smrg  # These system don't have libm, or don't need it
3590b9b4fd27Smrg  ;;
3591af9a7ee5Smrg*-ncr-sysv4.3*)
3592af9a7ee5Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3593af9a7ee5Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3594b9b4fd27Smrg  ;;
3595af9a7ee5Smrg*)
3596af9a7ee5Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
3597b9b4fd27Smrg  ;;
3598af9a7ee5Smrgesac
3599af9a7ee5SmrgAC_SUBST([LIBM])
3600af9a7ee5Smrg])# LT_LIB_M
3601caade7ccSmrg
3602af9a7ee5Smrg# Old name:
3603af9a7ee5SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3604af9a7ee5Smrgdnl aclocal-1.4 backwards compatibility:
3605af9a7ee5Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3606caade7ccSmrg
3607caade7ccSmrg
3608af9a7ee5Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
3609af9a7ee5Smrg# -------------------------------
3610af9a7ee5Smrgm4_defun([_LT_COMPILER_NO_RTTI],
3611af9a7ee5Smrg[m4_require([_LT_TAG_COMPILER])dnl
3612caade7ccSmrg
3613af9a7ee5Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3614caade7ccSmrg
3615af9a7ee5Smrgif test "$GCC" = yes; then
3616af9a7ee5Smrg  case $cc_basename in
3617af9a7ee5Smrg  nvcc*)
3618af9a7ee5Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
3619af9a7ee5Smrg  *)
3620af9a7ee5Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
3621af9a7ee5Smrg  esac
3622caade7ccSmrg
3623af9a7ee5Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3624af9a7ee5Smrg    lt_cv_prog_compiler_rtti_exceptions,
3625af9a7ee5Smrg    [-fno-rtti -fno-exceptions], [],
3626af9a7ee5Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3627af9a7ee5Smrgfi
3628af9a7ee5Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3629af9a7ee5Smrg	[Compiler flag to turn off builtin functions])
3630af9a7ee5Smrg])# _LT_COMPILER_NO_RTTI
3631e8a5466aSmrg
3632caade7ccSmrg
3633af9a7ee5Smrg# _LT_CMD_GLOBAL_SYMBOLS
3634af9a7ee5Smrg# ----------------------
3635af9a7ee5Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3636af9a7ee5Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3637af9a7ee5SmrgAC_REQUIRE([AC_PROG_CC])dnl
3638af9a7ee5SmrgAC_REQUIRE([AC_PROG_AWK])dnl
3639af9a7ee5SmrgAC_REQUIRE([LT_PATH_NM])dnl
3640af9a7ee5SmrgAC_REQUIRE([LT_PATH_LD])dnl
3641af9a7ee5Smrgm4_require([_LT_DECL_SED])dnl
3642af9a7ee5Smrgm4_require([_LT_DECL_EGREP])dnl
3643af9a7ee5Smrgm4_require([_LT_TAG_COMPILER])dnl
3644caade7ccSmrg
3645af9a7ee5Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
3646af9a7ee5SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
3647af9a7ee5SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3648af9a7ee5Smrg[
3649af9a7ee5Smrg# These are sane defaults that work on at least a few old systems.
3650af9a7ee5Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3651caade7ccSmrg
3652af9a7ee5Smrg# Character class describing NM global symbol codes.
3653af9a7ee5Smrgsymcode='[[BCDEGRST]]'
3654caade7ccSmrg
3655af9a7ee5Smrg# Regexp to match symbols that can be accessed directly from C.
3656af9a7ee5Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3657caade7ccSmrg
3658af9a7ee5Smrg# Define system-specific variables.
3659af9a7ee5Smrgcase $host_os in
3660af9a7ee5Smrgaix*)
3661af9a7ee5Smrg  symcode='[[BCDT]]'
3662b9b4fd27Smrg  ;;
3663af9a7ee5Smrgcygwin* | mingw* | pw32* | cegcc*)
3664af9a7ee5Smrg  symcode='[[ABCDGISTW]]'
3665b9b4fd27Smrg  ;;
3666af9a7ee5Smrghpux*)
3667af9a7ee5Smrg  if test "$host_cpu" = ia64; then
3668af9a7ee5Smrg    symcode='[[ABCDEGRST]]'
3669b9b4fd27Smrg  fi
3670b9b4fd27Smrg  ;;
3671af9a7ee5Smrgirix* | nonstopux*)
3672af9a7ee5Smrg  symcode='[[BCDEGRST]]'
3673b9b4fd27Smrg  ;;
3674af9a7ee5Smrgosf*)
3675af9a7ee5Smrg  symcode='[[BCDEGQRST]]'
3676b9b4fd27Smrg  ;;
3677b9b4fd27Smrgsolaris*)
3678af9a7ee5Smrg  symcode='[[BDRT]]'
3679b9b4fd27Smrg  ;;
3680af9a7ee5Smrgsco3.2v5*)
3681af9a7ee5Smrg  symcode='[[DT]]'
3682b9b4fd27Smrg  ;;
3683af9a7ee5Smrgsysv4.2uw2*)
3684af9a7ee5Smrg  symcode='[[DT]]'
3685b9b4fd27Smrg  ;;
3686af9a7ee5Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
3687af9a7ee5Smrg  symcode='[[ABDT]]'
3688af9a7ee5Smrg  ;;
3689af9a7ee5Smrgsysv4)
3690af9a7ee5Smrg  symcode='[[DFNSTU]]'
3691b9b4fd27Smrg  ;;
3692caade7ccSmrgesac
3693a5602400Smrg
3694af9a7ee5Smrg# If we're using GNU nm, then use its standard symbol codes.
3695af9a7ee5Smrgcase `$NM -V 2>&1` in
3696af9a7ee5Smrg*GNU* | *'with BFD'*)
3697af9a7ee5Smrg  symcode='[[ABCDGIRSTW]]' ;;
3698af9a7ee5Smrgesac
3699a5602400Smrg
3700af9a7ee5Smrg# Transform an extracted symbol line into a proper C declaration.
3701af9a7ee5Smrg# Some systems (esp. on ia64) link data and code symbols differently,
3702af9a7ee5Smrg# so use this general approach.
3703af9a7ee5Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3704caade7ccSmrg
3705af9a7ee5Smrg# Transform an extracted symbol line into symbol name and symbol address
3706af9a7ee5Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
3707af9a7ee5Smrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
3708caade7ccSmrg
3709af9a7ee5Smrg# Handle CRLF in mingw tool chain
3710af9a7ee5Smrgopt_cr=
3711af9a7ee5Smrgcase $build_os in
3712af9a7ee5Smrgmingw*)
3713af9a7ee5Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
3714af9a7ee5Smrg  ;;
3715af9a7ee5Smrgesac
3716caade7ccSmrg
3717af9a7ee5Smrg# Try without a prefix underscore, then with it.
3718af9a7ee5Smrgfor ac_symprfx in "" "_"; do
3719af9a7ee5Smrg
3720af9a7ee5Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
3721af9a7ee5Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
3722af9a7ee5Smrg
3723af9a7ee5Smrg  # Write the raw and C identifiers.
3724af9a7ee5Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3725af9a7ee5Smrg    # Fake it for dumpbin and say T for any non-static function
3726af9a7ee5Smrg    # and D for any global variable.
3727af9a7ee5Smrg    # Also find C++ and __fastcall symbols from MSVC++,
3728af9a7ee5Smrg    # which start with @ or ?.
3729af9a7ee5Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
3730af9a7ee5Smrg"     {last_section=section; section=\$ 3};"\
3731af9a7ee5Smrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
3732af9a7ee5Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
3733af9a7ee5Smrg"     \$ 0!~/External *\|/{next};"\
3734af9a7ee5Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
3735af9a7ee5Smrg"     {if(hide[section]) next};"\
3736af9a7ee5Smrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
3737af9a7ee5Smrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
3738af9a7ee5Smrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
3739af9a7ee5Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
3740af9a7ee5Smrg"     ' prfx=^$ac_symprfx]"
3741af9a7ee5Smrg  else
3742af9a7ee5Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
3743b9b4fd27Smrg  fi
3744af9a7ee5Smrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
3745caade7ccSmrg
3746af9a7ee5Smrg  # Check to see that the pipe works correctly.
3747af9a7ee5Smrg  pipe_works=no
3748caade7ccSmrg
3749af9a7ee5Smrg  rm -f conftest*
3750af9a7ee5Smrg  cat > conftest.$ac_ext <<_LT_EOF
3751af9a7ee5Smrg#ifdef __cplusplus
3752af9a7ee5Smrgextern "C" {
3753af9a7ee5Smrg#endif
3754af9a7ee5Smrgchar nm_test_var;
3755af9a7ee5Smrgvoid nm_test_func(void);
3756af9a7ee5Smrgvoid nm_test_func(void){}
3757af9a7ee5Smrg#ifdef __cplusplus
3758af9a7ee5Smrg}
3759af9a7ee5Smrg#endif
3760af9a7ee5Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
3761af9a7ee5Smrg_LT_EOF
3762a5602400Smrg
3763af9a7ee5Smrg  if AC_TRY_EVAL(ac_compile); then
3764af9a7ee5Smrg    # Now try to grab the symbols.
3765af9a7ee5Smrg    nlist=conftest.nm
3766af9a7ee5Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
3767af9a7ee5Smrg      # Try sorting and uniquifying the output.
3768af9a7ee5Smrg      if sort "$nlist" | uniq > "$nlist"T; then
3769af9a7ee5Smrg	mv -f "$nlist"T "$nlist"
3770af9a7ee5Smrg      else
3771af9a7ee5Smrg	rm -f "$nlist"T
3772af9a7ee5Smrg      fi
3773a5602400Smrg
3774af9a7ee5Smrg      # Make sure that we snagged all the symbols we need.
3775af9a7ee5Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
3776af9a7ee5Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
3777af9a7ee5Smrg	  cat <<_LT_EOF > conftest.$ac_ext
3778af9a7ee5Smrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
3779af9a7ee5Smrg#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3780af9a7ee5Smrg/* DATA imports from DLLs on WIN32 con't be const, because runtime
3781af9a7ee5Smrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
3782af9a7ee5Smrg# define LT@&t@_DLSYM_CONST
3783af9a7ee5Smrg#elif defined(__osf__)
3784af9a7ee5Smrg/* This system does not cope well with relocations in const data.  */
3785af9a7ee5Smrg# define LT@&t@_DLSYM_CONST
3786af9a7ee5Smrg#else
3787af9a7ee5Smrg# define LT@&t@_DLSYM_CONST const
3788af9a7ee5Smrg#endif
3789a5602400Smrg
3790af9a7ee5Smrg#ifdef __cplusplus
3791af9a7ee5Smrgextern "C" {
3792af9a7ee5Smrg#endif
3793a5602400Smrg
3794af9a7ee5Smrg_LT_EOF
3795af9a7ee5Smrg	  # Now generate the symbol file.
3796af9a7ee5Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
3797a5602400Smrg
3798af9a7ee5Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
3799caade7ccSmrg
3800af9a7ee5Smrg/* The mapping between symbol names and symbols.  */
3801af9a7ee5SmrgLT@&t@_DLSYM_CONST struct {
3802af9a7ee5Smrg  const char *name;
3803af9a7ee5Smrg  void       *address;
3804af9a7ee5Smrg}
3805af9a7ee5Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
3806af9a7ee5Smrg{
3807af9a7ee5Smrg  { "@PROGRAM@", (void *) 0 },
3808af9a7ee5Smrg_LT_EOF
3809af9a7ee5Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
3810af9a7ee5Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
3811af9a7ee5Smrg  {0, (void *) 0}
3812af9a7ee5Smrg};
3813caade7ccSmrg
3814af9a7ee5Smrg/* This works around a problem in FreeBSD linker */
3815af9a7ee5Smrg#ifdef FREEBSD_WORKAROUND
3816af9a7ee5Smrgstatic const void *lt_preloaded_setup() {
3817af9a7ee5Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
3818af9a7ee5Smrg}
3819af9a7ee5Smrg#endif
3820caade7ccSmrg
3821af9a7ee5Smrg#ifdef __cplusplus
3822af9a7ee5Smrg}
3823af9a7ee5Smrg#endif
3824af9a7ee5Smrg_LT_EOF
3825af9a7ee5Smrg	  # Now try linking the two files.
3826af9a7ee5Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
3827af9a7ee5Smrg	  lt_globsym_save_LIBS=$LIBS
3828af9a7ee5Smrg	  lt_globsym_save_CFLAGS=$CFLAGS
3829af9a7ee5Smrg	  LIBS="conftstm.$ac_objext"
3830af9a7ee5Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
3831af9a7ee5Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
3832af9a7ee5Smrg	    pipe_works=yes
3833af9a7ee5Smrg	  fi
3834af9a7ee5Smrg	  LIBS=$lt_globsym_save_LIBS
3835af9a7ee5Smrg	  CFLAGS=$lt_globsym_save_CFLAGS
3836af9a7ee5Smrg	else
3837af9a7ee5Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
3838af9a7ee5Smrg	fi
3839af9a7ee5Smrg      else
3840af9a7ee5Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
3841af9a7ee5Smrg      fi
3842af9a7ee5Smrg    else
3843af9a7ee5Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
3844af9a7ee5Smrg    fi
3845af9a7ee5Smrg  else
3846af9a7ee5Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
3847af9a7ee5Smrg    cat conftest.$ac_ext >&5
3848af9a7ee5Smrg  fi
3849af9a7ee5Smrg  rm -rf conftest* conftst*
3850caade7ccSmrg
3851af9a7ee5Smrg  # Do not use the global_symbol_pipe unless it works.
3852af9a7ee5Smrg  if test "$pipe_works" = yes; then
3853af9a7ee5Smrg    break
3854af9a7ee5Smrg  else
3855af9a7ee5Smrg    lt_cv_sys_global_symbol_pipe=
3856af9a7ee5Smrg  fi
3857af9a7ee5Smrgdone
3858af9a7ee5Smrg])
3859af9a7ee5Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
3860af9a7ee5Smrg  lt_cv_sys_global_symbol_to_cdecl=
3861af9a7ee5Smrgfi
3862af9a7ee5Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
3863af9a7ee5Smrg  AC_MSG_RESULT(failed)
3864af9a7ee5Smrgelse
3865af9a7ee5Smrg  AC_MSG_RESULT(ok)
3866af9a7ee5Smrgfi
3867caade7ccSmrg
3868af9a7ee5Smrg# Response file support.
3869af9a7ee5Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
3870af9a7ee5Smrg  nm_file_list_spec='@'
3871af9a7ee5Smrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
3872af9a7ee5Smrg  nm_file_list_spec='@'
3873af9a7ee5Smrgfi
3874a5602400Smrg
3875b9b4fd27Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
3876b9b4fd27Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
3877b9b4fd27Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
3878b9b4fd27Smrg    [Transform the output of nm in a proper C declaration])
3879b9b4fd27Smrg_LT_DECL([global_symbol_to_c_name_address],
3880b9b4fd27Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
3881b9b4fd27Smrg    [Transform the output of nm in a C name address pair])
3882b9b4fd27Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
3883b9b4fd27Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
3884b9b4fd27Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
3885a5602400Smrg_LT_DECL([], [nm_file_list_spec], [1],
3886a5602400Smrg    [Specify filename containing input files for $NM])
3887b9b4fd27Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
3888caade7ccSmrg
3889caade7ccSmrg
3890b9b4fd27Smrg# _LT_COMPILER_PIC([TAGNAME])
3891b9b4fd27Smrg# ---------------------------
3892b9b4fd27Smrgm4_defun([_LT_COMPILER_PIC],
3893b9b4fd27Smrg[m4_require([_LT_TAG_COMPILER])dnl
3894b9b4fd27Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
3895b9b4fd27Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
3896b9b4fd27Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
3897caade7ccSmrg
3898b9b4fd27Smrgm4_if([$1], [CXX], [
3899b9b4fd27Smrg  # C++ specific cases for pic, static, wl, etc.
3900b9b4fd27Smrg  if test "$GXX" = yes; then
3901b9b4fd27Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3902b9b4fd27Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3903caade7ccSmrg
3904b9b4fd27Smrg    case $host_os in
3905b9b4fd27Smrg    aix*)
3906b9b4fd27Smrg      # All AIX code is PIC.
3907b9b4fd27Smrg      if test "$host_cpu" = ia64; then
3908b9b4fd27Smrg	# AIX 5 now supports IA64 processor
3909b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3910b9b4fd27Smrg      fi
3911b9b4fd27Smrg      ;;
3912caade7ccSmrg
3913b9b4fd27Smrg    amigaos*)
3914b9b4fd27Smrg      case $host_cpu in
3915b9b4fd27Smrg      powerpc)
3916b9b4fd27Smrg            # see comment about AmigaOS4 .so support
3917b9b4fd27Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3918b9b4fd27Smrg        ;;
3919b9b4fd27Smrg      m68k)
3920b9b4fd27Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
3921b9b4fd27Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
3922b9b4fd27Smrg            # like `-m68040'.
3923b9b4fd27Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3924b9b4fd27Smrg        ;;
3925b9b4fd27Smrg      esac
3926b9b4fd27Smrg      ;;
3927caade7ccSmrg
3928b9b4fd27Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3929b9b4fd27Smrg      # PIC is the default for these OSes.
3930b9b4fd27Smrg      ;;
3931b9b4fd27Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
3932b9b4fd27Smrg      # This hack is so that the source file can tell whether it is being
3933b9b4fd27Smrg      # built for inclusion in a dll (and should export symbols for example).
3934b9b4fd27Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
3935b9b4fd27Smrg      # (--disable-auto-import) libraries
3936b9b4fd27Smrg      m4_if([$1], [GCJ], [],
3937b9b4fd27Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3938b9b4fd27Smrg      ;;
3939b9b4fd27Smrg    darwin* | rhapsody*)
3940b9b4fd27Smrg      # PIC is the default on this platform
3941b9b4fd27Smrg      # Common symbols not allowed in MH_DYLIB files
3942b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3943b9b4fd27Smrg      ;;
3944b9b4fd27Smrg    *djgpp*)
3945b9b4fd27Smrg      # DJGPP does not support shared libraries at all
3946b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3947b9b4fd27Smrg      ;;
3948e8a5466aSmrg    haiku*)
3949e8a5466aSmrg      # PIC is the default for Haiku.
3950e8a5466aSmrg      # The "-static" flag exists, but is broken.
3951e8a5466aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
3952e8a5466aSmrg      ;;
3953b9b4fd27Smrg    interix[[3-9]]*)
3954b9b4fd27Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3955b9b4fd27Smrg      # Instead, we relocate shared libraries at runtime.
3956b9b4fd27Smrg      ;;
3957b9b4fd27Smrg    sysv4*MP*)
3958b9b4fd27Smrg      if test -d /usr/nec; then
3959b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3960b9b4fd27Smrg      fi
3961b9b4fd27Smrg      ;;
3962b9b4fd27Smrg    hpux*)
3963b9b4fd27Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3964b9b4fd27Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
3965b9b4fd27Smrg      # sets the default TLS model and affects inlining.
3966b9b4fd27Smrg      case $host_cpu in
3967b9b4fd27Smrg      hppa*64*)
3968b9b4fd27Smrg	;;
3969b9b4fd27Smrg      *)
3970b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3971b9b4fd27Smrg	;;
3972b9b4fd27Smrg      esac
3973b9b4fd27Smrg      ;;
3974b9b4fd27Smrg    *qnx* | *nto*)
3975b9b4fd27Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
3976b9b4fd27Smrg      # it will coredump.
3977b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3978caade7ccSmrg      ;;
3979caade7ccSmrg    *)
3980b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3981caade7ccSmrg      ;;
3982caade7ccSmrg    esac
3983b9b4fd27Smrg  else
3984b9b4fd27Smrg    case $host_os in
3985b9b4fd27Smrg      aix[[4-9]]*)
3986b9b4fd27Smrg	# All AIX code is PIC.
3987b9b4fd27Smrg	if test "$host_cpu" = ia64; then
3988b9b4fd27Smrg	  # AIX 5 now supports IA64 processor
3989b9b4fd27Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3990b9b4fd27Smrg	else
3991b9b4fd27Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3992b9b4fd27Smrg	fi
3993b9b4fd27Smrg	;;
3994b9b4fd27Smrg      chorus*)
3995b9b4fd27Smrg	case $cc_basename in
3996b9b4fd27Smrg	cxch68*)
3997b9b4fd27Smrg	  # Green Hills C++ Compiler
3998b9b4fd27Smrg	  # _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"
3999b9b4fd27Smrg	  ;;
4000b9b4fd27Smrg	esac
4001b9b4fd27Smrg	;;
4002a5602400Smrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
4003a5602400Smrg	# This hack is so that the source file can tell whether it is being
4004a5602400Smrg	# built for inclusion in a dll (and should export symbols for example).
4005a5602400Smrg	m4_if([$1], [GCJ], [],
4006a5602400Smrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4007a5602400Smrg	;;
4008b9b4fd27Smrg      dgux*)
4009b9b4fd27Smrg	case $cc_basename in
4010b9b4fd27Smrg	  ec++*)
4011b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4012b9b4fd27Smrg	    ;;
4013b9b4fd27Smrg	  ghcx*)
4014b9b4fd27Smrg	    # Green Hills C++ Compiler
4015b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4016b9b4fd27Smrg	    ;;
4017b9b4fd27Smrg	  *)
4018b9b4fd27Smrg	    ;;
4019b9b4fd27Smrg	esac
4020b9b4fd27Smrg	;;
4021b9b4fd27Smrg      freebsd* | dragonfly*)
4022b9b4fd27Smrg	# FreeBSD uses GNU C++
4023b9b4fd27Smrg	;;
4024b9b4fd27Smrg      hpux9* | hpux10* | hpux11*)
4025b9b4fd27Smrg	case $cc_basename in
4026b9b4fd27Smrg	  CC*)
4027b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4028b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4029b9b4fd27Smrg	    if test "$host_cpu" != ia64; then
4030b9b4fd27Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4031b9b4fd27Smrg	    fi
4032b9b4fd27Smrg	    ;;
4033b9b4fd27Smrg	  aCC*)
4034b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4035b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4036b9b4fd27Smrg	    case $host_cpu in
4037b9b4fd27Smrg	    hppa*64*|ia64*)
4038b9b4fd27Smrg	      # +Z the default
4039b9b4fd27Smrg	      ;;
4040b9b4fd27Smrg	    *)
4041b9b4fd27Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4042b9b4fd27Smrg	      ;;
4043b9b4fd27Smrg	    esac
4044b9b4fd27Smrg	    ;;
4045b9b4fd27Smrg	  *)
4046b9b4fd27Smrg	    ;;
4047b9b4fd27Smrg	esac
4048b9b4fd27Smrg	;;
4049b9b4fd27Smrg      interix*)
4050b9b4fd27Smrg	# This is c89, which is MS Visual C++ (no shared libs)
4051b9b4fd27Smrg	# Anyone wants to do a port?
4052b9b4fd27Smrg	;;
4053b9b4fd27Smrg      irix5* | irix6* | nonstopux*)
4054b9b4fd27Smrg	case $cc_basename in
4055b9b4fd27Smrg	  CC*)
4056b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4057b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4058b9b4fd27Smrg	    # CC pic flag -KPIC is the default.
4059b9b4fd27Smrg	    ;;
4060b9b4fd27Smrg	  *)
4061b9b4fd27Smrg	    ;;
4062b9b4fd27Smrg	esac
4063b9b4fd27Smrg	;;
4064e8a5466aSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
4065b9b4fd27Smrg	case $cc_basename in
4066b9b4fd27Smrg	  KCC*)
4067b9b4fd27Smrg	    # KAI C++ Compiler
4068b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4069b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4070b9b4fd27Smrg	    ;;
4071b9b4fd27Smrg	  ecpc* )
4072b9b4fd27Smrg	    # old Intel C++ for x86_64 which still supported -KPIC.
4073b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4074b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4075b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4076b9b4fd27Smrg	    ;;
4077b9b4fd27Smrg	  icpc* )
4078b9b4fd27Smrg	    # Intel C++, used to be incompatible with GCC.
4079b9b4fd27Smrg	    # ICC 10 doesn't accept -KPIC any more.
4080b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4081b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4082b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4083b9b4fd27Smrg	    ;;
4084b9b4fd27Smrg	  pgCC* | pgcpp*)
4085b9b4fd27Smrg	    # Portland Group C++ compiler
4086b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4087b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4088b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4089b9b4fd27Smrg	    ;;
4090b9b4fd27Smrg	  cxx*)
4091b9b4fd27Smrg	    # Compaq C++
4092b9b4fd27Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
4093b9b4fd27Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
4094b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4095b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4096b9b4fd27Smrg	    ;;
4097e8a5466aSmrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
4098e8a5466aSmrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
4099b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4100b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4101b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4102b9b4fd27Smrg	    ;;
4103b9b4fd27Smrg	  *)
4104b9b4fd27Smrg	    case `$CC -V 2>&1 | sed 5q` in
4105b9b4fd27Smrg	    *Sun\ C*)
4106b9b4fd27Smrg	      # Sun C++ 5.9
4107b9b4fd27Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4108b9b4fd27Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4109b9b4fd27Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4110b9b4fd27Smrg	      ;;
4111b9b4fd27Smrg	    esac
4112b9b4fd27Smrg	    ;;
4113b9b4fd27Smrg	esac
4114b9b4fd27Smrg	;;
4115b9b4fd27Smrg      lynxos*)
4116b9b4fd27Smrg	;;
4117b9b4fd27Smrg      m88k*)
4118b9b4fd27Smrg	;;
4119b9b4fd27Smrg      mvs*)
4120b9b4fd27Smrg	case $cc_basename in
4121b9b4fd27Smrg	  cxx*)
4122b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
4123b9b4fd27Smrg	    ;;
4124b9b4fd27Smrg	  *)
4125b9b4fd27Smrg	    ;;
4126b9b4fd27Smrg	esac
4127b9b4fd27Smrg	;;
4128b9b4fd27Smrg      netbsd*)
4129b9b4fd27Smrg	;;
4130b9b4fd27Smrg      *qnx* | *nto*)
4131b9b4fd27Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
4132b9b4fd27Smrg        # it will coredump.
4133b9b4fd27Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4134b9b4fd27Smrg        ;;
4135b9b4fd27Smrg      osf3* | osf4* | osf5*)
4136b9b4fd27Smrg	case $cc_basename in
4137b9b4fd27Smrg	  KCC*)
4138b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4139b9b4fd27Smrg	    ;;
4140b9b4fd27Smrg	  RCC*)
4141b9b4fd27Smrg	    # Rational C++ 2.4.1
4142b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4143b9b4fd27Smrg	    ;;
4144b9b4fd27Smrg	  cxx*)
4145b9b4fd27Smrg	    # Digital/Compaq C++
4146b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4147b9b4fd27Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
4148b9b4fd27Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
4149b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4150b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4151b9b4fd27Smrg	    ;;
4152b9b4fd27Smrg	  *)
4153b9b4fd27Smrg	    ;;
4154b9b4fd27Smrg	esac
4155b9b4fd27Smrg	;;
4156b9b4fd27Smrg      psos*)
4157b9b4fd27Smrg	;;
4158b9b4fd27Smrg      solaris*)
4159b9b4fd27Smrg	case $cc_basename in
4160e8a5466aSmrg	  CC* | sunCC*)
4161b9b4fd27Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
4162b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4163b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4164b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4165b9b4fd27Smrg	    ;;
4166b9b4fd27Smrg	  gcx*)
4167b9b4fd27Smrg	    # Green Hills C++ Compiler
4168b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4169b9b4fd27Smrg	    ;;
4170b9b4fd27Smrg	  *)
4171b9b4fd27Smrg	    ;;
4172b9b4fd27Smrg	esac
4173b9b4fd27Smrg	;;
4174b9b4fd27Smrg      sunos4*)
4175b9b4fd27Smrg	case $cc_basename in
4176b9b4fd27Smrg	  CC*)
4177b9b4fd27Smrg	    # Sun C++ 4.x
4178b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4179b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4180b9b4fd27Smrg	    ;;
4181b9b4fd27Smrg	  lcc*)
4182b9b4fd27Smrg	    # Lucid
4183b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4184b9b4fd27Smrg	    ;;
4185b9b4fd27Smrg	  *)
4186b9b4fd27Smrg	    ;;
4187b9b4fd27Smrg	esac
4188b9b4fd27Smrg	;;
4189b9b4fd27Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4190b9b4fd27Smrg	case $cc_basename in
4191b9b4fd27Smrg	  CC*)
4192b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4193b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4194b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4195b9b4fd27Smrg	    ;;
4196b9b4fd27Smrg	esac
4197b9b4fd27Smrg	;;
4198b9b4fd27Smrg      tandem*)
4199b9b4fd27Smrg	case $cc_basename in
4200b9b4fd27Smrg	  NCC*)
4201b9b4fd27Smrg	    # NonStop-UX NCC 3.20
4202b9b4fd27Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4203b9b4fd27Smrg	    ;;
4204b9b4fd27Smrg	  *)
4205b9b4fd27Smrg	    ;;
4206b9b4fd27Smrg	esac
4207b9b4fd27Smrg	;;
4208b9b4fd27Smrg      vxworks*)
4209b9b4fd27Smrg	;;
4210b9b4fd27Smrg      *)
4211b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4212b9b4fd27Smrg	;;
4213b9b4fd27Smrg    esac
4214b9b4fd27Smrg  fi
4215b9b4fd27Smrg],
4216b9b4fd27Smrg[
4217b9b4fd27Smrg  if test "$GCC" = yes; then
4218b9b4fd27Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4219b9b4fd27Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4220caade7ccSmrg
4221b9b4fd27Smrg    case $host_os in
4222b9b4fd27Smrg      aix*)
4223b9b4fd27Smrg      # All AIX code is PIC.
4224b9b4fd27Smrg      if test "$host_cpu" = ia64; then
4225b9b4fd27Smrg	# AIX 5 now supports IA64 processor
4226b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4227b9b4fd27Smrg      fi
4228b9b4fd27Smrg      ;;
4229caade7ccSmrg
4230b9b4fd27Smrg    amigaos*)
4231b9b4fd27Smrg      case $host_cpu in
4232b9b4fd27Smrg      powerpc)
4233b9b4fd27Smrg            # see comment about AmigaOS4 .so support
4234b9b4fd27Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4235b9b4fd27Smrg        ;;
4236b9b4fd27Smrg      m68k)
4237b9b4fd27Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
4238b9b4fd27Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
4239b9b4fd27Smrg            # like `-m68040'.
4240b9b4fd27Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4241b9b4fd27Smrg        ;;
4242b9b4fd27Smrg      esac
4243b9b4fd27Smrg      ;;
4244caade7ccSmrg
4245b9b4fd27Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4246b9b4fd27Smrg      # PIC is the default for these OSes.
4247b9b4fd27Smrg      ;;
4248caade7ccSmrg
4249b9b4fd27Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
4250b9b4fd27Smrg      # This hack is so that the source file can tell whether it is being
4251b9b4fd27Smrg      # built for inclusion in a dll (and should export symbols for example).
4252b9b4fd27Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4253b9b4fd27Smrg      # (--disable-auto-import) libraries
4254b9b4fd27Smrg      m4_if([$1], [GCJ], [],
4255b9b4fd27Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4256b9b4fd27Smrg      ;;
4257caade7ccSmrg
4258b9b4fd27Smrg    darwin* | rhapsody*)
4259b9b4fd27Smrg      # PIC is the default on this platform
4260b9b4fd27Smrg      # Common symbols not allowed in MH_DYLIB files
4261b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4262b9b4fd27Smrg      ;;
4263caade7ccSmrg
4264e8a5466aSmrg    haiku*)
4265e8a5466aSmrg      # PIC is the default for Haiku.
4266e8a5466aSmrg      # The "-static" flag exists, but is broken.
4267e8a5466aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4268e8a5466aSmrg      ;;
4269e8a5466aSmrg
4270b9b4fd27Smrg    hpux*)
4271b9b4fd27Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4272b9b4fd27Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4273b9b4fd27Smrg      # sets the default TLS model and affects inlining.
4274b9b4fd27Smrg      case $host_cpu in
4275b9b4fd27Smrg      hppa*64*)
4276b9b4fd27Smrg	# +Z the default
4277b9b4fd27Smrg	;;
4278b9b4fd27Smrg      *)
4279b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4280b9b4fd27Smrg	;;
4281b9b4fd27Smrg      esac
4282b9b4fd27Smrg      ;;
4283caade7ccSmrg
4284b9b4fd27Smrg    interix[[3-9]]*)
4285b9b4fd27Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4286b9b4fd27Smrg      # Instead, we relocate shared libraries at runtime.
4287b9b4fd27Smrg      ;;
4288caade7ccSmrg
4289b9b4fd27Smrg    msdosdjgpp*)
4290b9b4fd27Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
4291b9b4fd27Smrg      # on systems that don't support them.
4292b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4293b9b4fd27Smrg      enable_shared=no
4294b9b4fd27Smrg      ;;
4295caade7ccSmrg
4296b9b4fd27Smrg    *nto* | *qnx*)
4297b9b4fd27Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4298b9b4fd27Smrg      # it will coredump.
4299b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4300b9b4fd27Smrg      ;;
4301caade7ccSmrg
4302b9b4fd27Smrg    sysv4*MP*)
4303b9b4fd27Smrg      if test -d /usr/nec; then
4304b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4305b9b4fd27Smrg      fi
4306b9b4fd27Smrg      ;;
4307caade7ccSmrg
4308b9b4fd27Smrg    *)
4309b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4310b9b4fd27Smrg      ;;
4311b9b4fd27Smrg    esac
4312e8a5466aSmrg
4313e8a5466aSmrg    case $cc_basename in
4314e8a5466aSmrg    nvcc*) # Cuda Compiler Driver 2.2
4315e8a5466aSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
4316af9a7ee5Smrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4317af9a7ee5Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
4318af9a7ee5Smrg      fi
4319e8a5466aSmrg      ;;
4320e8a5466aSmrg    esac
4321b9b4fd27Smrg  else
4322b9b4fd27Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
4323b9b4fd27Smrg    case $host_os in
4324b9b4fd27Smrg    aix*)
4325b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4326b9b4fd27Smrg      if test "$host_cpu" = ia64; then
4327b9b4fd27Smrg	# AIX 5 now supports IA64 processor
4328b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4329b9b4fd27Smrg      else
4330b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4331b9b4fd27Smrg      fi
4332b9b4fd27Smrg      ;;
4333caade7ccSmrg
4334b9b4fd27Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
4335b9b4fd27Smrg      # This hack is so that the source file can tell whether it is being
4336b9b4fd27Smrg      # built for inclusion in a dll (and should export symbols for example).
4337b9b4fd27Smrg      m4_if([$1], [GCJ], [],
4338b9b4fd27Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4339b9b4fd27Smrg      ;;
4340caade7ccSmrg
4341b9b4fd27Smrg    hpux9* | hpux10* | hpux11*)
4342b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4343b9b4fd27Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
4344b9b4fd27Smrg      # not for PA HP-UX.
4345b9b4fd27Smrg      case $host_cpu in
4346b9b4fd27Smrg      hppa*64*|ia64*)
4347b9b4fd27Smrg	# +Z the default
4348b9b4fd27Smrg	;;
4349b9b4fd27Smrg      *)
4350b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4351b9b4fd27Smrg	;;
4352b9b4fd27Smrg      esac
4353b9b4fd27Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
4354b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4355b9b4fd27Smrg      ;;
4356caade7ccSmrg
4357b9b4fd27Smrg    irix5* | irix6* | nonstopux*)
4358b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4359b9b4fd27Smrg      # PIC (with -KPIC) is the default.
4360b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4361b9b4fd27Smrg      ;;
4362caade7ccSmrg
4363e8a5466aSmrg    linux* | k*bsd*-gnu | kopensolaris*-gnu)
4364b9b4fd27Smrg      case $cc_basename in
4365b9b4fd27Smrg      # old Intel for x86_64 which still supported -KPIC.
4366b9b4fd27Smrg      ecc*)
4367b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4368b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4369b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4370b9b4fd27Smrg        ;;
4371b9b4fd27Smrg      # icc used to be incompatible with GCC.
4372b9b4fd27Smrg      # ICC 10 doesn't accept -KPIC any more.
4373b9b4fd27Smrg      icc* | ifort*)
4374b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4375b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4376b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4377b9b4fd27Smrg        ;;
4378b9b4fd27Smrg      # Lahey Fortran 8.1.
4379b9b4fd27Smrg      lf95*)
4380b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4381b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4382b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4383b9b4fd27Smrg	;;
4384a5602400Smrg      nagfor*)
4385a5602400Smrg	# NAG Fortran compiler
4386a5602400Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4387a5602400Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4388a5602400Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4389a5602400Smrg	;;
4390e8a5466aSmrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
4391b9b4fd27Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
4392b9b4fd27Smrg	# which looks to be a dead project)
4393b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4394b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4395b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4396b9b4fd27Smrg        ;;
4397b9b4fd27Smrg      ccc*)
4398b9b4fd27Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4399b9b4fd27Smrg        # All Alpha code is PIC.
4400b9b4fd27Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4401b9b4fd27Smrg        ;;
4402e8a5466aSmrg      xl* | bgxl* | bgf* | mpixl*)
4403e8a5466aSmrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
4404b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4405b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4406b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4407b9b4fd27Smrg	;;
4408b9b4fd27Smrg      *)
4409b9b4fd27Smrg	case `$CC -V 2>&1 | sed 5q` in
4410af9a7ee5Smrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
4411e8a5466aSmrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
4412b9b4fd27Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4413b9b4fd27Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4414e8a5466aSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4415b9b4fd27Smrg	  ;;
4416af9a7ee5Smrg	*Sun\ F* | *Sun*Fortran*)
4417af9a7ee5Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4418af9a7ee5Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4419af9a7ee5Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4420af9a7ee5Smrg	  ;;
4421af9a7ee5Smrg	*Sun\ C*)
4422e8a5466aSmrg	  # Sun C 5.9
4423b9b4fd27Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4424b9b4fd27Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4425e8a5466aSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4426b9b4fd27Smrg	  ;;
4427af9a7ee5Smrg        *Intel*\ [[CF]]*Compiler*)
4428af9a7ee5Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4429af9a7ee5Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4430af9a7ee5Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4431af9a7ee5Smrg	  ;;
4432af9a7ee5Smrg	*Portland\ Group*)
4433af9a7ee5Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4434af9a7ee5Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4435af9a7ee5Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4436af9a7ee5Smrg	  ;;
4437b9b4fd27Smrg	esac
4438b9b4fd27Smrg	;;
4439b9b4fd27Smrg      esac
4440b9b4fd27Smrg      ;;
4441caade7ccSmrg
4442b9b4fd27Smrg    newsos6)
4443b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4444b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4445b9b4fd27Smrg      ;;
4446caade7ccSmrg
4447b9b4fd27Smrg    *nto* | *qnx*)
4448b9b4fd27Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4449b9b4fd27Smrg      # it will coredump.
4450b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4451b9b4fd27Smrg      ;;
4452caade7ccSmrg
4453b9b4fd27Smrg    osf3* | osf4* | osf5*)
4454b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4455b9b4fd27Smrg      # All OSF/1 code is PIC.
4456b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4457b9b4fd27Smrg      ;;
4458caade7ccSmrg
4459b9b4fd27Smrg    rdos*)
4460b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4461b9b4fd27Smrg      ;;
4462caade7ccSmrg
4463b9b4fd27Smrg    solaris*)
4464b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4465b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4466b9b4fd27Smrg      case $cc_basename in
4467e8a5466aSmrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
4468b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4469b9b4fd27Smrg      *)
4470b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4471b9b4fd27Smrg      esac
4472b9b4fd27Smrg      ;;
4473caade7ccSmrg
4474b9b4fd27Smrg    sunos4*)
4475b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4476b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4477b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4478b9b4fd27Smrg      ;;
4479caade7ccSmrg
4480b9b4fd27Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
4481b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4482b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4483b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4484b9b4fd27Smrg      ;;
4485caade7ccSmrg
4486b9b4fd27Smrg    sysv4*MP*)
4487b9b4fd27Smrg      if test -d /usr/nec ;then
4488b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4489b9b4fd27Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4490b9b4fd27Smrg      fi
4491b9b4fd27Smrg      ;;
4492caade7ccSmrg
4493b9b4fd27Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4494b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4495b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4496b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4497b9b4fd27Smrg      ;;
4498caade7ccSmrg
4499b9b4fd27Smrg    unicos*)
4500b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4501b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4502b9b4fd27Smrg      ;;
4503caade7ccSmrg
4504b9b4fd27Smrg    uts4*)
4505b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4506b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4507b9b4fd27Smrg      ;;
4508caade7ccSmrg
4509b9b4fd27Smrg    *)
4510b9b4fd27Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4511b9b4fd27Smrg      ;;
4512b9b4fd27Smrg    esac
4513b9b4fd27Smrg  fi
4514b9b4fd27Smrg])
4515b9b4fd27Smrgcase $host_os in
4516b9b4fd27Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
4517b9b4fd27Smrg  *djgpp*)
4518b9b4fd27Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4519b9b4fd27Smrg    ;;
4520b9b4fd27Smrg  *)
4521b9b4fd27Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4522b9b4fd27Smrg    ;;
4523b9b4fd27Smrgesac
4524a5602400Smrg
4525a5602400SmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
4526a5602400Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
4527a5602400Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4528a5602400Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
4529caade7ccSmrg
4530b9b4fd27Smrg#
4531b9b4fd27Smrg# Check to make sure the PIC flag actually works.
4532b9b4fd27Smrg#
4533b9b4fd27Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4534b9b4fd27Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4535b9b4fd27Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4536b9b4fd27Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4537b9b4fd27Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4538b9b4fd27Smrg     "" | " "*) ;;
4539b9b4fd27Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4540b9b4fd27Smrg     esac],
4541b9b4fd27Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4542b9b4fd27Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4543b9b4fd27Smrgfi
4544b9b4fd27Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4545b9b4fd27Smrg	[Additional compiler flags for building library objects])
4546caade7ccSmrg
4547a5602400Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4548a5602400Smrg	[How to pass a linker flag through the compiler])
4549b9b4fd27Smrg#
4550b9b4fd27Smrg# Check to make sure the static flag actually works.
4551b9b4fd27Smrg#
4552b9b4fd27Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4553b9b4fd27Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4554b9b4fd27Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4555b9b4fd27Smrg  $lt_tmp_static_flag,
4556b9b4fd27Smrg  [],
4557b9b4fd27Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4558b9b4fd27Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4559b9b4fd27Smrg	[Compiler flag to prevent dynamic linking])
4560b9b4fd27Smrg])# _LT_COMPILER_PIC
4561caade7ccSmrg
4562caade7ccSmrg
4563b9b4fd27Smrg# _LT_LINKER_SHLIBS([TAGNAME])
4564b9b4fd27Smrg# ----------------------------
4565b9b4fd27Smrg# See if the linker supports building shared libraries.
4566b9b4fd27Smrgm4_defun([_LT_LINKER_SHLIBS],
4567b9b4fd27Smrg[AC_REQUIRE([LT_PATH_LD])dnl
4568b9b4fd27SmrgAC_REQUIRE([LT_PATH_NM])dnl
4569a5602400Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
4570b9b4fd27Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4571b9b4fd27Smrgm4_require([_LT_DECL_EGREP])dnl
4572b9b4fd27Smrgm4_require([_LT_DECL_SED])dnl
4573b9b4fd27Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4574b9b4fd27Smrgm4_require([_LT_TAG_COMPILER])dnl
4575b9b4fd27SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4576b9b4fd27Smrgm4_if([$1], [CXX], [
4577b9b4fd27Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4578a5602400Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4579b9b4fd27Smrg  case $host_os in
4580b9b4fd27Smrg  aix[[4-9]]*)
4581b9b4fd27Smrg    # If we're using GNU nm, then we don't want the "-C" option.
4582b9b4fd27Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
4583e8a5466aSmrg    # Also, AIX nm treats weak defined symbols like other global defined
4584e8a5466aSmrg    # symbols, whereas GNU nm marks them as "W".
4585b9b4fd27Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4586e8a5466aSmrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4587b9b4fd27Smrg    else
4588b9b4fd27Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4589b9b4fd27Smrg    fi
4590b9b4fd27Smrg    ;;
4591b9b4fd27Smrg  pw32*)
4592b9b4fd27Smrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
4593a5602400Smrg    ;;
4594b9b4fd27Smrg  cygwin* | mingw* | cegcc*)
4595a5602400Smrg    case $cc_basename in
4596af9a7ee5Smrg    cl*)
4597af9a7ee5Smrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
4598af9a7ee5Smrg      ;;
4599a5602400Smrg    *)
4600a5602400Smrg      _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'
4601a5602400Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4602a5602400Smrg      ;;
4603a5602400Smrg    esac
4604a5602400Smrg    ;;
4605b9b4fd27Smrg  *)
4606b9b4fd27Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4607a5602400Smrg    ;;
4608b9b4fd27Smrg  esac
4609b9b4fd27Smrg], [
4610b9b4fd27Smrg  runpath_var=
4611b9b4fd27Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
4612b9b4fd27Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
4613b9b4fd27Smrg  _LT_TAGVAR(archive_cmds, $1)=
4614b9b4fd27Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
4615b9b4fd27Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
4616b9b4fd27Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4617b9b4fd27Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4618b9b4fd27Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4619b9b4fd27Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
4620b9b4fd27Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
4621b9b4fd27Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4622b9b4fd27Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4623b9b4fd27Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4624b9b4fd27Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
4625b9b4fd27Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4626b9b4fd27Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
4627b9b4fd27Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
4628b9b4fd27Smrg  _LT_TAGVAR(module_cmds, $1)=
4629b9b4fd27Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
4630b9b4fd27Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4631b9b4fd27Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4632b9b4fd27Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
4633b9b4fd27Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4634b9b4fd27Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
4635b9b4fd27Smrg  # included in the symbol list
4636b9b4fd27Smrg  _LT_TAGVAR(include_expsyms, $1)=
4637b9b4fd27Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
4638b9b4fd27Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
4639b9b4fd27Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
4640b9b4fd27Smrg  # as well as any symbol that contains `d'.
4641b9b4fd27Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4642b9b4fd27Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
4643b9b4fd27Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
4644b9b4fd27Smrg  # the symbol is explicitly referenced.  Since portable code cannot
4645b9b4fd27Smrg  # rely on this symbol name, it's probably fine to never include it in
4646b9b4fd27Smrg  # preloaded symbol tables.
4647b9b4fd27Smrg  # Exclude shared library initialization/finalization symbols.
4648b9b4fd27Smrgdnl Note also adjust exclude_expsyms for C++ above.
4649b9b4fd27Smrg  extract_expsyms_cmds=
4650caade7ccSmrg
4651b9b4fd27Smrg  case $host_os in
4652b9b4fd27Smrg  cygwin* | mingw* | pw32* | cegcc*)
4653b9b4fd27Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
4654b9b4fd27Smrg    # When not using gcc, we currently assume that we are using
4655b9b4fd27Smrg    # Microsoft Visual C++.
4656b9b4fd27Smrg    if test "$GCC" != yes; then
4657b9b4fd27Smrg      with_gnu_ld=no
4658b9b4fd27Smrg    fi
4659b9b4fd27Smrg    ;;
4660b9b4fd27Smrg  interix*)
4661b9b4fd27Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
4662b9b4fd27Smrg    with_gnu_ld=yes
4663b9b4fd27Smrg    ;;
4664b9b4fd27Smrg  openbsd*)
4665b9b4fd27Smrg    with_gnu_ld=no
4666b9b4fd27Smrg    ;;
4667b9b4fd27Smrg  esac
4668caade7ccSmrg
4669b9b4fd27Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
4670e8a5466aSmrg
4671e8a5466aSmrg  # On some targets, GNU ld is compatible enough with the native linker
4672e8a5466aSmrg  # that we're better off using the native interface for both.
4673e8a5466aSmrg  lt_use_gnu_ld_interface=no
4674b9b4fd27Smrg  if test "$with_gnu_ld" = yes; then
4675e8a5466aSmrg    case $host_os in
4676e8a5466aSmrg      aix*)
4677e8a5466aSmrg	# The AIX port of GNU ld has always aspired to compatibility
4678e8a5466aSmrg	# with the native linker.  However, as the warning in the GNU ld
4679e8a5466aSmrg	# block says, versions before 2.19.5* couldn't really create working
4680e8a5466aSmrg	# shared libraries, regardless of the interface used.
4681e8a5466aSmrg	case `$LD -v 2>&1` in
4682e8a5466aSmrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
4683e8a5466aSmrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
4684e8a5466aSmrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
4685e8a5466aSmrg	  *)
4686e8a5466aSmrg	    lt_use_gnu_ld_interface=yes
4687e8a5466aSmrg	    ;;
4688e8a5466aSmrg	esac
4689e8a5466aSmrg	;;
4690e8a5466aSmrg      *)
4691e8a5466aSmrg	lt_use_gnu_ld_interface=yes
4692e8a5466aSmrg	;;
4693e8a5466aSmrg    esac
4694e8a5466aSmrg  fi
4695e8a5466aSmrg
4696e8a5466aSmrg  if test "$lt_use_gnu_ld_interface" = yes; then
4697b9b4fd27Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
4698b9b4fd27Smrg    wlarc='${wl}'
4699caade7ccSmrg
4700b9b4fd27Smrg    # Set some defaults for GNU ld with shared library support. These
4701b9b4fd27Smrg    # are reset later if shared libraries are not supported. Putting them
4702b9b4fd27Smrg    # here allows them to be overridden if necessary.
4703b9b4fd27Smrg    runpath_var=LD_RUN_PATH
4704b9b4fd27Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4705b9b4fd27Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
4706b9b4fd27Smrg    # ancient GNU ld didn't support --whole-archive et. al.
4707b9b4fd27Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
4708b9b4fd27Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
4709b9b4fd27Smrg    else
4710b9b4fd27Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4711b9b4fd27Smrg    fi
4712b9b4fd27Smrg    supports_anon_versioning=no
4713b9b4fd27Smrg    case `$LD -v 2>&1` in
4714e8a5466aSmrg      *GNU\ gold*) supports_anon_versioning=yes ;;
4715b9b4fd27Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
4716b9b4fd27Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
4717b9b4fd27Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
4718b9b4fd27Smrg      *\ 2.11.*) ;; # other 2.11 versions
4719b9b4fd27Smrg      *) supports_anon_versioning=yes ;;
4720b9b4fd27Smrg    esac
4721caade7ccSmrg
4722b9b4fd27Smrg    # See if GNU ld supports shared libraries.
4723b9b4fd27Smrg    case $host_os in
4724b9b4fd27Smrg    aix[[3-9]]*)
4725b9b4fd27Smrg      # On AIX/PPC, the GNU linker is very broken
4726b9b4fd27Smrg      if test "$host_cpu" != ia64; then
4727b9b4fd27Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4728b9b4fd27Smrg	cat <<_LT_EOF 1>&2
4729caade7ccSmrg
4730e8a5466aSmrg*** Warning: the GNU linker, at least up to release 2.19, is reported
4731b9b4fd27Smrg*** to be unable to reliably create shared libraries on AIX.
4732b9b4fd27Smrg*** Therefore, libtool is disabling shared libraries support.  If you
4733e8a5466aSmrg*** really care for shared libraries, you may want to install binutils
4734e8a5466aSmrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
4735e8a5466aSmrg*** You will then need to restart the configuration process.
4736caade7ccSmrg
4737b9b4fd27Smrg_LT_EOF
4738b9b4fd27Smrg      fi
4739b9b4fd27Smrg      ;;
4740caade7ccSmrg
4741b9b4fd27Smrg    amigaos*)
4742b9b4fd27Smrg      case $host_cpu in
4743b9b4fd27Smrg      powerpc)
4744b9b4fd27Smrg            # see comment about AmigaOS4 .so support
4745b9b4fd27Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4746b9b4fd27Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
4747b9b4fd27Smrg        ;;
4748b9b4fd27Smrg      m68k)
4749b9b4fd27Smrg            _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)'
4750b9b4fd27Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4751b9b4fd27Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
4752b9b4fd27Smrg        ;;
4753b9b4fd27Smrg      esac
4754b9b4fd27Smrg      ;;
4755caade7ccSmrg
4756b9b4fd27Smrg    beos*)
4757b9b4fd27Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4758b9b4fd27Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4759b9b4fd27Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
4760b9b4fd27Smrg	# support --undefined.  This deserves some investigation.  FIXME
4761b9b4fd27Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4762b9b4fd27Smrg      else
4763b9b4fd27Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4764b9b4fd27Smrg      fi
4765b9b4fd27Smrg      ;;
4766caade7ccSmrg
4767b9b4fd27Smrg    cygwin* | mingw* | pw32* | cegcc*)
4768b9b4fd27Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
4769b9b4fd27Smrg      # as there is no search path for DLLs.
4770b9b4fd27Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4771e8a5466aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
4772b9b4fd27Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4773b9b4fd27Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
4774b9b4fd27Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4775a5602400Smrg      _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'
4776a5602400Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4777b9b4fd27Smrg
4778b9b4fd27Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
4779b9b4fd27Smrg        _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'
4780b9b4fd27Smrg	# If the export-symbols file already is a .def file (1st line
4781b9b4fd27Smrg	# is EXPORTS), use it as is; otherwise, prepend...
4782b9b4fd27Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
4783b9b4fd27Smrg	  cp $export_symbols $output_objdir/$soname.def;
4784b9b4fd27Smrg	else
4785b9b4fd27Smrg	  echo EXPORTS > $output_objdir/$soname.def;
4786b9b4fd27Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
4787b9b4fd27Smrg	fi~
4788b9b4fd27Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4789b9b4fd27Smrg      else
4790b9b4fd27Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4791b9b4fd27Smrg      fi
4792b9b4fd27Smrg      ;;
4793caade7ccSmrg
4794e8a5466aSmrg    haiku*)
4795e8a5466aSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4796e8a5466aSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
4797e8a5466aSmrg      ;;
4798e8a5466aSmrg
4799b9b4fd27Smrg    interix[[3-9]]*)
4800b9b4fd27Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
4801b9b4fd27Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4802b9b4fd27Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4803b9b4fd27Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4804b9b4fd27Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
4805b9b4fd27Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
4806b9b4fd27Smrg      # default) and relocated if they conflict, which is a slow very memory
4807b9b4fd27Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
4808b9b4fd27Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
4809b9b4fd27Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
4810b9b4fd27Smrg      _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'
4811b9b4fd27Smrg      _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'
4812b9b4fd27Smrg      ;;
4813caade7ccSmrg
4814e8a5466aSmrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
4815b9b4fd27Smrg      tmp_diet=no
4816b9b4fd27Smrg      if test "$host_os" = linux-dietlibc; then
4817b9b4fd27Smrg	case $cc_basename in
4818b9b4fd27Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
4819b9b4fd27Smrg	esac
4820b9b4fd27Smrg      fi
4821b9b4fd27Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
4822b9b4fd27Smrg	 && test "$tmp_diet" = no
4823b9b4fd27Smrg      then
4824a5602400Smrg	tmp_addflag=' $pic_flag'
4825b9b4fd27Smrg	tmp_sharedflag='-shared'
4826b9b4fd27Smrg	case $cc_basename,$host_cpu in
4827b9b4fd27Smrg        pgcc*)				# Portland Group C compiler
4828e8a5466aSmrg	  _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'
4829b9b4fd27Smrg	  tmp_addflag=' $pic_flag'
4830b9b4fd27Smrg	  ;;
4831e8a5466aSmrg	pgf77* | pgf90* | pgf95* | pgfortran*)
4832e8a5466aSmrg					# Portland Group f77 and f90 compilers
4833e8a5466aSmrg	  _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'
4834b9b4fd27Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
4835b9b4fd27Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
4836b9b4fd27Smrg	  tmp_addflag=' -i_dynamic' ;;
4837b9b4fd27Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
4838b9b4fd27Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
4839b9b4fd27Smrg	ifc* | ifort*)			# Intel Fortran compiler
4840b9b4fd27Smrg	  tmp_addflag=' -nofor_main' ;;
4841b9b4fd27Smrg	lf95*)				# Lahey Fortran 8.1
4842b9b4fd27Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4843b9b4fd27Smrg	  tmp_sharedflag='--shared' ;;
4844e8a5466aSmrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
4845b9b4fd27Smrg	  tmp_sharedflag='-qmkshrobj'
4846b9b4fd27Smrg	  tmp_addflag= ;;
4847e8a5466aSmrg	nvcc*)	# Cuda Compiler Driver 2.2
4848e8a5466aSmrg	  _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'
4849e8a5466aSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
4850e8a5466aSmrg	  ;;
4851b9b4fd27Smrg	esac
4852b9b4fd27Smrg	case `$CC -V 2>&1 | sed 5q` in
4853b9b4fd27Smrg	*Sun\ C*)			# Sun C 5.9
4854e8a5466aSmrg	  _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'
4855b9b4fd27Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
4856b9b4fd27Smrg	  tmp_sharedflag='-G' ;;
4857b9b4fd27Smrg	*Sun\ F*)			# Sun Fortran 8.3
4858b9b4fd27Smrg	  tmp_sharedflag='-G' ;;
4859b9b4fd27Smrg	esac
4860b9b4fd27Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4861caade7ccSmrg
4862b9b4fd27Smrg        if test "x$supports_anon_versioning" = xyes; then
4863b9b4fd27Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4864b9b4fd27Smrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4865b9b4fd27Smrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
4866b9b4fd27Smrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
4867b9b4fd27Smrg        fi
4868caade7ccSmrg
4869b9b4fd27Smrg	case $cc_basename in
4870e8a5466aSmrg	xlf* | bgf* | bgxlf* | mpixlf*)
4871b9b4fd27Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
4872b9b4fd27Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
4873af9a7ee5Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4874e8a5466aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
4875b9b4fd27Smrg	  if test "x$supports_anon_versioning" = xyes; then
4876b9b4fd27Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4877b9b4fd27Smrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4878b9b4fd27Smrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
4879e8a5466aSmrg	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
4880b9b4fd27Smrg	  fi
4881b9b4fd27Smrg	  ;;
4882b9b4fd27Smrg	esac
4883b9b4fd27Smrg      else
4884b9b4fd27Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
4885b9b4fd27Smrg      fi
4886b9b4fd27Smrg      ;;
4887caade7ccSmrg
4888b9b4fd27Smrg    netbsd*)
4889b9b4fd27Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4890b9b4fd27Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
4891b9b4fd27Smrg	wlarc=
4892b9b4fd27Smrg      else
4893a5602400Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4894a5602400Smrg	_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'
4895b9b4fd27Smrg      fi
4896b9b4fd27Smrg      ;;
4897caade7ccSmrg
4898b9b4fd27Smrg    solaris*)
4899b9b4fd27Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
4900b9b4fd27Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4901b9b4fd27Smrg	cat <<_LT_EOF 1>&2
4902caade7ccSmrg
4903b9b4fd27Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
4904b9b4fd27Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
4905b9b4fd27Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
4906b9b4fd27Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
4907b9b4fd27Smrg*** your PATH or compiler configuration so that the native linker is
4908b9b4fd27Smrg*** used, and then restart.
4909caade7ccSmrg
4910b9b4fd27Smrg_LT_EOF
4911b9b4fd27Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4912a5602400Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4913a5602400Smrg	_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'
4914b9b4fd27Smrg      else
4915b9b4fd27Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4916b9b4fd27Smrg      fi
4917b9b4fd27Smrg      ;;
4918caade7ccSmrg
4919b9b4fd27Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
4920b9b4fd27Smrg      case `$LD -v 2>&1` in
4921b9b4fd27Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
4922b9b4fd27Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4923b9b4fd27Smrg	cat <<_LT_EOF 1>&2
4924caade7ccSmrg
4925b9b4fd27Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
4926b9b4fd27Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
4927b9b4fd27Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
4928b9b4fd27Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
4929b9b4fd27Smrg*** your PATH or compiler configuration so that the native linker is
4930b9b4fd27Smrg*** used, and then restart.
4931caade7ccSmrg
4932b9b4fd27Smrg_LT_EOF
4933b9b4fd27Smrg	;;
4934b9b4fd27Smrg	*)
4935b9b4fd27Smrg	  # For security reasons, it is highly recommended that you always
4936b9b4fd27Smrg	  # use absolute paths for naming shared libraries, and exclude the
4937b9b4fd27Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
4938b9b4fd27Smrg	  # requires that you compile everything twice, which is a pain.
4939b9b4fd27Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4940b9b4fd27Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4941b9b4fd27Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4942b9b4fd27Smrg	    _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'
4943b9b4fd27Smrg	  else
4944b9b4fd27Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
4945b9b4fd27Smrg	  fi
4946b9b4fd27Smrg	;;
4947b9b4fd27Smrg      esac
4948b9b4fd27Smrg      ;;
4949caade7ccSmrg
4950b9b4fd27Smrg    sunos4*)
4951b9b4fd27Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4952b9b4fd27Smrg      wlarc=
4953b9b4fd27Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4954b9b4fd27Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4955b9b4fd27Smrg      ;;
4956caade7ccSmrg
4957b9b4fd27Smrg    *)
4958b9b4fd27Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4959a5602400Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4960a5602400Smrg	_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'
4961b9b4fd27Smrg      else
4962b9b4fd27Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4963b9b4fd27Smrg      fi
4964b9b4fd27Smrg      ;;
4965b9b4fd27Smrg    esac
4966caade7ccSmrg
4967b9b4fd27Smrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
4968b9b4fd27Smrg      runpath_var=
4969b9b4fd27Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4970b9b4fd27Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4971b9b4fd27Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4972b9b4fd27Smrg    fi
4973b9b4fd27Smrg  else
4974b9b4fd27Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
4975b9b4fd27Smrg    case $host_os in
4976b9b4fd27Smrg    aix3*)
4977b9b4fd27Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4978b9b4fd27Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
4979b9b4fd27Smrg      _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'
4980b9b4fd27Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
4981b9b4fd27Smrg      # are no directories specified by -L.
4982b9b4fd27Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4983b9b4fd27Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
4984b9b4fd27Smrg	# Neither direct hardcoding nor static linking is supported with a
4985b9b4fd27Smrg	# broken collect2.
4986b9b4fd27Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
4987b9b4fd27Smrg      fi
4988b9b4fd27Smrg      ;;
4989caade7ccSmrg
4990b9b4fd27Smrg    aix[[4-9]]*)
4991b9b4fd27Smrg      if test "$host_cpu" = ia64; then
4992b9b4fd27Smrg	# On IA64, the linker does run time linking by default, so we don't
4993b9b4fd27Smrg	# have to do anything special.
4994b9b4fd27Smrg	aix_use_runtimelinking=no
4995b9b4fd27Smrg	exp_sym_flag='-Bexport'
4996b9b4fd27Smrg	no_entry_flag=""
4997b9b4fd27Smrg      else
4998b9b4fd27Smrg	# If we're using GNU nm, then we don't want the "-C" option.
4999b9b4fd27Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
5000e8a5466aSmrg	# Also, AIX nm treats weak defined symbols like other global
5001e8a5466aSmrg	# defined symbols, whereas GNU nm marks them as "W".
5002b9b4fd27Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5003e8a5466aSmrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
5004b9b4fd27Smrg	else
5005b9b4fd27Smrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
5006b9b4fd27Smrg	fi
5007b9b4fd27Smrg	aix_use_runtimelinking=no
5008caade7ccSmrg
5009b9b4fd27Smrg	# Test if we are trying to use run time linking or normal
5010b9b4fd27Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
5011b9b4fd27Smrg	# need to do runtime linking.
5012b9b4fd27Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5013b9b4fd27Smrg	  for ld_flag in $LDFLAGS; do
5014b9b4fd27Smrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
5015b9b4fd27Smrg	    aix_use_runtimelinking=yes
5016b9b4fd27Smrg	    break
5017b9b4fd27Smrg	  fi
5018b9b4fd27Smrg	  done
5019b9b4fd27Smrg	  ;;
5020b9b4fd27Smrg	esac
5021caade7ccSmrg
5022b9b4fd27Smrg	exp_sym_flag='-bexport'
5023b9b4fd27Smrg	no_entry_flag='-bnoentry'
5024b9b4fd27Smrg      fi
5025caade7ccSmrg
5026b9b4fd27Smrg      # When large executables or shared objects are built, AIX ld can
5027b9b4fd27Smrg      # have problems creating the table of contents.  If linking a library
5028b9b4fd27Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
5029b9b4fd27Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5030b9b4fd27Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5031caade7ccSmrg
5032b9b4fd27Smrg      _LT_TAGVAR(archive_cmds, $1)=''
5033b9b4fd27Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5034b9b4fd27Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5035b9b4fd27Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5036b9b4fd27Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5037b9b4fd27Smrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
5038485f0483Smrg
5039b9b4fd27Smrg      if test "$GCC" = yes; then
5040b9b4fd27Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
5041b9b4fd27Smrg	# We only want to do this on AIX 4.2 and lower, the check
5042b9b4fd27Smrg	# below for broken collect2 doesn't work under 4.3+
5043b9b4fd27Smrg	  collect2name=`${CC} -print-prog-name=collect2`
5044b9b4fd27Smrg	  if test -f "$collect2name" &&
5045b9b4fd27Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5046b9b4fd27Smrg	  then
5047b9b4fd27Smrg	  # We have reworked collect2
5048b9b4fd27Smrg	  :
5049b9b4fd27Smrg	  else
5050b9b4fd27Smrg	  # We have old collect2
5051b9b4fd27Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
5052b9b4fd27Smrg	  # It fails to find uninstalled libraries when the uninstalled
5053b9b4fd27Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
5054b9b4fd27Smrg	  # to unsupported forces relinking
5055b9b4fd27Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5056b9b4fd27Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5057b9b4fd27Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5058b9b4fd27Smrg	  fi
5059b9b4fd27Smrg	  ;;
5060b9b4fd27Smrg	esac
5061b9b4fd27Smrg	shared_flag='-shared'
5062b9b4fd27Smrg	if test "$aix_use_runtimelinking" = yes; then
5063b9b4fd27Smrg	  shared_flag="$shared_flag "'${wl}-G'
5064b9b4fd27Smrg	fi
5065b9b4fd27Smrg      else
5066b9b4fd27Smrg	# not using gcc
5067b9b4fd27Smrg	if test "$host_cpu" = ia64; then
5068b9b4fd27Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5069b9b4fd27Smrg	# chokes on -Wl,-G. The following line is correct:
5070b9b4fd27Smrg	  shared_flag='-G'
5071b9b4fd27Smrg	else
5072b9b4fd27Smrg	  if test "$aix_use_runtimelinking" = yes; then
5073b9b4fd27Smrg	    shared_flag='${wl}-G'
5074b9b4fd27Smrg	  else
5075b9b4fd27Smrg	    shared_flag='${wl}-bM:SRE'
5076b9b4fd27Smrg	  fi
5077b9b4fd27Smrg	fi
5078b9b4fd27Smrg      fi
5079caade7ccSmrg
5080b9b4fd27Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
5081b9b4fd27Smrg      # It seems that -bexpall does not export symbols beginning with
5082b9b4fd27Smrg      # underscore (_), so it is better to generate a list of symbols to export.
5083b9b4fd27Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
5084b9b4fd27Smrg      if test "$aix_use_runtimelinking" = yes; then
5085b9b4fd27Smrg	# Warning - without using the other runtime loading flags (-brtl),
5086b9b4fd27Smrg	# -berok will link without error, but may produce a broken library.
5087b9b4fd27Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5088b9b4fd27Smrg        # Determine the default libpath from the value encoded in an
5089b9b4fd27Smrg        # empty executable.
5090a5602400Smrg        _LT_SYS_MODULE_PATH_AIX([$1])
5091b9b4fd27Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5092e8a5466aSmrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
5093b9b4fd27Smrg      else
5094b9b4fd27Smrg	if test "$host_cpu" = ia64; then
5095b9b4fd27Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
5096b9b4fd27Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5097b9b4fd27Smrg	  _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"
5098b9b4fd27Smrg	else
5099b9b4fd27Smrg	 # Determine the default libpath from the value encoded in an
5100b9b4fd27Smrg	 # empty executable.
5101a5602400Smrg	 _LT_SYS_MODULE_PATH_AIX([$1])
5102b9b4fd27Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5103b9b4fd27Smrg	  # Warning - without using the other run time loading flags,
5104b9b4fd27Smrg	  # -berok will link without error, but may produce a broken library.
5105b9b4fd27Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5106b9b4fd27Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
5107e8a5466aSmrg	  if test "$with_gnu_ld" = yes; then
5108e8a5466aSmrg	    # We only use this code for GNU lds that support --whole-archive.
5109e8a5466aSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
5110e8a5466aSmrg	  else
5111e8a5466aSmrg	    # Exported symbols can be pulled into shared objects from archives
5112e8a5466aSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5113e8a5466aSmrg	  fi
5114b9b4fd27Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5115b9b4fd27Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
5116b9b4fd27Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
5117b9b4fd27Smrg	fi
5118b9b4fd27Smrg      fi
5119b9b4fd27Smrg      ;;
5120caade7ccSmrg
5121b9b4fd27Smrg    amigaos*)
5122b9b4fd27Smrg      case $host_cpu in
5123b9b4fd27Smrg      powerpc)
5124b9b4fd27Smrg            # see comment about AmigaOS4 .so support
5125b9b4fd27Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5126b9b4fd27Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5127b9b4fd27Smrg        ;;
5128b9b4fd27Smrg      m68k)
5129b9b4fd27Smrg            _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)'
5130b9b4fd27Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5131b9b4fd27Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5132b9b4fd27Smrg        ;;
5133b9b4fd27Smrg      esac
5134b9b4fd27Smrg      ;;
5135caade7ccSmrg
5136b9b4fd27Smrg    bsdi[[45]]*)
5137b9b4fd27Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
5138b9b4fd27Smrg      ;;
5139caade7ccSmrg
5140b9b4fd27Smrg    cygwin* | mingw* | pw32* | cegcc*)
5141b9b4fd27Smrg      # When not using gcc, we currently assume that we are using
5142b9b4fd27Smrg      # Microsoft Visual C++.
5143b9b4fd27Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
5144b9b4fd27Smrg      # no search path for DLLs.
5145a5602400Smrg      case $cc_basename in
5146a5602400Smrg      cl*)
5147a5602400Smrg	# Native MSVC
5148a5602400Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5149a5602400Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5150a5602400Smrg	_LT_TAGVAR(always_export_symbols, $1)=yes
5151a5602400Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
5152a5602400Smrg	# Tell ltmain to make .lib files, not .a files.
5153a5602400Smrg	libext=lib
5154a5602400Smrg	# Tell ltmain to make .dll files, not .so files.
5155a5602400Smrg	shrext_cmds=".dll"
5156a5602400Smrg	# FIXME: Setting linknames here is a bad hack.
5157a5602400Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
5158a5602400Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5159a5602400Smrg	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
5160a5602400Smrg	  else
5161a5602400Smrg	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
5162a5602400Smrg	  fi~
5163a5602400Smrg	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5164a5602400Smrg	  linknames='
5165a5602400Smrg	# The linker will not automatically build a static lib if we build a DLL.
5166a5602400Smrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5167a5602400Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5168af9a7ee5Smrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5169a5602400Smrg	_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'
5170a5602400Smrg	# Don't use ranlib
5171a5602400Smrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
5172a5602400Smrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
5173a5602400Smrg	  lt_tool_outputfile="@TOOL_OUTPUT@"~
5174a5602400Smrg	  case $lt_outputfile in
5175a5602400Smrg	    *.exe|*.EXE) ;;
5176a5602400Smrg	    *)
5177a5602400Smrg	      lt_outputfile="$lt_outputfile.exe"
5178a5602400Smrg	      lt_tool_outputfile="$lt_tool_outputfile.exe"
5179a5602400Smrg	      ;;
5180a5602400Smrg	  esac~
5181a5602400Smrg	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
5182a5602400Smrg	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5183a5602400Smrg	    $RM "$lt_outputfile.manifest";
5184a5602400Smrg	  fi'
5185a5602400Smrg	;;
5186a5602400Smrg      *)
5187a5602400Smrg	# Assume MSVC wrapper
5188a5602400Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5189a5602400Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5190a5602400Smrg	# Tell ltmain to make .lib files, not .a files.
5191a5602400Smrg	libext=lib
5192a5602400Smrg	# Tell ltmain to make .dll files, not .so files.
5193a5602400Smrg	shrext_cmds=".dll"
5194a5602400Smrg	# FIXME: Setting linknames here is a bad hack.
5195a5602400Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
5196a5602400Smrg	# The linker will automatically build a .lib file if we build a DLL.
5197a5602400Smrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5198a5602400Smrg	# FIXME: Should let the user specify the lib program.
5199a5602400Smrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
5200a5602400Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5201a5602400Smrg	;;
5202af9a7ee5Smrg      esac
5203af9a7ee5Smrg      ;;
5204af9a7ee5Smrg
5205af9a7ee5Smrg    darwin* | rhapsody*)
5206af9a7ee5Smrg      _LT_DARWIN_LINKER_FEATURES($1)
5207af9a7ee5Smrg      ;;
5208af9a7ee5Smrg
5209af9a7ee5Smrg    dgux*)
5210af9a7ee5Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5211af9a7ee5Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5212af9a7ee5Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5213af9a7ee5Smrg      ;;
5214af9a7ee5Smrg
5215af9a7ee5Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5216af9a7ee5Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
5217af9a7ee5Smrg    # does not break anything, and helps significantly (at the cost of a little
5218af9a7ee5Smrg    # extra space).
5219af9a7ee5Smrg    freebsd2.2*)
5220af9a7ee5Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5221af9a7ee5Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5222af9a7ee5Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5223af9a7ee5Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5224af9a7ee5Smrg      ;;
5225af9a7ee5Smrg
5226af9a7ee5Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5227af9a7ee5Smrg    freebsd2.*)
5228af9a7ee5Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5229af9a7ee5Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5230af9a7ee5Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5231af9a7ee5Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5232af9a7ee5Smrg      ;;
5233af9a7ee5Smrg
5234af9a7ee5Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5235af9a7ee5Smrg    freebsd* | dragonfly*)
5236af9a7ee5Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5237af9a7ee5Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5238af9a7ee5Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5239af9a7ee5Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5240af9a7ee5Smrg      ;;
5241af9a7ee5Smrg
5242af9a7ee5Smrg    hpux9*)
5243af9a7ee5Smrg      if test "$GCC" = yes; then
5244af9a7ee5Smrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5245af9a7ee5Smrg      else
5246af9a7ee5Smrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5247af9a7ee5Smrg      fi
5248af9a7ee5Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5249af9a7ee5Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5250af9a7ee5Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5251af9a7ee5Smrg
5252af9a7ee5Smrg      # hardcode_minus_L: Not really in the search PATH,
5253af9a7ee5Smrg      # but as the default location of the library.
5254af9a7ee5Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5255af9a7ee5Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5256af9a7ee5Smrg      ;;
5257af9a7ee5Smrg
5258af9a7ee5Smrg    hpux10*)
5259af9a7ee5Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
5260af9a7ee5Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5261af9a7ee5Smrg      else
5262af9a7ee5Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
5263af9a7ee5Smrg      fi
5264af9a7ee5Smrg      if test "$with_gnu_ld" = no; then
5265af9a7ee5Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5266af9a7ee5Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5267af9a7ee5Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
5268af9a7ee5Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5269af9a7ee5Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5270af9a7ee5Smrg	# hardcode_minus_L: Not really in the search PATH,
5271af9a7ee5Smrg	# but as the default location of the library.
5272af9a7ee5Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
5273af9a7ee5Smrg      fi
5274af9a7ee5Smrg      ;;
5275af9a7ee5Smrg
5276af9a7ee5Smrg    hpux11*)
5277af9a7ee5Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
5278af9a7ee5Smrg	case $host_cpu in
5279af9a7ee5Smrg	hppa*64*)
5280af9a7ee5Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5281af9a7ee5Smrg	  ;;
5282af9a7ee5Smrg	ia64*)
5283af9a7ee5Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5284af9a7ee5Smrg	  ;;
5285af9a7ee5Smrg	*)
5286af9a7ee5Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5287af9a7ee5Smrg	  ;;
5288af9a7ee5Smrg	esac
5289af9a7ee5Smrg      else
5290af9a7ee5Smrg	case $host_cpu in
5291af9a7ee5Smrg	hppa*64*)
5292af9a7ee5Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5293af9a7ee5Smrg	  ;;
5294af9a7ee5Smrg	ia64*)
5295af9a7ee5Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5296af9a7ee5Smrg	  ;;
5297af9a7ee5Smrg	*)
5298af9a7ee5Smrg	m4_if($1, [], [
5299af9a7ee5Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
5300af9a7ee5Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
5301af9a7ee5Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
5302af9a7ee5Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
5303af9a7ee5Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
5304af9a7ee5Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
5305af9a7ee5Smrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
5306af9a7ee5Smrg	  ;;
5307af9a7ee5Smrg	esac
5308af9a7ee5Smrg      fi
5309af9a7ee5Smrg      if test "$with_gnu_ld" = no; then
5310af9a7ee5Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5311af9a7ee5Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5312af9a7ee5Smrg
5313af9a7ee5Smrg	case $host_cpu in
5314af9a7ee5Smrg	hppa*64*|ia64*)
5315af9a7ee5Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
5316af9a7ee5Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5317af9a7ee5Smrg	  ;;
5318af9a7ee5Smrg	*)
5319af9a7ee5Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
5320af9a7ee5Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5321af9a7ee5Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5322af9a7ee5Smrg
5323af9a7ee5Smrg	  # hardcode_minus_L: Not really in the search PATH,
5324af9a7ee5Smrg	  # but as the default location of the library.
5325af9a7ee5Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5326af9a7ee5Smrg	  ;;
5327af9a7ee5Smrg	esac
5328af9a7ee5Smrg      fi
5329af9a7ee5Smrg      ;;
5330af9a7ee5Smrg
5331af9a7ee5Smrg    irix5* | irix6* | nonstopux*)
5332af9a7ee5Smrg      if test "$GCC" = yes; then
5333af9a7ee5Smrg	_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'
5334af9a7ee5Smrg	# Try to use the -exported_symbol ld option, if it does not
5335af9a7ee5Smrg	# work, assume that -exports_file does not work either and
5336af9a7ee5Smrg	# implicitly export all symbols.
5337af9a7ee5Smrg	# This should be the same for all languages, so no per-tag cache variable.
5338af9a7ee5Smrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
5339af9a7ee5Smrg	  [lt_cv_irix_exported_symbol],
5340af9a7ee5Smrg	  [save_LDFLAGS="$LDFLAGS"
5341af9a7ee5Smrg	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
5342af9a7ee5Smrg	   AC_LINK_IFELSE(
5343af9a7ee5Smrg	     [AC_LANG_SOURCE(
5344af9a7ee5Smrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
5345af9a7ee5Smrg			      [C++], [[int foo (void) { return 0; }]],
5346af9a7ee5Smrg			      [Fortran 77], [[
5347af9a7ee5Smrg      subroutine foo
5348af9a7ee5Smrg      end]],
5349af9a7ee5Smrg			      [Fortran], [[
5350af9a7ee5Smrg      subroutine foo
5351af9a7ee5Smrg      end]])])],
5352af9a7ee5Smrg	      [lt_cv_irix_exported_symbol=yes],
5353af9a7ee5Smrg	      [lt_cv_irix_exported_symbol=no])
5354af9a7ee5Smrg           LDFLAGS="$save_LDFLAGS"])
5355af9a7ee5Smrg	if test "$lt_cv_irix_exported_symbol" = yes; then
5356af9a7ee5Smrg          _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'
5357af9a7ee5Smrg	fi
5358af9a7ee5Smrg      else
5359af9a7ee5Smrg	_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'
5360af9a7ee5Smrg	_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'
5361af9a7ee5Smrg      fi
5362af9a7ee5Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5363af9a7ee5Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5364af9a7ee5Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5365af9a7ee5Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
5366af9a7ee5Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5367af9a7ee5Smrg      ;;
5368af9a7ee5Smrg
5369af9a7ee5Smrg    netbsd*)
5370af9a7ee5Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5371af9a7ee5Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
5372af9a7ee5Smrg      else
5373af9a7ee5Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
5374af9a7ee5Smrg      fi
5375af9a7ee5Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5376af9a7ee5Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5377af9a7ee5Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5378af9a7ee5Smrg      ;;
5379af9a7ee5Smrg
5380af9a7ee5Smrg    newsos6)
5381af9a7ee5Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5382af9a7ee5Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5383af9a7ee5Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5384af9a7ee5Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5385af9a7ee5Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5386af9a7ee5Smrg      ;;
5387af9a7ee5Smrg
5388af9a7ee5Smrg    *nto* | *qnx*)
5389af9a7ee5Smrg      ;;
5390af9a7ee5Smrg
5391af9a7ee5Smrg    openbsd*)
5392af9a7ee5Smrg      if test -f /usr/libexec/ld.so; then
5393af9a7ee5Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
5394af9a7ee5Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5395af9a7ee5Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5396af9a7ee5Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5397af9a7ee5Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5398af9a7ee5Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
5399af9a7ee5Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5400af9a7ee5Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5401af9a7ee5Smrg	else
5402af9a7ee5Smrg	  case $host_os in
5403af9a7ee5Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
5404af9a7ee5Smrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5405af9a7ee5Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5406af9a7ee5Smrg	     ;;
5407af9a7ee5Smrg	   *)
5408af9a7ee5Smrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5409af9a7ee5Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5410af9a7ee5Smrg	     ;;
5411af9a7ee5Smrg	  esac
5412af9a7ee5Smrg	fi
5413af9a7ee5Smrg      else
5414af9a7ee5Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
5415af9a7ee5Smrg      fi
5416af9a7ee5Smrg      ;;
5417af9a7ee5Smrg
5418af9a7ee5Smrg    os2*)
5419af9a7ee5Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5420af9a7ee5Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5421af9a7ee5Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5422af9a7ee5Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
5423af9a7ee5Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
5424af9a7ee5Smrg      ;;
5425af9a7ee5Smrg
5426af9a7ee5Smrg    osf3*)
5427af9a7ee5Smrg      if test "$GCC" = yes; then
5428af9a7ee5Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5429af9a7ee5Smrg	_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'
5430af9a7ee5Smrg      else
5431af9a7ee5Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5432af9a7ee5Smrg	_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'
5433af9a7ee5Smrg      fi
5434af9a7ee5Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5435af9a7ee5Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5436af9a7ee5Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5437af9a7ee5Smrg      ;;
5438af9a7ee5Smrg
5439af9a7ee5Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
5440af9a7ee5Smrg      if test "$GCC" = yes; then
5441af9a7ee5Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5442af9a7ee5Smrg	_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'
5443af9a7ee5Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5444af9a7ee5Smrg      else
5445af9a7ee5Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5446af9a7ee5Smrg	_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'
5447af9a7ee5Smrg	_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~
5448af9a7ee5Smrg	$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'
5449af9a7ee5Smrg
5450af9a7ee5Smrg	# Both c and cxx compiler support -rpath directly
5451af9a7ee5Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5452af9a7ee5Smrg      fi
5453af9a7ee5Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5454af9a7ee5Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5455af9a7ee5Smrg      ;;
5456af9a7ee5Smrg
5457af9a7ee5Smrg    solaris*)
5458af9a7ee5Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
5459af9a7ee5Smrg      if test "$GCC" = yes; then
5460af9a7ee5Smrg	wlarc='${wl}'
5461af9a7ee5Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5462af9a7ee5Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5463af9a7ee5Smrg	  $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'
5464af9a7ee5Smrg      else
5465af9a7ee5Smrg	case `$CC -V 2>&1` in
5466af9a7ee5Smrg	*"Compilers 5.0"*)
5467af9a7ee5Smrg	  wlarc=''
5468af9a7ee5Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
5469af9a7ee5Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5470af9a7ee5Smrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
5471af9a7ee5Smrg	  ;;
5472af9a7ee5Smrg	*)
5473af9a7ee5Smrg	  wlarc='${wl}'
5474af9a7ee5Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
5475af9a7ee5Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5476af9a7ee5Smrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5477af9a7ee5Smrg	  ;;
5478af9a7ee5Smrg	esac
5479af9a7ee5Smrg      fi
5480af9a7ee5Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5481af9a7ee5Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5482af9a7ee5Smrg      case $host_os in
5483af9a7ee5Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
5484af9a7ee5Smrg      *)
5485af9a7ee5Smrg	# The compiler driver will combine and reorder linker options,
5486af9a7ee5Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
5487af9a7ee5Smrg	# but is careful enough not to reorder.
5488af9a7ee5Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
5489af9a7ee5Smrg	if test "$GCC" = yes; then
5490af9a7ee5Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
5491af9a7ee5Smrg	else
5492af9a7ee5Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
5493af9a7ee5Smrg	fi
5494af9a7ee5Smrg	;;
5495af9a7ee5Smrg      esac
5496af9a7ee5Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5497af9a7ee5Smrg      ;;
5498af9a7ee5Smrg
5499af9a7ee5Smrg    sunos4*)
5500af9a7ee5Smrg      if test "x$host_vendor" = xsequent; then
5501af9a7ee5Smrg	# Use $CC to link under sequent, because it throws in some extra .o
5502af9a7ee5Smrg	# files that make .init and .fini sections work.
5503af9a7ee5Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5504af9a7ee5Smrg      else
5505af9a7ee5Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5506af9a7ee5Smrg      fi
5507af9a7ee5Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5508af9a7ee5Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5509af9a7ee5Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5510af9a7ee5Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5511af9a7ee5Smrg      ;;
5512af9a7ee5Smrg
5513af9a7ee5Smrg    sysv4)
5514af9a7ee5Smrg      case $host_vendor in
5515af9a7ee5Smrg	sni)
5516af9a7ee5Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5517af9a7ee5Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5518af9a7ee5Smrg	;;
5519af9a7ee5Smrg	siemens)
5520af9a7ee5Smrg	  ## LD is ld it makes a PLAMLIB
5521af9a7ee5Smrg	  ## CC just makes a GrossModule.
5522af9a7ee5Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5523af9a7ee5Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5524af9a7ee5Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
5525af9a7ee5Smrg        ;;
5526af9a7ee5Smrg	motorola)
5527af9a7ee5Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5528af9a7ee5Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
5529af9a7ee5Smrg	;;
5530af9a7ee5Smrg      esac
5531af9a7ee5Smrg      runpath_var='LD_RUN_PATH'
5532af9a7ee5Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5533af9a7ee5Smrg      ;;
5534af9a7ee5Smrg
5535af9a7ee5Smrg    sysv4.3*)
5536af9a7ee5Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5537af9a7ee5Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5538af9a7ee5Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
5539af9a7ee5Smrg      ;;
5540af9a7ee5Smrg
5541af9a7ee5Smrg    sysv4*MP*)
5542af9a7ee5Smrg      if test -d /usr/nec; then
5543af9a7ee5Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5544af9a7ee5Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5545af9a7ee5Smrg	runpath_var=LD_RUN_PATH
5546af9a7ee5Smrg	hardcode_runpath_var=yes
5547af9a7ee5Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
5548af9a7ee5Smrg      fi
5549af9a7ee5Smrg      ;;
5550af9a7ee5Smrg
5551af9a7ee5Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
5552af9a7ee5Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5553af9a7ee5Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5554af9a7ee5Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5555af9a7ee5Smrg      runpath_var='LD_RUN_PATH'
5556af9a7ee5Smrg
5557af9a7ee5Smrg      if test "$GCC" = yes; then
5558af9a7ee5Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5559af9a7ee5Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5560af9a7ee5Smrg      else
5561af9a7ee5Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5562af9a7ee5Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5563af9a7ee5Smrg      fi
5564af9a7ee5Smrg      ;;
5565af9a7ee5Smrg
5566af9a7ee5Smrg    sysv5* | sco3.2v5* | sco5v6*)
5567af9a7ee5Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
5568af9a7ee5Smrg      # link with -lc, and that would cause any symbols used from libc to
5569af9a7ee5Smrg      # always be unresolved, which means just about no library would
5570af9a7ee5Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
5571af9a7ee5Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
5572af9a7ee5Smrg      # as -z defs.
5573af9a7ee5Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5574af9a7ee5Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
5575af9a7ee5Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5576af9a7ee5Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5577af9a7ee5Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
5578af9a7ee5Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5579af9a7ee5Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5580af9a7ee5Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
5581af9a7ee5Smrg      runpath_var='LD_RUN_PATH'
5582af9a7ee5Smrg
5583af9a7ee5Smrg      if test "$GCC" = yes; then
5584af9a7ee5Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5585af9a7ee5Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5586af9a7ee5Smrg      else
5587af9a7ee5Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5588af9a7ee5Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5589af9a7ee5Smrg      fi
5590af9a7ee5Smrg      ;;
5591af9a7ee5Smrg
5592af9a7ee5Smrg    uts4*)
5593af9a7ee5Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5594af9a7ee5Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5595af9a7ee5Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5596af9a7ee5Smrg      ;;
5597af9a7ee5Smrg
5598af9a7ee5Smrg    *)
5599af9a7ee5Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
5600af9a7ee5Smrg      ;;
5601af9a7ee5Smrg    esac
5602af9a7ee5Smrg
5603af9a7ee5Smrg    if test x$host_vendor = xsni; then
5604af9a7ee5Smrg      case $host in
5605af9a7ee5Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5606af9a7ee5Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
5607af9a7ee5Smrg	;;
5608af9a7ee5Smrg      esac
5609af9a7ee5Smrg    fi
5610af9a7ee5Smrg  fi
5611af9a7ee5Smrg])
5612af9a7ee5SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
5613af9a7ee5Smrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
5614af9a7ee5Smrg
5615af9a7ee5Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
5616af9a7ee5Smrg
5617af9a7ee5Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
5618af9a7ee5Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
5619af9a7ee5Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
5620af9a7ee5Smrg    [The commands to extract the exported symbol list from a shared archive])
5621af9a7ee5Smrg
5622af9a7ee5Smrg#
5623af9a7ee5Smrg# Do we need to explicitly link libc?
5624af9a7ee5Smrg#
5625af9a7ee5Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
5626af9a7ee5Smrgx|xyes)
5627af9a7ee5Smrg  # Assume -lc should be added
5628af9a7ee5Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5629af9a7ee5Smrg
5630af9a7ee5Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
5631af9a7ee5Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
5632af9a7ee5Smrg    *'~'*)
5633af9a7ee5Smrg      # FIXME: we may have to deal with multi-command sequences.
5634af9a7ee5Smrg      ;;
5635af9a7ee5Smrg    '$CC '*)
5636af9a7ee5Smrg      # Test whether the compiler implicitly links with -lc since on some
5637af9a7ee5Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
5638af9a7ee5Smrg      # to ld, don't add -lc before -lgcc.
5639af9a7ee5Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
5640af9a7ee5Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
5641af9a7ee5Smrg	[$RM conftest*
5642af9a7ee5Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5643af9a7ee5Smrg
5644af9a7ee5Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
5645af9a7ee5Smrg	  soname=conftest
5646af9a7ee5Smrg	  lib=conftest
5647af9a7ee5Smrg	  libobjs=conftest.$ac_objext
5648af9a7ee5Smrg	  deplibs=
5649af9a7ee5Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
5650af9a7ee5Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
5651af9a7ee5Smrg	  compiler_flags=-v
5652af9a7ee5Smrg	  linker_flags=-v
5653af9a7ee5Smrg	  verstring=
5654af9a7ee5Smrg	  output_objdir=.
5655af9a7ee5Smrg	  libname=conftest
5656af9a7ee5Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
5657af9a7ee5Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
5658af9a7ee5Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
5659af9a7ee5Smrg	  then
5660af9a7ee5Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
5661af9a7ee5Smrg	  else
5662af9a7ee5Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5663af9a7ee5Smrg	  fi
5664af9a7ee5Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
5665af9a7ee5Smrg	else
5666af9a7ee5Smrg	  cat conftest.err 1>&5
5667af9a7ee5Smrg	fi
5668af9a7ee5Smrg	$RM conftest*
5669af9a7ee5Smrg	])
5670af9a7ee5Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
5671af9a7ee5Smrg      ;;
5672af9a7ee5Smrg    esac
5673af9a7ee5Smrg  fi
5674af9a7ee5Smrg  ;;
5675af9a7ee5Smrgesac
5676af9a7ee5Smrg
5677af9a7ee5Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
5678af9a7ee5Smrg    [Whether or not to add -lc for building shared libraries])
5679af9a7ee5Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
5680af9a7ee5Smrg    [enable_shared_with_static_runtimes], [0],
5681af9a7ee5Smrg    [Whether or not to disallow shared libs when runtime libs are static])
5682af9a7ee5Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
5683af9a7ee5Smrg    [Compiler flag to allow reflexive dlopens])
5684af9a7ee5Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
5685af9a7ee5Smrg    [Compiler flag to generate shared objects directly from archives])
5686af9a7ee5Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
5687af9a7ee5Smrg    [Whether the compiler copes with passing no objects directly])
5688af9a7ee5Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
5689af9a7ee5Smrg    [Create an old-style archive from a shared archive])
5690af9a7ee5Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
5691af9a7ee5Smrg    [Create a temporary old-style archive to link instead of a shared archive])
5692af9a7ee5Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
5693af9a7ee5Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
5694af9a7ee5Smrg_LT_TAGDECL([], [module_cmds], [2],
5695af9a7ee5Smrg    [Commands used to build a loadable module if different from building
5696af9a7ee5Smrg    a shared archive.])
5697af9a7ee5Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
5698af9a7ee5Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
5699af9a7ee5Smrg    [Whether we are building with GNU ld or not])
5700af9a7ee5Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
5701af9a7ee5Smrg    [Flag that allows shared libraries with undefined symbols to be built])
5702af9a7ee5Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
5703af9a7ee5Smrg    [Flag that enforces no undefined symbols])
5704af9a7ee5Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
5705af9a7ee5Smrg    [Flag to hardcode $libdir into a binary during linking.
5706af9a7ee5Smrg    This must work even if $libdir does not exist])
5707af9a7ee5Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
5708af9a7ee5Smrg    [Whether we need a single "-rpath" flag with a separated argument])
5709af9a7ee5Smrg_LT_TAGDECL([], [hardcode_direct], [0],
5710af9a7ee5Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5711af9a7ee5Smrg    DIR into the resulting binary])
5712af9a7ee5Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
5713af9a7ee5Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5714af9a7ee5Smrg    DIR into the resulting binary and the resulting library dependency is
5715af9a7ee5Smrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
5716af9a7ee5Smrg    library is relocated])
5717af9a7ee5Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
5718af9a7ee5Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
5719af9a7ee5Smrg    into the resulting binary])
5720af9a7ee5Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
5721af9a7ee5Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
5722af9a7ee5Smrg    into the resulting binary])
5723af9a7ee5Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
5724af9a7ee5Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
5725af9a7ee5Smrg    into the library and all subsequent libraries and executables linked
5726af9a7ee5Smrg    against it])
5727af9a7ee5Smrg_LT_TAGDECL([], [inherit_rpath], [0],
5728af9a7ee5Smrg    [Set to yes if linker adds runtime paths of dependent libraries
5729af9a7ee5Smrg    to runtime path list])
5730af9a7ee5Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
5731af9a7ee5Smrg    [Whether libtool must link a program against all its dependency libraries])
5732af9a7ee5Smrg_LT_TAGDECL([], [always_export_symbols], [0],
5733af9a7ee5Smrg    [Set to "yes" if exported symbols are required])
5734af9a7ee5Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
5735af9a7ee5Smrg    [The commands to list exported symbols])
5736af9a7ee5Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
5737af9a7ee5Smrg    [Symbols that should not be listed in the preloaded symbols])
5738af9a7ee5Smrg_LT_TAGDECL([], [include_expsyms], [1],
5739af9a7ee5Smrg    [Symbols that must always be exported])
5740af9a7ee5Smrg_LT_TAGDECL([], [prelink_cmds], [2],
5741af9a7ee5Smrg    [Commands necessary for linking programs (against libraries) with templates])
5742af9a7ee5Smrg_LT_TAGDECL([], [postlink_cmds], [2],
5743af9a7ee5Smrg    [Commands necessary for finishing linking programs])
5744af9a7ee5Smrg_LT_TAGDECL([], [file_list_spec], [1],
5745af9a7ee5Smrg    [Specify filename containing input files])
5746af9a7ee5Smrgdnl FIXME: Not yet implemented
5747af9a7ee5Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
5748af9a7ee5Smrgdnl    [Compiler flag to generate thread safe objects])
5749af9a7ee5Smrg])# _LT_LINKER_SHLIBS
5750af9a7ee5Smrg
5751af9a7ee5Smrg
5752af9a7ee5Smrg# _LT_LANG_C_CONFIG([TAG])
5753af9a7ee5Smrg# ------------------------
5754af9a7ee5Smrg# Ensure that the configuration variables for a C compiler are suitably
5755af9a7ee5Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
5756af9a7ee5Smrg# the compiler configuration to `libtool'.
5757af9a7ee5Smrgm4_defun([_LT_LANG_C_CONFIG],
5758af9a7ee5Smrg[m4_require([_LT_DECL_EGREP])dnl
5759af9a7ee5Smrglt_save_CC="$CC"
5760af9a7ee5SmrgAC_LANG_PUSH(C)
5761af9a7ee5Smrg
5762af9a7ee5Smrg# Source file extension for C test sources.
5763af9a7ee5Smrgac_ext=c
5764af9a7ee5Smrg
5765af9a7ee5Smrg# Object file extension for compiled C test sources.
5766af9a7ee5Smrgobjext=o
5767af9a7ee5Smrg_LT_TAGVAR(objext, $1)=$objext
5768af9a7ee5Smrg
5769af9a7ee5Smrg# Code to be used in simple compile tests
5770af9a7ee5Smrglt_simple_compile_test_code="int some_variable = 0;"
5771af9a7ee5Smrg
5772af9a7ee5Smrg# Code to be used in simple link tests
5773af9a7ee5Smrglt_simple_link_test_code='int main(){return(0);}'
5774af9a7ee5Smrg
5775af9a7ee5Smrg_LT_TAG_COMPILER
5776af9a7ee5Smrg# Save the default compiler, since it gets overwritten when the other
5777af9a7ee5Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
5778af9a7ee5Smrgcompiler_DEFAULT=$CC
5779af9a7ee5Smrg
5780af9a7ee5Smrg# save warnings/boilerplate of simple test code
5781af9a7ee5Smrg_LT_COMPILER_BOILERPLATE
5782af9a7ee5Smrg_LT_LINKER_BOILERPLATE
5783af9a7ee5Smrg
5784af9a7ee5Smrgif test -n "$compiler"; then
5785af9a7ee5Smrg  _LT_COMPILER_NO_RTTI($1)
5786af9a7ee5Smrg  _LT_COMPILER_PIC($1)
5787af9a7ee5Smrg  _LT_COMPILER_C_O($1)
5788af9a7ee5Smrg  _LT_COMPILER_FILE_LOCKS($1)
5789af9a7ee5Smrg  _LT_LINKER_SHLIBS($1)
5790af9a7ee5Smrg  _LT_SYS_DYNAMIC_LINKER($1)
5791af9a7ee5Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
5792af9a7ee5Smrg  LT_SYS_DLOPEN_SELF
5793af9a7ee5Smrg  _LT_CMD_STRIPLIB
5794af9a7ee5Smrg
5795af9a7ee5Smrg  # Report which library types will actually be built
5796af9a7ee5Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
5797af9a7ee5Smrg  AC_MSG_RESULT([$can_build_shared])
5798af9a7ee5Smrg
5799af9a7ee5Smrg  AC_MSG_CHECKING([whether to build shared libraries])
5800af9a7ee5Smrg  test "$can_build_shared" = "no" && enable_shared=no
5801af9a7ee5Smrg
5802af9a7ee5Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
5803af9a7ee5Smrg  # are all built from PIC.
5804af9a7ee5Smrg  case $host_os in
5805af9a7ee5Smrg  aix3*)
5806af9a7ee5Smrg    test "$enable_shared" = yes && enable_static=no
5807af9a7ee5Smrg    if test -n "$RANLIB"; then
5808af9a7ee5Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
5809af9a7ee5Smrg      postinstall_cmds='$RANLIB $lib'
5810af9a7ee5Smrg    fi
5811af9a7ee5Smrg    ;;
5812af9a7ee5Smrg
5813af9a7ee5Smrg  aix[[4-9]]*)
5814af9a7ee5Smrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
5815af9a7ee5Smrg      test "$enable_shared" = yes && enable_static=no
5816af9a7ee5Smrg    fi
5817af9a7ee5Smrg    ;;
5818af9a7ee5Smrg  esac
5819af9a7ee5Smrg  AC_MSG_RESULT([$enable_shared])
5820af9a7ee5Smrg
5821af9a7ee5Smrg  AC_MSG_CHECKING([whether to build static libraries])
5822af9a7ee5Smrg  # Make sure either enable_shared or enable_static is yes.
5823af9a7ee5Smrg  test "$enable_shared" = yes || enable_static=yes
5824af9a7ee5Smrg  AC_MSG_RESULT([$enable_static])
5825af9a7ee5Smrg
5826af9a7ee5Smrg  _LT_CONFIG($1)
5827af9a7ee5Smrgfi
5828af9a7ee5SmrgAC_LANG_POP
5829af9a7ee5SmrgCC="$lt_save_CC"
5830af9a7ee5Smrg])# _LT_LANG_C_CONFIG
5831af9a7ee5Smrg
5832af9a7ee5Smrg
5833af9a7ee5Smrg# _LT_LANG_CXX_CONFIG([TAG])
5834af9a7ee5Smrg# --------------------------
5835af9a7ee5Smrg# Ensure that the configuration variables for a C++ compiler are suitably
5836af9a7ee5Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
5837af9a7ee5Smrg# the compiler configuration to `libtool'.
5838af9a7ee5Smrgm4_defun([_LT_LANG_CXX_CONFIG],
5839af9a7ee5Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5840af9a7ee5Smrgm4_require([_LT_DECL_EGREP])dnl
5841af9a7ee5Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
5842af9a7ee5Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
5843af9a7ee5Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
5844af9a7ee5Smrg    (test "X$CXX" != "Xg++"))) ; then
5845af9a7ee5Smrg  AC_PROG_CXXCPP
5846af9a7ee5Smrgelse
5847af9a7ee5Smrg  _lt_caught_CXX_error=yes
5848af9a7ee5Smrgfi
5849af9a7ee5Smrg
5850af9a7ee5SmrgAC_LANG_PUSH(C++)
5851af9a7ee5Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
5852af9a7ee5Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
5853af9a7ee5Smrg_LT_TAGVAR(always_export_symbols, $1)=no
5854af9a7ee5Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
5855af9a7ee5Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
5856af9a7ee5Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
5857af9a7ee5Smrg_LT_TAGVAR(hardcode_direct, $1)=no
5858af9a7ee5Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5859af9a7ee5Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5860af9a7ee5Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
5861af9a7ee5Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
5862af9a7ee5Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5863af9a7ee5Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
5864af9a7ee5Smrg_LT_TAGVAR(inherit_rpath, $1)=no
5865af9a7ee5Smrg_LT_TAGVAR(module_cmds, $1)=
5866af9a7ee5Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
5867af9a7ee5Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
5868af9a7ee5Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
5869af9a7ee5Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
5870af9a7ee5Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
5871af9a7ee5Smrg_LT_TAGVAR(no_undefined_flag, $1)=
5872af9a7ee5Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
5873af9a7ee5Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5874af9a7ee5Smrg
5875af9a7ee5Smrg# Source file extension for C++ test sources.
5876af9a7ee5Smrgac_ext=cpp
5877af9a7ee5Smrg
5878af9a7ee5Smrg# Object file extension for compiled C++ test sources.
5879af9a7ee5Smrgobjext=o
5880af9a7ee5Smrg_LT_TAGVAR(objext, $1)=$objext
5881af9a7ee5Smrg
5882af9a7ee5Smrg# No sense in running all these tests if we already determined that
5883af9a7ee5Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
5884af9a7ee5Smrg# are currently assumed to apply to all compilers on this platform,
5885af9a7ee5Smrg# and will be corrupted by setting them based on a non-working compiler.
5886af9a7ee5Smrgif test "$_lt_caught_CXX_error" != yes; then
5887af9a7ee5Smrg  # Code to be used in simple compile tests
5888af9a7ee5Smrg  lt_simple_compile_test_code="int some_variable = 0;"
5889af9a7ee5Smrg
5890af9a7ee5Smrg  # Code to be used in simple link tests
5891af9a7ee5Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
5892af9a7ee5Smrg
5893af9a7ee5Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
5894af9a7ee5Smrg  _LT_TAG_COMPILER
5895af9a7ee5Smrg
5896af9a7ee5Smrg  # save warnings/boilerplate of simple test code
5897af9a7ee5Smrg  _LT_COMPILER_BOILERPLATE
5898af9a7ee5Smrg  _LT_LINKER_BOILERPLATE
5899af9a7ee5Smrg
5900af9a7ee5Smrg  # Allow CC to be a program name with arguments.
5901af9a7ee5Smrg  lt_save_CC=$CC
5902af9a7ee5Smrg  lt_save_CFLAGS=$CFLAGS
5903af9a7ee5Smrg  lt_save_LD=$LD
5904af9a7ee5Smrg  lt_save_GCC=$GCC
5905af9a7ee5Smrg  GCC=$GXX
5906af9a7ee5Smrg  lt_save_with_gnu_ld=$with_gnu_ld
5907af9a7ee5Smrg  lt_save_path_LD=$lt_cv_path_LD
5908af9a7ee5Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
5909af9a7ee5Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
5910af9a7ee5Smrg  else
5911af9a7ee5Smrg    $as_unset lt_cv_prog_gnu_ld
5912af9a7ee5Smrg  fi
5913af9a7ee5Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
5914af9a7ee5Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
5915af9a7ee5Smrg  else
5916af9a7ee5Smrg    $as_unset lt_cv_path_LD
5917af9a7ee5Smrg  fi
5918af9a7ee5Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
5919af9a7ee5Smrg  CC=${CXX-"c++"}
5920af9a7ee5Smrg  CFLAGS=$CXXFLAGS
5921af9a7ee5Smrg  compiler=$CC
5922af9a7ee5Smrg  _LT_TAGVAR(compiler, $1)=$CC
5923af9a7ee5Smrg  _LT_CC_BASENAME([$compiler])
5924af9a7ee5Smrg
5925af9a7ee5Smrg  if test -n "$compiler"; then
5926af9a7ee5Smrg    # We don't want -fno-exception when compiling C++ code, so set the
5927af9a7ee5Smrg    # no_builtin_flag separately
5928af9a7ee5Smrg    if test "$GXX" = yes; then
5929af9a7ee5Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
5930af9a7ee5Smrg    else
5931af9a7ee5Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
5932af9a7ee5Smrg    fi
5933af9a7ee5Smrg
5934af9a7ee5Smrg    if test "$GXX" = yes; then
5935af9a7ee5Smrg      # Set up default GNU C++ configuration
5936af9a7ee5Smrg
5937af9a7ee5Smrg      LT_PATH_LD
5938af9a7ee5Smrg
5939af9a7ee5Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
5940af9a7ee5Smrg      # archiving commands below assume that GNU ld is being used.
5941af9a7ee5Smrg      if test "$with_gnu_ld" = yes; then
5942af9a7ee5Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5943af9a7ee5Smrg        _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'
5944af9a7ee5Smrg
5945af9a7ee5Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5946af9a7ee5Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5947af9a7ee5Smrg
5948af9a7ee5Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
5949af9a7ee5Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
5950af9a7ee5Smrg        #     investigate it a little bit more. (MM)
5951af9a7ee5Smrg        wlarc='${wl}'
5952af9a7ee5Smrg
5953af9a7ee5Smrg        # ancient GNU ld didn't support --whole-archive et. al.
5954af9a7ee5Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
5955af9a7ee5Smrg	  $GREP 'no-whole-archive' > /dev/null; then
5956af9a7ee5Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5957af9a7ee5Smrg        else
5958af9a7ee5Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
5959af9a7ee5Smrg        fi
5960af9a7ee5Smrg      else
5961af9a7ee5Smrg        with_gnu_ld=no
5962af9a7ee5Smrg        wlarc=
5963af9a7ee5Smrg
5964af9a7ee5Smrg        # A generic and very simple default shared library creation
5965af9a7ee5Smrg        # command for GNU C++ for the case where it uses the native
5966af9a7ee5Smrg        # linker, instead of GNU ld.  If possible, this setting should
5967af9a7ee5Smrg        # overridden to take advantage of the native linker features on
5968af9a7ee5Smrg        # the platform it is being used on.
5969af9a7ee5Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
5970af9a7ee5Smrg      fi
5971af9a7ee5Smrg
5972af9a7ee5Smrg      # Commands to make compiler produce verbose output that lists
5973af9a7ee5Smrg      # what "hidden" libraries, object files and flags are used when
5974af9a7ee5Smrg      # linking a shared library.
5975af9a7ee5Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
5976af9a7ee5Smrg
5977af9a7ee5Smrg    else
5978af9a7ee5Smrg      GXX=no
5979af9a7ee5Smrg      with_gnu_ld=no
5980af9a7ee5Smrg      wlarc=
5981af9a7ee5Smrg    fi
5982af9a7ee5Smrg
5983af9a7ee5Smrg    # PORTME: fill in a description of your system's C++ link characteristics
5984af9a7ee5Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5985af9a7ee5Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
5986af9a7ee5Smrg    case $host_os in
5987af9a7ee5Smrg      aix3*)
5988af9a7ee5Smrg        # FIXME: insert proper C++ library support
5989af9a7ee5Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
5990af9a7ee5Smrg        ;;
5991af9a7ee5Smrg      aix[[4-9]]*)
5992af9a7ee5Smrg        if test "$host_cpu" = ia64; then
5993af9a7ee5Smrg          # On IA64, the linker does run time linking by default, so we don't
5994af9a7ee5Smrg          # have to do anything special.
5995af9a7ee5Smrg          aix_use_runtimelinking=no
5996af9a7ee5Smrg          exp_sym_flag='-Bexport'
5997af9a7ee5Smrg          no_entry_flag=""
5998af9a7ee5Smrg        else
5999af9a7ee5Smrg          aix_use_runtimelinking=no
6000af9a7ee5Smrg
6001af9a7ee5Smrg          # Test if we are trying to use run time linking or normal
6002af9a7ee5Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
6003af9a7ee5Smrg          # need to do runtime linking.
6004af9a7ee5Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6005af9a7ee5Smrg	    for ld_flag in $LDFLAGS; do
6006af9a7ee5Smrg	      case $ld_flag in
6007af9a7ee5Smrg	      *-brtl*)
6008af9a7ee5Smrg	        aix_use_runtimelinking=yes
6009af9a7ee5Smrg	        break
6010af9a7ee5Smrg	        ;;
6011af9a7ee5Smrg	      esac
6012af9a7ee5Smrg	    done
6013af9a7ee5Smrg	    ;;
6014af9a7ee5Smrg          esac
6015af9a7ee5Smrg
6016af9a7ee5Smrg          exp_sym_flag='-bexport'
6017af9a7ee5Smrg          no_entry_flag='-bnoentry'
6018af9a7ee5Smrg        fi
6019af9a7ee5Smrg
6020af9a7ee5Smrg        # When large executables or shared objects are built, AIX ld can
6021af9a7ee5Smrg        # have problems creating the table of contents.  If linking a library
6022af9a7ee5Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
6023af9a7ee5Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6024af9a7ee5Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6025af9a7ee5Smrg
6026af9a7ee5Smrg        _LT_TAGVAR(archive_cmds, $1)=''
6027af9a7ee5Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
6028af9a7ee5Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6029af9a7ee5Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6030af9a7ee5Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
6031af9a7ee5Smrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6032af9a7ee5Smrg
6033af9a7ee5Smrg        if test "$GXX" = yes; then
6034af9a7ee5Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
6035af9a7ee5Smrg          # We only want to do this on AIX 4.2 and lower, the check
6036af9a7ee5Smrg          # below for broken collect2 doesn't work under 4.3+
6037af9a7ee5Smrg	  collect2name=`${CC} -print-prog-name=collect2`
6038af9a7ee5Smrg	  if test -f "$collect2name" &&
6039af9a7ee5Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6040af9a7ee5Smrg	  then
6041af9a7ee5Smrg	    # We have reworked collect2
6042af9a7ee5Smrg	    :
6043af9a7ee5Smrg	  else
6044af9a7ee5Smrg	    # We have old collect2
6045af9a7ee5Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
6046af9a7ee5Smrg	    # It fails to find uninstalled libraries when the uninstalled
6047af9a7ee5Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
6048af9a7ee5Smrg	    # to unsupported forces relinking
6049af9a7ee5Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
6050af9a7ee5Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6051af9a7ee5Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
6052af9a7ee5Smrg	  fi
6053af9a7ee5Smrg          esac
6054af9a7ee5Smrg          shared_flag='-shared'
6055af9a7ee5Smrg	  if test "$aix_use_runtimelinking" = yes; then
6056af9a7ee5Smrg	    shared_flag="$shared_flag "'${wl}-G'
6057af9a7ee5Smrg	  fi
6058af9a7ee5Smrg        else
6059af9a7ee5Smrg          # not using gcc
6060af9a7ee5Smrg          if test "$host_cpu" = ia64; then
6061af9a7ee5Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6062af9a7ee5Smrg	  # chokes on -Wl,-G. The following line is correct:
6063af9a7ee5Smrg	  shared_flag='-G'
6064af9a7ee5Smrg          else
6065af9a7ee5Smrg	    if test "$aix_use_runtimelinking" = yes; then
6066af9a7ee5Smrg	      shared_flag='${wl}-G'
6067af9a7ee5Smrg	    else
6068af9a7ee5Smrg	      shared_flag='${wl}-bM:SRE'
6069af9a7ee5Smrg	    fi
6070af9a7ee5Smrg          fi
6071af9a7ee5Smrg        fi
6072af9a7ee5Smrg
6073af9a7ee5Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
6074af9a7ee5Smrg        # It seems that -bexpall does not export symbols beginning with
6075af9a7ee5Smrg        # underscore (_), so it is better to generate a list of symbols to
6076af9a7ee5Smrg	# export.
6077af9a7ee5Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
6078af9a7ee5Smrg        if test "$aix_use_runtimelinking" = yes; then
6079af9a7ee5Smrg          # Warning - without using the other runtime loading flags (-brtl),
6080af9a7ee5Smrg          # -berok will link without error, but may produce a broken library.
6081af9a7ee5Smrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
6082af9a7ee5Smrg          # Determine the default libpath from the value encoded in an empty
6083af9a7ee5Smrg          # executable.
6084af9a7ee5Smrg          _LT_SYS_MODULE_PATH_AIX([$1])
6085af9a7ee5Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6086af9a7ee5Smrg
6087af9a7ee5Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
6088af9a7ee5Smrg        else
6089af9a7ee5Smrg          if test "$host_cpu" = ia64; then
6090af9a7ee5Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6091af9a7ee5Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6092af9a7ee5Smrg	    _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"
6093af9a7ee5Smrg          else
6094af9a7ee5Smrg	    # Determine the default libpath from the value encoded in an
6095af9a7ee5Smrg	    # empty executable.
6096af9a7ee5Smrg	    _LT_SYS_MODULE_PATH_AIX([$1])
6097af9a7ee5Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6098af9a7ee5Smrg	    # Warning - without using the other run time loading flags,
6099af9a7ee5Smrg	    # -berok will link without error, but may produce a broken library.
6100af9a7ee5Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6101af9a7ee5Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6102af9a7ee5Smrg	    if test "$with_gnu_ld" = yes; then
6103af9a7ee5Smrg	      # We only use this code for GNU lds that support --whole-archive.
6104af9a7ee5Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6105af9a7ee5Smrg	    else
6106af9a7ee5Smrg	      # Exported symbols can be pulled into shared objects from archives
6107af9a7ee5Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6108af9a7ee5Smrg	    fi
6109af9a7ee5Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6110af9a7ee5Smrg	    # This is similar to how AIX traditionally builds its shared
6111af9a7ee5Smrg	    # libraries.
6112af9a7ee5Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
6113af9a7ee5Smrg          fi
6114af9a7ee5Smrg        fi
6115af9a7ee5Smrg        ;;
6116af9a7ee5Smrg
6117af9a7ee5Smrg      beos*)
6118af9a7ee5Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6119af9a7ee5Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6120af9a7ee5Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
6121af9a7ee5Smrg	  # support --undefined.  This deserves some investigation.  FIXME
6122af9a7ee5Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6123af9a7ee5Smrg	else
6124af9a7ee5Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6125af9a7ee5Smrg	fi
6126af9a7ee5Smrg	;;
6127af9a7ee5Smrg
6128af9a7ee5Smrg      chorus*)
6129af9a7ee5Smrg        case $cc_basename in
6130af9a7ee5Smrg          *)
6131af9a7ee5Smrg	  # FIXME: insert proper C++ library support
6132af9a7ee5Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6133af9a7ee5Smrg	  ;;
6134af9a7ee5Smrg        esac
6135af9a7ee5Smrg        ;;
6136af9a7ee5Smrg
6137af9a7ee5Smrg      cygwin* | mingw* | pw32* | cegcc*)
6138af9a7ee5Smrg	case $GXX,$cc_basename in
6139af9a7ee5Smrg	,cl* | no,cl*)
6140af9a7ee5Smrg	  # Native MSVC
6141af9a7ee5Smrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
6142af9a7ee5Smrg	  # no search path for DLLs.
6143af9a7ee5Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6144af9a7ee5Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6145af9a7ee5Smrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
6146af9a7ee5Smrg	  _LT_TAGVAR(file_list_spec, $1)='@'
6147af9a7ee5Smrg	  # Tell ltmain to make .lib files, not .a files.
6148af9a7ee5Smrg	  libext=lib
6149af9a7ee5Smrg	  # Tell ltmain to make .dll files, not .so files.
6150af9a7ee5Smrg	  shrext_cmds=".dll"
6151af9a7ee5Smrg	  # FIXME: Setting linknames here is a bad hack.
6152af9a7ee5Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
6153af9a7ee5Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6154af9a7ee5Smrg	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
6155af9a7ee5Smrg	    else
6156af9a7ee5Smrg	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
6157af9a7ee5Smrg	    fi~
6158af9a7ee5Smrg	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6159af9a7ee5Smrg	    linknames='
6160af9a7ee5Smrg	  # The linker will not automatically build a static lib if we build a DLL.
6161af9a7ee5Smrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6162af9a7ee5Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6163af9a7ee5Smrg	  # Don't use ranlib
6164af9a7ee5Smrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6165af9a7ee5Smrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6166af9a7ee5Smrg	    lt_tool_outputfile="@TOOL_OUTPUT@"~
6167af9a7ee5Smrg	    case $lt_outputfile in
6168af9a7ee5Smrg	      *.exe|*.EXE) ;;
6169af9a7ee5Smrg	      *)
6170af9a7ee5Smrg		lt_outputfile="$lt_outputfile.exe"
6171af9a7ee5Smrg		lt_tool_outputfile="$lt_tool_outputfile.exe"
6172af9a7ee5Smrg		;;
6173af9a7ee5Smrg	    esac~
6174af9a7ee5Smrg	    func_to_tool_file "$lt_outputfile"~
6175af9a7ee5Smrg	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
6176af9a7ee5Smrg	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6177af9a7ee5Smrg	      $RM "$lt_outputfile.manifest";
6178af9a7ee5Smrg	    fi'
6179af9a7ee5Smrg	  ;;
6180af9a7ee5Smrg	*)
6181af9a7ee5Smrg	  # g++
6182af9a7ee5Smrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6183af9a7ee5Smrg	  # as there is no search path for DLLs.
6184af9a7ee5Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6185af9a7ee5Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
6186af9a7ee5Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6187af9a7ee5Smrg	  _LT_TAGVAR(always_export_symbols, $1)=no
6188af9a7ee5Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6189af9a7ee5Smrg
6190e5383a99Smrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6191e5383a99Smrg	    _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'
6192e5383a99Smrg	    # If the export-symbols file already is a .def file (1st line
6193e5383a99Smrg	    # is EXPORTS), use it as is; otherwise, prepend...
6194e5383a99Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6195e5383a99Smrg	      cp $export_symbols $output_objdir/$soname.def;
6196e5383a99Smrg	    else
6197e5383a99Smrg	      echo EXPORTS > $output_objdir/$soname.def;
6198e5383a99Smrg	      cat $export_symbols >> $output_objdir/$soname.def;
6199e5383a99Smrg	    fi~
6200e5383a99Smrg	    $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'
6201e5383a99Smrg	  else
6202e5383a99Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6203e5383a99Smrg	  fi
6204e5383a99Smrg	  ;;
6205e5383a99Smrg	esac
6206e5383a99Smrg	;;
6207e5383a99Smrg      darwin* | rhapsody*)
6208e5383a99Smrg        _LT_DARWIN_LINKER_FEATURES($1)
6209e5383a99Smrg	;;
6210e5383a99Smrg
6211e5383a99Smrg      dgux*)
6212e5383a99Smrg        case $cc_basename in
6213e5383a99Smrg          ec++*)
6214e5383a99Smrg	    # FIXME: insert proper C++ library support
6215e5383a99Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6216e5383a99Smrg	    ;;
6217e5383a99Smrg          ghcx*)
6218e5383a99Smrg	    # Green Hills C++ Compiler
6219e5383a99Smrg	    # FIXME: insert proper C++ library support
6220e5383a99Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6221e5383a99Smrg	    ;;
6222e5383a99Smrg          *)
6223e5383a99Smrg	    # FIXME: insert proper C++ library support
6224e5383a99Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6225e5383a99Smrg	    ;;
6226e5383a99Smrg        esac
6227e5383a99Smrg        ;;
6228e5383a99Smrg
6229e5383a99Smrg      freebsd2.*)
6230e5383a99Smrg        # C++ shared libraries reported to be fairly broken before
6231e5383a99Smrg	# switch to ELF
6232e5383a99Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6233e5383a99Smrg        ;;
6234e5383a99Smrg
6235e5383a99Smrg      freebsd-elf*)
6236e5383a99Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6237e5383a99Smrg        ;;
6238e5383a99Smrg
6239e5383a99Smrg      freebsd* | dragonfly*)
6240e5383a99Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
6241e5383a99Smrg        # conventions
6242e5383a99Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
6243e5383a99Smrg        ;;
6244e5383a99Smrg
6245e5383a99Smrg      gnu*)
6246e5383a99Smrg        ;;
6247e5383a99Smrg
6248e5383a99Smrg      haiku*)
6249e5383a99Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6250e5383a99Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
6251e5383a99Smrg        ;;
6252e5383a99Smrg
6253e5383a99Smrg      hpux9*)
6254e5383a99Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6255e5383a99Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6256e5383a99Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6257e5383a99Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
6258e5383a99Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6259e5383a99Smrg				             # but as the default
6260e5383a99Smrg				             # location of the library.
6261e5383a99Smrg
6262e5383a99Smrg        case $cc_basename in
6263e5383a99Smrg          CC*)
6264e5383a99Smrg            # FIXME: insert proper C++ library support
6265e5383a99Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
6266e5383a99Smrg            ;;
6267e5383a99Smrg          aCC*)
6268e5383a99Smrg            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6269e5383a99Smrg            # Commands to make compiler produce verbose output that lists
6270e5383a99Smrg            # what "hidden" libraries, object files and flags are used when
6271e5383a99Smrg            # linking a shared library.
6272e5383a99Smrg            #
6273e5383a99Smrg            # There doesn't appear to be a way to prevent this compiler from
6274e5383a99Smrg            # explicitly linking system object files so we need to strip them
6275e5383a99Smrg            # from the output so that they don't get included in the library
6276e5383a99Smrg            # dependencies.
6277e5383a99Smrg            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"'
6278e5383a99Smrg            ;;
6279e5383a99Smrg          *)
6280e5383a99Smrg            if test "$GXX" = yes; then
6281e5383a99Smrg              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6282e5383a99Smrg            else
6283e5383a99Smrg              # FIXME: insert proper C++ library support
6284e5383a99Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
6285e5383a99Smrg            fi
6286e5383a99Smrg            ;;
6287e5383a99Smrg        esac
6288e5383a99Smrg        ;;
6289e5383a99Smrg
6290e5383a99Smrg      hpux10*|hpux11*)
6291e5383a99Smrg        if test $with_gnu_ld = no; then
6292e5383a99Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6293e5383a99Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6294e5383a99Smrg
6295e5383a99Smrg          case $host_cpu in
6296e5383a99Smrg            hppa*64*|ia64*)
6297e5383a99Smrg              ;;
6298e5383a99Smrg            *)
6299e5383a99Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6300e5383a99Smrg              ;;
6301e5383a99Smrg          esac
6302e5383a99Smrg        fi
6303e5383a99Smrg        case $host_cpu in
6304e5383a99Smrg          hppa*64*|ia64*)
6305e5383a99Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
6306e5383a99Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6307e5383a99Smrg            ;;
6308e5383a99Smrg          *)
6309e5383a99Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
6310e5383a99Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6311e5383a99Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6312e5383a99Smrg					         # but as the default
6313e5383a99Smrg					         # location of the library.
6314e5383a99Smrg            ;;
6315e5383a99Smrg        esac
6316e5383a99Smrg
6317e5383a99Smrg        case $cc_basename in
6318e5383a99Smrg          CC*)
6319e5383a99Smrg	    # FIXME: insert proper C++ library support
6320e5383a99Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6321e5383a99Smrg	    ;;
6322e5383a99Smrg          aCC*)
6323e5383a99Smrg	    case $host_cpu in
6324e5383a99Smrg	      hppa*64*)
6325e5383a99Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6326e5383a99Smrg	        ;;
6327e5383a99Smrg	      ia64*)
6328e5383a99Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6329e5383a99Smrg	        ;;
6330e5383a99Smrg	      *)
6331e5383a99Smrg	        _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'
6332e5383a99Smrg	        ;;
6333e5383a99Smrg	    esac
6334e5383a99Smrg	    # Commands to make compiler produce verbose output that lists
6335e5383a99Smrg	    # what "hidden" libraries, object files and flags are used when
6336e5383a99Smrg	    # linking a shared library.
6337e5383a99Smrg	    #
6338e5383a99Smrg	    # There doesn't appear to be a way to prevent this compiler from
6339e5383a99Smrg	    # explicitly linking system object files so we need to strip them
6340e5383a99Smrg	    # from the output so that they don't get included in the library
6341e5383a99Smrg	    # dependencies.
6342e5383a99Smrg	    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"'
6343e5383a99Smrg	    ;;
6344e5383a99Smrg          *)
6345e5383a99Smrg	    if test "$GXX" = yes; then
6346e5383a99Smrg	      if test $with_gnu_ld = no; then
6347e5383a99Smrg	        case $host_cpu in
6348e5383a99Smrg	          hppa*64*)
6349e5383a99Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6350e5383a99Smrg	            ;;
6351e5383a99Smrg	          ia64*)
6352e5383a99Smrg	            _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'
6353e5383a99Smrg	            ;;
6354e5383a99Smrg	          *)
6355e5383a99Smrg	            _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'
6356e5383a99Smrg	            ;;
6357e5383a99Smrg	        esac
6358e5383a99Smrg	      fi
6359e5383a99Smrg	    else
6360e5383a99Smrg	      # FIXME: insert proper C++ library support
6361e5383a99Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
6362e5383a99Smrg	    fi
6363e5383a99Smrg	    ;;
6364e5383a99Smrg        esac
6365e5383a99Smrg        ;;
6366e5383a99Smrg
6367e5383a99Smrg      interix[[3-9]]*)
6368e5383a99Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
6369e5383a99Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6370e5383a99Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6371e5383a99Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6372e5383a99Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
6373e5383a99Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
6374e5383a99Smrg	# default) and relocated if they conflict, which is a slow very memory
6375e5383a99Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
6376e5383a99Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
6377e5383a99Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
6378e5383a99Smrg	_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'
6379e5383a99Smrg	_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'
6380e5383a99Smrg	;;
6381e5383a99Smrg      irix5* | irix6*)
6382e5383a99Smrg        case $cc_basename in
6383e5383a99Smrg          CC*)
6384e5383a99Smrg	    # SGI C++
6385e5383a99Smrg	    _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'
6386e5383a99Smrg
6387e5383a99Smrg	    # Archives containing C++ object files must be created using
6388e5383a99Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
6389e5383a99Smrg	    # necessary to make sure instantiated templates are included
6390e5383a99Smrg	    # in the archive.
6391e5383a99Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
6392e5383a99Smrg	    ;;
6393e5383a99Smrg          *)
6394e5383a99Smrg	    if test "$GXX" = yes; then
6395e5383a99Smrg	      if test "$with_gnu_ld" = no; then
6396e5383a99Smrg	        _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'
6397e5383a99Smrg	      else
6398e5383a99Smrg	        _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'
6399e5383a99Smrg	      fi
6400e5383a99Smrg	    fi
6401e5383a99Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6402e5383a99Smrg	    ;;
6403e5383a99Smrg        esac
6404e5383a99Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6405e5383a99Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6406e5383a99Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
6407e5383a99Smrg        ;;
6408e5383a99Smrg
6409e5383a99Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
6410e5383a99Smrg        case $cc_basename in
6411e5383a99Smrg          KCC*)
6412e5383a99Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6413e5383a99Smrg
6414e5383a99Smrg	    # KCC will only create a shared library if the output file
6415e5383a99Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6416e5383a99Smrg	    # to its proper name (with version) after linking.
6417e5383a99Smrg	    _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'
6418e5383a99Smrg	    _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'
6419e5383a99Smrg	    # Commands to make compiler produce verbose output that lists
6420e5383a99Smrg	    # what "hidden" libraries, object files and flags are used when
6421e5383a99Smrg	    # linking a shared library.
6422e5383a99Smrg	    #
6423e5383a99Smrg	    # There doesn't appear to be a way to prevent this compiler from
6424e5383a99Smrg	    # explicitly linking system object files so we need to strip them
6425e5383a99Smrg	    # from the output so that they don't get included in the library
6426e5383a99Smrg	    # dependencies.
6427e5383a99Smrg	    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"'
6428e5383a99Smrg
6429e5383a99Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6430e5383a99Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6431e5383a99Smrg
6432e5383a99Smrg	    # Archives containing C++ object files must be created using
6433e5383a99Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
6434e5383a99Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
6435e5383a99Smrg	    ;;
6436e5383a99Smrg	  icpc* | ecpc* )
6437e5383a99Smrg	    # Intel C++
6438e5383a99Smrg	    with_gnu_ld=yes
6439e5383a99Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
6440e5383a99Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
6441e5383a99Smrg	    # earlier do not add the objects themselves.
6442e5383a99Smrg	    case `$CC -V 2>&1` in
6443e5383a99Smrg	      *"Version 7."*)
6444e5383a99Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6445e5383a99Smrg		_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'
6446e5383a99Smrg		;;
6447e5383a99Smrg	      *)  # Version 8.0 or newer
6448e5383a99Smrg	        tmp_idyn=
6449e5383a99Smrg	        case $host_cpu in
6450e5383a99Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
6451e5383a99Smrg		esac
6452e5383a99Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6453e5383a99Smrg		_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'
6454e5383a99Smrg		;;
6455e5383a99Smrg	    esac
6456e5383a99Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6457e5383a99Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6458e5383a99Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6459e5383a99Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6460e5383a99Smrg	    ;;
6461e5383a99Smrg          pgCC* | pgcpp*)
6462e5383a99Smrg            # Portland Group C++ compiler
6463e5383a99Smrg	    case `$CC -V` in
6464e5383a99Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
6465e5383a99Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
6466e5383a99Smrg		rm -rf $tpldir~
6467e5383a99Smrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
6468e5383a99Smrg		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
6469e5383a99Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
6470e5383a99Smrg		rm -rf $tpldir~
6471e5383a99Smrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
6472e5383a99Smrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
6473e5383a99Smrg		$RANLIB $oldlib'
6474e5383a99Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
6475e5383a99Smrg		rm -rf $tpldir~
6476e5383a99Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
6477e5383a99Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
6478e5383a99Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
6479e5383a99Smrg		rm -rf $tpldir~
6480e5383a99Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
6481e5383a99Smrg		$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'
6482e5383a99Smrg	      ;;
6483e5383a99Smrg	    *) # Version 6 and above use weak symbols
6484e5383a99Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
6485e5383a99Smrg	      _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'
6486e5383a99Smrg	      ;;
6487e5383a99Smrg	    esac
6488e5383a99Smrg
6489e5383a99Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
6490e5383a99Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6491e5383a99Smrg	    _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'
6492e5383a99Smrg            ;;
6493e5383a99Smrg	  cxx*)
6494e5383a99Smrg	    # Compaq C++
6495e5383a99Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6496e5383a99Smrg	    _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'
6497e5383a99Smrg
6498e5383a99Smrg	    runpath_var=LD_RUN_PATH
6499e5383a99Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6500e5383a99Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6501e5383a99Smrg
6502e5383a99Smrg	    # Commands to make compiler produce verbose output that lists
6503e5383a99Smrg	    # what "hidden" libraries, object files and flags are used when
6504e5383a99Smrg	    # linking a shared library.
6505e5383a99Smrg	    #
6506e5383a99Smrg	    # There doesn't appear to be a way to prevent this compiler from
6507e5383a99Smrg	    # explicitly linking system object files so we need to strip them
6508e5383a99Smrg	    # from the output so that they don't get included in the library
6509e5383a99Smrg	    # dependencies.
6510e5383a99Smrg	    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'
6511e5383a99Smrg	    ;;
6512e5383a99Smrg	  xl* | mpixl* | bgxl*)
6513e5383a99Smrg	    # IBM XL 8.0 on PPC, with GNU ld
6514e5383a99Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6515e5383a99Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6516e5383a99Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6517e5383a99Smrg	    if test "x$supports_anon_versioning" = xyes; then
6518e5383a99Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
6519e5383a99Smrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
6520e5383a99Smrg		echo "local: *; };" >> $output_objdir/$libname.ver~
6521e5383a99Smrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
6522e5383a99Smrg	    fi
6523e5383a99Smrg	    ;;
6524e5383a99Smrg	  *)
6525e5383a99Smrg	    case `$CC -V 2>&1 | sed 5q` in
6526e5383a99Smrg	    *Sun\ C*)
6527e5383a99Smrg	      # Sun C++ 5.9
6528e5383a99Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6529e5383a99Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6530e5383a99Smrg	      _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'
6531e5383a99Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6532e5383a99Smrg	      _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'
6533e5383a99Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
6534e5383a99Smrg
6535e5383a99Smrg	      # Not sure whether something based on
6536e5383a99Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
6537e5383a99Smrg	      # would be better.
6538e5383a99Smrg	      output_verbose_link_cmd='func_echo_all'
6539e5383a99Smrg
6540e5383a99Smrg	      # Archives containing C++ object files must be created using
6541e5383a99Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
6542e5383a99Smrg	      # necessary to make sure instantiated templates are included
6543e5383a99Smrg	      # in the archive.
6544e5383a99Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6545e5383a99Smrg	      ;;
6546e5383a99Smrg	    esac
6547e5383a99Smrg	    ;;
6548e5383a99Smrg	esac
6549e5383a99Smrg	;;
6550e5383a99Smrg
6551e5383a99Smrg      lynxos*)
6552e5383a99Smrg        # FIXME: insert proper C++ library support
6553e5383a99Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
6554e5383a99Smrg	;;
6555e5383a99Smrg
6556e5383a99Smrg      m88k*)
6557e5383a99Smrg        # FIXME: insert proper C++ library support
6558e5383a99Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6559e5383a99Smrg	;;
6560e5383a99Smrg
6561e5383a99Smrg      mvs*)
6562e5383a99Smrg        case $cc_basename in
6563e5383a99Smrg          cxx*)
6564e5383a99Smrg	    # FIXME: insert proper C++ library support
6565e5383a99Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6566e5383a99Smrg	    ;;
6567e5383a99Smrg	  *)
6568e5383a99Smrg	    # FIXME: insert proper C++ library support
6569e5383a99Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6570e5383a99Smrg	    ;;
6571e5383a99Smrg	esac
6572e5383a99Smrg	;;
6573e5383a99Smrg
6574e5383a99Smrg      netbsd*)
6575e5383a99Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6576e5383a99Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
6577e5383a99Smrg	  wlarc=
6578e5383a99Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6579e5383a99Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
6580e5383a99Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6581e5383a99Smrg	fi
6582e5383a99Smrg	# Workaround some broken pre-1.5 toolchains
6583e5383a99Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
6584e5383a99Smrg	;;
6585e5383a99Smrg
6586e5383a99Smrg      *nto* | *qnx*)
6587e5383a99Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
6588e5383a99Smrg	;;
6589e5383a99Smrg
6590e5383a99Smrg      openbsd2*)
6591e5383a99Smrg        # C++ shared libraries are fairly broken
6592e5383a99Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
6593e5383a99Smrg	;;
6594e5383a99Smrg
6595e5383a99Smrg      openbsd*)
6596e5383a99Smrg	if test -f /usr/libexec/ld.so; then
6597e5383a99Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
6598e5383a99Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6599e5383a99Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6600e5383a99Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6601e5383a99Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6602e5383a99Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6603e5383a99Smrg	    _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'
6604e5383a99Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6605e5383a99Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6606e5383a99Smrg	  fi
6607e5383a99Smrg	  output_verbose_link_cmd=func_echo_all
6608e5383a99Smrg	else
6609e5383a99Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6610e5383a99Smrg	fi
6611e5383a99Smrg	;;
6612e5383a99Smrg
6613e5383a99Smrg      osf3* | osf4* | osf5*)
6614e5383a99Smrg        case $cc_basename in
6615e5383a99Smrg          KCC*)
6616e5383a99Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6617e5383a99Smrg
6618e5383a99Smrg	    # KCC will only create a shared library if the output file
6619e5383a99Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6620e5383a99Smrg	    # to its proper name (with version) after linking.
6621e5383a99Smrg	    _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'
6622e5383a99Smrg
6623e5383a99Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6624e5383a99Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6625e5383a99Smrg
6626e5383a99Smrg	    # Archives containing C++ object files must be created using
6627e5383a99Smrg	    # the KAI C++ compiler.
6628e5383a99Smrg	    case $host in
6629e5383a99Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
6630e5383a99Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
6631e5383a99Smrg	    esac
6632e5383a99Smrg	    ;;
6633e5383a99Smrg          RCC*)
6634e5383a99Smrg	    # Rational C++ 2.4.1
6635e5383a99Smrg	    # FIXME: insert proper C++ library support
6636e5383a99Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6637e5383a99Smrg	    ;;
6638e5383a99Smrg          cxx*)
6639e5383a99Smrg	    case $host in
6640e5383a99Smrg	      osf3*)
6641e5383a99Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6642e5383a99Smrg	        _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'
6643e5383a99Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6644e5383a99Smrg		;;
6645e5383a99Smrg	      *)
6646e5383a99Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6647e5383a99Smrg	        _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'
6648e5383a99Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
6649e5383a99Smrg	          echo "-hidden">> $lib.exp~
6650e5383a99Smrg	          $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~
6651e5383a99Smrg	          $RM $lib.exp'
6652e5383a99Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6653e5383a99Smrg		;;
6654e5383a99Smrg	    esac
6655e5383a99Smrg
6656e5383a99Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6657e5383a99Smrg
6658e5383a99Smrg	    # Commands to make compiler produce verbose output that lists
6659e5383a99Smrg	    # what "hidden" libraries, object files and flags are used when
6660e5383a99Smrg	    # linking a shared library.
6661e5383a99Smrg	    #
6662e5383a99Smrg	    # There doesn't appear to be a way to prevent this compiler from
6663e5383a99Smrg	    # explicitly linking system object files so we need to strip them
6664e5383a99Smrg	    # from the output so that they don't get included in the library
6665e5383a99Smrg	    # dependencies.
6666e5383a99Smrg	    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"'
6667e5383a99Smrg	    ;;
6668e5383a99Smrg	  *)
6669e5383a99Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6670e5383a99Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6671e5383a99Smrg	      case $host in
6672e5383a99Smrg	        osf3*)
6673e5383a99Smrg	          _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'
6674e5383a99Smrg		  ;;
6675e5383a99Smrg	        *)
6676e5383a99Smrg	          _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'
6677e5383a99Smrg		  ;;
6678e5383a99Smrg	      esac
6679e5383a99Smrg
6680e5383a99Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6681e5383a99Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6682e5383a99Smrg
6683e5383a99Smrg	      # Commands to make compiler produce verbose output that lists
6684e5383a99Smrg	      # what "hidden" libraries, object files and flags are used when
6685e5383a99Smrg	      # linking a shared library.
6686e5383a99Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6687e5383a99Smrg
6688e5383a99Smrg	    else
6689e5383a99Smrg	      # FIXME: insert proper C++ library support
6690e5383a99Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
6691e5383a99Smrg	    fi
6692e5383a99Smrg	    ;;
6693e5383a99Smrg        esac
6694e5383a99Smrg        ;;
6695e5383a99Smrg
6696e5383a99Smrg      psos*)
6697e5383a99Smrg        # FIXME: insert proper C++ library support
6698e5383a99Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6699e5383a99Smrg        ;;
6700e5383a99Smrg
6701e5383a99Smrg      sunos4*)
6702e5383a99Smrg        case $cc_basename in
6703e5383a99Smrg          CC*)
6704e5383a99Smrg	    # Sun C++ 4.x
6705e5383a99Smrg	    # FIXME: insert proper C++ library support
6706e5383a99Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6707e5383a99Smrg	    ;;
6708e5383a99Smrg          lcc*)
6709e5383a99Smrg	    # Lucid
6710e5383a99Smrg	    # FIXME: insert proper C++ library support
6711e5383a99Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6712e5383a99Smrg	    ;;
6713e5383a99Smrg          *)
6714e5383a99Smrg	    # FIXME: insert proper C++ library support
6715e5383a99Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6716e5383a99Smrg	    ;;
6717e5383a99Smrg        esac
6718e5383a99Smrg        ;;
6719e5383a99Smrg
6720e5383a99Smrg      solaris*)
6721e5383a99Smrg        case $cc_basename in
6722e5383a99Smrg          CC* | sunCC*)
6723e5383a99Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
6724e5383a99Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
6725e5383a99Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6726e5383a99Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6727e5383a99Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6728e5383a99Smrg	      $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'
6729e5383a99Smrg
6730e5383a99Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6731e5383a99Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6732e5383a99Smrg	    case $host_os in
6733e5383a99Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6734e5383a99Smrg	      *)
6735e5383a99Smrg		# The compiler driver will combine and reorder linker options,
6736e5383a99Smrg		# but understands `-z linker_flag'.
6737e5383a99Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
6738e5383a99Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6739e5383a99Smrg	        ;;
6740e5383a99Smrg	    esac
6741e5383a99Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6742e5383a99Smrg
6743e5383a99Smrg	    output_verbose_link_cmd='func_echo_all'
6744e5383a99Smrg
6745e5383a99Smrg	    # Archives containing C++ object files must be created using
6746e5383a99Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
6747e5383a99Smrg	    # necessary to make sure instantiated templates are included
6748e5383a99Smrg	    # in the archive.
6749e5383a99Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6750e5383a99Smrg	    ;;
6751e5383a99Smrg          gcx*)
6752e5383a99Smrg	    # Green Hills C++ Compiler
6753e5383a99Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6754e5383a99Smrg
6755e5383a99Smrg	    # The C++ compiler must be used to create the archive.
6756e5383a99Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
6757e5383a99Smrg	    ;;
6758e5383a99Smrg          *)
6759e5383a99Smrg	    # GNU C++ compiler with Solaris linker
6760e5383a99Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6761e5383a99Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
6762e5383a99Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
6763e5383a99Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6764e5383a99Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6765e5383a99Smrg		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6766e5383a99Smrg
6767e5383a99Smrg	        # Commands to make compiler produce verbose output that lists
6768e5383a99Smrg	        # what "hidden" libraries, object files and flags are used when
6769e5383a99Smrg	        # linking a shared library.
6770e5383a99Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6771e5383a99Smrg	      else
6772e5383a99Smrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
6773e5383a99Smrg	        # platform.
6774e5383a99Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6775e5383a99Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6776e5383a99Smrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6777e5383a99Smrg
6778e5383a99Smrg	        # Commands to make compiler produce verbose output that lists
6779e5383a99Smrg	        # what "hidden" libraries, object files and flags are used when
6780e5383a99Smrg	        # linking a shared library.
6781e5383a99Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6782e5383a99Smrg	      fi
6783e5383a99Smrg
6784e5383a99Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
6785e5383a99Smrg	      case $host_os in
6786e5383a99Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6787e5383a99Smrg		*)
6788e5383a99Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6789e5383a99Smrg		  ;;
6790e5383a99Smrg	      esac
6791e5383a99Smrg	    fi
6792e5383a99Smrg	    ;;
6793e5383a99Smrg        esac
6794e5383a99Smrg        ;;
6795e5383a99Smrg
6796e5383a99Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6797e5383a99Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6798e5383a99Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6799e5383a99Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6800e5383a99Smrg      runpath_var='LD_RUN_PATH'
6801e5383a99Smrg
6802e5383a99Smrg      case $cc_basename in
6803e5383a99Smrg        CC*)
6804e5383a99Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6805e5383a99Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6806e5383a99Smrg	  ;;
6807e5383a99Smrg	*)
6808e5383a99Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6809e5383a99Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6810e5383a99Smrg	  ;;
6811e5383a99Smrg      esac
6812e5383a99Smrg      ;;
6813e5383a99Smrg
6814e5383a99Smrg      sysv5* | sco3.2v5* | sco5v6*)
6815e5383a99Smrg	# Note: We can NOT use -z defs as we might desire, because we do not
6816e5383a99Smrg	# link with -lc, and that would cause any symbols used from libc to
6817e5383a99Smrg	# always be unresolved, which means just about no library would
6818e5383a99Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
6819e5383a99Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
6820e5383a99Smrg	# as -z defs.
6821e5383a99Smrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6822e5383a99Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6823e5383a99Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6824e5383a99Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6825e5383a99Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6826e5383a99Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6827e5383a99Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
6828e5383a99Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6829e5383a99Smrg	runpath_var='LD_RUN_PATH'
6830e5383a99Smrg
6831e5383a99Smrg	case $cc_basename in
6832e5383a99Smrg          CC*)
6833e5383a99Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6834e5383a99Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6835e5383a99Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
6836e5383a99Smrg	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
6837e5383a99Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
6838e5383a99Smrg	      '"$_LT_TAGVAR(reload_cmds, $1)"
6839e5383a99Smrg	    ;;
6840e5383a99Smrg	  *)
6841e5383a99Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6842e5383a99Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6843e5383a99Smrg	    ;;
6844e5383a99Smrg	esac
6845e5383a99Smrg      ;;
6846e5383a99Smrg
6847e5383a99Smrg      tandem*)
6848e5383a99Smrg        case $cc_basename in
6849e5383a99Smrg          NCC*)
6850e5383a99Smrg	    # NonStop-UX NCC 3.20
6851e5383a99Smrg	    # FIXME: insert proper C++ library support
6852e5383a99Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6853e5383a99Smrg	    ;;
6854e5383a99Smrg          *)
6855e5383a99Smrg	    # FIXME: insert proper C++ library support
6856e5383a99Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6857e5383a99Smrg	    ;;
6858e5383a99Smrg        esac
6859e5383a99Smrg        ;;
6860e5383a99Smrg
6861e5383a99Smrg      vxworks*)
6862e5383a99Smrg        # FIXME: insert proper C++ library support
6863e5383a99Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6864e5383a99Smrg        ;;
6865e5383a99Smrg
6866e5383a99Smrg      *)
6867e5383a99Smrg        # FIXME: insert proper C++ library support
6868e5383a99Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6869e5383a99Smrg        ;;
6870e5383a99Smrg    esac
6871e5383a99Smrg
6872e5383a99Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6873e5383a99Smrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6874e5383a99Smrg
6875e5383a99Smrg    _LT_TAGVAR(GCC, $1)="$GXX"
6876e5383a99Smrg    _LT_TAGVAR(LD, $1)="$LD"
6877e5383a99Smrg
6878e5383a99Smrg    ## CAVEAT EMPTOR:
6879e5383a99Smrg    ## There is no encapsulation within the following macros, do not change
6880e5383a99Smrg    ## the running order or otherwise move them around unless you know exactly
6881e5383a99Smrg    ## what you are doing...
6882e5383a99Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
6883e5383a99Smrg    _LT_COMPILER_PIC($1)
6884e5383a99Smrg    _LT_COMPILER_C_O($1)
6885e5383a99Smrg    _LT_COMPILER_FILE_LOCKS($1)
6886e5383a99Smrg    _LT_LINKER_SHLIBS($1)
6887e5383a99Smrg    _LT_SYS_DYNAMIC_LINKER($1)
6888e5383a99Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
6889e5383a99Smrg
6890e5383a99Smrg    _LT_CONFIG($1)
6891e5383a99Smrg  fi # test -n "$compiler"
6892e5383a99Smrg
6893e5383a99Smrg  CC=$lt_save_CC
6894e5383a99Smrg  CFLAGS=$lt_save_CFLAGS
6895e5383a99Smrg  LDCXX=$LD
6896e5383a99Smrg  LD=$lt_save_LD
6897e5383a99Smrg  GCC=$lt_save_GCC
6898e5383a99Smrg  with_gnu_ld=$lt_save_with_gnu_ld
6899e5383a99Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
6900e5383a99Smrg  lt_cv_path_LD=$lt_save_path_LD
6901e5383a99Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
6902e5383a99Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
6903e5383a99Smrgfi # test "$_lt_caught_CXX_error" != yes
6904e5383a99Smrg
6905e5383a99SmrgAC_LANG_POP
6906e5383a99Smrg])# _LT_LANG_CXX_CONFIG
6907e5383a99Smrg
6908e5383a99Smrg
6909e5383a99Smrg# _LT_FUNC_STRIPNAME_CNF
6910e5383a99Smrg# ----------------------
6911e5383a99Smrg# func_stripname_cnf prefix suffix name
6912e5383a99Smrg# strip PREFIX and SUFFIX off of NAME.
6913e5383a99Smrg# PREFIX and SUFFIX must not contain globbing or regex special
6914e5383a99Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
6915e5383a99Smrg# dot (in which case that matches only a dot).
6916e5383a99Smrg#
6917e5383a99Smrg# This function is identical to the (non-XSI) version of func_stripname,
6918e5383a99Smrg# except this one can be used by m4 code that may be executed by configure,
6919e5383a99Smrg# rather than the libtool script.
6920e5383a99Smrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
6921e5383a99SmrgAC_REQUIRE([_LT_DECL_SED])
6922e5383a99SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
6923e5383a99Smrgfunc_stripname_cnf ()
6924e5383a99Smrg{
6925e5383a99Smrg  case ${2} in
6926e5383a99Smrg  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
6927e5383a99Smrg  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
6928e5383a99Smrg  esac
6929e5383a99Smrg} # func_stripname_cnf
6930e5383a99Smrg])# _LT_FUNC_STRIPNAME_CNF
6931e5383a99Smrg
6932e5383a99Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
6933e5383a99Smrg# ---------------------------------
6934e5383a99Smrg# Figure out "hidden" library dependencies from verbose
6935e5383a99Smrg# compiler output when linking a shared library.
6936e5383a99Smrg# Parse the compiler output and extract the necessary
6937e5383a99Smrg# objects, libraries and library flags.
6938e5383a99Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
6939e5383a99Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6940e5383a99SmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
6941e5383a99Smrg# Dependencies to place before and after the object being linked:
6942e5383a99Smrg_LT_TAGVAR(predep_objects, $1)=
6943e5383a99Smrg_LT_TAGVAR(postdep_objects, $1)=
6944e5383a99Smrg_LT_TAGVAR(predeps, $1)=
6945e5383a99Smrg_LT_TAGVAR(postdeps, $1)=
6946e5383a99Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
6947e5383a99Smrg
6948e5383a99Smrgdnl we can't use the lt_simple_compile_test_code here,
6949e5383a99Smrgdnl because it contains code intended for an executable,
6950e5383a99Smrgdnl not a library.  It's possible we should let each
6951e5383a99Smrgdnl tag define a new lt_????_link_test_code variable,
6952e5383a99Smrgdnl but it's only used here...
6953e5383a99Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
6954e5383a99Smrgint a;
6955e5383a99Smrgvoid foo (void) { a = 0; }
6956e5383a99Smrg_LT_EOF
6957e5383a99Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
6958e5383a99Smrgclass Foo
6959e5383a99Smrg{
6960e5383a99Smrgpublic:
6961e5383a99Smrg  Foo (void) { a = 0; }
6962e5383a99Smrgprivate:
6963e5383a99Smrg  int a;
6964e5383a99Smrg};
6965e5383a99Smrg_LT_EOF
6966e5383a99Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
6967e5383a99Smrg      subroutine foo
6968e5383a99Smrg      implicit none
6969e5383a99Smrg      integer*4 a
6970e5383a99Smrg      a=0
6971e5383a99Smrg      return
6972e5383a99Smrg      end
6973e5383a99Smrg_LT_EOF
6974e5383a99Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
6975e5383a99Smrg      subroutine foo
6976e5383a99Smrg      implicit none
6977e5383a99Smrg      integer a
6978e5383a99Smrg      a=0
6979e5383a99Smrg      return
6980e5383a99Smrg      end
6981e5383a99Smrg_LT_EOF
6982e5383a99Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
6983e5383a99Smrgpublic class foo {
6984e5383a99Smrg  private int a;
6985e5383a99Smrg  public void bar (void) {
6986e5383a99Smrg    a = 0;
6987e5383a99Smrg  }
6988e5383a99Smrg};
6989e5383a99Smrg_LT_EOF
6990e5383a99Smrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
6991e5383a99Smrgpackage foo
6992e5383a99Smrgfunc foo() {
6993e5383a99Smrg}
6994e5383a99Smrg_LT_EOF
6995e5383a99Smrg])
6996e5383a99Smrg
6997e5383a99Smrg_lt_libdeps_save_CFLAGS=$CFLAGS
6998e5383a99Smrgcase "$CC $CFLAGS " in #(
6999e5383a99Smrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
7000e5383a99Smrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
7001e5383a99Smrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
7002e5383a99Smrgesac
7003e5383a99Smrg
7004e5383a99Smrgdnl Parse the compiler output and extract the necessary
7005e5383a99Smrgdnl objects, libraries and library flags.
7006e5383a99Smrgif AC_TRY_EVAL(ac_compile); then
7007e5383a99Smrg  # Parse the compiler output and extract the necessary
7008e5383a99Smrg  # objects, libraries and library flags.
7009e5383a99Smrg
7010e5383a99Smrg  # Sentinel used to keep track of whether or not we are before
7011e5383a99Smrg  # the conftest object file.
7012e5383a99Smrg  pre_test_object_deps_done=no
7013e5383a99Smrg
7014e5383a99Smrg  for p in `eval "$output_verbose_link_cmd"`; do
7015e5383a99Smrg    case ${prev}${p} in
7016e5383a99Smrg
7017e5383a99Smrg    -L* | -R* | -l*)
7018e5383a99Smrg       # Some compilers place space between "-{L,R}" and the path.
7019e5383a99Smrg       # Remove the space.
7020e5383a99Smrg       if test $p = "-L" ||
7021e5383a99Smrg          test $p = "-R"; then
7022e5383a99Smrg	 prev=$p
7023e5383a99Smrg	 continue
7024e5383a99Smrg       fi
7025e5383a99Smrg
7026e5383a99Smrg       # Expand the sysroot to ease extracting the directories later.
7027e5383a99Smrg       if test -z "$prev"; then
7028e5383a99Smrg         case $p in
7029e5383a99Smrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
7030e5383a99Smrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
7031e5383a99Smrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
7032e5383a99Smrg         esac
7033e5383a99Smrg       fi
7034e5383a99Smrg       case $p in
7035e5383a99Smrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
7036e5383a99Smrg       esac
7037e5383a99Smrg       if test "$pre_test_object_deps_done" = no; then
7038e5383a99Smrg	 case ${prev} in
7039e5383a99Smrg	 -L | -R)
7040e5383a99Smrg	   # Internal compiler library paths should come after those
7041e5383a99Smrg	   # provided the user.  The postdeps already come after the
7042e5383a99Smrg	   # user supplied libs so there is no need to process them.
7043e5383a99Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
7044e5383a99Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
7045e5383a99Smrg	   else
7046e5383a99Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
7047e5383a99Smrg	   fi
7048e5383a99Smrg	   ;;
7049e5383a99Smrg	 # The "-l" case would never come before the object being
7050e5383a99Smrg	 # linked, so don't bother handling this case.
7051e5383a99Smrg	 esac
7052e5383a99Smrg       else
7053e5383a99Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
7054e5383a99Smrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
7055e5383a99Smrg	 else
7056e5383a99Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
7057e5383a99Smrg	 fi
7058e5383a99Smrg       fi
7059e5383a99Smrg       prev=
7060e5383a99Smrg       ;;
7061e5383a99Smrg
7062e5383a99Smrg    *.lto.$objext) ;; # Ignore GCC LTO objects
7063e5383a99Smrg    *.$objext)
7064e5383a99Smrg       # This assumes that the test object file only shows up
7065e5383a99Smrg       # once in the compiler output.
7066e5383a99Smrg       if test "$p" = "conftest.$objext"; then
7067e5383a99Smrg	 pre_test_object_deps_done=yes
7068e5383a99Smrg	 continue
7069e5383a99Smrg       fi
7070e5383a99Smrg
7071e5383a99Smrg       if test "$pre_test_object_deps_done" = no; then
7072e5383a99Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
7073e5383a99Smrg	   _LT_TAGVAR(predep_objects, $1)="$p"
7074e5383a99Smrg	 else
7075e5383a99Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
7076e5383a99Smrg	 fi
7077e5383a99Smrg       else
7078e5383a99Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
7079e5383a99Smrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
7080e5383a99Smrg	 else
7081e5383a99Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
7082e5383a99Smrg	 fi
7083e5383a99Smrg       fi
7084e5383a99Smrg       ;;
7085e5383a99Smrg
7086e5383a99Smrg    *) ;; # Ignore the rest.
7087af9a7ee5Smrg
7088e5383a99Smrg    esac
7089e5383a99Smrg  done
7090af9a7ee5Smrg
7091e5383a99Smrg  # Clean up.
7092e5383a99Smrg  rm -f a.out a.exe
7093e5383a99Smrgelse
7094e5383a99Smrg  echo "libtool.m4: error: problem compiling $1 test program"
7095e5383a99Smrgfi
7096af9a7ee5Smrg
7097e5383a99Smrg$RM -f confest.$objext
7098e5383a99SmrgCFLAGS=$_lt_libdeps_save_CFLAGS
7099af9a7ee5Smrg
7100e5383a99Smrg# PORTME: override above test on systems where it is broken
7101e5383a99Smrgm4_if([$1], [CXX],
7102e5383a99Smrg[case $host_os in
7103e5383a99Smrginterix[[3-9]]*)
7104e5383a99Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
7105e5383a99Smrg  # hack all around it, let's just trust "g++" to DTRT.
7106e5383a99Smrg  _LT_TAGVAR(predep_objects,$1)=
7107e5383a99Smrg  _LT_TAGVAR(postdep_objects,$1)=
7108e5383a99Smrg  _LT_TAGVAR(postdeps,$1)=
7109e5383a99Smrg  ;;
7110af9a7ee5Smrg
7111e5383a99Smrglinux*)
7112e5383a99Smrg  case `$CC -V 2>&1 | sed 5q` in
7113e5383a99Smrg  *Sun\ C*)
7114e5383a99Smrg    # Sun C++ 5.9
7115af9a7ee5Smrg
7116e5383a99Smrg    # The more standards-conforming stlport4 library is
7117e5383a99Smrg    # incompatible with the Cstd library. Avoid specifying
7118e5383a99Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
7119e5383a99Smrg    # -library=stlport4 depends on it.
7120e5383a99Smrg    case " $CXX $CXXFLAGS " in
7121e5383a99Smrg    *" -library=stlport4 "*)
7122e5383a99Smrg      solaris_use_stlport4=yes
7123e5383a99Smrg      ;;
7124e5383a99Smrg    esac
7125af9a7ee5Smrg
7126e5383a99Smrg    if test "$solaris_use_stlport4" != yes; then
7127e5383a99Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7128e5383a99Smrg    fi
7129e5383a99Smrg    ;;
7130e5383a99Smrg  esac
7131e5383a99Smrg  ;;
7132af9a7ee5Smrg
7133e5383a99Smrgsolaris*)
7134e5383a99Smrg  case $cc_basename in
7135e5383a99Smrg  CC* | sunCC*)
7136e5383a99Smrg    # The more standards-conforming stlport4 library is
7137e5383a99Smrg    # incompatible with the Cstd library. Avoid specifying
7138e5383a99Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
7139e5383a99Smrg    # -library=stlport4 depends on it.
7140e5383a99Smrg    case " $CXX $CXXFLAGS " in
7141e5383a99Smrg    *" -library=stlport4 "*)
7142e5383a99Smrg      solaris_use_stlport4=yes
7143e5383a99Smrg      ;;
7144e5383a99Smrg    esac
7145af9a7ee5Smrg
7146e5383a99Smrg    # Adding this requires a known-good setup of shared libraries for
7147e5383a99Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
7148e5383a99Smrg    # archive will be linked into the output, leading to subtle bugs.
7149e5383a99Smrg    if test "$solaris_use_stlport4" != yes; then
7150e5383a99Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7151e5383a99Smrg    fi
7152e5383a99Smrg    ;;
7153e5383a99Smrg  esac
7154e5383a99Smrg  ;;
7155e5383a99Smrgesac
7156e5383a99Smrg])
7157af9a7ee5Smrg
7158e5383a99Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
7159e5383a99Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
7160e5383a99Smrgesac
7161e5383a99Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
7162e5383a99Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
7163e5383a99Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
7164e5383a99Smrgfi
7165e5383a99Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
7166e5383a99Smrg    [The directories searched by this compiler when creating a shared library])
7167e5383a99Smrg_LT_TAGDECL([], [predep_objects], [1],
7168e5383a99Smrg    [Dependencies to place before and after the objects being linked to
7169e5383a99Smrg    create a shared library])
7170e5383a99Smrg_LT_TAGDECL([], [postdep_objects], [1])
7171e5383a99Smrg_LT_TAGDECL([], [predeps], [1])
7172e5383a99Smrg_LT_TAGDECL([], [postdeps], [1])
7173e5383a99Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
7174e5383a99Smrg    [The library search path used internally by the compiler when linking
7175e5383a99Smrg    a shared library])
7176e5383a99Smrg])# _LT_SYS_HIDDEN_LIBDEPS
7177af9a7ee5Smrg
7178af9a7ee5Smrg
7179e5383a99Smrg# _LT_LANG_F77_CONFIG([TAG])
7180e5383a99Smrg# --------------------------
7181e5383a99Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
7182e5383a99Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7183e5383a99Smrg# to write the compiler configuration to `libtool'.
7184e5383a99Smrgm4_defun([_LT_LANG_F77_CONFIG],
7185e5383a99Smrg[AC_LANG_PUSH(Fortran 77)
7186e5383a99Smrgif test -z "$F77" || test "X$F77" = "Xno"; then
7187e5383a99Smrg  _lt_disable_F77=yes
7188e5383a99Smrgfi
7189e5383a99Smrg
7190e5383a99Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7191e5383a99Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
7192e5383a99Smrg_LT_TAGVAR(always_export_symbols, $1)=no
7193e5383a99Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
7194e5383a99Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7195e5383a99Smrg_LT_TAGVAR(hardcode_direct, $1)=no
7196e5383a99Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7197e5383a99Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7198e5383a99Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
7199e5383a99Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
7200e5383a99Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
7201e5383a99Smrg_LT_TAGVAR(inherit_rpath, $1)=no
7202e5383a99Smrg_LT_TAGVAR(module_cmds, $1)=
7203e5383a99Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
7204e5383a99Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
7205e5383a99Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7206e5383a99Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7207e5383a99Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7208e5383a99Smrg_LT_TAGVAR(no_undefined_flag, $1)=
7209e5383a99Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
7210e5383a99Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7211af9a7ee5Smrg
7212e5383a99Smrg# Source file extension for f77 test sources.
7213e5383a99Smrgac_ext=f
7214af9a7ee5Smrg
7215e5383a99Smrg# Object file extension for compiled f77 test sources.
7216e5383a99Smrgobjext=o
7217e5383a99Smrg_LT_TAGVAR(objext, $1)=$objext
7218af9a7ee5Smrg
7219e5383a99Smrg# No sense in running all these tests if we already determined that
7220e5383a99Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
7221e5383a99Smrg# are currently assumed to apply to all compilers on this platform,
7222e5383a99Smrg# and will be corrupted by setting them based on a non-working compiler.
7223e5383a99Smrgif test "$_lt_disable_F77" != yes; then
7224e5383a99Smrg  # Code to be used in simple compile tests
7225e5383a99Smrg  lt_simple_compile_test_code="\
7226e5383a99Smrg      subroutine t
7227e5383a99Smrg      return
7228e5383a99Smrg      end
7229e5383a99Smrg"
7230af9a7ee5Smrg
7231e5383a99Smrg  # Code to be used in simple link tests
7232e5383a99Smrg  lt_simple_link_test_code="\
7233e5383a99Smrg      program t
7234e5383a99Smrg      end
7235e5383a99Smrg"
7236af9a7ee5Smrg
7237e5383a99Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7238e5383a99Smrg  _LT_TAG_COMPILER
7239af9a7ee5Smrg
7240e5383a99Smrg  # save warnings/boilerplate of simple test code
7241e5383a99Smrg  _LT_COMPILER_BOILERPLATE
7242e5383a99Smrg  _LT_LINKER_BOILERPLATE
7243af9a7ee5Smrg
7244e5383a99Smrg  # Allow CC to be a program name with arguments.
7245e5383a99Smrg  lt_save_CC="$CC"
7246e5383a99Smrg  lt_save_GCC=$GCC
7247e5383a99Smrg  lt_save_CFLAGS=$CFLAGS
7248e5383a99Smrg  CC=${F77-"f77"}
7249e5383a99Smrg  CFLAGS=$FFLAGS
7250e5383a99Smrg  compiler=$CC
7251e5383a99Smrg  _LT_TAGVAR(compiler, $1)=$CC
7252e5383a99Smrg  _LT_CC_BASENAME([$compiler])
7253e5383a99Smrg  GCC=$G77
7254e5383a99Smrg  if test -n "$compiler"; then
7255e5383a99Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
7256e5383a99Smrg    AC_MSG_RESULT([$can_build_shared])
7257af9a7ee5Smrg
7258e5383a99Smrg    AC_MSG_CHECKING([whether to build shared libraries])
7259e5383a99Smrg    test "$can_build_shared" = "no" && enable_shared=no
7260e5383a99Smrg
7261e5383a99Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
7262e5383a99Smrg    # are all built from PIC.
7263e5383a99Smrg    case $host_os in
7264e5383a99Smrg      aix3*)
7265e5383a99Smrg        test "$enable_shared" = yes && enable_static=no
7266e5383a99Smrg        if test -n "$RANLIB"; then
7267e5383a99Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7268e5383a99Smrg          postinstall_cmds='$RANLIB $lib'
7269e5383a99Smrg        fi
7270e5383a99Smrg        ;;
7271e5383a99Smrg      aix[[4-9]]*)
7272e5383a99Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7273e5383a99Smrg	  test "$enable_shared" = yes && enable_static=no
7274e5383a99Smrg	fi
7275e5383a99Smrg        ;;
7276e5383a99Smrg    esac
7277e5383a99Smrg    AC_MSG_RESULT([$enable_shared])
7278e5383a99Smrg
7279e5383a99Smrg    AC_MSG_CHECKING([whether to build static libraries])
7280e5383a99Smrg    # Make sure either enable_shared or enable_static is yes.
7281e5383a99Smrg    test "$enable_shared" = yes || enable_static=yes
7282e5383a99Smrg    AC_MSG_RESULT([$enable_static])
7283e5383a99Smrg
7284e5383a99Smrg    _LT_TAGVAR(GCC, $1)="$G77"
7285e5383a99Smrg    _LT_TAGVAR(LD, $1)="$LD"
7286e5383a99Smrg
7287e5383a99Smrg    ## CAVEAT EMPTOR:
7288e5383a99Smrg    ## There is no encapsulation within the following macros, do not change
7289e5383a99Smrg    ## the running order or otherwise move them around unless you know exactly
7290e5383a99Smrg    ## what you are doing...
7291e5383a99Smrg    _LT_COMPILER_PIC($1)
7292e5383a99Smrg    _LT_COMPILER_C_O($1)
7293e5383a99Smrg    _LT_COMPILER_FILE_LOCKS($1)
7294e5383a99Smrg    _LT_LINKER_SHLIBS($1)
7295e5383a99Smrg    _LT_SYS_DYNAMIC_LINKER($1)
7296e5383a99Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7297af9a7ee5Smrg
7298e5383a99Smrg    _LT_CONFIG($1)
7299e5383a99Smrg  fi # test -n "$compiler"
7300af9a7ee5Smrg
7301e5383a99Smrg  GCC=$lt_save_GCC
7302e5383a99Smrg  CC="$lt_save_CC"
7303e5383a99Smrg  CFLAGS="$lt_save_CFLAGS"
7304e5383a99Smrgfi # test "$_lt_disable_F77" != yes
7305caade7ccSmrg
7306e5383a99SmrgAC_LANG_POP
7307e5383a99Smrg])# _LT_LANG_F77_CONFIG
7308caade7ccSmrg
7309caade7ccSmrg
7310e5383a99Smrg# _LT_LANG_FC_CONFIG([TAG])
7311e5383a99Smrg# -------------------------
7312e5383a99Smrg# Ensure that the configuration variables for a Fortran compiler are
7313e5383a99Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7314e5383a99Smrg# to write the compiler configuration to `libtool'.
7315e5383a99Smrgm4_defun([_LT_LANG_FC_CONFIG],
7316e5383a99Smrg[AC_LANG_PUSH(Fortran)
7317caade7ccSmrg
7318e5383a99Smrgif test -z "$FC" || test "X$FC" = "Xno"; then
7319e5383a99Smrg  _lt_disable_FC=yes
7320e5383a99Smrgfi
7321caade7ccSmrg
7322e5383a99Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7323e5383a99Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
7324e5383a99Smrg_LT_TAGVAR(always_export_symbols, $1)=no
7325e5383a99Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
7326e5383a99Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7327e5383a99Smrg_LT_TAGVAR(hardcode_direct, $1)=no
7328e5383a99Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7329e5383a99Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7330e5383a99Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
7331e5383a99Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
7332e5383a99Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
7333e5383a99Smrg_LT_TAGVAR(inherit_rpath, $1)=no
7334e5383a99Smrg_LT_TAGVAR(module_cmds, $1)=
7335e5383a99Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
7336e5383a99Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
7337e5383a99Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7338e5383a99Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7339e5383a99Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7340e5383a99Smrg_LT_TAGVAR(no_undefined_flag, $1)=
7341e5383a99Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
7342e5383a99Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7343caade7ccSmrg
7344e5383a99Smrg# Source file extension for fc test sources.
7345e5383a99Smrgac_ext=${ac_fc_srcext-f}
7346caade7ccSmrg
7347e5383a99Smrg# Object file extension for compiled fc test sources.
7348e5383a99Smrgobjext=o
7349e5383a99Smrg_LT_TAGVAR(objext, $1)=$objext
7350caade7ccSmrg
7351e5383a99Smrg# No sense in running all these tests if we already determined that
7352e5383a99Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
7353e5383a99Smrg# are currently assumed to apply to all compilers on this platform,
7354e5383a99Smrg# and will be corrupted by setting them based on a non-working compiler.
7355e5383a99Smrgif test "$_lt_disable_FC" != yes; then
7356e5383a99Smrg  # Code to be used in simple compile tests
7357e5383a99Smrg  lt_simple_compile_test_code="\
7358e5383a99Smrg      subroutine t
7359e5383a99Smrg      return
7360e5383a99Smrg      end
7361e5383a99Smrg"
7362caade7ccSmrg
7363e5383a99Smrg  # Code to be used in simple link tests
7364e5383a99Smrg  lt_simple_link_test_code="\
7365e5383a99Smrg      program t
7366e5383a99Smrg      end
7367e5383a99Smrg"
7368caade7ccSmrg
7369e5383a99Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7370e5383a99Smrg  _LT_TAG_COMPILER
7371caade7ccSmrg
7372e5383a99Smrg  # save warnings/boilerplate of simple test code
7373e5383a99Smrg  _LT_COMPILER_BOILERPLATE
7374e5383a99Smrg  _LT_LINKER_BOILERPLATE
7375caade7ccSmrg
7376e5383a99Smrg  # Allow CC to be a program name with arguments.
7377e5383a99Smrg  lt_save_CC="$CC"
7378e5383a99Smrg  lt_save_GCC=$GCC
7379e5383a99Smrg  lt_save_CFLAGS=$CFLAGS
7380e5383a99Smrg  CC=${FC-"f95"}
7381e5383a99Smrg  CFLAGS=$FCFLAGS
7382e5383a99Smrg  compiler=$CC
7383e5383a99Smrg  GCC=$ac_cv_fc_compiler_gnu
7384caade7ccSmrg
7385e5383a99Smrg  _LT_TAGVAR(compiler, $1)=$CC
7386e5383a99Smrg  _LT_CC_BASENAME([$compiler])
7387e5383a99Smrg
7388e5383a99Smrg  if test -n "$compiler"; then
7389e5383a99Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
7390e5383a99Smrg    AC_MSG_RESULT([$can_build_shared])
7391e5383a99Smrg
7392e5383a99Smrg    AC_MSG_CHECKING([whether to build shared libraries])
7393e5383a99Smrg    test "$can_build_shared" = "no" && enable_shared=no
7394e5383a99Smrg
7395e5383a99Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
7396e5383a99Smrg    # are all built from PIC.
7397e5383a99Smrg    case $host_os in
7398e5383a99Smrg      aix3*)
7399e5383a99Smrg        test "$enable_shared" = yes && enable_static=no
7400e5383a99Smrg        if test -n "$RANLIB"; then
7401e5383a99Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7402e5383a99Smrg          postinstall_cmds='$RANLIB $lib'
7403e5383a99Smrg        fi
7404e5383a99Smrg        ;;
7405e5383a99Smrg      aix[[4-9]]*)
7406e5383a99Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7407e5383a99Smrg	  test "$enable_shared" = yes && enable_static=no
7408e5383a99Smrg	fi
7409e5383a99Smrg        ;;
7410e5383a99Smrg    esac
7411e5383a99Smrg    AC_MSG_RESULT([$enable_shared])
7412e5383a99Smrg
7413e5383a99Smrg    AC_MSG_CHECKING([whether to build static libraries])
7414e5383a99Smrg    # Make sure either enable_shared or enable_static is yes.
7415e5383a99Smrg    test "$enable_shared" = yes || enable_static=yes
7416e5383a99Smrg    AC_MSG_RESULT([$enable_static])
7417e5383a99Smrg
7418e5383a99Smrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
7419e5383a99Smrg    _LT_TAGVAR(LD, $1)="$LD"
7420e5383a99Smrg
7421e5383a99Smrg    ## CAVEAT EMPTOR:
7422e5383a99Smrg    ## There is no encapsulation within the following macros, do not change
7423e5383a99Smrg    ## the running order or otherwise move them around unless you know exactly
7424e5383a99Smrg    ## what you are doing...
7425e5383a99Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
7426e5383a99Smrg    _LT_COMPILER_PIC($1)
7427e5383a99Smrg    _LT_COMPILER_C_O($1)
7428e5383a99Smrg    _LT_COMPILER_FILE_LOCKS($1)
7429e5383a99Smrg    _LT_LINKER_SHLIBS($1)
7430e5383a99Smrg    _LT_SYS_DYNAMIC_LINKER($1)
7431e5383a99Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7432caade7ccSmrg
7433e5383a99Smrg    _LT_CONFIG($1)
7434e5383a99Smrg  fi # test -n "$compiler"
7435caade7ccSmrg
7436e5383a99Smrg  GCC=$lt_save_GCC
7437e5383a99Smrg  CC=$lt_save_CC
7438e5383a99Smrg  CFLAGS=$lt_save_CFLAGS
7439e5383a99Smrgfi # test "$_lt_disable_FC" != yes
7440caade7ccSmrg
7441e5383a99SmrgAC_LANG_POP
7442e5383a99Smrg])# _LT_LANG_FC_CONFIG
7443caade7ccSmrg
7444caade7ccSmrg
7445e5383a99Smrg# _LT_LANG_GCJ_CONFIG([TAG])
7446e5383a99Smrg# --------------------------
7447e5383a99Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
7448e5383a99Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7449e5383a99Smrg# to write the compiler configuration to `libtool'.
7450e5383a99Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
7451e5383a99Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
7452e5383a99SmrgAC_LANG_SAVE
7453caade7ccSmrg
7454e5383a99Smrg# Source file extension for Java test sources.
7455e5383a99Smrgac_ext=java
7456caade7ccSmrg
7457e5383a99Smrg# Object file extension for compiled Java test sources.
7458e5383a99Smrgobjext=o
7459e5383a99Smrg_LT_TAGVAR(objext, $1)=$objext
7460caade7ccSmrg
7461e5383a99Smrg# Code to be used in simple compile tests
7462e5383a99Smrglt_simple_compile_test_code="class foo {}"
7463caade7ccSmrg
7464e5383a99Smrg# Code to be used in simple link tests
7465e5383a99Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
7466caade7ccSmrg
7467e5383a99Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7468e5383a99Smrg_LT_TAG_COMPILER
7469caade7ccSmrg
7470e5383a99Smrg# save warnings/boilerplate of simple test code
7471e5383a99Smrg_LT_COMPILER_BOILERPLATE
7472e5383a99Smrg_LT_LINKER_BOILERPLATE
7473caade7ccSmrg
7474e5383a99Smrg# Allow CC to be a program name with arguments.
7475e5383a99Smrglt_save_CC=$CC
7476e5383a99Smrglt_save_CFLAGS=$CFLAGS
7477e5383a99Smrglt_save_GCC=$GCC
7478e5383a99SmrgGCC=yes
7479e5383a99SmrgCC=${GCJ-"gcj"}
7480e5383a99SmrgCFLAGS=$GCJFLAGS
7481e5383a99Smrgcompiler=$CC
7482e5383a99Smrg_LT_TAGVAR(compiler, $1)=$CC
7483e5383a99Smrg_LT_TAGVAR(LD, $1)="$LD"
7484e5383a99Smrg_LT_CC_BASENAME([$compiler])
7485caade7ccSmrg
7486e5383a99Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
7487e5383a99Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7488caade7ccSmrg
7489e5383a99Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7490e5383a99Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7491e5383a99Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7492caade7ccSmrg
7493e5383a99Smrgif test -n "$compiler"; then
7494e5383a99Smrg  _LT_COMPILER_NO_RTTI($1)
7495e5383a99Smrg  _LT_COMPILER_PIC($1)
7496e5383a99Smrg  _LT_COMPILER_C_O($1)
7497e5383a99Smrg  _LT_COMPILER_FILE_LOCKS($1)
7498e5383a99Smrg  _LT_LINKER_SHLIBS($1)
7499e5383a99Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
7500caade7ccSmrg
7501e5383a99Smrg  _LT_CONFIG($1)
7502e5383a99Smrgfi
7503caade7ccSmrg
7504e5383a99SmrgAC_LANG_RESTORE
7505caade7ccSmrg
7506e5383a99SmrgGCC=$lt_save_GCC
7507e5383a99SmrgCC=$lt_save_CC
7508e5383a99SmrgCFLAGS=$lt_save_CFLAGS
7509e5383a99Smrg])# _LT_LANG_GCJ_CONFIG
7510caade7ccSmrg
7511af9a7ee5Smrg
7512e5383a99Smrg# _LT_LANG_GO_CONFIG([TAG])
7513e5383a99Smrg# --------------------------
7514e5383a99Smrg# Ensure that the configuration variables for the GNU Go compiler
7515e5383a99Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7516e5383a99Smrg# to write the compiler configuration to `libtool'.
7517e5383a99Smrgm4_defun([_LT_LANG_GO_CONFIG],
7518e5383a99Smrg[AC_REQUIRE([LT_PROG_GO])dnl
7519e5383a99SmrgAC_LANG_SAVE
7520e5383a99Smrg
7521e5383a99Smrg# Source file extension for Go test sources.
7522e5383a99Smrgac_ext=go
7523e5383a99Smrg
7524e5383a99Smrg# Object file extension for compiled Go test sources.
7525e5383a99Smrgobjext=o
7526e5383a99Smrg_LT_TAGVAR(objext, $1)=$objext
7527e5383a99Smrg
7528e5383a99Smrg# Code to be used in simple compile tests
7529e5383a99Smrglt_simple_compile_test_code="package main; func main() { }"
7530e5383a99Smrg
7531e5383a99Smrg# Code to be used in simple link tests
7532e5383a99Smrglt_simple_link_test_code='package main; func main() { }'
7533caade7ccSmrg
7534e5383a99Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7535e5383a99Smrg_LT_TAG_COMPILER
7536caade7ccSmrg
7537e5383a99Smrg# save warnings/boilerplate of simple test code
7538e5383a99Smrg_LT_COMPILER_BOILERPLATE
7539e5383a99Smrg_LT_LINKER_BOILERPLATE
7540caade7ccSmrg
7541e5383a99Smrg# Allow CC to be a program name with arguments.
7542e5383a99Smrglt_save_CC=$CC
7543e5383a99Smrglt_save_CFLAGS=$CFLAGS
7544e5383a99Smrglt_save_GCC=$GCC
7545e5383a99SmrgGCC=yes
7546e5383a99SmrgCC=${GOC-"gccgo"}
7547e5383a99SmrgCFLAGS=$GOFLAGS
7548e5383a99Smrgcompiler=$CC
7549e5383a99Smrg_LT_TAGVAR(compiler, $1)=$CC
7550e5383a99Smrg_LT_TAGVAR(LD, $1)="$LD"
7551e5383a99Smrg_LT_CC_BASENAME([$compiler])
7552caade7ccSmrg
7553e5383a99Smrg# Go did not exist at the time GCC didn't implicitly link libc in.
7554e5383a99Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7555af9a7ee5Smrg
7556e5383a99Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7557e5383a99Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7558e5383a99Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7559af9a7ee5Smrg
7560e5383a99Smrgif test -n "$compiler"; then
7561e5383a99Smrg  _LT_COMPILER_NO_RTTI($1)
7562e5383a99Smrg  _LT_COMPILER_PIC($1)
7563e5383a99Smrg  _LT_COMPILER_C_O($1)
7564e5383a99Smrg  _LT_COMPILER_FILE_LOCKS($1)
7565e5383a99Smrg  _LT_LINKER_SHLIBS($1)
7566e5383a99Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
7567af9a7ee5Smrg
7568e5383a99Smrg  _LT_CONFIG($1)
7569e5383a99Smrgfi
7570af9a7ee5Smrg
7571e5383a99SmrgAC_LANG_RESTORE
7572caade7ccSmrg
7573e5383a99SmrgGCC=$lt_save_GCC
7574e5383a99SmrgCC=$lt_save_CC
7575e5383a99SmrgCFLAGS=$lt_save_CFLAGS
7576e5383a99Smrg])# _LT_LANG_GO_CONFIG
7577af9a7ee5Smrg
7578e8a5466aSmrg
7579e5383a99Smrg# _LT_LANG_RC_CONFIG([TAG])
7580e5383a99Smrg# -------------------------
7581e5383a99Smrg# Ensure that the configuration variables for the Windows resource compiler
7582e5383a99Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7583e5383a99Smrg# to write the compiler configuration to `libtool'.
7584e5383a99Smrgm4_defun([_LT_LANG_RC_CONFIG],
7585e5383a99Smrg[AC_REQUIRE([LT_PROG_RC])dnl
7586e5383a99SmrgAC_LANG_SAVE
7587caade7ccSmrg
7588e5383a99Smrg# Source file extension for RC test sources.
7589e5383a99Smrgac_ext=rc
7590b9b4fd27Smrg
7591e5383a99Smrg# Object file extension for compiled RC test sources.
7592e5383a99Smrgobjext=o
7593e5383a99Smrg_LT_TAGVAR(objext, $1)=$objext
7594b9b4fd27Smrg
7595e5383a99Smrg# Code to be used in simple compile tests
7596e5383a99Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
7597b9b4fd27Smrg
7598e5383a99Smrg# Code to be used in simple link tests
7599e5383a99Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
7600b9b4fd27Smrg
7601e5383a99Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7602e5383a99Smrg_LT_TAG_COMPILER
7603caade7ccSmrg
7604e5383a99Smrg# save warnings/boilerplate of simple test code
7605e5383a99Smrg_LT_COMPILER_BOILERPLATE
7606e5383a99Smrg_LT_LINKER_BOILERPLATE
7607e5383a99Smrg
7608e5383a99Smrg# Allow CC to be a program name with arguments.
7609e5383a99Smrglt_save_CC="$CC"
7610e5383a99Smrglt_save_CFLAGS=$CFLAGS
7611e5383a99Smrglt_save_GCC=$GCC
7612e5383a99SmrgGCC=
7613e5383a99SmrgCC=${RC-"windres"}
7614e5383a99SmrgCFLAGS=
7615e5383a99Smrgcompiler=$CC
7616e5383a99Smrg_LT_TAGVAR(compiler, $1)=$CC
7617e5383a99Smrg_LT_CC_BASENAME([$compiler])
7618e5383a99Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
7619e5383a99Smrg
7620e5383a99Smrgif test -n "$compiler"; then
7621e5383a99Smrg  :
7622e5383a99Smrg  _LT_CONFIG($1)
7623e5383a99Smrgfi
7624caade7ccSmrg
7625e5383a99SmrgGCC=$lt_save_GCC
7626e5383a99SmrgAC_LANG_RESTORE
7627e5383a99SmrgCC=$lt_save_CC
7628e5383a99SmrgCFLAGS=$lt_save_CFLAGS
7629e5383a99Smrg])# _LT_LANG_RC_CONFIG
7630caade7ccSmrg
7631caade7ccSmrg
7632e5383a99Smrg# LT_PROG_GCJ
7633e5383a99Smrg# -----------
7634e5383a99SmrgAC_DEFUN([LT_PROG_GCJ],
7635e5383a99Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
7636e5383a99Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
7637e5383a99Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
7638e5383a99Smrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
7639e5383a99Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
7640e5383a99Smrg])
7641caade7ccSmrg
7642e5383a99Smrg# Old name:
7643e5383a99SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
7644e5383a99Smrgdnl aclocal-1.4 backwards compatibility:
7645e5383a99Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
7646af9a7ee5Smrg
7647b9b4fd27Smrg
7648e5383a99Smrg# LT_PROG_GO
7649e5383a99Smrg# ----------
7650e5383a99SmrgAC_DEFUN([LT_PROG_GO],
7651e5383a99Smrg[AC_CHECK_TOOL(GOC, gccgo,)
7652e5383a99Smrg])
7653b9b4fd27Smrg
7654b9b4fd27Smrg
7655e5383a99Smrg# LT_PROG_RC
7656e5383a99Smrg# ----------
7657e5383a99SmrgAC_DEFUN([LT_PROG_RC],
7658e5383a99Smrg[AC_CHECK_TOOL(RC, windres,)
7659e5383a99Smrg])
7660af9a7ee5Smrg
7661e5383a99Smrg# Old name:
7662e5383a99SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
7663e5383a99Smrgdnl aclocal-1.4 backwards compatibility:
7664e5383a99Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
7665caade7ccSmrg
7666af9a7ee5Smrg
7667e5383a99Smrg# _LT_DECL_EGREP
7668e5383a99Smrg# --------------
7669e5383a99Smrg# If we don't have a new enough Autoconf to choose the best grep
7670e5383a99Smrg# available, choose the one first in the user's PATH.
7671e5383a99Smrgm4_defun([_LT_DECL_EGREP],
7672e5383a99Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
7673e5383a99SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
7674e5383a99Smrgtest -z "$GREP" && GREP=grep
7675e5383a99Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
7676e5383a99Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
7677e5383a99Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
7678e5383a99Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
7679e5383a99SmrgAC_SUBST([GREP])
7680af9a7ee5Smrg])
7681caade7ccSmrg
7682caade7ccSmrg
7683e5383a99Smrg# _LT_DECL_OBJDUMP
7684e5383a99Smrg# --------------
7685e5383a99Smrg# If we don't have a new enough Autoconf to choose the best objdump
7686e5383a99Smrg# available, choose the one first in the user's PATH.
7687e5383a99Smrgm4_defun([_LT_DECL_OBJDUMP],
7688e5383a99Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
7689e5383a99Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
7690e5383a99Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
7691e5383a99SmrgAC_SUBST([OBJDUMP])
7692e5383a99Smrg])
7693caade7ccSmrg
7694e5383a99Smrg# _LT_DECL_DLLTOOL
7695e5383a99Smrg# ----------------
7696e5383a99Smrg# Ensure DLLTOOL variable is set.
7697e5383a99Smrgm4_defun([_LT_DECL_DLLTOOL],
7698e5383a99Smrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
7699e5383a99Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
7700e5383a99Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
7701e5383a99SmrgAC_SUBST([DLLTOOL])
7702e5383a99Smrg])
7703b9b4fd27Smrg
7704e5383a99Smrg# _LT_DECL_SED
7705e5383a99Smrg# ------------
7706e5383a99Smrg# Check for a fully-functional sed program, that truncates
7707e5383a99Smrg# as few characters as possible.  Prefer GNU sed if found.
7708e5383a99Smrgm4_defun([_LT_DECL_SED],
7709e5383a99Smrg[AC_PROG_SED
7710e5383a99Smrgtest -z "$SED" && SED=sed
7711e5383a99SmrgXsed="$SED -e 1s/^X//"
7712e5383a99Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
7713e5383a99Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
7714e5383a99Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
7715e5383a99Smrg])# _LT_DECL_SED
7716e5383a99Smrg
7717e5383a99Smrgm4_ifndef([AC_PROG_SED], [
7718e5383a99Smrg# NOTE: This macro has been submitted for inclusion into   #
7719e5383a99Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
7720e5383a99Smrg#  a released version of Autoconf we should remove this    #
7721e5383a99Smrg#  macro and use it instead.                               #
7722e5383a99Smrg
7723e5383a99Smrgm4_defun([AC_PROG_SED],
7724e5383a99Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
7725e5383a99SmrgAC_CACHE_VAL(lt_cv_path_SED,
7726e5383a99Smrg[# Loop through the user's path and test for sed and gsed.
7727e5383a99Smrg# Then use that list of sed's as ones to test for truncation.
7728e5383a99Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7729e5383a99Smrgfor as_dir in $PATH
7730e5383a99Smrgdo
7731e5383a99Smrg  IFS=$as_save_IFS
7732e5383a99Smrg  test -z "$as_dir" && as_dir=.
7733e5383a99Smrg  for lt_ac_prog in sed gsed; do
7734e5383a99Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
7735e5383a99Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
7736e5383a99Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
7737e5383a99Smrg      fi
7738e5383a99Smrg    done
7739e5383a99Smrg  done
7740e5383a99Smrgdone
7741e5383a99SmrgIFS=$as_save_IFS
7742e5383a99Smrglt_ac_max=0
7743e5383a99Smrglt_ac_count=0
7744e5383a99Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
7745e5383a99Smrg# along with /bin/sed that truncates output.
7746e5383a99Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
7747e5383a99Smrg  test ! -f $lt_ac_sed && continue
7748e5383a99Smrg  cat /dev/null > conftest.in
7749e5383a99Smrg  lt_ac_count=0
7750e5383a99Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
7751e5383a99Smrg  # Check for GNU sed and select it if it is found.
7752e5383a99Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
7753e5383a99Smrg    lt_cv_path_SED=$lt_ac_sed
7754e5383a99Smrg    break
7755e5383a99Smrg  fi
7756e5383a99Smrg  while true; do
7757e5383a99Smrg    cat conftest.in conftest.in >conftest.tmp
7758e5383a99Smrg    mv conftest.tmp conftest.in
7759e5383a99Smrg    cp conftest.in conftest.nl
7760e5383a99Smrg    echo >>conftest.nl
7761e5383a99Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
7762e5383a99Smrg    cmp -s conftest.out conftest.nl || break
7763e5383a99Smrg    # 10000 chars as input seems more than enough
7764e5383a99Smrg    test $lt_ac_count -gt 10 && break
7765e5383a99Smrg    lt_ac_count=`expr $lt_ac_count + 1`
7766e5383a99Smrg    if test $lt_ac_count -gt $lt_ac_max; then
7767e5383a99Smrg      lt_ac_max=$lt_ac_count
7768e5383a99Smrg      lt_cv_path_SED=$lt_ac_sed
7769e5383a99Smrg    fi
7770e5383a99Smrg  done
7771e5383a99Smrgdone
7772e5383a99Smrg])
7773e5383a99SmrgSED=$lt_cv_path_SED
7774e5383a99SmrgAC_SUBST([SED])
7775e5383a99SmrgAC_MSG_RESULT([$SED])
7776e5383a99Smrg])#AC_PROG_SED
7777e5383a99Smrg])#m4_ifndef
7778b9b4fd27Smrg
7779e5383a99Smrg# Old name:
7780e5383a99SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
7781e5383a99Smrgdnl aclocal-1.4 backwards compatibility:
7782e5383a99Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
7783b9b4fd27Smrg
7784b9b4fd27Smrg
7785e5383a99Smrg# _LT_CHECK_SHELL_FEATURES
7786e5383a99Smrg# ------------------------
7787e5383a99Smrg# Find out whether the shell is Bourne or XSI compatible,
7788e5383a99Smrg# or has some other useful features.
7789e5383a99Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
7790e5383a99Smrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
7791e5383a99Smrg# Try some XSI features
7792e5383a99Smrgxsi_shell=no
7793e5383a99Smrg( _lt_dummy="a/b/c"
7794e5383a99Smrg  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
7795e5383a99Smrg      = c,a/b,b/c, \
7796e5383a99Smrg    && eval 'test $(( 1 + 1 )) -eq 2 \
7797e5383a99Smrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
7798e5383a99Smrg  && xsi_shell=yes
7799e5383a99SmrgAC_MSG_RESULT([$xsi_shell])
7800e5383a99Smrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
7801b9b4fd27Smrg
7802e5383a99SmrgAC_MSG_CHECKING([whether the shell understands "+="])
7803e5383a99Smrglt_shell_append=no
7804e5383a99Smrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
7805e5383a99Smrg    >/dev/null 2>&1 \
7806e5383a99Smrg  && lt_shell_append=yes
7807e5383a99SmrgAC_MSG_RESULT([$lt_shell_append])
7808e5383a99Smrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
7809b9b4fd27Smrg
7810e5383a99Smrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
7811e5383a99Smrg  lt_unset=unset
7812e5383a99Smrgelse
7813e5383a99Smrg  lt_unset=false
7814e5383a99Smrgfi
7815e5383a99Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
7816b9b4fd27Smrg
7817e5383a99Smrg# test EBCDIC or ASCII
7818e5383a99Smrgcase `echo X|tr X '\101'` in
7819e5383a99Smrg A) # ASCII based system
7820e5383a99Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
7821e5383a99Smrg  lt_SP2NL='tr \040 \012'
7822e5383a99Smrg  lt_NL2SP='tr \015\012 \040\040'
7823e5383a99Smrg  ;;
7824e5383a99Smrg *) # EBCDIC based system
7825e5383a99Smrg  lt_SP2NL='tr \100 \n'
7826e5383a99Smrg  lt_NL2SP='tr \r\n \100\100'
7827e5383a99Smrg  ;;
7828e5383a99Smrgesac
7829e5383a99Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
7830e5383a99Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
7831e5383a99Smrg])# _LT_CHECK_SHELL_FEATURES
7832b9b4fd27Smrg
7833b9b4fd27Smrg
7834e5383a99Smrg# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
7835e5383a99Smrg# ------------------------------------------------------
7836e5383a99Smrg# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
7837e5383a99Smrg# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
7838e5383a99Smrgm4_defun([_LT_PROG_FUNCTION_REPLACE],
7839e5383a99Smrg[dnl {
7840e5383a99Smrgsed -e '/^$1 ()$/,/^} # $1 /c\
7841e5383a99Smrg$1 ()\
7842e5383a99Smrg{\
7843e5383a99Smrgm4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
7844e5383a99Smrg} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
7845e5383a99Smrg  && mv -f "$cfgfile.tmp" "$cfgfile" \
7846e5383a99Smrg    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7847e5383a99Smrgtest 0 -eq $? || _lt_function_replace_fail=:
7848e5383a99Smrg])
7849af9a7ee5Smrg
7850b9b4fd27Smrg
7851e5383a99Smrg# _LT_PROG_REPLACE_SHELLFNS
7852e5383a99Smrg# -------------------------
7853e5383a99Smrg# Replace existing portable implementations of several shell functions with
7854e5383a99Smrg# equivalent extended shell implementations where those features are available..
7855e5383a99Smrgm4_defun([_LT_PROG_REPLACE_SHELLFNS],
7856e5383a99Smrg[if test x"$xsi_shell" = xyes; then
7857e5383a99Smrg  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
7858e5383a99Smrg    case ${1} in
7859e5383a99Smrg      */*) func_dirname_result="${1%/*}${2}" ;;
7860e5383a99Smrg      *  ) func_dirname_result="${3}" ;;
7861e5383a99Smrg    esac])
7862b9b4fd27Smrg
7863e5383a99Smrg  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
7864e5383a99Smrg    func_basename_result="${1##*/}"])
7865b9b4fd27Smrg
7866e5383a99Smrg  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
7867e5383a99Smrg    case ${1} in
7868e5383a99Smrg      */*) func_dirname_result="${1%/*}${2}" ;;
7869e5383a99Smrg      *  ) func_dirname_result="${3}" ;;
7870e5383a99Smrg    esac
7871e5383a99Smrg    func_basename_result="${1##*/}"])
7872b9b4fd27Smrg
7873e5383a99Smrg  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
7874e5383a99Smrg    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
7875e5383a99Smrg    # positional parameters, so assign one to ordinary parameter first.
7876e5383a99Smrg    func_stripname_result=${3}
7877e5383a99Smrg    func_stripname_result=${func_stripname_result#"${1}"}
7878e5383a99Smrg    func_stripname_result=${func_stripname_result%"${2}"}])
7879b9b4fd27Smrg
7880e5383a99Smrg  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
7881e5383a99Smrg    func_split_long_opt_name=${1%%=*}
7882e5383a99Smrg    func_split_long_opt_arg=${1#*=}])
7883b9b4fd27Smrg
7884e5383a99Smrg  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
7885e5383a99Smrg    func_split_short_opt_arg=${1#??}
7886e5383a99Smrg    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
7887b9b4fd27Smrg
7888e5383a99Smrg  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
7889e5383a99Smrg    case ${1} in
7890e5383a99Smrg      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
7891e5383a99Smrg      *)    func_lo2o_result=${1} ;;
7892e5383a99Smrg    esac])
7893b9b4fd27Smrg
7894e5383a99Smrg  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
7895af9a7ee5Smrg
7896e5383a99Smrg  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
7897af9a7ee5Smrg
7898e5383a99Smrg  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
7899e5383a99Smrgfi
7900af9a7ee5Smrg
7901e5383a99Smrgif test x"$lt_shell_append" = xyes; then
7902e5383a99Smrg  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
7903af9a7ee5Smrg
7904e5383a99Smrg  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
7905e5383a99Smrg    func_quote_for_eval "${2}"
7906e5383a99Smrgdnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
7907e5383a99Smrg    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
7908af9a7ee5Smrg
7909e5383a99Smrg  # Save a `func_append' function call where possible by direct use of '+='
7910e5383a99Smrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
7911e5383a99Smrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
7912e5383a99Smrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7913e5383a99Smrg  test 0 -eq $? || _lt_function_replace_fail=:
7914e5383a99Smrgelse
7915e5383a99Smrg  # Save a `func_append' function call even when '+=' is not available
7916e5383a99Smrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
7917e5383a99Smrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
7918e5383a99Smrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7919e5383a99Smrg  test 0 -eq $? || _lt_function_replace_fail=:
7920e5383a99Smrgfi
7921a5602400Smrg
7922e5383a99Smrgif test x"$_lt_function_replace_fail" = x":"; then
7923e5383a99Smrg  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
7924e5383a99Smrgfi
7925e5383a99Smrg])
7926b9b4fd27Smrg
7927e5383a99Smrg# _LT_PATH_CONVERSION_FUNCTIONS
7928e5383a99Smrg# -----------------------------
7929e5383a99Smrg# Determine which file name conversion functions should be used by
7930e5383a99Smrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
7931e5383a99Smrg# for certain cross-compile configurations and native mingw.
7932e5383a99Smrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
7933e5383a99Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7934e5383a99SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
7935e5383a99SmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
7936e5383a99SmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
7937e5383a99Smrg[case $host in
7938e5383a99Smrg  *-*-mingw* )
7939e5383a99Smrg    case $build in
7940e5383a99Smrg      *-*-mingw* ) # actually msys
7941e5383a99Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
7942e5383a99Smrg        ;;
7943e5383a99Smrg      *-*-cygwin* )
7944e5383a99Smrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
7945e5383a99Smrg        ;;
7946e5383a99Smrg      * ) # otherwise, assume *nix
7947e5383a99Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
7948e5383a99Smrg        ;;
7949e5383a99Smrg    esac
7950e5383a99Smrg    ;;
7951e5383a99Smrg  *-*-cygwin* )
7952e5383a99Smrg    case $build in
7953e5383a99Smrg      *-*-mingw* ) # actually msys
7954e5383a99Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
7955e5383a99Smrg        ;;
7956e5383a99Smrg      *-*-cygwin* )
7957e5383a99Smrg        lt_cv_to_host_file_cmd=func_convert_file_noop
7958e5383a99Smrg        ;;
7959e5383a99Smrg      * ) # otherwise, assume *nix
7960e5383a99Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
7961e5383a99Smrg        ;;
7962e5383a99Smrg    esac
7963e5383a99Smrg    ;;
7964e5383a99Smrg  * ) # unhandled hosts (and "normal" native builds)
7965e5383a99Smrg    lt_cv_to_host_file_cmd=func_convert_file_noop
7966e5383a99Smrg    ;;
7967e5383a99Smrgesac
7968e5383a99Smrg])
7969e5383a99Smrgto_host_file_cmd=$lt_cv_to_host_file_cmd
7970e5383a99SmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
7971e5383a99Smrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
7972e5383a99Smrg         [0], [convert $build file names to $host format])dnl
7973b9b4fd27Smrg
7974e5383a99SmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
7975e5383a99SmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
7976e5383a99Smrg[#assume ordinary cross tools, or native build.
7977e5383a99Smrglt_cv_to_tool_file_cmd=func_convert_file_noop
7978e5383a99Smrgcase $host in
7979e5383a99Smrg  *-*-mingw* )
7980e5383a99Smrg    case $build in
7981e5383a99Smrg      *-*-mingw* ) # actually msys
7982e5383a99Smrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
7983e5383a99Smrg        ;;
7984e5383a99Smrg    esac
7985e5383a99Smrg    ;;
7986e5383a99Smrgesac
7987e5383a99Smrg])
7988e5383a99Smrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
7989e5383a99SmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
7990e5383a99Smrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
7991e5383a99Smrg         [0], [convert $build files to toolchain format])dnl
7992e5383a99Smrg])# _LT_PATH_CONVERSION_FUNCTIONS
7993b9b4fd27Smrg
7994e5383a99Smrg# Helper functions for option handling.                    -*- Autoconf -*-
7995e5383a99Smrg#
7996e5383a99Smrg#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
7997e5383a99Smrg#   Inc.
7998e5383a99Smrg#   Written by Gary V. Vaughan, 2004
7999e5383a99Smrg#
8000e5383a99Smrg# This file is free software; the Free Software Foundation gives
8001e5383a99Smrg# unlimited permission to copy and/or distribute it, with or without
8002e5383a99Smrg# modifications, as long as this notice is preserved.
8003b9b4fd27Smrg
8004e5383a99Smrg# serial 7 ltoptions.m4
8005b9b4fd27Smrg
8006e5383a99Smrg# This is to help aclocal find these macros, as it can't see m4_define.
8007e5383a99SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
8008b9b4fd27Smrg
8009af9a7ee5Smrg
8010e5383a99Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
8011e5383a99Smrg# ------------------------------------------
8012e5383a99Smrgm4_define([_LT_MANGLE_OPTION],
8013e5383a99Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
8014e8a5466aSmrg
8015b9b4fd27Smrg
8016e5383a99Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
8017e5383a99Smrg# ---------------------------------------
8018e5383a99Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
8019e5383a99Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
8020e5383a99Smrg# saved as a flag.
8021e5383a99Smrgm4_define([_LT_SET_OPTION],
8022e5383a99Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
8023e5383a99Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
8024e5383a99Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
8025e5383a99Smrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
8026e5383a99Smrg])
8027b9b4fd27Smrg
8028b9b4fd27Smrg
8029e5383a99Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
8030e5383a99Smrg# ------------------------------------------------------------
8031e5383a99Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
8032e5383a99Smrgm4_define([_LT_IF_OPTION],
8033e5383a99Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
8034b9b4fd27Smrg
8035af9a7ee5Smrg
8036e5383a99Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
8037e5383a99Smrg# -------------------------------------------------------
8038e5383a99Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
8039e5383a99Smrg# are set.
8040e5383a99Smrgm4_define([_LT_UNLESS_OPTIONS],
8041e5383a99Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8042e5383a99Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
8043e5383a99Smrg		      [m4_define([$0_found])])])[]dnl
8044e5383a99Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
8045e5383a99Smrg])[]dnl
8046e5383a99Smrg])
8047af9a7ee5Smrg
8048af9a7ee5Smrg
8049e5383a99Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
8050e5383a99Smrg# ----------------------------------------
8051e5383a99Smrg# OPTION-LIST is a space-separated list of Libtool options associated
8052e5383a99Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
8053e5383a99Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
8054e5383a99Smrg# the unknown option and exit.
8055e5383a99Smrgm4_defun([_LT_SET_OPTIONS],
8056e5383a99Smrg[# Set options
8057e5383a99Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8058e5383a99Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
8059af9a7ee5Smrg
8060e5383a99Smrgm4_if([$1],[LT_INIT],[
8061e5383a99Smrg  dnl
8062e5383a99Smrg  dnl Simply set some default values (i.e off) if boolean options were not
8063e5383a99Smrg  dnl specified:
8064e5383a99Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
8065e5383a99Smrg  ])
8066e5383a99Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
8067e5383a99Smrg  ])
8068e5383a99Smrg  dnl
8069e5383a99Smrg  dnl If no reference was made to various pairs of opposing options, then
8070e5383a99Smrg  dnl we run the default mode handler for the pair.  For example, if neither
8071e5383a99Smrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
8072e5383a99Smrg  dnl archives by default:
8073e5383a99Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
8074e5383a99Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
8075e5383a99Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
8076e5383a99Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
8077e5383a99Smrg  		   [_LT_ENABLE_FAST_INSTALL])
8078e5383a99Smrg  ])
8079e5383a99Smrg])# _LT_SET_OPTIONS
8080af9a7ee5Smrg
8081af9a7ee5Smrg
8082af9a7ee5Smrg
8083e5383a99Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
8084e5383a99Smrg# -----------------------------------------
8085e5383a99Smrgm4_define([_LT_MANGLE_DEFUN],
8086e5383a99Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
8087b9b4fd27Smrg
8088b9b4fd27Smrg
8089e5383a99Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
8090e5383a99Smrg# -----------------------------------------------
8091e5383a99Smrgm4_define([LT_OPTION_DEFINE],
8092e5383a99Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
8093e5383a99Smrg])# LT_OPTION_DEFINE
8094b9b4fd27Smrg
8095b9b4fd27Smrg
8096e5383a99Smrg# dlopen
8097e5383a99Smrg# ------
8098e5383a99SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
8099e5383a99Smrg])
8100e5383a99Smrg
8101e5383a99SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
8102e5383a99Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
8103e5383a99SmrgAC_DIAGNOSE([obsolete],
8104e5383a99Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8105e5383a99Smrgput the `dlopen' option into LT_INIT's first parameter.])
8106e5383a99Smrg])
8107b9b4fd27Smrg
8108e5383a99Smrgdnl aclocal-1.4 backwards compatibility:
8109e5383a99Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
8110b9b4fd27Smrg
8111b9b4fd27Smrg
8112e5383a99Smrg# win32-dll
8113e5383a99Smrg# ---------
8114e5383a99Smrg# Declare package support for building win32 dll's.
8115e5383a99SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
8116e5383a99Smrg[enable_win32_dll=yes
8117b9b4fd27Smrg
8118e5383a99Smrgcase $host in
8119e5383a99Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
8120e5383a99Smrg  AC_CHECK_TOOL(AS, as, false)
8121e5383a99Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8122e5383a99Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
8123e5383a99Smrg  ;;
8124e5383a99Smrgesac
8125b9b4fd27Smrg
8126e5383a99Smrgtest -z "$AS" && AS=as
8127e5383a99Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
8128b9b4fd27Smrg
8129e5383a99Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
8130e5383a99Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
8131b9b4fd27Smrg
8132e5383a99Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
8133e5383a99Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
8134e5383a99Smrg])# win32-dll
8135b9b4fd27Smrg
8136e5383a99SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
8137e5383a99Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8138e5383a99Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
8139e5383a99SmrgAC_DIAGNOSE([obsolete],
8140e5383a99Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8141e5383a99Smrgput the `win32-dll' option into LT_INIT's first parameter.])
8142e5383a99Smrg])
8143b9b4fd27Smrg
8144e5383a99Smrgdnl aclocal-1.4 backwards compatibility:
8145e5383a99Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
8146af9a7ee5Smrg
8147af9a7ee5Smrg
8148e5383a99Smrg# _LT_ENABLE_SHARED([DEFAULT])
8149e5383a99Smrg# ----------------------------
8150e5383a99Smrg# implement the --enable-shared flag, and supports the `shared' and
8151e5383a99Smrg# `disable-shared' LT_INIT options.
8152e5383a99Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
8153e5383a99Smrgm4_define([_LT_ENABLE_SHARED],
8154e5383a99Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
8155e5383a99SmrgAC_ARG_ENABLE([shared],
8156e5383a99Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
8157e5383a99Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
8158e5383a99Smrg    [p=${PACKAGE-default}
8159e5383a99Smrg    case $enableval in
8160e5383a99Smrg    yes) enable_shared=yes ;;
8161e5383a99Smrg    no) enable_shared=no ;;
8162e5383a99Smrg    *)
8163e5383a99Smrg      enable_shared=no
8164e5383a99Smrg      # Look at the argument we got.  We use all the common list separators.
8165e5383a99Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8166e5383a99Smrg      for pkg in $enableval; do
8167e5383a99Smrg	IFS="$lt_save_ifs"
8168e5383a99Smrg	if test "X$pkg" = "X$p"; then
8169e5383a99Smrg	  enable_shared=yes
8170e5383a99Smrg	fi
8171e5383a99Smrg      done
8172e5383a99Smrg      IFS="$lt_save_ifs"
8173e5383a99Smrg      ;;
8174e5383a99Smrg    esac],
8175e5383a99Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
8176af9a7ee5Smrg
8177e5383a99Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
8178e5383a99Smrg	[Whether or not to build shared libraries])
8179e5383a99Smrg])# _LT_ENABLE_SHARED
8180af9a7ee5Smrg
8181e5383a99SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
8182e5383a99SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
8183af9a7ee5Smrg
8184e5383a99Smrg# Old names:
8185e5383a99SmrgAC_DEFUN([AC_ENABLE_SHARED],
8186e5383a99Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
8187e5383a99Smrg])
8188af9a7ee5Smrg
8189e5383a99SmrgAC_DEFUN([AC_DISABLE_SHARED],
8190e5383a99Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
8191e5383a99Smrg])
8192af9a7ee5Smrg
8193e5383a99SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
8194e5383a99SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
8195af9a7ee5Smrg
8196e5383a99Smrgdnl aclocal-1.4 backwards compatibility:
8197e5383a99Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
8198e5383a99Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
8199b9b4fd27Smrg
8200b9b4fd27Smrg
8201b9b4fd27Smrg
8202e5383a99Smrg# _LT_ENABLE_STATIC([DEFAULT])
8203e5383a99Smrg# ----------------------------
8204e5383a99Smrg# implement the --enable-static flag, and support the `static' and
8205e5383a99Smrg# `disable-static' LT_INIT options.
8206e5383a99Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
8207e5383a99Smrgm4_define([_LT_ENABLE_STATIC],
8208e5383a99Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
8209e5383a99SmrgAC_ARG_ENABLE([static],
8210e5383a99Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
8211e5383a99Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
8212e5383a99Smrg    [p=${PACKAGE-default}
8213e5383a99Smrg    case $enableval in
8214e5383a99Smrg    yes) enable_static=yes ;;
8215e5383a99Smrg    no) enable_static=no ;;
8216e5383a99Smrg    *)
8217e5383a99Smrg     enable_static=no
8218e5383a99Smrg      # Look at the argument we got.  We use all the common list separators.
8219e5383a99Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8220e5383a99Smrg      for pkg in $enableval; do
8221e5383a99Smrg	IFS="$lt_save_ifs"
8222e5383a99Smrg	if test "X$pkg" = "X$p"; then
8223e5383a99Smrg	  enable_static=yes
8224e5383a99Smrg	fi
8225e5383a99Smrg      done
8226e5383a99Smrg      IFS="$lt_save_ifs"
8227e5383a99Smrg      ;;
8228e5383a99Smrg    esac],
8229e5383a99Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
8230b9b4fd27Smrg
8231e5383a99Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
8232e5383a99Smrg	[Whether or not to build static libraries])
8233e5383a99Smrg])# _LT_ENABLE_STATIC
8234b9b4fd27Smrg
8235e5383a99SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
8236e5383a99SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
8237b9b4fd27Smrg
8238e5383a99Smrg# Old names:
8239e5383a99SmrgAC_DEFUN([AC_ENABLE_STATIC],
8240e5383a99Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
8241e5383a99Smrg])
8242b9b4fd27Smrg
8243e5383a99SmrgAC_DEFUN([AC_DISABLE_STATIC],
8244e5383a99Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
8245e5383a99Smrg])
8246b9b4fd27Smrg
8247e5383a99SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
8248e5383a99SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
8249b9b4fd27Smrg
8250e5383a99Smrgdnl aclocal-1.4 backwards compatibility:
8251e5383a99Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
8252e5383a99Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
8253b9b4fd27Smrg
8254b9b4fd27Smrg
8255b9b4fd27Smrg
8256e5383a99Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
8257e5383a99Smrg# ----------------------------------
8258e5383a99Smrg# implement the --enable-fast-install flag, and support the `fast-install'
8259e5383a99Smrg# and `disable-fast-install' LT_INIT options.
8260e5383a99Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
8261e5383a99Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
8262e5383a99Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
8263e5383a99SmrgAC_ARG_ENABLE([fast-install],
8264e5383a99Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
8265e5383a99Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
8266e5383a99Smrg    [p=${PACKAGE-default}
8267e5383a99Smrg    case $enableval in
8268e5383a99Smrg    yes) enable_fast_install=yes ;;
8269e5383a99Smrg    no) enable_fast_install=no ;;
8270e5383a99Smrg    *)
8271e5383a99Smrg      enable_fast_install=no
8272e5383a99Smrg      # Look at the argument we got.  We use all the common list separators.
8273e5383a99Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8274e5383a99Smrg      for pkg in $enableval; do
8275e5383a99Smrg	IFS="$lt_save_ifs"
8276e5383a99Smrg	if test "X$pkg" = "X$p"; then
8277e5383a99Smrg	  enable_fast_install=yes
8278e5383a99Smrg	fi
8279e5383a99Smrg      done
8280e5383a99Smrg      IFS="$lt_save_ifs"
8281e5383a99Smrg      ;;
8282e5383a99Smrg    esac],
8283e5383a99Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
8284b9b4fd27Smrg
8285e5383a99Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
8286e5383a99Smrg	 [Whether or not to optimize for fast installation])dnl
8287e5383a99Smrg])# _LT_ENABLE_FAST_INSTALL
8288b9b4fd27Smrg
8289e5383a99SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
8290e5383a99SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
8291b9b4fd27Smrg
8292e5383a99Smrg# Old names:
8293e5383a99SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
8294e5383a99Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
8295e5383a99SmrgAC_DIAGNOSE([obsolete],
8296e5383a99Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8297e5383a99Smrgthe `fast-install' option into LT_INIT's first parameter.])
8298e5383a99Smrg])
8299b9b4fd27Smrg
8300e5383a99SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
8301e5383a99Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
8302e5383a99SmrgAC_DIAGNOSE([obsolete],
8303e5383a99Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8304e5383a99Smrgthe `disable-fast-install' option into LT_INIT's first parameter.])
8305af9a7ee5Smrg])
8306b9b4fd27Smrg
8307af9a7ee5Smrgdnl aclocal-1.4 backwards compatibility:
8308e5383a99Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
8309e5383a99Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
8310b9b4fd27Smrg
8311b9b4fd27Smrg
8312e5383a99Smrg# _LT_WITH_PIC([MODE])
8313e5383a99Smrg# --------------------
8314e5383a99Smrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
8315e5383a99Smrg# LT_INIT options.
8316e5383a99Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
8317e5383a99Smrgm4_define([_LT_WITH_PIC],
8318e5383a99Smrg[AC_ARG_WITH([pic],
8319e5383a99Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
8320e5383a99Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
8321e5383a99Smrg    [lt_p=${PACKAGE-default}
8322e5383a99Smrg    case $withval in
8323e5383a99Smrg    yes|no) pic_mode=$withval ;;
8324e5383a99Smrg    *)
8325e5383a99Smrg      pic_mode=default
8326e5383a99Smrg      # Look at the argument we got.  We use all the common list separators.
8327e5383a99Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8328e5383a99Smrg      for lt_pkg in $withval; do
8329e5383a99Smrg	IFS="$lt_save_ifs"
8330e5383a99Smrg	if test "X$lt_pkg" = "X$lt_p"; then
8331e5383a99Smrg	  pic_mode=yes
8332e5383a99Smrg	fi
8333e5383a99Smrg      done
8334e5383a99Smrg      IFS="$lt_save_ifs"
8335e5383a99Smrg      ;;
8336e5383a99Smrg    esac],
8337e5383a99Smrg    [pic_mode=default])
8338b9b4fd27Smrg
8339e5383a99Smrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
8340b9b4fd27Smrg
8341e5383a99Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
8342e5383a99Smrg])# _LT_WITH_PIC
8343b9b4fd27Smrg
8344e5383a99SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
8345e5383a99SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
8346b9b4fd27Smrg
8347e5383a99Smrg# Old name:
8348e5383a99SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
8349e5383a99Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
8350e5383a99SmrgAC_DIAGNOSE([obsolete],
8351e5383a99Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8352e5383a99Smrgput the `pic-only' option into LT_INIT's first parameter.])
8353af9a7ee5Smrg])
8354b9b4fd27Smrg
8355e5383a99Smrgdnl aclocal-1.4 backwards compatibility:
8356e5383a99Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
8357b9b4fd27Smrg
8358b9b4fd27Smrg
8359e5383a99Smrgm4_define([_LTDL_MODE], [])
8360e5383a99SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
8361e5383a99Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
8362e5383a99SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
8363e5383a99Smrg		 [m4_define([_LTDL_MODE], [recursive])])
8364e5383a99SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
8365e5383a99Smrg		 [m4_define([_LTDL_MODE], [subproject])])
8366b9b4fd27Smrg
8367e5383a99Smrgm4_define([_LTDL_TYPE], [])
8368e5383a99SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
8369e5383a99Smrg		 [m4_define([_LTDL_TYPE], [installable])])
8370e5383a99SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
8371e5383a99Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
8372b9b4fd27Smrg
8373e5383a99Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
8374e5383a99Smrg#
8375e5383a99Smrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
8376e5383a99Smrg# Written by Gary V. Vaughan, 2004
8377e5383a99Smrg#
8378e5383a99Smrg# This file is free software; the Free Software Foundation gives
8379e5383a99Smrg# unlimited permission to copy and/or distribute it, with or without
8380e5383a99Smrg# modifications, as long as this notice is preserved.
8381b9b4fd27Smrg
8382e5383a99Smrg# serial 6 ltsugar.m4
8383caade7ccSmrg
8384e5383a99Smrg# This is to help aclocal find these macros, as it can't see m4_define.
8385e5383a99SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
8386b9b4fd27Smrg
8387af9a7ee5Smrg
8388e5383a99Smrg# lt_join(SEP, ARG1, [ARG2...])
8389e5383a99Smrg# -----------------------------
8390e5383a99Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
8391e5383a99Smrg# associated separator.
8392e5383a99Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
8393e5383a99Smrg# versions in m4sugar had bugs.
8394e5383a99Smrgm4_define([lt_join],
8395e5383a99Smrg[m4_if([$#], [1], [],
8396e5383a99Smrg       [$#], [2], [[$2]],
8397e5383a99Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
8398e5383a99Smrgm4_define([_lt_join],
8399e5383a99Smrg[m4_if([$#$2], [2], [],
8400e5383a99Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
8401af9a7ee5Smrg
8402af9a7ee5Smrg
8403e5383a99Smrg# lt_car(LIST)
8404e5383a99Smrg# lt_cdr(LIST)
8405e5383a99Smrg# ------------
8406e5383a99Smrg# Manipulate m4 lists.
8407e5383a99Smrg# These macros are necessary as long as will still need to support
8408e5383a99Smrg# Autoconf-2.59 which quotes differently.
8409e5383a99Smrgm4_define([lt_car], [[$1]])
8410e5383a99Smrgm4_define([lt_cdr],
8411e5383a99Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
8412e5383a99Smrg       [$#], 1, [],
8413e5383a99Smrg       [m4_dquote(m4_shift($@))])])
8414e5383a99Smrgm4_define([lt_unquote], $1)
8415b9b4fd27Smrg
8416b9b4fd27Smrg
8417e5383a99Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
8418e5383a99Smrg# ------------------------------------------
8419e5383a99Smrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
8420e5383a99Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
8421e5383a99Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
8422e5383a99Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
8423e5383a99Smrg# than defined and empty).
8424e5383a99Smrg#
8425e5383a99Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
8426e5383a99Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
8427e5383a99Smrgm4_define([lt_append],
8428e5383a99Smrg[m4_define([$1],
8429e5383a99Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
8430b9b4fd27Smrg
8431b9b4fd27Smrg
8432b9b4fd27Smrg
8433e5383a99Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
8434e5383a99Smrg# ----------------------------------------------------------
8435e5383a99Smrg# Produce a SEP delimited list of all paired combinations of elements of
8436e5383a99Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
8437e5383a99Smrg# has the form PREFIXmINFIXSUFFIXn.
8438e5383a99Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
8439e5383a99Smrgm4_define([lt_combine],
8440e5383a99Smrg[m4_if(m4_eval([$# > 3]), [1],
8441e5383a99Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
8442e5383a99Smrg[[m4_foreach([_Lt_prefix], [$2],
8443e5383a99Smrg	     [m4_foreach([_Lt_suffix],
8444e5383a99Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
8445e5383a99Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
8446b9b4fd27Smrg
8447a5602400Smrg
8448e5383a99Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
8449e5383a99Smrg# -----------------------------------------------------------------------
8450e5383a99Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
8451e5383a99Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
8452e5383a99Smrgm4_define([lt_if_append_uniq],
8453e5383a99Smrg[m4_ifdef([$1],
8454e5383a99Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
8455e5383a99Smrg		 [lt_append([$1], [$2], [$3])$4],
8456e5383a99Smrg		 [$5])],
8457e5383a99Smrg	  [lt_append([$1], [$2], [$3])$4])])
8458b9b4fd27Smrg
8459a5602400Smrg
8460e5383a99Smrg# lt_dict_add(DICT, KEY, VALUE)
8461e5383a99Smrg# -----------------------------
8462e5383a99Smrgm4_define([lt_dict_add],
8463e5383a99Smrg[m4_define([$1($2)], [$3])])
8464a5602400Smrg
8465b9b4fd27Smrg
8466e5383a99Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
8467e5383a99Smrg# --------------------------------------------
8468e5383a99Smrgm4_define([lt_dict_add_subkey],
8469e5383a99Smrg[m4_define([$1($2:$3)], [$4])])
8470b9b4fd27Smrg
8471b9b4fd27Smrg
8472e5383a99Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
8473e5383a99Smrg# ----------------------------------
8474e5383a99Smrgm4_define([lt_dict_fetch],
8475e5383a99Smrg[m4_ifval([$3],
8476e5383a99Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
8477e5383a99Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
8478b9b4fd27Smrg
8479b9b4fd27Smrg
8480e5383a99Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
8481e5383a99Smrg# -----------------------------------------------------------------
8482e5383a99Smrgm4_define([lt_if_dict_fetch],
8483e5383a99Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
8484e5383a99Smrg	[$5],
8485e5383a99Smrg    [$6])])
8486b9b4fd27Smrg
8487caade7ccSmrg
8488e5383a99Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
8489e5383a99Smrg# --------------------------------------------------------------
8490e5383a99Smrgm4_define([lt_dict_filter],
8491e5383a99Smrg[m4_if([$5], [], [],
8492e5383a99Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
8493e5383a99Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
8494e5383a99Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
8495af9a7ee5Smrg])
8496caade7ccSmrg
8497e5383a99Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
8498e5383a99Smrg#
8499e5383a99Smrg#   Copyright (C) 2004 Free Software Foundation, Inc.
8500e5383a99Smrg#   Written by Scott James Remnant, 2004
8501e5383a99Smrg#
8502e5383a99Smrg# This file is free software; the Free Software Foundation gives
8503e5383a99Smrg# unlimited permission to copy and/or distribute it, with or without
8504e5383a99Smrg# modifications, as long as this notice is preserved.
8505caade7ccSmrg
8506e5383a99Smrg# @configure_input@
8507e5383a99Smrg
8508e5383a99Smrg# serial 3337 ltversion.m4
8509e5383a99Smrg# This file is part of GNU Libtool
8510e5383a99Smrg
8511e5383a99Smrgm4_define([LT_PACKAGE_VERSION], [2.4.2])
8512e5383a99Smrgm4_define([LT_PACKAGE_REVISION], [1.3337])
8513e5383a99Smrg
8514e5383a99SmrgAC_DEFUN([LTVERSION_VERSION],
8515e5383a99Smrg[macro_version='2.4.2'
8516e5383a99Smrgmacro_revision='1.3337'
8517e5383a99Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
8518e5383a99Smrg_LT_DECL(, macro_revision, 0)
8519af9a7ee5Smrg])
8520caade7ccSmrg
8521e5383a99Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
8522af9a7ee5Smrg#
8523e5383a99Smrg#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
8524e5383a99Smrg#   Written by Scott James Remnant, 2004.
8525af9a7ee5Smrg#
8526af9a7ee5Smrg# This file is free software; the Free Software Foundation gives
8527af9a7ee5Smrg# unlimited permission to copy and/or distribute it, with or without
8528af9a7ee5Smrg# modifications, as long as this notice is preserved.
8529caade7ccSmrg
8530e5383a99Smrg# serial 5 lt~obsolete.m4
8531caade7ccSmrg
8532e5383a99Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
8533e5383a99Smrg#
8534e5383a99Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
8535e5383a99Smrg# which have later been changed to m4_define as they aren't part of the
8536e5383a99Smrg# exported API, or moved to Autoconf or Automake where they belong.
8537e5383a99Smrg#
8538e5383a99Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
8539e5383a99Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
8540e5383a99Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
8541e5383a99Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
8542e5383a99Smrg# and doesn't know about Autoconf macros at all.)
8543e5383a99Smrg#
8544e5383a99Smrg# So we provide this file, which has a silly filename so it's always
8545e5383a99Smrg# included after everything else.  This provides aclocal with the
8546e5383a99Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
8547e5383a99Smrg# because those macros already exist, or will be overwritten later.
8548e5383a99Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
8549e5383a99Smrg#
8550e5383a99Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
8551e5383a99Smrg# Yes, that means every name once taken will need to remain here until
8552e5383a99Smrg# we give up compatibility with versions before 1.7, at which point
8553e5383a99Smrg# we need to keep only those names which we still refer to.
8554caade7ccSmrg
8555e5383a99Smrg# This is to help aclocal find these macros, as it can't see m4_define.
8556e5383a99SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
8557caade7ccSmrg
8558e5383a99Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
8559e5383a99Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
8560e5383a99Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
8561e5383a99Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
8562e5383a99Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
8563e5383a99Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
8564e5383a99Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
8565e5383a99Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
8566e5383a99Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
8567e5383a99Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
8568e5383a99Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
8569e5383a99Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
8570e5383a99Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
8571e5383a99Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
8572e5383a99Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
8573e5383a99Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
8574e5383a99Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
8575e5383a99Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
8576e5383a99Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
8577e5383a99Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
8578e5383a99Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
8579e5383a99Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
8580e5383a99Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
8581e5383a99Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
8582e5383a99Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
8583e5383a99Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
8584e5383a99Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
8585e5383a99Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
8586e5383a99Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
8587e5383a99Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
8588e5383a99Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
8589e5383a99Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
8590e5383a99Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
8591e5383a99Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
8592e5383a99Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
8593e5383a99Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
8594e5383a99Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
8595e5383a99Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
8596e5383a99Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
8597e5383a99Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
8598e5383a99Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
8599e5383a99Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
8600e5383a99Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
8601e5383a99Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
8602e5383a99Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
8603e5383a99Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
8604e5383a99Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
8605e5383a99Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
8606e5383a99Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
8607e5383a99Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
8608e5383a99Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
8609e5383a99Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
8610e5383a99Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
8611e5383a99Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
8612e5383a99Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
8613e5383a99Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
8614e5383a99Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
8615e5383a99Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
8616e5383a99Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
8617e5383a99Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
8618e5383a99Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
8619caade7ccSmrg
8620e5383a99Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
8621e5383a99Smrg# serial 1 (pkg-config-0.24)
8622e5383a99Smrg# 
8623e5383a99Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
8624e5383a99Smrg#
8625e5383a99Smrg# This program is free software; you can redistribute it and/or modify
8626e5383a99Smrg# it under the terms of the GNU General Public License as published by
8627e5383a99Smrg# the Free Software Foundation; either version 2 of the License, or
8628e5383a99Smrg# (at your option) any later version.
8629e5383a99Smrg#
8630e5383a99Smrg# This program is distributed in the hope that it will be useful, but
8631e5383a99Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
8632e5383a99Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
8633e5383a99Smrg# General Public License for more details.
8634e5383a99Smrg#
8635e5383a99Smrg# You should have received a copy of the GNU General Public License
8636e5383a99Smrg# along with this program; if not, write to the Free Software
8637e5383a99Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
8638e5383a99Smrg#
8639e5383a99Smrg# As a special exception to the GNU General Public License, if you
8640e5383a99Smrg# distribute this file as part of a program that contains a
8641e5383a99Smrg# configuration script generated by Autoconf, you may include it under
8642e5383a99Smrg# the same distribution terms that you use for the rest of that program.
8643caade7ccSmrg
8644e5383a99Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
8645e5383a99Smrg# ----------------------------------
8646e5383a99SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
8647e5383a99Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
8648e5383a99Smrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
8649e5383a99Smrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
8650e5383a99SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
8651e5383a99SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
8652e5383a99SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
8653b9b4fd27Smrg
8654e5383a99Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
8655e5383a99Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
8656e5383a99Smrgfi
8657e5383a99Smrgif test -n "$PKG_CONFIG"; then
8658e5383a99Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
8659e5383a99Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
8660e5383a99Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
8661e5383a99Smrg		AC_MSG_RESULT([yes])
8662e5383a99Smrg	else
8663e5383a99Smrg		AC_MSG_RESULT([no])
8664e5383a99Smrg		PKG_CONFIG=""
8665e5383a99Smrg	fi
8666e5383a99Smrgfi[]dnl
8667e5383a99Smrg])# PKG_PROG_PKG_CONFIG
8668b9b4fd27Smrg
8669e5383a99Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
8670e5383a99Smrg#
8671e5383a99Smrg# Check to see whether a particular set of modules exists.  Similar
8672e5383a99Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
8673e5383a99Smrg#
8674e5383a99Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
8675e5383a99Smrg# only at the first occurence in configure.ac, so if the first place
8676e5383a99Smrg# it's called might be skipped (such as if it is within an "if", you
8677e5383a99Smrg# have to call PKG_CHECK_EXISTS manually
8678e5383a99Smrg# --------------------------------------------------------------
8679e5383a99SmrgAC_DEFUN([PKG_CHECK_EXISTS],
8680e5383a99Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8681e5383a99Smrgif test -n "$PKG_CONFIG" && \
8682e5383a99Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
8683e5383a99Smrg  m4_default([$2], [:])
8684e5383a99Smrgm4_ifvaln([$3], [else
8685e5383a99Smrg  $3])dnl
8686e5383a99Smrgfi])
8687b9b4fd27Smrg
8688e5383a99Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
8689e5383a99Smrg# ---------------------------------------------
8690e5383a99Smrgm4_define([_PKG_CONFIG],
8691e5383a99Smrg[if test -n "$$1"; then
8692e5383a99Smrg    pkg_cv_[]$1="$$1"
8693e5383a99Smrg elif test -n "$PKG_CONFIG"; then
8694e5383a99Smrg    PKG_CHECK_EXISTS([$3],
8695e5383a99Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
8696e5383a99Smrg		      test "x$?" != "x0" && pkg_failed=yes ],
8697e5383a99Smrg		     [pkg_failed=yes])
8698e5383a99Smrg else
8699e5383a99Smrg    pkg_failed=untried
8700e5383a99Smrgfi[]dnl
8701e5383a99Smrg])# _PKG_CONFIG
8702af9a7ee5Smrg
8703e5383a99Smrg# _PKG_SHORT_ERRORS_SUPPORTED
8704e5383a99Smrg# -----------------------------
8705e5383a99SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
8706e5383a99Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
8707e5383a99Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
8708e5383a99Smrg        _pkg_short_errors_supported=yes
8709e5383a99Smrgelse
8710e5383a99Smrg        _pkg_short_errors_supported=no
8711e5383a99Smrgfi[]dnl
8712e5383a99Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
8713af9a7ee5Smrg
8714af9a7ee5Smrg
8715e5383a99Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
8716e5383a99Smrg# [ACTION-IF-NOT-FOUND])
8717e5383a99Smrg#
8718e5383a99Smrg#
8719e5383a99Smrg# Note that if there is a possibility the first call to
8720e5383a99Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
8721e5383a99Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
8722e5383a99Smrg#
8723e5383a99Smrg#
8724e5383a99Smrg# --------------------------------------------------------------
8725e5383a99SmrgAC_DEFUN([PKG_CHECK_MODULES],
8726e5383a99Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8727e5383a99SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
8728e5383a99SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
8729b9b4fd27Smrg
8730e5383a99Smrgpkg_failed=no
8731e5383a99SmrgAC_MSG_CHECKING([for $1])
8732b9b4fd27Smrg
8733e5383a99Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
8734e5383a99Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
8735b9b4fd27Smrg
8736e5383a99Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
8737e5383a99Smrgand $1[]_LIBS to avoid the need to call pkg-config.
8738e5383a99SmrgSee the pkg-config man page for more details.])
8739b9b4fd27Smrg
8740e5383a99Smrgif test $pkg_failed = yes; then
8741e5383a99Smrg   	AC_MSG_RESULT([no])
8742e5383a99Smrg        _PKG_SHORT_ERRORS_SUPPORTED
8743e5383a99Smrg        if test $_pkg_short_errors_supported = yes; then
8744e5383a99Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
8745e5383a99Smrg        else 
8746e5383a99Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
8747e5383a99Smrg        fi
8748e5383a99Smrg	# Put the nasty error message in config.log where it belongs
8749e5383a99Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
8750b9b4fd27Smrg
8751e5383a99Smrg	m4_default([$4], [AC_MSG_ERROR(
8752e5383a99Smrg[Package requirements ($2) were not met:
8753b9b4fd27Smrg
8754e5383a99Smrg$$1_PKG_ERRORS
8755b9b4fd27Smrg
8756e5383a99SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
8757e5383a99Smrginstalled software in a non-standard prefix.
8758b9b4fd27Smrg
8759e5383a99Smrg_PKG_TEXT])[]dnl
8760e5383a99Smrg        ])
8761e5383a99Smrgelif test $pkg_failed = untried; then
8762e5383a99Smrg     	AC_MSG_RESULT([no])
8763e5383a99Smrg	m4_default([$4], [AC_MSG_FAILURE(
8764e5383a99Smrg[The pkg-config script could not be found or is too old.  Make sure it
8765e5383a99Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
8766e5383a99Smrgpath to pkg-config.
8767b9b4fd27Smrg
8768e5383a99Smrg_PKG_TEXT
8769b9b4fd27Smrg
8770e5383a99SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
8771e5383a99Smrg        ])
8772e5383a99Smrgelse
8773e5383a99Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
8774e5383a99Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
8775e5383a99Smrg        AC_MSG_RESULT([yes])
8776e5383a99Smrg	$3
8777e5383a99Smrgfi[]dnl
8778e5383a99Smrg])# PKG_CHECK_MODULES
8779b9b4fd27Smrg
8780b9b4fd27Smrg
8781e5383a99Smrg# PKG_INSTALLDIR(DIRECTORY)
8782e5383a99Smrg# -------------------------
8783e5383a99Smrg# Substitutes the variable pkgconfigdir as the location where a module
8784e5383a99Smrg# should install pkg-config .pc files. By default the directory is
8785e5383a99Smrg# $libdir/pkgconfig, but the default can be changed by passing
8786e5383a99Smrg# DIRECTORY. The user can override through the --with-pkgconfigdir
8787e5383a99Smrg# parameter.
8788e5383a99SmrgAC_DEFUN([PKG_INSTALLDIR],
8789e5383a99Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
8790e5383a99Smrgm4_pushdef([pkg_description],
8791e5383a99Smrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
8792e5383a99SmrgAC_ARG_WITH([pkgconfigdir],
8793e5383a99Smrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
8794e5383a99Smrg    [with_pkgconfigdir=]pkg_default)
8795e5383a99SmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
8796e5383a99Smrgm4_popdef([pkg_default])
8797e5383a99Smrgm4_popdef([pkg_description])
8798e5383a99Smrg]) dnl PKG_INSTALLDIR
8799e5383a99Smrg
8800e5383a99Smrg
8801e5383a99Smrg# PKG_NOARCH_INSTALLDIR(DIRECTORY)
8802e5383a99Smrg# -------------------------
8803e5383a99Smrg# Substitutes the variable noarch_pkgconfigdir as the location where a
8804e5383a99Smrg# module should install arch-independent pkg-config .pc files. By
8805e5383a99Smrg# default the directory is $datadir/pkgconfig, but the default can be
8806e5383a99Smrg# changed by passing DIRECTORY. The user can override through the
8807e5383a99Smrg# --with-noarch-pkgconfigdir parameter.
8808e5383a99SmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
8809e5383a99Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
8810e5383a99Smrgm4_pushdef([pkg_description],
8811e5383a99Smrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
8812e5383a99SmrgAC_ARG_WITH([noarch-pkgconfigdir],
8813e5383a99Smrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
8814e5383a99Smrg    [with_noarch_pkgconfigdir=]pkg_default)
8815e5383a99SmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
8816e5383a99Smrgm4_popdef([pkg_default])
8817e5383a99Smrgm4_popdef([pkg_description])
8818e5383a99Smrg]) dnl PKG_NOARCH_INSTALLDIR
8819e5383a99Smrg
8820e5383a99Smrg
8821e5383a99Smrg# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
8822e5383a99Smrg# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
8823e5383a99Smrg# -------------------------------------------
8824e5383a99Smrg# Retrieves the value of the pkg-config variable for the given module.
8825e5383a99SmrgAC_DEFUN([PKG_CHECK_VAR],
8826e5383a99Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8827e5383a99SmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
8828b9b4fd27Smrg
8829e5383a99Smrg_PKG_CONFIG([$1], [variable="][$3]["], [$2])
8830e5383a99SmrgAS_VAR_COPY([$1], [pkg_cv_][$1])
8831b9b4fd27Smrg
8832e5383a99SmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl
8833e5383a99Smrg])# PKG_CHECK_VAR
8834b9b4fd27Smrg
8835e5383a99Smrg# Copyright (C) 2002-2013 Free Software Foundation, Inc.
8836e5383a99Smrg#
8837e5383a99Smrg# This file is free software; the Free Software Foundation
8838e5383a99Smrg# gives unlimited permission to copy and/or distribute it,
8839e5383a99Smrg# with or without modifications, as long as this notice is preserved.
8840af9a7ee5Smrg
8841e5383a99Smrg# AM_AUTOMAKE_VERSION(VERSION)
8842e5383a99Smrg# ----------------------------
8843e5383a99Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
8844e5383a99Smrg# generated from the m4 files accompanying Automake X.Y.
8845e5383a99Smrg# (This private macro should not be called outside this file.)
8846e5383a99SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
8847e5383a99Smrg[am__api_version='1.13'
8848e5383a99Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
8849e5383a99Smrgdnl require some minimum version.  Point them to the right macro.
8850e5383a99Smrgm4_if([$1], [1.13.4], [],
8851e5383a99Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
8852af9a7ee5Smrg])
8853b9b4fd27Smrg
8854e5383a99Smrg# _AM_AUTOCONF_VERSION(VERSION)
8855e5383a99Smrg# -----------------------------
8856e5383a99Smrg# aclocal traces this macro to find the Autoconf version.
8857e5383a99Smrg# This is a private macro too.  Using m4_define simplifies
8858e5383a99Smrg# the logic in aclocal, which can simply ignore this definition.
8859e5383a99Smrgm4_define([_AM_AUTOCONF_VERSION], [])
8860e8a5466aSmrg
8861e5383a99Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
8862e5383a99Smrg# -------------------------------
8863e5383a99Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
8864e5383a99Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
8865e5383a99SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
8866e5383a99Smrg[AM_AUTOMAKE_VERSION([1.13.4])dnl
8867e5383a99Smrgm4_ifndef([AC_AUTOCONF_VERSION],
8868e5383a99Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
8869e5383a99Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
8870b9b4fd27Smrg
8871e5383a99Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
8872b9b4fd27Smrg
8873e5383a99Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
8874e5383a99Smrg#
8875e5383a99Smrg# This file is free software; the Free Software Foundation
8876e5383a99Smrg# gives unlimited permission to copy and/or distribute it,
8877e5383a99Smrg# with or without modifications, as long as this notice is preserved.
8878b9b4fd27Smrg
8879e5383a99Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
8880e5383a99Smrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
8881e5383a99Smrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
8882e5383a99Smrg#
8883e5383a99Smrg# Of course, Automake must honor this variable whenever it calls a
8884e5383a99Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
8885e5383a99Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
8886e5383a99Smrg# depending on how configure is run.  This is pretty annoying, since
8887e5383a99Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
8888e5383a99Smrg# source directory, any form will work fine, but in subdirectories a
8889e5383a99Smrg# relative path needs to be adjusted first.
8890e5383a99Smrg#
8891e5383a99Smrg# $ac_aux_dir/missing
8892e5383a99Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
8893e5383a99Smrg# $top_srcdir/$ac_aux_dir/missing
8894e5383a99Smrg#    fails if $ac_aux_dir is absolute,
8895e5383a99Smrg#    fails when called from a subdirectory in a VPATH build with
8896e5383a99Smrg#          a relative $ac_aux_dir
8897e5383a99Smrg#
8898e5383a99Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
8899e5383a99Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
8900e5383a99Smrg# harmless because $srcdir is '.', but things will broke when you
8901e5383a99Smrg# start a VPATH build or use an absolute $srcdir.
8902e5383a99Smrg#
8903e5383a99Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
8904e5383a99Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
8905e5383a99Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
8906e5383a99Smrg# and then we would define $MISSING as
8907e5383a99Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
8908e5383a99Smrg# This will work as long as MISSING is not called from configure, because
8909e5383a99Smrg# unfortunately $(top_srcdir) has no meaning in configure.
8910e5383a99Smrg# However there are other variables, like CC, which are often used in
8911e5383a99Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
8912e5383a99Smrg#
8913e5383a99Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
8914e5383a99Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
8915e5383a99Smrg# configured tree to be moved without reconfiguration.
8916b9b4fd27Smrg
8917e5383a99SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
8918e5383a99Smrg[dnl Rely on autoconf to set up CDPATH properly.
8919e5383a99SmrgAC_PREREQ([2.50])dnl
8920e5383a99Smrg# expand $ac_aux_dir to an absolute path
8921e5383a99Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
8922af9a7ee5Smrg])
8923b9b4fd27Smrg
8924e5383a99Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
8925af9a7ee5Smrg
8926e5383a99Smrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
8927e5383a99Smrg#
8928e5383a99Smrg# This file is free software; the Free Software Foundation
8929e5383a99Smrg# gives unlimited permission to copy and/or distribute it,
8930e5383a99Smrg# with or without modifications, as long as this notice is preserved.
8931b9b4fd27Smrg
8932e5383a99Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
8933e5383a99Smrg# -------------------------------------
8934e5383a99Smrg# Define a conditional.
8935e5383a99SmrgAC_DEFUN([AM_CONDITIONAL],
8936e5383a99Smrg[AC_PREREQ([2.52])dnl
8937e5383a99Smrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
8938e5383a99Smrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
8939e5383a99SmrgAC_SUBST([$1_TRUE])dnl
8940e5383a99SmrgAC_SUBST([$1_FALSE])dnl
8941e5383a99Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
8942e5383a99Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
8943e5383a99Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
8944e5383a99Smrgif $2; then
8945e5383a99Smrg  $1_TRUE=
8946e5383a99Smrg  $1_FALSE='#'
8947e5383a99Smrgelse
8948e5383a99Smrg  $1_TRUE='#'
8949e5383a99Smrg  $1_FALSE=
8950e5383a99Smrgfi
8951e5383a99SmrgAC_CONFIG_COMMANDS_PRE(
8952e5383a99Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
8953e5383a99Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
8954e5383a99SmrgUsually this means the macro was only invoked conditionally.]])
8955e5383a99Smrgfi])])
8956b9b4fd27Smrg
8957e5383a99Smrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
8958e5383a99Smrg#
8959e5383a99Smrg# This file is free software; the Free Software Foundation
8960e5383a99Smrg# gives unlimited permission to copy and/or distribute it,
8961e5383a99Smrg# with or without modifications, as long as this notice is preserved.
8962b9b4fd27Smrg
8963b9b4fd27Smrg
8964e5383a99Smrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
8965e5383a99Smrg# written in clear, in which case automake, when reading aclocal.m4,
8966e5383a99Smrg# will think it sees a *use*, and therefore will trigger all it's
8967e5383a99Smrg# C support machinery.  Also note that it means that autoscan, seeing
8968e5383a99Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
8969b9b4fd27Smrg
8970b9b4fd27Smrg
8971e5383a99Smrg# _AM_DEPENDENCIES(NAME)
8972e5383a99Smrg# ----------------------
8973e5383a99Smrg# See how the compiler implements dependency checking.
8974e5383a99Smrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
8975e5383a99Smrg# We try a few techniques and use that to set a single cache variable.
8976e5383a99Smrg#
8977e5383a99Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
8978e5383a99Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
8979e5383a99Smrg# dependency, and given that the user is not expected to run this macro,
8980e5383a99Smrg# just rely on AC_PROG_CC.
8981e5383a99SmrgAC_DEFUN([_AM_DEPENDENCIES],
8982e5383a99Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
8983e5383a99SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
8984e5383a99SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
8985e5383a99SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
8986b9b4fd27Smrg
8987e5383a99Smrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
8988e5383a99Smrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
8989e5383a99Smrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
8990e5383a99Smrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
8991e5383a99Smrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
8992e5383a99Smrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
8993e5383a99Smrg                    [depcc="$$1"   am_compiler_list=])
8994b9b4fd27Smrg
8995e5383a99SmrgAC_CACHE_CHECK([dependency style of $depcc],
8996e5383a99Smrg               [am_cv_$1_dependencies_compiler_type],
8997e5383a99Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
8998e5383a99Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
8999e5383a99Smrg  # making bogus files that we don't know about and never remove.  For
9000e5383a99Smrg  # instance it was reported that on HP-UX the gcc test will end up
9001e5383a99Smrg  # making a dummy file named 'D' -- because '-MD' means "put the output
9002e5383a99Smrg  # in D".
9003e5383a99Smrg  rm -rf conftest.dir
9004e5383a99Smrg  mkdir conftest.dir
9005e5383a99Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
9006e5383a99Smrg  # using a relative directory.
9007e5383a99Smrg  cp "$am_depcomp" conftest.dir
9008e5383a99Smrg  cd conftest.dir
9009e5383a99Smrg  # We will build objects and dependencies in a subdirectory because
9010e5383a99Smrg  # it helps to detect inapplicable dependency modes.  For instance
9011e5383a99Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
9012e5383a99Smrg  # side effect of compilation, but ICC will put the dependencies in
9013e5383a99Smrg  # the current directory while Tru64 will put them in the object
9014e5383a99Smrg  # directory.
9015e5383a99Smrg  mkdir sub
9016b9b4fd27Smrg
9017e5383a99Smrg  am_cv_$1_dependencies_compiler_type=none
9018e5383a99Smrg  if test "$am_compiler_list" = ""; then
9019e5383a99Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
9020e5383a99Smrg  fi
9021e5383a99Smrg  am__universal=false
9022e5383a99Smrg  m4_case([$1], [CC],
9023e5383a99Smrg    [case " $depcc " in #(
9024e5383a99Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
9025e5383a99Smrg     esac],
9026e5383a99Smrg    [CXX],
9027e5383a99Smrg    [case " $depcc " in #(
9028e5383a99Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
9029e5383a99Smrg     esac])
9030b9b4fd27Smrg
9031e5383a99Smrg  for depmode in $am_compiler_list; do
9032e5383a99Smrg    # Setup a source with many dependencies, because some compilers
9033e5383a99Smrg    # like to wrap large dependency lists on column 80 (with \), and
9034e5383a99Smrg    # we should not choose a depcomp mode which is confused by this.
9035e5383a99Smrg    #
9036e5383a99Smrg    # We need to recreate these files for each test, as the compiler may
9037e5383a99Smrg    # overwrite some of them when testing with obscure command lines.
9038e5383a99Smrg    # This happens at least with the AIX C compiler.
9039e5383a99Smrg    : > sub/conftest.c
9040e5383a99Smrg    for i in 1 2 3 4 5 6; do
9041e5383a99Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
9042e5383a99Smrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
9043e5383a99Smrg      # Solaris 10 /bin/sh.
9044e5383a99Smrg      echo '/* dummy */' > sub/conftst$i.h
9045e5383a99Smrg    done
9046e5383a99Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
9047b9b4fd27Smrg
9048e5383a99Smrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
9049e5383a99Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
9050e5383a99Smrg    # handle '-M -o', and we need to detect this.  Also, some Intel
9051e5383a99Smrg    # versions had trouble with output in subdirs.
9052e5383a99Smrg    am__obj=sub/conftest.${OBJEXT-o}
9053e5383a99Smrg    am__minus_obj="-o $am__obj"
9054e5383a99Smrg    case $depmode in
9055e5383a99Smrg    gcc)
9056e5383a99Smrg      # This depmode causes a compiler race in universal mode.
9057e5383a99Smrg      test "$am__universal" = false || continue
9058e5383a99Smrg      ;;
9059e5383a99Smrg    nosideeffect)
9060e5383a99Smrg      # After this tag, mechanisms are not by side-effect, so they'll
9061e5383a99Smrg      # only be used when explicitly requested.
9062e5383a99Smrg      if test "x$enable_dependency_tracking" = xyes; then
9063e5383a99Smrg	continue
9064e5383a99Smrg      else
9065e5383a99Smrg	break
9066e5383a99Smrg      fi
9067e5383a99Smrg      ;;
9068e5383a99Smrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
9069e5383a99Smrg      # This compiler won't grok '-c -o', but also, the minuso test has
9070e5383a99Smrg      # not run yet.  These depmodes are late enough in the game, and
9071e5383a99Smrg      # so weak that their functioning should not be impacted.
9072e5383a99Smrg      am__obj=conftest.${OBJEXT-o}
9073e5383a99Smrg      am__minus_obj=
9074e5383a99Smrg      ;;
9075e5383a99Smrg    none) break ;;
9076e5383a99Smrg    esac
9077e5383a99Smrg    if depmode=$depmode \
9078e5383a99Smrg       source=sub/conftest.c object=$am__obj \
9079e5383a99Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
9080e5383a99Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
9081e5383a99Smrg         >/dev/null 2>conftest.err &&
9082e5383a99Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
9083e5383a99Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
9084e5383a99Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
9085e5383a99Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
9086e5383a99Smrg      # icc doesn't choke on unknown options, it will just issue warnings
9087e5383a99Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
9088e5383a99Smrg      # that says an option was ignored or not supported.
9089e5383a99Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
9090e5383a99Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
9091e5383a99Smrg      # The diagnosis changed in icc 8.0:
9092e5383a99Smrg      #   icc: Command line remark: option '-MP' not supported
9093e5383a99Smrg      if (grep 'ignoring option' conftest.err ||
9094e5383a99Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
9095e5383a99Smrg        am_cv_$1_dependencies_compiler_type=$depmode
9096e5383a99Smrg        break
9097e5383a99Smrg      fi
9098e5383a99Smrg    fi
9099e5383a99Smrg  done
9100b9b4fd27Smrg
9101e5383a99Smrg  cd ..
9102e5383a99Smrg  rm -rf conftest.dir
9103e5383a99Smrgelse
9104e5383a99Smrg  am_cv_$1_dependencies_compiler_type=none
9105e5383a99Smrgfi
9106af9a7ee5Smrg])
9107e5383a99SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
9108e5383a99SmrgAM_CONDITIONAL([am__fastdep$1], [
9109e5383a99Smrg  test "x$enable_dependency_tracking" != xno \
9110e5383a99Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
9111af9a7ee5Smrg])
9112b9b4fd27Smrg
9113b9b4fd27Smrg
9114e5383a99Smrg# AM_SET_DEPDIR
9115e5383a99Smrg# -------------
9116e5383a99Smrg# Choose a directory name for dependency files.
9117e5383a99Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
9118e5383a99SmrgAC_DEFUN([AM_SET_DEPDIR],
9119e5383a99Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
9120e5383a99SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
9121e5383a99Smrg])
9122b9b4fd27Smrg
9123b9b4fd27Smrg
9124e5383a99Smrg# AM_DEP_TRACK
9125e5383a99Smrg# ------------
9126e5383a99SmrgAC_DEFUN([AM_DEP_TRACK],
9127e5383a99Smrg[AC_ARG_ENABLE([dependency-tracking], [dnl
9128e5383a99SmrgAS_HELP_STRING(
9129e5383a99Smrg  [--enable-dependency-tracking],
9130e5383a99Smrg  [do not reject slow dependency extractors])
9131e5383a99SmrgAS_HELP_STRING(
9132e5383a99Smrg  [--disable-dependency-tracking],
9133e5383a99Smrg  [speeds up one-time build])])
9134e5383a99Smrgif test "x$enable_dependency_tracking" != xno; then
9135e5383a99Smrg  am_depcomp="$ac_aux_dir/depcomp"
9136e5383a99Smrg  AMDEPBACKSLASH='\'
9137e5383a99Smrg  am__nodep='_no'
9138e5383a99Smrgfi
9139e5383a99SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
9140e5383a99SmrgAC_SUBST([AMDEPBACKSLASH])dnl
9141e5383a99Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
9142e5383a99SmrgAC_SUBST([am__nodep])dnl
9143e5383a99Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl
9144af9a7ee5Smrg])
9145b9b4fd27Smrg
9146e5383a99Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
9147caade7ccSmrg
9148e5383a99Smrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
9149e5383a99Smrg#
9150e5383a99Smrg# This file is free software; the Free Software Foundation
9151e5383a99Smrg# gives unlimited permission to copy and/or distribute it,
9152e5383a99Smrg# with or without modifications, as long as this notice is preserved.
9153caade7ccSmrg
9154485f0483Smrg
9155e5383a99Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
9156e5383a99Smrg# ------------------------------
9157e5383a99SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
9158e5383a99Smrg[{
9159e5383a99Smrg  # Older Autoconf quotes --file arguments for eval, but not when files
9160e5383a99Smrg  # are listed without --file.  Let's play safe and only enable the eval
9161e5383a99Smrg  # if we detect the quoting.
9162e5383a99Smrg  case $CONFIG_FILES in
9163e5383a99Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
9164e5383a99Smrg  *)   set x $CONFIG_FILES ;;
9165e5383a99Smrg  esac
9166e5383a99Smrg  shift
9167e5383a99Smrg  for mf
9168e5383a99Smrg  do
9169e5383a99Smrg    # Strip MF so we end up with the name of the file.
9170e5383a99Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
9171e5383a99Smrg    # Check whether this is an Automake generated Makefile or not.
9172e5383a99Smrg    # We used to match only the files named 'Makefile.in', but
9173e5383a99Smrg    # some people rename them; so instead we look at the file content.
9174e5383a99Smrg    # Grep'ing the first line is not enough: some people post-process
9175e5383a99Smrg    # each Makefile.in and add a new line on top of each file to say so.
9176e5383a99Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
9177e5383a99Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
9178e5383a99Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
9179e5383a99Smrg      dirpart=`AS_DIRNAME("$mf")`
9180e5383a99Smrg    else
9181e5383a99Smrg      continue
9182e5383a99Smrg    fi
9183e5383a99Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
9184e5383a99Smrg    # from the Makefile without running 'make'.
9185e5383a99Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
9186e5383a99Smrg    test -z "$DEPDIR" && continue
9187e5383a99Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
9188e5383a99Smrg    test -z "$am__include" && continue
9189e5383a99Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
9190e5383a99Smrg    # Find all dependency output files, they are included files with
9191e5383a99Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
9192e5383a99Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
9193e5383a99Smrg    # expansion.
9194e5383a99Smrg    for file in `sed -n "
9195e5383a99Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
9196e5383a99Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
9197e5383a99Smrg      # Make sure the directory exists.
9198e5383a99Smrg      test -f "$dirpart/$file" && continue
9199e5383a99Smrg      fdir=`AS_DIRNAME(["$file"])`
9200e5383a99Smrg      AS_MKDIR_P([$dirpart/$fdir])
9201e5383a99Smrg      # echo "creating $dirpart/$file"
9202e5383a99Smrg      echo '# dummy' > "$dirpart/$file"
9203e5383a99Smrg    done
9204e5383a99Smrg  done
9205e5383a99Smrg}
9206e5383a99Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
9207caade7ccSmrg
9208e5383a99Smrg
9209e5383a99Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
9210e5383a99Smrg# -----------------------------
9211e5383a99Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
9212af9a7ee5Smrg#
9213e5383a99Smrg# This code is only required when automatic dependency tracking
9214e5383a99Smrg# is enabled.  FIXME.  This creates each '.P' file that we will
9215e5383a99Smrg# need in order to bootstrap the dependency handling code.
9216e5383a99SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
9217e5383a99Smrg[AC_CONFIG_COMMANDS([depfiles],
9218e5383a99Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
9219e5383a99Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
9220e5383a99Smrg])
9221caade7ccSmrg
9222e5383a99Smrg# Do all the work for Automake.                             -*- Autoconf -*-
9223caade7ccSmrg
9224e5383a99Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
9225e5383a99Smrg#
9226e5383a99Smrg# This file is free software; the Free Software Foundation
9227e5383a99Smrg# gives unlimited permission to copy and/or distribute it,
9228e5383a99Smrg# with or without modifications, as long as this notice is preserved.
9229caade7ccSmrg
9230e5383a99Smrg# This macro actually does too much.  Some checks are only needed if
9231e5383a99Smrg# your package does certain things.  But this isn't really a big deal.
9232caade7ccSmrg
9233e5383a99Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
9234e5383a99Smrg# AM_INIT_AUTOMAKE([OPTIONS])
9235e5383a99Smrg# -----------------------------------------------
9236e5383a99Smrg# The call with PACKAGE and VERSION arguments is the old style
9237e5383a99Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
9238e5383a99Smrg# and VERSION should now be passed to AC_INIT and removed from
9239e5383a99Smrg# the call to AM_INIT_AUTOMAKE.
9240e5383a99Smrg# We support both call styles for the transition.  After
9241e5383a99Smrg# the next Automake release, Autoconf can make the AC_INIT
9242e5383a99Smrg# arguments mandatory, and then we can depend on a new Autoconf
9243e5383a99Smrg# release and drop the old call support.
9244e5383a99SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
9245e5383a99Smrg[AC_PREREQ([2.65])dnl
9246e5383a99Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
9247e5383a99Smrgdnl the ones we care about.
9248e5383a99Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
9249e5383a99SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
9250e5383a99SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
9251e5383a99Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
9252e5383a99Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
9253e5383a99Smrg  # is not polluted with repeated "-I."
9254e5383a99Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
9255e5383a99Smrg  # test to see if srcdir already configured
9256e5383a99Smrg  if test -f $srcdir/config.status; then
9257e5383a99Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
9258e5383a99Smrg  fi
9259e5383a99Smrgfi
9260caade7ccSmrg
9261e5383a99Smrg# test whether we have cygpath
9262e5383a99Smrgif test -z "$CYGPATH_W"; then
9263e5383a99Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
9264e5383a99Smrg    CYGPATH_W='cygpath -w'
9265e5383a99Smrg  else
9266e5383a99Smrg    CYGPATH_W=echo
9267e5383a99Smrg  fi
9268e5383a99Smrgfi
9269e5383a99SmrgAC_SUBST([CYGPATH_W])
9270caade7ccSmrg
9271e5383a99Smrg# Define the identity of the package.
9272e5383a99Smrgdnl Distinguish between old-style and new-style calls.
9273e5383a99Smrgm4_ifval([$2],
9274e5383a99Smrg[AC_DIAGNOSE([obsolete],
9275e5383a99Smrg             [$0: two- and three-arguments forms are deprecated.])
9276e5383a99Smrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
9277e5383a99Smrg AC_SUBST([PACKAGE], [$1])dnl
9278e5383a99Smrg AC_SUBST([VERSION], [$2])],
9279e5383a99Smrg[_AM_SET_OPTIONS([$1])dnl
9280e5383a99Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
9281e5383a99Smrgm4_if(
9282e5383a99Smrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
9283e5383a99Smrg  [ok:ok],,
9284e5383a99Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
9285e5383a99Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
9286e5383a99Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
9287caade7ccSmrg
9288e5383a99Smrg_AM_IF_OPTION([no-define],,
9289e5383a99Smrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
9290e5383a99Smrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
9291b9b4fd27Smrg
9292e5383a99Smrg# Some tools Automake needs.
9293e5383a99SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
9294e5383a99SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
9295e5383a99SmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
9296e5383a99SmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
9297e5383a99SmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
9298e5383a99SmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
9299e5383a99SmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
9300e5383a99SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
9301e5383a99SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
9302e5383a99SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
9303e5383a99Smrg# For better backward compatibility.  To be removed once Automake 1.9.x
9304e5383a99Smrg# dies out for good.  For more background, see:
9305e5383a99Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
9306e5383a99Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
9307e5383a99SmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
9308e5383a99Smrg# We need awk for the "check" target.  The system "awk" is bad on
9309e5383a99Smrg# some platforms.
9310e5383a99SmrgAC_REQUIRE([AC_PROG_AWK])dnl
9311e5383a99SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
9312e5383a99SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
9313e5383a99Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
9314e5383a99Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
9315e5383a99Smrg			     [_AM_PROG_TAR([v7])])])
9316e5383a99Smrg_AM_IF_OPTION([no-dependencies],,
9317e5383a99Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
9318e5383a99Smrg		  [_AM_DEPENDENCIES([CC])],
9319e5383a99Smrg		  [m4_define([AC_PROG_CC],
9320e5383a99Smrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
9321e5383a99SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
9322e5383a99Smrg		  [_AM_DEPENDENCIES([CXX])],
9323e5383a99Smrg		  [m4_define([AC_PROG_CXX],
9324e5383a99Smrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
9325e5383a99SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
9326e5383a99Smrg		  [_AM_DEPENDENCIES([OBJC])],
9327e5383a99Smrg		  [m4_define([AC_PROG_OBJC],
9328e5383a99Smrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
9329e5383a99SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
9330e5383a99Smrg		  [_AM_DEPENDENCIES([OBJCXX])],
9331e5383a99Smrg		  [m4_define([AC_PROG_OBJCXX],
9332e5383a99Smrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
9333e5383a99Smrg])
9334e5383a99SmrgAC_REQUIRE([AM_SILENT_RULES])dnl
9335e5383a99Smrgdnl The testsuite driver may need to know about EXEEXT, so add the
9336e5383a99Smrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
9337e5383a99Smrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
9338e5383a99SmrgAC_CONFIG_COMMANDS_PRE(dnl
9339e5383a99Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
9340e5383a99Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
9341e5383a99Smrg])
9342b9b4fd27Smrg
9343e5383a99Smrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
9344e5383a99Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
9345e5383a99Smrgdnl mangled by Autoconf and run in a shell conditional statement.
9346e5383a99Smrgm4_define([_AC_COMPILER_EXEEXT],
9347e5383a99Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
9348b9b4fd27Smrg
9349b9b4fd27Smrg
9350e5383a99Smrg# When config.status generates a header, we must update the stamp-h file.
9351e5383a99Smrg# This file resides in the same directory as the config header
9352e5383a99Smrg# that is generated.  The stamp files are numbered to have different names.
9353b9b4fd27Smrg
9354e5383a99Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
9355e5383a99Smrg# loop where config.status creates the headers, so we can generate
9356e5383a99Smrg# our stamp files there.
9357e5383a99SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
9358e5383a99Smrg[# Compute $1's index in $config_headers.
9359e5383a99Smrg_am_arg=$1
9360e5383a99Smrg_am_stamp_count=1
9361e5383a99Smrgfor _am_header in $config_headers :; do
9362e5383a99Smrg  case $_am_header in
9363e5383a99Smrg    $_am_arg | $_am_arg:* )
9364e5383a99Smrg      break ;;
9365e5383a99Smrg    * )
9366e5383a99Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
9367e5383a99Smrg  esac
9368e5383a99Smrgdone
9369e5383a99Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
9370caade7ccSmrg
9371e5383a99Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
9372e5383a99Smrg#
9373e5383a99Smrg# This file is free software; the Free Software Foundation
9374e5383a99Smrg# gives unlimited permission to copy and/or distribute it,
9375e5383a99Smrg# with or without modifications, as long as this notice is preserved.
9376b9b4fd27Smrg
9377e5383a99Smrg# AM_PROG_INSTALL_SH
9378e5383a99Smrg# ------------------
9379e5383a99Smrg# Define $install_sh.
9380e5383a99SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
9381e5383a99Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
9382e5383a99Smrgif test x"${install_sh}" != xset; then
9383e5383a99Smrg  case $am_aux_dir in
9384e5383a99Smrg  *\ * | *\	*)
9385e5383a99Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
9386e5383a99Smrg  *)
9387e5383a99Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
9388e5383a99Smrg  esac
9389e5383a99Smrgfi
9390e5383a99SmrgAC_SUBST([install_sh])])
9391b9b4fd27Smrg
9392e5383a99Smrg# Copyright (C) 2003-2013 Free Software Foundation, Inc.
9393e5383a99Smrg#
9394e5383a99Smrg# This file is free software; the Free Software Foundation
9395e5383a99Smrg# gives unlimited permission to copy and/or distribute it,
9396e5383a99Smrg# with or without modifications, as long as this notice is preserved.
9397caade7ccSmrg
9398e5383a99Smrg# Check whether the underlying file-system supports filenames
9399e5383a99Smrg# with a leading dot.  For instance MS-DOS doesn't.
9400e5383a99SmrgAC_DEFUN([AM_SET_LEADING_DOT],
9401e5383a99Smrg[rm -rf .tst 2>/dev/null
9402e5383a99Smrgmkdir .tst 2>/dev/null
9403e5383a99Smrgif test -d .tst; then
9404e5383a99Smrg  am__leading_dot=.
9405e5383a99Smrgelse
9406e5383a99Smrg  am__leading_dot=_
9407e5383a99Smrgfi
9408e5383a99Smrgrmdir .tst 2>/dev/null
9409e5383a99SmrgAC_SUBST([am__leading_dot])])
9410caade7ccSmrg
9411e5383a99Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
9412caade7ccSmrg
9413e5383a99Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
9414e5383a99Smrg#
9415e5383a99Smrg# This file is free software; the Free Software Foundation
9416e5383a99Smrg# gives unlimited permission to copy and/or distribute it,
9417e5383a99Smrg# with or without modifications, as long as this notice is preserved.
9418caade7ccSmrg
9419e5383a99Smrg# AM_MAKE_INCLUDE()
9420e5383a99Smrg# -----------------
9421e5383a99Smrg# Check to see how make treats includes.
9422e5383a99SmrgAC_DEFUN([AM_MAKE_INCLUDE],
9423e5383a99Smrg[am_make=${MAKE-make}
9424e5383a99Smrgcat > confinc << 'END'
9425e5383a99Smrgam__doit:
9426e5383a99Smrg	@echo this is the am__doit target
9427e5383a99Smrg.PHONY: am__doit
9428e5383a99SmrgEND
9429e5383a99Smrg# If we don't find an include directive, just comment out the code.
9430e5383a99SmrgAC_MSG_CHECKING([for style of include used by $am_make])
9431e5383a99Smrgam__include="#"
9432e5383a99Smrgam__quote=
9433e5383a99Smrg_am_result=none
9434e5383a99Smrg# First try GNU make style include.
9435e5383a99Smrgecho "include confinc" > confmf
9436e5383a99Smrg# Ignore all kinds of additional output from 'make'.
9437e5383a99Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
9438e5383a99Smrg*the\ am__doit\ target*)
9439e5383a99Smrg  am__include=include
9440e5383a99Smrg  am__quote=
9441e5383a99Smrg  _am_result=GNU
9442e5383a99Smrg  ;;
9443e5383a99Smrgesac
9444e5383a99Smrg# Now try BSD make style include.
9445e5383a99Smrgif test "$am__include" = "#"; then
9446e5383a99Smrg   echo '.include "confinc"' > confmf
9447e5383a99Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
9448e5383a99Smrg   *the\ am__doit\ target*)
9449e5383a99Smrg     am__include=.include
9450e5383a99Smrg     am__quote="\""
9451e5383a99Smrg     _am_result=BSD
9452e5383a99Smrg     ;;
9453e5383a99Smrg   esac
9454e5383a99Smrgfi
9455e5383a99SmrgAC_SUBST([am__include])
9456e5383a99SmrgAC_SUBST([am__quote])
9457e5383a99SmrgAC_MSG_RESULT([$_am_result])
9458e5383a99Smrgrm -f confinc confmf
9459e5383a99Smrg])
9460caade7ccSmrg
9461e5383a99Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
9462caade7ccSmrg
9463e5383a99Smrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
9464e5383a99Smrg#
9465e5383a99Smrg# This file is free software; the Free Software Foundation
9466e5383a99Smrg# gives unlimited permission to copy and/or distribute it,
9467e5383a99Smrg# with or without modifications, as long as this notice is preserved.
9468caade7ccSmrg
9469e5383a99Smrg# AM_MISSING_PROG(NAME, PROGRAM)
9470e5383a99Smrg# ------------------------------
9471e5383a99SmrgAC_DEFUN([AM_MISSING_PROG],
9472e5383a99Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
9473e5383a99Smrg$1=${$1-"${am_missing_run}$2"}
9474e5383a99SmrgAC_SUBST($1)])
9475caade7ccSmrg
9476e5383a99Smrg# AM_MISSING_HAS_RUN
9477e5383a99Smrg# ------------------
9478e5383a99Smrg# Define MISSING if not defined so far and test if it is modern enough.
9479e5383a99Smrg# If it is, set am_missing_run to use it, otherwise, to nothing.
9480e5383a99SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
9481e5383a99Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
9482e5383a99SmrgAC_REQUIRE_AUX_FILE([missing])dnl
9483e5383a99Smrgif test x"${MISSING+set}" != xset; then
9484e5383a99Smrg  case $am_aux_dir in
9485e5383a99Smrg  *\ * | *\	*)
9486e5383a99Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
9487e5383a99Smrg  *)
9488e5383a99Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
9489e5383a99Smrg  esac
9490e5383a99Smrgfi
9491e5383a99Smrg# Use eval to expand $SHELL
9492e5383a99Smrgif eval "$MISSING --is-lightweight"; then
9493e5383a99Smrg  am_missing_run="$MISSING "
9494e5383a99Smrgelse
9495e5383a99Smrg  am_missing_run=
9496e5383a99Smrg  AC_MSG_WARN(['missing' script is too old or missing])
9497e5383a99Smrgfi
9498b9b4fd27Smrg])
9499caade7ccSmrg
9500e5383a99Smrg# Helper functions for option handling.                     -*- Autoconf -*-
9501b9b4fd27Smrg
9502e5383a99Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
9503e5383a99Smrg#
9504e5383a99Smrg# This file is free software; the Free Software Foundation
9505e5383a99Smrg# gives unlimited permission to copy and/or distribute it,
9506e5383a99Smrg# with or without modifications, as long as this notice is preserved.
9507b9b4fd27Smrg
9508e5383a99Smrg# _AM_MANGLE_OPTION(NAME)
9509e5383a99Smrg# -----------------------
9510e5383a99SmrgAC_DEFUN([_AM_MANGLE_OPTION],
9511e5383a99Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
9512af9a7ee5Smrg
9513e5383a99Smrg# _AM_SET_OPTION(NAME)
9514e5383a99Smrg# --------------------
9515e5383a99Smrg# Set option NAME.  Presently that only means defining a flag for this option.
9516e5383a99SmrgAC_DEFUN([_AM_SET_OPTION],
9517e5383a99Smrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
9518b9b4fd27Smrg
9519e5383a99Smrg# _AM_SET_OPTIONS(OPTIONS)
9520e5383a99Smrg# ------------------------
9521e5383a99Smrg# OPTIONS is a space-separated list of Automake options.
9522e5383a99SmrgAC_DEFUN([_AM_SET_OPTIONS],
9523e5383a99Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
9524b9b4fd27Smrg
9525e5383a99Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
9526e5383a99Smrg# -------------------------------------------
9527e5383a99Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
9528e5383a99SmrgAC_DEFUN([_AM_IF_OPTION],
9529e5383a99Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
9530b9b4fd27Smrg
9531e5383a99Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
9532e5383a99Smrg
9533e5383a99Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
9534af9a7ee5Smrg#
9535e5383a99Smrg# This file is free software; the Free Software Foundation
9536e5383a99Smrg# gives unlimited permission to copy and/or distribute it,
9537e5383a99Smrg# with or without modifications, as long as this notice is preserved.
9538b9b4fd27Smrg
9539e5383a99Smrg# AM_SANITY_CHECK
9540e5383a99Smrg# ---------------
9541e5383a99SmrgAC_DEFUN([AM_SANITY_CHECK],
9542e5383a99Smrg[AC_MSG_CHECKING([whether build environment is sane])
9543e5383a99Smrg# Reject unsafe characters in $srcdir or the absolute working directory
9544e5383a99Smrg# name.  Accept space and tab only in the latter.
9545e5383a99Smrgam_lf='
9546e5383a99Smrg'
9547e5383a99Smrgcase `pwd` in
9548e5383a99Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
9549e5383a99Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
9550e5383a99Smrgesac
9551e5383a99Smrgcase $srcdir in
9552e5383a99Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
9553e5383a99Smrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
9554e5383a99Smrgesac
9555b9b4fd27Smrg
9556e5383a99Smrg# Do 'set' in a subshell so we don't clobber the current shell's
9557e5383a99Smrg# arguments.  Must try -L first in case configure is actually a
9558e5383a99Smrg# symlink; some systems play weird games with the mod time of symlinks
9559e5383a99Smrg# (eg FreeBSD returns the mod time of the symlink's containing
9560e5383a99Smrg# directory).
9561e5383a99Smrgif (
9562e5383a99Smrg   am_has_slept=no
9563e5383a99Smrg   for am_try in 1 2; do
9564e5383a99Smrg     echo "timestamp, slept: $am_has_slept" > conftest.file
9565e5383a99Smrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
9566e5383a99Smrg     if test "$[*]" = "X"; then
9567e5383a99Smrg	# -L didn't work.
9568e5383a99Smrg	set X `ls -t "$srcdir/configure" conftest.file`
9569e5383a99Smrg     fi
9570e5383a99Smrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
9571e5383a99Smrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
9572af9a7ee5Smrg
9573e5383a99Smrg	# If neither matched, then we have a broken ls.  This can happen
9574e5383a99Smrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
9575e5383a99Smrg	# broken ls alias from the environment.  This has actually
9576e5383a99Smrg	# happened.  Such a system could not be considered "sane".
9577e5383a99Smrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
9578e5383a99Smrg  alias in your environment])
9579e5383a99Smrg     fi
9580e5383a99Smrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
9581e5383a99Smrg       break
9582e5383a99Smrg     fi
9583e5383a99Smrg     # Just in case.
9584e5383a99Smrg     sleep 1
9585e5383a99Smrg     am_has_slept=yes
9586e5383a99Smrg   done
9587e5383a99Smrg   test "$[2]" = conftest.file
9588e5383a99Smrg   )
9589e5383a99Smrgthen
9590e5383a99Smrg   # Ok.
9591e5383a99Smrg   :
9592e5383a99Smrgelse
9593e5383a99Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
9594e5383a99SmrgCheck your system clock])
9595e5383a99Smrgfi
9596e5383a99SmrgAC_MSG_RESULT([yes])
9597e5383a99Smrg# If we didn't sleep, we still need to ensure time stamps of config.status and
9598e5383a99Smrg# generated files are strictly newer.
9599e5383a99Smrgam_sleep_pid=
9600e5383a99Smrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
9601e5383a99Smrg  ( sleep 1 ) &
9602e5383a99Smrg  am_sleep_pid=$!
9603e5383a99Smrgfi
9604e5383a99SmrgAC_CONFIG_COMMANDS_PRE(
9605e5383a99Smrg  [AC_MSG_CHECKING([that generated files are newer than configure])
9606e5383a99Smrg   if test -n "$am_sleep_pid"; then
9607e5383a99Smrg     # Hide warnings about reused PIDs.
9608e5383a99Smrg     wait $am_sleep_pid 2>/dev/null
9609e5383a99Smrg   fi
9610e5383a99Smrg   AC_MSG_RESULT([done])])
9611e5383a99Smrgrm -f conftest.file
9612e5383a99Smrg])
9613e5383a99Smrg
9614e5383a99Smrg# Copyright (C) 2009-2013 Free Software Foundation, Inc.
9615af9a7ee5Smrg#
9616e5383a99Smrg# This file is free software; the Free Software Foundation
9617e5383a99Smrg# gives unlimited permission to copy and/or distribute it,
9618e5383a99Smrg# with or without modifications, as long as this notice is preserved.
9619af9a7ee5Smrg
9620e5383a99Smrg# AM_SILENT_RULES([DEFAULT])
9621e5383a99Smrg# --------------------------
9622e5383a99Smrg# Enable less verbose build rules; with the default set to DEFAULT
9623e5383a99Smrg# ("yes" being less verbose, "no" or empty being verbose).
9624e5383a99SmrgAC_DEFUN([AM_SILENT_RULES],
9625e5383a99Smrg[AC_ARG_ENABLE([silent-rules], [dnl
9626e5383a99SmrgAS_HELP_STRING(
9627e5383a99Smrg  [--enable-silent-rules],
9628e5383a99Smrg  [less verbose build output (undo: "make V=1")])
9629e5383a99SmrgAS_HELP_STRING(
9630e5383a99Smrg  [--disable-silent-rules],
9631e5383a99Smrg  [verbose build output (undo: "make V=0")])dnl
9632e5383a99Smrg])
9633e5383a99Smrgcase $enable_silent_rules in @%:@ (((
9634e5383a99Smrg  yes) AM_DEFAULT_VERBOSITY=0;;
9635e5383a99Smrg   no) AM_DEFAULT_VERBOSITY=1;;
9636e5383a99Smrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
9637e5383a99Smrgesac
9638e5383a99Smrgdnl
9639e5383a99Smrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
9640e5383a99Smrgdnl do not support nested variable expansions.
9641e5383a99Smrgdnl See automake bug#9928 and bug#10237.
9642e5383a99Smrgam_make=${MAKE-make}
9643e5383a99SmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
9644e5383a99Smrg   [am_cv_make_support_nested_variables],
9645e5383a99Smrg   [if AS_ECHO([['TRUE=$(BAR$(V))
9646e5383a99SmrgBAR0=false
9647e5383a99SmrgBAR1=true
9648e5383a99SmrgV=1
9649e5383a99Smrgam__doit:
9650e5383a99Smrg	@$(TRUE)
9651e5383a99Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
9652e5383a99Smrg  am_cv_make_support_nested_variables=yes
9653e5383a99Smrgelse
9654e5383a99Smrg  am_cv_make_support_nested_variables=no
9655e5383a99Smrgfi])
9656e5383a99Smrgif test $am_cv_make_support_nested_variables = yes; then
9657e5383a99Smrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
9658e5383a99Smrg  AM_V='$(V)'
9659e5383a99Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
9660e5383a99Smrgelse
9661e5383a99Smrg  AM_V=$AM_DEFAULT_VERBOSITY
9662e5383a99Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
9663b9b4fd27Smrgfi
9664e5383a99SmrgAC_SUBST([AM_V])dnl
9665e5383a99SmrgAM_SUBST_NOTMAKE([AM_V])dnl
9666e5383a99SmrgAC_SUBST([AM_DEFAULT_V])dnl
9667e5383a99SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
9668e5383a99SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
9669e5383a99SmrgAM_BACKSLASH='\'
9670e5383a99SmrgAC_SUBST([AM_BACKSLASH])dnl
9671e5383a99Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
9672e5383a99Smrg])
9673b9b4fd27Smrg
9674e5383a99Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
9675af9a7ee5Smrg#
9676e5383a99Smrg# This file is free software; the Free Software Foundation
9677e5383a99Smrg# gives unlimited permission to copy and/or distribute it,
9678e5383a99Smrg# with or without modifications, as long as this notice is preserved.
9679caade7ccSmrg
9680e5383a99Smrg# AM_PROG_INSTALL_STRIP
9681e5383a99Smrg# ---------------------
9682e5383a99Smrg# One issue with vendor 'install' (even GNU) is that you can't
9683e5383a99Smrg# specify the program used to strip binaries.  This is especially
9684e5383a99Smrg# annoying in cross-compiling environments, where the build's strip
9685e5383a99Smrg# is unlikely to handle the host's binaries.
9686e5383a99Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
9687e5383a99Smrg# always use install-sh in "make install-strip", and initialize
9688e5383a99Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
9689e5383a99SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
9690e5383a99Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
9691e5383a99Smrg# Installed binaries are usually stripped using 'strip' when the user
9692e5383a99Smrg# run "make install-strip".  However 'strip' might not be the right
9693e5383a99Smrg# tool to use in cross-compilation environments, therefore Automake
9694e5383a99Smrg# will honor the 'STRIP' environment variable to overrule this program.
9695e5383a99Smrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
9696e5383a99Smrgif test "$cross_compiling" != no; then
9697e5383a99Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
9698e5383a99Smrgfi
9699e5383a99SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
9700e5383a99SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
9701caade7ccSmrg
9702e5383a99Smrg# Copyright (C) 2006-2013 Free Software Foundation, Inc.
9703e5383a99Smrg#
9704e5383a99Smrg# This file is free software; the Free Software Foundation
9705e5383a99Smrg# gives unlimited permission to copy and/or distribute it,
9706e5383a99Smrg# with or without modifications, as long as this notice is preserved.
9707af9a7ee5Smrg
9708e5383a99Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
9709e5383a99Smrg# ---------------------------
9710e5383a99Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
9711e5383a99Smrg# This macro is traced by Automake.
9712e5383a99SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
9713e5383a99Smrg
9714e5383a99Smrg# AM_SUBST_NOTMAKE(VARIABLE)
9715e5383a99Smrg# --------------------------
9716e5383a99Smrg# Public sister of _AM_SUBST_NOTMAKE.
9717e5383a99SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
9718af9a7ee5Smrg
9719e5383a99Smrg# Check how to create a tarball.                            -*- Autoconf -*-
9720af9a7ee5Smrg
9721e5383a99Smrg# Copyright (C) 2004-2013 Free Software Foundation, Inc.
9722af9a7ee5Smrg#
9723e5383a99Smrg# This file is free software; the Free Software Foundation
9724e5383a99Smrg# gives unlimited permission to copy and/or distribute it,
9725e5383a99Smrg# with or without modifications, as long as this notice is preserved.
9726e5383a99Smrg
9727e5383a99Smrg# _AM_PROG_TAR(FORMAT)
9728e5383a99Smrg# --------------------
9729e5383a99Smrg# Check how to create a tarball in format FORMAT.
9730e5383a99Smrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
9731af9a7ee5Smrg#
9732e5383a99Smrg# Substitute a variable $(am__tar) that is a command
9733e5383a99Smrg# writing to stdout a FORMAT-tarball containing the directory
9734e5383a99Smrg# $tardir.
9735e5383a99Smrg#     tardir=directory && $(am__tar) > result.tar
9736af9a7ee5Smrg#
9737e5383a99Smrg# Substitute a variable $(am__untar) that extract such
9738e5383a99Smrg# a tarball read from stdin.
9739e5383a99Smrg#     $(am__untar) < result.tar
9740af9a7ee5Smrg#
9741e5383a99SmrgAC_DEFUN([_AM_PROG_TAR],
9742e5383a99Smrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
9743e5383a99Smrg# in the wild :-(  We should find a proper way to deprecate it ...
9744e5383a99SmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
9745caade7ccSmrg
9746e5383a99Smrg# We'll loop over all known methods to create a tar archive until one works.
9747e5383a99Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
9748caade7ccSmrg
9749e5383a99Smrgm4_if([$1], [v7],
9750e5383a99Smrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
9751a5602400Smrg
9752e5383a99Smrg  [m4_case([$1],
9753e5383a99Smrg    [ustar],
9754e5383a99Smrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
9755e5383a99Smrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
9756e5383a99Smrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
9757e5383a99Smrg      # and bug#13588).
9758e5383a99Smrg      am_max_uid=2097151 # 2^21 - 1
9759e5383a99Smrg      am_max_gid=$am_max_uid
9760e5383a99Smrg      # The $UID and $GID variables are not portable, so we need to resort
9761e5383a99Smrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
9762e5383a99Smrg      # below are definitely unexpected, so allow the users to see them
9763e5383a99Smrg      # (that is, avoid stderr redirection).
9764e5383a99Smrg      am_uid=`id -u || echo unknown`
9765e5383a99Smrg      am_gid=`id -g || echo unknown`
9766e5383a99Smrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
9767e5383a99Smrg      if test $am_uid -le $am_max_uid; then
9768e5383a99Smrg         AC_MSG_RESULT([yes])
9769e5383a99Smrg      else
9770e5383a99Smrg         AC_MSG_RESULT([no])
9771e5383a99Smrg         _am_tools=none
9772e5383a99Smrg      fi
9773e5383a99Smrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
9774e5383a99Smrg      if test $am_gid -le $am_max_gid; then
9775e5383a99Smrg         AC_MSG_RESULT([yes])
9776e5383a99Smrg      else
9777e5383a99Smrg        AC_MSG_RESULT([no])
9778e5383a99Smrg        _am_tools=none
9779e5383a99Smrg      fi],
9780a5602400Smrg
9781e5383a99Smrg  [pax],
9782e5383a99Smrg    [],
9783caade7ccSmrg
9784e5383a99Smrg  [m4_fatal([Unknown tar format])])
9785caade7ccSmrg
9786e5383a99Smrg  AC_MSG_CHECKING([how to create a $1 tar archive])
9787b9b4fd27Smrg
9788e5383a99Smrg  # Go ahead even if we have the value already cached.  We do so because we
9789e5383a99Smrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
9790e5383a99Smrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
9791caade7ccSmrg
9792e5383a99Smrg  for _am_tool in $_am_tools; do
9793e5383a99Smrg    case $_am_tool in
9794e5383a99Smrg    gnutar)
9795e5383a99Smrg      for _am_tar in tar gnutar gtar; do
9796e5383a99Smrg        AM_RUN_LOG([$_am_tar --version]) && break
9797e5383a99Smrg      done
9798e5383a99Smrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
9799e5383a99Smrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
9800e5383a99Smrg      am__untar="$_am_tar -xf -"
9801e5383a99Smrg      ;;
9802e5383a99Smrg    plaintar)
9803e5383a99Smrg      # Must skip GNU tar: if it does not support --format= it doesn't create
9804e5383a99Smrg      # ustar tarball either.
9805e5383a99Smrg      (tar --version) >/dev/null 2>&1 && continue
9806e5383a99Smrg      am__tar='tar chf - "$$tardir"'
9807e5383a99Smrg      am__tar_='tar chf - "$tardir"'
9808e5383a99Smrg      am__untar='tar xf -'
9809e5383a99Smrg      ;;
9810e5383a99Smrg    pax)
9811e5383a99Smrg      am__tar='pax -L -x $1 -w "$$tardir"'
9812e5383a99Smrg      am__tar_='pax -L -x $1 -w "$tardir"'
9813e5383a99Smrg      am__untar='pax -r'
9814e5383a99Smrg      ;;
9815e5383a99Smrg    cpio)
9816e5383a99Smrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
9817e5383a99Smrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
9818e5383a99Smrg      am__untar='cpio -i -H $1 -d'
9819e5383a99Smrg      ;;
9820e5383a99Smrg    none)
9821e5383a99Smrg      am__tar=false
9822e5383a99Smrg      am__tar_=false
9823e5383a99Smrg      am__untar=false
9824e5383a99Smrg      ;;
9825e5383a99Smrg    esac
9826caade7ccSmrg
9827e5383a99Smrg    # If the value was cached, stop now.  We just wanted to have am__tar
9828e5383a99Smrg    # and am__untar set.
9829e5383a99Smrg    test -n "${am_cv_prog_tar_$1}" && break
9830caade7ccSmrg
9831e5383a99Smrg    # tar/untar a dummy directory, and stop if the command works.
9832e5383a99Smrg    rm -rf conftest.dir
9833e5383a99Smrg    mkdir conftest.dir
9834e5383a99Smrg    echo GrepMe > conftest.dir/file
9835e5383a99Smrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
9836e5383a99Smrg    rm -rf conftest.dir
9837e5383a99Smrg    if test -s conftest.tar; then
9838e5383a99Smrg      AM_RUN_LOG([$am__untar <conftest.tar])
9839e5383a99Smrg      AM_RUN_LOG([cat conftest.dir/file])
9840e5383a99Smrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
9841e5383a99Smrg    fi
9842e5383a99Smrg  done
9843e5383a99Smrg  rm -rf conftest.dir
9844e5383a99Smrg
9845e5383a99Smrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
9846e5383a99Smrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
9847e5383a99Smrg
9848e5383a99SmrgAC_SUBST([am__tar])
9849e5383a99SmrgAC_SUBST([am__untar])
9850e5383a99Smrg]) # _AM_PROG_TAR
9851caade7ccSmrg
9852af9a7ee5Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
9853af9a7ee5Smrgdnl
9854af9a7ee5Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
9855e5383a99Smrgdnl
9856af9a7ee5Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
9857af9a7ee5Smrgdnl copy of this software and associated documentation files (the "Software"),
9858af9a7ee5Smrgdnl to deal in the Software without restriction, including without limitation
9859af9a7ee5Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
9860af9a7ee5Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
9861af9a7ee5Smrgdnl Software is furnished to do so, subject to the following conditions:
9862af9a7ee5Smrgdnl
9863af9a7ee5Smrgdnl The above copyright notice and this permission notice (including the next
9864af9a7ee5Smrgdnl paragraph) shall be included in all copies or substantial portions of the
9865af9a7ee5Smrgdnl Software.
9866af9a7ee5Smrgdnl
9867af9a7ee5Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9868af9a7ee5Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9869af9a7ee5Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
9870af9a7ee5Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9871af9a7ee5Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9872af9a7ee5Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
9873af9a7ee5Smrgdnl DEALINGS IN THE SOFTWARE.
9874caade7ccSmrg
9875af9a7ee5Smrg# XORG_MACROS_VERSION(required-version)
9876af9a7ee5Smrg# -------------------------------------
9877af9a7ee5Smrg# Minimum version: 1.1.0
9878af9a7ee5Smrg#
9879af9a7ee5Smrg# If you're using a macro added in Version 1.1 or newer, include this in
9880af9a7ee5Smrg# your configure.ac with the minimum required version, such as:
9881af9a7ee5Smrg# XORG_MACROS_VERSION(1.1)
9882af9a7ee5Smrg#
9883af9a7ee5Smrg# To ensure that this macro is defined, also add:
9884af9a7ee5Smrg# m4_ifndef([XORG_MACROS_VERSION],
9885af9a7ee5Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9886af9a7ee5Smrg#
9887af9a7ee5Smrg#
9888e5383a99Smrg# See the "minimum version" comment for each macro you use to see what
9889af9a7ee5Smrg# version you require.
9890af9a7ee5Smrgm4_defun([XORG_MACROS_VERSION],[
9891e5383a99Smrgm4_define([vers_have], [1.19.0])
9892af9a7ee5Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
9893af9a7ee5Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
9894af9a7ee5Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
9895af9a7ee5Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
9896af9a7ee5Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
9897af9a7ee5Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
9898af9a7ee5Smrgm4_undefine([vers_have])
9899af9a7ee5Smrgm4_undefine([maj_have])
9900af9a7ee5Smrgm4_undefine([maj_needed])
9901af9a7ee5Smrg]) # XORG_MACROS_VERSION
9902caade7ccSmrg
9903af9a7ee5Smrg# XORG_PROG_RAWCPP()
9904af9a7ee5Smrg# ------------------
9905af9a7ee5Smrg# Minimum version: 1.0.0
9906af9a7ee5Smrg#
9907af9a7ee5Smrg# Find cpp program and necessary flags for use in pre-processing text files
9908af9a7ee5Smrg# such as man pages and config files
9909af9a7ee5SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
9910af9a7ee5SmrgAC_REQUIRE([AC_PROG_CPP])
9911e5383a99SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
9912af9a7ee5Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9913caade7ccSmrg
9914af9a7ee5Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
9915af9a7ee5Smrg# which is not the best choice for supporting other OS'es, but covers most
9916af9a7ee5Smrg# of the ones we need for now.
9917af9a7ee5SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
9918af9a7ee5SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
9919af9a7ee5Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9920af9a7ee5Smrg	AC_MSG_RESULT([no])
9921a5602400Smrgelse
9922af9a7ee5Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9923af9a7ee5Smrg		RAWCPPFLAGS=-undef
9924af9a7ee5Smrg		AC_MSG_RESULT([yes])
9925af9a7ee5Smrg	# under Cygwin unix is still defined even with -undef
9926af9a7ee5Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9927af9a7ee5Smrg		RAWCPPFLAGS="-undef -ansi"
9928af9a7ee5Smrg		AC_MSG_RESULT([yes, with -ansi])
9929af9a7ee5Smrg	else
9930af9a7ee5Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9931af9a7ee5Smrg	fi
9932a5602400Smrgfi
9933af9a7ee5Smrgrm -f conftest.$ac_ext
9934caade7ccSmrg
9935af9a7ee5SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
9936af9a7ee5SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
9937af9a7ee5Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9938af9a7ee5Smrg	AC_MSG_RESULT([no])
9939af9a7ee5Smrgelse
9940af9a7ee5Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9941e5383a99Smrg		TRADITIONALCPPFLAGS="-traditional"
9942af9a7ee5Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
9943af9a7ee5Smrg		AC_MSG_RESULT([yes])
9944af9a7ee5Smrg	else
9945af9a7ee5Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
9946af9a7ee5Smrg	fi
9947a5602400Smrgfi
9948af9a7ee5Smrgrm -f conftest.$ac_ext
9949af9a7ee5SmrgAC_SUBST(RAWCPPFLAGS)
9950e5383a99SmrgAC_SUBST(TRADITIONALCPPFLAGS)
9951af9a7ee5Smrg]) # XORG_PROG_RAWCPP
9952caade7ccSmrg
9953af9a7ee5Smrg# XORG_MANPAGE_SECTIONS()
9954af9a7ee5Smrg# -----------------------
9955af9a7ee5Smrg# Minimum version: 1.0.0
9956af9a7ee5Smrg#
9957af9a7ee5Smrg# Determine which sections man pages go in for the different man page types
9958af9a7ee5Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
9959af9a7ee5Smrg# Not sure if there's any better way than just hardcoding by OS name.
9960af9a7ee5Smrg# Override default settings by setting environment variables
9961af9a7ee5Smrg# Added MAN_SUBSTS in version 1.8
9962af9a7ee5Smrg# Added AC_PROG_SED in version 1.8
9963af9a7ee5Smrg
9964af9a7ee5SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
9965af9a7ee5SmrgAC_REQUIRE([AC_CANONICAL_HOST])
9966af9a7ee5SmrgAC_REQUIRE([AC_PROG_SED])
9967af9a7ee5Smrg
9968af9a7ee5Smrgif test x$APP_MAN_SUFFIX = x    ; then
9969af9a7ee5Smrg    APP_MAN_SUFFIX=1
9970af9a7ee5Smrgfi
9971af9a7ee5Smrgif test x$APP_MAN_DIR = x    ; then
9972af9a7ee5Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
9973af9a7ee5Smrgfi
9974af9a7ee5Smrg
9975af9a7ee5Smrgif test x$LIB_MAN_SUFFIX = x    ; then
9976af9a7ee5Smrg    LIB_MAN_SUFFIX=3
9977af9a7ee5Smrgfi
9978af9a7ee5Smrgif test x$LIB_MAN_DIR = x    ; then
9979af9a7ee5Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
9980af9a7ee5Smrgfi
9981af9a7ee5Smrg
9982af9a7ee5Smrgif test x$FILE_MAN_SUFFIX = x    ; then
9983af9a7ee5Smrg    case $host_os in
9984af9a7ee5Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
9985af9a7ee5Smrg	*)		FILE_MAN_SUFFIX=5  ;;
9986a5602400Smrg    esac
9987af9a7ee5Smrgfi
9988af9a7ee5Smrgif test x$FILE_MAN_DIR = x    ; then
9989af9a7ee5Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
9990af9a7ee5Smrgfi
9991a5602400Smrg
9992af9a7ee5Smrgif test x$MISC_MAN_SUFFIX = x    ; then
9993af9a7ee5Smrg    case $host_os in
9994af9a7ee5Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
9995af9a7ee5Smrg	*)		MISC_MAN_SUFFIX=7  ;;
9996a5602400Smrg    esac
9997af9a7ee5Smrgfi
9998af9a7ee5Smrgif test x$MISC_MAN_DIR = x    ; then
9999af9a7ee5Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
10000af9a7ee5Smrgfi
10001caade7ccSmrg
10002af9a7ee5Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
10003af9a7ee5Smrg    case $host_os in
10004af9a7ee5Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
10005af9a7ee5Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
10006af9a7ee5Smrg    esac
10007af9a7ee5Smrgfi
10008af9a7ee5Smrgif test x$DRIVER_MAN_DIR = x    ; then
10009af9a7ee5Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
10010af9a7ee5Smrgfi
10011caade7ccSmrg
10012af9a7ee5Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
10013af9a7ee5Smrg    case $host_os in
10014af9a7ee5Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
10015af9a7ee5Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
10016af9a7ee5Smrg    esac
10017af9a7ee5Smrgfi
10018af9a7ee5Smrgif test x$ADMIN_MAN_DIR = x    ; then
10019af9a7ee5Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
10020af9a7ee5Smrgfi
10021caade7ccSmrg
10022b9b4fd27Smrg
10023af9a7ee5SmrgAC_SUBST([APP_MAN_SUFFIX])
10024af9a7ee5SmrgAC_SUBST([LIB_MAN_SUFFIX])
10025af9a7ee5SmrgAC_SUBST([FILE_MAN_SUFFIX])
10026af9a7ee5SmrgAC_SUBST([MISC_MAN_SUFFIX])
10027af9a7ee5SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
10028af9a7ee5SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
10029af9a7ee5SmrgAC_SUBST([APP_MAN_DIR])
10030af9a7ee5SmrgAC_SUBST([LIB_MAN_DIR])
10031af9a7ee5SmrgAC_SUBST([FILE_MAN_DIR])
10032af9a7ee5SmrgAC_SUBST([MISC_MAN_DIR])
10033af9a7ee5SmrgAC_SUBST([DRIVER_MAN_DIR])
10034af9a7ee5SmrgAC_SUBST([ADMIN_MAN_DIR])
10035b9b4fd27Smrg
10036af9a7ee5SmrgXORG_MAN_PAGE="X Version 11"
10037af9a7ee5SmrgAC_SUBST([XORG_MAN_PAGE])
10038af9a7ee5SmrgMAN_SUBSTS="\
10039af9a7ee5Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
10040af9a7ee5Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
10041af9a7ee5Smrg	-e 's|__xservername__|Xorg|g' \
10042af9a7ee5Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
10043e5383a99Smrg	-e 's|__xorgconfdir__|xorg.conf.d|g' \
10044af9a7ee5Smrg	-e 's|__projectroot__|\$(prefix)|g' \
10045af9a7ee5Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
10046af9a7ee5Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
10047af9a7ee5Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
10048af9a7ee5Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
10049af9a7ee5Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
10050af9a7ee5Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
10051af9a7ee5Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
10052af9a7ee5SmrgAC_SUBST([MAN_SUBSTS])
10053b9b4fd27Smrg
10054af9a7ee5Smrg]) # XORG_MANPAGE_SECTIONS
10055b9b4fd27Smrg
10056af9a7ee5Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
10057af9a7ee5Smrg# ------------------------
10058af9a7ee5Smrg# Minimum version: 1.7.0
10059af9a7ee5Smrg#
10060af9a7ee5Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
10061af9a7ee5Smrg# provided by xorg-sgml-doctools, if installed.
10062af9a7ee5SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
10063af9a7ee5SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
10064af9a7ee5SmrgXORG_SGML_PATH=
10065af9a7ee5SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
10066af9a7ee5Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
10067af9a7ee5Smrg    [m4_ifval([$1],[:],
10068af9a7ee5Smrg        [if test x"$cross_compiling" != x"yes" ; then
10069af9a7ee5Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
10070af9a7ee5Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
10071af9a7ee5Smrg         fi])
10072af9a7ee5Smrg    ])
10073b9b4fd27Smrg
10074af9a7ee5Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
10075af9a7ee5Smrg# the path and the name of the doc stylesheet
10076af9a7ee5Smrgif test "x$XORG_SGML_PATH" != "x" ; then
10077af9a7ee5Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
10078af9a7ee5Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
10079af9a7ee5Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
10080af9a7ee5Smrgelse
10081af9a7ee5Smrg   AC_MSG_RESULT([no])
10082af9a7ee5Smrgfi
10083b9b4fd27Smrg
10084af9a7ee5SmrgAC_SUBST(XORG_SGML_PATH)
10085af9a7ee5SmrgAC_SUBST(STYLESHEET_SRCDIR)
10086af9a7ee5SmrgAC_SUBST(XSL_STYLESHEET)
10087af9a7ee5SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
10088af9a7ee5Smrg]) # XORG_CHECK_SGML_DOCTOOLS
10089b9b4fd27Smrg
10090af9a7ee5Smrg# XORG_CHECK_LINUXDOC
10091af9a7ee5Smrg# -------------------
10092af9a7ee5Smrg# Minimum version: 1.0.0
10093af9a7ee5Smrg#
10094af9a7ee5Smrg# Defines the variable MAKE_TEXT if the necessary tools and
10095af9a7ee5Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
10096af9a7ee5Smrg# Whether or not the necessary tools and files are found can be checked
10097af9a7ee5Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
10098af9a7ee5SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
10099af9a7ee5SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10100af9a7ee5SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
10101b9b4fd27Smrg
10102af9a7ee5SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
10103caade7ccSmrg
10104af9a7ee5SmrgAC_MSG_CHECKING([whether to build documentation])
10105caade7ccSmrg
10106af9a7ee5Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
10107af9a7ee5Smrg   BUILDDOC=yes
10108af9a7ee5Smrgelse
10109af9a7ee5Smrg   BUILDDOC=no
10110af9a7ee5Smrgfi
10111b9b4fd27Smrg
10112af9a7ee5SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
10113caade7ccSmrg
10114af9a7ee5SmrgAC_MSG_RESULT([$BUILDDOC])
10115caade7ccSmrg
10116af9a7ee5SmrgAC_MSG_CHECKING([whether to build pdf documentation])
10117caade7ccSmrg
10118af9a7ee5Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
10119af9a7ee5Smrg   BUILDPDFDOC=yes
10120af9a7ee5Smrgelse
10121af9a7ee5Smrg   BUILDPDFDOC=no
10122af9a7ee5Smrgfi
10123caade7ccSmrg
10124af9a7ee5SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10125caade7ccSmrg
10126af9a7ee5SmrgAC_MSG_RESULT([$BUILDPDFDOC])
10127caade7ccSmrg
10128af9a7ee5SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
10129af9a7ee5SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
10130af9a7ee5SmrgMAKE_PDF="$PS2PDF"
10131af9a7ee5SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
10132caade7ccSmrg
10133af9a7ee5SmrgAC_SUBST(MAKE_TEXT)
10134af9a7ee5SmrgAC_SUBST(MAKE_PS)
10135af9a7ee5SmrgAC_SUBST(MAKE_PDF)
10136af9a7ee5SmrgAC_SUBST(MAKE_HTML)
10137af9a7ee5Smrg]) # XORG_CHECK_LINUXDOC
10138caade7ccSmrg
10139af9a7ee5Smrg# XORG_CHECK_DOCBOOK
10140af9a7ee5Smrg# -------------------
10141af9a7ee5Smrg# Minimum version: 1.0.0
10142af9a7ee5Smrg#
10143af9a7ee5Smrg# Checks for the ability to build output formats from SGML DocBook source.
10144af9a7ee5Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
10145af9a7ee5Smrg# indicates whether the necessary tools and files are found and, if set,
10146af9a7ee5Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
10147af9a7ee5SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
10148af9a7ee5SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10149caade7ccSmrg
10150af9a7ee5SmrgBUILDTXTDOC=no
10151af9a7ee5SmrgBUILDPDFDOC=no
10152af9a7ee5SmrgBUILDPSDOC=no
10153af9a7ee5SmrgBUILDHTMLDOC=no
10154caade7ccSmrg
10155af9a7ee5SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
10156af9a7ee5SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
10157af9a7ee5SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
10158af9a7ee5SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
10159caade7ccSmrg
10160af9a7ee5SmrgAC_MSG_CHECKING([whether to build text documentation])
10161af9a7ee5Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
10162af9a7ee5Smrg   test x$BUILD_TXTDOC != xno; then
10163af9a7ee5Smrg	BUILDTXTDOC=yes
10164af9a7ee5Smrgfi
10165af9a7ee5SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
10166af9a7ee5SmrgAC_MSG_RESULT([$BUILDTXTDOC])
10167caade7ccSmrg
10168af9a7ee5SmrgAC_MSG_CHECKING([whether to build PDF documentation])
10169af9a7ee5Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
10170af9a7ee5Smrg   test x$BUILD_PDFDOC != xno; then
10171af9a7ee5Smrg	BUILDPDFDOC=yes
10172af9a7ee5Smrgfi
10173af9a7ee5SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10174af9a7ee5SmrgAC_MSG_RESULT([$BUILDPDFDOC])
10175caade7ccSmrg
10176af9a7ee5SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
10177af9a7ee5Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
10178af9a7ee5Smrg   test x$BUILD_PSDOC != xno; then
10179af9a7ee5Smrg	BUILDPSDOC=yes
10180af9a7ee5Smrgfi
10181af9a7ee5SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
10182af9a7ee5SmrgAC_MSG_RESULT([$BUILDPSDOC])
10183caade7ccSmrg
10184af9a7ee5SmrgAC_MSG_CHECKING([whether to build HTML documentation])
10185af9a7ee5Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
10186af9a7ee5Smrg   test x$BUILD_HTMLDOC != xno; then
10187af9a7ee5Smrg	BUILDHTMLDOC=yes
10188af9a7ee5Smrgfi
10189af9a7ee5SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
10190af9a7ee5SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
10191caade7ccSmrg
10192af9a7ee5SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
10193af9a7ee5SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
10194af9a7ee5SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
10195af9a7ee5SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
10196caade7ccSmrg
10197af9a7ee5SmrgAC_SUBST(MAKE_TEXT)
10198af9a7ee5SmrgAC_SUBST(MAKE_PS)
10199af9a7ee5SmrgAC_SUBST(MAKE_PDF)
10200af9a7ee5SmrgAC_SUBST(MAKE_HTML)
10201af9a7ee5Smrg]) # XORG_CHECK_DOCBOOK
10202caade7ccSmrg
10203af9a7ee5Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
10204af9a7ee5Smrg# ----------------
10205af9a7ee5Smrg# Minimum version: 1.5.0
10206af9a7ee5Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10207af9a7ee5Smrg#
10208af9a7ee5Smrg# Documentation tools are not always available on all platforms and sometimes
10209af9a7ee5Smrg# not at the appropriate level. This macro enables a module to test for the
10210af9a7ee5Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
10211af9a7ee5Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
10212af9a7ee5Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
10213af9a7ee5Smrg# --with-xmlto assumes 'auto'.
10214af9a7ee5Smrg#
10215af9a7ee5Smrg# Interface to module:
10216af9a7ee5Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
10217af9a7ee5Smrg# XMLTO:	returns the path of the xmlto program found
10218af9a7ee5Smrg#		returns the path set by the user in the environment
10219af9a7ee5Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
10220af9a7ee5Smrg#		'no' user instructs the module not to use xmlto
10221af9a7ee5Smrg#
10222af9a7ee5Smrg# Added in version 1.10.0
10223af9a7ee5Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
10224af9a7ee5Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
10225af9a7ee5Smrg#
10226af9a7ee5Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
10227af9a7ee5Smrg#
10228af9a7ee5SmrgAC_DEFUN([XORG_WITH_XMLTO],[
10229af9a7ee5SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
10230af9a7ee5Smrgm4_define([_defopt], m4_default([$2], [auto]))
10231af9a7ee5SmrgAC_ARG_WITH(xmlto,
10232af9a7ee5Smrg	AS_HELP_STRING([--with-xmlto],
10233af9a7ee5Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
10234af9a7ee5Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
10235af9a7ee5Smrgm4_undefine([_defopt])
10236af9a7ee5Smrg
10237af9a7ee5Smrgif test "x$use_xmlto" = x"auto"; then
10238af9a7ee5Smrg   AC_PATH_PROG([XMLTO], [xmlto])
10239af9a7ee5Smrg   if test "x$XMLTO" = "x"; then
10240af9a7ee5Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
10241af9a7ee5Smrg	have_xmlto=no
10242af9a7ee5Smrg   else
10243af9a7ee5Smrg        have_xmlto=yes
10244af9a7ee5Smrg   fi
10245af9a7ee5Smrgelif test "x$use_xmlto" = x"yes" ; then
10246af9a7ee5Smrg   AC_PATH_PROG([XMLTO], [xmlto])
10247af9a7ee5Smrg   if test "x$XMLTO" = "x"; then
10248af9a7ee5Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
10249af9a7ee5Smrg   fi
10250af9a7ee5Smrg   have_xmlto=yes
10251af9a7ee5Smrgelif test "x$use_xmlto" = x"no" ; then
10252af9a7ee5Smrg   if test "x$XMLTO" != "x"; then
10253af9a7ee5Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
10254af9a7ee5Smrg   fi
10255af9a7ee5Smrg   have_xmlto=no
10256af9a7ee5Smrgelse
10257af9a7ee5Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
10258af9a7ee5Smrgfi
10259caade7ccSmrg
10260af9a7ee5Smrg# Test for a minimum version of xmlto, if provided.
10261af9a7ee5Smrgm4_ifval([$1],
10262af9a7ee5Smrg[if test "$have_xmlto" = yes; then
10263af9a7ee5Smrg    # scrape the xmlto version
10264af9a7ee5Smrg    AC_MSG_CHECKING([the xmlto version])
10265af9a7ee5Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
10266af9a7ee5Smrg    AC_MSG_RESULT([$xmlto_version])
10267af9a7ee5Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
10268af9a7ee5Smrg        [if test "x$use_xmlto" = xauto; then
10269af9a7ee5Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
10270af9a7ee5Smrg            have_xmlto=no
10271af9a7ee5Smrg        else
10272af9a7ee5Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
10273af9a7ee5Smrg        fi])
10274af9a7ee5Smrgfi])
10275caade7ccSmrg
10276af9a7ee5Smrg# Test for the ability of xmlto to generate a text target
10277af9a7ee5Smrghave_xmlto_text=no
10278af9a7ee5Smrgcat > conftest.xml << "EOF"
10279af9a7ee5SmrgEOF
10280af9a7ee5SmrgAS_IF([test "$have_xmlto" = yes],
10281af9a7ee5Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
10282af9a7ee5Smrg             [have_xmlto_text=yes],
10283af9a7ee5Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
10284af9a7ee5Smrgrm -f conftest.xml
10285af9a7ee5SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
10286af9a7ee5SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
10287af9a7ee5Smrg]) # XORG_WITH_XMLTO
10288caade7ccSmrg
10289af9a7ee5Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
10290af9a7ee5Smrg# --------------------------------------------
10291af9a7ee5Smrg# Minimum version: 1.12.0
10292af9a7ee5Smrg# Minimum version for optional DEFAULT argument: 1.12.0
10293af9a7ee5Smrg#
10294af9a7ee5Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
10295af9a7ee5Smrg# XML-based language used for the transformation of XML documents.
10296af9a7ee5Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
10297af9a7ee5Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
10298af9a7ee5Smrg# The XSLT processor is often used as a standalone tool for transformations.
10299af9a7ee5Smrg# It should not be assumed that this tool is used only to work with documnetation.
10300af9a7ee5Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
10301af9a7ee5Smrg#
10302af9a7ee5Smrg# Interface to module:
10303af9a7ee5Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
10304af9a7ee5Smrg# XSLTPROC:	 returns the path of the xsltproc program found
10305af9a7ee5Smrg#		 returns the path set by the user in the environment
10306af9a7ee5Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
10307af9a7ee5Smrg#		  'no' user instructs the module not to use xsltproc
10308af9a7ee5Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
10309af9a7ee5Smrg#
10310af9a7ee5Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
10311af9a7ee5Smrg#
10312af9a7ee5SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
10313af9a7ee5SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
10314af9a7ee5Smrg# Preserves the interface, should it be implemented later
10315af9a7ee5Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
10316af9a7ee5Smrgm4_define([_defopt], m4_default([$2], [auto]))
10317af9a7ee5SmrgAC_ARG_WITH(xsltproc,
10318af9a7ee5Smrg	AS_HELP_STRING([--with-xsltproc],
10319af9a7ee5Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
10320af9a7ee5Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
10321af9a7ee5Smrgm4_undefine([_defopt])
10322caade7ccSmrg
10323af9a7ee5Smrgif test "x$use_xsltproc" = x"auto"; then
10324af9a7ee5Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
10325af9a7ee5Smrg   if test "x$XSLTPROC" = "x"; then
10326af9a7ee5Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
10327af9a7ee5Smrg	have_xsltproc=no
10328af9a7ee5Smrg   else
10329af9a7ee5Smrg        have_xsltproc=yes
10330af9a7ee5Smrg   fi
10331af9a7ee5Smrgelif test "x$use_xsltproc" = x"yes" ; then
10332af9a7ee5Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
10333af9a7ee5Smrg   if test "x$XSLTPROC" = "x"; then
10334af9a7ee5Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
10335af9a7ee5Smrg   fi
10336af9a7ee5Smrg   have_xsltproc=yes
10337af9a7ee5Smrgelif test "x$use_xsltproc" = x"no" ; then
10338af9a7ee5Smrg   if test "x$XSLTPROC" != "x"; then
10339af9a7ee5Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
10340af9a7ee5Smrg   fi
10341af9a7ee5Smrg   have_xsltproc=no
10342af9a7ee5Smrgelse
10343af9a7ee5Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
10344af9a7ee5Smrgfi
10345caade7ccSmrg
10346af9a7ee5SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
10347af9a7ee5Smrg]) # XORG_WITH_XSLTPROC
10348caade7ccSmrg
10349af9a7ee5Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
10350af9a7ee5Smrg# ----------------------------------------
10351af9a7ee5Smrg# Minimum version: 1.15.0
10352af9a7ee5Smrg#
10353af9a7ee5Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
10354af9a7ee5Smrg# scanning arbitrary text files, extracting information from those text files,
10355af9a7ee5Smrg# and printing reports based on that information.
10356af9a7ee5Smrg#
10357af9a7ee5Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
10358af9a7ee5Smrg#
10359af9a7ee5Smrg# Interface to module:
10360af9a7ee5Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
10361af9a7ee5Smrg# PERL:	     returns the path of the perl program found
10362af9a7ee5Smrg#	     returns the path set by the user in the environment
10363af9a7ee5Smrg# --with-perl: 'yes' user instructs the module to use perl
10364af9a7ee5Smrg#	       'no' user instructs the module not to use perl
10365af9a7ee5Smrg# have_perl: returns yes if perl found in PATH or no
10366af9a7ee5Smrg#
10367af9a7ee5Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
10368af9a7ee5Smrg#
10369af9a7ee5SmrgAC_DEFUN([XORG_WITH_PERL],[
10370af9a7ee5SmrgAC_ARG_VAR([PERL], [Path to perl command])
10371af9a7ee5Smrg# Preserves the interface, should it be implemented later
10372af9a7ee5Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
10373af9a7ee5Smrgm4_define([_defopt], m4_default([$2], [auto]))
10374af9a7ee5SmrgAC_ARG_WITH(perl,
10375af9a7ee5Smrg	AS_HELP_STRING([--with-perl],
10376af9a7ee5Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
10377af9a7ee5Smrg	   [use_perl=$withval], [use_perl=]_defopt)
10378af9a7ee5Smrgm4_undefine([_defopt])
10379caade7ccSmrg
10380af9a7ee5Smrgif test "x$use_perl" = x"auto"; then
10381af9a7ee5Smrg   AC_PATH_PROG([PERL], [perl])
10382af9a7ee5Smrg   if test "x$PERL" = "x"; then
10383af9a7ee5Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
10384af9a7ee5Smrg	have_perl=no
10385af9a7ee5Smrg   else
10386af9a7ee5Smrg        have_perl=yes
10387af9a7ee5Smrg   fi
10388af9a7ee5Smrgelif test "x$use_perl" = x"yes" ; then
10389af9a7ee5Smrg   AC_PATH_PROG([PERL], [perl])
10390af9a7ee5Smrg   if test "x$PERL" = "x"; then
10391af9a7ee5Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
10392af9a7ee5Smrg   fi
10393af9a7ee5Smrg   have_perl=yes
10394af9a7ee5Smrgelif test "x$use_perl" = x"no" ; then
10395af9a7ee5Smrg   if test "x$PERL" != "x"; then
10396af9a7ee5Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
10397af9a7ee5Smrg   fi
10398af9a7ee5Smrg   have_perl=no
10399af9a7ee5Smrgelse
10400af9a7ee5Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
10401af9a7ee5Smrgfi
10402b9b4fd27Smrg
10403af9a7ee5SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
10404af9a7ee5Smrg]) # XORG_WITH_PERL
10405caade7ccSmrg
10406af9a7ee5Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
10407af9a7ee5Smrg# ----------------
10408af9a7ee5Smrg# Minimum version: 1.5.0
10409af9a7ee5Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10410af9a7ee5Smrg#
10411af9a7ee5Smrg# Documentation tools are not always available on all platforms and sometimes
10412af9a7ee5Smrg# not at the appropriate level. This macro enables a module to test for the
10413af9a7ee5Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
10414af9a7ee5Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
10415af9a7ee5Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
10416af9a7ee5Smrg# --with-asciidoc assumes 'auto'.
10417af9a7ee5Smrg#
10418af9a7ee5Smrg# Interface to module:
10419af9a7ee5Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
10420af9a7ee5Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
10421af9a7ee5Smrg#		 returns the path set by the user in the environment
10422af9a7ee5Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
10423af9a7ee5Smrg#		  'no' user instructs the module not to use asciidoc
10424af9a7ee5Smrg#
10425af9a7ee5Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
10426af9a7ee5Smrg#
10427af9a7ee5SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
10428af9a7ee5SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
10429af9a7ee5Smrgm4_define([_defopt], m4_default([$2], [auto]))
10430af9a7ee5SmrgAC_ARG_WITH(asciidoc,
10431af9a7ee5Smrg	AS_HELP_STRING([--with-asciidoc],
10432af9a7ee5Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
10433af9a7ee5Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
10434af9a7ee5Smrgm4_undefine([_defopt])
10435caade7ccSmrg
10436af9a7ee5Smrgif test "x$use_asciidoc" = x"auto"; then
10437af9a7ee5Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10438af9a7ee5Smrg   if test "x$ASCIIDOC" = "x"; then
10439af9a7ee5Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
10440af9a7ee5Smrg	have_asciidoc=no
10441af9a7ee5Smrg   else
10442af9a7ee5Smrg        have_asciidoc=yes
10443af9a7ee5Smrg   fi
10444af9a7ee5Smrgelif test "x$use_asciidoc" = x"yes" ; then
10445af9a7ee5Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
10446af9a7ee5Smrg   if test "x$ASCIIDOC" = "x"; then
10447af9a7ee5Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
10448af9a7ee5Smrg   fi
10449af9a7ee5Smrg   have_asciidoc=yes
10450af9a7ee5Smrgelif test "x$use_asciidoc" = x"no" ; then
10451af9a7ee5Smrg   if test "x$ASCIIDOC" != "x"; then
10452af9a7ee5Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
10453af9a7ee5Smrg   fi
10454af9a7ee5Smrg   have_asciidoc=no
10455af9a7ee5Smrgelse
10456af9a7ee5Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
10457af9a7ee5Smrgfi
10458af9a7ee5Smrgm4_ifval([$1],
10459af9a7ee5Smrg[if test "$have_asciidoc" = yes; then
10460af9a7ee5Smrg    # scrape the asciidoc version
10461af9a7ee5Smrg    AC_MSG_CHECKING([the asciidoc version])
10462af9a7ee5Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
10463af9a7ee5Smrg    AC_MSG_RESULT([$asciidoc_version])
10464af9a7ee5Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
10465af9a7ee5Smrg        [if test "x$use_asciidoc" = xauto; then
10466af9a7ee5Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
10467af9a7ee5Smrg            have_asciidoc=no
10468af9a7ee5Smrg        else
10469af9a7ee5Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
10470af9a7ee5Smrg        fi])
10471af9a7ee5Smrgfi])
10472af9a7ee5SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
10473af9a7ee5Smrg]) # XORG_WITH_ASCIIDOC
10474caade7ccSmrg
10475af9a7ee5Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
10476e5383a99Smrg# -------------------------------------------
10477af9a7ee5Smrg# Minimum version: 1.5.0
10478af9a7ee5Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10479e5383a99Smrg# Minimum version for optional DOT checking: 1.18.0
10480af9a7ee5Smrg#
10481af9a7ee5Smrg# Documentation tools are not always available on all platforms and sometimes
10482af9a7ee5Smrg# not at the appropriate level. This macro enables a module to test for the
10483af9a7ee5Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
10484af9a7ee5Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
10485af9a7ee5Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
10486af9a7ee5Smrg# --with-doxygen assumes 'auto'.
10487af9a7ee5Smrg#
10488af9a7ee5Smrg# Interface to module:
10489af9a7ee5Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
10490af9a7ee5Smrg# DOXYGEN:	 returns the path of the doxygen program found
10491af9a7ee5Smrg#		 returns the path set by the user in the environment
10492af9a7ee5Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
10493af9a7ee5Smrg#		  'no' user instructs the module not to use doxygen
10494af9a7ee5Smrg#
10495af9a7ee5Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
10496af9a7ee5Smrg#
10497af9a7ee5SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
10498af9a7ee5SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
10499e5383a99SmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
10500af9a7ee5Smrgm4_define([_defopt], m4_default([$2], [auto]))
10501af9a7ee5SmrgAC_ARG_WITH(doxygen,
10502af9a7ee5Smrg	AS_HELP_STRING([--with-doxygen],
10503af9a7ee5Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
10504af9a7ee5Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
10505af9a7ee5Smrgm4_undefine([_defopt])
10506caade7ccSmrg
10507af9a7ee5Smrgif test "x$use_doxygen" = x"auto"; then
10508af9a7ee5Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
10509af9a7ee5Smrg   if test "x$DOXYGEN" = "x"; then
10510af9a7ee5Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
10511af9a7ee5Smrg	have_doxygen=no
10512af9a7ee5Smrg   else
10513af9a7ee5Smrg        have_doxygen=yes
10514af9a7ee5Smrg   fi
10515af9a7ee5Smrgelif test "x$use_doxygen" = x"yes" ; then
10516af9a7ee5Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
10517af9a7ee5Smrg   if test "x$DOXYGEN" = "x"; then
10518af9a7ee5Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
10519af9a7ee5Smrg   fi
10520af9a7ee5Smrg   have_doxygen=yes
10521af9a7ee5Smrgelif test "x$use_doxygen" = x"no" ; then
10522af9a7ee5Smrg   if test "x$DOXYGEN" != "x"; then
10523af9a7ee5Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
10524af9a7ee5Smrg   fi
10525af9a7ee5Smrg   have_doxygen=no
10526af9a7ee5Smrgelse
10527af9a7ee5Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
10528af9a7ee5Smrgfi
10529af9a7ee5Smrgm4_ifval([$1],
10530af9a7ee5Smrg[if test "$have_doxygen" = yes; then
10531af9a7ee5Smrg    # scrape the doxygen version
10532af9a7ee5Smrg    AC_MSG_CHECKING([the doxygen version])
10533af9a7ee5Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
10534af9a7ee5Smrg    AC_MSG_RESULT([$doxygen_version])
10535af9a7ee5Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
10536af9a7ee5Smrg        [if test "x$use_doxygen" = xauto; then
10537af9a7ee5Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
10538af9a7ee5Smrg            have_doxygen=no
10539af9a7ee5Smrg        else
10540af9a7ee5Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
10541af9a7ee5Smrg        fi])
10542af9a7ee5Smrgfi])
10543e5383a99Smrg
10544e5383a99Smrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
10545e5383a99Smrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
10546e5383a99Smrgdnl 	HAVE_DOT = @HAVE_DOT@
10547e5383a99SmrgHAVE_DOT=no
10548e5383a99Smrgif test "x$have_doxygen" = "xyes"; then
10549e5383a99Smrg  AC_PATH_PROG([DOT], [dot])
10550e5383a99Smrg    if test "x$DOT" != "x"; then
10551e5383a99Smrg      HAVE_DOT=yes
10552e5383a99Smrg    fi
10553e5383a99Smrgfi
10554e5383a99Smrg
10555e5383a99SmrgAC_SUBST([HAVE_DOT])
10556e5383a99SmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
10557af9a7ee5SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
10558af9a7ee5Smrg]) # XORG_WITH_DOXYGEN
10559caade7ccSmrg
10560af9a7ee5Smrg# XORG_WITH_GROFF([DEFAULT])
10561af9a7ee5Smrg# ----------------
10562af9a7ee5Smrg# Minimum version: 1.6.0
10563af9a7ee5Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10564af9a7ee5Smrg#
10565af9a7ee5Smrg# Documentation tools are not always available on all platforms and sometimes
10566af9a7ee5Smrg# not at the appropriate level. This macro enables a module to test for the
10567af9a7ee5Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
10568af9a7ee5Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
10569af9a7ee5Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
10570af9a7ee5Smrg# --with-groff assumes 'auto'.
10571af9a7ee5Smrg#
10572af9a7ee5Smrg# Interface to module:
10573af9a7ee5Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
10574af9a7ee5Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
10575af9a7ee5Smrg# HAVE_GROFF_MS: the -ms macros package
10576af9a7ee5Smrg# GROFF:	 returns the path of the groff program found
10577af9a7ee5Smrg#		 returns the path set by the user in the environment
10578af9a7ee5Smrg# --with-groff:	 'yes' user instructs the module to use groff
10579af9a7ee5Smrg#		 'no' user instructs the module not to use groff
10580af9a7ee5Smrg#
10581af9a7ee5Smrg# Added in version 1.9.0:
10582af9a7ee5Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
10583af9a7ee5Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
10584af9a7ee5Smrg#		   psselect from the psutils package.
10585af9a7ee5Smrg#		   the ghostcript package. Refer to the grohtml man pages
10586af9a7ee5Smrg#
10587af9a7ee5Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
10588af9a7ee5Smrg#
10589af9a7ee5Smrg# OS and distros often splits groff in a basic and full package, the former
10590af9a7ee5Smrg# having the groff program and the later having devices, fonts and macros
10591af9a7ee5Smrg# Checking for the groff executable is not enough.
10592af9a7ee5Smrg#
10593af9a7ee5Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
10594af9a7ee5Smrg# unset HAVE_GROFF or GROFF env variables.
10595af9a7ee5Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
10596af9a7ee5Smrg#
10597af9a7ee5SmrgAC_DEFUN([XORG_WITH_GROFF],[
10598af9a7ee5SmrgAC_ARG_VAR([GROFF], [Path to groff command])
10599af9a7ee5Smrgm4_define([_defopt], m4_default([$1], [auto]))
10600af9a7ee5SmrgAC_ARG_WITH(groff,
10601af9a7ee5Smrg	AS_HELP_STRING([--with-groff],
10602af9a7ee5Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
10603af9a7ee5Smrg	   [use_groff=$withval], [use_groff=]_defopt)
10604af9a7ee5Smrgm4_undefine([_defopt])
10605caade7ccSmrg
10606af9a7ee5Smrgif test "x$use_groff" = x"auto"; then
10607af9a7ee5Smrg   AC_PATH_PROG([GROFF], [groff])
10608af9a7ee5Smrg   if test "x$GROFF" = "x"; then
10609af9a7ee5Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
10610af9a7ee5Smrg	have_groff=no
10611af9a7ee5Smrg   else
10612af9a7ee5Smrg        have_groff=yes
10613af9a7ee5Smrg   fi
10614af9a7ee5Smrgelif test "x$use_groff" = x"yes" ; then
10615af9a7ee5Smrg   AC_PATH_PROG([GROFF], [groff])
10616af9a7ee5Smrg   if test "x$GROFF" = "x"; then
10617af9a7ee5Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
10618af9a7ee5Smrg   fi
10619af9a7ee5Smrg   have_groff=yes
10620af9a7ee5Smrgelif test "x$use_groff" = x"no" ; then
10621af9a7ee5Smrg   if test "x$GROFF" != "x"; then
10622af9a7ee5Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
10623af9a7ee5Smrg   fi
10624af9a7ee5Smrg   have_groff=no
10625af9a7ee5Smrgelse
10626af9a7ee5Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
10627af9a7ee5Smrgfi
10628caade7ccSmrg
10629af9a7ee5Smrg# We have groff, test for the presence of the macro packages
10630af9a7ee5Smrgif test "x$have_groff" = x"yes"; then
10631af9a7ee5Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
10632af9a7ee5Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
10633af9a7ee5Smrg        groff_ms_works=yes
10634af9a7ee5Smrg    else
10635af9a7ee5Smrg        groff_ms_works=no
10636af9a7ee5Smrg    fi
10637af9a7ee5Smrg    AC_MSG_RESULT([$groff_ms_works])
10638af9a7ee5Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
10639af9a7ee5Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
10640af9a7ee5Smrg        groff_mm_works=yes
10641af9a7ee5Smrg    else
10642af9a7ee5Smrg        groff_mm_works=no
10643af9a7ee5Smrg    fi
10644af9a7ee5Smrg    AC_MSG_RESULT([$groff_mm_works])
10645af9a7ee5Smrgfi
10646caade7ccSmrg
10647af9a7ee5Smrg# We have groff, test for HTML dependencies, one command per package
10648af9a7ee5Smrgif test "x$have_groff" = x"yes"; then
10649af9a7ee5Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
10650af9a7ee5Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
10651af9a7ee5Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
10652af9a7ee5Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
10653af9a7ee5Smrg      have_groff_html=yes
10654af9a7ee5Smrg   else
10655af9a7ee5Smrg      have_groff_html=no
10656af9a7ee5Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
10657af9a7ee5Smrg   fi
10658af9a7ee5Smrgfi
10659b9b4fd27Smrg
10660af9a7ee5Smrg# Set Automake conditionals for Makefiles
10661af9a7ee5SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
10662af9a7ee5SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
10663af9a7ee5SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
10664af9a7ee5SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
10665af9a7ee5Smrg]) # XORG_WITH_GROFF
10666caade7ccSmrg
10667af9a7ee5Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
10668af9a7ee5Smrg# ---------------------------------------
10669af9a7ee5Smrg# Minimum version: 1.6.0
10670af9a7ee5Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10671af9a7ee5Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
10672af9a7ee5Smrg#
10673af9a7ee5Smrg# Documentation tools are not always available on all platforms and sometimes
10674af9a7ee5Smrg# not at the appropriate level. This macro enables a module to test for the
10675af9a7ee5Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
10676af9a7ee5Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
10677af9a7ee5Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
10678af9a7ee5Smrg# --with-fop assumes 'auto'.
10679af9a7ee5Smrg#
10680af9a7ee5Smrg# Interface to module:
10681af9a7ee5Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
10682af9a7ee5Smrg# FOP:	 	returns the path of the fop program found
10683af9a7ee5Smrg#		returns the path set by the user in the environment
10684af9a7ee5Smrg# --with-fop: 	'yes' user instructs the module to use fop
10685af9a7ee5Smrg#		'no' user instructs the module not to use fop
10686af9a7ee5Smrg#
10687af9a7ee5Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
10688af9a7ee5Smrg#
10689af9a7ee5SmrgAC_DEFUN([XORG_WITH_FOP],[
10690af9a7ee5SmrgAC_ARG_VAR([FOP], [Path to fop command])
10691af9a7ee5Smrgm4_define([_defopt], m4_default([$2], [auto]))
10692af9a7ee5SmrgAC_ARG_WITH(fop,
10693af9a7ee5Smrg	AS_HELP_STRING([--with-fop],
10694af9a7ee5Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
10695af9a7ee5Smrg	   [use_fop=$withval], [use_fop=]_defopt)
10696af9a7ee5Smrgm4_undefine([_defopt])
10697caade7ccSmrg
10698af9a7ee5Smrgif test "x$use_fop" = x"auto"; then
10699af9a7ee5Smrg   AC_PATH_PROG([FOP], [fop])
10700af9a7ee5Smrg   if test "x$FOP" = "x"; then
10701af9a7ee5Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
10702af9a7ee5Smrg	have_fop=no
10703af9a7ee5Smrg   else
10704af9a7ee5Smrg        have_fop=yes
10705af9a7ee5Smrg   fi
10706af9a7ee5Smrgelif test "x$use_fop" = x"yes" ; then
10707af9a7ee5Smrg   AC_PATH_PROG([FOP], [fop])
10708af9a7ee5Smrg   if test "x$FOP" = "x"; then
10709af9a7ee5Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
10710af9a7ee5Smrg   fi
10711af9a7ee5Smrg   have_fop=yes
10712af9a7ee5Smrgelif test "x$use_fop" = x"no" ; then
10713af9a7ee5Smrg   if test "x$FOP" != "x"; then
10714af9a7ee5Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
10715af9a7ee5Smrg   fi
10716af9a7ee5Smrg   have_fop=no
10717af9a7ee5Smrgelse
10718af9a7ee5Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
10719af9a7ee5Smrgfi
10720caade7ccSmrg
10721af9a7ee5Smrg# Test for a minimum version of fop, if provided.
10722af9a7ee5Smrgm4_ifval([$1],
10723af9a7ee5Smrg[if test "$have_fop" = yes; then
10724af9a7ee5Smrg    # scrape the fop version
10725af9a7ee5Smrg    AC_MSG_CHECKING([for fop minimum version])
10726af9a7ee5Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
10727af9a7ee5Smrg    AC_MSG_RESULT([$fop_version])
10728af9a7ee5Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
10729af9a7ee5Smrg        [if test "x$use_fop" = xauto; then
10730af9a7ee5Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
10731af9a7ee5Smrg            have_fop=no
10732af9a7ee5Smrg        else
10733af9a7ee5Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
10734af9a7ee5Smrg        fi])
10735af9a7ee5Smrgfi])
10736af9a7ee5SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
10737af9a7ee5Smrg]) # XORG_WITH_FOP
10738caade7ccSmrg
10739e5383a99Smrg# XORG_WITH_M4([MIN-VERSION])
10740e5383a99Smrg# ---------------------------
10741e5383a99Smrg# Minimum version: 1.19.0
10742e5383a99Smrg#
10743e5383a99Smrg# This macro attempts to locate an m4 macro processor which supports
10744e5383a99Smrg# -I option and is only useful for modules relying on M4 in order to
10745e5383a99Smrg# expand macros in source code files.
10746e5383a99Smrg#
10747e5383a99Smrg# Interface to module:
10748e5383a99Smrg# M4:	 	returns the path of the m4 program found
10749e5383a99Smrg#		returns the path set by the user in the environment
10750e5383a99Smrg#
10751e5383a99SmrgAC_DEFUN([XORG_WITH_M4], [
10752e5383a99SmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
10753e5383a99Smrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
10754e5383a99Smrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
10755e5383a99Smrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
10756e5383a99Smrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
10757e5383a99Smrg   [$PATH:/usr/gnu/bin])])
10758e5383a99Smrg
10759e5383a99SmrgAC_SUBST([M4], [$ac_cv_path_M4])
10760e5383a99Smrg]) # XORG_WITH_M4
10761e5383a99Smrg
10762af9a7ee5Smrg# XORG_WITH_PS2PDF([DEFAULT])
10763af9a7ee5Smrg# ----------------
10764af9a7ee5Smrg# Minimum version: 1.6.0
10765af9a7ee5Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10766af9a7ee5Smrg#
10767af9a7ee5Smrg# Documentation tools are not always available on all platforms and sometimes
10768af9a7ee5Smrg# not at the appropriate level. This macro enables a module to test for the
10769af9a7ee5Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
10770af9a7ee5Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
10771af9a7ee5Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
10772af9a7ee5Smrg# --with-ps2pdf assumes 'auto'.
10773af9a7ee5Smrg#
10774af9a7ee5Smrg# Interface to module:
10775af9a7ee5Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
10776af9a7ee5Smrg# PS2PDF:	returns the path of the ps2pdf program found
10777af9a7ee5Smrg#		returns the path set by the user in the environment
10778af9a7ee5Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
10779af9a7ee5Smrg#		 'no' user instructs the module not to use ps2pdf
10780af9a7ee5Smrg#
10781af9a7ee5Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
10782af9a7ee5Smrg#
10783af9a7ee5SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
10784af9a7ee5SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
10785af9a7ee5Smrgm4_define([_defopt], m4_default([$1], [auto]))
10786af9a7ee5SmrgAC_ARG_WITH(ps2pdf,
10787af9a7ee5Smrg	AS_HELP_STRING([--with-ps2pdf],
10788af9a7ee5Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
10789af9a7ee5Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
10790af9a7ee5Smrgm4_undefine([_defopt])
10791caade7ccSmrg
10792af9a7ee5Smrgif test "x$use_ps2pdf" = x"auto"; then
10793af9a7ee5Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
10794af9a7ee5Smrg   if test "x$PS2PDF" = "x"; then
10795af9a7ee5Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
10796af9a7ee5Smrg	have_ps2pdf=no
10797af9a7ee5Smrg   else
10798af9a7ee5Smrg        have_ps2pdf=yes
10799af9a7ee5Smrg   fi
10800af9a7ee5Smrgelif test "x$use_ps2pdf" = x"yes" ; then
10801af9a7ee5Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
10802af9a7ee5Smrg   if test "x$PS2PDF" = "x"; then
10803af9a7ee5Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
10804af9a7ee5Smrg   fi
10805af9a7ee5Smrg   have_ps2pdf=yes
10806af9a7ee5Smrgelif test "x$use_ps2pdf" = x"no" ; then
10807af9a7ee5Smrg   if test "x$PS2PDF" != "x"; then
10808af9a7ee5Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
10809af9a7ee5Smrg   fi
10810af9a7ee5Smrg   have_ps2pdf=no
10811af9a7ee5Smrgelse
10812af9a7ee5Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
10813af9a7ee5Smrgfi
10814af9a7ee5SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
10815af9a7ee5Smrg]) # XORG_WITH_PS2PDF
10816caade7ccSmrg
10817af9a7ee5Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
10818af9a7ee5Smrg# ----------------
10819af9a7ee5Smrg# Minimum version: 1.6.0
10820af9a7ee5Smrg#
10821af9a7ee5Smrg# Documentation tools are not always available on all platforms and sometimes
10822af9a7ee5Smrg# not at the appropriate level. This macro enables a builder to skip all
10823af9a7ee5Smrg# documentation targets except traditional man pages.
10824af9a7ee5Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10825af9a7ee5Smrg# maximum flexibilty in controlling documentation building.
10826af9a7ee5Smrg# Refer to:
10827af9a7ee5Smrg# XORG_WITH_XMLTO         --with-xmlto
10828af9a7ee5Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10829af9a7ee5Smrg# XORG_WITH_DOXYGEN       --with-doxygen
10830af9a7ee5Smrg# XORG_WITH_FOP           --with-fop
10831af9a7ee5Smrg# XORG_WITH_GROFF         --with-groff
10832af9a7ee5Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
10833af9a7ee5Smrg#
10834af9a7ee5Smrg# Interface to module:
10835af9a7ee5Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
10836af9a7ee5Smrg# --enable-docs: 'yes' user instructs the module to generate docs
10837af9a7ee5Smrg#		 'no' user instructs the module not to generate docs
10838af9a7ee5Smrg# parm1:	specify the default value, yes or no.
10839af9a7ee5Smrg#
10840af9a7ee5SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
10841af9a7ee5Smrgm4_define([docs_default], m4_default([$1], [yes]))
10842af9a7ee5SmrgAC_ARG_ENABLE(docs,
10843af9a7ee5Smrg	AS_HELP_STRING([--enable-docs],
10844af9a7ee5Smrg	   [Enable building the documentation (default: ]docs_default[)]),
10845af9a7ee5Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
10846af9a7ee5Smrgm4_undefine([docs_default])
10847af9a7ee5SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
10848af9a7ee5SmrgAC_MSG_CHECKING([whether to build documentation])
10849af9a7ee5SmrgAC_MSG_RESULT([$build_docs])
10850af9a7ee5Smrg]) # XORG_ENABLE_DOCS
10851caade7ccSmrg
10852af9a7ee5Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
10853af9a7ee5Smrg# ----------------
10854af9a7ee5Smrg# Minimum version: 1.6.0
10855af9a7ee5Smrg#
10856af9a7ee5Smrg# This macro enables a builder to skip all developer documentation.
10857af9a7ee5Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10858af9a7ee5Smrg# maximum flexibilty in controlling documentation building.
10859af9a7ee5Smrg# Refer to:
10860af9a7ee5Smrg# XORG_WITH_XMLTO         --with-xmlto
10861af9a7ee5Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10862af9a7ee5Smrg# XORG_WITH_DOXYGEN       --with-doxygen
10863af9a7ee5Smrg# XORG_WITH_FOP           --with-fop
10864af9a7ee5Smrg# XORG_WITH_GROFF         --with-groff
10865af9a7ee5Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
10866af9a7ee5Smrg#
10867af9a7ee5Smrg# Interface to module:
10868af9a7ee5Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
10869af9a7ee5Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
10870af9a7ee5Smrg#			'no' user instructs the module not to generate developer docs
10871af9a7ee5Smrg# parm1:		specify the default value, yes or no.
10872af9a7ee5Smrg#
10873af9a7ee5SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
10874af9a7ee5Smrgm4_define([devel_default], m4_default([$1], [yes]))
10875af9a7ee5SmrgAC_ARG_ENABLE(devel-docs,
10876af9a7ee5Smrg	AS_HELP_STRING([--enable-devel-docs],
10877af9a7ee5Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
10878af9a7ee5Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
10879af9a7ee5Smrgm4_undefine([devel_default])
10880af9a7ee5SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
10881af9a7ee5SmrgAC_MSG_CHECKING([whether to build developer documentation])
10882af9a7ee5SmrgAC_MSG_RESULT([$build_devel_docs])
10883af9a7ee5Smrg]) # XORG_ENABLE_DEVEL_DOCS
10884caade7ccSmrg
10885af9a7ee5Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
10886af9a7ee5Smrg# ----------------
10887af9a7ee5Smrg# Minimum version: 1.6.0
10888af9a7ee5Smrg#
10889af9a7ee5Smrg# This macro enables a builder to skip all functional specification targets.
10890af9a7ee5Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10891af9a7ee5Smrg# maximum flexibilty in controlling documentation building.
10892af9a7ee5Smrg# Refer to:
10893af9a7ee5Smrg# XORG_WITH_XMLTO         --with-xmlto
10894af9a7ee5Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10895af9a7ee5Smrg# XORG_WITH_DOXYGEN       --with-doxygen
10896af9a7ee5Smrg# XORG_WITH_FOP           --with-fop
10897af9a7ee5Smrg# XORG_WITH_GROFF         --with-groff
10898af9a7ee5Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
10899af9a7ee5Smrg#
10900af9a7ee5Smrg# Interface to module:
10901af9a7ee5Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
10902af9a7ee5Smrg# --enable-specs:	'yes' user instructs the module to generate specs
10903af9a7ee5Smrg#			'no' user instructs the module not to generate specs
10904af9a7ee5Smrg# parm1:		specify the default value, yes or no.
10905af9a7ee5Smrg#
10906af9a7ee5SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
10907af9a7ee5Smrgm4_define([spec_default], m4_default([$1], [yes]))
10908af9a7ee5SmrgAC_ARG_ENABLE(specs,
10909af9a7ee5Smrg	AS_HELP_STRING([--enable-specs],
10910af9a7ee5Smrg	   [Enable building the specs (default: ]spec_default[)]),
10911af9a7ee5Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
10912af9a7ee5Smrgm4_undefine([spec_default])
10913af9a7ee5SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
10914af9a7ee5SmrgAC_MSG_CHECKING([whether to build functional specifications])
10915af9a7ee5SmrgAC_MSG_RESULT([$build_specs])
10916af9a7ee5Smrg]) # XORG_ENABLE_SPECS
10917485f0483Smrg
10918af9a7ee5Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
10919af9a7ee5Smrg# ----------------------------------------------
10920af9a7ee5Smrg# Minimum version: 1.13.0
10921af9a7ee5Smrg#
10922af9a7ee5Smrg# This macro enables a builder to enable/disable unit testing
10923af9a7ee5Smrg# It makes no assumption about the test cases implementation
10924af9a7ee5Smrg# Test cases may or may not use Automake "Support for test suites"
10925af9a7ee5Smrg# They may or may not use the software utility library GLib
10926af9a7ee5Smrg#
10927af9a7ee5Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
10928af9a7ee5Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
10929af9a7ee5Smrg# The variable enable_unit_tests is used by other macros in this file.
10930af9a7ee5Smrg#
10931af9a7ee5Smrg# Interface to module:
10932af9a7ee5Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
10933af9a7ee5Smrg# enable_unit_tests:    used in configure.ac for additional configuration
10934af9a7ee5Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
10935af9a7ee5Smrg#			'no' user instructs the module not to build tests
10936af9a7ee5Smrg# parm1:		specify the default value, yes or no.
10937af9a7ee5Smrg#
10938af9a7ee5SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
10939af9a7ee5SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
10940af9a7ee5SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
10941af9a7ee5SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10942af9a7ee5Smrgm4_define([_defopt], m4_default([$1], [auto]))
10943af9a7ee5SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
10944af9a7ee5Smrg	[Enable building unit test cases (default: ]_defopt[)]),
10945af9a7ee5Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
10946af9a7ee5Smrgm4_undefine([_defopt])
10947af9a7ee5SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
10948af9a7ee5SmrgAC_MSG_CHECKING([whether to build unit test cases])
10949af9a7ee5SmrgAC_MSG_RESULT([$enable_unit_tests])
10950af9a7ee5Smrg]) # XORG_ENABLE_UNIT_TESTS
10951485f0483Smrg
10952af9a7ee5Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
10953af9a7ee5Smrg# ------------------------------------------------------
10954af9a7ee5Smrg# Minimum version: 1.17.0
10955af9a7ee5Smrg#
10956af9a7ee5Smrg# This macro enables a builder to enable/disable integration testing
10957af9a7ee5Smrg# It makes no assumption about the test cases' implementation
10958af9a7ee5Smrg# Test cases may or may not use Automake "Support for test suites"
10959af9a7ee5Smrg#
10960af9a7ee5Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
10961af9a7ee5Smrg# usually requires less dependencies and may be built and run under less
10962af9a7ee5Smrg# stringent environments than integration tests.
10963af9a7ee5Smrg#
10964af9a7ee5Smrg# Interface to module:
10965af9a7ee5Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
10966af9a7ee5Smrg# enable_integration_tests:   used in configure.ac for additional configuration
10967af9a7ee5Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
10968af9a7ee5Smrg#                             'no' user instructs the module not to build tests
10969af9a7ee5Smrg# parm1:                      specify the default value, yes or no.
10970af9a7ee5Smrg#
10971af9a7ee5SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
10972af9a7ee5SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10973af9a7ee5Smrgm4_define([_defopt], m4_default([$1], [auto]))
10974af9a7ee5SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
10975af9a7ee5Smrg	[Enable building integration test cases (default: ]_defopt[)]),
10976af9a7ee5Smrg	[enable_integration_tests=$enableval],
10977af9a7ee5Smrg	[enable_integration_tests=]_defopt)
10978af9a7ee5Smrgm4_undefine([_defopt])
10979af9a7ee5SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
10980af9a7ee5Smrg	[test "x$enable_integration_tests" != xno])
10981af9a7ee5SmrgAC_MSG_CHECKING([whether to build unit test cases])
10982af9a7ee5SmrgAC_MSG_RESULT([$enable_integration_tests])
10983af9a7ee5Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
10984485f0483Smrg
10985af9a7ee5Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
10986af9a7ee5Smrg# ----------------------------------------
10987af9a7ee5Smrg# Minimum version: 1.13.0
10988af9a7ee5Smrg#
10989af9a7ee5Smrg# GLib is a library which provides advanced data structures and functions.
10990af9a7ee5Smrg# This macro enables a module to test for the presence of Glib.
10991af9a7ee5Smrg#
10992af9a7ee5Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
10993af9a7ee5Smrg# Otherwise the value of $enable_unit_tests is blank.
10994af9a7ee5Smrg#
10995af9a7ee5Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
10996af9a7ee5Smrg# test support usually requires less dependencies and may be built and run under
10997af9a7ee5Smrg# less stringent environments than integration tests.
10998af9a7ee5Smrg#
10999af9a7ee5Smrg# Interface to module:
11000af9a7ee5Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
11001af9a7ee5Smrg# with_glib: used in configure.ac to know if GLib has been found
11002af9a7ee5Smrg# --with-glib:	'yes' user instructs the module to use glib
11003af9a7ee5Smrg#		'no' user instructs the module not to use glib
11004af9a7ee5Smrg#
11005af9a7ee5SmrgAC_DEFUN([XORG_WITH_GLIB],[
11006af9a7ee5SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
11007af9a7ee5Smrgm4_define([_defopt], m4_default([$2], [auto]))
11008af9a7ee5SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
11009af9a7ee5Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
11010af9a7ee5Smrg	[with_glib=$withval], [with_glib=]_defopt)
11011af9a7ee5Smrgm4_undefine([_defopt])
11012485f0483Smrg
11013af9a7ee5Smrghave_glib=no
11014af9a7ee5Smrg# Do not probe GLib if user explicitly disabled unit testing
11015af9a7ee5Smrgif test "x$enable_unit_tests" != x"no"; then
11016af9a7ee5Smrg  # Do not probe GLib if user explicitly disabled it
11017af9a7ee5Smrg  if test "x$with_glib" != x"no"; then
11018af9a7ee5Smrg    m4_ifval(
11019af9a7ee5Smrg      [$1],
11020af9a7ee5Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
11021af9a7ee5Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
11022af9a7ee5Smrg    )
11023af9a7ee5Smrg  fi
11024af9a7ee5Smrgfi
11025b9b4fd27Smrg
11026af9a7ee5Smrg# Not having GLib when unit testing has been explicitly requested is an error
11027af9a7ee5Smrgif test "x$enable_unit_tests" = x"yes"; then
11028af9a7ee5Smrg  if test "x$have_glib" = x"no"; then
11029af9a7ee5Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
11030af9a7ee5Smrg  fi
11031af9a7ee5Smrgfi
11032b9b4fd27Smrg
11033af9a7ee5Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
11034af9a7ee5Smrgif test "x$enable_unit_tests" = x"no"; then
11035af9a7ee5Smrg  if test "x$with_glib" = x"yes"; then
11036af9a7ee5Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
11037af9a7ee5Smrg  fi
11038af9a7ee5Smrgfi
11039caade7ccSmrg
11040af9a7ee5Smrg# Not having GLib when it has been explicitly requested is an error
11041af9a7ee5Smrgif test "x$with_glib" = x"yes"; then
11042af9a7ee5Smrg  if test "x$have_glib" = x"no"; then
11043af9a7ee5Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
11044af9a7ee5Smrg  fi
11045af9a7ee5Smrgfi
11046caade7ccSmrg
11047af9a7ee5SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
11048af9a7ee5Smrg]) # XORG_WITH_GLIB
11049caade7ccSmrg
11050af9a7ee5Smrg# XORG_LD_WRAP([required|optional])
11051af9a7ee5Smrg# ---------------------------------
11052af9a7ee5Smrg# Minimum version: 1.13.0
11053af9a7ee5Smrg#
11054af9a7ee5Smrg# Check if linker supports -wrap, passed via compiler flags
11055af9a7ee5Smrg#
11056af9a7ee5Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
11057af9a7ee5Smrg# Otherwise the value of $enable_unit_tests is blank.
11058af9a7ee5Smrg#
11059af9a7ee5Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
11060af9a7ee5Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
11061af9a7ee5Smrg# available, an argument of "optional" allows use when some unit tests require
11062af9a7ee5Smrg# ld -wrap and others do not.
11063af9a7ee5Smrg#
11064af9a7ee5SmrgAC_DEFUN([XORG_LD_WRAP],[
11065af9a7ee5SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
11066af9a7ee5Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
11067af9a7ee5Smrg                      void __wrap_exit(int status) { return; }],
11068af9a7ee5Smrg                     [exit(0);])])
11069af9a7ee5Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
11070af9a7ee5Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
11071af9a7ee5Smrg  if test "x$have_ld_wrap" = x"no"; then
11072af9a7ee5Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
11073af9a7ee5Smrg  fi
11074af9a7ee5Smrgfi
11075af9a7ee5SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
11076af9a7ee5Smrg#
11077af9a7ee5Smrg]) # XORG_LD_WRAP
11078b9b4fd27Smrg
11079af9a7ee5Smrg# XORG_CHECK_LINKER_FLAGS
11080af9a7ee5Smrg# -----------------------
11081af9a7ee5Smrg# SYNOPSIS
11082af9a7ee5Smrg#
11083af9a7ee5Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
11084af9a7ee5Smrg#
11085af9a7ee5Smrg# DESCRIPTION
11086af9a7ee5Smrg#
11087af9a7ee5Smrg#   Check whether the given linker FLAGS work with the current language's
11088af9a7ee5Smrg#   linker, or whether they give an error.
11089af9a7ee5Smrg#
11090af9a7ee5Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
11091af9a7ee5Smrg#   success/failure.
11092af9a7ee5Smrg#
11093af9a7ee5Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
11094af9a7ee5Smrg#
11095af9a7ee5Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
11096af9a7ee5Smrg#
11097af9a7ee5Smrg# LICENSE
11098af9a7ee5Smrg#
11099af9a7ee5Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
11100af9a7ee5Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
11101af9a7ee5Smrg#   Copyright (c) 2009 Matteo Frigo
11102af9a7ee5Smrg#
11103af9a7ee5Smrg#   This program is free software: you can redistribute it and/or modify it
11104af9a7ee5Smrg#   under the terms of the GNU General Public License as published by the
11105af9a7ee5Smrg#   Free Software Foundation, either version 3 of the License, or (at your
11106af9a7ee5Smrg#   option) any later version.
11107af9a7ee5Smrg#
11108af9a7ee5Smrg#   This program is distributed in the hope that it will be useful, but
11109af9a7ee5Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
11110af9a7ee5Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11111af9a7ee5Smrg#   Public License for more details.
11112af9a7ee5Smrg#
11113af9a7ee5Smrg#   You should have received a copy of the GNU General Public License along
11114af9a7ee5Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
11115af9a7ee5Smrg#
11116af9a7ee5Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
11117af9a7ee5Smrg#   gives unlimited permission to copy, distribute and modify the configure
11118af9a7ee5Smrg#   scripts that are the output of Autoconf when processing the Macro. You
11119af9a7ee5Smrg#   need not follow the terms of the GNU General Public License when using
11120af9a7ee5Smrg#   or distributing such scripts, even though portions of the text of the
11121af9a7ee5Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
11122af9a7ee5Smrg#   all other use of the material that constitutes the Autoconf Macro.
11123af9a7ee5Smrg#
11124af9a7ee5Smrg#   This special exception to the GPL applies to versions of the Autoconf
11125af9a7ee5Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
11126af9a7ee5Smrg#   modified version of the Autoconf Macro, you may extend this special
11127af9a7ee5Smrg#   exception to the GPL to apply to your modified version as well.#
11128af9a7ee5SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
11129af9a7ee5Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
11130af9a7ee5Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
11131af9a7ee5SmrgAS_LITERAL_IF([$1],
11132af9a7ee5Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
11133af9a7ee5Smrg      ax_save_FLAGS=$LDFLAGS
11134af9a7ee5Smrg      LDFLAGS="$1"
11135af9a7ee5Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
11136af9a7ee5Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
11137af9a7ee5Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
11138af9a7ee5Smrg      LDFLAGS=$ax_save_FLAGS])],
11139af9a7ee5Smrg  [ax_save_FLAGS=$LDFLAGS
11140af9a7ee5Smrg   LDFLAGS="$1"
11141af9a7ee5Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
11142af9a7ee5Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
11143af9a7ee5Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
11144af9a7ee5Smrg   LDFLAGS=$ax_save_FLAGS])
11145af9a7ee5Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
11146af9a7ee5SmrgAC_MSG_RESULT($xorg_check_linker_flags)
11147af9a7ee5Smrgif test "x$xorg_check_linker_flags" = xyes; then
11148af9a7ee5Smrg	m4_default([$2], :)
11149af9a7ee5Smrgelse
11150af9a7ee5Smrg	m4_default([$3], :)
11151af9a7ee5Smrgfi
11152af9a7ee5Smrg]) # XORG_CHECK_LINKER_FLAGS
11153b9b4fd27Smrg
11154af9a7ee5Smrg# XORG_MEMORY_CHECK_FLAGS
11155af9a7ee5Smrg# -----------------------
11156af9a7ee5Smrg# Minimum version: 1.16.0
11157caade7ccSmrg#
11158af9a7ee5Smrg# This macro attempts to find appropriate memory checking functionality
11159af9a7ee5Smrg# for various platforms which unit testing code may use to catch various
11160af9a7ee5Smrg# forms of memory allocation and access errors in testing.
11161caade7ccSmrg#
11162af9a7ee5Smrg# Interface to module:
11163af9a7ee5Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
11164af9a7ee5Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
11165af9a7ee5Smrg#
11166af9a7ee5Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
11167af9a7ee5Smrg#
11168af9a7ee5SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
11169caade7ccSmrg
11170af9a7ee5SmrgAC_REQUIRE([AC_CANONICAL_HOST])
11171af9a7ee5SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
11172af9a7ee5Smrg           [Environment variables to enable memory checking in tests])
11173caade7ccSmrg
11174af9a7ee5Smrg# Check for different types of support on different platforms
11175af9a7ee5Smrgcase $host_os in
11176af9a7ee5Smrg    solaris*)
11177af9a7ee5Smrg        AC_CHECK_LIB([umem], [umem_alloc],
11178af9a7ee5Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
11179af9a7ee5Smrg        ;;
11180af9a7ee5Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
11181af9a7ee5Smrg        # both directly and inverted, so should not be 0 or 255.
11182af9a7ee5Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
11183af9a7ee5Smrg        ;;
11184af9a7ee5Smrg    darwin*)
11185af9a7ee5Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
11186af9a7ee5Smrg        ;;
11187af9a7ee5Smrg    *bsd*)
11188af9a7ee5Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
11189af9a7ee5Smrg        ;;
11190af9a7ee5Smrgesac
11191caade7ccSmrg
11192af9a7ee5Smrg# User supplied flags override default flags
11193af9a7ee5Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
11194af9a7ee5Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
11195af9a7ee5Smrgfi
11196b9b4fd27Smrg
11197af9a7ee5SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
11198af9a7ee5Smrg]) # XORG_WITH_LINT
11199b9b4fd27Smrg
11200af9a7ee5Smrg# XORG_CHECK_MALLOC_ZERO
11201af9a7ee5Smrg# ----------------------
11202af9a7ee5Smrg# Minimum version: 1.0.0
11203af9a7ee5Smrg#
11204af9a7ee5Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
11205af9a7ee5Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
11206af9a7ee5Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
11207af9a7ee5SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
11208af9a7ee5SmrgAC_ARG_ENABLE(malloc0returnsnull,
11209af9a7ee5Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
11210af9a7ee5Smrg		       [malloc(0) returns NULL (default: auto)]),
11211af9a7ee5Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
11212af9a7ee5Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
11213b9b4fd27Smrg
11214af9a7ee5SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
11215af9a7ee5Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
11216e5383a99SmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
11217e5383a99Smrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
11218af9a7ee5Smrg#include <stdlib.h>
11219af9a7ee5Smrg],[
11220af9a7ee5Smrg    char *m0, *r0, *c0, *p;
11221af9a7ee5Smrg    m0 = malloc(0);
11222af9a7ee5Smrg    p = malloc(10);
11223af9a7ee5Smrg    r0 = realloc(p,0);
11224af9a7ee5Smrg    c0 = calloc(0,10);
11225af9a7ee5Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
11226af9a7ee5Smrg])],
11227e5383a99Smrg		[xorg_cv_malloc0_returns_null=yes],
11228e5383a99Smrg		[xorg_cv_malloc0_returns_null=no])])
11229e5383a99SmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
11230af9a7ee5Smrgfi
11231af9a7ee5SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
11232af9a7ee5Smrg
11233af9a7ee5Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
11234af9a7ee5Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
11235af9a7ee5Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
11236af9a7ee5Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
11237af9a7ee5Smrgelse
11238af9a7ee5Smrg	MALLOC_ZERO_CFLAGS=""
11239af9a7ee5Smrg	XMALLOC_ZERO_CFLAGS=""
11240af9a7ee5Smrg	XTMALLOC_ZERO_CFLAGS=""
11241af9a7ee5Smrgfi
11242b9b4fd27Smrg
11243af9a7ee5SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
11244af9a7ee5SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
11245af9a7ee5SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
11246af9a7ee5Smrg]) # XORG_CHECK_MALLOC_ZERO
11247b9b4fd27Smrg
11248af9a7ee5Smrg# XORG_WITH_LINT()
11249af9a7ee5Smrg# ----------------
11250af9a7ee5Smrg# Minimum version: 1.1.0
11251b9b4fd27Smrg#
11252af9a7ee5Smrg# This macro enables the use of a tool that flags some suspicious and
11253af9a7ee5Smrg# non-portable constructs (likely to be bugs) in C language source code.
11254af9a7ee5Smrg# It will attempt to locate the tool and use appropriate options.
11255af9a7ee5Smrg# There are various lint type tools on different platforms.
11256af9a7ee5Smrg#
11257af9a7ee5Smrg# Interface to module:
11258af9a7ee5Smrg# LINT:		returns the path to the tool found on the platform
11259af9a7ee5Smrg#		or the value set to LINT on the configure cmd line
11260af9a7ee5Smrg#		also an Automake conditional
11261af9a7ee5Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
11262af9a7ee5Smrg#
11263af9a7ee5Smrg# --with-lint:	'yes' user instructs the module to use lint
11264af9a7ee5Smrg#		'no' user instructs the module not to use lint (default)
11265af9a7ee5Smrg#
11266af9a7ee5Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
11267af9a7ee5Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
11268af9a7ee5Smrg#
11269af9a7ee5SmrgAC_DEFUN([XORG_WITH_LINT],[
11270b9b4fd27Smrg
11271af9a7ee5SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
11272af9a7ee5SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
11273af9a7ee5SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
11274af9a7ee5Smrg		[Use a lint-style source code checker (default: disabled)])],
11275af9a7ee5Smrg		[use_lint=$withval], [use_lint=no])
11276b9b4fd27Smrg
11277af9a7ee5Smrg# Obtain platform specific info like program name and options
11278af9a7ee5Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
11279af9a7ee5Smrgcase $host_os in
11280af9a7ee5Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
11281af9a7ee5Smrg	lint_name=splint
11282af9a7ee5Smrg	lint_options="-badflag"
11283af9a7ee5Smrg	;;
11284af9a7ee5Smrg  *freebsd* | *netbsd*)
11285af9a7ee5Smrg	lint_name=lint
11286af9a7ee5Smrg	lint_options="-u -b"
11287af9a7ee5Smrg	;;
11288af9a7ee5Smrg  *solaris*)
11289af9a7ee5Smrg	lint_name=lint
11290af9a7ee5Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
11291af9a7ee5Smrg	;;
11292af9a7ee5Smrgesac
11293b9b4fd27Smrg
11294af9a7ee5Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
11295af9a7ee5Smrgif test "x$use_lint" = x"yes" ; then
11296af9a7ee5Smrg   AC_PATH_PROG([LINT], [$lint_name])
11297af9a7ee5Smrg   if test "x$LINT" = "x"; then
11298af9a7ee5Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
11299af9a7ee5Smrg   fi
11300af9a7ee5Smrgelif test "x$use_lint" = x"no" ; then
11301af9a7ee5Smrg   if test "x$LINT" != "x"; then
11302af9a7ee5Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
11303af9a7ee5Smrg   fi
11304af9a7ee5Smrgelse
11305af9a7ee5Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
11306af9a7ee5Smrgfi
11307b9b4fd27Smrg
11308af9a7ee5Smrg# User supplied flags override default flags
11309af9a7ee5Smrgif test "x$LINT_FLAGS" != "x"; then
11310af9a7ee5Smrg   lint_options=$LINT_FLAGS
11311af9a7ee5Smrgfi
11312b9b4fd27Smrg
11313af9a7ee5SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
11314af9a7ee5SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
11315b9b4fd27Smrg
11316af9a7ee5Smrg]) # XORG_WITH_LINT
11317b9b4fd27Smrg
11318af9a7ee5Smrg# XORG_LINT_LIBRARY(LIBNAME)
11319af9a7ee5Smrg# --------------------------
11320af9a7ee5Smrg# Minimum version: 1.1.0
11321af9a7ee5Smrg#
11322af9a7ee5Smrg# Sets up flags for building lint libraries for checking programs that call
11323af9a7ee5Smrg# functions in the library.
11324af9a7ee5Smrg#
11325af9a7ee5Smrg# Interface to module:
11326af9a7ee5Smrg# LINTLIB		- Automake variable with the name of lint library file to make
11327af9a7ee5Smrg# MAKE_LINT_LIB		- Automake conditional
11328af9a7ee5Smrg#
11329af9a7ee5Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
11330af9a7ee5Smrg#			  - 'no' user instructs the module not to create a lint library (default)
11331485f0483Smrg
11332af9a7ee5SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
11333af9a7ee5SmrgAC_REQUIRE([XORG_WITH_LINT])
11334af9a7ee5SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
11335af9a7ee5Smrg	[Create lint library (default: disabled)])],
11336af9a7ee5Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
11337485f0483Smrg
11338af9a7ee5Smrgif test "x$make_lint_lib" = x"yes" ; then
11339af9a7ee5Smrg   LINTLIB=llib-l$1.ln
11340af9a7ee5Smrg   if test "x$LINT" = "x"; then
11341af9a7ee5Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
11342af9a7ee5Smrg   fi
11343af9a7ee5Smrgelif test "x$make_lint_lib" != x"no" ; then
11344af9a7ee5Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
11345af9a7ee5Smrgfi
11346caade7ccSmrg
11347af9a7ee5SmrgAC_SUBST(LINTLIB)
11348af9a7ee5SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
11349caade7ccSmrg
11350af9a7ee5Smrg]) # XORG_LINT_LIBRARY
11351af9a7ee5Smrg
11352af9a7ee5Smrg# XORG_COMPILER_BRAND
11353af9a7ee5Smrg# -------------------
11354af9a7ee5Smrg# Minimum version: 1.14.0
11355af9a7ee5Smrg#
11356af9a7ee5Smrg# Checks for various brands of compilers and sets flags as appropriate:
11357af9a7ee5Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
11358af9a7ee5Smrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
11359af9a7ee5Smrg#   clang compiler - sets CLANGCC to "yes"
11360af9a7ee5Smrg#   Intel compiler - sets INTELCC to "yes"
11361af9a7ee5Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
11362af9a7ee5Smrg#
11363af9a7ee5SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
11364af9a7ee5SmrgAC_LANG_CASE(
11365af9a7ee5Smrg	[C], [
11366af9a7ee5Smrg		AC_REQUIRE([AC_PROG_CC_C99])
11367af9a7ee5Smrg	],
11368af9a7ee5Smrg	[C++], [
11369af9a7ee5Smrg		AC_REQUIRE([AC_PROG_CXX])
11370af9a7ee5Smrg	]
11371af9a7ee5Smrg)
11372af9a7ee5SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
11373af9a7ee5SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
11374af9a7ee5SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
11375af9a7ee5Smrg]) # XORG_COMPILER_BRAND
11376caade7ccSmrg
11377af9a7ee5Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
11378af9a7ee5Smrg# ---------------
11379af9a7ee5Smrg# Minimum version: 1.16.0
11380af9a7ee5Smrg#
11381af9a7ee5Smrg# Test if the compiler works when passed the given flag as a command line argument.
11382af9a7ee5Smrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
11383af9a7ee5Smrg# next flag in the list until there are no more options.
11384af9a7ee5Smrg#
11385af9a7ee5Smrg# Note that this does not guarantee that the compiler supports the flag as some
11386af9a7ee5Smrg# compilers will simply ignore arguments that they do not understand, but we do
11387af9a7ee5Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
11388af9a7ee5Smrg# -Werror=unused-command-line-argument
11389af9a7ee5Smrg#
11390af9a7ee5SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
11391af9a7ee5Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11392af9a7ee5Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11393af9a7ee5Smrg
11394af9a7ee5SmrgAC_LANG_COMPILER_REQUIRE
11395af9a7ee5Smrg
11396af9a7ee5SmrgAC_LANG_CASE(
11397af9a7ee5Smrg	[C], [
11398af9a7ee5Smrg		AC_REQUIRE([AC_PROG_CC_C99])
11399af9a7ee5Smrg		define([PREFIX], [C])
11400af9a7ee5Smrg		define([CACHE_PREFIX], [cc])
11401af9a7ee5Smrg		define([COMPILER], [$CC])
11402af9a7ee5Smrg	],
11403af9a7ee5Smrg	[C++], [
11404af9a7ee5Smrg		define([PREFIX], [CXX])
11405af9a7ee5Smrg		define([CACHE_PREFIX], [cxx])
11406af9a7ee5Smrg		define([COMPILER], [$CXX])
11407af9a7ee5Smrg	]
11408af9a7ee5Smrg)
11409485f0483Smrg
11410af9a7ee5Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
11411af9a7ee5Smrg
11412af9a7ee5Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
11413af9a7ee5Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11414af9a7ee5Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
11415af9a7ee5Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
11416af9a7ee5Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11417af9a7ee5Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
11418af9a7ee5Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
11419af9a7ee5Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
11420af9a7ee5Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11421af9a7ee5Smrgfi
11422caade7ccSmrg
11423af9a7ee5Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
11424af9a7ee5Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
11425af9a7ee5Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11426af9a7ee5Smrg	fi
11427af9a7ee5Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11428af9a7ee5Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
11429af9a7ee5Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
11430af9a7ee5Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
11431af9a7ee5Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
11432af9a7ee5Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
11433af9a7ee5Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
11434af9a7ee5Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11435af9a7ee5Smrgfi
11436485f0483Smrg
11437af9a7ee5Smrgfound="no"
11438af9a7ee5Smrgm4_foreach([flag], m4_cdr($@), [
11439af9a7ee5Smrg	if test $found = "no" ; then
11440e5383a99Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
11441af9a7ee5Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
11442af9a7ee5Smrg		fi
11443af9a7ee5Smrg
11444e5383a99Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
11445af9a7ee5Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
11446af9a7ee5Smrg		fi
11447af9a7ee5Smrg
11448af9a7ee5Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
11449af9a7ee5Smrg
11450af9a7ee5Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
11451af9a7ee5Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
11452af9a7ee5Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
11453af9a7ee5Smrg		AC_CACHE_VAL($cacheid,
11454af9a7ee5Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
11455af9a7ee5Smrg					     [eval $cacheid=yes],
11456af9a7ee5Smrg					     [eval $cacheid=no])])
11457af9a7ee5Smrg
11458af9a7ee5Smrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11459af9a7ee5Smrg
11460af9a7ee5Smrg		eval supported=\$$cacheid
11461af9a7ee5Smrg		AC_MSG_RESULT([$supported])
11462af9a7ee5Smrg		if test "$supported" = "yes" ; then
11463af9a7ee5Smrg			$1="$$1 ]flag["
11464af9a7ee5Smrg			found="yes"
11465af9a7ee5Smrg		fi
11466af9a7ee5Smrg	fi
11467b9b4fd27Smrg])
11468af9a7ee5Smrg]) # XORG_TESTSET_CFLAG
11469485f0483Smrg
11470af9a7ee5Smrg# XORG_COMPILER_FLAGS
11471af9a7ee5Smrg# ---------------
11472af9a7ee5Smrg# Minimum version: 1.16.0
11473b9b4fd27Smrg#
11474af9a7ee5Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
11475af9a7ee5Smrg# arguments supported by the selected compiler which do NOT alter the generated
11476af9a7ee5Smrg# code.  These arguments will cause the compiler to print various warnings
11477af9a7ee5Smrg# during compilation AND turn a conservative set of warnings into errors.
11478b9b4fd27Smrg#
11479af9a7ee5Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
11480af9a7ee5Smrg# future versions of util-macros as options are added to new compilers.
11481af9a7ee5Smrg#
11482af9a7ee5SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
11483af9a7ee5SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
11484caade7ccSmrg
11485af9a7ee5SmrgAC_ARG_ENABLE(selective-werror,
11486af9a7ee5Smrg              AS_HELP_STRING([--disable-selective-werror],
11487af9a7ee5Smrg                             [Turn off selective compiler errors. (default: enabled)]),
11488af9a7ee5Smrg              [SELECTIVE_WERROR=$enableval],
11489af9a7ee5Smrg              [SELECTIVE_WERROR=yes])
11490af9a7ee5Smrg
11491af9a7ee5SmrgAC_LANG_CASE(
11492af9a7ee5Smrg        [C], [
11493af9a7ee5Smrg                define([PREFIX], [C])
11494af9a7ee5Smrg        ],
11495af9a7ee5Smrg        [C++], [
11496af9a7ee5Smrg                define([PREFIX], [CXX])
11497af9a7ee5Smrg        ]
11498af9a7ee5Smrg)
11499af9a7ee5Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
11500af9a7ee5Smrgif test "x$SUNCC" = "xyes"; then
11501af9a7ee5Smrg    [BASE_]PREFIX[FLAGS]="-v"
11502af9a7ee5Smrgelse
11503af9a7ee5Smrg    [BASE_]PREFIX[FLAGS]=""
11504af9a7ee5Smrgfi
11505caade7ccSmrg
11506af9a7ee5Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
11507af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
11508af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
11509af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
11510af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
11511af9a7ee5Smrg
11512af9a7ee5SmrgAC_LANG_CASE(
11513af9a7ee5Smrg	[C], [
11514af9a7ee5Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
11515af9a7ee5Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
11516af9a7ee5Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
11517af9a7ee5Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
11518e5383a99Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
11519af9a7ee5Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
11520af9a7ee5Smrg	]
11521af9a7ee5Smrg)
11522caade7ccSmrg
11523af9a7ee5Smrg# This chunk adds additional warnings that could catch undesired effects.
11524af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
11525af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
11526af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
11527af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
11528af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
11529af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
11530e5383a99SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
11531af9a7ee5Smrg
11532af9a7ee5Smrg# These are currently disabled because they are noisy.  They will be enabled
11533af9a7ee5Smrg# in the future once the codebase is sufficiently modernized to silence
11534af9a7ee5Smrg# them.  For now, I don't want them to drown out the other warnings.
11535af9a7ee5Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
11536af9a7ee5Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
11537e5383a99Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
11538af9a7ee5Smrg
11539af9a7ee5Smrg# Turn some warnings into errors, so we don't accidently get successful builds
11540af9a7ee5Smrg# when there are problems that should be fixed.
11541af9a7ee5Smrg
11542af9a7ee5Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
11543af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
11544af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
11545af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
11546af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
11547af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
11548af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
11549af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
11550af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
11551af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
11552af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
11553af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
11554af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
11555af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
11556af9a7ee5Smrgelse
11557af9a7ee5SmrgAC_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])
11558af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
11559af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
11560af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
11561af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
11562af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
11563af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
11564af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
11565af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
11566af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
11567af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
11568af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
11569af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
11570af9a7ee5SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
11571af9a7ee5Smrgfi
11572b9b4fd27Smrg
11573af9a7ee5SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
11574af9a7ee5Smrg]) # XORG_COMPILER_FLAGS
11575b9b4fd27Smrg
11576af9a7ee5Smrg# XORG_CWARNFLAGS
11577af9a7ee5Smrg# ---------------
11578af9a7ee5Smrg# Minimum version: 1.2.0
11579af9a7ee5Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
11580b9b4fd27Smrg#
11581af9a7ee5Smrg# Defines CWARNFLAGS to enable C compiler warnings.
11582b9b4fd27Smrg#
11583af9a7ee5Smrg# This function is deprecated because it defines -fno-strict-aliasing
11584af9a7ee5Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
11585af9a7ee5Smrg# is needed, then it should be added explicitly in the module when
11586af9a7ee5Smrg# it is updated to use BASE_CFLAGS.
11587af9a7ee5Smrg#
11588af9a7ee5SmrgAC_DEFUN([XORG_CWARNFLAGS], [
11589af9a7ee5SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
11590af9a7ee5SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
11591af9a7ee5SmrgAC_LANG_CASE(
11592af9a7ee5Smrg	[C], [
11593af9a7ee5Smrg		CWARNFLAGS="$BASE_CFLAGS"
11594af9a7ee5Smrg		if  test "x$GCC" = xyes ; then
11595af9a7ee5Smrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
11596af9a7ee5Smrg		fi
11597af9a7ee5Smrg		AC_SUBST(CWARNFLAGS)
11598af9a7ee5Smrg	]
11599af9a7ee5Smrg)
11600af9a7ee5Smrg]) # XORG_CWARNFLAGS
11601b9b4fd27Smrg
11602af9a7ee5Smrg# XORG_STRICT_OPTION
11603af9a7ee5Smrg# -----------------------
11604af9a7ee5Smrg# Minimum version: 1.3.0
11605af9a7ee5Smrg#
11606af9a7ee5Smrg# Add configure option to enable strict compilation flags, such as treating
11607af9a7ee5Smrg# warnings as fatal errors.
11608af9a7ee5Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
11609af9a7ee5Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
11610af9a7ee5Smrg#
11611af9a7ee5Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
11612af9a7ee5Smrg# when strict compilation is unconditionally desired.
11613af9a7ee5SmrgAC_DEFUN([XORG_STRICT_OPTION], [
11614af9a7ee5SmrgAC_REQUIRE([XORG_CWARNFLAGS])
11615af9a7ee5SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
11616b9b4fd27Smrg
11617af9a7ee5SmrgAC_ARG_ENABLE(strict-compilation,
11618af9a7ee5Smrg			  AS_HELP_STRING([--enable-strict-compilation],
11619af9a7ee5Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
11620af9a7ee5Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
11621af9a7ee5Smrg
11622af9a7ee5SmrgAC_LANG_CASE(
11623af9a7ee5Smrg        [C], [
11624af9a7ee5Smrg                define([PREFIX], [C])
11625af9a7ee5Smrg        ],
11626af9a7ee5Smrg        [C++], [
11627af9a7ee5Smrg                define([PREFIX], [CXX])
11628af9a7ee5Smrg        ]
11629af9a7ee5Smrg)
11630af9a7ee5Smrg
11631af9a7ee5Smrg[STRICT_]PREFIX[FLAGS]=""
11632af9a7ee5SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
11633af9a7ee5SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
11634af9a7ee5Smrg
11635af9a7ee5Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
11636af9a7ee5Smrg# activate it with -Werror, so we add it here explicitly.
11637af9a7ee5SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
11638af9a7ee5Smrg
11639af9a7ee5Smrgif test "x$STRICT_COMPILE" = "xyes"; then
11640af9a7ee5Smrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
11641af9a7ee5Smrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
11642af9a7ee5Smrgfi
11643af9a7ee5SmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
11644af9a7ee5SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
11645af9a7ee5SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
11646af9a7ee5Smrg]) # XORG_STRICT_OPTION
11647af9a7ee5Smrg
11648af9a7ee5Smrg# XORG_DEFAULT_OPTIONS
11649af9a7ee5Smrg# --------------------
11650af9a7ee5Smrg# Minimum version: 1.3.0
11651b9b4fd27Smrg#
11652af9a7ee5Smrg# Defines default options for X.Org modules.
11653b9b4fd27Smrg#
11654af9a7ee5SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
11655af9a7ee5SmrgAC_REQUIRE([AC_PROG_INSTALL])
11656af9a7ee5SmrgXORG_COMPILER_FLAGS
11657af9a7ee5SmrgXORG_CWARNFLAGS
11658af9a7ee5SmrgXORG_STRICT_OPTION
11659af9a7ee5SmrgXORG_RELEASE_VERSION
11660af9a7ee5SmrgXORG_CHANGELOG
11661af9a7ee5SmrgXORG_INSTALL
11662af9a7ee5SmrgXORG_MANPAGE_SECTIONS
11663af9a7ee5Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
11664af9a7ee5Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
11665af9a7ee5Smrg]) # XORG_DEFAULT_OPTIONS
11666af9a7ee5Smrg
11667af9a7ee5Smrg# XORG_INSTALL()
11668af9a7ee5Smrg# ----------------
11669af9a7ee5Smrg# Minimum version: 1.4.0
11670b9b4fd27Smrg#
11671af9a7ee5Smrg# Defines the variable INSTALL_CMD as the command to copy
11672af9a7ee5Smrg# INSTALL from $prefix/share/util-macros.
11673b9b4fd27Smrg#
11674af9a7ee5SmrgAC_DEFUN([XORG_INSTALL], [
11675af9a7ee5SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
11676af9a7ee5Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
11677af9a7ee5SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
11678af9a7ee5Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
11679af9a7ee5Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
11680af9a7ee5Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
11681af9a7ee5SmrgAC_SUBST([INSTALL_CMD])
11682af9a7ee5Smrg]) # XORG_INSTALL
11683af9a7ee5Smrgdnl Copyright 2005 Red Hat, Inc
11684af9a7ee5Smrgdnl
11685af9a7ee5Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
11686af9a7ee5Smrgdnl documentation for any purpose is hereby granted without fee, provided that
11687af9a7ee5Smrgdnl the above copyright notice appear in all copies and that both that
11688af9a7ee5Smrgdnl copyright notice and this permission notice appear in supporting
11689af9a7ee5Smrgdnl documentation.
11690af9a7ee5Smrgdnl
11691af9a7ee5Smrgdnl The above copyright notice and this permission notice shall be included
11692af9a7ee5Smrgdnl in all copies or substantial portions of the Software.
11693af9a7ee5Smrgdnl
11694af9a7ee5Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11695af9a7ee5Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11696af9a7ee5Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11697af9a7ee5Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11698af9a7ee5Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11699af9a7ee5Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11700af9a7ee5Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
11701af9a7ee5Smrgdnl
11702af9a7ee5Smrgdnl Except as contained in this notice, the name of the copyright holders shall
11703af9a7ee5Smrgdnl not be used in advertising or otherwise to promote the sale, use or
11704af9a7ee5Smrgdnl other dealings in this Software without prior written authorization
11705af9a7ee5Smrgdnl from the copyright holders.
11706af9a7ee5Smrgdnl
11707b9b4fd27Smrg
11708af9a7ee5Smrg# XORG_RELEASE_VERSION
11709af9a7ee5Smrg# --------------------
11710af9a7ee5Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
11711e5383a99Smrg
11712af9a7ee5SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
11713af9a7ee5Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
11714af9a7ee5Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
11715af9a7ee5Smrg		[Major version of this package])
11716af9a7ee5Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
11717af9a7ee5Smrg	if test "x$PVM" = "x"; then
11718af9a7ee5Smrg		PVM="0"
11719af9a7ee5Smrg	fi
11720af9a7ee5Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
11721af9a7ee5Smrg		[$PVM],
11722af9a7ee5Smrg		[Minor version of this package])
11723af9a7ee5Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
11724af9a7ee5Smrg	if test "x$PVP" = "x"; then
11725af9a7ee5Smrg		PVP="0"
11726af9a7ee5Smrg	fi
11727af9a7ee5Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
11728af9a7ee5Smrg		[$PVP],
11729af9a7ee5Smrg		[Patch version of this package])
11730af9a7ee5Smrg])
11731b9b4fd27Smrg
11732af9a7ee5Smrg# XORG_CHANGELOG()
11733af9a7ee5Smrg# ----------------
11734af9a7ee5Smrg# Minimum version: 1.2.0
11735af9a7ee5Smrg#
11736af9a7ee5Smrg# Defines the variable CHANGELOG_CMD as the command to generate
11737af9a7ee5Smrg# ChangeLog from git.
11738af9a7ee5Smrg#
11739af9a7ee5Smrg#
11740af9a7ee5SmrgAC_DEFUN([XORG_CHANGELOG], [
11741af9a7ee5SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
11742af9a7ee5Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
11743af9a7ee5Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
11744af9a7ee5Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
11745af9a7ee5SmrgAC_SUBST([CHANGELOG_CMD])
11746af9a7ee5Smrg]) # XORG_CHANGELOG
11747caade7ccSmrg
11748