aclocal.m4 revision d7be9c72
1d7be9c72Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2fe5e51b7Smrg
3fe5e51b7Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4643b027fSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5fe5e51b7Smrg# This file is free software; the Free Software Foundation
6fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
7fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
8fe5e51b7Smrg
9fe5e51b7Smrg# This program is distributed in the hope that it will be useful,
10fe5e51b7Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11fe5e51b7Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12fe5e51b7Smrg# PARTICULAR PURPOSE.
13fe5e51b7Smrg
14eda3803bSmrgm4_ifndef([AC_AUTOCONF_VERSION],
15eda3803bSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16eda3803bSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
17eda3803bSmrg[m4_warning([this file was generated for autoconf 2.63.
18eda3803bSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19eda3803bSmrgIf you have problems, you may need to regenerate the build system entirely.
20eda3803bSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21fe5e51b7Smrg
22fe5e51b7Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
23a31a186aSmrg#
24a31a186aSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
25a31a186aSmrg#                 2006, 2007, 2008 Free Software Foundation, Inc.
26a31a186aSmrg#   Written by Gordon Matzigkeit, 1996
27a31a186aSmrg#
28a31a186aSmrg# This file is free software; the Free Software Foundation gives
29a31a186aSmrg# unlimited permission to copy and/or distribute it, with or without
30a31a186aSmrg# modifications, as long as this notice is preserved.
31a31a186aSmrg
32a31a186aSmrgm4_define([_LT_COPYING], [dnl
33a31a186aSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
34a31a186aSmrg#                 2006, 2007, 2008 Free Software Foundation, Inc.
35a31a186aSmrg#   Written by Gordon Matzigkeit, 1996
36a31a186aSmrg#
37a31a186aSmrg#   This file is part of GNU Libtool.
38a31a186aSmrg#
39a31a186aSmrg# GNU Libtool is free software; you can redistribute it and/or
40a31a186aSmrg# modify it under the terms of the GNU General Public License as
41a31a186aSmrg# published by the Free Software Foundation; either version 2 of
42a31a186aSmrg# the License, or (at your option) any later version.
43a31a186aSmrg#
44a31a186aSmrg# As a special exception to the GNU General Public License,
45a31a186aSmrg# if you distribute this file as part of a program or library that
46a31a186aSmrg# is built using GNU Libtool, you may include this file under the
47a31a186aSmrg# same distribution terms that you use for the rest of that program.
48a31a186aSmrg#
49a31a186aSmrg# GNU Libtool is distributed in the hope that it will be useful,
50a31a186aSmrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
51a31a186aSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
52a31a186aSmrg# GNU General Public License for more details.
53a31a186aSmrg#
54a31a186aSmrg# You should have received a copy of the GNU General Public License
55a31a186aSmrg# along with GNU Libtool; see the file COPYING.  If not, a copy
56a31a186aSmrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
57a31a186aSmrg# obtained by writing to the Free Software Foundation, Inc.,
58a31a186aSmrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
59a31a186aSmrg])
60fe5e51b7Smrg
61a31a186aSmrg# serial 56 LT_INIT
62fe5e51b7Smrg
63fe5e51b7Smrg
64a31a186aSmrg# LT_PREREQ(VERSION)
65a31a186aSmrg# ------------------
66a31a186aSmrg# Complain and exit if this libtool version is less that VERSION.
67a31a186aSmrgm4_defun([LT_PREREQ],
68a31a186aSmrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
69a31a186aSmrg       [m4_default([$3],
70a31a186aSmrg		   [m4_fatal([Libtool version $1 or higher is required],
71a31a186aSmrg		             63)])],
72a31a186aSmrg       [$2])])
73eda3803bSmrg
74eda3803bSmrg
75a31a186aSmrg# _LT_CHECK_BUILDDIR
76a31a186aSmrg# ------------------
77a31a186aSmrg# Complain if the absolute build directory name contains unusual characters
78a31a186aSmrgm4_defun([_LT_CHECK_BUILDDIR],
79a31a186aSmrg[case `pwd` in
80a31a186aSmrg  *\ * | *\	*)
81a31a186aSmrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
82a31a186aSmrgesac
83a31a186aSmrg])
84a31a186aSmrg
85a31a186aSmrg
86a31a186aSmrg# LT_INIT([OPTIONS])
87a31a186aSmrg# ------------------
88a31a186aSmrgAC_DEFUN([LT_INIT],
89a31a186aSmrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
90a31a186aSmrgAC_BEFORE([$0], [LT_LANG])dnl
91a31a186aSmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
92a31a186aSmrgAC_BEFORE([$0], [LTDL_INIT])dnl
93a31a186aSmrgm4_require([_LT_CHECK_BUILDDIR])dnl
94a31a186aSmrg
95a31a186aSmrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
96a31a186aSmrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
97a31a186aSmrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
98a31a186aSmrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
99a31a186aSmrgdnl unless we require an AC_DEFUNed macro:
100a31a186aSmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
101a31a186aSmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
102a31a186aSmrgAC_REQUIRE([LTVERSION_VERSION])dnl
103a31a186aSmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
104a31a186aSmrgm4_require([_LT_PROG_LTMAIN])dnl
105a31a186aSmrg
106a31a186aSmrgdnl Parse OPTIONS
107a31a186aSmrg_LT_SET_OPTIONS([$0], [$1])
108fe5e51b7Smrg
109fe5e51b7Smrg# This can be used to rebuild libtool when needed
110a31a186aSmrgLIBTOOL_DEPS="$ltmain"
111fe5e51b7Smrg
112fe5e51b7Smrg# Always use our own libtool.
113fe5e51b7SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
114fe5e51b7SmrgAC_SUBST(LIBTOOL)dnl
115fe5e51b7Smrg
116a31a186aSmrg_LT_SETUP
117eda3803bSmrg
118a31a186aSmrg# Only expand once:
119a31a186aSmrgm4_define([LT_INIT])
120a31a186aSmrg])# LT_INIT
121eda3803bSmrg
122a31a186aSmrg# Old names:
123a31a186aSmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
124a31a186aSmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
125a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
126a31a186aSmrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
127a31a186aSmrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
128a31a186aSmrg
129a31a186aSmrg
130a31a186aSmrg# _LT_CC_BASENAME(CC)
131a31a186aSmrg# -------------------
132a31a186aSmrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
133a31a186aSmrgm4_defun([_LT_CC_BASENAME],
134a31a186aSmrg[for cc_temp in $1""; do
135a31a186aSmrg  case $cc_temp in
136a31a186aSmrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
137a31a186aSmrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
138a31a186aSmrg    \-*) ;;
139a31a186aSmrg    *) break;;
140a31a186aSmrg  esac
141a31a186aSmrgdone
142a31a186aSmrgcc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
143a31a186aSmrg])
144a31a186aSmrg
145a31a186aSmrg
146a31a186aSmrg# _LT_FILEUTILS_DEFAULTS
147a31a186aSmrg# ----------------------
148a31a186aSmrg# It is okay to use these file commands and assume they have been set
149a31a186aSmrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
150a31a186aSmrgm4_defun([_LT_FILEUTILS_DEFAULTS],
151a31a186aSmrg[: ${CP="cp -f"}
152a31a186aSmrg: ${MV="mv -f"}
153a31a186aSmrg: ${RM="rm -f"}
154a31a186aSmrg])# _LT_FILEUTILS_DEFAULTS
155a31a186aSmrg
156a31a186aSmrg
157a31a186aSmrg# _LT_SETUP
158a31a186aSmrg# ---------
159a31a186aSmrgm4_defun([_LT_SETUP],
160a31a186aSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
161fe5e51b7SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
162a31a186aSmrg_LT_DECL([], [host_alias], [0], [The host system])dnl
163a31a186aSmrg_LT_DECL([], [host], [0])dnl
164a31a186aSmrg_LT_DECL([], [host_os], [0])dnl
165a31a186aSmrgdnl
166a31a186aSmrg_LT_DECL([], [build_alias], [0], [The build system])dnl
167a31a186aSmrg_LT_DECL([], [build], [0])dnl
168a31a186aSmrg_LT_DECL([], [build_os], [0])dnl
169a31a186aSmrgdnl
170fe5e51b7SmrgAC_REQUIRE([AC_PROG_CC])dnl
171a31a186aSmrgAC_REQUIRE([LT_PATH_LD])dnl
172a31a186aSmrgAC_REQUIRE([LT_PATH_NM])dnl
173a31a186aSmrgdnl
174fe5e51b7SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
175a31a186aSmrgtest -z "$LN_S" && LN_S="ln -s"
176a31a186aSmrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
177eda3803bSmrgdnl
178a31a186aSmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
179a31a186aSmrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
180a31a186aSmrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
181a31a186aSmrgdnl
182a31a186aSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
183a31a186aSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
184a31a186aSmrgm4_require([_LT_CMD_RELOAD])dnl
185a31a186aSmrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
186a31a186aSmrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
187a31a186aSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
188a31a186aSmrg
189a31a186aSmrg_LT_CONFIG_LIBTOOL_INIT([
190a31a186aSmrg# See if we are running on zsh, and set the options which allow our
191a31a186aSmrg# commands through without removal of \ escapes INIT.
192a31a186aSmrgif test -n "\${ZSH_VERSION+set}" ; then
193a31a186aSmrg   setopt NO_GLOB_SUBST
194a31a186aSmrgfi
195a31a186aSmrg])
196a31a186aSmrgif test -n "${ZSH_VERSION+set}" ; then
197a31a186aSmrg   setopt NO_GLOB_SUBST
198a31a186aSmrgfi
199fe5e51b7Smrg
200a31a186aSmrg_LT_CHECK_OBJDIR
201a31a186aSmrg
202a31a186aSmrgm4_require([_LT_TAG_COMPILER])dnl
203a31a186aSmrg_LT_PROG_ECHO_BACKSLASH
204fe5e51b7Smrg
205fe5e51b7Smrgcase $host_os in
206fe5e51b7Smrgaix3*)
207fe5e51b7Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
208fe5e51b7Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
209fe5e51b7Smrg  # vanish in a puff of smoke.
210fe5e51b7Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
211fe5e51b7Smrg    COLLECT_NAMES=
212fe5e51b7Smrg    export COLLECT_NAMES
213fe5e51b7Smrg  fi
214fe5e51b7Smrg  ;;
215fe5e51b7Smrgesac
216fe5e51b7Smrg
217fe5e51b7Smrg# Sed substitution that helps us do robust quoting.  It backslashifies
218fe5e51b7Smrg# metacharacters that are still active within double-quoted strings.
219a31a186aSmrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
220fe5e51b7Smrg
221fe5e51b7Smrg# Same as above, but do not quote variable references.
222a31a186aSmrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
223fe5e51b7Smrg
224fe5e51b7Smrg# Sed substitution to delay expansion of an escaped shell variable in a
225fe5e51b7Smrg# double_quote_subst'ed string.
226fe5e51b7Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
227fe5e51b7Smrg
228a31a186aSmrg# Sed substitution to delay expansion of an escaped single quote.
229a31a186aSmrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
230a31a186aSmrg
231fe5e51b7Smrg# Sed substitution to avoid accidental globbing in evaled expressions
232fe5e51b7Smrgno_glob_subst='s/\*/\\\*/g'
233fe5e51b7Smrg
234fe5e51b7Smrg# Global variables:
235a31a186aSmrgofile=libtool
236fe5e51b7Smrgcan_build_shared=yes
237fe5e51b7Smrg
238fe5e51b7Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
239fe5e51b7Smrg# which needs '.lib').
240fe5e51b7Smrglibext=a
241fe5e51b7Smrg
242a31a186aSmrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
243643b027fSmrg
244fe5e51b7Smrgold_CC="$CC"
245fe5e51b7Smrgold_CFLAGS="$CFLAGS"
246fe5e51b7Smrg
247fe5e51b7Smrg# Set sane defaults for various variables
248fe5e51b7Smrgtest -z "$CC" && CC=cc
249fe5e51b7Smrgtest -z "$LTCC" && LTCC=$CC
250fe5e51b7Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
251fe5e51b7Smrgtest -z "$LD" && LD=ld
252fe5e51b7Smrgtest -z "$ac_objext" && ac_objext=o
253fe5e51b7Smrg
254fe5e51b7Smrg_LT_CC_BASENAME([$compiler])
255fe5e51b7Smrg
256fe5e51b7Smrg# Only perform the check for file, if the check method requires it
257a31a186aSmrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
258fe5e51b7Smrgcase $deplibs_check_method in
259fe5e51b7Smrgfile_magic*)
260fe5e51b7Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
261a31a186aSmrg    _LT_PATH_MAGIC
262fe5e51b7Smrg  fi
263fe5e51b7Smrg  ;;
264fe5e51b7Smrgesac
265fe5e51b7Smrg
266a31a186aSmrg# Use C for the default configuration in the libtool script
267a31a186aSmrgLT_SUPPORTED_TAG([CC])
268a31a186aSmrg_LT_LANG_C_CONFIG
269a31a186aSmrg_LT_LANG_DEFAULT_CONFIG
270a31a186aSmrg_LT_CONFIG_COMMANDS
271a31a186aSmrg])# _LT_SETUP
272eda3803bSmrg
273eda3803bSmrg
274a31a186aSmrg# _LT_PROG_LTMAIN
275a31a186aSmrg# ---------------
276a31a186aSmrg# Note that this code is called both from `configure', and `config.status'
277a31a186aSmrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
278a31a186aSmrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
279a31a186aSmrg# so we pass a copy along to make sure it has a sensible value anyway.
280a31a186aSmrgm4_defun([_LT_PROG_LTMAIN],
281a31a186aSmrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
282a31a186aSmrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
283a31a186aSmrgltmain="$ac_aux_dir/ltmain.sh"
284a31a186aSmrg])# _LT_PROG_LTMAIN
285eda3803bSmrg
286eda3803bSmrg
287a31a186aSmrg
288a31a186aSmrg# So that we can recreate a full libtool script including additional
289a31a186aSmrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
290a31a186aSmrg# in macros and then make a single call at the end using the `libtool'
291a31a186aSmrg# label.
292a31a186aSmrg
293a31a186aSmrg
294a31a186aSmrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
295a31a186aSmrg# ----------------------------------------
296a31a186aSmrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
297a31a186aSmrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
298a31a186aSmrg[m4_ifval([$1],
299a31a186aSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
300a31a186aSmrg                     [$1
301a31a186aSmrg])])])
302a31a186aSmrg
303a31a186aSmrg# Initialize.
304a31a186aSmrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
305a31a186aSmrg
306a31a186aSmrg
307a31a186aSmrg# _LT_CONFIG_LIBTOOL([COMMANDS])
308a31a186aSmrg# ------------------------------
309a31a186aSmrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
310a31a186aSmrgm4_define([_LT_CONFIG_LIBTOOL],
311a31a186aSmrg[m4_ifval([$1],
312a31a186aSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
313a31a186aSmrg                     [$1
314a31a186aSmrg])])])
315a31a186aSmrg
316a31a186aSmrg# Initialize.
317a31a186aSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
318a31a186aSmrg
319a31a186aSmrg
320a31a186aSmrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
321a31a186aSmrg# -----------------------------------------------------
322a31a186aSmrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
323a31a186aSmrg[_LT_CONFIG_LIBTOOL([$1])
324a31a186aSmrg_LT_CONFIG_LIBTOOL_INIT([$2])
325a31a186aSmrg])
326a31a186aSmrg
327a31a186aSmrg
328a31a186aSmrg# _LT_FORMAT_COMMENT([COMMENT])
329a31a186aSmrg# -----------------------------
330a31a186aSmrg# Add leading comment marks to the start of each line, and a trailing
331a31a186aSmrg# full-stop to the whole comment if one is not present already.
332a31a186aSmrgm4_define([_LT_FORMAT_COMMENT],
333a31a186aSmrg[m4_ifval([$1], [
334a31a186aSmrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
335a31a186aSmrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
336a31a186aSmrg)])
337a31a186aSmrg
338a31a186aSmrg
339a31a186aSmrg
340a31a186aSmrg
341a31a186aSmrg
342a31a186aSmrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
343a31a186aSmrg# -------------------------------------------------------------------
344a31a186aSmrg# CONFIGNAME is the name given to the value in the libtool script.
345a31a186aSmrg# VARNAME is the (base) name used in the configure script.
346a31a186aSmrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
347a31a186aSmrg# VARNAME.  Any other value will be used directly.
348a31a186aSmrgm4_define([_LT_DECL],
349a31a186aSmrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
350a31a186aSmrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
351a31a186aSmrg	[m4_ifval([$1], [$1], [$2])])
352a31a186aSmrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
353a31a186aSmrg    m4_ifval([$4],
354a31a186aSmrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
355a31a186aSmrg    lt_dict_add_subkey([lt_decl_dict], [$2],
356a31a186aSmrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
357a31a186aSmrg])
358a31a186aSmrg
359a31a186aSmrg
360a31a186aSmrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
361a31a186aSmrg# --------------------------------------------------------
362a31a186aSmrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
363a31a186aSmrg
364a31a186aSmrg
365a31a186aSmrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
366a31a186aSmrg# ------------------------------------------------
367a31a186aSmrgm4_define([lt_decl_tag_varnames],
368a31a186aSmrg[_lt_decl_filter([tagged?], [yes], $@)])
369a31a186aSmrg
370a31a186aSmrg
371a31a186aSmrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
372a31a186aSmrg# ---------------------------------------------------------
373a31a186aSmrgm4_define([_lt_decl_filter],
374a31a186aSmrg[m4_case([$#],
375a31a186aSmrg  [0], [m4_fatal([$0: too few arguments: $#])],
376a31a186aSmrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
377a31a186aSmrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
378a31a186aSmrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
379a31a186aSmrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
380a31a186aSmrg])
381a31a186aSmrg
382a31a186aSmrg
383a31a186aSmrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
384a31a186aSmrg# --------------------------------------------------
385a31a186aSmrgm4_define([lt_decl_quote_varnames],
386a31a186aSmrg[_lt_decl_filter([value], [1], $@)])
387a31a186aSmrg
388a31a186aSmrg
389a31a186aSmrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
390a31a186aSmrg# ---------------------------------------------------
391a31a186aSmrgm4_define([lt_decl_dquote_varnames],
392a31a186aSmrg[_lt_decl_filter([value], [2], $@)])
393a31a186aSmrg
394a31a186aSmrg
395a31a186aSmrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
396a31a186aSmrg# ---------------------------------------------------
397a31a186aSmrgm4_define([lt_decl_varnames_tagged],
398a31a186aSmrg[m4_assert([$# <= 2])dnl
399a31a186aSmrg_$0(m4_quote(m4_default([$1], [[, ]])),
400a31a186aSmrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
401a31a186aSmrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
402a31a186aSmrgm4_define([_lt_decl_varnames_tagged],
403a31a186aSmrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
404a31a186aSmrg
405a31a186aSmrg
406a31a186aSmrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
407a31a186aSmrg# ------------------------------------------------
408a31a186aSmrgm4_define([lt_decl_all_varnames],
409a31a186aSmrg[_$0(m4_quote(m4_default([$1], [[, ]])),
410a31a186aSmrg     m4_if([$2], [],
411a31a186aSmrg	   m4_quote(lt_decl_varnames),
412a31a186aSmrg	m4_quote(m4_shift($@))))[]dnl
413a31a186aSmrg])
414a31a186aSmrgm4_define([_lt_decl_all_varnames],
415a31a186aSmrg[lt_join($@, lt_decl_varnames_tagged([$1],
416a31a186aSmrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
417a31a186aSmrg])
418a31a186aSmrg
419a31a186aSmrg
420a31a186aSmrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
421a31a186aSmrg# ------------------------------------
422a31a186aSmrg# Quote a variable value, and forward it to `config.status' so that its
423a31a186aSmrg# declaration there will have the same value as in `configure'.  VARNAME
424a31a186aSmrg# must have a single quote delimited value for this to work.
425a31a186aSmrgm4_define([_LT_CONFIG_STATUS_DECLARE],
426a31a186aSmrg[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
427a31a186aSmrg
428a31a186aSmrg
429a31a186aSmrg# _LT_CONFIG_STATUS_DECLARATIONS
430a31a186aSmrg# ------------------------------
431a31a186aSmrg# We delimit libtool config variables with single quotes, so when
432a31a186aSmrg# we write them to config.status, we have to be sure to quote all
433a31a186aSmrg# embedded single quotes properly.  In configure, this macro expands
434a31a186aSmrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
435a31a186aSmrg#
436a31a186aSmrg#    <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
437a31a186aSmrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
438a31a186aSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
439a31a186aSmrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
440a31a186aSmrg
441a31a186aSmrg
442a31a186aSmrg# _LT_LIBTOOL_TAGS
443a31a186aSmrg# ----------------
444a31a186aSmrg# Output comment and list of tags supported by the script
445a31a186aSmrgm4_defun([_LT_LIBTOOL_TAGS],
446a31a186aSmrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
447a31a186aSmrgavailable_tags="_LT_TAGS"dnl
448a31a186aSmrg])
449a31a186aSmrg
450a31a186aSmrg
451a31a186aSmrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
452a31a186aSmrg# -----------------------------------
453a31a186aSmrg# Extract the dictionary values for VARNAME (optionally with TAG) and
454a31a186aSmrg# expand to a commented shell variable setting:
455a31a186aSmrg#
456a31a186aSmrg#    # Some comment about what VAR is for.
457a31a186aSmrg#    visible_name=$lt_internal_name
458a31a186aSmrgm4_define([_LT_LIBTOOL_DECLARE],
459a31a186aSmrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
460a31a186aSmrg					   [description])))[]dnl
461a31a186aSmrgm4_pushdef([_libtool_name],
462a31a186aSmrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
463a31a186aSmrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
464a31a186aSmrg    [0], [_libtool_name=[$]$1],
465a31a186aSmrg    [1], [_libtool_name=$lt_[]$1],
466a31a186aSmrg    [2], [_libtool_name=$lt_[]$1],
467a31a186aSmrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
468a31a186aSmrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
469a31a186aSmrg])
470a31a186aSmrg
471a31a186aSmrg
472a31a186aSmrg# _LT_LIBTOOL_CONFIG_VARS
473a31a186aSmrg# -----------------------
474a31a186aSmrg# Produce commented declarations of non-tagged libtool config variables
475a31a186aSmrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
476a31a186aSmrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
477a31a186aSmrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
478a31a186aSmrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
479a31a186aSmrg[m4_foreach([_lt_var],
480a31a186aSmrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
481a31a186aSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
482a31a186aSmrg
483a31a186aSmrg
484a31a186aSmrg# _LT_LIBTOOL_TAG_VARS(TAG)
485a31a186aSmrg# -------------------------
486a31a186aSmrgm4_define([_LT_LIBTOOL_TAG_VARS],
487a31a186aSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
488a31a186aSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
489eda3803bSmrg
490eda3803bSmrg
491a31a186aSmrg# _LT_TAGVAR(VARNAME, [TAGNAME])
492a31a186aSmrg# ------------------------------
493a31a186aSmrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
494a31a186aSmrg
495a31a186aSmrg
496a31a186aSmrg# _LT_CONFIG_COMMANDS
497fe5e51b7Smrg# -------------------
498a31a186aSmrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
499a31a186aSmrg# variables for single and double quote escaping we saved from calls
500a31a186aSmrg# to _LT_DECL, we can put quote escaped variables declarations
501a31a186aSmrg# into `config.status', and then the shell code to quote escape them in
502a31a186aSmrg# for loops in `config.status'.  Finally, any additional code accumulated
503a31a186aSmrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
504a31a186aSmrgm4_defun([_LT_CONFIG_COMMANDS],
505a31a186aSmrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
506a31a186aSmrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
507a31a186aSmrg	dnl instead of duplicating it all over again into config.status,
508a31a186aSmrg	dnl then we will have config.status run $CONFIG_LT later, so it
509a31a186aSmrg	dnl needs to know what name is stored there:
510a31a186aSmrg        [AC_CONFIG_COMMANDS([libtool],
511a31a186aSmrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
512a31a186aSmrg    dnl If the libtool generation code is destined for config.status,
513a31a186aSmrg    dnl expand the accumulated commands and init code now:
514a31a186aSmrg    [AC_CONFIG_COMMANDS([libtool],
515a31a186aSmrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
516a31a186aSmrg])#_LT_CONFIG_COMMANDS
517a31a186aSmrg
518a31a186aSmrg
519a31a186aSmrg# Initialize.
520a31a186aSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
521a31a186aSmrg[
522a31a186aSmrg
523a31a186aSmrg# The HP-UX ksh and POSIX shell print the target directory to stdout
524a31a186aSmrg# if CDPATH is set.
525a31a186aSmrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
526a31a186aSmrg
527a31a186aSmrgsed_quote_subst='$sed_quote_subst'
528a31a186aSmrgdouble_quote_subst='$double_quote_subst'
529a31a186aSmrgdelay_variable_subst='$delay_variable_subst'
530a31a186aSmrg_LT_CONFIG_STATUS_DECLARATIONS
531a31a186aSmrgLTCC='$LTCC'
532a31a186aSmrgLTCFLAGS='$LTCFLAGS'
533a31a186aSmrgcompiler='$compiler_DEFAULT'
534a31a186aSmrg
535a31a186aSmrg# Quote evaled strings.
536a31a186aSmrgfor var in lt_decl_all_varnames([[ \
537a31a186aSmrg]], lt_decl_quote_varnames); do
538a31a186aSmrg    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
539a31a186aSmrg    *[[\\\\\\\`\\"\\\$]]*)
540a31a186aSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
541a31a186aSmrg      ;;
542a31a186aSmrg    *)
543a31a186aSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
544a31a186aSmrg      ;;
545a31a186aSmrg    esac
546a31a186aSmrgdone
547a31a186aSmrg
548a31a186aSmrg# Double-quote double-evaled strings.
549a31a186aSmrgfor var in lt_decl_all_varnames([[ \
550a31a186aSmrg]], lt_decl_dquote_varnames); do
551a31a186aSmrg    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
552a31a186aSmrg    *[[\\\\\\\`\\"\\\$]]*)
553a31a186aSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
554a31a186aSmrg      ;;
555a31a186aSmrg    *)
556a31a186aSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
557a31a186aSmrg      ;;
558a31a186aSmrg    esac
559a31a186aSmrgdone
560a31a186aSmrg
561a31a186aSmrg# Fix-up fallback echo if it was mangled by the above quoting rules.
562a31a186aSmrgcase \$lt_ECHO in
563a31a186aSmrg*'\\\[$]0 --fallback-echo"')dnl "
564a31a186aSmrg  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
565a31a186aSmrg  ;;
566a31a186aSmrgesac
567a31a186aSmrg
568a31a186aSmrg_LT_OUTPUT_LIBTOOL_INIT
569a31a186aSmrg])
570a31a186aSmrg
571a31a186aSmrg
572a31a186aSmrg# LT_OUTPUT
573a31a186aSmrg# ---------
574a31a186aSmrg# This macro allows early generation of the libtool script (before
575a31a186aSmrg# AC_OUTPUT is called), incase it is used in configure for compilation
576a31a186aSmrg# tests.
577a31a186aSmrgAC_DEFUN([LT_OUTPUT],
578a31a186aSmrg[: ${CONFIG_LT=./config.lt}
579a31a186aSmrgAC_MSG_NOTICE([creating $CONFIG_LT])
580a31a186aSmrgcat >"$CONFIG_LT" <<_LTEOF
581a31a186aSmrg#! $SHELL
582a31a186aSmrg# Generated by $as_me.
583a31a186aSmrg# Run this file to recreate a libtool stub with the current configuration.
584a31a186aSmrg
585a31a186aSmrglt_cl_silent=false
586a31a186aSmrgSHELL=\${CONFIG_SHELL-$SHELL}
587a31a186aSmrg_LTEOF
588a31a186aSmrg
589a31a186aSmrgcat >>"$CONFIG_LT" <<\_LTEOF
590a31a186aSmrgAS_SHELL_SANITIZE
591a31a186aSmrg_AS_PREPARE
592a31a186aSmrg
593a31a186aSmrgexec AS_MESSAGE_FD>&1
594a31a186aSmrgexec AS_MESSAGE_LOG_FD>>config.log
595a31a186aSmrg{
596a31a186aSmrg  echo
597a31a186aSmrg  AS_BOX([Running $as_me.])
598a31a186aSmrg} >&AS_MESSAGE_LOG_FD
599a31a186aSmrg
600a31a186aSmrglt_cl_help="\
601a31a186aSmrg\`$as_me' creates a local libtool stub from the current configuration,
602a31a186aSmrgfor use in further configure time tests before the real libtool is
603a31a186aSmrggenerated.
604a31a186aSmrg
605a31a186aSmrgUsage: $[0] [[OPTIONS]]
606a31a186aSmrg
607a31a186aSmrg  -h, --help      print this help, then exit
608a31a186aSmrg  -V, --version   print version number, then exit
609a31a186aSmrg  -q, --quiet     do not print progress messages
610a31a186aSmrg  -d, --debug     don't remove temporary files
611a31a186aSmrg
612a31a186aSmrgReport bugs to <bug-libtool@gnu.org>."
613a31a186aSmrg
614a31a186aSmrglt_cl_version="\
615a31a186aSmrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
616a31a186aSmrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
617a31a186aSmrgconfigured by $[0], generated by m4_PACKAGE_STRING.
618a31a186aSmrg
619a31a186aSmrgCopyright (C) 2008 Free Software Foundation, Inc.
620a31a186aSmrgThis config.lt script is free software; the Free Software Foundation
621a31a186aSmrggives unlimited permision to copy, distribute and modify it."
622a31a186aSmrg
623a31a186aSmrgwhile test $[#] != 0
624a31a186aSmrgdo
625a31a186aSmrg  case $[1] in
626a31a186aSmrg    --version | --v* | -V )
627a31a186aSmrg      echo "$lt_cl_version"; exit 0 ;;
628a31a186aSmrg    --help | --h* | -h )
629a31a186aSmrg      echo "$lt_cl_help"; exit 0 ;;
630a31a186aSmrg    --debug | --d* | -d )
631a31a186aSmrg      debug=: ;;
632a31a186aSmrg    --quiet | --q* | --silent | --s* | -q )
633a31a186aSmrg      lt_cl_silent=: ;;
634a31a186aSmrg
635a31a186aSmrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
636a31a186aSmrgTry \`$[0] --help' for more information.]) ;;
637a31a186aSmrg
638a31a186aSmrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
639a31a186aSmrgTry \`$[0] --help' for more information.]) ;;
640a31a186aSmrg  esac
641a31a186aSmrg  shift
642a31a186aSmrgdone
643a31a186aSmrg
644a31a186aSmrgif $lt_cl_silent; then
645a31a186aSmrg  exec AS_MESSAGE_FD>/dev/null
646a31a186aSmrgfi
647a31a186aSmrg_LTEOF
648a31a186aSmrg
649a31a186aSmrgcat >>"$CONFIG_LT" <<_LTEOF
650a31a186aSmrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
651a31a186aSmrg_LTEOF
652a31a186aSmrg
653a31a186aSmrgcat >>"$CONFIG_LT" <<\_LTEOF
654a31a186aSmrgAC_MSG_NOTICE([creating $ofile])
655a31a186aSmrg_LT_OUTPUT_LIBTOOL_COMMANDS
656a31a186aSmrgAS_EXIT(0)
657a31a186aSmrg_LTEOF
658a31a186aSmrgchmod +x "$CONFIG_LT"
659a31a186aSmrg
660a31a186aSmrg# configure is writing to config.log, but config.lt does its own redirection,
661a31a186aSmrg# appending to config.log, which fails on DOS, as config.log is still kept
662a31a186aSmrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
663a31a186aSmrg# config.log, so it can be properly (re)opened and appended to by config.lt.
664a31a186aSmrgif test "$no_create" != yes; then
665a31a186aSmrg  lt_cl_success=:
666a31a186aSmrg  test "$silent" = yes &&
667a31a186aSmrg    lt_config_lt_args="$lt_config_lt_args --quiet"
668a31a186aSmrg  exec AS_MESSAGE_LOG_FD>/dev/null
669a31a186aSmrg  $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
670a31a186aSmrg  exec AS_MESSAGE_LOG_FD>>config.log
671a31a186aSmrg  $lt_cl_success || AS_EXIT(1)
672a31a186aSmrgfi
673a31a186aSmrg])# LT_OUTPUT
674a31a186aSmrg
675a31a186aSmrg
676a31a186aSmrg# _LT_CONFIG(TAG)
677a31a186aSmrg# ---------------
678a31a186aSmrg# If TAG is the built-in tag, create an initial libtool script with a
679a31a186aSmrg# default configuration from the untagged config vars.  Otherwise add code
680a31a186aSmrg# to config.status for appending the configuration named by TAG from the
681a31a186aSmrg# matching tagged config vars.
682a31a186aSmrgm4_defun([_LT_CONFIG],
683a31a186aSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
684a31a186aSmrg_LT_CONFIG_SAVE_COMMANDS([
685a31a186aSmrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
686a31a186aSmrg  m4_if(_LT_TAG, [C], [
687a31a186aSmrg    # See if we are running on zsh, and set the options which allow our
688a31a186aSmrg    # commands through without removal of \ escapes.
689a31a186aSmrg    if test -n "${ZSH_VERSION+set}" ; then
690a31a186aSmrg      setopt NO_GLOB_SUBST
691a31a186aSmrg    fi
692a31a186aSmrg
693a31a186aSmrg    cfgfile="${ofile}T"
694a31a186aSmrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
695a31a186aSmrg    $RM "$cfgfile"
696a31a186aSmrg
697a31a186aSmrg    cat <<_LT_EOF >> "$cfgfile"
698a31a186aSmrg#! $SHELL
699a31a186aSmrg
700a31a186aSmrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
701a31a186aSmrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
702a31a186aSmrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
703a31a186aSmrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
704a31a186aSmrg#
705a31a186aSmrg_LT_COPYING
706a31a186aSmrg_LT_LIBTOOL_TAGS
707a31a186aSmrg
708a31a186aSmrg# ### BEGIN LIBTOOL CONFIG
709a31a186aSmrg_LT_LIBTOOL_CONFIG_VARS
710a31a186aSmrg_LT_LIBTOOL_TAG_VARS
711a31a186aSmrg# ### END LIBTOOL CONFIG
712a31a186aSmrg
713a31a186aSmrg_LT_EOF
714a31a186aSmrg
715a31a186aSmrg  case $host_os in
716a31a186aSmrg  aix3*)
717a31a186aSmrg    cat <<\_LT_EOF >> "$cfgfile"
718a31a186aSmrg# AIX sometimes has problems with the GCC collect2 program.  For some
719a31a186aSmrg# reason, if we set the COLLECT_NAMES environment variable, the problems
720a31a186aSmrg# vanish in a puff of smoke.
721a31a186aSmrgif test "X${COLLECT_NAMES+set}" != Xset; then
722a31a186aSmrg  COLLECT_NAMES=
723a31a186aSmrg  export COLLECT_NAMES
724a31a186aSmrgfi
725a31a186aSmrg_LT_EOF
726a31a186aSmrg    ;;
727a31a186aSmrg  esac
728a31a186aSmrg
729a31a186aSmrg  _LT_PROG_LTMAIN
730a31a186aSmrg
731a31a186aSmrg  # We use sed instead of cat because bash on DJGPP gets confused if
732a31a186aSmrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
733a31a186aSmrg  # text mode, it properly converts lines to CR/LF.  This bash problem
734a31a186aSmrg  # is reportedly fixed, but why not run on old versions too?
735a31a186aSmrg  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
736a31a186aSmrg    || (rm -f "$cfgfile"; exit 1)
737a31a186aSmrg
738a31a186aSmrg  _LT_PROG_XSI_SHELLFNS
739a31a186aSmrg
740a31a186aSmrg  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
741a31a186aSmrg    || (rm -f "$cfgfile"; exit 1)
742a31a186aSmrg
743a31a186aSmrg  mv -f "$cfgfile" "$ofile" ||
744a31a186aSmrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
745a31a186aSmrg  chmod +x "$ofile"
746a31a186aSmrg],
747a31a186aSmrg[cat <<_LT_EOF >> "$ofile"
748a31a186aSmrg
749a31a186aSmrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
750a31a186aSmrgdnl in a comment (ie after a #).
751a31a186aSmrg# ### BEGIN LIBTOOL TAG CONFIG: $1
752a31a186aSmrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
753a31a186aSmrg# ### END LIBTOOL TAG CONFIG: $1
754a31a186aSmrg_LT_EOF
755a31a186aSmrg])dnl /m4_if
756a31a186aSmrg],
757a31a186aSmrg[m4_if([$1], [], [
758a31a186aSmrg    PACKAGE='$PACKAGE'
759a31a186aSmrg    VERSION='$VERSION'
760a31a186aSmrg    TIMESTAMP='$TIMESTAMP'
761a31a186aSmrg    RM='$RM'
762a31a186aSmrg    ofile='$ofile'], [])
763a31a186aSmrg])dnl /_LT_CONFIG_SAVE_COMMANDS
764a31a186aSmrg])# _LT_CONFIG
765a31a186aSmrg
766a31a186aSmrg
767a31a186aSmrg# LT_SUPPORTED_TAG(TAG)
768a31a186aSmrg# ---------------------
769a31a186aSmrg# Trace this macro to discover what tags are supported by the libtool
770a31a186aSmrg# --tag option, using:
771a31a186aSmrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
772a31a186aSmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
773a31a186aSmrg
774a31a186aSmrg
775a31a186aSmrg# C support is built-in for now
776a31a186aSmrgm4_define([_LT_LANG_C_enabled], [])
777a31a186aSmrgm4_define([_LT_TAGS], [])
778a31a186aSmrg
779a31a186aSmrg
780a31a186aSmrg# LT_LANG(LANG)
781a31a186aSmrg# -------------
782a31a186aSmrg# Enable libtool support for the given language if not already enabled.
783a31a186aSmrgAC_DEFUN([LT_LANG],
784a31a186aSmrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
785a31a186aSmrgm4_case([$1],
786a31a186aSmrg  [C],			[_LT_LANG(C)],
787a31a186aSmrg  [C++],		[_LT_LANG(CXX)],
788a31a186aSmrg  [Java],		[_LT_LANG(GCJ)],
789a31a186aSmrg  [Fortran 77],		[_LT_LANG(F77)],
790a31a186aSmrg  [Fortran],		[_LT_LANG(FC)],
791a31a186aSmrg  [Windows Resource],	[_LT_LANG(RC)],
792a31a186aSmrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
793a31a186aSmrg    [_LT_LANG($1)],
794a31a186aSmrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
795a31a186aSmrg])# LT_LANG
796a31a186aSmrg
797a31a186aSmrg
798a31a186aSmrg# _LT_LANG(LANGNAME)
799a31a186aSmrg# ------------------
800a31a186aSmrgm4_defun([_LT_LANG],
801a31a186aSmrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
802a31a186aSmrg  [LT_SUPPORTED_TAG([$1])dnl
803a31a186aSmrg  m4_append([_LT_TAGS], [$1 ])dnl
804a31a186aSmrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
805a31a186aSmrg  _LT_LANG_$1_CONFIG($1)])dnl
806a31a186aSmrg])# _LT_LANG
807a31a186aSmrg
808a31a186aSmrg
809a31a186aSmrg# _LT_LANG_DEFAULT_CONFIG
810a31a186aSmrg# -----------------------
811a31a186aSmrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
812a31a186aSmrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
813a31a186aSmrg  [LT_LANG(CXX)],
814a31a186aSmrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
815a31a186aSmrg
816a31a186aSmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
817a31a186aSmrg  [LT_LANG(F77)],
818a31a186aSmrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
819a31a186aSmrg
820a31a186aSmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
821a31a186aSmrg  [LT_LANG(FC)],
822a31a186aSmrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
823a31a186aSmrg
824a31a186aSmrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
825a31a186aSmrgdnl pulling things in needlessly.
826a31a186aSmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
827a31a186aSmrg  [LT_LANG(GCJ)],
828a31a186aSmrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
829a31a186aSmrg    [LT_LANG(GCJ)],
830a31a186aSmrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
831a31a186aSmrg      [LT_LANG(GCJ)],
832a31a186aSmrg      [m4_ifdef([AC_PROG_GCJ],
833a31a186aSmrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
834a31a186aSmrg       m4_ifdef([A][M_PROG_GCJ],
835a31a186aSmrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
836a31a186aSmrg       m4_ifdef([LT_PROG_GCJ],
837a31a186aSmrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
838a31a186aSmrg
839a31a186aSmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
840a31a186aSmrg  [LT_LANG(RC)],
841a31a186aSmrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
842a31a186aSmrg])# _LT_LANG_DEFAULT_CONFIG
843a31a186aSmrg
844a31a186aSmrg# Obsolete macros:
845a31a186aSmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
846a31a186aSmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
847a31a186aSmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
848a31a186aSmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
849a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
850a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
851a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
852a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
853a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
854a31a186aSmrg
855a31a186aSmrg
856a31a186aSmrg# _LT_TAG_COMPILER
857a31a186aSmrg# ----------------
858a31a186aSmrgm4_defun([_LT_TAG_COMPILER],
859fe5e51b7Smrg[AC_REQUIRE([AC_PROG_CC])dnl
860fe5e51b7Smrg
861a31a186aSmrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
862a31a186aSmrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
863a31a186aSmrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
864a31a186aSmrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
865a31a186aSmrg
866fe5e51b7Smrg# If no C compiler was specified, use CC.
867fe5e51b7SmrgLTCC=${LTCC-"$CC"}
868fe5e51b7Smrg
869fe5e51b7Smrg# If no C compiler flags were specified, use CFLAGS.
870fe5e51b7SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
871fe5e51b7Smrg
872fe5e51b7Smrg# Allow CC to be a program name with arguments.
873fe5e51b7Smrgcompiler=$CC
874a31a186aSmrg])# _LT_TAG_COMPILER
875fe5e51b7Smrg
876fe5e51b7Smrg
877fe5e51b7Smrg# _LT_COMPILER_BOILERPLATE
878fe5e51b7Smrg# ------------------------
879fe5e51b7Smrg# Check for compiler boilerplate output or warnings with
880fe5e51b7Smrg# the simple compiler test code.
881a31a186aSmrgm4_defun([_LT_COMPILER_BOILERPLATE],
882a31a186aSmrg[m4_require([_LT_DECL_SED])dnl
883fe5e51b7Smrgac_outfile=conftest.$ac_objext
884fe5e51b7Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
885fe5e51b7Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
886fe5e51b7Smrg_lt_compiler_boilerplate=`cat conftest.err`
887a31a186aSmrg$RM conftest*
888fe5e51b7Smrg])# _LT_COMPILER_BOILERPLATE
889fe5e51b7Smrg
890fe5e51b7Smrg
891fe5e51b7Smrg# _LT_LINKER_BOILERPLATE
892fe5e51b7Smrg# ----------------------
893fe5e51b7Smrg# Check for linker boilerplate output or warnings with
894fe5e51b7Smrg# the simple link test code.
895a31a186aSmrgm4_defun([_LT_LINKER_BOILERPLATE],
896a31a186aSmrg[m4_require([_LT_DECL_SED])dnl
897fe5e51b7Smrgac_outfile=conftest.$ac_objext
898fe5e51b7Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
899fe5e51b7Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
900fe5e51b7Smrg_lt_linker_boilerplate=`cat conftest.err`
901a31a186aSmrg$RM -r conftest*
902fe5e51b7Smrg])# _LT_LINKER_BOILERPLATE
903fe5e51b7Smrg
904eda3803bSmrg# _LT_REQUIRED_DARWIN_CHECKS
905a31a186aSmrg# -------------------------
906a31a186aSmrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
907eda3803bSmrg  case $host_os in
908eda3803bSmrg    rhapsody* | darwin*)
909eda3803bSmrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
910eda3803bSmrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
911a31a186aSmrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
912a31a186aSmrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
913a31a186aSmrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
914a31a186aSmrg    _LT_DECL([], [DSYMUTIL], [1],
915a31a186aSmrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
916a31a186aSmrg    _LT_DECL([], [NMEDIT], [1],
917a31a186aSmrg      [Tool to change global to local symbols on Mac OS X])
918a31a186aSmrg    _LT_DECL([], [LIPO], [1],
919a31a186aSmrg      [Tool to manipulate fat objects and archives on Mac OS X])
920a31a186aSmrg    _LT_DECL([], [OTOOL], [1],
921a31a186aSmrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
922a31a186aSmrg    _LT_DECL([], [OTOOL64], [1],
923a31a186aSmrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
924eda3803bSmrg
925eda3803bSmrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
926eda3803bSmrg      [lt_cv_apple_cc_single_mod=no
927eda3803bSmrg      if test -z "${LT_MULTI_MODULE}"; then
928a31a186aSmrg	# By default we will add the -single_module flag. You can override
929a31a186aSmrg	# by either setting the environment variable LT_MULTI_MODULE
930a31a186aSmrg	# non-empty at configure time, or by adding -multi_module to the
931a31a186aSmrg	# link flags.
932a31a186aSmrg	rm -rf libconftest.dylib*
933a31a186aSmrg	echo "int foo(void){return 1;}" > conftest.c
934a31a186aSmrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
935a31a186aSmrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
936a31a186aSmrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
937a31a186aSmrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
938a31a186aSmrg        _lt_result=$?
939a31a186aSmrg	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
940a31a186aSmrg	  lt_cv_apple_cc_single_mod=yes
941a31a186aSmrg	else
942a31a186aSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
943a31a186aSmrg	fi
944a31a186aSmrg	rm -rf libconftest.dylib*
945a31a186aSmrg	rm -f conftest.*
946eda3803bSmrg      fi])
947eda3803bSmrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
948eda3803bSmrg      [lt_cv_ld_exported_symbols_list],
949eda3803bSmrg      [lt_cv_ld_exported_symbols_list=no
950eda3803bSmrg      save_LDFLAGS=$LDFLAGS
951eda3803bSmrg      echo "_main" > conftest.sym
952eda3803bSmrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
953eda3803bSmrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
954a31a186aSmrg	[lt_cv_ld_exported_symbols_list=yes],
955a31a186aSmrg	[lt_cv_ld_exported_symbols_list=no])
956a31a186aSmrg	LDFLAGS="$save_LDFLAGS"
957eda3803bSmrg    ])
958eda3803bSmrg    case $host_os in
959a31a186aSmrg    rhapsody* | darwin1.[[012]])
960eda3803bSmrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
961eda3803bSmrg    darwin1.*)
962a31a186aSmrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
963a31a186aSmrg    darwin*) # darwin 5.x on
964eda3803bSmrg      # if running on 10.5 or later, the deployment target defaults
965eda3803bSmrg      # to the OS version, if on x86, and 10.4, the deployment
966eda3803bSmrg      # target defaults to 10.4. Don't you love it?
967eda3803bSmrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
968a31a186aSmrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
969a31a186aSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
970a31a186aSmrg	10.[[012]]*)
971a31a186aSmrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
972a31a186aSmrg	10.*)
973a31a186aSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
974eda3803bSmrg      esac
975eda3803bSmrg    ;;
976eda3803bSmrg  esac
977eda3803bSmrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
978eda3803bSmrg      _lt_dar_single_mod='$single_module'
979eda3803bSmrg    fi
980eda3803bSmrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
981eda3803bSmrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
982eda3803bSmrg    else
983a31a186aSmrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
984eda3803bSmrg    fi
985eda3803bSmrg    if test "$DSYMUTIL" != ":"; then
986a31a186aSmrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
987eda3803bSmrg    else
988eda3803bSmrg      _lt_dsymutil=
989eda3803bSmrg    fi
990eda3803bSmrg    ;;
991eda3803bSmrg  esac
992eda3803bSmrg])
993eda3803bSmrg
994a31a186aSmrg
995a31a186aSmrg# _LT_DARWIN_LINKER_FEATURES
996a31a186aSmrg# --------------------------
997a31a186aSmrg# Checks for linker and compiler features on darwin
998a31a186aSmrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
999a31a186aSmrg[
1000a31a186aSmrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1001a31a186aSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1002a31a186aSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
1003a31a186aSmrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
1004a31a186aSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1005a31a186aSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1006a31a186aSmrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
1007a31a186aSmrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
1008a31a186aSmrg  case $cc_basename in
1009a31a186aSmrg     ifort*) _lt_dar_can_shared=yes ;;
1010a31a186aSmrg     *) _lt_dar_can_shared=$GCC ;;
1011a31a186aSmrg  esac
1012a31a186aSmrg  if test "$_lt_dar_can_shared" = "yes"; then
1013a31a186aSmrg    output_verbose_link_cmd=echo
1014a31a186aSmrg    _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}"
1015a31a186aSmrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
1016a31a186aSmrg    _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}"
1017a31a186aSmrg    _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}"
1018a31a186aSmrg    m4_if([$1], [CXX],
1019a31a186aSmrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
1020a31a186aSmrg      _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}"
1021a31a186aSmrg      _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}"
1022a31a186aSmrg    fi
1023a31a186aSmrg],[])
1024a31a186aSmrg  else
1025a31a186aSmrg  _LT_TAGVAR(ld_shlibs, $1)=no
1026a31a186aSmrg  fi
1027a31a186aSmrg])
1028a31a186aSmrg
1029a31a186aSmrg# _LT_SYS_MODULE_PATH_AIX
1030a31a186aSmrg# -----------------------
1031fe5e51b7Smrg# Links a minimal program and checks the executable
1032fe5e51b7Smrg# for the system default hardcoded library path. In most cases,
1033fe5e51b7Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
1034fe5e51b7Smrg# the location of the communication and MPI libs are included too.
1035fe5e51b7Smrg# If we don't find anything, use the default library path according
1036fe5e51b7Smrg# to the aix ld manual.
1037a31a186aSmrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
1038a31a186aSmrg[m4_require([_LT_DECL_SED])dnl
1039fe5e51b7SmrgAC_LINK_IFELSE(AC_LANG_PROGRAM,[
1040fe5e51b7Smrglt_aix_libpath_sed='
1041fe5e51b7Smrg    /Import File Strings/,/^$/ {
1042fe5e51b7Smrg	/^0/ {
1043fe5e51b7Smrg	    s/^0  *\(.*\)$/\1/
1044fe5e51b7Smrg	    p
1045fe5e51b7Smrg	}
1046fe5e51b7Smrg    }'
1047fe5e51b7Smrgaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1048fe5e51b7Smrg# Check for a 64-bit object if we didn't find anything.
1049fe5e51b7Smrgif test -z "$aix_libpath"; then
1050fe5e51b7Smrg  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1051fe5e51b7Smrgfi],[])
1052fe5e51b7Smrgif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
1053a31a186aSmrg])# _LT_SYS_MODULE_PATH_AIX
1054fe5e51b7Smrg
1055fe5e51b7Smrg
1056a31a186aSmrg# _LT_SHELL_INIT(ARG)
1057a31a186aSmrg# -------------------
1058a31a186aSmrgm4_define([_LT_SHELL_INIT],
1059fe5e51b7Smrg[ifdef([AC_DIVERSION_NOTICE],
1060fe5e51b7Smrg	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
1061fe5e51b7Smrg	 [AC_DIVERT_PUSH(NOTICE)])
1062fe5e51b7Smrg$1
1063fe5e51b7SmrgAC_DIVERT_POP
1064a31a186aSmrg])# _LT_SHELL_INIT
1065fe5e51b7Smrg
1066fe5e51b7Smrg
1067a31a186aSmrg# _LT_PROG_ECHO_BACKSLASH
1068a31a186aSmrg# -----------------------
1069fe5e51b7Smrg# Add some code to the start of the generated configure script which
1070fe5e51b7Smrg# will find an echo command which doesn't interpret backslashes.
1071a31a186aSmrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
1072a31a186aSmrg[_LT_SHELL_INIT([
1073fe5e51b7Smrg# Check that we are running under the correct shell.
1074fe5e51b7SmrgSHELL=${CONFIG_SHELL-/bin/sh}
1075fe5e51b7Smrg
1076a31a186aSmrgcase X$lt_ECHO in
1077fe5e51b7SmrgX*--fallback-echo)
1078fe5e51b7Smrg  # Remove one level of quotation (which was required for Make).
1079a31a186aSmrg  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
1080fe5e51b7Smrg  ;;
1081fe5e51b7Smrgesac
1082fe5e51b7Smrg
1083a31a186aSmrgECHO=${lt_ECHO-echo}
1084fe5e51b7Smrgif test "X[$]1" = X--no-reexec; then
1085fe5e51b7Smrg  # Discard the --no-reexec flag, and continue.
1086fe5e51b7Smrg  shift
1087fe5e51b7Smrgelif test "X[$]1" = X--fallback-echo; then
1088fe5e51b7Smrg  # Avoid inline document here, it may be left over
1089fe5e51b7Smrg  :
1090a31a186aSmrgelif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
1091a31a186aSmrg  # Yippee, $ECHO works!
1092fe5e51b7Smrg  :
1093fe5e51b7Smrgelse
1094fe5e51b7Smrg  # Restart under the correct shell.
1095fe5e51b7Smrg  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
1096fe5e51b7Smrgfi
1097fe5e51b7Smrg
1098fe5e51b7Smrgif test "X[$]1" = X--fallback-echo; then
1099fe5e51b7Smrg  # used as fallback echo
1100fe5e51b7Smrg  shift
1101a31a186aSmrg  cat <<_LT_EOF
1102fe5e51b7Smrg[$]*
1103a31a186aSmrg_LT_EOF
1104fe5e51b7Smrg  exit 0
1105fe5e51b7Smrgfi
1106fe5e51b7Smrg
1107fe5e51b7Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
1108fe5e51b7Smrg# if CDPATH is set.
1109fe5e51b7Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1110fe5e51b7Smrg
1111a31a186aSmrgif test -z "$lt_ECHO"; then
1112a31a186aSmrg  if test "X${echo_test_string+set}" != Xset; then
1113a31a186aSmrg    # find a string as large as possible, as long as the shell can cope with it
1114a31a186aSmrg    for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
1115a31a186aSmrg      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
1116a31a186aSmrg      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
1117a31a186aSmrg	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
1118a31a186aSmrg      then
1119a31a186aSmrg        break
1120a31a186aSmrg      fi
1121a31a186aSmrg    done
1122a31a186aSmrg  fi
1123fe5e51b7Smrg
1124a31a186aSmrg  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
1125a31a186aSmrg     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
1126a31a186aSmrg     test "X$echo_testing_string" = "X$echo_test_string"; then
1127a31a186aSmrg    :
1128a31a186aSmrg  else
1129a31a186aSmrg    # The Solaris, AIX, and Digital Unix default echo programs unquote
1130a31a186aSmrg    # backslashes.  This makes it impossible to quote backslashes using
1131a31a186aSmrg    #   echo "$something" | sed 's/\\/\\\\/g'
1132a31a186aSmrg    #
1133a31a186aSmrg    # So, first we look for a working echo in the user's PATH.
1134fe5e51b7Smrg
1135a31a186aSmrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
1136a31a186aSmrg    for dir in $PATH /usr/ucb; do
1137a31a186aSmrg      IFS="$lt_save_ifs"
1138a31a186aSmrg      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
1139a31a186aSmrg         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
1140a31a186aSmrg         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
1141a31a186aSmrg         test "X$echo_testing_string" = "X$echo_test_string"; then
1142a31a186aSmrg        ECHO="$dir/echo"
1143a31a186aSmrg        break
1144a31a186aSmrg      fi
1145a31a186aSmrg    done
1146fe5e51b7Smrg    IFS="$lt_save_ifs"
1147fe5e51b7Smrg
1148a31a186aSmrg    if test "X$ECHO" = Xecho; then
1149a31a186aSmrg      # We didn't find a better echo, so look for alternatives.
1150a31a186aSmrg      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
1151a31a186aSmrg         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
1152a31a186aSmrg         test "X$echo_testing_string" = "X$echo_test_string"; then
1153a31a186aSmrg        # This shell has a builtin print -r that does the trick.
1154a31a186aSmrg        ECHO='print -r'
1155a31a186aSmrg      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
1156a31a186aSmrg	   test "X$CONFIG_SHELL" != X/bin/ksh; then
1157a31a186aSmrg        # If we have ksh, try running configure again with it.
1158a31a186aSmrg        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
1159a31a186aSmrg        export ORIGINAL_CONFIG_SHELL
1160a31a186aSmrg        CONFIG_SHELL=/bin/ksh
1161a31a186aSmrg        export CONFIG_SHELL
1162a31a186aSmrg        exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
1163643b027fSmrg      else
1164a31a186aSmrg        # Try using printf.
1165a31a186aSmrg        ECHO='printf %s\n'
1166a31a186aSmrg        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
1167a31a186aSmrg	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
1168a31a186aSmrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
1169a31a186aSmrg	  # Cool, printf works
1170a31a186aSmrg	  :
1171a31a186aSmrg        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1172a31a186aSmrg	     test "X$echo_testing_string" = 'X\t' &&
1173a31a186aSmrg	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1174a31a186aSmrg	     test "X$echo_testing_string" = "X$echo_test_string"; then
1175a31a186aSmrg	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
1176a31a186aSmrg	  export CONFIG_SHELL
1177a31a186aSmrg	  SHELL="$CONFIG_SHELL"
1178a31a186aSmrg	  export SHELL
1179a31a186aSmrg	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
1180a31a186aSmrg        elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1181a31a186aSmrg	     test "X$echo_testing_string" = 'X\t' &&
1182a31a186aSmrg	     echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1183a31a186aSmrg	     test "X$echo_testing_string" = "X$echo_test_string"; then
1184a31a186aSmrg	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
1185a31a186aSmrg        else
1186a31a186aSmrg	  # maybe with a smaller string...
1187a31a186aSmrg	  prev=:
1188fe5e51b7Smrg
1189a31a186aSmrg	  for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
1190a31a186aSmrg	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
1191a31a186aSmrg	    then
1192a31a186aSmrg	      break
1193a31a186aSmrg	    fi
1194a31a186aSmrg	    prev="$cmd"
1195a31a186aSmrg	  done
1196643b027fSmrg
1197a31a186aSmrg	  if test "$prev" != 'sed 50q "[$]0"'; then
1198a31a186aSmrg	    echo_test_string=`eval $prev`
1199a31a186aSmrg	    export echo_test_string
1200a31a186aSmrg	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
1201a31a186aSmrg	  else
1202a31a186aSmrg	    # Oops.  We lost completely, so just stick with echo.
1203a31a186aSmrg	    ECHO=echo
1204a31a186aSmrg	  fi
1205a31a186aSmrg        fi
1206fe5e51b7Smrg      fi
1207fe5e51b7Smrg    fi
1208fe5e51b7Smrg  fi
1209fe5e51b7Smrgfi
1210fe5e51b7Smrg
1211fe5e51b7Smrg# Copy echo and quote the copy suitably for passing to libtool from
1212fe5e51b7Smrg# the Makefile, instead of quoting the original, which is used later.
1213a31a186aSmrglt_ECHO=$ECHO
1214a31a186aSmrgif test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
1215a31a186aSmrg   lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
1216fe5e51b7Smrgfi
1217fe5e51b7Smrg
1218a31a186aSmrgAC_SUBST(lt_ECHO)
1219a31a186aSmrg])
1220a31a186aSmrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1221a31a186aSmrg_LT_DECL([], [ECHO], [1],
1222a31a186aSmrg    [An echo program that does not interpret backslashes])
1223a31a186aSmrg])# _LT_PROG_ECHO_BACKSLASH
1224fe5e51b7Smrg
1225fe5e51b7Smrg
1226a31a186aSmrg# _LT_ENABLE_LOCK
1227a31a186aSmrg# ---------------
1228a31a186aSmrgm4_defun([_LT_ENABLE_LOCK],
1229fe5e51b7Smrg[AC_ARG_ENABLE([libtool-lock],
1230a31a186aSmrg  [AS_HELP_STRING([--disable-libtool-lock],
1231a31a186aSmrg    [avoid locking (might break parallel builds)])])
1232fe5e51b7Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1233fe5e51b7Smrg
1234fe5e51b7Smrg# Some flags need to be propagated to the compiler or linker for good
1235fe5e51b7Smrg# libtool support.
1236fe5e51b7Smrgcase $host in
1237fe5e51b7Smrgia64-*-hpux*)
1238fe5e51b7Smrg  # Find out which ABI we are using.
1239fe5e51b7Smrg  echo 'int i;' > conftest.$ac_ext
1240fe5e51b7Smrg  if AC_TRY_EVAL(ac_compile); then
1241fe5e51b7Smrg    case `/usr/bin/file conftest.$ac_objext` in
1242a31a186aSmrg      *ELF-32*)
1243a31a186aSmrg	HPUX_IA64_MODE="32"
1244a31a186aSmrg	;;
1245a31a186aSmrg      *ELF-64*)
1246a31a186aSmrg	HPUX_IA64_MODE="64"
1247a31a186aSmrg	;;
1248fe5e51b7Smrg    esac
1249fe5e51b7Smrg  fi
1250fe5e51b7Smrg  rm -rf conftest*
1251fe5e51b7Smrg  ;;
1252fe5e51b7Smrg*-*-irix6*)
1253fe5e51b7Smrg  # Find out which ABI we are using.
1254fe5e51b7Smrg  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1255fe5e51b7Smrg  if AC_TRY_EVAL(ac_compile); then
1256a31a186aSmrg    if test "$lt_cv_prog_gnu_ld" = yes; then
1257a31a186aSmrg      case `/usr/bin/file conftest.$ac_objext` in
1258a31a186aSmrg	*32-bit*)
1259a31a186aSmrg	  LD="${LD-ld} -melf32bsmip"
1260a31a186aSmrg	  ;;
1261a31a186aSmrg	*N32*)
1262a31a186aSmrg	  LD="${LD-ld} -melf32bmipn32"
1263a31a186aSmrg	  ;;
1264a31a186aSmrg	*64-bit*)
1265a31a186aSmrg	  LD="${LD-ld} -melf64bmip"
1266a31a186aSmrg	;;
1267a31a186aSmrg      esac
1268a31a186aSmrg    else
1269a31a186aSmrg      case `/usr/bin/file conftest.$ac_objext` in
1270a31a186aSmrg	*32-bit*)
1271a31a186aSmrg	  LD="${LD-ld} -32"
1272a31a186aSmrg	  ;;
1273a31a186aSmrg	*N32*)
1274a31a186aSmrg	  LD="${LD-ld} -n32"
1275a31a186aSmrg	  ;;
1276a31a186aSmrg	*64-bit*)
1277a31a186aSmrg	  LD="${LD-ld} -64"
1278a31a186aSmrg	  ;;
1279a31a186aSmrg      esac
1280a31a186aSmrg    fi
1281fe5e51b7Smrg  fi
1282fe5e51b7Smrg  rm -rf conftest*
1283fe5e51b7Smrg  ;;
1284fe5e51b7Smrg
1285fe5e51b7Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
1286a31a186aSmrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1287fe5e51b7Smrg  # Find out which ABI we are using.
1288fe5e51b7Smrg  echo 'int i;' > conftest.$ac_ext
1289fe5e51b7Smrg  if AC_TRY_EVAL(ac_compile); then
1290fe5e51b7Smrg    case `/usr/bin/file conftest.o` in
1291a31a186aSmrg      *32-bit*)
1292a31a186aSmrg	case $host in
1293a31a186aSmrg	  x86_64-*kfreebsd*-gnu)
1294a31a186aSmrg	    LD="${LD-ld} -m elf_i386_fbsd"
1295a31a186aSmrg	    ;;
1296a31a186aSmrg	  x86_64-*linux*)
1297a31a186aSmrg	    LD="${LD-ld} -m elf_i386"
1298a31a186aSmrg	    ;;
1299a31a186aSmrg	  ppc64-*linux*|powerpc64-*linux*)
1300a31a186aSmrg	    LD="${LD-ld} -m elf32ppclinux"
1301a31a186aSmrg	    ;;
1302a31a186aSmrg	  s390x-*linux*)
1303a31a186aSmrg	    LD="${LD-ld} -m elf_s390"
1304a31a186aSmrg	    ;;
1305a31a186aSmrg	  sparc64-*linux*)
1306a31a186aSmrg	    LD="${LD-ld} -m elf32_sparc"
1307a31a186aSmrg	    ;;
1308a31a186aSmrg	esac
1309a31a186aSmrg	;;
1310a31a186aSmrg      *64-bit*)
1311a31a186aSmrg	case $host in
1312a31a186aSmrg	  x86_64-*kfreebsd*-gnu)
1313a31a186aSmrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
1314a31a186aSmrg	    ;;
1315a31a186aSmrg	  x86_64-*linux*)
1316a31a186aSmrg	    LD="${LD-ld} -m elf_x86_64"
1317a31a186aSmrg	    ;;
1318a31a186aSmrg	  ppc*-*linux*|powerpc*-*linux*)
1319a31a186aSmrg	    LD="${LD-ld} -m elf64ppc"
1320a31a186aSmrg	    ;;
1321a31a186aSmrg	  s390*-*linux*|s390*-*tpf*)
1322a31a186aSmrg	    LD="${LD-ld} -m elf64_s390"
1323a31a186aSmrg	    ;;
1324a31a186aSmrg	  sparc*-*linux*)
1325a31a186aSmrg	    LD="${LD-ld} -m elf64_sparc"
1326a31a186aSmrg	    ;;
1327a31a186aSmrg	esac
1328a31a186aSmrg	;;
1329fe5e51b7Smrg    esac
1330fe5e51b7Smrg  fi
1331fe5e51b7Smrg  rm -rf conftest*
1332fe5e51b7Smrg  ;;
1333fe5e51b7Smrg
1334fe5e51b7Smrg*-*-sco3.2v5*)
1335fe5e51b7Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1336fe5e51b7Smrg  SAVE_CFLAGS="$CFLAGS"
1337fe5e51b7Smrg  CFLAGS="$CFLAGS -belf"
1338fe5e51b7Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1339fe5e51b7Smrg    [AC_LANG_PUSH(C)
1340a31a186aSmrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1341fe5e51b7Smrg     AC_LANG_POP])
1342fe5e51b7Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1343fe5e51b7Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1344fe5e51b7Smrg    CFLAGS="$SAVE_CFLAGS"
1345fe5e51b7Smrg  fi
1346fe5e51b7Smrg  ;;
1347fe5e51b7Smrgsparc*-*solaris*)
1348fe5e51b7Smrg  # Find out which ABI we are using.
1349fe5e51b7Smrg  echo 'int i;' > conftest.$ac_ext
1350fe5e51b7Smrg  if AC_TRY_EVAL(ac_compile); then
1351fe5e51b7Smrg    case `/usr/bin/file conftest.o` in
1352fe5e51b7Smrg    *64-bit*)
1353fe5e51b7Smrg      case $lt_cv_prog_gnu_ld in
1354fe5e51b7Smrg      yes*) LD="${LD-ld} -m elf64_sparc" ;;
1355eda3803bSmrg      *)
1356a31a186aSmrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1357eda3803bSmrg	  LD="${LD-ld} -64"
1358eda3803bSmrg	fi
1359eda3803bSmrg	;;
1360fe5e51b7Smrg      esac
1361fe5e51b7Smrg      ;;
1362fe5e51b7Smrg    esac
1363fe5e51b7Smrg  fi
1364fe5e51b7Smrg  rm -rf conftest*
1365fe5e51b7Smrg  ;;
1366fe5e51b7Smrgesac
1367fe5e51b7Smrg
1368fe5e51b7Smrgneed_locks="$enable_libtool_lock"
1369a31a186aSmrg])# _LT_ENABLE_LOCK
1370a31a186aSmrg
1371a31a186aSmrg
1372a31a186aSmrg# _LT_CMD_OLD_ARCHIVE
1373a31a186aSmrg# -------------------
1374a31a186aSmrgm4_defun([_LT_CMD_OLD_ARCHIVE],
1375a31a186aSmrg[AC_CHECK_TOOL(AR, ar, false)
1376a31a186aSmrgtest -z "$AR" && AR=ar
1377a31a186aSmrgtest -z "$AR_FLAGS" && AR_FLAGS=cru
1378a31a186aSmrg_LT_DECL([], [AR], [1], [The archiver])
1379a31a186aSmrg_LT_DECL([], [AR_FLAGS], [1])
1380a31a186aSmrg
1381a31a186aSmrgAC_CHECK_TOOL(STRIP, strip, :)
1382a31a186aSmrgtest -z "$STRIP" && STRIP=:
1383a31a186aSmrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1384eda3803bSmrg
1385a31a186aSmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
1386a31a186aSmrgtest -z "$RANLIB" && RANLIB=:
1387a31a186aSmrg_LT_DECL([], [RANLIB], [1],
1388a31a186aSmrg    [Commands used to install an old-style archive])
1389a31a186aSmrg
1390a31a186aSmrg# Determine commands to create old-style static archives.
1391a31a186aSmrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1392a31a186aSmrgold_postinstall_cmds='chmod 644 $oldlib'
1393a31a186aSmrgold_postuninstall_cmds=
1394a31a186aSmrg
1395a31a186aSmrgif test -n "$RANLIB"; then
1396a31a186aSmrg  case $host_os in
1397a31a186aSmrg  openbsd*)
1398a31a186aSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
1399a31a186aSmrg    ;;
1400a31a186aSmrg  *)
1401a31a186aSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
1402a31a186aSmrg    ;;
1403a31a186aSmrg  esac
1404a31a186aSmrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1405a31a186aSmrgfi
1406a31a186aSmrg_LT_DECL([], [old_postinstall_cmds], [2])
1407a31a186aSmrg_LT_DECL([], [old_postuninstall_cmds], [2])
1408a31a186aSmrg_LT_TAGDECL([], [old_archive_cmds], [2],
1409a31a186aSmrg    [Commands used to build an old-style archive])
1410a31a186aSmrg])# _LT_CMD_OLD_ARCHIVE
1411fe5e51b7Smrg
1412fe5e51b7Smrg
1413a31a186aSmrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1414fe5e51b7Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1415fe5e51b7Smrg# ----------------------------------------------------------------
1416fe5e51b7Smrg# Check whether the given compiler option works
1417a31a186aSmrgAC_DEFUN([_LT_COMPILER_OPTION],
1418a31a186aSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1419a31a186aSmrgm4_require([_LT_DECL_SED])dnl
1420fe5e51b7SmrgAC_CACHE_CHECK([$1], [$2],
1421fe5e51b7Smrg  [$2=no
1422a31a186aSmrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1423fe5e51b7Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1424fe5e51b7Smrg   lt_compiler_flag="$3"
1425fe5e51b7Smrg   # Insert the option either (1) after the last *FLAGS variable, or
1426fe5e51b7Smrg   # (2) before a word containing "conftest.", or (3) at the end.
1427fe5e51b7Smrg   # Note that $ac_compile itself does not contain backslashes and begins
1428fe5e51b7Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
1429fe5e51b7Smrg   # The option is referenced via a variable to avoid confusing sed.
1430fe5e51b7Smrg   lt_compile=`echo "$ac_compile" | $SED \
1431fe5e51b7Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1432fe5e51b7Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1433fe5e51b7Smrg   -e 's:$: $lt_compiler_flag:'`
1434fe5e51b7Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1435fe5e51b7Smrg   (eval "$lt_compile" 2>conftest.err)
1436fe5e51b7Smrg   ac_status=$?
1437fe5e51b7Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
1438fe5e51b7Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1439fe5e51b7Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
1440fe5e51b7Smrg     # The compiler can only warn and ignore the option if not recognized
1441fe5e51b7Smrg     # So say no if there are warnings other than the usual output.
1442a31a186aSmrg     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
1443fe5e51b7Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1444fe5e51b7Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1445fe5e51b7Smrg       $2=yes
1446fe5e51b7Smrg     fi
1447fe5e51b7Smrg   fi
1448a31a186aSmrg   $RM conftest*
1449fe5e51b7Smrg])
1450fe5e51b7Smrg
1451fe5e51b7Smrgif test x"[$]$2" = xyes; then
1452a31a186aSmrg    m4_if([$5], , :, [$5])
1453fe5e51b7Smrgelse
1454a31a186aSmrg    m4_if([$6], , :, [$6])
1455fe5e51b7Smrgfi
1456a31a186aSmrg])# _LT_COMPILER_OPTION
1457fe5e51b7Smrg
1458a31a186aSmrg# Old name:
1459a31a186aSmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1460a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
1461a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1462eda3803bSmrg
1463a31a186aSmrg
1464a31a186aSmrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1465a31a186aSmrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
1466a31a186aSmrg# ----------------------------------------------------
1467a31a186aSmrg# Check whether the given linker option works
1468a31a186aSmrgAC_DEFUN([_LT_LINKER_OPTION],
1469a31a186aSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1470a31a186aSmrgm4_require([_LT_DECL_SED])dnl
1471fe5e51b7SmrgAC_CACHE_CHECK([$1], [$2],
1472fe5e51b7Smrg  [$2=no
1473fe5e51b7Smrg   save_LDFLAGS="$LDFLAGS"
1474fe5e51b7Smrg   LDFLAGS="$LDFLAGS $3"
1475fe5e51b7Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
1476fe5e51b7Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1477fe5e51b7Smrg     # The linker can only warn and ignore the option if not recognized
1478fe5e51b7Smrg     # So say no if there are warnings
1479fe5e51b7Smrg     if test -s conftest.err; then
1480fe5e51b7Smrg       # Append any errors to the config.log.
1481fe5e51b7Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
1482a31a186aSmrg       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
1483fe5e51b7Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1484fe5e51b7Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
1485fe5e51b7Smrg         $2=yes
1486fe5e51b7Smrg       fi
1487fe5e51b7Smrg     else
1488fe5e51b7Smrg       $2=yes
1489fe5e51b7Smrg     fi
1490fe5e51b7Smrg   fi
1491a31a186aSmrg   $RM -r conftest*
1492fe5e51b7Smrg   LDFLAGS="$save_LDFLAGS"
1493fe5e51b7Smrg])
1494fe5e51b7Smrg
1495fe5e51b7Smrgif test x"[$]$2" = xyes; then
1496a31a186aSmrg    m4_if([$4], , :, [$4])
1497fe5e51b7Smrgelse
1498a31a186aSmrg    m4_if([$5], , :, [$5])
1499fe5e51b7Smrgfi
1500a31a186aSmrg])# _LT_LINKER_OPTION
1501fe5e51b7Smrg
1502a31a186aSmrg# Old name:
1503a31a186aSmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1504a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
1505a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1506fe5e51b7Smrg
1507a31a186aSmrg
1508a31a186aSmrg# LT_CMD_MAX_LEN
1509a31a186aSmrg#---------------
1510a31a186aSmrgAC_DEFUN([LT_CMD_MAX_LEN],
1511a31a186aSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1512a31a186aSmrg# find the maximum length of command line arguments
1513fe5e51b7SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
1514fe5e51b7SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1515fe5e51b7Smrg  i=0
1516fe5e51b7Smrg  teststring="ABCD"
1517fe5e51b7Smrg
1518fe5e51b7Smrg  case $build_os in
1519fe5e51b7Smrg  msdosdjgpp*)
1520fe5e51b7Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
1521fe5e51b7Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
1522fe5e51b7Smrg    # during glob expansion).  Even if it were fixed, the result of this
1523fe5e51b7Smrg    # check would be larger than it should be.
1524fe5e51b7Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
1525fe5e51b7Smrg    ;;
1526fe5e51b7Smrg
1527fe5e51b7Smrg  gnu*)
1528fe5e51b7Smrg    # Under GNU Hurd, this test is not required because there is
1529fe5e51b7Smrg    # no limit to the length of command line arguments.
1530fe5e51b7Smrg    # Libtool will interpret -1 as no limit whatsoever
1531fe5e51b7Smrg    lt_cv_sys_max_cmd_len=-1;
1532fe5e51b7Smrg    ;;
1533fe5e51b7Smrg
1534a31a186aSmrg  cygwin* | mingw* | cegcc*)
1535fe5e51b7Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
1536fe5e51b7Smrg    # about 5 minutes as the teststring grows exponentially.
1537fe5e51b7Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
1538fe5e51b7Smrg    # you end up with a "frozen" computer, even though with patience
1539fe5e51b7Smrg    # the test eventually succeeds (with a max line length of 256k).
1540fe5e51b7Smrg    # Instead, let's just punt: use the minimum linelength reported by
1541fe5e51b7Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
1542fe5e51b7Smrg    lt_cv_sys_max_cmd_len=8192;
1543fe5e51b7Smrg    ;;
1544fe5e51b7Smrg
1545fe5e51b7Smrg  amigaos*)
1546fe5e51b7Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
1547fe5e51b7Smrg    # So we just punt and use a minimum line length of 8192.
1548fe5e51b7Smrg    lt_cv_sys_max_cmd_len=8192;
1549fe5e51b7Smrg    ;;
1550fe5e51b7Smrg
1551fe5e51b7Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
1552fe5e51b7Smrg    # This has been around since 386BSD, at least.  Likely further.
1553fe5e51b7Smrg    if test -x /sbin/sysctl; then
1554fe5e51b7Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1555fe5e51b7Smrg    elif test -x /usr/sbin/sysctl; then
1556fe5e51b7Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1557fe5e51b7Smrg    else
1558fe5e51b7Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
1559fe5e51b7Smrg    fi
1560fe5e51b7Smrg    # And add a safety zone
1561fe5e51b7Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1562fe5e51b7Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1563fe5e51b7Smrg    ;;
1564fe5e51b7Smrg
1565fe5e51b7Smrg  interix*)
1566fe5e51b7Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
1567fe5e51b7Smrg    lt_cv_sys_max_cmd_len=196608
1568fe5e51b7Smrg    ;;
1569fe5e51b7Smrg
1570fe5e51b7Smrg  osf*)
1571fe5e51b7Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1572fe5e51b7Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1573fe5e51b7Smrg    # nice to cause kernel panics so lets avoid the loop below.
1574fe5e51b7Smrg    # First set a reasonable default.
1575fe5e51b7Smrg    lt_cv_sys_max_cmd_len=16384
1576fe5e51b7Smrg    #
1577fe5e51b7Smrg    if test -x /sbin/sysconfig; then
1578fe5e51b7Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1579fe5e51b7Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
1580fe5e51b7Smrg      esac
1581fe5e51b7Smrg    fi
1582fe5e51b7Smrg    ;;
1583fe5e51b7Smrg  sco3.2v5*)
1584fe5e51b7Smrg    lt_cv_sys_max_cmd_len=102400
1585fe5e51b7Smrg    ;;
1586fe5e51b7Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
1587fe5e51b7Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1588fe5e51b7Smrg    if test -n "$kargmax"; then
1589a31a186aSmrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
1590fe5e51b7Smrg    else
1591fe5e51b7Smrg      lt_cv_sys_max_cmd_len=32768
1592fe5e51b7Smrg    fi
1593fe5e51b7Smrg    ;;
1594fe5e51b7Smrg  *)
1595fe5e51b7Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1596fe5e51b7Smrg    if test -n "$lt_cv_sys_max_cmd_len"; then
1597fe5e51b7Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1598fe5e51b7Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1599fe5e51b7Smrg    else
1600a31a186aSmrg      # Make teststring a little bigger before we do anything with it.
1601a31a186aSmrg      # a 1K string should be a reasonable start.
1602a31a186aSmrg      for i in 1 2 3 4 5 6 7 8 ; do
1603a31a186aSmrg        teststring=$teststring$teststring
1604a31a186aSmrg      done
1605fe5e51b7Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1606a31a186aSmrg      # If test is not a shell built-in, we'll probably end up computing a
1607a31a186aSmrg      # maximum length that is only half of the actual maximum length, but
1608a31a186aSmrg      # we can't tell.
1609a31a186aSmrg      while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
1610a31a186aSmrg	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
1611fe5e51b7Smrg	      test $i != 17 # 1/2 MB should be enough
1612fe5e51b7Smrg      do
1613fe5e51b7Smrg        i=`expr $i + 1`
1614fe5e51b7Smrg        teststring=$teststring$teststring
1615fe5e51b7Smrg      done
1616a31a186aSmrg      # Only check the string length outside the loop.
1617a31a186aSmrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1618fe5e51b7Smrg      teststring=
1619a31a186aSmrg      # Add a significant safety factor because C++ compilers can tack on
1620a31a186aSmrg      # massive amounts of additional arguments before passing them to the
1621a31a186aSmrg      # linker.  It appears as though 1/2 is a usable value.
1622fe5e51b7Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1623fe5e51b7Smrg    fi
1624fe5e51b7Smrg    ;;
1625fe5e51b7Smrg  esac
1626fe5e51b7Smrg])
1627fe5e51b7Smrgif test -n $lt_cv_sys_max_cmd_len ; then
1628fe5e51b7Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1629fe5e51b7Smrgelse
1630fe5e51b7Smrg  AC_MSG_RESULT(none)
1631fe5e51b7Smrgfi
1632a31a186aSmrgmax_cmd_len=$lt_cv_sys_max_cmd_len
1633a31a186aSmrg_LT_DECL([], [max_cmd_len], [0],
1634a31a186aSmrg    [What is the maximum length of a command?])
1635a31a186aSmrg])# LT_CMD_MAX_LEN
1636fe5e51b7Smrg
1637a31a186aSmrg# Old name:
1638a31a186aSmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1639a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
1640a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1641fe5e51b7Smrg
1642a31a186aSmrg
1643a31a186aSmrg# _LT_HEADER_DLFCN
1644a31a186aSmrg# ----------------
1645a31a186aSmrgm4_defun([_LT_HEADER_DLFCN],
1646a31a186aSmrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1647a31a186aSmrg])# _LT_HEADER_DLFCN
1648fe5e51b7Smrg
1649fe5e51b7Smrg
1650a31a186aSmrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1651a31a186aSmrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1652a31a186aSmrg# ----------------------------------------------------------------
1653a31a186aSmrgm4_defun([_LT_TRY_DLOPEN_SELF],
1654a31a186aSmrg[m4_require([_LT_HEADER_DLFCN])dnl
1655fe5e51b7Smrgif test "$cross_compiling" = yes; then :
1656fe5e51b7Smrg  [$4]
1657fe5e51b7Smrgelse
1658fe5e51b7Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1659fe5e51b7Smrg  lt_status=$lt_dlunknown
1660a31a186aSmrg  cat > conftest.$ac_ext <<_LT_EOF
1661fe5e51b7Smrg[#line __oline__ "configure"
1662fe5e51b7Smrg#include "confdefs.h"
1663fe5e51b7Smrg
1664fe5e51b7Smrg#if HAVE_DLFCN_H
1665fe5e51b7Smrg#include <dlfcn.h>
1666fe5e51b7Smrg#endif
1667fe5e51b7Smrg
1668fe5e51b7Smrg#include <stdio.h>
1669fe5e51b7Smrg
1670fe5e51b7Smrg#ifdef RTLD_GLOBAL
1671fe5e51b7Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
1672fe5e51b7Smrg#else
1673fe5e51b7Smrg#  ifdef DL_GLOBAL
1674fe5e51b7Smrg#    define LT_DLGLOBAL		DL_GLOBAL
1675fe5e51b7Smrg#  else
1676fe5e51b7Smrg#    define LT_DLGLOBAL		0
1677fe5e51b7Smrg#  endif
1678fe5e51b7Smrg#endif
1679fe5e51b7Smrg
1680fe5e51b7Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1681fe5e51b7Smrg   find out it does not work in some platform. */
1682fe5e51b7Smrg#ifndef LT_DLLAZY_OR_NOW
1683fe5e51b7Smrg#  ifdef RTLD_LAZY
1684fe5e51b7Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
1685fe5e51b7Smrg#  else
1686fe5e51b7Smrg#    ifdef DL_LAZY
1687fe5e51b7Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
1688fe5e51b7Smrg#    else
1689fe5e51b7Smrg#      ifdef RTLD_NOW
1690fe5e51b7Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
1691fe5e51b7Smrg#      else
1692fe5e51b7Smrg#        ifdef DL_NOW
1693fe5e51b7Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
1694fe5e51b7Smrg#        else
1695fe5e51b7Smrg#          define LT_DLLAZY_OR_NOW	0
1696fe5e51b7Smrg#        endif
1697fe5e51b7Smrg#      endif
1698fe5e51b7Smrg#    endif
1699fe5e51b7Smrg#  endif
1700fe5e51b7Smrg#endif
1701fe5e51b7Smrg
1702fe5e51b7Smrgvoid fnord() { int i=42;}
1703fe5e51b7Smrgint main ()
1704fe5e51b7Smrg{
1705fe5e51b7Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1706fe5e51b7Smrg  int status = $lt_dlunknown;
1707fe5e51b7Smrg
1708fe5e51b7Smrg  if (self)
1709fe5e51b7Smrg    {
1710fe5e51b7Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1711fe5e51b7Smrg      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
1712fe5e51b7Smrg      /* dlclose (self); */
1713fe5e51b7Smrg    }
1714fe5e51b7Smrg  else
1715fe5e51b7Smrg    puts (dlerror ());
1716fe5e51b7Smrg
1717a31a186aSmrg  return status;
1718fe5e51b7Smrg}]
1719a31a186aSmrg_LT_EOF
1720fe5e51b7Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1721fe5e51b7Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1722fe5e51b7Smrg    lt_status=$?
1723fe5e51b7Smrg    case x$lt_status in
1724fe5e51b7Smrg      x$lt_dlno_uscore) $1 ;;
1725fe5e51b7Smrg      x$lt_dlneed_uscore) $2 ;;
1726fe5e51b7Smrg      x$lt_dlunknown|x*) $3 ;;
1727fe5e51b7Smrg    esac
1728fe5e51b7Smrg  else :
1729fe5e51b7Smrg    # compilation failed
1730fe5e51b7Smrg    $3
1731fe5e51b7Smrg  fi
1732fe5e51b7Smrgfi
1733fe5e51b7Smrgrm -fr conftest*
1734a31a186aSmrg])# _LT_TRY_DLOPEN_SELF
1735fe5e51b7Smrg
1736fe5e51b7Smrg
1737a31a186aSmrg# LT_SYS_DLOPEN_SELF
1738a31a186aSmrg# ------------------
1739a31a186aSmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
1740a31a186aSmrg[m4_require([_LT_HEADER_DLFCN])dnl
1741fe5e51b7Smrgif test "x$enable_dlopen" != xyes; then
1742fe5e51b7Smrg  enable_dlopen=unknown
1743fe5e51b7Smrg  enable_dlopen_self=unknown
1744fe5e51b7Smrg  enable_dlopen_self_static=unknown
1745fe5e51b7Smrgelse
1746fe5e51b7Smrg  lt_cv_dlopen=no
1747fe5e51b7Smrg  lt_cv_dlopen_libs=
1748fe5e51b7Smrg
1749fe5e51b7Smrg  case $host_os in
1750fe5e51b7Smrg  beos*)
1751fe5e51b7Smrg    lt_cv_dlopen="load_add_on"
1752fe5e51b7Smrg    lt_cv_dlopen_libs=
1753fe5e51b7Smrg    lt_cv_dlopen_self=yes
1754fe5e51b7Smrg    ;;
1755fe5e51b7Smrg
1756a31a186aSmrg  mingw* | pw32* | cegcc*)
1757fe5e51b7Smrg    lt_cv_dlopen="LoadLibrary"
1758fe5e51b7Smrg    lt_cv_dlopen_libs=
1759a31a186aSmrg    ;;
1760fe5e51b7Smrg
1761fe5e51b7Smrg  cygwin*)
1762fe5e51b7Smrg    lt_cv_dlopen="dlopen"
1763fe5e51b7Smrg    lt_cv_dlopen_libs=
1764a31a186aSmrg    ;;
1765fe5e51b7Smrg
1766fe5e51b7Smrg  darwin*)
1767fe5e51b7Smrg  # if libdl is installed we need to link against it
1768fe5e51b7Smrg    AC_CHECK_LIB([dl], [dlopen],
1769fe5e51b7Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
1770fe5e51b7Smrg    lt_cv_dlopen="dyld"
1771fe5e51b7Smrg    lt_cv_dlopen_libs=
1772fe5e51b7Smrg    lt_cv_dlopen_self=yes
1773fe5e51b7Smrg    ])
1774a31a186aSmrg    ;;
1775fe5e51b7Smrg
1776fe5e51b7Smrg  *)
1777fe5e51b7Smrg    AC_CHECK_FUNC([shl_load],
1778fe5e51b7Smrg	  [lt_cv_dlopen="shl_load"],
1779fe5e51b7Smrg      [AC_CHECK_LIB([dld], [shl_load],
1780eda3803bSmrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
1781fe5e51b7Smrg	[AC_CHECK_FUNC([dlopen],
1782fe5e51b7Smrg	      [lt_cv_dlopen="dlopen"],
1783fe5e51b7Smrg	  [AC_CHECK_LIB([dl], [dlopen],
1784fe5e51b7Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1785fe5e51b7Smrg	    [AC_CHECK_LIB([svld], [dlopen],
1786fe5e51b7Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1787fe5e51b7Smrg	      [AC_CHECK_LIB([dld], [dld_link],
1788eda3803bSmrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
1789fe5e51b7Smrg	      ])
1790fe5e51b7Smrg	    ])
1791fe5e51b7Smrg	  ])
1792fe5e51b7Smrg	])
1793fe5e51b7Smrg      ])
1794fe5e51b7Smrg    ;;
1795fe5e51b7Smrg  esac
1796fe5e51b7Smrg
1797fe5e51b7Smrg  if test "x$lt_cv_dlopen" != xno; then
1798fe5e51b7Smrg    enable_dlopen=yes
1799fe5e51b7Smrg  else
1800fe5e51b7Smrg    enable_dlopen=no
1801fe5e51b7Smrg  fi
1802fe5e51b7Smrg
1803fe5e51b7Smrg  case $lt_cv_dlopen in
1804fe5e51b7Smrg  dlopen)
1805fe5e51b7Smrg    save_CPPFLAGS="$CPPFLAGS"
1806fe5e51b7Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1807fe5e51b7Smrg
1808fe5e51b7Smrg    save_LDFLAGS="$LDFLAGS"
1809fe5e51b7Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1810fe5e51b7Smrg
1811fe5e51b7Smrg    save_LIBS="$LIBS"
1812fe5e51b7Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
1813fe5e51b7Smrg
1814fe5e51b7Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
1815fe5e51b7Smrg	  lt_cv_dlopen_self, [dnl
1816a31a186aSmrg	  _LT_TRY_DLOPEN_SELF(
1817fe5e51b7Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1818fe5e51b7Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1819fe5e51b7Smrg    ])
1820fe5e51b7Smrg
1821fe5e51b7Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
1822fe5e51b7Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
1823fe5e51b7Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1824a31a186aSmrg	  lt_cv_dlopen_self_static, [dnl
1825a31a186aSmrg	  _LT_TRY_DLOPEN_SELF(
1826fe5e51b7Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1827fe5e51b7Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
1828fe5e51b7Smrg      ])
1829fe5e51b7Smrg    fi
1830fe5e51b7Smrg
1831fe5e51b7Smrg    CPPFLAGS="$save_CPPFLAGS"
1832fe5e51b7Smrg    LDFLAGS="$save_LDFLAGS"
1833fe5e51b7Smrg    LIBS="$save_LIBS"
1834fe5e51b7Smrg    ;;
1835fe5e51b7Smrg  esac
1836fe5e51b7Smrg
1837fe5e51b7Smrg  case $lt_cv_dlopen_self in
1838fe5e51b7Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1839fe5e51b7Smrg  *) enable_dlopen_self=unknown ;;
1840fe5e51b7Smrg  esac
1841fe5e51b7Smrg
1842fe5e51b7Smrg  case $lt_cv_dlopen_self_static in
1843fe5e51b7Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1844fe5e51b7Smrg  *) enable_dlopen_self_static=unknown ;;
1845fe5e51b7Smrg  esac
1846fe5e51b7Smrgfi
1847a31a186aSmrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
1848a31a186aSmrg	 [Whether dlopen is supported])
1849a31a186aSmrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
1850a31a186aSmrg	 [Whether dlopen of programs is supported])
1851a31a186aSmrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
1852a31a186aSmrg	 [Whether dlopen of statically linked programs is supported])
1853a31a186aSmrg])# LT_SYS_DLOPEN_SELF
1854fe5e51b7Smrg
1855a31a186aSmrg# Old name:
1856a31a186aSmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
1857a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
1858a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1859eda3803bSmrg
1860a31a186aSmrg
1861a31a186aSmrg# _LT_COMPILER_C_O([TAGNAME])
1862a31a186aSmrg# ---------------------------
1863a31a186aSmrg# Check to see if options -c and -o are simultaneously supported by compiler.
1864a31a186aSmrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
1865a31a186aSmrgm4_defun([_LT_COMPILER_C_O],
1866a31a186aSmrg[m4_require([_LT_DECL_SED])dnl
1867a31a186aSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
1868a31a186aSmrgm4_require([_LT_TAG_COMPILER])dnl
1869fe5e51b7SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1870a31a186aSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1871a31a186aSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
1872a31a186aSmrg   $RM -r conftest 2>/dev/null
1873fe5e51b7Smrg   mkdir conftest
1874fe5e51b7Smrg   cd conftest
1875fe5e51b7Smrg   mkdir out
1876fe5e51b7Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1877fe5e51b7Smrg
1878fe5e51b7Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
1879fe5e51b7Smrg   # Insert the option either (1) after the last *FLAGS variable, or
1880fe5e51b7Smrg   # (2) before a word containing "conftest.", or (3) at the end.
1881fe5e51b7Smrg   # Note that $ac_compile itself does not contain backslashes and begins
1882fe5e51b7Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
1883fe5e51b7Smrg   lt_compile=`echo "$ac_compile" | $SED \
1884fe5e51b7Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1885fe5e51b7Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1886fe5e51b7Smrg   -e 's:$: $lt_compiler_flag:'`
1887fe5e51b7Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1888fe5e51b7Smrg   (eval "$lt_compile" 2>out/conftest.err)
1889fe5e51b7Smrg   ac_status=$?
1890fe5e51b7Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
1891fe5e51b7Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1892fe5e51b7Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
1893fe5e51b7Smrg   then
1894fe5e51b7Smrg     # The compiler can only warn and ignore the option if not recognized
1895fe5e51b7Smrg     # So say no if there are warnings
1896a31a186aSmrg     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
1897fe5e51b7Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
1898fe5e51b7Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
1899a31a186aSmrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
1900fe5e51b7Smrg     fi
1901fe5e51b7Smrg   fi
1902fe5e51b7Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
1903a31a186aSmrg   $RM conftest*
1904fe5e51b7Smrg   # SGI C++ compiler will create directory out/ii_files/ for
1905fe5e51b7Smrg   # template instantiation
1906a31a186aSmrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
1907a31a186aSmrg   $RM out/* && rmdir out
1908fe5e51b7Smrg   cd ..
1909a31a186aSmrg   $RM -r conftest
1910a31a186aSmrg   $RM conftest*
1911fe5e51b7Smrg])
1912a31a186aSmrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
1913a31a186aSmrg	[Does compiler simultaneously support -c and -o options?])
1914a31a186aSmrg])# _LT_COMPILER_C_O
1915fe5e51b7Smrg
1916fe5e51b7Smrg
1917a31a186aSmrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
1918a31a186aSmrg# ----------------------------------
1919fe5e51b7Smrg# Check to see if we can do hard links to lock some files if needed
1920a31a186aSmrgm4_defun([_LT_COMPILER_FILE_LOCKS],
1921a31a186aSmrg[m4_require([_LT_ENABLE_LOCK])dnl
1922a31a186aSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
1923a31a186aSmrg_LT_COMPILER_C_O([$1])
1924fe5e51b7Smrg
1925fe5e51b7Smrghard_links="nottested"
1926a31a186aSmrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
1927fe5e51b7Smrg  # do not overwrite the value of need_locks provided by the user
1928fe5e51b7Smrg  AC_MSG_CHECKING([if we can lock with hard links])
1929fe5e51b7Smrg  hard_links=yes
1930a31a186aSmrg  $RM conftest*
1931fe5e51b7Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
1932fe5e51b7Smrg  touch conftest.a
1933fe5e51b7Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
1934fe5e51b7Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
1935fe5e51b7Smrg  AC_MSG_RESULT([$hard_links])
1936fe5e51b7Smrg  if test "$hard_links" = no; then
1937fe5e51b7Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
1938fe5e51b7Smrg    need_locks=warn
1939fe5e51b7Smrg  fi
1940fe5e51b7Smrgelse
1941fe5e51b7Smrg  need_locks=no
1942fe5e51b7Smrgfi
1943a31a186aSmrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
1944a31a186aSmrg])# _LT_COMPILER_FILE_LOCKS
1945fe5e51b7Smrg
1946fe5e51b7Smrg
1947a31a186aSmrg# _LT_CHECK_OBJDIR
1948a31a186aSmrg# ----------------
1949a31a186aSmrgm4_defun([_LT_CHECK_OBJDIR],
1950fe5e51b7Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
1951fe5e51b7Smrg[rm -f .libs 2>/dev/null
1952fe5e51b7Smrgmkdir .libs 2>/dev/null
1953fe5e51b7Smrgif test -d .libs; then
1954fe5e51b7Smrg  lt_cv_objdir=.libs
1955fe5e51b7Smrgelse
1956fe5e51b7Smrg  # MS-DOS does not allow filenames that begin with a dot.
1957fe5e51b7Smrg  lt_cv_objdir=_libs
1958fe5e51b7Smrgfi
1959fe5e51b7Smrgrmdir .libs 2>/dev/null])
1960fe5e51b7Smrgobjdir=$lt_cv_objdir
1961a31a186aSmrg_LT_DECL([], [objdir], [0],
1962a31a186aSmrg         [The name of the directory that contains temporary libtool files])dnl
1963a31a186aSmrgm4_pattern_allow([LT_OBJDIR])dnl
1964a31a186aSmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
1965a31a186aSmrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
1966a31a186aSmrg])# _LT_CHECK_OBJDIR
1967fe5e51b7Smrg
1968fe5e51b7Smrg
1969a31a186aSmrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
1970a31a186aSmrg# --------------------------------------
1971fe5e51b7Smrg# Check hardcoding attributes.
1972a31a186aSmrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
1973fe5e51b7Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
1974a31a186aSmrg_LT_TAGVAR(hardcode_action, $1)=
1975a31a186aSmrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
1976a31a186aSmrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
1977a31a186aSmrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
1978fe5e51b7Smrg
1979a31a186aSmrg  # We can hardcode non-existent directories.
1980a31a186aSmrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
1981fe5e51b7Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
1982fe5e51b7Smrg     # have to relink, otherwise we might link with an installed library
1983fe5e51b7Smrg     # when we should be linking with a yet-to-be-installed one
1984a31a186aSmrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
1985a31a186aSmrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
1986fe5e51b7Smrg    # Linking always hardcodes the temporary library directory.
1987a31a186aSmrg    _LT_TAGVAR(hardcode_action, $1)=relink
1988fe5e51b7Smrg  else
1989fe5e51b7Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
1990a31a186aSmrg    _LT_TAGVAR(hardcode_action, $1)=immediate
1991fe5e51b7Smrg  fi
1992fe5e51b7Smrgelse
1993fe5e51b7Smrg  # We cannot hardcode anything, or else we can only hardcode existing
1994fe5e51b7Smrg  # directories.
1995a31a186aSmrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
1996fe5e51b7Smrgfi
1997a31a186aSmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
1998fe5e51b7Smrg
1999a31a186aSmrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
2000a31a186aSmrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
2001fe5e51b7Smrg  # Fast installation is not supported
2002fe5e51b7Smrg  enable_fast_install=no
2003fe5e51b7Smrgelif test "$shlibpath_overrides_runpath" = yes ||
2004fe5e51b7Smrg     test "$enable_shared" = no; then
2005fe5e51b7Smrg  # Fast installation is not necessary
2006fe5e51b7Smrg  enable_fast_install=needless
2007fe5e51b7Smrgfi
2008a31a186aSmrg_LT_TAGDECL([], [hardcode_action], [0],
2009a31a186aSmrg    [How to hardcode a shared library path into an executable])
2010a31a186aSmrg])# _LT_LINKER_HARDCODE_LIBPATH
2011fe5e51b7Smrg
2012fe5e51b7Smrg
2013a31a186aSmrg# _LT_CMD_STRIPLIB
2014a31a186aSmrg# ----------------
2015a31a186aSmrgm4_defun([_LT_CMD_STRIPLIB],
2016a31a186aSmrg[m4_require([_LT_DECL_EGREP])
2017a31a186aSmrgstriplib=
2018fe5e51b7Smrgold_striplib=
2019fe5e51b7SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
2020a31a186aSmrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2021fe5e51b7Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2022fe5e51b7Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2023fe5e51b7Smrg  AC_MSG_RESULT([yes])
2024fe5e51b7Smrgelse
2025fe5e51b7Smrg# FIXME - insert some real tests, host_os isn't really good enough
2026fe5e51b7Smrg  case $host_os in
2027a31a186aSmrg  darwin*)
2028a31a186aSmrg    if test -n "$STRIP" ; then
2029a31a186aSmrg      striplib="$STRIP -x"
2030a31a186aSmrg      old_striplib="$STRIP -S"
2031a31a186aSmrg      AC_MSG_RESULT([yes])
2032a31a186aSmrg    else
2033a31a186aSmrg      AC_MSG_RESULT([no])
2034a31a186aSmrg    fi
2035a31a186aSmrg    ;;
2036a31a186aSmrg  *)
2037a31a186aSmrg    AC_MSG_RESULT([no])
2038fe5e51b7Smrg    ;;
2039fe5e51b7Smrg  esac
2040fe5e51b7Smrgfi
2041a31a186aSmrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2042a31a186aSmrg_LT_DECL([], [striplib], [1])
2043a31a186aSmrg])# _LT_CMD_STRIPLIB
2044fe5e51b7Smrg
2045fe5e51b7Smrg
2046a31a186aSmrg# _LT_SYS_DYNAMIC_LINKER([TAG])
2047fe5e51b7Smrg# -----------------------------
2048fe5e51b7Smrg# PORTME Fill in your ld.so characteristics
2049a31a186aSmrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
2050a31a186aSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2051a31a186aSmrgm4_require([_LT_DECL_EGREP])dnl
2052a31a186aSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2053a31a186aSmrgm4_require([_LT_DECL_OBJDUMP])dnl
2054a31a186aSmrgm4_require([_LT_DECL_SED])dnl
2055fe5e51b7SmrgAC_MSG_CHECKING([dynamic linker characteristics])
2056a31a186aSmrgm4_if([$1],
2057a31a186aSmrg	[], [
2058fe5e51b7Smrgif test "$GCC" = yes; then
2059fe5e51b7Smrg  case $host_os in
2060fe5e51b7Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
2061fe5e51b7Smrg    *) lt_awk_arg="/^libraries:/" ;;
2062fe5e51b7Smrg  esac
2063fe5e51b7Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
2064a31a186aSmrg  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
2065fe5e51b7Smrg    # if the path contains ";" then we assume it to be the separator
2066fe5e51b7Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
2067fe5e51b7Smrg    # assumed that no part of a normal pathname contains ";" but that should
2068fe5e51b7Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
2069a31a186aSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
2070fe5e51b7Smrg  else
2071a31a186aSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
2072fe5e51b7Smrg  fi
2073fe5e51b7Smrg  # Ok, now we have the path, separated by spaces, we can step through it
2074fe5e51b7Smrg  # and add multilib dir if necessary.
2075fe5e51b7Smrg  lt_tmp_lt_search_path_spec=
2076fe5e51b7Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2077fe5e51b7Smrg  for lt_sys_path in $lt_search_path_spec; do
2078fe5e51b7Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
2079fe5e51b7Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
2080fe5e51b7Smrg    else
2081fe5e51b7Smrg      test -d "$lt_sys_path" && \
2082fe5e51b7Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2083fe5e51b7Smrg    fi
2084fe5e51b7Smrg  done
2085a31a186aSmrg  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
2086fe5e51b7SmrgBEGIN {RS=" "; FS="/|\n";} {
2087fe5e51b7Smrg  lt_foo="";
2088fe5e51b7Smrg  lt_count=0;
2089fe5e51b7Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
2090fe5e51b7Smrg    if ($lt_i != "" && $lt_i != ".") {
2091fe5e51b7Smrg      if ($lt_i == "..") {
2092fe5e51b7Smrg        lt_count++;
2093fe5e51b7Smrg      } else {
2094fe5e51b7Smrg        if (lt_count == 0) {
2095fe5e51b7Smrg          lt_foo="/" $lt_i lt_foo;
2096fe5e51b7Smrg        } else {
2097fe5e51b7Smrg          lt_count--;
2098fe5e51b7Smrg        }
2099fe5e51b7Smrg      }
2100fe5e51b7Smrg    }
2101fe5e51b7Smrg  }
2102fe5e51b7Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2103fe5e51b7Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2104fe5e51b7Smrg}'`
2105a31a186aSmrg  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
2106fe5e51b7Smrgelse
2107fe5e51b7Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2108fe5e51b7Smrgfi])
2109a31a186aSmrglibrary_names_spec=
2110a31a186aSmrglibname_spec='lib$name'
2111a31a186aSmrgsoname_spec=
2112a31a186aSmrgshrext_cmds=".so"
2113a31a186aSmrgpostinstall_cmds=
2114a31a186aSmrgpostuninstall_cmds=
2115a31a186aSmrgfinish_cmds=
2116a31a186aSmrgfinish_eval=
2117a31a186aSmrgshlibpath_var=
2118a31a186aSmrgshlibpath_overrides_runpath=unknown
2119a31a186aSmrgversion_type=none
2120a31a186aSmrgdynamic_linker="$host_os ld.so"
2121a31a186aSmrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
2122fe5e51b7Smrgneed_lib_prefix=unknown
2123fe5e51b7Smrghardcode_into_libs=no
2124fe5e51b7Smrg
2125fe5e51b7Smrg# when you set need_version to no, make sure it does not cause -set_version
2126fe5e51b7Smrg# flags to be left without arguments
2127fe5e51b7Smrgneed_version=unknown
2128fe5e51b7Smrg
2129fe5e51b7Smrgcase $host_os in
2130fe5e51b7Smrgaix3*)
2131fe5e51b7Smrg  version_type=linux
2132fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
2133fe5e51b7Smrg  shlibpath_var=LIBPATH
2134fe5e51b7Smrg
2135fe5e51b7Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
2136fe5e51b7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2137fe5e51b7Smrg  ;;
2138fe5e51b7Smrg
2139eda3803bSmrgaix[[4-9]]*)
2140fe5e51b7Smrg  version_type=linux
2141fe5e51b7Smrg  need_lib_prefix=no
2142fe5e51b7Smrg  need_version=no
2143fe5e51b7Smrg  hardcode_into_libs=yes
2144fe5e51b7Smrg  if test "$host_cpu" = ia64; then
2145fe5e51b7Smrg    # AIX 5 supports IA64
2146fe5e51b7Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
2147fe5e51b7Smrg    shlibpath_var=LD_LIBRARY_PATH
2148fe5e51b7Smrg  else
2149fe5e51b7Smrg    # With GCC up to 2.95.x, collect2 would create an import file
2150fe5e51b7Smrg    # for dependence libraries.  The import file would start with
2151fe5e51b7Smrg    # the line `#! .'.  This would cause the generated library to
2152fe5e51b7Smrg    # depend on `.', always an invalid library.  This was fixed in
2153fe5e51b7Smrg    # development snapshots of GCC prior to 3.0.
2154fe5e51b7Smrg    case $host_os in
2155fe5e51b7Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
2156fe5e51b7Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2157fe5e51b7Smrg	   echo ' yes '
2158a31a186aSmrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
2159fe5e51b7Smrg	:
2160fe5e51b7Smrg      else
2161fe5e51b7Smrg	can_build_shared=no
2162fe5e51b7Smrg      fi
2163fe5e51b7Smrg      ;;
2164fe5e51b7Smrg    esac
2165fe5e51b7Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
2166fe5e51b7Smrg    # soname into executable. Probably we can add versioning support to
2167fe5e51b7Smrg    # collect2, so additional links can be useful in future.
2168fe5e51b7Smrg    if test "$aix_use_runtimelinking" = yes; then
2169fe5e51b7Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2170fe5e51b7Smrg      # instead of lib<name>.a to let people know that these are not
2171fe5e51b7Smrg      # typical AIX shared libraries.
2172fe5e51b7Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2173fe5e51b7Smrg    else
2174fe5e51b7Smrg      # We preserve .a as extension for shared libraries through AIX4.2
2175fe5e51b7Smrg      # and later when we are not doing run time linking.
2176fe5e51b7Smrg      library_names_spec='${libname}${release}.a $libname.a'
2177fe5e51b7Smrg      soname_spec='${libname}${release}${shared_ext}$major'
2178fe5e51b7Smrg    fi
2179fe5e51b7Smrg    shlibpath_var=LIBPATH
2180fe5e51b7Smrg  fi
2181fe5e51b7Smrg  ;;
2182fe5e51b7Smrg
2183fe5e51b7Smrgamigaos*)
2184a31a186aSmrg  case $host_cpu in
2185a31a186aSmrg  powerpc)
2186a31a186aSmrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
2187a31a186aSmrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2188a31a186aSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2189a31a186aSmrg    ;;
2190a31a186aSmrg  m68k)
2191a31a186aSmrg    library_names_spec='$libname.ixlibrary $libname.a'
2192a31a186aSmrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
2193a31a186aSmrg    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''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'
2194a31a186aSmrg    ;;
2195a31a186aSmrg  esac
2196fe5e51b7Smrg  ;;
2197fe5e51b7Smrg
2198fe5e51b7Smrgbeos*)
2199fe5e51b7Smrg  library_names_spec='${libname}${shared_ext}'
2200fe5e51b7Smrg  dynamic_linker="$host_os ld.so"
2201fe5e51b7Smrg  shlibpath_var=LIBRARY_PATH
2202fe5e51b7Smrg  ;;
2203fe5e51b7Smrg
2204fe5e51b7Smrgbsdi[[45]]*)
2205fe5e51b7Smrg  version_type=linux
2206fe5e51b7Smrg  need_version=no
2207fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2208fe5e51b7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2209fe5e51b7Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2210fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2211fe5e51b7Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2212fe5e51b7Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2213fe5e51b7Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
2214fe5e51b7Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2215fe5e51b7Smrg  # libtool to hard-code these into programs
2216fe5e51b7Smrg  ;;
2217fe5e51b7Smrg
2218a31a186aSmrgcygwin* | mingw* | pw32* | cegcc*)
2219fe5e51b7Smrg  version_type=windows
2220fe5e51b7Smrg  shrext_cmds=".dll"
2221fe5e51b7Smrg  need_version=no
2222fe5e51b7Smrg  need_lib_prefix=no
2223fe5e51b7Smrg
2224fe5e51b7Smrg  case $GCC,$host_os in
2225a31a186aSmrg  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
2226fe5e51b7Smrg    library_names_spec='$libname.dll.a'
2227fe5e51b7Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2228fe5e51b7Smrg    postinstall_cmds='base_file=`basename \${file}`~
2229a31a186aSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2230fe5e51b7Smrg      dldir=$destdir/`dirname \$dlpath`~
2231fe5e51b7Smrg      test -d \$dldir || mkdir -p \$dldir~
2232fe5e51b7Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
2233a31a186aSmrg      chmod a+x \$dldir/$dlname~
2234a31a186aSmrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2235a31a186aSmrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2236a31a186aSmrg      fi'
2237fe5e51b7Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2238fe5e51b7Smrg      dlpath=$dir/\$dldll~
2239a31a186aSmrg       $RM \$dlpath'
2240fe5e51b7Smrg    shlibpath_overrides_runpath=yes
2241fe5e51b7Smrg
2242fe5e51b7Smrg    case $host_os in
2243fe5e51b7Smrg    cygwin*)
2244fe5e51b7Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2245fe5e51b7Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2246fe5e51b7Smrg      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
2247fe5e51b7Smrg      ;;
2248a31a186aSmrg    mingw* | cegcc*)
2249fe5e51b7Smrg      # MinGW DLLs use traditional 'lib' prefix
2250fe5e51b7Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2251a31a186aSmrg      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
2252a31a186aSmrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2253fe5e51b7Smrg        # It is most probably a Windows format PATH printed by
2254fe5e51b7Smrg        # mingw gcc, but we are running on Cygwin. Gcc prints its search
2255fe5e51b7Smrg        # path with ; separators, and with drive letters. We can handle the
2256fe5e51b7Smrg        # drive letters (cygwin fileutils understands them), so leave them,
2257fe5e51b7Smrg        # especially as we might pass files found there to a mingw objdump,
2258fe5e51b7Smrg        # which wouldn't understand a cygwinified path. Ahh.
2259a31a186aSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2260fe5e51b7Smrg      else
2261a31a186aSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
2262fe5e51b7Smrg      fi
2263fe5e51b7Smrg      ;;
2264fe5e51b7Smrg    pw32*)
2265fe5e51b7Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
2266fe5e51b7Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2267fe5e51b7Smrg      ;;
2268fe5e51b7Smrg    esac
2269fe5e51b7Smrg    ;;
2270fe5e51b7Smrg
2271fe5e51b7Smrg  *)
2272fe5e51b7Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
2273fe5e51b7Smrg    ;;
2274fe5e51b7Smrg  esac
2275fe5e51b7Smrg  dynamic_linker='Win32 ld.exe'
2276fe5e51b7Smrg  # FIXME: first we should search . and the directory the executable is in
2277fe5e51b7Smrg  shlibpath_var=PATH
2278fe5e51b7Smrg  ;;
2279fe5e51b7Smrg
2280fe5e51b7Smrgdarwin* | rhapsody*)
2281fe5e51b7Smrg  dynamic_linker="$host_os dyld"
2282fe5e51b7Smrg  version_type=darwin
2283fe5e51b7Smrg  need_lib_prefix=no
2284fe5e51b7Smrg  need_version=no
2285a31a186aSmrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
2286fe5e51b7Smrg  soname_spec='${libname}${release}${major}$shared_ext'
2287fe5e51b7Smrg  shlibpath_overrides_runpath=yes
2288fe5e51b7Smrg  shlibpath_var=DYLD_LIBRARY_PATH
2289fe5e51b7Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2290a31a186aSmrgm4_if([$1], [],[
2291a31a186aSmrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2292fe5e51b7Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2293fe5e51b7Smrg  ;;
2294fe5e51b7Smrg
2295fe5e51b7Smrgdgux*)
2296fe5e51b7Smrg  version_type=linux
2297fe5e51b7Smrg  need_lib_prefix=no
2298fe5e51b7Smrg  need_version=no
2299fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
2300fe5e51b7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2301fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2302fe5e51b7Smrg  ;;
2303fe5e51b7Smrg
2304fe5e51b7Smrgfreebsd1*)
2305fe5e51b7Smrg  dynamic_linker=no
2306fe5e51b7Smrg  ;;
2307fe5e51b7Smrg
2308fe5e51b7Smrgfreebsd* | dragonfly*)
2309fe5e51b7Smrg  # DragonFly does not have aout.  When/if they implement a new
2310fe5e51b7Smrg  # versioning mechanism, adjust this.
2311fe5e51b7Smrg  if test -x /usr/bin/objformat; then
2312fe5e51b7Smrg    objformat=`/usr/bin/objformat`
2313fe5e51b7Smrg  else
2314fe5e51b7Smrg    case $host_os in
2315fe5e51b7Smrg    freebsd[[123]]*) objformat=aout ;;
2316fe5e51b7Smrg    *) objformat=elf ;;
2317fe5e51b7Smrg    esac
2318fe5e51b7Smrg  fi
2319fe5e51b7Smrg  version_type=freebsd-$objformat
2320fe5e51b7Smrg  case $version_type in
2321fe5e51b7Smrg    freebsd-elf*)
2322fe5e51b7Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2323fe5e51b7Smrg      need_version=no
2324fe5e51b7Smrg      need_lib_prefix=no
2325fe5e51b7Smrg      ;;
2326fe5e51b7Smrg    freebsd-*)
2327fe5e51b7Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
2328fe5e51b7Smrg      need_version=yes
2329fe5e51b7Smrg      ;;
2330fe5e51b7Smrg  esac
2331fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2332fe5e51b7Smrg  case $host_os in
2333fe5e51b7Smrg  freebsd2*)
2334fe5e51b7Smrg    shlibpath_overrides_runpath=yes
2335fe5e51b7Smrg    ;;
2336fe5e51b7Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2337fe5e51b7Smrg    shlibpath_overrides_runpath=yes
2338fe5e51b7Smrg    hardcode_into_libs=yes
2339fe5e51b7Smrg    ;;
2340fe5e51b7Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2341fe5e51b7Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2342fe5e51b7Smrg    shlibpath_overrides_runpath=no
2343fe5e51b7Smrg    hardcode_into_libs=yes
2344fe5e51b7Smrg    ;;
2345fe5e51b7Smrg  *) # from 4.6 on, and DragonFly
2346fe5e51b7Smrg    shlibpath_overrides_runpath=yes
2347fe5e51b7Smrg    hardcode_into_libs=yes
2348fe5e51b7Smrg    ;;
2349fe5e51b7Smrg  esac
2350fe5e51b7Smrg  ;;
2351fe5e51b7Smrg
2352fe5e51b7Smrggnu*)
2353fe5e51b7Smrg  version_type=linux
2354fe5e51b7Smrg  need_lib_prefix=no
2355fe5e51b7Smrg  need_version=no
2356fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2357fe5e51b7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2358fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2359fe5e51b7Smrg  hardcode_into_libs=yes
2360fe5e51b7Smrg  ;;
2361fe5e51b7Smrg
2362fe5e51b7Smrghpux9* | hpux10* | hpux11*)
2363fe5e51b7Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
2364fe5e51b7Smrg  # link against other versions.
2365fe5e51b7Smrg  version_type=sunos
2366fe5e51b7Smrg  need_lib_prefix=no
2367fe5e51b7Smrg  need_version=no
2368fe5e51b7Smrg  case $host_cpu in
2369fe5e51b7Smrg  ia64*)
2370fe5e51b7Smrg    shrext_cmds='.so'
2371fe5e51b7Smrg    hardcode_into_libs=yes
2372fe5e51b7Smrg    dynamic_linker="$host_os dld.so"
2373fe5e51b7Smrg    shlibpath_var=LD_LIBRARY_PATH
2374fe5e51b7Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2375fe5e51b7Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2376fe5e51b7Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2377fe5e51b7Smrg    if test "X$HPUX_IA64_MODE" = X32; then
2378fe5e51b7Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2379fe5e51b7Smrg    else
2380fe5e51b7Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2381fe5e51b7Smrg    fi
2382fe5e51b7Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2383fe5e51b7Smrg    ;;
2384a31a186aSmrg  hppa*64*)
2385a31a186aSmrg    shrext_cmds='.sl'
2386a31a186aSmrg    hardcode_into_libs=yes
2387a31a186aSmrg    dynamic_linker="$host_os dld.sl"
2388a31a186aSmrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2389a31a186aSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2390a31a186aSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2391a31a186aSmrg    soname_spec='${libname}${release}${shared_ext}$major'
2392a31a186aSmrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2393a31a186aSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2394a31a186aSmrg    ;;
2395a31a186aSmrg  *)
2396fe5e51b7Smrg    shrext_cmds='.sl'
2397fe5e51b7Smrg    dynamic_linker="$host_os dld.sl"
2398fe5e51b7Smrg    shlibpath_var=SHLIB_PATH
2399fe5e51b7Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2400fe5e51b7Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2401fe5e51b7Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2402fe5e51b7Smrg    ;;
2403fe5e51b7Smrg  esac
2404fe5e51b7Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555.
2405fe5e51b7Smrg  postinstall_cmds='chmod 555 $lib'
2406fe5e51b7Smrg  ;;
2407fe5e51b7Smrg
2408fe5e51b7Smrginterix[[3-9]]*)
2409fe5e51b7Smrg  version_type=linux
2410fe5e51b7Smrg  need_lib_prefix=no
2411fe5e51b7Smrg  need_version=no
2412fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2413fe5e51b7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2414fe5e51b7Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2415fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2416fe5e51b7Smrg  shlibpath_overrides_runpath=no
2417fe5e51b7Smrg  hardcode_into_libs=yes
2418fe5e51b7Smrg  ;;
2419fe5e51b7Smrg
2420fe5e51b7Smrgirix5* | irix6* | nonstopux*)
2421fe5e51b7Smrg  case $host_os in
2422fe5e51b7Smrg    nonstopux*) version_type=nonstopux ;;
2423fe5e51b7Smrg    *)
2424fe5e51b7Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
2425fe5e51b7Smrg		version_type=linux
2426fe5e51b7Smrg	else
2427fe5e51b7Smrg		version_type=irix
2428fe5e51b7Smrg	fi ;;
2429fe5e51b7Smrg  esac
2430fe5e51b7Smrg  need_lib_prefix=no
2431fe5e51b7Smrg  need_version=no
2432fe5e51b7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2433fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
2434fe5e51b7Smrg  case $host_os in
2435fe5e51b7Smrg  irix5* | nonstopux*)
2436fe5e51b7Smrg    libsuff= shlibsuff=
2437fe5e51b7Smrg    ;;
2438fe5e51b7Smrg  *)
2439fe5e51b7Smrg    case $LD in # libtool.m4 will add one of these switches to LD
2440fe5e51b7Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2441fe5e51b7Smrg      libsuff= shlibsuff= libmagic=32-bit;;
2442fe5e51b7Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2443fe5e51b7Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
2444fe5e51b7Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2445fe5e51b7Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
2446fe5e51b7Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
2447fe5e51b7Smrg    esac
2448fe5e51b7Smrg    ;;
2449fe5e51b7Smrg  esac
2450fe5e51b7Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2451fe5e51b7Smrg  shlibpath_overrides_runpath=no
2452fe5e51b7Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2453fe5e51b7Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2454fe5e51b7Smrg  hardcode_into_libs=yes
2455fe5e51b7Smrg  ;;
2456fe5e51b7Smrg
2457fe5e51b7Smrg# No shared lib support for Linux oldld, aout, or coff.
2458fe5e51b7Smrglinux*oldld* | linux*aout* | linux*coff*)
2459fe5e51b7Smrg  dynamic_linker=no
2460fe5e51b7Smrg  ;;
2461fe5e51b7Smrg
2462fe5e51b7Smrg# This must be Linux ELF.
2463fe5e51b7Smrglinux* | k*bsd*-gnu)
2464fe5e51b7Smrg  version_type=linux
2465fe5e51b7Smrg  need_lib_prefix=no
2466fe5e51b7Smrg  need_version=no
2467fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2468fe5e51b7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2469fe5e51b7Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2470fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2471fe5e51b7Smrg  shlibpath_overrides_runpath=no
2472a31a186aSmrg  # Some binutils ld are patched to set DT_RUNPATH
2473a31a186aSmrg  save_LDFLAGS=$LDFLAGS
2474a31a186aSmrg  save_libdir=$libdir
2475a31a186aSmrg  eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2476a31a186aSmrg       LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2477a31a186aSmrg  AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2478a31a186aSmrg    [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2479a31a186aSmrg       [shlibpath_overrides_runpath=yes])])
2480a31a186aSmrg  LDFLAGS=$save_LDFLAGS
2481a31a186aSmrg  libdir=$save_libdir
2482a31a186aSmrg
2483fe5e51b7Smrg  # This implies no fast_install, which is unacceptable.
2484fe5e51b7Smrg  # Some rework will be needed to allow for fast_install
2485fe5e51b7Smrg  # before this can be enabled.
2486fe5e51b7Smrg  hardcode_into_libs=yes
2487a31a186aSmrg
2488a31a186aSmrg  # Add ABI-specific directories to the system library path.
2489a31a186aSmrg  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
2490eda3803bSmrg
2491fe5e51b7Smrg  # Append ld.so.conf contents to the search path
2492fe5e51b7Smrg  if test -f /etc/ld.so.conf; then
2493a31a186aSmrg    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;/^$/d' | tr '\n' ' '`
2494eda3803bSmrg    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
2495fe5e51b7Smrg  fi
2496fe5e51b7Smrg
2497fe5e51b7Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
2498fe5e51b7Smrg  # powerpc, because MkLinux only supported shared libraries with the
2499fe5e51b7Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
2500fe5e51b7Smrg  # most powerpc-linux boxes support dynamic linking these days and
2501fe5e51b7Smrg  # people can always --disable-shared, the test was removed, and we
2502fe5e51b7Smrg  # assume the GNU/Linux dynamic linker is in use.
2503fe5e51b7Smrg  dynamic_linker='GNU/Linux ld.so'
2504fe5e51b7Smrg  ;;
2505fe5e51b7Smrg
2506fe5e51b7Smrgnetbsd*)
2507fe5e51b7Smrg  version_type=sunos
2508fe5e51b7Smrg  need_lib_prefix=no
2509fe5e51b7Smrg  need_version=no
2510a31a186aSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2511fe5e51b7Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2512fe5e51b7Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2513fe5e51b7Smrg    dynamic_linker='NetBSD (a.out) ld.so'
2514fe5e51b7Smrg  else
2515fe5e51b7Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2516fe5e51b7Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2517fe5e51b7Smrg    dynamic_linker='NetBSD ld.elf_so'
2518fe5e51b7Smrg  fi
2519fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2520fe5e51b7Smrg  shlibpath_overrides_runpath=yes
2521fe5e51b7Smrg  hardcode_into_libs=yes
2522fe5e51b7Smrg  ;;
2523fe5e51b7Smrg
2524fe5e51b7Smrgnewsos6)
2525fe5e51b7Smrg  version_type=linux
2526fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2527fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2528fe5e51b7Smrg  shlibpath_overrides_runpath=yes
2529fe5e51b7Smrg  ;;
2530fe5e51b7Smrg
2531a31a186aSmrg*nto* | *qnx*)
2532a31a186aSmrg  version_type=qnx
2533fe5e51b7Smrg  need_lib_prefix=no
2534fe5e51b7Smrg  need_version=no
2535fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2536fe5e51b7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2537fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2538a31a186aSmrg  shlibpath_overrides_runpath=no
2539a31a186aSmrg  hardcode_into_libs=yes
2540a31a186aSmrg  dynamic_linker='ldqnx.so'
2541fe5e51b7Smrg  ;;
2542fe5e51b7Smrg
2543fe5e51b7Smrgopenbsd*)
2544fe5e51b7Smrg  version_type=sunos
2545fe5e51b7Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
2546fe5e51b7Smrg  need_lib_prefix=no
2547fe5e51b7Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
2548fe5e51b7Smrg  case $host_os in
2549a31a186aSmrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
2550a31a186aSmrg    *)				need_version=no  ;;
2551fe5e51b7Smrg  esac
2552fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2553fe5e51b7Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2554fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2555a31a186aSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2556fe5e51b7Smrg    case $host_os in
2557fe5e51b7Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
2558fe5e51b7Smrg	shlibpath_overrides_runpath=no
2559fe5e51b7Smrg	;;
2560fe5e51b7Smrg      *)
2561fe5e51b7Smrg	shlibpath_overrides_runpath=yes
2562fe5e51b7Smrg	;;
2563fe5e51b7Smrg      esac
2564fe5e51b7Smrg  else
2565fe5e51b7Smrg    shlibpath_overrides_runpath=yes
2566fe5e51b7Smrg  fi
2567fe5e51b7Smrg  ;;
2568fe5e51b7Smrg
2569fe5e51b7Smrgos2*)
2570fe5e51b7Smrg  libname_spec='$name'
2571fe5e51b7Smrg  shrext_cmds=".dll"
2572fe5e51b7Smrg  need_lib_prefix=no
2573fe5e51b7Smrg  library_names_spec='$libname${shared_ext} $libname.a'
2574fe5e51b7Smrg  dynamic_linker='OS/2 ld.exe'
2575fe5e51b7Smrg  shlibpath_var=LIBPATH
2576fe5e51b7Smrg  ;;
2577fe5e51b7Smrg
2578fe5e51b7Smrgosf3* | osf4* | osf5*)
2579fe5e51b7Smrg  version_type=osf
2580fe5e51b7Smrg  need_lib_prefix=no
2581fe5e51b7Smrg  need_version=no
2582fe5e51b7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2583fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2584fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2585fe5e51b7Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2586fe5e51b7Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2587fe5e51b7Smrg  ;;
2588fe5e51b7Smrg
2589fe5e51b7Smrgrdos*)
2590fe5e51b7Smrg  dynamic_linker=no
2591fe5e51b7Smrg  ;;
2592fe5e51b7Smrg
2593fe5e51b7Smrgsolaris*)
2594fe5e51b7Smrg  version_type=linux
2595fe5e51b7Smrg  need_lib_prefix=no
2596fe5e51b7Smrg  need_version=no
2597fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2598fe5e51b7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2599fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2600fe5e51b7Smrg  shlibpath_overrides_runpath=yes
2601fe5e51b7Smrg  hardcode_into_libs=yes
2602fe5e51b7Smrg  # ldd complains unless libraries are executable
2603fe5e51b7Smrg  postinstall_cmds='chmod +x $lib'
2604fe5e51b7Smrg  ;;
2605fe5e51b7Smrg
2606fe5e51b7Smrgsunos4*)
2607fe5e51b7Smrg  version_type=sunos
2608fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2609fe5e51b7Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2610fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2611fe5e51b7Smrg  shlibpath_overrides_runpath=yes
2612fe5e51b7Smrg  if test "$with_gnu_ld" = yes; then
2613fe5e51b7Smrg    need_lib_prefix=no
2614fe5e51b7Smrg  fi
2615fe5e51b7Smrg  need_version=yes
2616fe5e51b7Smrg  ;;
2617fe5e51b7Smrg
2618fe5e51b7Smrgsysv4 | sysv4.3*)
2619fe5e51b7Smrg  version_type=linux
2620fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2621fe5e51b7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2622fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2623fe5e51b7Smrg  case $host_vendor in
2624fe5e51b7Smrg    sni)
2625fe5e51b7Smrg      shlibpath_overrides_runpath=no
2626fe5e51b7Smrg      need_lib_prefix=no
2627fe5e51b7Smrg      runpath_var=LD_RUN_PATH
2628fe5e51b7Smrg      ;;
2629fe5e51b7Smrg    siemens)
2630fe5e51b7Smrg      need_lib_prefix=no
2631fe5e51b7Smrg      ;;
2632fe5e51b7Smrg    motorola)
2633fe5e51b7Smrg      need_lib_prefix=no
2634fe5e51b7Smrg      need_version=no
2635fe5e51b7Smrg      shlibpath_overrides_runpath=no
2636fe5e51b7Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2637fe5e51b7Smrg      ;;
2638fe5e51b7Smrg  esac
2639fe5e51b7Smrg  ;;
2640fe5e51b7Smrg
2641fe5e51b7Smrgsysv4*MP*)
2642fe5e51b7Smrg  if test -d /usr/nec ;then
2643fe5e51b7Smrg    version_type=linux
2644fe5e51b7Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
2645fe5e51b7Smrg    soname_spec='$libname${shared_ext}.$major'
2646fe5e51b7Smrg    shlibpath_var=LD_LIBRARY_PATH
2647fe5e51b7Smrg  fi
2648fe5e51b7Smrg  ;;
2649fe5e51b7Smrg
2650fe5e51b7Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
2651fe5e51b7Smrg  version_type=freebsd-elf
2652fe5e51b7Smrg  need_lib_prefix=no
2653fe5e51b7Smrg  need_version=no
2654fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2655fe5e51b7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2656fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2657a31a186aSmrg  shlibpath_overrides_runpath=yes
2658fe5e51b7Smrg  hardcode_into_libs=yes
2659fe5e51b7Smrg  if test "$with_gnu_ld" = yes; then
2660fe5e51b7Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
2661fe5e51b7Smrg  else
2662fe5e51b7Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
2663fe5e51b7Smrg    case $host_os in
2664fe5e51b7Smrg      sco3.2v5*)
2665fe5e51b7Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
2666fe5e51b7Smrg	;;
2667fe5e51b7Smrg    esac
2668fe5e51b7Smrg  fi
2669fe5e51b7Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
2670fe5e51b7Smrg  ;;
2671fe5e51b7Smrg
2672a31a186aSmrgtpf*)
2673a31a186aSmrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
2674a31a186aSmrg  version_type=linux
2675a31a186aSmrg  need_lib_prefix=no
2676a31a186aSmrg  need_version=no
2677a31a186aSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2678a31a186aSmrg  shlibpath_var=LD_LIBRARY_PATH
2679a31a186aSmrg  shlibpath_overrides_runpath=no
2680a31a186aSmrg  hardcode_into_libs=yes
2681a31a186aSmrg  ;;
2682a31a186aSmrg
2683eda3803bSmrguts4*)
2684eda3803bSmrg  version_type=linux
2685eda3803bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2686eda3803bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2687eda3803bSmrg  shlibpath_var=LD_LIBRARY_PATH
2688eda3803bSmrg  ;;
2689fe5e51b7Smrg
2690fe5e51b7Smrg*)
2691fe5e51b7Smrg  dynamic_linker=no
2692fe5e51b7Smrg  ;;
2693fe5e51b7Smrgesac
2694fe5e51b7SmrgAC_MSG_RESULT([$dynamic_linker])
2695fe5e51b7Smrgtest "$dynamic_linker" = no && can_build_shared=no
2696fe5e51b7Smrg
2697fe5e51b7Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2698fe5e51b7Smrgif test "$GCC" = yes; then
2699fe5e51b7Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2700fe5e51b7Smrgfi
2701fe5e51b7Smrg
2702a31a186aSmrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
2703a31a186aSmrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
2704a31a186aSmrgfi
2705a31a186aSmrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
2706a31a186aSmrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
2707a31a186aSmrgfi
2708fe5e51b7Smrg
2709a31a186aSmrg_LT_DECL([], [variables_saved_for_relink], [1],
2710a31a186aSmrg    [Variables whose values should be saved in libtool wrapper scripts and
2711a31a186aSmrg    restored at link time])
2712a31a186aSmrg_LT_DECL([], [need_lib_prefix], [0],
2713a31a186aSmrg    [Do we need the "lib" prefix for modules?])
2714a31a186aSmrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
2715a31a186aSmrg_LT_DECL([], [version_type], [0], [Library versioning type])
2716a31a186aSmrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
2717a31a186aSmrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
2718a31a186aSmrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
2719a31a186aSmrg    [Is shlibpath searched before the hard-coded library search path?])
2720a31a186aSmrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
2721a31a186aSmrg_LT_DECL([], [library_names_spec], [1],
2722a31a186aSmrg    [[List of archive names.  First name is the real one, the rest are links.
2723a31a186aSmrg    The last name is the one that the linker finds with -lNAME]])
2724a31a186aSmrg_LT_DECL([], [soname_spec], [1],
2725a31a186aSmrg    [[The coded name of the library, if different from the real name]])
2726a31a186aSmrg_LT_DECL([], [postinstall_cmds], [2],
2727a31a186aSmrg    [Command to use after installation of a shared archive])
2728a31a186aSmrg_LT_DECL([], [postuninstall_cmds], [2],
2729a31a186aSmrg    [Command to use after uninstallation of a shared archive])
2730a31a186aSmrg_LT_DECL([], [finish_cmds], [2],
2731a31a186aSmrg    [Commands used to finish a libtool library installation in a directory])
2732a31a186aSmrg_LT_DECL([], [finish_eval], [1],
2733a31a186aSmrg    [[As "finish_cmds", except a single script fragment to be evaled but
2734a31a186aSmrg    not shown]])
2735a31a186aSmrg_LT_DECL([], [hardcode_into_libs], [0],
2736a31a186aSmrg    [Whether we should hardcode library paths into libraries])
2737a31a186aSmrg_LT_DECL([], [sys_lib_search_path_spec], [2],
2738a31a186aSmrg    [Compile-time system search path for libraries])
2739a31a186aSmrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
2740a31a186aSmrg    [Run-time system search path for libraries])
2741a31a186aSmrg])# _LT_SYS_DYNAMIC_LINKER
2742a31a186aSmrg
2743a31a186aSmrg
2744a31a186aSmrg# _LT_PATH_TOOL_PREFIX(TOOL)
2745643b027fSmrg# --------------------------
2746643b027fSmrg# find a file program which can recognize shared library
2747a31a186aSmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
2748a31a186aSmrg[m4_require([_LT_DECL_EGREP])dnl
2749643b027fSmrgAC_MSG_CHECKING([for $1])
2750643b027fSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
2751643b027fSmrg[case $MAGIC_CMD in
2752fe5e51b7Smrg[[\\/*] |  ?:[\\/]*])
2753fe5e51b7Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
2754fe5e51b7Smrg  ;;
2755fe5e51b7Smrg*)
2756fe5e51b7Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
2757fe5e51b7Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2758fe5e51b7Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
2759fe5e51b7Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
2760fe5e51b7Smrgdnl not every word.  This closes a longstanding sh security hole.
2761a31a186aSmrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
2762fe5e51b7Smrg  for ac_dir in $ac_dummy; do
2763fe5e51b7Smrg    IFS="$lt_save_ifs"
2764fe5e51b7Smrg    test -z "$ac_dir" && ac_dir=.
2765fe5e51b7Smrg    if test -f $ac_dir/$1; then
2766fe5e51b7Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
2767fe5e51b7Smrg      if test -n "$file_magic_test_file"; then
2768fe5e51b7Smrg	case $deplibs_check_method in
2769fe5e51b7Smrg	"file_magic "*)
2770fe5e51b7Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
2771fe5e51b7Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2772fe5e51b7Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
2773fe5e51b7Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
2774fe5e51b7Smrg	    :
2775fe5e51b7Smrg	  else
2776a31a186aSmrg	    cat <<_LT_EOF 1>&2
2777fe5e51b7Smrg
2778fe5e51b7Smrg*** Warning: the command libtool uses to detect shared libraries,
2779fe5e51b7Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
2780fe5e51b7Smrg*** The result is that libtool may fail to recognize shared libraries
2781fe5e51b7Smrg*** as such.  This will affect the creation of libtool libraries that
2782fe5e51b7Smrg*** depend on shared libraries, but programs linked with such libtool
2783fe5e51b7Smrg*** libraries will work regardless of this problem.  Nevertheless, you
2784fe5e51b7Smrg*** may want to report the problem to your system manager and/or to
2785fe5e51b7Smrg*** bug-libtool@gnu.org
2786fe5e51b7Smrg
2787a31a186aSmrg_LT_EOF
2788fe5e51b7Smrg	  fi ;;
2789fe5e51b7Smrg	esac
2790fe5e51b7Smrg      fi
2791fe5e51b7Smrg      break
2792fe5e51b7Smrg    fi
2793fe5e51b7Smrg  done
2794fe5e51b7Smrg  IFS="$lt_save_ifs"
2795fe5e51b7Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
2796fe5e51b7Smrg  ;;
2797fe5e51b7Smrgesac])
2798fe5e51b7SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2799fe5e51b7Smrgif test -n "$MAGIC_CMD"; then
2800fe5e51b7Smrg  AC_MSG_RESULT($MAGIC_CMD)
2801fe5e51b7Smrgelse
2802fe5e51b7Smrg  AC_MSG_RESULT(no)
2803fe5e51b7Smrgfi
2804a31a186aSmrg_LT_DECL([], [MAGIC_CMD], [0],
2805a31a186aSmrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
2806a31a186aSmrg])# _LT_PATH_TOOL_PREFIX
2807fe5e51b7Smrg
2808a31a186aSmrg# Old name:
2809a31a186aSmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
2810a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
2811a31a186aSmrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
2812eda3803bSmrg
2813a31a186aSmrg
2814a31a186aSmrg# _LT_PATH_MAGIC
2815a31a186aSmrg# --------------
2816fe5e51b7Smrg# find a file program which can recognize a shared library
2817a31a186aSmrgm4_defun([_LT_PATH_MAGIC],
2818a31a186aSmrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
2819fe5e51b7Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
2820fe5e51b7Smrg  if test -n "$ac_tool_prefix"; then
2821a31a186aSmrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
2822fe5e51b7Smrg  else
2823fe5e51b7Smrg    MAGIC_CMD=:
2824fe5e51b7Smrg  fi
2825fe5e51b7Smrgfi
2826a31a186aSmrg])# _LT_PATH_MAGIC
2827fe5e51b7Smrg
2828fe5e51b7Smrg
2829a31a186aSmrg# LT_PATH_LD
2830fe5e51b7Smrg# ----------
2831fe5e51b7Smrg# find the pathname to the GNU or non-GNU linker
2832a31a186aSmrgAC_DEFUN([LT_PATH_LD],
2833a31a186aSmrg[AC_REQUIRE([AC_PROG_CC])dnl
2834643b027fSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
2835643b027fSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
2836a31a186aSmrgm4_require([_LT_DECL_SED])dnl
2837a31a186aSmrgm4_require([_LT_DECL_EGREP])dnl
2838a31a186aSmrg
2839a31a186aSmrgAC_ARG_WITH([gnu-ld],
2840a31a186aSmrg    [AS_HELP_STRING([--with-gnu-ld],
2841a31a186aSmrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
2842a31a186aSmrg    [test "$withval" = no || with_gnu_ld=yes],
2843a31a186aSmrg    [with_gnu_ld=no])dnl
2844a31a186aSmrg
2845fe5e51b7Smrgac_prog=ld
2846fe5e51b7Smrgif test "$GCC" = yes; then
2847fe5e51b7Smrg  # Check if gcc -print-prog-name=ld gives a path.
2848fe5e51b7Smrg  AC_MSG_CHECKING([for ld used by $CC])
2849fe5e51b7Smrg  case $host in
2850fe5e51b7Smrg  *-*-mingw*)
2851fe5e51b7Smrg    # gcc leaves a trailing carriage return which upsets mingw
2852fe5e51b7Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2853fe5e51b7Smrg  *)
2854fe5e51b7Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2855fe5e51b7Smrg  esac
2856fe5e51b7Smrg  case $ac_prog in
2857fe5e51b7Smrg    # Accept absolute paths.
2858fe5e51b7Smrg    [[\\/]]* | ?:[[\\/]]*)
2859fe5e51b7Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
2860fe5e51b7Smrg      # Canonicalize the pathname of ld
2861a31a186aSmrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
2862a31a186aSmrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
2863a31a186aSmrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
2864fe5e51b7Smrg      done
2865fe5e51b7Smrg      test -z "$LD" && LD="$ac_prog"
2866fe5e51b7Smrg      ;;
2867fe5e51b7Smrg  "")
2868fe5e51b7Smrg    # If it fails, then pretend we aren't using GCC.
2869fe5e51b7Smrg    ac_prog=ld
2870fe5e51b7Smrg    ;;
2871fe5e51b7Smrg  *)
2872fe5e51b7Smrg    # If it is relative, then search for the first ld in PATH.
2873fe5e51b7Smrg    with_gnu_ld=unknown
2874fe5e51b7Smrg    ;;
2875fe5e51b7Smrg  esac
2876fe5e51b7Smrgelif test "$with_gnu_ld" = yes; then
2877fe5e51b7Smrg  AC_MSG_CHECKING([for GNU ld])
2878fe5e51b7Smrgelse
2879fe5e51b7Smrg  AC_MSG_CHECKING([for non-GNU ld])
2880fe5e51b7Smrgfi
2881fe5e51b7SmrgAC_CACHE_VAL(lt_cv_path_LD,
2882fe5e51b7Smrg[if test -z "$LD"; then
2883fe5e51b7Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2884fe5e51b7Smrg  for ac_dir in $PATH; do
2885fe5e51b7Smrg    IFS="$lt_save_ifs"
2886fe5e51b7Smrg    test -z "$ac_dir" && ac_dir=.
2887fe5e51b7Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2888fe5e51b7Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
2889fe5e51b7Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
2890fe5e51b7Smrg      # but apparently some variants of GNU ld only accept -v.
2891fe5e51b7Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
2892fe5e51b7Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
2893fe5e51b7Smrg      *GNU* | *'with BFD'*)
2894fe5e51b7Smrg	test "$with_gnu_ld" != no && break
2895fe5e51b7Smrg	;;
2896fe5e51b7Smrg      *)
2897fe5e51b7Smrg	test "$with_gnu_ld" != yes && break
2898fe5e51b7Smrg	;;
2899fe5e51b7Smrg      esac
2900fe5e51b7Smrg    fi
2901fe5e51b7Smrg  done
2902fe5e51b7Smrg  IFS="$lt_save_ifs"
2903fe5e51b7Smrgelse
2904fe5e51b7Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
2905fe5e51b7Smrgfi])
2906fe5e51b7SmrgLD="$lt_cv_path_LD"
2907fe5e51b7Smrgif test -n "$LD"; then
2908fe5e51b7Smrg  AC_MSG_RESULT($LD)
2909fe5e51b7Smrgelse
2910fe5e51b7Smrg  AC_MSG_RESULT(no)
2911fe5e51b7Smrgfi
2912fe5e51b7Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2913a31a186aSmrg_LT_PATH_LD_GNU
2914a31a186aSmrgAC_SUBST([LD])
2915fe5e51b7Smrg
2916a31a186aSmrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
2917a31a186aSmrg])# LT_PATH_LD
2918fe5e51b7Smrg
2919a31a186aSmrg# Old names:
2920a31a186aSmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
2921a31a186aSmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
2922a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
2923a31a186aSmrgdnl AC_DEFUN([AM_PROG_LD], [])
2924a31a186aSmrgdnl AC_DEFUN([AC_PROG_LD], [])
2925a31a186aSmrg
2926a31a186aSmrg
2927a31a186aSmrg# _LT_PATH_LD_GNU
2928a31a186aSmrg#- --------------
2929a31a186aSmrgm4_defun([_LT_PATH_LD_GNU],
2930a31a186aSmrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
2931fe5e51b7Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
2932fe5e51b7Smrgcase `$LD -v 2>&1 </dev/null` in
2933fe5e51b7Smrg*GNU* | *'with BFD'*)
2934fe5e51b7Smrg  lt_cv_prog_gnu_ld=yes
2935fe5e51b7Smrg  ;;
2936fe5e51b7Smrg*)
2937fe5e51b7Smrg  lt_cv_prog_gnu_ld=no
2938fe5e51b7Smrg  ;;
2939fe5e51b7Smrgesac])
2940fe5e51b7Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
2941a31a186aSmrg])# _LT_PATH_LD_GNU
2942fe5e51b7Smrg
2943fe5e51b7Smrg
2944a31a186aSmrg# _LT_CMD_RELOAD
2945a31a186aSmrg# --------------
2946fe5e51b7Smrg# find reload flag for linker
2947fe5e51b7Smrg#   -- PORTME Some linkers may need a different reload flag.
2948a31a186aSmrgm4_defun([_LT_CMD_RELOAD],
2949fe5e51b7Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
2950fe5e51b7Smrg  lt_cv_ld_reload_flag,
2951fe5e51b7Smrg  [lt_cv_ld_reload_flag='-r'])
2952fe5e51b7Smrgreload_flag=$lt_cv_ld_reload_flag
2953fe5e51b7Smrgcase $reload_flag in
2954fe5e51b7Smrg"" | " "*) ;;
2955fe5e51b7Smrg*) reload_flag=" $reload_flag" ;;
2956fe5e51b7Smrgesac
2957fe5e51b7Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
2958fe5e51b7Smrgcase $host_os in
2959fe5e51b7Smrg  darwin*)
2960fe5e51b7Smrg    if test "$GCC" = yes; then
2961fe5e51b7Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
2962fe5e51b7Smrg    else
2963fe5e51b7Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
2964fe5e51b7Smrg    fi
2965fe5e51b7Smrg    ;;
2966fe5e51b7Smrgesac
2967a31a186aSmrg_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
2968a31a186aSmrg_LT_DECL([], [reload_cmds], [2])dnl
2969a31a186aSmrg])# _LT_CMD_RELOAD
2970fe5e51b7Smrg
2971fe5e51b7Smrg
2972a31a186aSmrg# _LT_CHECK_MAGIC_METHOD
2973a31a186aSmrg# ----------------------
2974fe5e51b7Smrg# how to check for library dependencies
2975fe5e51b7Smrg#  -- PORTME fill in with the dynamic library characteristics
2976a31a186aSmrgm4_defun([_LT_CHECK_MAGIC_METHOD],
2977a31a186aSmrg[m4_require([_LT_DECL_EGREP])
2978a31a186aSmrgm4_require([_LT_DECL_OBJDUMP])
2979a31a186aSmrgAC_CACHE_CHECK([how to recognize dependent libraries],
2980fe5e51b7Smrglt_cv_deplibs_check_method,
2981fe5e51b7Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
2982fe5e51b7Smrglt_cv_file_magic_test_file=
2983fe5e51b7Smrglt_cv_deplibs_check_method='unknown'
2984fe5e51b7Smrg# Need to set the preceding variable on all platforms that support
2985fe5e51b7Smrg# interlibrary dependencies.
2986fe5e51b7Smrg# 'none' -- dependencies not supported.
2987fe5e51b7Smrg# `unknown' -- same as none, but documents that we really don't know.
2988fe5e51b7Smrg# 'pass_all' -- all dependencies passed with no checks.
2989fe5e51b7Smrg# 'test_compile' -- check by making test program.
2990fe5e51b7Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
2991fe5e51b7Smrg# which responds to the $file_magic_cmd with a given extended regex.
2992fe5e51b7Smrg# If you have `file' or equivalent on your system and you're not sure
2993fe5e51b7Smrg# whether `pass_all' will *always* work, you probably want this one.
2994fe5e51b7Smrg
2995fe5e51b7Smrgcase $host_os in
2996eda3803bSmrgaix[[4-9]]*)
2997fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
2998fe5e51b7Smrg  ;;
2999fe5e51b7Smrg
3000fe5e51b7Smrgbeos*)
3001fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3002fe5e51b7Smrg  ;;
3003fe5e51b7Smrg
3004fe5e51b7Smrgbsdi[[45]]*)
3005fe5e51b7Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3006fe5e51b7Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
3007fe5e51b7Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
3008fe5e51b7Smrg  ;;
3009fe5e51b7Smrg
3010fe5e51b7Smrgcygwin*)
3011fe5e51b7Smrg  # func_win32_libid is a shell function defined in ltmain.sh
3012fe5e51b7Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3013fe5e51b7Smrg  lt_cv_file_magic_cmd='func_win32_libid'
3014fe5e51b7Smrg  ;;
3015fe5e51b7Smrg
3016fe5e51b7Smrgmingw* | pw32*)
3017fe5e51b7Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
3018fe5e51b7Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
3019fe5e51b7Smrg  # unless we find 'file', for example because we are cross-compiling.
3020fe5e51b7Smrg  if ( file / ) >/dev/null 2>&1; then
3021fe5e51b7Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3022fe5e51b7Smrg    lt_cv_file_magic_cmd='func_win32_libid'
3023fe5e51b7Smrg  else
3024fe5e51b7Smrg    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
3025fe5e51b7Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
3026fe5e51b7Smrg  fi
3027fe5e51b7Smrg  ;;
3028fe5e51b7Smrg
3029a31a186aSmrgcegcc)
3030a31a186aSmrg  # use the weaker test based on 'objdump'. See mingw*.
3031a31a186aSmrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3032a31a186aSmrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
3033a31a186aSmrg  ;;
3034a31a186aSmrg
3035fe5e51b7Smrgdarwin* | rhapsody*)
3036fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3037fe5e51b7Smrg  ;;
3038fe5e51b7Smrg
3039fe5e51b7Smrgfreebsd* | dragonfly*)
3040a31a186aSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3041fe5e51b7Smrg    case $host_cpu in
3042fe5e51b7Smrg    i*86 )
3043fe5e51b7Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
3044fe5e51b7Smrg      # Let's accept both of them until this is cleared up.
3045fe5e51b7Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3046fe5e51b7Smrg      lt_cv_file_magic_cmd=/usr/bin/file
3047fe5e51b7Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3048fe5e51b7Smrg      ;;
3049fe5e51b7Smrg    esac
3050fe5e51b7Smrg  else
3051fe5e51b7Smrg    lt_cv_deplibs_check_method=pass_all
3052fe5e51b7Smrg  fi
3053fe5e51b7Smrg  ;;
3054fe5e51b7Smrg
3055fe5e51b7Smrggnu*)
3056fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3057fe5e51b7Smrg  ;;
3058fe5e51b7Smrg
3059fe5e51b7Smrghpux10.20* | hpux11*)
3060fe5e51b7Smrg  lt_cv_file_magic_cmd=/usr/bin/file
3061fe5e51b7Smrg  case $host_cpu in
3062fe5e51b7Smrg  ia64*)
3063fe5e51b7Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3064fe5e51b7Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3065fe5e51b7Smrg    ;;
3066fe5e51b7Smrg  hppa*64*)
3067fe5e51b7Smrg    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
3068fe5e51b7Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3069fe5e51b7Smrg    ;;
3070fe5e51b7Smrg  *)
3071fe5e51b7Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
3072fe5e51b7Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3073fe5e51b7Smrg    ;;
3074fe5e51b7Smrg  esac
3075fe5e51b7Smrg  ;;
3076fe5e51b7Smrg
3077fe5e51b7Smrginterix[[3-9]]*)
3078fe5e51b7Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3079fe5e51b7Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3080fe5e51b7Smrg  ;;
3081fe5e51b7Smrg
3082fe5e51b7Smrgirix5* | irix6* | nonstopux*)
3083fe5e51b7Smrg  case $LD in
3084fe5e51b7Smrg  *-32|*"-32 ") libmagic=32-bit;;
3085fe5e51b7Smrg  *-n32|*"-n32 ") libmagic=N32;;
3086fe5e51b7Smrg  *-64|*"-64 ") libmagic=64-bit;;
3087fe5e51b7Smrg  *) libmagic=never-match;;
3088fe5e51b7Smrg  esac
3089fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3090fe5e51b7Smrg  ;;
3091fe5e51b7Smrg
3092fe5e51b7Smrg# This must be Linux ELF.
3093fe5e51b7Smrglinux* | k*bsd*-gnu)
3094fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3095fe5e51b7Smrg  ;;
3096fe5e51b7Smrg
3097fe5e51b7Smrgnetbsd*)
3098a31a186aSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3099fe5e51b7Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3100fe5e51b7Smrg  else
3101fe5e51b7Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3102fe5e51b7Smrg  fi
3103fe5e51b7Smrg  ;;
3104fe5e51b7Smrg
3105fe5e51b7Smrgnewos6*)
3106fe5e51b7Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3107fe5e51b7Smrg  lt_cv_file_magic_cmd=/usr/bin/file
3108fe5e51b7Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3109fe5e51b7Smrg  ;;
3110fe5e51b7Smrg
3111a31a186aSmrg*nto* | *qnx*)
3112a31a186aSmrg  lt_cv_deplibs_check_method=pass_all
3113fe5e51b7Smrg  ;;
3114fe5e51b7Smrg
3115fe5e51b7Smrgopenbsd*)
3116a31a186aSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3117fe5e51b7Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3118fe5e51b7Smrg  else
3119fe5e51b7Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3120fe5e51b7Smrg  fi
3121fe5e51b7Smrg  ;;
3122fe5e51b7Smrg
3123fe5e51b7Smrgosf3* | osf4* | osf5*)
3124fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3125fe5e51b7Smrg  ;;
3126fe5e51b7Smrg
3127fe5e51b7Smrgrdos*)
3128fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3129fe5e51b7Smrg  ;;
3130fe5e51b7Smrg
3131fe5e51b7Smrgsolaris*)
3132fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3133fe5e51b7Smrg  ;;
3134fe5e51b7Smrg
3135a31a186aSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3136a31a186aSmrg  lt_cv_deplibs_check_method=pass_all
3137a31a186aSmrg  ;;
3138a31a186aSmrg
3139fe5e51b7Smrgsysv4 | sysv4.3*)
3140fe5e51b7Smrg  case $host_vendor in
3141fe5e51b7Smrg  motorola)
3142fe5e51b7Smrg    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]]'
3143fe5e51b7Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3144fe5e51b7Smrg    ;;
3145fe5e51b7Smrg  ncr)
3146fe5e51b7Smrg    lt_cv_deplibs_check_method=pass_all
3147fe5e51b7Smrg    ;;
3148fe5e51b7Smrg  sequent)
3149fe5e51b7Smrg    lt_cv_file_magic_cmd='/bin/file'
3150fe5e51b7Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3151fe5e51b7Smrg    ;;
3152fe5e51b7Smrg  sni)
3153fe5e51b7Smrg    lt_cv_file_magic_cmd='/bin/file'
3154fe5e51b7Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3155fe5e51b7Smrg    lt_cv_file_magic_test_file=/lib/libc.so
3156fe5e51b7Smrg    ;;
3157fe5e51b7Smrg  siemens)
3158fe5e51b7Smrg    lt_cv_deplibs_check_method=pass_all
3159fe5e51b7Smrg    ;;
3160fe5e51b7Smrg  pc)
3161fe5e51b7Smrg    lt_cv_deplibs_check_method=pass_all
3162fe5e51b7Smrg    ;;
3163fe5e51b7Smrg  esac
3164fe5e51b7Smrg  ;;
3165fe5e51b7Smrg
3166a31a186aSmrgtpf*)
3167fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3168fe5e51b7Smrg  ;;
3169fe5e51b7Smrgesac
3170fe5e51b7Smrg])
3171fe5e51b7Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
3172fe5e51b7Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
3173fe5e51b7Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
3174a31a186aSmrg
3175a31a186aSmrg_LT_DECL([], [deplibs_check_method], [1],
3176a31a186aSmrg    [Method to check whether dependent libraries are shared objects])
3177a31a186aSmrg_LT_DECL([], [file_magic_cmd], [1],
3178a31a186aSmrg    [Command to use when deplibs_check_method == "file_magic"])
3179a31a186aSmrg])# _LT_CHECK_MAGIC_METHOD
3180eda3803bSmrg
3181fe5e51b7Smrg
3182a31a186aSmrg# LT_PATH_NM
3183fe5e51b7Smrg# ----------
3184a31a186aSmrg# find the pathname to a BSD- or MS-compatible name lister
3185a31a186aSmrgAC_DEFUN([LT_PATH_NM],
3186a31a186aSmrg[AC_REQUIRE([AC_PROG_CC])dnl
3187a31a186aSmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3188fe5e51b7Smrg[if test -n "$NM"; then
3189fe5e51b7Smrg  # Let the user override the test.
3190fe5e51b7Smrg  lt_cv_path_NM="$NM"
3191fe5e51b7Smrgelse
3192fe5e51b7Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
3193fe5e51b7Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3194fe5e51b7Smrg    lt_nm_to_check="$lt_nm_to_check nm"
3195fe5e51b7Smrg  fi
3196fe5e51b7Smrg  for lt_tmp_nm in $lt_nm_to_check; do
3197fe5e51b7Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3198fe5e51b7Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3199fe5e51b7Smrg      IFS="$lt_save_ifs"
3200fe5e51b7Smrg      test -z "$ac_dir" && ac_dir=.
3201fe5e51b7Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
3202fe5e51b7Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
3203fe5e51b7Smrg	# Check to see if the nm accepts a BSD-compat flag.
3204fe5e51b7Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
3205fe5e51b7Smrg	#   nm: unknown option "B" ignored
3206fe5e51b7Smrg	# Tru64's nm complains that /dev/null is an invalid object file
3207fe5e51b7Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
3208fe5e51b7Smrg	*/dev/null* | *'Invalid file or object type'*)
3209fe5e51b7Smrg	  lt_cv_path_NM="$tmp_nm -B"
3210fe5e51b7Smrg	  break
3211fe5e51b7Smrg	  ;;
3212fe5e51b7Smrg	*)
3213fe5e51b7Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3214fe5e51b7Smrg	  */dev/null*)
3215fe5e51b7Smrg	    lt_cv_path_NM="$tmp_nm -p"
3216fe5e51b7Smrg	    break
3217fe5e51b7Smrg	    ;;
3218fe5e51b7Smrg	  *)
3219fe5e51b7Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3220fe5e51b7Smrg	    continue # so that we can try to find one that supports BSD flags
3221fe5e51b7Smrg	    ;;
3222fe5e51b7Smrg	  esac
3223fe5e51b7Smrg	  ;;
3224fe5e51b7Smrg	esac
3225fe5e51b7Smrg      fi
3226fe5e51b7Smrg    done
3227fe5e51b7Smrg    IFS="$lt_save_ifs"
3228fe5e51b7Smrg  done
3229a31a186aSmrg  : ${lt_cv_path_NM=no}
3230fe5e51b7Smrgfi])
3231a31a186aSmrgif test "$lt_cv_path_NM" != "no"; then
3232a31a186aSmrg  NM="$lt_cv_path_NM"
3233a31a186aSmrgelse
3234a31a186aSmrg  # Didn't find any BSD compatible name lister, look for dumpbin.
3235a31a186aSmrg  AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
3236a31a186aSmrg  AC_SUBST([DUMPBIN])
3237a31a186aSmrg  if test "$DUMPBIN" != ":"; then
3238a31a186aSmrg    NM="$DUMPBIN"
3239a31a186aSmrg  fi
3240a31a186aSmrgfi
3241a31a186aSmrgtest -z "$NM" && NM=nm
3242a31a186aSmrgAC_SUBST([NM])
3243a31a186aSmrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3244a31a186aSmrg
3245a31a186aSmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3246a31a186aSmrg  [lt_cv_nm_interface="BSD nm"
3247a31a186aSmrg  echo "int some_variable = 0;" > conftest.$ac_ext
3248a31a186aSmrg  (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3249a31a186aSmrg  (eval "$ac_compile" 2>conftest.err)
3250a31a186aSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3251a31a186aSmrg  (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3252a31a186aSmrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3253a31a186aSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3254a31a186aSmrg  (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
3255a31a186aSmrg  cat conftest.out >&AS_MESSAGE_LOG_FD
3256a31a186aSmrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3257a31a186aSmrg    lt_cv_nm_interface="MS dumpbin"
3258a31a186aSmrg  fi
3259a31a186aSmrg  rm -f conftest*])
3260a31a186aSmrg])# LT_PATH_NM
3261fe5e51b7Smrg
3262a31a186aSmrg# Old names:
3263a31a186aSmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3264a31a186aSmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3265a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
3266a31a186aSmrgdnl AC_DEFUN([AM_PROG_NM], [])
3267a31a186aSmrgdnl AC_DEFUN([AC_PROG_NM], [])
3268eda3803bSmrg
3269a31a186aSmrg
3270a31a186aSmrg# LT_LIB_M
3271a31a186aSmrg# --------
3272fe5e51b7Smrg# check for math library
3273a31a186aSmrgAC_DEFUN([LT_LIB_M],
3274fe5e51b7Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3275fe5e51b7SmrgLIBM=
3276fe5e51b7Smrgcase $host in
3277fe5e51b7Smrg*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
3278fe5e51b7Smrg  # These system don't have libm, or don't need it
3279fe5e51b7Smrg  ;;
3280fe5e51b7Smrg*-ncr-sysv4.3*)
3281fe5e51b7Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3282fe5e51b7Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3283fe5e51b7Smrg  ;;
3284fe5e51b7Smrg*)
3285fe5e51b7Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
3286fe5e51b7Smrg  ;;
3287fe5e51b7Smrgesac
3288a31a186aSmrgAC_SUBST([LIBM])
3289a31a186aSmrg])# LT_LIB_M
3290fe5e51b7Smrg
3291a31a186aSmrg# Old name:
3292a31a186aSmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3293a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
3294a31a186aSmrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3295fe5e51b7Smrg
3296fe5e51b7Smrg
3297a31a186aSmrg# _LT_COMPILER_NO_RTTI([TAGNAME])
3298a31a186aSmrg# -------------------------------
3299a31a186aSmrgm4_defun([_LT_COMPILER_NO_RTTI],
3300a31a186aSmrg[m4_require([_LT_TAG_COMPILER])dnl
3301fe5e51b7Smrg
3302a31a186aSmrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3303fe5e51b7Smrg
3304a31a186aSmrgif test "$GCC" = yes; then
3305a31a186aSmrg  _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
3306fe5e51b7Smrg
3307a31a186aSmrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3308a31a186aSmrg    lt_cv_prog_compiler_rtti_exceptions,
3309a31a186aSmrg    [-fno-rtti -fno-exceptions], [],
3310a31a186aSmrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3311a31a186aSmrgfi
3312a31a186aSmrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3313a31a186aSmrg	[Compiler flag to turn off builtin functions])
3314a31a186aSmrg])# _LT_COMPILER_NO_RTTI
3315fe5e51b7Smrg
3316fe5e51b7Smrg
3317a31a186aSmrg# _LT_CMD_GLOBAL_SYMBOLS
3318a31a186aSmrg# ----------------------
3319a31a186aSmrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3320a31a186aSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3321a31a186aSmrgAC_REQUIRE([AC_PROG_CC])dnl
3322a31a186aSmrgAC_REQUIRE([LT_PATH_NM])dnl
3323a31a186aSmrgAC_REQUIRE([LT_PATH_LD])dnl
3324a31a186aSmrgm4_require([_LT_DECL_SED])dnl
3325a31a186aSmrgm4_require([_LT_DECL_EGREP])dnl
3326a31a186aSmrgm4_require([_LT_TAG_COMPILER])dnl
3327fe5e51b7Smrg
3328a31a186aSmrg# Check for command to grab the raw symbol name followed by C symbol from nm.
3329a31a186aSmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
3330a31a186aSmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3331fe5e51b7Smrg[
3332a31a186aSmrg# These are sane defaults that work on at least a few old systems.
3333a31a186aSmrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3334fe5e51b7Smrg
3335a31a186aSmrg# Character class describing NM global symbol codes.
3336a31a186aSmrgsymcode='[[BCDEGRST]]'
3337fe5e51b7Smrg
3338a31a186aSmrg# Regexp to match symbols that can be accessed directly from C.
3339a31a186aSmrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3340fe5e51b7Smrg
3341a31a186aSmrg# Define system-specific variables.
3342a31a186aSmrgcase $host_os in
3343a31a186aSmrgaix*)
3344a31a186aSmrg  symcode='[[BCDT]]'
3345a31a186aSmrg  ;;
3346a31a186aSmrgcygwin* | mingw* | pw32* | cegcc*)
3347a31a186aSmrg  symcode='[[ABCDGISTW]]'
3348a31a186aSmrg  ;;
3349a31a186aSmrghpux*)
3350a31a186aSmrg  if test "$host_cpu" = ia64; then
3351a31a186aSmrg    symcode='[[ABCDEGRST]]'
3352a31a186aSmrg  fi
3353a31a186aSmrg  ;;
3354a31a186aSmrgirix* | nonstopux*)
3355a31a186aSmrg  symcode='[[BCDEGRST]]'
3356a31a186aSmrg  ;;
3357a31a186aSmrgosf*)
3358a31a186aSmrg  symcode='[[BCDEGQRST]]'
3359a31a186aSmrg  ;;
3360a31a186aSmrgsolaris*)
3361a31a186aSmrg  symcode='[[BDRT]]'
3362a31a186aSmrg  ;;
3363a31a186aSmrgsco3.2v5*)
3364a31a186aSmrg  symcode='[[DT]]'
3365a31a186aSmrg  ;;
3366a31a186aSmrgsysv4.2uw2*)
3367a31a186aSmrg  symcode='[[DT]]'
3368a31a186aSmrg  ;;
3369a31a186aSmrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
3370a31a186aSmrg  symcode='[[ABDT]]'
3371a31a186aSmrg  ;;
3372a31a186aSmrgsysv4)
3373a31a186aSmrg  symcode='[[DFNSTU]]'
3374a31a186aSmrg  ;;
3375a31a186aSmrgesac
3376fe5e51b7Smrg
3377a31a186aSmrg# If we're using GNU nm, then use its standard symbol codes.
3378a31a186aSmrgcase `$NM -V 2>&1` in
3379a31a186aSmrg*GNU* | *'with BFD'*)
3380a31a186aSmrg  symcode='[[ABCDGIRSTW]]' ;;
3381a31a186aSmrgesac
3382fe5e51b7Smrg
3383a31a186aSmrg# Transform an extracted symbol line into a proper C declaration.
3384a31a186aSmrg# Some systems (esp. on ia64) link data and code symbols differently,
3385a31a186aSmrg# so use this general approach.
3386a31a186aSmrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3387fe5e51b7Smrg
3388a31a186aSmrg# Transform an extracted symbol line into symbol name and symbol address
3389a31a186aSmrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
3390a31a186aSmrglt_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'"
3391fe5e51b7Smrg
3392a31a186aSmrg# Handle CRLF in mingw tool chain
3393a31a186aSmrgopt_cr=
3394a31a186aSmrgcase $build_os in
3395a31a186aSmrgmingw*)
3396a31a186aSmrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
3397a31a186aSmrg  ;;
3398a31a186aSmrgesac
3399fe5e51b7Smrg
3400a31a186aSmrg# Try without a prefix underscore, then with it.
3401a31a186aSmrgfor ac_symprfx in "" "_"; do
3402fe5e51b7Smrg
3403a31a186aSmrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
3404a31a186aSmrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
3405fe5e51b7Smrg
3406a31a186aSmrg  # Write the raw and C identifiers.
3407a31a186aSmrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3408a31a186aSmrg    # Fake it for dumpbin and say T for any non-static function
3409a31a186aSmrg    # and D for any global variable.
3410a31a186aSmrg    # Also find C++ and __fastcall symbols from MSVC++,
3411a31a186aSmrg    # which start with @ or ?.
3412a31a186aSmrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
3413a31a186aSmrg"     {last_section=section; section=\$ 3};"\
3414a31a186aSmrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
3415a31a186aSmrg"     \$ 0!~/External *\|/{next};"\
3416a31a186aSmrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
3417a31a186aSmrg"     {if(hide[section]) next};"\
3418a31a186aSmrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
3419a31a186aSmrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
3420a31a186aSmrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
3421a31a186aSmrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
3422a31a186aSmrg"     ' prfx=^$ac_symprfx]"
3423a31a186aSmrg  else
3424a31a186aSmrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
3425643b027fSmrg  fi
3426fe5e51b7Smrg
3427a31a186aSmrg  # Check to see that the pipe works correctly.
3428a31a186aSmrg  pipe_works=no
3429fe5e51b7Smrg
3430a31a186aSmrg  rm -f conftest*
3431a31a186aSmrg  cat > conftest.$ac_ext <<_LT_EOF
3432a31a186aSmrg#ifdef __cplusplus
3433a31a186aSmrgextern "C" {
3434a31a186aSmrg#endif
3435a31a186aSmrgchar nm_test_var;
3436a31a186aSmrgvoid nm_test_func(void);
3437a31a186aSmrgvoid nm_test_func(void){}
3438a31a186aSmrg#ifdef __cplusplus
3439a31a186aSmrg}
3440a31a186aSmrg#endif
3441a31a186aSmrgint main(){nm_test_var='a';nm_test_func();return(0);}
3442a31a186aSmrg_LT_EOF
3443643b027fSmrg
3444a31a186aSmrg  if AC_TRY_EVAL(ac_compile); then
3445a31a186aSmrg    # Now try to grab the symbols.
3446a31a186aSmrg    nlist=conftest.nm
3447a31a186aSmrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
3448a31a186aSmrg      # Try sorting and uniquifying the output.
3449a31a186aSmrg      if sort "$nlist" | uniq > "$nlist"T; then
3450a31a186aSmrg	mv -f "$nlist"T "$nlist"
3451a31a186aSmrg      else
3452a31a186aSmrg	rm -f "$nlist"T
3453a31a186aSmrg      fi
3454643b027fSmrg
3455a31a186aSmrg      # Make sure that we snagged all the symbols we need.
3456a31a186aSmrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
3457a31a186aSmrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
3458a31a186aSmrg	  cat <<_LT_EOF > conftest.$ac_ext
3459a31a186aSmrg#ifdef __cplusplus
3460a31a186aSmrgextern "C" {
3461a31a186aSmrg#endif
3462643b027fSmrg
3463a31a186aSmrg_LT_EOF
3464a31a186aSmrg	  # Now generate the symbol file.
3465a31a186aSmrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
3466643b027fSmrg
3467a31a186aSmrg	  cat <<_LT_EOF >> conftest.$ac_ext
3468643b027fSmrg
3469a31a186aSmrg/* The mapping between symbol names and symbols.  */
3470a31a186aSmrgconst struct {
3471a31a186aSmrg  const char *name;
3472a31a186aSmrg  void       *address;
3473a31a186aSmrg}
3474a31a186aSmrglt__PROGRAM__LTX_preloaded_symbols[[]] =
3475a31a186aSmrg{
3476a31a186aSmrg  { "@PROGRAM@", (void *) 0 },
3477a31a186aSmrg_LT_EOF
3478a31a186aSmrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
3479a31a186aSmrg	  cat <<\_LT_EOF >> conftest.$ac_ext
3480a31a186aSmrg  {0, (void *) 0}
3481a31a186aSmrg};
3482643b027fSmrg
3483a31a186aSmrg/* This works around a problem in FreeBSD linker */
3484a31a186aSmrg#ifdef FREEBSD_WORKAROUND
3485a31a186aSmrgstatic const void *lt_preloaded_setup() {
3486a31a186aSmrg  return lt__PROGRAM__LTX_preloaded_symbols;
3487a31a186aSmrg}
3488a31a186aSmrg#endif
3489643b027fSmrg
3490a31a186aSmrg#ifdef __cplusplus
3491a31a186aSmrg}
3492a31a186aSmrg#endif
3493a31a186aSmrg_LT_EOF
3494a31a186aSmrg	  # Now try linking the two files.
3495a31a186aSmrg	  mv conftest.$ac_objext conftstm.$ac_objext
3496a31a186aSmrg	  lt_save_LIBS="$LIBS"
3497a31a186aSmrg	  lt_save_CFLAGS="$CFLAGS"
3498a31a186aSmrg	  LIBS="conftstm.$ac_objext"
3499a31a186aSmrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
3500a31a186aSmrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
3501a31a186aSmrg	    pipe_works=yes
3502a31a186aSmrg	  fi
3503a31a186aSmrg	  LIBS="$lt_save_LIBS"
3504a31a186aSmrg	  CFLAGS="$lt_save_CFLAGS"
3505a31a186aSmrg	else
3506a31a186aSmrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
3507a31a186aSmrg	fi
3508a31a186aSmrg      else
3509a31a186aSmrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
3510a31a186aSmrg      fi
3511fe5e51b7Smrg    else
3512a31a186aSmrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
3513fe5e51b7Smrg    fi
3514fe5e51b7Smrg  else
3515a31a186aSmrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
3516a31a186aSmrg    cat conftest.$ac_ext >&5
3517fe5e51b7Smrg  fi
3518a31a186aSmrg  rm -rf conftest* conftst*
3519fe5e51b7Smrg
3520a31a186aSmrg  # Do not use the global_symbol_pipe unless it works.
3521a31a186aSmrg  if test "$pipe_works" = yes; then
3522a31a186aSmrg    break
3523a31a186aSmrg  else
3524a31a186aSmrg    lt_cv_sys_global_symbol_pipe=
3525a31a186aSmrg  fi
3526a31a186aSmrgdone
3527a31a186aSmrg])
3528a31a186aSmrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
3529a31a186aSmrg  lt_cv_sys_global_symbol_to_cdecl=
3530a31a186aSmrgfi
3531a31a186aSmrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
3532a31a186aSmrg  AC_MSG_RESULT(failed)
3533fe5e51b7Smrgelse
3534a31a186aSmrg  AC_MSG_RESULT(ok)
3535fe5e51b7Smrgfi
3536fe5e51b7Smrg
3537a31a186aSmrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
3538a31a186aSmrg    [Take the output of nm and produce a listing of raw symbols and C names])
3539a31a186aSmrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
3540a31a186aSmrg    [Transform the output of nm in a proper C declaration])
3541a31a186aSmrg_LT_DECL([global_symbol_to_c_name_address],
3542a31a186aSmrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
3543a31a186aSmrg    [Transform the output of nm in a C name address pair])
3544a31a186aSmrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
3545a31a186aSmrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
3546a31a186aSmrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
3547a31a186aSmrg]) # _LT_CMD_GLOBAL_SYMBOLS
3548fe5e51b7Smrg
3549fe5e51b7Smrg
3550a31a186aSmrg# _LT_COMPILER_PIC([TAGNAME])
3551a31a186aSmrg# ---------------------------
3552a31a186aSmrgm4_defun([_LT_COMPILER_PIC],
3553a31a186aSmrg[m4_require([_LT_TAG_COMPILER])dnl
3554a31a186aSmrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
3555a31a186aSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
3556a31a186aSmrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
3557fe5e51b7Smrg
3558a31a186aSmrgAC_MSG_CHECKING([for $compiler option to produce PIC])
3559a31a186aSmrgm4_if([$1], [CXX], [
3560a31a186aSmrg  # C++ specific cases for pic, static, wl, etc.
3561a31a186aSmrg  if test "$GXX" = yes; then
3562a31a186aSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3563a31a186aSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3564643b027fSmrg
3565a31a186aSmrg    case $host_os in
3566a31a186aSmrg    aix*)
3567a31a186aSmrg      # All AIX code is PIC.
3568643b027fSmrg      if test "$host_cpu" = ia64; then
3569a31a186aSmrg	# AIX 5 now supports IA64 processor
3570a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3571fe5e51b7Smrg      fi
3572fe5e51b7Smrg      ;;
3573fe5e51b7Smrg
3574a31a186aSmrg    amigaos*)
3575fe5e51b7Smrg      case $host_cpu in
3576a31a186aSmrg      powerpc)
3577a31a186aSmrg            # see comment about AmigaOS4 .so support
3578a31a186aSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3579a31a186aSmrg        ;;
3580a31a186aSmrg      m68k)
3581a31a186aSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
3582a31a186aSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
3583a31a186aSmrg            # like `-m68040'.
3584a31a186aSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3585fe5e51b7Smrg        ;;
3586fe5e51b7Smrg      esac
3587643b027fSmrg      ;;
3588eda3803bSmrg
3589a31a186aSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3590a31a186aSmrg      # PIC is the default for these OSes.
3591a31a186aSmrg      ;;
3592a31a186aSmrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
3593a31a186aSmrg      # This hack is so that the source file can tell whether it is being
3594a31a186aSmrg      # built for inclusion in a dll (and should export symbols for example).
3595a31a186aSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
3596a31a186aSmrg      # (--disable-auto-import) libraries
3597a31a186aSmrg      m4_if([$1], [GCJ], [],
3598a31a186aSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3599a31a186aSmrg      ;;
3600a31a186aSmrg    darwin* | rhapsody*)
3601a31a186aSmrg      # PIC is the default on this platform
3602a31a186aSmrg      # Common symbols not allowed in MH_DYLIB files
3603a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3604a31a186aSmrg      ;;
3605a31a186aSmrg    *djgpp*)
3606a31a186aSmrg      # DJGPP does not support shared libraries at all
3607a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3608a31a186aSmrg      ;;
3609a31a186aSmrg    interix[[3-9]]*)
3610a31a186aSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3611a31a186aSmrg      # Instead, we relocate shared libraries at runtime.
3612a31a186aSmrg      ;;
3613a31a186aSmrg    sysv4*MP*)
3614a31a186aSmrg      if test -d /usr/nec; then
3615a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3616a31a186aSmrg      fi
3617a31a186aSmrg      ;;
3618a31a186aSmrg    hpux*)
3619a31a186aSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3620a31a186aSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
3621a31a186aSmrg      # sets the default TLS model and affects inlining.
3622a31a186aSmrg      case $host_cpu in
3623a31a186aSmrg      hppa*64*)
3624fe5e51b7Smrg	;;
3625643b027fSmrg      *)
3626a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3627fe5e51b7Smrg	;;
3628a31a186aSmrg      esac
3629a31a186aSmrg      ;;
3630a31a186aSmrg    *qnx* | *nto*)
3631a31a186aSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
3632a31a186aSmrg      # it will coredump.
3633a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3634a31a186aSmrg      ;;
3635a31a186aSmrg    *)
3636a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3637a31a186aSmrg      ;;
3638643b027fSmrg    esac
3639a31a186aSmrg  else
3640a31a186aSmrg    case $host_os in
3641a31a186aSmrg      aix[[4-9]]*)
3642a31a186aSmrg	# All AIX code is PIC.
3643a31a186aSmrg	if test "$host_cpu" = ia64; then
3644a31a186aSmrg	  # AIX 5 now supports IA64 processor
3645a31a186aSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3646a31a186aSmrg	else
3647a31a186aSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3648643b027fSmrg	fi
3649643b027fSmrg	;;
3650a31a186aSmrg      chorus*)
3651a31a186aSmrg	case $cc_basename in
3652a31a186aSmrg	cxch68*)
3653a31a186aSmrg	  # Green Hills C++ Compiler
3654a31a186aSmrg	  # _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"
3655643b027fSmrg	  ;;
3656fe5e51b7Smrg	esac
3657fe5e51b7Smrg	;;
3658a31a186aSmrg      dgux*)
3659a31a186aSmrg	case $cc_basename in
3660a31a186aSmrg	  ec++*)
3661a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3662a31a186aSmrg	    ;;
3663a31a186aSmrg	  ghcx*)
3664a31a186aSmrg	    # Green Hills C++ Compiler
3665a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3666a31a186aSmrg	    ;;
3667a31a186aSmrg	  *)
3668a31a186aSmrg	    ;;
3669eda3803bSmrg	esac
3670fe5e51b7Smrg	;;
3671a31a186aSmrg      freebsd* | dragonfly*)
3672a31a186aSmrg	# FreeBSD uses GNU C++
3673fe5e51b7Smrg	;;
3674a31a186aSmrg      hpux9* | hpux10* | hpux11*)
3675a31a186aSmrg	case $cc_basename in
3676a31a186aSmrg	  CC*)
3677a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3678a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3679a31a186aSmrg	    if test "$host_cpu" != ia64; then
3680a31a186aSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3681a31a186aSmrg	    fi
3682a31a186aSmrg	    ;;
3683a31a186aSmrg	  aCC*)
3684a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3685a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3686a31a186aSmrg	    case $host_cpu in
3687a31a186aSmrg	    hppa*64*|ia64*)
3688a31a186aSmrg	      # +Z the default
3689a31a186aSmrg	      ;;
3690a31a186aSmrg	    *)
3691a31a186aSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3692a31a186aSmrg	      ;;
3693a31a186aSmrg	    esac
3694a31a186aSmrg	    ;;
3695a31a186aSmrg	  *)
3696a31a186aSmrg	    ;;
3697a31a186aSmrg	esac
3698fe5e51b7Smrg	;;
3699a31a186aSmrg      interix*)
3700a31a186aSmrg	# This is c89, which is MS Visual C++ (no shared libs)
3701a31a186aSmrg	# Anyone wants to do a port?
3702fe5e51b7Smrg	;;
3703a31a186aSmrg      irix5* | irix6* | nonstopux*)
3704a31a186aSmrg	case $cc_basename in
3705a31a186aSmrg	  CC*)
3706a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3707a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3708a31a186aSmrg	    # CC pic flag -KPIC is the default.
3709a31a186aSmrg	    ;;
3710a31a186aSmrg	  *)
3711a31a186aSmrg	    ;;
3712a31a186aSmrg	esac
3713fe5e51b7Smrg	;;
3714a31a186aSmrg      linux* | k*bsd*-gnu)
3715a31a186aSmrg	case $cc_basename in
3716a31a186aSmrg	  KCC*)
3717a31a186aSmrg	    # KAI C++ Compiler
3718a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
3719a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3720a31a186aSmrg	    ;;
3721a31a186aSmrg	  ecpc* )
3722a31a186aSmrg	    # old Intel C++ for x86_64 which still supported -KPIC.
3723a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3724a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3725a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3726a31a186aSmrg	    ;;
3727a31a186aSmrg	  icpc* )
3728a31a186aSmrg	    # Intel C++, used to be incompatible with GCC.
3729a31a186aSmrg	    # ICC 10 doesn't accept -KPIC any more.
3730a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3731a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3732a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3733a31a186aSmrg	    ;;
3734a31a186aSmrg	  pgCC* | pgcpp*)
3735a31a186aSmrg	    # Portland Group C++ compiler
3736a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3737a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
3738a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3739a31a186aSmrg	    ;;
3740a31a186aSmrg	  cxx*)
3741a31a186aSmrg	    # Compaq C++
3742a31a186aSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
3743a31a186aSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
3744a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3745a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3746a31a186aSmrg	    ;;
3747a31a186aSmrg	  xlc* | xlC*)
3748a31a186aSmrg	    # IBM XL 8.0 on PPC
3749a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3750a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
3751a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
3752a31a186aSmrg	    ;;
3753a31a186aSmrg	  *)
3754a31a186aSmrg	    case `$CC -V 2>&1 | sed 5q` in
3755a31a186aSmrg	    *Sun\ C*)
3756a31a186aSmrg	      # Sun C++ 5.9
3757a31a186aSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3758a31a186aSmrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3759a31a186aSmrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
3760a31a186aSmrg	      ;;
3761a31a186aSmrg	    esac
3762a31a186aSmrg	    ;;
3763a31a186aSmrg	esac
3764fe5e51b7Smrg	;;
3765a31a186aSmrg      lynxos*)
3766fe5e51b7Smrg	;;
3767a31a186aSmrg      m88k*)
3768fe5e51b7Smrg	;;
3769a31a186aSmrg      mvs*)
3770a31a186aSmrg	case $cc_basename in
3771a31a186aSmrg	  cxx*)
3772a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
3773a31a186aSmrg	    ;;
3774a31a186aSmrg	  *)
3775a31a186aSmrg	    ;;
3776a31a186aSmrg	esac
3777fe5e51b7Smrg	;;
3778a31a186aSmrg      netbsd*)
3779643b027fSmrg	;;
3780a31a186aSmrg      *qnx* | *nto*)
3781a31a186aSmrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
3782a31a186aSmrg        # it will coredump.
3783a31a186aSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3784a31a186aSmrg        ;;
3785a31a186aSmrg      osf3* | osf4* | osf5*)
3786a31a186aSmrg	case $cc_basename in
3787a31a186aSmrg	  KCC*)
3788a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
3789a31a186aSmrg	    ;;
3790a31a186aSmrg	  RCC*)
3791a31a186aSmrg	    # Rational C++ 2.4.1
3792a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3793a31a186aSmrg	    ;;
3794a31a186aSmrg	  cxx*)
3795a31a186aSmrg	    # Digital/Compaq C++
3796a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3797a31a186aSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
3798a31a186aSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
3799a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3800a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3801a31a186aSmrg	    ;;
3802a31a186aSmrg	  *)
3803a31a186aSmrg	    ;;
3804a31a186aSmrg	esac
3805643b027fSmrg	;;
3806a31a186aSmrg      psos*)
3807643b027fSmrg	;;
3808a31a186aSmrg      solaris*)
3809a31a186aSmrg	case $cc_basename in
3810a31a186aSmrg	  CC*)
3811a31a186aSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
3812a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3813a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3814a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
3815a31a186aSmrg	    ;;
3816a31a186aSmrg	  gcx*)
3817a31a186aSmrg	    # Green Hills C++ Compiler
3818a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
3819a31a186aSmrg	    ;;
3820a31a186aSmrg	  *)
3821a31a186aSmrg	    ;;
3822a31a186aSmrg	esac
3823643b027fSmrg	;;
3824a31a186aSmrg      sunos4*)
3825a31a186aSmrg	case $cc_basename in
3826a31a186aSmrg	  CC*)
3827a31a186aSmrg	    # Sun C++ 4.x
3828a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3829a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3830a31a186aSmrg	    ;;
3831a31a186aSmrg	  lcc*)
3832a31a186aSmrg	    # Lucid
3833a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3834a31a186aSmrg	    ;;
3835fe5e51b7Smrg	  *)
3836fe5e51b7Smrg	    ;;
3837fe5e51b7Smrg	esac
3838fe5e51b7Smrg	;;
3839a31a186aSmrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
3840a31a186aSmrg	case $cc_basename in
3841a31a186aSmrg	  CC*)
3842a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3843a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3844a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3845a31a186aSmrg	    ;;
3846a31a186aSmrg	esac
3847fe5e51b7Smrg	;;
3848a31a186aSmrg      tandem*)
3849a31a186aSmrg	case $cc_basename in
3850a31a186aSmrg	  NCC*)
3851a31a186aSmrg	    # NonStop-UX NCC 3.20
3852a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3853a31a186aSmrg	    ;;
3854643b027fSmrg	  *)
3855643b027fSmrg	    ;;
3856a31a186aSmrg	esac
3857643b027fSmrg	;;
3858a31a186aSmrg      vxworks*)
3859fe5e51b7Smrg	;;
3860fe5e51b7Smrg      *)
3861a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
3862fe5e51b7Smrg	;;
3863fe5e51b7Smrg    esac
3864a31a186aSmrg  fi
3865a31a186aSmrg],
3866a31a186aSmrg[
3867a31a186aSmrg  if test "$GCC" = yes; then
3868a31a186aSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3869a31a186aSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3870a31a186aSmrg
3871a31a186aSmrg    case $host_os in
3872a31a186aSmrg      aix*)
3873a31a186aSmrg      # All AIX code is PIC.
3874a31a186aSmrg      if test "$host_cpu" = ia64; then
3875a31a186aSmrg	# AIX 5 now supports IA64 processor
3876a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3877a31a186aSmrg      fi
3878a31a186aSmrg      ;;
3879a31a186aSmrg
3880a31a186aSmrg    amigaos*)
3881a31a186aSmrg      case $host_cpu in
3882a31a186aSmrg      powerpc)
3883a31a186aSmrg            # see comment about AmigaOS4 .so support
3884a31a186aSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3885a31a186aSmrg        ;;
3886a31a186aSmrg      m68k)
3887a31a186aSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
3888a31a186aSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
3889a31a186aSmrg            # like `-m68040'.
3890a31a186aSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3891a31a186aSmrg        ;;
3892a31a186aSmrg      esac
3893a31a186aSmrg      ;;
3894a31a186aSmrg
3895a31a186aSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3896a31a186aSmrg      # PIC is the default for these OSes.
3897a31a186aSmrg      ;;
3898a31a186aSmrg
3899a31a186aSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
3900a31a186aSmrg      # This hack is so that the source file can tell whether it is being
3901a31a186aSmrg      # built for inclusion in a dll (and should export symbols for example).
3902a31a186aSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
3903a31a186aSmrg      # (--disable-auto-import) libraries
3904a31a186aSmrg      m4_if([$1], [GCJ], [],
3905a31a186aSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3906a31a186aSmrg      ;;
3907a31a186aSmrg
3908a31a186aSmrg    darwin* | rhapsody*)
3909a31a186aSmrg      # PIC is the default on this platform
3910a31a186aSmrg      # Common symbols not allowed in MH_DYLIB files
3911a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3912a31a186aSmrg      ;;
3913a31a186aSmrg
3914a31a186aSmrg    hpux*)
3915a31a186aSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3916a31a186aSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
3917a31a186aSmrg      # sets the default TLS model and affects inlining.
3918a31a186aSmrg      case $host_cpu in
3919a31a186aSmrg      hppa*64*)
3920a31a186aSmrg	# +Z the default
3921fe5e51b7Smrg	;;
3922fe5e51b7Smrg      *)
3923a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3924eda3803bSmrg	;;
3925a31a186aSmrg      esac
3926a31a186aSmrg      ;;
3927a31a186aSmrg
3928a31a186aSmrg    interix[[3-9]]*)
3929a31a186aSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3930a31a186aSmrg      # Instead, we relocate shared libraries at runtime.
3931a31a186aSmrg      ;;
3932a31a186aSmrg
3933a31a186aSmrg    msdosdjgpp*)
3934a31a186aSmrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
3935a31a186aSmrg      # on systems that don't support them.
3936a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
3937a31a186aSmrg      enable_shared=no
3938a31a186aSmrg      ;;
3939a31a186aSmrg
3940a31a186aSmrg    *nto* | *qnx*)
3941a31a186aSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
3942a31a186aSmrg      # it will coredump.
3943a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3944a31a186aSmrg      ;;
3945a31a186aSmrg
3946a31a186aSmrg    sysv4*MP*)
3947a31a186aSmrg      if test -d /usr/nec; then
3948a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3949a31a186aSmrg      fi
3950a31a186aSmrg      ;;
3951a31a186aSmrg
3952a31a186aSmrg    *)
3953a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3954a31a186aSmrg      ;;
3955643b027fSmrg    esac
3956a31a186aSmrg  else
3957a31a186aSmrg    # PORTME Check for flag to pass linker flags through the system compiler.
3958a31a186aSmrg    case $host_os in
3959a31a186aSmrg    aix*)
3960a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3961a31a186aSmrg      if test "$host_cpu" = ia64; then
3962a31a186aSmrg	# AIX 5 now supports IA64 processor
3963a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3964a31a186aSmrg      else
3965a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3966a31a186aSmrg      fi
3967a31a186aSmrg      ;;
3968a31a186aSmrg
3969a31a186aSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
3970a31a186aSmrg      # This hack is so that the source file can tell whether it is being
3971a31a186aSmrg      # built for inclusion in a dll (and should export symbols for example).
3972a31a186aSmrg      m4_if([$1], [GCJ], [],
3973a31a186aSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3974a31a186aSmrg      ;;
3975a31a186aSmrg
3976a31a186aSmrg    hpux9* | hpux10* | hpux11*)
3977a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3978a31a186aSmrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
3979a31a186aSmrg      # not for PA HP-UX.
3980a31a186aSmrg      case $host_cpu in
3981a31a186aSmrg      hppa*64*|ia64*)
3982a31a186aSmrg	# +Z the default
3983fe5e51b7Smrg	;;
3984fe5e51b7Smrg      *)
3985a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3986fe5e51b7Smrg	;;
3987a31a186aSmrg      esac
3988a31a186aSmrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
3989a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3990a31a186aSmrg      ;;
3991fe5e51b7Smrg
3992a31a186aSmrg    irix5* | irix6* | nonstopux*)
3993a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3994a31a186aSmrg      # PIC (with -KPIC) is the default.
3995a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3996a31a186aSmrg      ;;
3997fe5e51b7Smrg
3998a31a186aSmrg    linux* | k*bsd*-gnu)
3999a31a186aSmrg      case $cc_basename in
4000a31a186aSmrg      # old Intel for x86_64 which still supported -KPIC.
4001a31a186aSmrg      ecc*)
4002a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4003a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4004a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4005a31a186aSmrg        ;;
4006a31a186aSmrg      # icc used to be incompatible with GCC.
4007a31a186aSmrg      # ICC 10 doesn't accept -KPIC any more.
4008a31a186aSmrg      icc* | ifort*)
4009a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4010a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4011a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4012a31a186aSmrg        ;;
4013a31a186aSmrg      # Lahey Fortran 8.1.
4014a31a186aSmrg      lf95*)
4015a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4016a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4017a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4018a31a186aSmrg	;;
4019a31a186aSmrg      pgcc* | pgf77* | pgf90* | pgf95*)
4020a31a186aSmrg        # Portland Group compilers (*not* the Pentium gcc compiler,
4021a31a186aSmrg	# which looks to be a dead project)
4022a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4023a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4024a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4025a31a186aSmrg        ;;
4026a31a186aSmrg      ccc*)
4027a31a186aSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4028a31a186aSmrg        # All Alpha code is PIC.
4029a31a186aSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4030a31a186aSmrg        ;;
4031a31a186aSmrg      xl*)
4032a31a186aSmrg	# IBM XL C 8.0/Fortran 10.1 on PPC
4033a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4034a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4035a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4036a31a186aSmrg	;;
4037a31a186aSmrg      *)
4038a31a186aSmrg	case `$CC -V 2>&1 | sed 5q` in
4039a31a186aSmrg	*Sun\ C*)
4040a31a186aSmrg	  # Sun C 5.9
4041a31a186aSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4042a31a186aSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4043a31a186aSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4044a31a186aSmrg	  ;;
4045a31a186aSmrg	*Sun\ F*)
4046a31a186aSmrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
4047a31a186aSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4048a31a186aSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4049a31a186aSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4050a31a186aSmrg	  ;;
4051a31a186aSmrg	esac
4052a31a186aSmrg	;;
4053a31a186aSmrg      esac
4054a31a186aSmrg      ;;
4055fe5e51b7Smrg
4056a31a186aSmrg    newsos6)
4057a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4058a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4059a31a186aSmrg      ;;
4060fe5e51b7Smrg
4061a31a186aSmrg    *nto* | *qnx*)
4062a31a186aSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4063a31a186aSmrg      # it will coredump.
4064a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4065a31a186aSmrg      ;;
4066fe5e51b7Smrg
4067a31a186aSmrg    osf3* | osf4* | osf5*)
4068a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4069a31a186aSmrg      # All OSF/1 code is PIC.
4070a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4071a31a186aSmrg      ;;
4072fe5e51b7Smrg
4073a31a186aSmrg    rdos*)
4074a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4075a31a186aSmrg      ;;
4076fe5e51b7Smrg
4077a31a186aSmrg    solaris*)
4078a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4079a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4080a31a186aSmrg      case $cc_basename in
4081a31a186aSmrg      f77* | f90* | f95*)
4082a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4083a31a186aSmrg      *)
4084a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4085a31a186aSmrg      esac
4086a31a186aSmrg      ;;
4087fe5e51b7Smrg
4088a31a186aSmrg    sunos4*)
4089a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4090a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4091a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4092a31a186aSmrg      ;;
4093fe5e51b7Smrg
4094a31a186aSmrg    sysv4 | sysv4.2uw2* | sysv4.3*)
4095a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4096a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4097a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4098a31a186aSmrg      ;;
4099fe5e51b7Smrg
4100a31a186aSmrg    sysv4*MP*)
4101a31a186aSmrg      if test -d /usr/nec ;then
4102a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4103a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4104a31a186aSmrg      fi
4105a31a186aSmrg      ;;
4106fe5e51b7Smrg
4107a31a186aSmrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4108a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4109a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4110a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4111a31a186aSmrg      ;;
4112643b027fSmrg
4113a31a186aSmrg    unicos*)
4114a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4115a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4116a31a186aSmrg      ;;
4117fe5e51b7Smrg
4118a31a186aSmrg    uts4*)
4119a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4120a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4121a31a186aSmrg      ;;
4122a31a186aSmrg
4123a31a186aSmrg    *)
4124a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4125a31a186aSmrg      ;;
4126fe5e51b7Smrg    esac
4127a31a186aSmrg  fi
4128a31a186aSmrg])
4129a31a186aSmrgcase $host_os in
4130a31a186aSmrg  # For platforms which do not support PIC, -DPIC is meaningless:
4131a31a186aSmrg  *djgpp*)
4132a31a186aSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4133a31a186aSmrg    ;;
4134a31a186aSmrg  *)
4135a31a186aSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4136a31a186aSmrg    ;;
4137a31a186aSmrgesac
4138a31a186aSmrgAC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4139a31a186aSmrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4140a31a186aSmrg	[How to pass a linker flag through the compiler])
4141fe5e51b7Smrg
4142a31a186aSmrg#
4143a31a186aSmrg# Check to make sure the PIC flag actually works.
4144a31a186aSmrg#
4145a31a186aSmrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4146a31a186aSmrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4147a31a186aSmrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4148a31a186aSmrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4149a31a186aSmrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4150a31a186aSmrg     "" | " "*) ;;
4151a31a186aSmrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4152a31a186aSmrg     esac],
4153a31a186aSmrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4154a31a186aSmrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4155fe5e51b7Smrgfi
4156a31a186aSmrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4157a31a186aSmrg	[Additional compiler flags for building library objects])
4158fe5e51b7Smrg
4159a31a186aSmrg#
4160a31a186aSmrg# Check to make sure the static flag actually works.
4161a31a186aSmrg#
4162a31a186aSmrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4163a31a186aSmrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4164a31a186aSmrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4165a31a186aSmrg  $lt_tmp_static_flag,
4166a31a186aSmrg  [],
4167a31a186aSmrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4168a31a186aSmrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4169a31a186aSmrg	[Compiler flag to prevent dynamic linking])
4170a31a186aSmrg])# _LT_COMPILER_PIC
4171fe5e51b7Smrg
4172643b027fSmrg
4173a31a186aSmrg# _LT_LINKER_SHLIBS([TAGNAME])
4174a31a186aSmrg# ----------------------------
4175a31a186aSmrg# See if the linker supports building shared libraries.
4176a31a186aSmrgm4_defun([_LT_LINKER_SHLIBS],
4177a31a186aSmrg[AC_REQUIRE([LT_PATH_LD])dnl
4178a31a186aSmrgAC_REQUIRE([LT_PATH_NM])dnl
4179a31a186aSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4180a31a186aSmrgm4_require([_LT_DECL_EGREP])dnl
4181a31a186aSmrgm4_require([_LT_DECL_SED])dnl
4182a31a186aSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4183a31a186aSmrgm4_require([_LT_TAG_COMPILER])dnl
4184a31a186aSmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4185a31a186aSmrgm4_if([$1], [CXX], [
4186a31a186aSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4187a31a186aSmrg  case $host_os in
4188a31a186aSmrg  aix[[4-9]]*)
4189a31a186aSmrg    # If we're using GNU nm, then we don't want the "-C" option.
4190a31a186aSmrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
4191a31a186aSmrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4192a31a186aSmrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4193a31a186aSmrg    else
4194a31a186aSmrg      _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'
4195fe5e51b7Smrg    fi
4196fe5e51b7Smrg    ;;
4197a31a186aSmrg  pw32*)
4198a31a186aSmrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
4199643b027fSmrg  ;;
4200a31a186aSmrg  cygwin* | mingw* | cegcc*)
4201a31a186aSmrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
4202a31a186aSmrg  ;;
4203a31a186aSmrg  *)
4204a31a186aSmrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4205a31a186aSmrg  ;;
4206a31a186aSmrg  esac
4207a31a186aSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4208a31a186aSmrg], [
4209a31a186aSmrg  runpath_var=
4210a31a186aSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=
4211a31a186aSmrg  _LT_TAGVAR(always_export_symbols, $1)=no
4212a31a186aSmrg  _LT_TAGVAR(archive_cmds, $1)=
4213a31a186aSmrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
4214a31a186aSmrg  _LT_TAGVAR(compiler_needs_object, $1)=no
4215a31a186aSmrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4216a31a186aSmrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4217a31a186aSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4218a31a186aSmrg  _LT_TAGVAR(hardcode_automatic, $1)=no
4219a31a186aSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
4220a31a186aSmrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4221a31a186aSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4222a31a186aSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
4223a31a186aSmrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4224a31a186aSmrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
4225a31a186aSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4226a31a186aSmrg  _LT_TAGVAR(inherit_rpath, $1)=no
4227a31a186aSmrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
4228a31a186aSmrg  _LT_TAGVAR(module_cmds, $1)=
4229a31a186aSmrg  _LT_TAGVAR(module_expsym_cmds, $1)=
4230a31a186aSmrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4231a31a186aSmrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4232a31a186aSmrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
4233a31a186aSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4234a31a186aSmrg  # include_expsyms should be a list of space-separated symbols to be *always*
4235a31a186aSmrg  # included in the symbol list
4236a31a186aSmrg  _LT_TAGVAR(include_expsyms, $1)=
4237a31a186aSmrg  # exclude_expsyms can be an extended regexp of symbols to exclude
4238a31a186aSmrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
4239a31a186aSmrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
4240a31a186aSmrg  # as well as any symbol that contains `d'.
4241a31a186aSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4242a31a186aSmrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
4243a31a186aSmrg  # platforms (ab)use it in PIC code, but their linkers get confused if
4244a31a186aSmrg  # the symbol is explicitly referenced.  Since portable code cannot
4245a31a186aSmrg  # rely on this symbol name, it's probably fine to never include it in
4246a31a186aSmrg  # preloaded symbol tables.
4247a31a186aSmrg  # Exclude shared library initialization/finalization symbols.
4248a31a186aSmrgdnl Note also adjust exclude_expsyms for C++ above.
4249a31a186aSmrg  extract_expsyms_cmds=
4250fe5e51b7Smrg
4251a31a186aSmrg  case $host_os in
4252a31a186aSmrg  cygwin* | mingw* | pw32* | cegcc*)
4253a31a186aSmrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
4254a31a186aSmrg    # When not using gcc, we currently assume that we are using
4255a31a186aSmrg    # Microsoft Visual C++.
4256a31a186aSmrg    if test "$GCC" != yes; then
4257a31a186aSmrg      with_gnu_ld=no
4258fe5e51b7Smrg    fi
4259fe5e51b7Smrg    ;;
4260a31a186aSmrg  interix*)
4261a31a186aSmrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
4262a31a186aSmrg    with_gnu_ld=yes
4263a31a186aSmrg    ;;
4264a31a186aSmrg  openbsd*)
4265a31a186aSmrg    with_gnu_ld=no
4266a31a186aSmrg    ;;
4267fe5e51b7Smrg  esac
4268fe5e51b7Smrg
4269a31a186aSmrg  _LT_TAGVAR(ld_shlibs, $1)=yes
4270a31a186aSmrg  if test "$with_gnu_ld" = yes; then
4271a31a186aSmrg    # If archive_cmds runs LD, not CC, wlarc should be empty
4272a31a186aSmrg    wlarc='${wl}'
4273fe5e51b7Smrg
4274a31a186aSmrg    # Set some defaults for GNU ld with shared library support. These
4275a31a186aSmrg    # are reset later if shared libraries are not supported. Putting them
4276a31a186aSmrg    # here allows them to be overridden if necessary.
4277a31a186aSmrg    runpath_var=LD_RUN_PATH
4278a31a186aSmrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4279a31a186aSmrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
4280a31a186aSmrg    # ancient GNU ld didn't support --whole-archive et. al.
4281a31a186aSmrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
4282a31a186aSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
4283a31a186aSmrg    else
4284a31a186aSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4285a31a186aSmrg    fi
4286a31a186aSmrg    supports_anon_versioning=no
4287a31a186aSmrg    case `$LD -v 2>&1` in
4288a31a186aSmrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
4289a31a186aSmrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
4290a31a186aSmrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
4291a31a186aSmrg      *\ 2.11.*) ;; # other 2.11 versions
4292a31a186aSmrg      *) supports_anon_versioning=yes ;;
4293a31a186aSmrg    esac
4294fe5e51b7Smrg
4295a31a186aSmrg    # See if GNU ld supports shared libraries.
4296a31a186aSmrg    case $host_os in
4297a31a186aSmrg    aix[[3-9]]*)
4298a31a186aSmrg      # On AIX/PPC, the GNU linker is very broken
4299a31a186aSmrg      if test "$host_cpu" != ia64; then
4300a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
4301a31a186aSmrg	cat <<_LT_EOF 1>&2
4302fe5e51b7Smrg
4303a31a186aSmrg*** Warning: the GNU linker, at least up to release 2.9.1, is reported
4304a31a186aSmrg*** to be unable to reliably create shared libraries on AIX.
4305a31a186aSmrg*** Therefore, libtool is disabling shared libraries support.  If you
4306a31a186aSmrg*** really care for shared libraries, you may want to modify your PATH
4307a31a186aSmrg*** so that a non-GNU linker is found, and then restart.
4308fe5e51b7Smrg
4309a31a186aSmrg_LT_EOF
4310a31a186aSmrg      fi
4311a31a186aSmrg      ;;
4312fe5e51b7Smrg
4313a31a186aSmrg    amigaos*)
4314a31a186aSmrg      case $host_cpu in
4315a31a186aSmrg      powerpc)
4316a31a186aSmrg            # see comment about AmigaOS4 .so support
4317a31a186aSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4318a31a186aSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
4319a31a186aSmrg        ;;
4320a31a186aSmrg      m68k)
4321a31a186aSmrg            _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)'
4322a31a186aSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4323a31a186aSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
4324a31a186aSmrg        ;;
4325a31a186aSmrg      esac
4326a31a186aSmrg      ;;
4327fe5e51b7Smrg
4328a31a186aSmrg    beos*)
4329a31a186aSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4330a31a186aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4331a31a186aSmrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
4332a31a186aSmrg	# support --undefined.  This deserves some investigation.  FIXME
4333a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4334a31a186aSmrg      else
4335a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
4336a31a186aSmrg      fi
4337a31a186aSmrg      ;;
4338fe5e51b7Smrg
4339a31a186aSmrg    cygwin* | mingw* | pw32* | cegcc*)
4340a31a186aSmrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
4341a31a186aSmrg      # as there is no search path for DLLs.
4342a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4343a31a186aSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4344a31a186aSmrg      _LT_TAGVAR(always_export_symbols, $1)=no
4345a31a186aSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4346a31a186aSmrg      _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'
4347a31a186aSmrg
4348a31a186aSmrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
4349a31a186aSmrg        _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'
4350a31a186aSmrg	# If the export-symbols file already is a .def file (1st line
4351a31a186aSmrg	# is EXPORTS), use it as is; otherwise, prepend...
4352a31a186aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
4353a31a186aSmrg	  cp $export_symbols $output_objdir/$soname.def;
4354a31a186aSmrg	else
4355a31a186aSmrg	  echo EXPORTS > $output_objdir/$soname.def;
4356a31a186aSmrg	  cat $export_symbols >> $output_objdir/$soname.def;
4357a31a186aSmrg	fi~
4358a31a186aSmrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4359a31a186aSmrg      else
4360a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
4361a31a186aSmrg      fi
4362a31a186aSmrg      ;;
4363fe5e51b7Smrg
4364a31a186aSmrg    interix[[3-9]]*)
4365a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=no
4366a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4367a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4368a31a186aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4369a31a186aSmrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
4370a31a186aSmrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
4371a31a186aSmrg      # default) and relocated if they conflict, which is a slow very memory
4372a31a186aSmrg      # consuming and fragmenting process.  To avoid this, we pick a random,
4373a31a186aSmrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
4374a31a186aSmrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
4375a31a186aSmrg      _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'
4376a31a186aSmrg      _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'
4377a31a186aSmrg      ;;
4378fe5e51b7Smrg
4379a31a186aSmrg    gnu* | linux* | tpf* | k*bsd*-gnu)
4380a31a186aSmrg      tmp_diet=no
4381a31a186aSmrg      if test "$host_os" = linux-dietlibc; then
4382a31a186aSmrg	case $cc_basename in
4383a31a186aSmrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
4384a31a186aSmrg	esac
4385a31a186aSmrg      fi
4386a31a186aSmrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
4387a31a186aSmrg	 && test "$tmp_diet" = no
4388a31a186aSmrg      then
4389a31a186aSmrg	tmp_addflag=
4390a31a186aSmrg	tmp_sharedflag='-shared'
4391a31a186aSmrg	case $cc_basename,$host_cpu in
4392a31a186aSmrg        pgcc*)				# Portland Group C compiler
4393a31a186aSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
4394a31a186aSmrg	  tmp_addflag=' $pic_flag'
4395a31a186aSmrg	  ;;
4396a31a186aSmrg	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
4397a31a186aSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
4398a31a186aSmrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
4399a31a186aSmrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
4400a31a186aSmrg	  tmp_addflag=' -i_dynamic' ;;
4401a31a186aSmrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
4402a31a186aSmrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
4403a31a186aSmrg	ifc* | ifort*)			# Intel Fortran compiler
4404a31a186aSmrg	  tmp_addflag=' -nofor_main' ;;
4405a31a186aSmrg	lf95*)				# Lahey Fortran 8.1
4406a31a186aSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4407a31a186aSmrg	  tmp_sharedflag='--shared' ;;
4408a31a186aSmrg	xl[[cC]]*)			# IBM XL C 8.0 on PPC (deal with xlf below)
4409a31a186aSmrg	  tmp_sharedflag='-qmkshrobj'
4410a31a186aSmrg	  tmp_addflag= ;;
4411a31a186aSmrg	esac
4412a31a186aSmrg	case `$CC -V 2>&1 | sed 5q` in
4413a31a186aSmrg	*Sun\ C*)			# Sun C 5.9
4414a31a186aSmrg	  _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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
4415a31a186aSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
4416a31a186aSmrg	  tmp_sharedflag='-G' ;;
4417a31a186aSmrg	*Sun\ F*)			# Sun Fortran 8.3
4418a31a186aSmrg	  tmp_sharedflag='-G' ;;
4419a31a186aSmrg	esac
4420a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4421fe5e51b7Smrg
4422a31a186aSmrg        if test "x$supports_anon_versioning" = xyes; then
4423a31a186aSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4424a31a186aSmrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4425a31a186aSmrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
4426a31a186aSmrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
4427a31a186aSmrg        fi
4428fe5e51b7Smrg
4429a31a186aSmrg	case $cc_basename in
4430a31a186aSmrg	xlf*)
4431a31a186aSmrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
4432a31a186aSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
4433a31a186aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4434a31a186aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
4435a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
4436a31a186aSmrg	  if test "x$supports_anon_versioning" = xyes; then
4437a31a186aSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4438a31a186aSmrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4439a31a186aSmrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
4440a31a186aSmrg	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
4441a31a186aSmrg	  fi
4442a31a186aSmrg	  ;;
4443a31a186aSmrg	esac
4444a31a186aSmrg      else
4445a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
4446a31a186aSmrg      fi
4447a31a186aSmrg      ;;
4448fe5e51b7Smrg
4449a31a186aSmrg    netbsd*)
4450a31a186aSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4451a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
4452a31a186aSmrg	wlarc=
4453a31a186aSmrg      else
4454a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4455a31a186aSmrg	_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'
4456a31a186aSmrg      fi
4457a31a186aSmrg      ;;
4458fe5e51b7Smrg
4459a31a186aSmrg    solaris*)
4460a31a186aSmrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
4461a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
4462a31a186aSmrg	cat <<_LT_EOF 1>&2
4463fe5e51b7Smrg
4464a31a186aSmrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
4465a31a186aSmrg*** create shared libraries on Solaris systems.  Therefore, libtool
4466a31a186aSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
4467a31a186aSmrg*** binutils to release 2.9.1 or newer.  Another option is to modify
4468a31a186aSmrg*** your PATH or compiler configuration so that the native linker is
4469a31a186aSmrg*** used, and then restart.
4470fe5e51b7Smrg
4471a31a186aSmrg_LT_EOF
4472a31a186aSmrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4473a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4474a31a186aSmrg	_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'
4475a31a186aSmrg      else
4476a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
4477a31a186aSmrg      fi
4478a31a186aSmrg      ;;
4479fe5e51b7Smrg
4480a31a186aSmrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
4481a31a186aSmrg      case `$LD -v 2>&1` in
4482a31a186aSmrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
4483a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
4484a31a186aSmrg	cat <<_LT_EOF 1>&2
4485fe5e51b7Smrg
4486a31a186aSmrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
4487a31a186aSmrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
4488a31a186aSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
4489a31a186aSmrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
4490a31a186aSmrg*** your PATH or compiler configuration so that the native linker is
4491a31a186aSmrg*** used, and then restart.
4492fe5e51b7Smrg
4493a31a186aSmrg_LT_EOF
4494a31a186aSmrg	;;
4495a31a186aSmrg	*)
4496a31a186aSmrg	  # For security reasons, it is highly recommended that you always
4497a31a186aSmrg	  # use absolute paths for naming shared libraries, and exclude the
4498a31a186aSmrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
4499a31a186aSmrg	  # requires that you compile everything twice, which is a pain.
4500a31a186aSmrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4501a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4502a31a186aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4503a31a186aSmrg	    _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'
4504a31a186aSmrg	  else
4505a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
4506a31a186aSmrg	  fi
4507a31a186aSmrg	;;
4508a31a186aSmrg      esac
4509a31a186aSmrg      ;;
4510fe5e51b7Smrg
4511a31a186aSmrg    sunos4*)
4512a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4513a31a186aSmrg      wlarc=
4514a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4515a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4516a31a186aSmrg      ;;
4517fe5e51b7Smrg
4518a31a186aSmrg    *)
4519a31a186aSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4520a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4521a31a186aSmrg	_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'
4522a31a186aSmrg      else
4523a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
4524a31a186aSmrg      fi
4525a31a186aSmrg      ;;
4526a31a186aSmrg    esac
4527fe5e51b7Smrg
4528a31a186aSmrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
4529a31a186aSmrg      runpath_var=
4530a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4531a31a186aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4532a31a186aSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4533a31a186aSmrg    fi
4534a31a186aSmrg  else
4535a31a186aSmrg    # PORTME fill in a description of your system's linker (not GNU ld)
4536a31a186aSmrg    case $host_os in
4537a31a186aSmrg    aix3*)
4538a31a186aSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4539a31a186aSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
4540a31a186aSmrg      _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'
4541a31a186aSmrg      # Note: this linker hardcodes the directories in LIBPATH if there
4542a31a186aSmrg      # are no directories specified by -L.
4543a31a186aSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4544a31a186aSmrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
4545a31a186aSmrg	# Neither direct hardcoding nor static linking is supported with a
4546a31a186aSmrg	# broken collect2.
4547a31a186aSmrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
4548a31a186aSmrg      fi
4549a31a186aSmrg      ;;
4550fe5e51b7Smrg
4551a31a186aSmrg    aix[[4-9]]*)
4552a31a186aSmrg      if test "$host_cpu" = ia64; then
4553a31a186aSmrg	# On IA64, the linker does run time linking by default, so we don't
4554a31a186aSmrg	# have to do anything special.
4555a31a186aSmrg	aix_use_runtimelinking=no
4556a31a186aSmrg	exp_sym_flag='-Bexport'
4557a31a186aSmrg	no_entry_flag=""
4558a31a186aSmrg      else
4559a31a186aSmrg	# If we're using GNU nm, then we don't want the "-C" option.
4560a31a186aSmrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
4561a31a186aSmrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4562a31a186aSmrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4563a31a186aSmrg	else
4564a31a186aSmrg	  _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'
4565a31a186aSmrg	fi
4566a31a186aSmrg	aix_use_runtimelinking=no
4567fe5e51b7Smrg
4568a31a186aSmrg	# Test if we are trying to use run time linking or normal
4569a31a186aSmrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
4570a31a186aSmrg	# need to do runtime linking.
4571a31a186aSmrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
4572a31a186aSmrg	  for ld_flag in $LDFLAGS; do
4573a31a186aSmrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
4574a31a186aSmrg	    aix_use_runtimelinking=yes
4575a31a186aSmrg	    break
4576a31a186aSmrg	  fi
4577a31a186aSmrg	  done
4578a31a186aSmrg	  ;;
4579a31a186aSmrg	esac
4580fe5e51b7Smrg
4581a31a186aSmrg	exp_sym_flag='-bexport'
4582a31a186aSmrg	no_entry_flag='-bnoentry'
4583a31a186aSmrg      fi
4584fe5e51b7Smrg
4585a31a186aSmrg      # When large executables or shared objects are built, AIX ld can
4586a31a186aSmrg      # have problems creating the table of contents.  If linking a library
4587a31a186aSmrg      # or program results in "error TOC overflow" add -mminimal-toc to
4588a31a186aSmrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
4589a31a186aSmrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
4590a31a186aSmrg
4591a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)=''
4592a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4593a31a186aSmrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4594a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
4595a31a186aSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
4596a31a186aSmrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
4597fe5e51b7Smrg
4598a31a186aSmrg      if test "$GCC" = yes; then
4599a31a186aSmrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
4600a31a186aSmrg	# We only want to do this on AIX 4.2 and lower, the check
4601a31a186aSmrg	# below for broken collect2 doesn't work under 4.3+
4602a31a186aSmrg	  collect2name=`${CC} -print-prog-name=collect2`
4603a31a186aSmrg	  if test -f "$collect2name" &&
4604a31a186aSmrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
4605a31a186aSmrg	  then
4606a31a186aSmrg	  # We have reworked collect2
4607a31a186aSmrg	  :
4608a31a186aSmrg	  else
4609a31a186aSmrg	  # We have old collect2
4610a31a186aSmrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
4611a31a186aSmrg	  # It fails to find uninstalled libraries when the uninstalled
4612a31a186aSmrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
4613a31a186aSmrg	  # to unsupported forces relinking
4614a31a186aSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
4615a31a186aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4616a31a186aSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4617a31a186aSmrg	  fi
4618a31a186aSmrg	  ;;
4619a31a186aSmrg	esac
4620a31a186aSmrg	shared_flag='-shared'
4621a31a186aSmrg	if test "$aix_use_runtimelinking" = yes; then
4622a31a186aSmrg	  shared_flag="$shared_flag "'${wl}-G'
4623a31a186aSmrg	fi
4624a31a186aSmrg      else
4625a31a186aSmrg	# not using gcc
4626a31a186aSmrg	if test "$host_cpu" = ia64; then
4627a31a186aSmrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
4628a31a186aSmrg	# chokes on -Wl,-G. The following line is correct:
4629a31a186aSmrg	  shared_flag='-G'
4630a31a186aSmrg	else
4631a31a186aSmrg	  if test "$aix_use_runtimelinking" = yes; then
4632a31a186aSmrg	    shared_flag='${wl}-G'
4633a31a186aSmrg	  else
4634a31a186aSmrg	    shared_flag='${wl}-bM:SRE'
4635a31a186aSmrg	  fi
4636a31a186aSmrg	fi
4637a31a186aSmrg      fi
4638fe5e51b7Smrg
4639a31a186aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
4640a31a186aSmrg      # It seems that -bexpall does not export symbols beginning with
4641a31a186aSmrg      # underscore (_), so it is better to generate a list of symbols to export.
4642a31a186aSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
4643a31a186aSmrg      if test "$aix_use_runtimelinking" = yes; then
4644a31a186aSmrg	# Warning - without using the other runtime loading flags (-brtl),
4645a31a186aSmrg	# -berok will link without error, but may produce a broken library.
4646a31a186aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
4647a31a186aSmrg        # Determine the default libpath from the value encoded in an
4648a31a186aSmrg        # empty executable.
4649a31a186aSmrg        _LT_SYS_MODULE_PATH_AIX
4650a31a186aSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4651a31a186aSmrg        _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 $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
4652a31a186aSmrg      else
4653a31a186aSmrg	if test "$host_cpu" = ia64; then
4654a31a186aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
4655a31a186aSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
4656a31a186aSmrg	  _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"
4657a31a186aSmrg	else
4658a31a186aSmrg	 # Determine the default libpath from the value encoded in an
4659a31a186aSmrg	 # empty executable.
4660a31a186aSmrg	 _LT_SYS_MODULE_PATH_AIX
4661a31a186aSmrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4662a31a186aSmrg	  # Warning - without using the other run time loading flags,
4663a31a186aSmrg	  # -berok will link without error, but may produce a broken library.
4664a31a186aSmrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
4665a31a186aSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
4666a31a186aSmrg	  # Exported symbols can be pulled into shared objects from archives
4667a31a186aSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
4668a31a186aSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
4669a31a186aSmrg	  # This is similar to how AIX traditionally builds its shared libraries.
4670a31a186aSmrg	  _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'
4671a31a186aSmrg	fi
4672a31a186aSmrg      fi
4673a31a186aSmrg      ;;
4674fe5e51b7Smrg
4675a31a186aSmrg    amigaos*)
4676a31a186aSmrg      case $host_cpu in
4677a31a186aSmrg      powerpc)
4678a31a186aSmrg            # see comment about AmigaOS4 .so support
4679a31a186aSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4680a31a186aSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
4681a31a186aSmrg        ;;
4682a31a186aSmrg      m68k)
4683a31a186aSmrg            _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)'
4684a31a186aSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4685a31a186aSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
4686a31a186aSmrg        ;;
4687a31a186aSmrg      esac
4688a31a186aSmrg      ;;
4689fe5e51b7Smrg
4690a31a186aSmrg    bsdi[[45]]*)
4691a31a186aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
4692a31a186aSmrg      ;;
4693fe5e51b7Smrg
4694a31a186aSmrg    cygwin* | mingw* | pw32* | cegcc*)
4695a31a186aSmrg      # When not using gcc, we currently assume that we are using
4696a31a186aSmrg      # Microsoft Visual C++.
4697a31a186aSmrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
4698a31a186aSmrg      # no search path for DLLs.
4699a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
4700a31a186aSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4701a31a186aSmrg      # Tell ltmain to make .lib files, not .a files.
4702a31a186aSmrg      libext=lib
4703a31a186aSmrg      # Tell ltmain to make .dll files, not .so files.
4704a31a186aSmrg      shrext_cmds=".dll"
4705a31a186aSmrg      # FIXME: Setting linknames here is a bad hack.
4706a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
4707a31a186aSmrg      # The linker will automatically build a .lib file if we build a DLL.
4708a31a186aSmrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
4709a31a186aSmrg      # FIXME: Should let the user specify the lib program.
4710a31a186aSmrg      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
4711a31a186aSmrg      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
4712a31a186aSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4713a31a186aSmrg      ;;
4714fe5e51b7Smrg
4715a31a186aSmrg    darwin* | rhapsody*)
4716a31a186aSmrg      _LT_DARWIN_LINKER_FEATURES($1)
4717a31a186aSmrg      ;;
4718fe5e51b7Smrg
4719a31a186aSmrg    dgux*)
4720a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
4721a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4722a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4723a31a186aSmrg      ;;
4724fe5e51b7Smrg
4725a31a186aSmrg    freebsd1*)
4726a31a186aSmrg      _LT_TAGVAR(ld_shlibs, $1)=no
4727a31a186aSmrg      ;;
4728fe5e51b7Smrg
4729a31a186aSmrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
4730a31a186aSmrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
4731a31a186aSmrg    # does not break anything, and helps significantly (at the cost of a little
4732a31a186aSmrg    # extra space).
4733a31a186aSmrg    freebsd2.2*)
4734a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
4735a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4736a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4737a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4738a31a186aSmrg      ;;
4739fe5e51b7Smrg
4740a31a186aSmrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
4741a31a186aSmrg    freebsd2*)
4742a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4743a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4744a31a186aSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4745a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4746a31a186aSmrg      ;;
4747fe5e51b7Smrg
4748a31a186aSmrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
4749a31a186aSmrg    freebsd* | dragonfly*)
4750a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
4751a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4752a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4753a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4754a31a186aSmrg      ;;
4755fe5e51b7Smrg
4756a31a186aSmrg    hpux9*)
4757a31a186aSmrg      if test "$GCC" = yes; then
4758a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
4759a31a186aSmrg      else
4760a31a186aSmrg	_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'
4761a31a186aSmrg      fi
4762a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4763a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4764a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4765fe5e51b7Smrg
4766a31a186aSmrg      # hardcode_minus_L: Not really in the search PATH,
4767a31a186aSmrg      # but as the default location of the library.
4768a31a186aSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4769a31a186aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4770a31a186aSmrg      ;;
4771fe5e51b7Smrg
4772a31a186aSmrg    hpux10*)
4773a31a186aSmrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
4774a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4775a31a186aSmrg      else
4776a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
4777a31a186aSmrg      fi
4778a31a186aSmrg      if test "$with_gnu_ld" = no; then
4779a31a186aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4780a31a186aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
4781a31a186aSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
4782a31a186aSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
4783a31a186aSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4784a31a186aSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4785a31a186aSmrg	# hardcode_minus_L: Not really in the search PATH,
4786a31a186aSmrg	# but as the default location of the library.
4787a31a186aSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
4788a31a186aSmrg      fi
4789a31a186aSmrg      ;;
4790fe5e51b7Smrg
4791a31a186aSmrg    hpux11*)
4792a31a186aSmrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
4793a31a186aSmrg	case $host_cpu in
4794a31a186aSmrg	hppa*64*)
4795a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4796a31a186aSmrg	  ;;
4797a31a186aSmrg	ia64*)
4798a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
4799a31a186aSmrg	  ;;
4800a31a186aSmrg	*)
4801a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4802a31a186aSmrg	  ;;
4803a31a186aSmrg	esac
4804a31a186aSmrg      else
4805a31a186aSmrg	case $host_cpu in
4806a31a186aSmrg	hppa*64*)
4807a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4808a31a186aSmrg	  ;;
4809a31a186aSmrg	ia64*)
4810a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
4811a31a186aSmrg	  ;;
4812a31a186aSmrg	*)
4813a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4814a31a186aSmrg	  ;;
4815a31a186aSmrg	esac
4816a31a186aSmrg      fi
4817a31a186aSmrg      if test "$with_gnu_ld" = no; then
4818a31a186aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4819a31a186aSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
4820fe5e51b7Smrg
4821a31a186aSmrg	case $host_cpu in
4822a31a186aSmrg	hppa*64*|ia64*)
4823a31a186aSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
4824a31a186aSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4825a31a186aSmrg	  ;;
4826a31a186aSmrg	*)
4827a31a186aSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
4828a31a186aSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4829a31a186aSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4830fe5e51b7Smrg
4831a31a186aSmrg	  # hardcode_minus_L: Not really in the search PATH,
4832a31a186aSmrg	  # but as the default location of the library.
4833a31a186aSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
4834a31a186aSmrg	  ;;
4835a31a186aSmrg	esac
4836a31a186aSmrg      fi
4837eda3803bSmrg      ;;
4838a31a186aSmrg
4839a31a186aSmrg    irix5* | irix6* | nonstopux*)
4840a31a186aSmrg      if test "$GCC" = yes; then
4841a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
4842a31a186aSmrg	# Try to use the -exported_symbol ld option, if it does not
4843a31a186aSmrg	# work, assume that -exports_file does not work either and
4844a31a186aSmrg	# implicitly export all symbols.
4845a31a186aSmrg        save_LDFLAGS="$LDFLAGS"
4846a31a186aSmrg        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
4847a31a186aSmrg        AC_LINK_IFELSE(int foo(void) {},
4848a31a186aSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
4849a31a186aSmrg        )
4850a31a186aSmrg        LDFLAGS="$save_LDFLAGS"
4851a31a186aSmrg      else
4852a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
4853a31a186aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
4854a31a186aSmrg      fi
4855a31a186aSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4856a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4857a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4858a31a186aSmrg      _LT_TAGVAR(inherit_rpath, $1)=yes
4859a31a186aSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
4860fe5e51b7Smrg      ;;
4861eda3803bSmrg
4862a31a186aSmrg    netbsd*)
4863a31a186aSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4864a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
4865a31a186aSmrg      else
4866a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
4867a31a186aSmrg      fi
4868a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4869a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4870a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4871a31a186aSmrg      ;;
4872fe5e51b7Smrg
4873a31a186aSmrg    newsos6)
4874a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
4875a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4876a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4877a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4878a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4879a31a186aSmrg      ;;
4880fe5e51b7Smrg
4881a31a186aSmrg    *nto* | *qnx*)
4882a31a186aSmrg      ;;
4883fe5e51b7Smrg
4884a31a186aSmrg    openbsd*)
4885a31a186aSmrg      if test -f /usr/libexec/ld.so; then
4886a31a186aSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
4887a31a186aSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4888a31a186aSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4889a31a186aSmrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4890a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
4891a31a186aSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
4892a31a186aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4893a31a186aSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4894a31a186aSmrg	else
4895a31a186aSmrg	  case $host_os in
4896a31a186aSmrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
4897a31a186aSmrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4898a31a186aSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4899a31a186aSmrg	     ;;
4900a31a186aSmrg	   *)
4901a31a186aSmrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
4902a31a186aSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4903a31a186aSmrg	     ;;
4904a31a186aSmrg	  esac
4905a31a186aSmrg	fi
4906a31a186aSmrg      else
4907a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
4908a31a186aSmrg      fi
4909a31a186aSmrg      ;;
4910fe5e51b7Smrg
4911a31a186aSmrg    os2*)
4912a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4913a31a186aSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4914a31a186aSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4915a31a186aSmrg      _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'
4916a31a186aSmrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
4917a31a186aSmrg      ;;
4918fe5e51b7Smrg
4919a31a186aSmrg    osf3*)
4920a31a186aSmrg      if test "$GCC" = yes; then
4921a31a186aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
4922a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
4923a31a186aSmrg      else
4924a31a186aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
4925a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
4926a31a186aSmrg      fi
4927a31a186aSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4928a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4929a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4930a31a186aSmrg      ;;
4931fe5e51b7Smrg
4932a31a186aSmrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
4933a31a186aSmrg      if test "$GCC" = yes; then
4934a31a186aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
4935a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
4936a31a186aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4937a31a186aSmrg      else
4938a31a186aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
4939a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
4940a31a186aSmrg	_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~
4941a31a186aSmrg	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
4942fe5e51b7Smrg
4943a31a186aSmrg	# Both c and cxx compiler support -rpath directly
4944a31a186aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
4945a31a186aSmrg      fi
4946a31a186aSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4947a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4948a31a186aSmrg      ;;
4949fe5e51b7Smrg
4950a31a186aSmrg    solaris*)
4951a31a186aSmrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
4952a31a186aSmrg      if test "$GCC" = yes; then
4953a31a186aSmrg	wlarc='${wl}'
4954a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4955a31a186aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4956a31a186aSmrg	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
4957a31a186aSmrg      else
4958a31a186aSmrg	case `$CC -V 2>&1` in
4959a31a186aSmrg	*"Compilers 5.0"*)
4960a31a186aSmrg	  wlarc=''
4961a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
4962a31a186aSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4963a31a186aSmrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
4964a31a186aSmrg	  ;;
4965a31a186aSmrg	*)
4966a31a186aSmrg	  wlarc='${wl}'
4967a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
4968a31a186aSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4969a31a186aSmrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
4970a31a186aSmrg	  ;;
4971a31a186aSmrg	esac
4972a31a186aSmrg      fi
4973a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4974a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4975a31a186aSmrg      case $host_os in
4976a31a186aSmrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
4977a31a186aSmrg      *)
4978a31a186aSmrg	# The compiler driver will combine and reorder linker options,
4979a31a186aSmrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
4980a31a186aSmrg	# but is careful enough not to reorder.
4981a31a186aSmrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
4982a31a186aSmrg	if test "$GCC" = yes; then
4983a31a186aSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
4984a31a186aSmrg	else
4985a31a186aSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
4986a31a186aSmrg	fi
4987a31a186aSmrg	;;
4988a31a186aSmrg      esac
4989a31a186aSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
4990a31a186aSmrg      ;;
4991fe5e51b7Smrg
4992a31a186aSmrg    sunos4*)
4993a31a186aSmrg      if test "x$host_vendor" = xsequent; then
4994a31a186aSmrg	# Use $CC to link under sequent, because it throws in some extra .o
4995a31a186aSmrg	# files that make .init and .fini sections work.
4996a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
4997a31a186aSmrg      else
4998a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
4999a31a186aSmrg      fi
5000a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5001a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5002a31a186aSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5003a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5004a31a186aSmrg      ;;
5005fe5e51b7Smrg
5006a31a186aSmrg    sysv4)
5007a31a186aSmrg      case $host_vendor in
5008a31a186aSmrg	sni)
5009a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5010a31a186aSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5011a31a186aSmrg	;;
5012a31a186aSmrg	siemens)
5013a31a186aSmrg	  ## LD is ld it makes a PLAMLIB
5014a31a186aSmrg	  ## CC just makes a GrossModule.
5015a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5016a31a186aSmrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5017a31a186aSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
5018a31a186aSmrg        ;;
5019a31a186aSmrg	motorola)
5020a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5021a31a186aSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
5022a31a186aSmrg	;;
5023a31a186aSmrg      esac
5024a31a186aSmrg      runpath_var='LD_RUN_PATH'
5025a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5026a31a186aSmrg      ;;
5027fe5e51b7Smrg
5028a31a186aSmrg    sysv4.3*)
5029a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5030a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5031a31a186aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
5032a31a186aSmrg      ;;
5033fe5e51b7Smrg
5034a31a186aSmrg    sysv4*MP*)
5035a31a186aSmrg      if test -d /usr/nec; then
5036a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5037a31a186aSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5038a31a186aSmrg	runpath_var=LD_RUN_PATH
5039a31a186aSmrg	hardcode_runpath_var=yes
5040a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
5041a31a186aSmrg      fi
5042a31a186aSmrg      ;;
5043fe5e51b7Smrg
5044a31a186aSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
5045a31a186aSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5046a31a186aSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5047a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5048a31a186aSmrg      runpath_var='LD_RUN_PATH'
5049fe5e51b7Smrg
5050a31a186aSmrg      if test "$GCC" = yes; then
5051a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5052a31a186aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5053a31a186aSmrg      else
5054a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5055a31a186aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5056a31a186aSmrg      fi
5057a31a186aSmrg      ;;
5058fe5e51b7Smrg
5059a31a186aSmrg    sysv5* | sco3.2v5* | sco5v6*)
5060a31a186aSmrg      # Note: We can NOT use -z defs as we might desire, because we do not
5061a31a186aSmrg      # link with -lc, and that would cause any symbols used from libc to
5062a31a186aSmrg      # always be unresolved, which means just about no library would
5063a31a186aSmrg      # ever link correctly.  If we're not using GNU ld we use -z text
5064a31a186aSmrg      # though, which does catch some bad symbols but isn't as heavy-handed
5065a31a186aSmrg      # as -z defs.
5066a31a186aSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5067a31a186aSmrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
5068a31a186aSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5069a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5070a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
5071a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5072a31a186aSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5073a31a186aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
5074a31a186aSmrg      runpath_var='LD_RUN_PATH'
5075fe5e51b7Smrg
5076a31a186aSmrg      if test "$GCC" = yes; then
5077a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5078a31a186aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5079a31a186aSmrg      else
5080a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5081a31a186aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5082a31a186aSmrg      fi
5083a31a186aSmrg      ;;
5084fe5e51b7Smrg
5085a31a186aSmrg    uts4*)
5086a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5087a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5088a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5089a31a186aSmrg      ;;
5090fe5e51b7Smrg
5091a31a186aSmrg    *)
5092a31a186aSmrg      _LT_TAGVAR(ld_shlibs, $1)=no
5093a31a186aSmrg      ;;
5094a31a186aSmrg    esac
5095fe5e51b7Smrg
5096a31a186aSmrg    if test x$host_vendor = xsni; then
5097a31a186aSmrg      case $host in
5098a31a186aSmrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5099a31a186aSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
5100a31a186aSmrg	;;
5101a31a186aSmrg      esac
5102a31a186aSmrg    fi
5103a31a186aSmrg  fi
5104a31a186aSmrg])
5105a31a186aSmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
5106a31a186aSmrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
5107fe5e51b7Smrg
5108a31a186aSmrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
5109fe5e51b7Smrg
5110a31a186aSmrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
5111a31a186aSmrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
5112a31a186aSmrg_LT_DECL([], [extract_expsyms_cmds], [2],
5113a31a186aSmrg    [The commands to extract the exported symbol list from a shared archive])
5114fe5e51b7Smrg
5115a31a186aSmrg#
5116a31a186aSmrg# Do we need to explicitly link libc?
5117a31a186aSmrg#
5118a31a186aSmrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
5119a31a186aSmrgx|xyes)
5120a31a186aSmrg  # Assume -lc should be added
5121a31a186aSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5122fe5e51b7Smrg
5123a31a186aSmrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
5124a31a186aSmrg    case $_LT_TAGVAR(archive_cmds, $1) in
5125a31a186aSmrg    *'~'*)
5126a31a186aSmrg      # FIXME: we may have to deal with multi-command sequences.
5127a31a186aSmrg      ;;
5128a31a186aSmrg    '$CC '*)
5129a31a186aSmrg      # Test whether the compiler implicitly links with -lc since on some
5130a31a186aSmrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
5131a31a186aSmrg      # to ld, don't add -lc before -lgcc.
5132a31a186aSmrg      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
5133a31a186aSmrg      $RM conftest*
5134a31a186aSmrg      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5135fe5e51b7Smrg
5136a31a186aSmrg      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
5137a31a186aSmrg        soname=conftest
5138a31a186aSmrg        lib=conftest
5139a31a186aSmrg        libobjs=conftest.$ac_objext
5140a31a186aSmrg        deplibs=
5141a31a186aSmrg        wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
5142a31a186aSmrg	pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
5143a31a186aSmrg        compiler_flags=-v
5144a31a186aSmrg        linker_flags=-v
5145a31a186aSmrg        verstring=
5146a31a186aSmrg        output_objdir=.
5147a31a186aSmrg        libname=conftest
5148a31a186aSmrg        lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
5149a31a186aSmrg        _LT_TAGVAR(allow_undefined_flag, $1)=
5150a31a186aSmrg        if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
5151a31a186aSmrg        then
5152a31a186aSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5153a31a186aSmrg        else
5154a31a186aSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5155a31a186aSmrg        fi
5156a31a186aSmrg        _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
5157a31a186aSmrg      else
5158a31a186aSmrg        cat conftest.err 1>&5
5159a31a186aSmrg      fi
5160a31a186aSmrg      $RM conftest*
5161a31a186aSmrg      AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
5162a31a186aSmrg      ;;
5163a31a186aSmrg    esac
5164a31a186aSmrg  fi
5165a31a186aSmrg  ;;
5166a31a186aSmrgesac
5167fe5e51b7Smrg
5168a31a186aSmrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
5169a31a186aSmrg    [Whether or not to add -lc for building shared libraries])
5170a31a186aSmrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
5171a31a186aSmrg    [enable_shared_with_static_runtimes], [0],
5172a31a186aSmrg    [Whether or not to disallow shared libs when runtime libs are static])
5173a31a186aSmrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
5174a31a186aSmrg    [Compiler flag to allow reflexive dlopens])
5175a31a186aSmrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
5176a31a186aSmrg    [Compiler flag to generate shared objects directly from archives])
5177a31a186aSmrg_LT_TAGDECL([], [compiler_needs_object], [1],
5178a31a186aSmrg    [Whether the compiler copes with passing no objects directly])
5179a31a186aSmrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
5180a31a186aSmrg    [Create an old-style archive from a shared archive])
5181a31a186aSmrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
5182a31a186aSmrg    [Create a temporary old-style archive to link instead of a shared archive])
5183a31a186aSmrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
5184a31a186aSmrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
5185a31a186aSmrg_LT_TAGDECL([], [module_cmds], [2],
5186a31a186aSmrg    [Commands used to build a loadable module if different from building
5187a31a186aSmrg    a shared archive.])
5188a31a186aSmrg_LT_TAGDECL([], [module_expsym_cmds], [2])
5189a31a186aSmrg_LT_TAGDECL([], [with_gnu_ld], [1],
5190a31a186aSmrg    [Whether we are building with GNU ld or not])
5191a31a186aSmrg_LT_TAGDECL([], [allow_undefined_flag], [1],
5192a31a186aSmrg    [Flag that allows shared libraries with undefined symbols to be built])
5193a31a186aSmrg_LT_TAGDECL([], [no_undefined_flag], [1],
5194a31a186aSmrg    [Flag that enforces no undefined symbols])
5195a31a186aSmrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
5196a31a186aSmrg    [Flag to hardcode $libdir into a binary during linking.
5197a31a186aSmrg    This must work even if $libdir does not exist])
5198a31a186aSmrg_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
5199a31a186aSmrg    [[If ld is used when linking, flag to hardcode $libdir into a binary
5200a31a186aSmrg    during linking.  This must work even if $libdir does not exist]])
5201a31a186aSmrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
5202a31a186aSmrg    [Whether we need a single "-rpath" flag with a separated argument])
5203a31a186aSmrg_LT_TAGDECL([], [hardcode_direct], [0],
5204a31a186aSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5205a31a186aSmrg    DIR into the resulting binary])
5206a31a186aSmrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
5207a31a186aSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5208a31a186aSmrg    DIR into the resulting binary and the resulting library dependency is
5209a31a186aSmrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
5210a31a186aSmrg    library is relocated])
5211a31a186aSmrg_LT_TAGDECL([], [hardcode_minus_L], [0],
5212a31a186aSmrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
5213a31a186aSmrg    into the resulting binary])
5214a31a186aSmrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
5215a31a186aSmrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
5216a31a186aSmrg    into the resulting binary])
5217a31a186aSmrg_LT_TAGDECL([], [hardcode_automatic], [0],
5218a31a186aSmrg    [Set to "yes" if building a shared library automatically hardcodes DIR
5219a31a186aSmrg    into the library and all subsequent libraries and executables linked
5220a31a186aSmrg    against it])
5221a31a186aSmrg_LT_TAGDECL([], [inherit_rpath], [0],
5222a31a186aSmrg    [Set to yes if linker adds runtime paths of dependent libraries
5223a31a186aSmrg    to runtime path list])
5224a31a186aSmrg_LT_TAGDECL([], [link_all_deplibs], [0],
5225a31a186aSmrg    [Whether libtool must link a program against all its dependency libraries])
5226a31a186aSmrg_LT_TAGDECL([], [fix_srcfile_path], [1],
5227a31a186aSmrg    [Fix the shell variable $srcfile for the compiler])
5228a31a186aSmrg_LT_TAGDECL([], [always_export_symbols], [0],
5229a31a186aSmrg    [Set to "yes" if exported symbols are required])
5230a31a186aSmrg_LT_TAGDECL([], [export_symbols_cmds], [2],
5231a31a186aSmrg    [The commands to list exported symbols])
5232a31a186aSmrg_LT_TAGDECL([], [exclude_expsyms], [1],
5233a31a186aSmrg    [Symbols that should not be listed in the preloaded symbols])
5234a31a186aSmrg_LT_TAGDECL([], [include_expsyms], [1],
5235a31a186aSmrg    [Symbols that must always be exported])
5236a31a186aSmrg_LT_TAGDECL([], [prelink_cmds], [2],
5237a31a186aSmrg    [Commands necessary for linking programs (against libraries) with templates])
5238a31a186aSmrg_LT_TAGDECL([], [file_list_spec], [1],
5239a31a186aSmrg    [Specify filename containing input files])
5240a31a186aSmrgdnl FIXME: Not yet implemented
5241a31a186aSmrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
5242a31a186aSmrgdnl    [Compiler flag to generate thread safe objects])
5243a31a186aSmrg])# _LT_LINKER_SHLIBS
5244a31a186aSmrg
5245a31a186aSmrg
5246a31a186aSmrg# _LT_LANG_C_CONFIG([TAG])
5247a31a186aSmrg# ------------------------
5248a31a186aSmrg# Ensure that the configuration variables for a C compiler are suitably
5249a31a186aSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
5250a31a186aSmrg# the compiler configuration to `libtool'.
5251a31a186aSmrgm4_defun([_LT_LANG_C_CONFIG],
5252a31a186aSmrg[m4_require([_LT_DECL_EGREP])dnl
5253a31a186aSmrglt_save_CC="$CC"
5254a31a186aSmrgAC_LANG_PUSH(C)
5255fe5e51b7Smrg
5256a31a186aSmrg# Source file extension for C test sources.
5257a31a186aSmrgac_ext=c
5258fe5e51b7Smrg
5259a31a186aSmrg# Object file extension for compiled C test sources.
5260a31a186aSmrgobjext=o
5261a31a186aSmrg_LT_TAGVAR(objext, $1)=$objext
5262fe5e51b7Smrg
5263a31a186aSmrg# Code to be used in simple compile tests
5264a31a186aSmrglt_simple_compile_test_code="int some_variable = 0;"
5265fe5e51b7Smrg
5266a31a186aSmrg# Code to be used in simple link tests
5267a31a186aSmrglt_simple_link_test_code='int main(){return(0);}'
5268fe5e51b7Smrg
5269a31a186aSmrg_LT_TAG_COMPILER
5270a31a186aSmrg# Save the default compiler, since it gets overwritten when the other
5271a31a186aSmrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
5272a31a186aSmrgcompiler_DEFAULT=$CC
5273fe5e51b7Smrg
5274a31a186aSmrg# save warnings/boilerplate of simple test code
5275a31a186aSmrg_LT_COMPILER_BOILERPLATE
5276a31a186aSmrg_LT_LINKER_BOILERPLATE
5277fe5e51b7Smrg
5278a31a186aSmrgif test -n "$compiler"; then
5279a31a186aSmrg  _LT_COMPILER_NO_RTTI($1)
5280a31a186aSmrg  _LT_COMPILER_PIC($1)
5281a31a186aSmrg  _LT_COMPILER_C_O($1)
5282a31a186aSmrg  _LT_COMPILER_FILE_LOCKS($1)
5283a31a186aSmrg  _LT_LINKER_SHLIBS($1)
5284a31a186aSmrg  _LT_SYS_DYNAMIC_LINKER($1)
5285a31a186aSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
5286a31a186aSmrg  LT_SYS_DLOPEN_SELF
5287a31a186aSmrg  _LT_CMD_STRIPLIB
5288a31a186aSmrg
5289a31a186aSmrg  # Report which library types will actually be built
5290a31a186aSmrg  AC_MSG_CHECKING([if libtool supports shared libraries])
5291a31a186aSmrg  AC_MSG_RESULT([$can_build_shared])
5292a31a186aSmrg
5293a31a186aSmrg  AC_MSG_CHECKING([whether to build shared libraries])
5294a31a186aSmrg  test "$can_build_shared" = "no" && enable_shared=no
5295a31a186aSmrg
5296a31a186aSmrg  # On AIX, shared libraries and static libraries use the same namespace, and
5297a31a186aSmrg  # are all built from PIC.
5298a31a186aSmrg  case $host_os in
5299a31a186aSmrg  aix3*)
5300a31a186aSmrg    test "$enable_shared" = yes && enable_static=no
5301a31a186aSmrg    if test -n "$RANLIB"; then
5302a31a186aSmrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
5303a31a186aSmrg      postinstall_cmds='$RANLIB $lib'
5304a31a186aSmrg    fi
5305a31a186aSmrg    ;;
5306fe5e51b7Smrg
5307a31a186aSmrg  aix[[4-9]]*)
5308a31a186aSmrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
5309a31a186aSmrg      test "$enable_shared" = yes && enable_static=no
5310a31a186aSmrg    fi
5311a31a186aSmrg    ;;
5312a31a186aSmrg  esac
5313a31a186aSmrg  AC_MSG_RESULT([$enable_shared])
5314fe5e51b7Smrg
5315a31a186aSmrg  AC_MSG_CHECKING([whether to build static libraries])
5316a31a186aSmrg  # Make sure either enable_shared or enable_static is yes.
5317a31a186aSmrg  test "$enable_shared" = yes || enable_static=yes
5318a31a186aSmrg  AC_MSG_RESULT([$enable_static])
5319fe5e51b7Smrg
5320a31a186aSmrg  _LT_CONFIG($1)
5321a31a186aSmrgfi
5322a31a186aSmrgAC_LANG_POP
5323a31a186aSmrgCC="$lt_save_CC"
5324a31a186aSmrg])# _LT_LANG_C_CONFIG
5325fe5e51b7Smrg
5326fe5e51b7Smrg
5327a31a186aSmrg# _LT_PROG_CXX
5328a31a186aSmrg# ------------
5329a31a186aSmrg# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
5330a31a186aSmrg# compiler, we have our own version here.
5331a31a186aSmrgm4_defun([_LT_PROG_CXX],
5332a31a186aSmrg[
5333a31a186aSmrgpushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
5334a31a186aSmrgAC_PROG_CXX
5335a31a186aSmrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
5336a31a186aSmrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
5337a31a186aSmrg    (test "X$CXX" != "Xg++"))) ; then
5338a31a186aSmrg  AC_PROG_CXXCPP
5339a31a186aSmrgelse
5340a31a186aSmrg  _lt_caught_CXX_error=yes
5341a31a186aSmrgfi
5342a31a186aSmrgpopdef([AC_MSG_ERROR])
5343a31a186aSmrg])# _LT_PROG_CXX
5344fe5e51b7Smrg
5345a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
5346a31a186aSmrgdnl AC_DEFUN([_LT_PROG_CXX], [])
5347fe5e51b7Smrg
5348fe5e51b7Smrg
5349a31a186aSmrg# _LT_LANG_CXX_CONFIG([TAG])
5350a31a186aSmrg# --------------------------
5351a31a186aSmrg# Ensure that the configuration variables for a C++ compiler are suitably
5352a31a186aSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
5353a31a186aSmrg# the compiler configuration to `libtool'.
5354a31a186aSmrgm4_defun([_LT_LANG_CXX_CONFIG],
5355a31a186aSmrg[AC_REQUIRE([_LT_PROG_CXX])dnl
5356a31a186aSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
5357a31a186aSmrgm4_require([_LT_DECL_EGREP])dnl
5358a31a186aSmrg
5359a31a186aSmrgAC_LANG_PUSH(C++)
5360a31a186aSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
5361a31a186aSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
5362a31a186aSmrg_LT_TAGVAR(always_export_symbols, $1)=no
5363a31a186aSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
5364a31a186aSmrg_LT_TAGVAR(compiler_needs_object, $1)=no
5365a31a186aSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
5366a31a186aSmrg_LT_TAGVAR(hardcode_direct, $1)=no
5367a31a186aSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5368a31a186aSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5369a31a186aSmrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
5370a31a186aSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
5371a31a186aSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
5372a31a186aSmrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5373a31a186aSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
5374a31a186aSmrg_LT_TAGVAR(inherit_rpath, $1)=no
5375a31a186aSmrg_LT_TAGVAR(module_cmds, $1)=
5376a31a186aSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
5377a31a186aSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
5378a31a186aSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
5379a31a186aSmrg_LT_TAGVAR(no_undefined_flag, $1)=
5380a31a186aSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
5381a31a186aSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5382fe5e51b7Smrg
5383a31a186aSmrg# Source file extension for C++ test sources.
5384a31a186aSmrgac_ext=cpp
5385fe5e51b7Smrg
5386a31a186aSmrg# Object file extension for compiled C++ test sources.
5387a31a186aSmrgobjext=o
5388a31a186aSmrg_LT_TAGVAR(objext, $1)=$objext
5389a31a186aSmrg
5390a31a186aSmrg# No sense in running all these tests if we already determined that
5391a31a186aSmrg# the CXX compiler isn't working.  Some variables (like enable_shared)
5392a31a186aSmrg# are currently assumed to apply to all compilers on this platform,
5393a31a186aSmrg# and will be corrupted by setting them based on a non-working compiler.
5394a31a186aSmrgif test "$_lt_caught_CXX_error" != yes; then
5395a31a186aSmrg  # Code to be used in simple compile tests
5396a31a186aSmrg  lt_simple_compile_test_code="int some_variable = 0;"
5397a31a186aSmrg
5398a31a186aSmrg  # Code to be used in simple link tests
5399a31a186aSmrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
5400a31a186aSmrg
5401a31a186aSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
5402a31a186aSmrg  _LT_TAG_COMPILER
5403a31a186aSmrg
5404a31a186aSmrg  # save warnings/boilerplate of simple test code
5405a31a186aSmrg  _LT_COMPILER_BOILERPLATE
5406a31a186aSmrg  _LT_LINKER_BOILERPLATE
5407a31a186aSmrg
5408a31a186aSmrg  # Allow CC to be a program name with arguments.
5409a31a186aSmrg  lt_save_CC=$CC
5410a31a186aSmrg  lt_save_LD=$LD
5411a31a186aSmrg  lt_save_GCC=$GCC
5412a31a186aSmrg  GCC=$GXX
5413a31a186aSmrg  lt_save_with_gnu_ld=$with_gnu_ld
5414a31a186aSmrg  lt_save_path_LD=$lt_cv_path_LD
5415a31a186aSmrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
5416a31a186aSmrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
5417a31a186aSmrg  else
5418a31a186aSmrg    $as_unset lt_cv_prog_gnu_ld
5419a31a186aSmrg  fi
5420a31a186aSmrg  if test -n "${lt_cv_path_LDCXX+set}"; then
5421a31a186aSmrg    lt_cv_path_LD=$lt_cv_path_LDCXX
5422a31a186aSmrg  else
5423a31a186aSmrg    $as_unset lt_cv_path_LD
5424a31a186aSmrg  fi
5425a31a186aSmrg  test -z "${LDCXX+set}" || LD=$LDCXX
5426a31a186aSmrg  CC=${CXX-"c++"}
5427a31a186aSmrg  compiler=$CC
5428a31a186aSmrg  _LT_TAGVAR(compiler, $1)=$CC
5429a31a186aSmrg  _LT_CC_BASENAME([$compiler])
5430fe5e51b7Smrg
5431a31a186aSmrg  if test -n "$compiler"; then
5432a31a186aSmrg    # We don't want -fno-exception when compiling C++ code, so set the
5433a31a186aSmrg    # no_builtin_flag separately
5434a31a186aSmrg    if test "$GXX" = yes; then
5435a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
5436a31a186aSmrg    else
5437a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
5438a31a186aSmrg    fi
5439fe5e51b7Smrg
5440a31a186aSmrg    if test "$GXX" = yes; then
5441a31a186aSmrg      # Set up default GNU C++ configuration
5442fe5e51b7Smrg
5443a31a186aSmrg      LT_PATH_LD
5444fe5e51b7Smrg
5445a31a186aSmrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
5446a31a186aSmrg      # archiving commands below assume that GNU ld is being used.
5447a31a186aSmrg      if test "$with_gnu_ld" = yes; then
5448a31a186aSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5449a31a186aSmrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5450fe5e51b7Smrg
5451a31a186aSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5452a31a186aSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5453fe5e51b7Smrg
5454a31a186aSmrg        # If archive_cmds runs LD, not CC, wlarc should be empty
5455a31a186aSmrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
5456a31a186aSmrg        #     investigate it a little bit more. (MM)
5457a31a186aSmrg        wlarc='${wl}'
5458fe5e51b7Smrg
5459a31a186aSmrg        # ancient GNU ld didn't support --whole-archive et. al.
5460a31a186aSmrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
5461a31a186aSmrg	  $GREP 'no-whole-archive' > /dev/null; then
5462a31a186aSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5463a31a186aSmrg        else
5464a31a186aSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
5465a31a186aSmrg        fi
5466a31a186aSmrg      else
5467a31a186aSmrg        with_gnu_ld=no
5468a31a186aSmrg        wlarc=
5469a31a186aSmrg
5470a31a186aSmrg        # A generic and very simple default shared library creation
5471a31a186aSmrg        # command for GNU C++ for the case where it uses the native
5472a31a186aSmrg        # linker, instead of GNU ld.  If possible, this setting should
5473a31a186aSmrg        # overridden to take advantage of the native linker features on
5474a31a186aSmrg        # the platform it is being used on.
5475a31a186aSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
5476a31a186aSmrg      fi
5477fe5e51b7Smrg
5478a31a186aSmrg      # Commands to make compiler produce verbose output that lists
5479a31a186aSmrg      # what "hidden" libraries, object files and flags are used when
5480a31a186aSmrg      # linking a shared library.
5481a31a186aSmrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
5482fe5e51b7Smrg
5483a31a186aSmrg    else
5484a31a186aSmrg      GXX=no
5485a31a186aSmrg      with_gnu_ld=no
5486a31a186aSmrg      wlarc=
5487a31a186aSmrg    fi
5488fe5e51b7Smrg
5489a31a186aSmrg    # PORTME: fill in a description of your system's C++ link characteristics
5490a31a186aSmrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5491a31a186aSmrg    _LT_TAGVAR(ld_shlibs, $1)=yes
5492a31a186aSmrg    case $host_os in
5493a31a186aSmrg      aix3*)
5494a31a186aSmrg        # FIXME: insert proper C++ library support
5495a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
5496a31a186aSmrg        ;;
5497a31a186aSmrg      aix[[4-9]]*)
5498a31a186aSmrg        if test "$host_cpu" = ia64; then
5499a31a186aSmrg          # On IA64, the linker does run time linking by default, so we don't
5500a31a186aSmrg          # have to do anything special.
5501a31a186aSmrg          aix_use_runtimelinking=no
5502a31a186aSmrg          exp_sym_flag='-Bexport'
5503a31a186aSmrg          no_entry_flag=""
5504a31a186aSmrg        else
5505a31a186aSmrg          aix_use_runtimelinking=no
5506a31a186aSmrg
5507a31a186aSmrg          # Test if we are trying to use run time linking or normal
5508a31a186aSmrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5509a31a186aSmrg          # need to do runtime linking.
5510a31a186aSmrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5511a31a186aSmrg	    for ld_flag in $LDFLAGS; do
5512a31a186aSmrg	      case $ld_flag in
5513a31a186aSmrg	      *-brtl*)
5514a31a186aSmrg	        aix_use_runtimelinking=yes
5515a31a186aSmrg	        break
5516a31a186aSmrg	        ;;
5517a31a186aSmrg	      esac
5518a31a186aSmrg	    done
5519a31a186aSmrg	    ;;
5520a31a186aSmrg          esac
5521fe5e51b7Smrg
5522a31a186aSmrg          exp_sym_flag='-bexport'
5523a31a186aSmrg          no_entry_flag='-bnoentry'
5524a31a186aSmrg        fi
5525fe5e51b7Smrg
5526a31a186aSmrg        # When large executables or shared objects are built, AIX ld can
5527a31a186aSmrg        # have problems creating the table of contents.  If linking a library
5528a31a186aSmrg        # or program results in "error TOC overflow" add -mminimal-toc to
5529a31a186aSmrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5530a31a186aSmrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5531a31a186aSmrg
5532a31a186aSmrg        _LT_TAGVAR(archive_cmds, $1)=''
5533a31a186aSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
5534a31a186aSmrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5535a31a186aSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5536a31a186aSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
5537a31a186aSmrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
5538a31a186aSmrg
5539a31a186aSmrg        if test "$GXX" = yes; then
5540a31a186aSmrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
5541a31a186aSmrg          # We only want to do this on AIX 4.2 and lower, the check
5542a31a186aSmrg          # below for broken collect2 doesn't work under 4.3+
5543a31a186aSmrg	  collect2name=`${CC} -print-prog-name=collect2`
5544a31a186aSmrg	  if test -f "$collect2name" &&
5545a31a186aSmrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5546a31a186aSmrg	  then
5547a31a186aSmrg	    # We have reworked collect2
5548a31a186aSmrg	    :
5549a31a186aSmrg	  else
5550a31a186aSmrg	    # We have old collect2
5551a31a186aSmrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
5552a31a186aSmrg	    # It fails to find uninstalled libraries when the uninstalled
5553a31a186aSmrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
5554a31a186aSmrg	    # to unsupported forces relinking
5555a31a186aSmrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
5556a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5557a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
5558a31a186aSmrg	  fi
5559a31a186aSmrg          esac
5560a31a186aSmrg          shared_flag='-shared'
5561a31a186aSmrg	  if test "$aix_use_runtimelinking" = yes; then
5562a31a186aSmrg	    shared_flag="$shared_flag "'${wl}-G'
5563a31a186aSmrg	  fi
5564a31a186aSmrg        else
5565a31a186aSmrg          # not using gcc
5566a31a186aSmrg          if test "$host_cpu" = ia64; then
5567a31a186aSmrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5568a31a186aSmrg	  # chokes on -Wl,-G. The following line is correct:
5569a31a186aSmrg	  shared_flag='-G'
5570a31a186aSmrg          else
5571a31a186aSmrg	    if test "$aix_use_runtimelinking" = yes; then
5572a31a186aSmrg	      shared_flag='${wl}-G'
5573a31a186aSmrg	    else
5574a31a186aSmrg	      shared_flag='${wl}-bM:SRE'
5575a31a186aSmrg	    fi
5576a31a186aSmrg          fi
5577a31a186aSmrg        fi
5578fe5e51b7Smrg
5579a31a186aSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
5580a31a186aSmrg        # It seems that -bexpall does not export symbols beginning with
5581a31a186aSmrg        # underscore (_), so it is better to generate a list of symbols to
5582a31a186aSmrg	# export.
5583a31a186aSmrg        _LT_TAGVAR(always_export_symbols, $1)=yes
5584a31a186aSmrg        if test "$aix_use_runtimelinking" = yes; then
5585a31a186aSmrg          # Warning - without using the other runtime loading flags (-brtl),
5586a31a186aSmrg          # -berok will link without error, but may produce a broken library.
5587a31a186aSmrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5588a31a186aSmrg          # Determine the default libpath from the value encoded in an empty
5589a31a186aSmrg          # executable.
5590a31a186aSmrg          _LT_SYS_MODULE_PATH_AIX
5591a31a186aSmrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5592a31a186aSmrg
5593a31a186aSmrg          _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 $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
5594a31a186aSmrg        else
5595a31a186aSmrg          if test "$host_cpu" = ia64; then
5596a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
5597a31a186aSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5598a31a186aSmrg	    _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"
5599a31a186aSmrg          else
5600a31a186aSmrg	    # Determine the default libpath from the value encoded in an
5601a31a186aSmrg	    # empty executable.
5602a31a186aSmrg	    _LT_SYS_MODULE_PATH_AIX
5603a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5604a31a186aSmrg	    # Warning - without using the other run time loading flags,
5605a31a186aSmrg	    # -berok will link without error, but may produce a broken library.
5606a31a186aSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5607a31a186aSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
5608a31a186aSmrg	    # Exported symbols can be pulled into shared objects from archives
5609a31a186aSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5610a31a186aSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5611a31a186aSmrg	    # This is similar to how AIX traditionally builds its shared
5612a31a186aSmrg	    # libraries.
5613a31a186aSmrg	    _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'
5614a31a186aSmrg          fi
5615a31a186aSmrg        fi
5616a31a186aSmrg        ;;
5617fe5e51b7Smrg
5618a31a186aSmrg      beos*)
5619a31a186aSmrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5620a31a186aSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5621a31a186aSmrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5622a31a186aSmrg	  # support --undefined.  This deserves some investigation.  FIXME
5623a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5624a31a186aSmrg	else
5625a31a186aSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
5626a31a186aSmrg	fi
5627a31a186aSmrg	;;
5628fe5e51b7Smrg
5629a31a186aSmrg      chorus*)
5630a31a186aSmrg        case $cc_basename in
5631a31a186aSmrg          *)
5632a31a186aSmrg	  # FIXME: insert proper C++ library support
5633a31a186aSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
5634a31a186aSmrg	  ;;
5635a31a186aSmrg        esac
5636a31a186aSmrg        ;;
5637fe5e51b7Smrg
5638a31a186aSmrg      cygwin* | mingw* | pw32* | cegcc*)
5639a31a186aSmrg        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5640a31a186aSmrg        # as there is no search path for DLLs.
5641a31a186aSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5642a31a186aSmrg        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5643a31a186aSmrg        _LT_TAGVAR(always_export_symbols, $1)=no
5644a31a186aSmrg        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5645a31a186aSmrg
5646a31a186aSmrg        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5647a31a186aSmrg          _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'
5648a31a186aSmrg          # If the export-symbols file already is a .def file (1st line
5649a31a186aSmrg          # is EXPORTS), use it as is; otherwise, prepend...
5650a31a186aSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5651a31a186aSmrg	    cp $export_symbols $output_objdir/$soname.def;
5652a31a186aSmrg          else
5653a31a186aSmrg	    echo EXPORTS > $output_objdir/$soname.def;
5654a31a186aSmrg	    cat $export_symbols >> $output_objdir/$soname.def;
5655a31a186aSmrg          fi~
5656a31a186aSmrg          $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'
5657a31a186aSmrg        else
5658a31a186aSmrg          _LT_TAGVAR(ld_shlibs, $1)=no
5659a31a186aSmrg        fi
5660a31a186aSmrg        ;;
5661a31a186aSmrg      darwin* | rhapsody*)
5662a31a186aSmrg        _LT_DARWIN_LINKER_FEATURES($1)
5663a31a186aSmrg	;;
5664fe5e51b7Smrg
5665a31a186aSmrg      dgux*)
5666a31a186aSmrg        case $cc_basename in
5667a31a186aSmrg          ec++*)
5668a31a186aSmrg	    # FIXME: insert proper C++ library support
5669a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5670a31a186aSmrg	    ;;
5671a31a186aSmrg          ghcx*)
5672a31a186aSmrg	    # Green Hills C++ Compiler
5673a31a186aSmrg	    # FIXME: insert proper C++ library support
5674a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5675a31a186aSmrg	    ;;
5676a31a186aSmrg          *)
5677a31a186aSmrg	    # FIXME: insert proper C++ library support
5678a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5679a31a186aSmrg	    ;;
5680a31a186aSmrg        esac
5681a31a186aSmrg        ;;
5682fe5e51b7Smrg
5683a31a186aSmrg      freebsd[[12]]*)
5684a31a186aSmrg        # C++ shared libraries reported to be fairly broken before
5685a31a186aSmrg	# switch to ELF
5686a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
5687a31a186aSmrg        ;;
5688fe5e51b7Smrg
5689a31a186aSmrg      freebsd-elf*)
5690a31a186aSmrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5691a31a186aSmrg        ;;
5692a31a186aSmrg
5693a31a186aSmrg      freebsd* | dragonfly*)
5694a31a186aSmrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
5695a31a186aSmrg        # conventions
5696a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
5697a31a186aSmrg        ;;
5698fe5e51b7Smrg
5699a31a186aSmrg      gnu*)
5700a31a186aSmrg        ;;
5701fe5e51b7Smrg
5702a31a186aSmrg      hpux9*)
5703a31a186aSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5704a31a186aSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5705a31a186aSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5706a31a186aSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
5707a31a186aSmrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
5708a31a186aSmrg				             # but as the default
5709a31a186aSmrg				             # location of the library.
5710a31a186aSmrg
5711a31a186aSmrg        case $cc_basename in
5712a31a186aSmrg          CC*)
5713a31a186aSmrg            # FIXME: insert proper C++ library support
5714a31a186aSmrg            _LT_TAGVAR(ld_shlibs, $1)=no
5715a31a186aSmrg            ;;
5716a31a186aSmrg          aCC*)
5717a31a186aSmrg            _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'
5718a31a186aSmrg            # Commands to make compiler produce verbose output that lists
5719a31a186aSmrg            # what "hidden" libraries, object files and flags are used when
5720a31a186aSmrg            # linking a shared library.
5721a31a186aSmrg            #
5722a31a186aSmrg            # There doesn't appear to be a way to prevent this compiler from
5723a31a186aSmrg            # explicitly linking system object files so we need to strip them
5724a31a186aSmrg            # from the output so that they don't get included in the library
5725a31a186aSmrg            # dependencies.
5726a31a186aSmrg            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; $ECHO "X$list" | $Xsed'
5727a31a186aSmrg            ;;
5728a31a186aSmrg          *)
5729a31a186aSmrg            if test "$GXX" = yes; then
5730a31a186aSmrg              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${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'
5731a31a186aSmrg            else
5732a31a186aSmrg              # FIXME: insert proper C++ library support
5733a31a186aSmrg              _LT_TAGVAR(ld_shlibs, $1)=no
5734a31a186aSmrg            fi
5735a31a186aSmrg            ;;
5736a31a186aSmrg        esac
5737a31a186aSmrg        ;;
5738fe5e51b7Smrg
5739a31a186aSmrg      hpux10*|hpux11*)
5740a31a186aSmrg        if test $with_gnu_ld = no; then
5741a31a186aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5742a31a186aSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5743a31a186aSmrg
5744a31a186aSmrg          case $host_cpu in
5745a31a186aSmrg            hppa*64*|ia64*)
5746a31a186aSmrg              ;;
5747a31a186aSmrg            *)
5748a31a186aSmrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5749a31a186aSmrg              ;;
5750a31a186aSmrg          esac
5751a31a186aSmrg        fi
5752a31a186aSmrg        case $host_cpu in
5753a31a186aSmrg          hppa*64*|ia64*)
5754a31a186aSmrg            _LT_TAGVAR(hardcode_direct, $1)=no
5755a31a186aSmrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5756a31a186aSmrg            ;;
5757a31a186aSmrg          *)
5758a31a186aSmrg            _LT_TAGVAR(hardcode_direct, $1)=yes
5759a31a186aSmrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5760a31a186aSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
5761a31a186aSmrg					         # but as the default
5762a31a186aSmrg					         # location of the library.
5763a31a186aSmrg            ;;
5764a31a186aSmrg        esac
5765a31a186aSmrg
5766a31a186aSmrg        case $cc_basename in
5767a31a186aSmrg          CC*)
5768a31a186aSmrg	    # FIXME: insert proper C++ library support
5769a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5770a31a186aSmrg	    ;;
5771a31a186aSmrg          aCC*)
5772a31a186aSmrg	    case $host_cpu in
5773a31a186aSmrg	      hppa*64*)
5774a31a186aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5775a31a186aSmrg	        ;;
5776a31a186aSmrg	      ia64*)
5777a31a186aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5778a31a186aSmrg	        ;;
5779a31a186aSmrg	      *)
5780a31a186aSmrg	        _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'
5781a31a186aSmrg	        ;;
5782a31a186aSmrg	    esac
5783a31a186aSmrg	    # Commands to make compiler produce verbose output that lists
5784a31a186aSmrg	    # what "hidden" libraries, object files and flags are used when
5785a31a186aSmrg	    # linking a shared library.
5786a31a186aSmrg	    #
5787a31a186aSmrg	    # There doesn't appear to be a way to prevent this compiler from
5788a31a186aSmrg	    # explicitly linking system object files so we need to strip them
5789a31a186aSmrg	    # from the output so that they don't get included in the library
5790a31a186aSmrg	    # dependencies.
5791a31a186aSmrg	    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; $ECHO "X$list" | $Xsed'
5792a31a186aSmrg	    ;;
5793a31a186aSmrg          *)
5794a31a186aSmrg	    if test "$GXX" = yes; then
5795a31a186aSmrg	      if test $with_gnu_ld = no; then
5796a31a186aSmrg	        case $host_cpu in
5797a31a186aSmrg	          hppa*64*)
5798a31a186aSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5799a31a186aSmrg	            ;;
5800a31a186aSmrg	          ia64*)
5801a31a186aSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5802a31a186aSmrg	            ;;
5803a31a186aSmrg	          *)
5804a31a186aSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5805a31a186aSmrg	            ;;
5806a31a186aSmrg	        esac
5807a31a186aSmrg	      fi
5808a31a186aSmrg	    else
5809a31a186aSmrg	      # FIXME: insert proper C++ library support
5810a31a186aSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
5811a31a186aSmrg	    fi
5812a31a186aSmrg	    ;;
5813a31a186aSmrg        esac
5814a31a186aSmrg        ;;
5815fe5e51b7Smrg
5816a31a186aSmrg      interix[[3-9]]*)
5817a31a186aSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
5818a31a186aSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5819a31a186aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5820a31a186aSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5821a31a186aSmrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5822a31a186aSmrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
5823a31a186aSmrg	# default) and relocated if they conflict, which is a slow very memory
5824a31a186aSmrg	# consuming and fragmenting process.  To avoid this, we pick a random,
5825a31a186aSmrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5826a31a186aSmrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5827a31a186aSmrg	_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'
5828a31a186aSmrg	_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'
5829a31a186aSmrg	;;
5830a31a186aSmrg      irix5* | irix6*)
5831a31a186aSmrg        case $cc_basename in
5832a31a186aSmrg          CC*)
5833a31a186aSmrg	    # SGI C++
5834a31a186aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
5835a31a186aSmrg
5836a31a186aSmrg	    # Archives containing C++ object files must be created using
5837a31a186aSmrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
5838a31a186aSmrg	    # necessary to make sure instantiated templates are included
5839a31a186aSmrg	    # in the archive.
5840a31a186aSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
5841a31a186aSmrg	    ;;
5842a31a186aSmrg          *)
5843a31a186aSmrg	    if test "$GXX" = yes; then
5844a31a186aSmrg	      if test "$with_gnu_ld" = no; then
5845a31a186aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5846a31a186aSmrg	      else
5847a31a186aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
5848a31a186aSmrg	      fi
5849a31a186aSmrg	    fi
5850a31a186aSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
5851a31a186aSmrg	    ;;
5852a31a186aSmrg        esac
5853a31a186aSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5854a31a186aSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5855a31a186aSmrg        _LT_TAGVAR(inherit_rpath, $1)=yes
5856a31a186aSmrg        ;;
5857fe5e51b7Smrg
5858a31a186aSmrg      linux* | k*bsd*-gnu)
5859a31a186aSmrg        case $cc_basename in
5860a31a186aSmrg          KCC*)
5861a31a186aSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
5862a31a186aSmrg
5863a31a186aSmrg	    # KCC will only create a shared library if the output file
5864a31a186aSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
5865a31a186aSmrg	    # to its proper name (with version) after linking.
5866a31a186aSmrg	    _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'
5867a31a186aSmrg	    _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'
5868a31a186aSmrg	    # Commands to make compiler produce verbose output that lists
5869a31a186aSmrg	    # what "hidden" libraries, object files and flags are used when
5870a31a186aSmrg	    # linking a shared library.
5871a31a186aSmrg	    #
5872a31a186aSmrg	    # There doesn't appear to be a way to prevent this compiler from
5873a31a186aSmrg	    # explicitly linking system object files so we need to strip them
5874a31a186aSmrg	    # from the output so that they don't get included in the library
5875a31a186aSmrg	    # dependencies.
5876a31a186aSmrg	    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; $ECHO "X$list" | $Xsed'
5877a31a186aSmrg
5878a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5879a31a186aSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5880a31a186aSmrg
5881a31a186aSmrg	    # Archives containing C++ object files must be created using
5882a31a186aSmrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
5883a31a186aSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
5884a31a186aSmrg	    ;;
5885a31a186aSmrg	  icpc* | ecpc* )
5886a31a186aSmrg	    # Intel C++
5887a31a186aSmrg	    with_gnu_ld=yes
5888a31a186aSmrg	    # version 8.0 and above of icpc choke on multiply defined symbols
5889a31a186aSmrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
5890a31a186aSmrg	    # earlier do not add the objects themselves.
5891a31a186aSmrg	    case `$CC -V 2>&1` in
5892a31a186aSmrg	      *"Version 7."*)
5893a31a186aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5894a31a186aSmrg		_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'
5895a31a186aSmrg		;;
5896a31a186aSmrg	      *)  # Version 8.0 or newer
5897a31a186aSmrg	        tmp_idyn=
5898a31a186aSmrg	        case $host_cpu in
5899a31a186aSmrg		  ia64*) tmp_idyn=' -i_dynamic';;
5900a31a186aSmrg		esac
5901a31a186aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5902a31a186aSmrg		_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'
5903a31a186aSmrg		;;
5904a31a186aSmrg	    esac
5905a31a186aSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5906a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5907a31a186aSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5908a31a186aSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
5909a31a186aSmrg	    ;;
5910a31a186aSmrg          pgCC* | pgcpp*)
5911a31a186aSmrg            # Portland Group C++ compiler
5912a31a186aSmrg	    case `$CC -V` in
5913a31a186aSmrg	    *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
5914a31a186aSmrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
5915a31a186aSmrg		rm -rf $tpldir~
5916a31a186aSmrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
5917a31a186aSmrg		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
5918a31a186aSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
5919a31a186aSmrg		rm -rf $tpldir~
5920a31a186aSmrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
5921a31a186aSmrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
5922a31a186aSmrg		$RANLIB $oldlib'
5923a31a186aSmrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
5924a31a186aSmrg		rm -rf $tpldir~
5925a31a186aSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
5926a31a186aSmrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
5927a31a186aSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
5928a31a186aSmrg		rm -rf $tpldir~
5929a31a186aSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
5930a31a186aSmrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
5931a31a186aSmrg	      ;;
5932a31a186aSmrg	    *) # Version 6 will use weak symbols
5933a31a186aSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
5934a31a186aSmrg	      _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'
5935a31a186aSmrg	      ;;
5936a31a186aSmrg	    esac
5937fe5e51b7Smrg
5938a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
5939a31a186aSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5940a31a186aSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
5941a31a186aSmrg            ;;
5942a31a186aSmrg	  cxx*)
5943a31a186aSmrg	    # Compaq C++
5944a31a186aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5945a31a186aSmrg	    _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'
5946fe5e51b7Smrg
5947a31a186aSmrg	    runpath_var=LD_RUN_PATH
5948a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5949a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5950fe5e51b7Smrg
5951a31a186aSmrg	    # Commands to make compiler produce verbose output that lists
5952a31a186aSmrg	    # what "hidden" libraries, object files and flags are used when
5953a31a186aSmrg	    # linking a shared library.
5954a31a186aSmrg	    #
5955a31a186aSmrg	    # There doesn't appear to be a way to prevent this compiler from
5956a31a186aSmrg	    # explicitly linking system object files so we need to strip them
5957a31a186aSmrg	    # from the output so that they don't get included in the library
5958a31a186aSmrg	    # dependencies.
5959a31a186aSmrg	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
5960a31a186aSmrg	    ;;
5961a31a186aSmrg	  xl*)
5962a31a186aSmrg	    # IBM XL 8.0 on PPC, with GNU ld
5963a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5964a31a186aSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5965a31a186aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5966a31a186aSmrg	    if test "x$supports_anon_versioning" = xyes; then
5967a31a186aSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5968a31a186aSmrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5969a31a186aSmrg		echo "local: *; };" >> $output_objdir/$libname.ver~
5970a31a186aSmrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5971a31a186aSmrg	    fi
5972a31a186aSmrg	    ;;
5973a31a186aSmrg	  *)
5974a31a186aSmrg	    case `$CC -V 2>&1 | sed 5q` in
5975a31a186aSmrg	    *Sun\ C*)
5976a31a186aSmrg	      # Sun C++ 5.9
5977a31a186aSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
5978a31a186aSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5979a31a186aSmrg	      _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'
5980a31a186aSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5981a31a186aSmrg	      _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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
5982a31a186aSmrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
5983a31a186aSmrg
5984a31a186aSmrg	      # Not sure whether something based on
5985a31a186aSmrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
5986a31a186aSmrg	      # would be better.
5987a31a186aSmrg	      output_verbose_link_cmd='echo'
5988a31a186aSmrg
5989a31a186aSmrg	      # Archives containing C++ object files must be created using
5990a31a186aSmrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
5991a31a186aSmrg	      # necessary to make sure instantiated templates are included
5992a31a186aSmrg	      # in the archive.
5993a31a186aSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
5994a31a186aSmrg	      ;;
5995a31a186aSmrg	    esac
5996a31a186aSmrg	    ;;
5997a31a186aSmrg	esac
5998a31a186aSmrg	;;
5999fe5e51b7Smrg
6000a31a186aSmrg      lynxos*)
6001a31a186aSmrg        # FIXME: insert proper C++ library support
6002a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
6003a31a186aSmrg	;;
6004fe5e51b7Smrg
6005a31a186aSmrg      m88k*)
6006a31a186aSmrg        # FIXME: insert proper C++ library support
6007a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6008a31a186aSmrg	;;
6009fe5e51b7Smrg
6010a31a186aSmrg      mvs*)
6011a31a186aSmrg        case $cc_basename in
6012a31a186aSmrg          cxx*)
6013a31a186aSmrg	    # FIXME: insert proper C++ library support
6014a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6015a31a186aSmrg	    ;;
6016a31a186aSmrg	  *)
6017a31a186aSmrg	    # FIXME: insert proper C++ library support
6018a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6019a31a186aSmrg	    ;;
6020a31a186aSmrg	esac
6021a31a186aSmrg	;;
6022fe5e51b7Smrg
6023a31a186aSmrg      netbsd*)
6024a31a186aSmrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6025a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
6026a31a186aSmrg	  wlarc=
6027a31a186aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6028a31a186aSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
6029a31a186aSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6030a31a186aSmrg	fi
6031a31a186aSmrg	# Workaround some broken pre-1.5 toolchains
6032a31a186aSmrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
6033a31a186aSmrg	;;
6034fe5e51b7Smrg
6035a31a186aSmrg      *nto* | *qnx*)
6036a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
6037a31a186aSmrg	;;
6038fe5e51b7Smrg
6039a31a186aSmrg      openbsd2*)
6040a31a186aSmrg        # C++ shared libraries are fairly broken
6041a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
6042a31a186aSmrg	;;
6043fe5e51b7Smrg
6044a31a186aSmrg      openbsd*)
6045a31a186aSmrg	if test -f /usr/libexec/ld.so; then
6046a31a186aSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
6047a31a186aSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6048a31a186aSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6049a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6050a31a186aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6051a31a186aSmrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6052a31a186aSmrg	    _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'
6053a31a186aSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6054a31a186aSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6055a31a186aSmrg	  fi
6056a31a186aSmrg	  output_verbose_link_cmd=echo
6057a31a186aSmrg	else
6058a31a186aSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6059a31a186aSmrg	fi
6060a31a186aSmrg	;;
6061fe5e51b7Smrg
6062a31a186aSmrg      osf3* | osf4* | osf5*)
6063a31a186aSmrg        case $cc_basename in
6064a31a186aSmrg          KCC*)
6065a31a186aSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6066a31a186aSmrg
6067a31a186aSmrg	    # KCC will only create a shared library if the output file
6068a31a186aSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6069a31a186aSmrg	    # to its proper name (with version) after linking.
6070a31a186aSmrg	    _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'
6071a31a186aSmrg
6072a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6073a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6074a31a186aSmrg
6075a31a186aSmrg	    # Archives containing C++ object files must be created using
6076a31a186aSmrg	    # the KAI C++ compiler.
6077a31a186aSmrg	    case $host in
6078a31a186aSmrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
6079a31a186aSmrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
6080a31a186aSmrg	    esac
6081a31a186aSmrg	    ;;
6082a31a186aSmrg          RCC*)
6083a31a186aSmrg	    # Rational C++ 2.4.1
6084a31a186aSmrg	    # FIXME: insert proper C++ library support
6085a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6086a31a186aSmrg	    ;;
6087a31a186aSmrg          cxx*)
6088a31a186aSmrg	    case $host in
6089a31a186aSmrg	      osf3*)
6090a31a186aSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6091a31a186aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
6092a31a186aSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6093a31a186aSmrg		;;
6094a31a186aSmrg	      *)
6095a31a186aSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6096a31a186aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
6097a31a186aSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
6098a31a186aSmrg	          echo "-hidden">> $lib.exp~
6099a31a186aSmrg	          $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 "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
6100a31a186aSmrg	          $RM $lib.exp'
6101a31a186aSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6102a31a186aSmrg		;;
6103a31a186aSmrg	    esac
6104fe5e51b7Smrg
6105a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6106fe5e51b7Smrg
6107a31a186aSmrg	    # Commands to make compiler produce verbose output that lists
6108a31a186aSmrg	    # what "hidden" libraries, object files and flags are used when
6109a31a186aSmrg	    # linking a shared library.
6110a31a186aSmrg	    #
6111a31a186aSmrg	    # There doesn't appear to be a way to prevent this compiler from
6112a31a186aSmrg	    # explicitly linking system object files so we need to strip them
6113a31a186aSmrg	    # from the output so that they don't get included in the library
6114a31a186aSmrg	    # dependencies.
6115a31a186aSmrg	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
6116a31a186aSmrg	    ;;
6117a31a186aSmrg	  *)
6118a31a186aSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6119a31a186aSmrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6120a31a186aSmrg	      case $host in
6121a31a186aSmrg	        osf3*)
6122a31a186aSmrg	          _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" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6123a31a186aSmrg		  ;;
6124a31a186aSmrg	        *)
6125a31a186aSmrg	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6126a31a186aSmrg		  ;;
6127a31a186aSmrg	      esac
6128a31a186aSmrg
6129a31a186aSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6130a31a186aSmrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6131a31a186aSmrg
6132a31a186aSmrg	      # Commands to make compiler produce verbose output that lists
6133a31a186aSmrg	      # what "hidden" libraries, object files and flags are used when
6134a31a186aSmrg	      # linking a shared library.
6135a31a186aSmrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6136a31a186aSmrg
6137a31a186aSmrg	    else
6138a31a186aSmrg	      # FIXME: insert proper C++ library support
6139a31a186aSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
6140a31a186aSmrg	    fi
6141a31a186aSmrg	    ;;
6142a31a186aSmrg        esac
6143a31a186aSmrg        ;;
6144fe5e51b7Smrg
6145a31a186aSmrg      psos*)
6146a31a186aSmrg        # FIXME: insert proper C++ library support
6147a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6148a31a186aSmrg        ;;
6149fe5e51b7Smrg
6150a31a186aSmrg      sunos4*)
6151a31a186aSmrg        case $cc_basename in
6152a31a186aSmrg          CC*)
6153a31a186aSmrg	    # Sun C++ 4.x
6154a31a186aSmrg	    # FIXME: insert proper C++ library support
6155a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6156a31a186aSmrg	    ;;
6157a31a186aSmrg          lcc*)
6158a31a186aSmrg	    # Lucid
6159a31a186aSmrg	    # FIXME: insert proper C++ library support
6160a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6161a31a186aSmrg	    ;;
6162a31a186aSmrg          *)
6163a31a186aSmrg	    # FIXME: insert proper C++ library support
6164a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6165a31a186aSmrg	    ;;
6166a31a186aSmrg        esac
6167a31a186aSmrg        ;;
6168fe5e51b7Smrg
6169a31a186aSmrg      solaris*)
6170a31a186aSmrg        case $cc_basename in
6171a31a186aSmrg          CC*)
6172a31a186aSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
6173a31a186aSmrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
6174a31a186aSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6175a31a186aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6176a31a186aSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6177a31a186aSmrg	      $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'
6178a31a186aSmrg
6179a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6180a31a186aSmrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6181a31a186aSmrg	    case $host_os in
6182a31a186aSmrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6183a31a186aSmrg	      *)
6184a31a186aSmrg		# The compiler driver will combine and reorder linker options,
6185a31a186aSmrg		# but understands `-z linker_flag'.
6186a31a186aSmrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
6187a31a186aSmrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6188a31a186aSmrg	        ;;
6189a31a186aSmrg	    esac
6190a31a186aSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6191fe5e51b7Smrg
6192a31a186aSmrg	    output_verbose_link_cmd='echo'
6193fe5e51b7Smrg
6194a31a186aSmrg	    # Archives containing C++ object files must be created using
6195a31a186aSmrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
6196a31a186aSmrg	    # necessary to make sure instantiated templates are included
6197a31a186aSmrg	    # in the archive.
6198a31a186aSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6199a31a186aSmrg	    ;;
6200a31a186aSmrg          gcx*)
6201a31a186aSmrg	    # Green Hills C++ Compiler
6202a31a186aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6203fe5e51b7Smrg
6204a31a186aSmrg	    # The C++ compiler must be used to create the archive.
6205a31a186aSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
6206a31a186aSmrg	    ;;
6207a31a186aSmrg          *)
6208a31a186aSmrg	    # GNU C++ compiler with Solaris linker
6209a31a186aSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6210a31a186aSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
6211a31a186aSmrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
6212a31a186aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6213a31a186aSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6214a31a186aSmrg		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6215a31a186aSmrg
6216a31a186aSmrg	        # Commands to make compiler produce verbose output that lists
6217a31a186aSmrg	        # what "hidden" libraries, object files and flags are used when
6218a31a186aSmrg	        # linking a shared library.
6219a31a186aSmrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6220a31a186aSmrg	      else
6221a31a186aSmrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
6222a31a186aSmrg	        # platform.
6223a31a186aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6224a31a186aSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6225a31a186aSmrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6226a31a186aSmrg
6227a31a186aSmrg	        # Commands to make compiler produce verbose output that lists
6228a31a186aSmrg	        # what "hidden" libraries, object files and flags are used when
6229a31a186aSmrg	        # linking a shared library.
6230a31a186aSmrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6231a31a186aSmrg	      fi
6232a31a186aSmrg
6233a31a186aSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
6234a31a186aSmrg	      case $host_os in
6235a31a186aSmrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6236a31a186aSmrg		*)
6237a31a186aSmrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6238a31a186aSmrg		  ;;
6239a31a186aSmrg	      esac
6240a31a186aSmrg	    fi
6241a31a186aSmrg	    ;;
6242a31a186aSmrg        esac
6243a31a186aSmrg        ;;
6244fe5e51b7Smrg
6245a31a186aSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6246a31a186aSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6247a31a186aSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6248a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6249a31a186aSmrg      runpath_var='LD_RUN_PATH'
6250fe5e51b7Smrg
6251a31a186aSmrg      case $cc_basename in
6252a31a186aSmrg        CC*)
6253a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6254a31a186aSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6255a31a186aSmrg	  ;;
6256a31a186aSmrg	*)
6257a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6258a31a186aSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6259a31a186aSmrg	  ;;
6260a31a186aSmrg      esac
6261a31a186aSmrg      ;;
6262fe5e51b7Smrg
6263a31a186aSmrg      sysv5* | sco3.2v5* | sco5v6*)
6264a31a186aSmrg	# Note: We can NOT use -z defs as we might desire, because we do not
6265a31a186aSmrg	# link with -lc, and that would cause any symbols used from libc to
6266a31a186aSmrg	# always be unresolved, which means just about no library would
6267a31a186aSmrg	# ever link correctly.  If we're not using GNU ld we use -z text
6268a31a186aSmrg	# though, which does catch some bad symbols but isn't as heavy-handed
6269a31a186aSmrg	# as -z defs.
6270a31a186aSmrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6271a31a186aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6272a31a186aSmrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6273a31a186aSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6274a31a186aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6275a31a186aSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6276a31a186aSmrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
6277a31a186aSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6278a31a186aSmrg	runpath_var='LD_RUN_PATH'
6279fe5e51b7Smrg
6280a31a186aSmrg	case $cc_basename in
6281a31a186aSmrg          CC*)
6282a31a186aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6283a31a186aSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6284a31a186aSmrg	    ;;
6285a31a186aSmrg	  *)
6286a31a186aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6287a31a186aSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6288a31a186aSmrg	    ;;
6289a31a186aSmrg	esac
6290a31a186aSmrg      ;;
6291fe5e51b7Smrg
6292a31a186aSmrg      tandem*)
6293a31a186aSmrg        case $cc_basename in
6294a31a186aSmrg          NCC*)
6295a31a186aSmrg	    # NonStop-UX NCC 3.20
6296a31a186aSmrg	    # FIXME: insert proper C++ library support
6297a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6298a31a186aSmrg	    ;;
6299a31a186aSmrg          *)
6300a31a186aSmrg	    # FIXME: insert proper C++ library support
6301a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6302a31a186aSmrg	    ;;
6303a31a186aSmrg        esac
6304a31a186aSmrg        ;;
6305fe5e51b7Smrg
6306a31a186aSmrg      vxworks*)
6307a31a186aSmrg        # FIXME: insert proper C++ library support
6308a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6309a31a186aSmrg        ;;
6310fe5e51b7Smrg
6311a31a186aSmrg      *)
6312a31a186aSmrg        # FIXME: insert proper C++ library support
6313a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6314a31a186aSmrg        ;;
6315a31a186aSmrg    esac
6316fe5e51b7Smrg
6317a31a186aSmrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6318a31a186aSmrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6319a31a186aSmrg
6320a31a186aSmrg    _LT_TAGVAR(GCC, $1)="$GXX"
6321a31a186aSmrg    _LT_TAGVAR(LD, $1)="$LD"
6322a31a186aSmrg
6323a31a186aSmrg    ## CAVEAT EMPTOR:
6324a31a186aSmrg    ## There is no encapsulation within the following macros, do not change
6325a31a186aSmrg    ## the running order or otherwise move them around unless you know exactly
6326a31a186aSmrg    ## what you are doing...
6327a31a186aSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
6328a31a186aSmrg    _LT_COMPILER_PIC($1)
6329a31a186aSmrg    _LT_COMPILER_C_O($1)
6330a31a186aSmrg    _LT_COMPILER_FILE_LOCKS($1)
6331a31a186aSmrg    _LT_LINKER_SHLIBS($1)
6332a31a186aSmrg    _LT_SYS_DYNAMIC_LINKER($1)
6333a31a186aSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
6334a31a186aSmrg
6335a31a186aSmrg    _LT_CONFIG($1)
6336a31a186aSmrg  fi # test -n "$compiler"
6337a31a186aSmrg
6338a31a186aSmrg  CC=$lt_save_CC
6339a31a186aSmrg  LDCXX=$LD
6340a31a186aSmrg  LD=$lt_save_LD
6341a31a186aSmrg  GCC=$lt_save_GCC
6342a31a186aSmrg  with_gnu_ld=$lt_save_with_gnu_ld
6343a31a186aSmrg  lt_cv_path_LDCXX=$lt_cv_path_LD
6344a31a186aSmrg  lt_cv_path_LD=$lt_save_path_LD
6345a31a186aSmrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
6346a31a186aSmrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
6347a31a186aSmrgfi # test "$_lt_caught_CXX_error" != yes
6348fe5e51b7Smrg
6349a31a186aSmrgAC_LANG_POP
6350a31a186aSmrg])# _LT_LANG_CXX_CONFIG
6351fe5e51b7Smrg
6352fe5e51b7Smrg
6353a31a186aSmrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
6354a31a186aSmrg# ---------------------------------
6355a31a186aSmrg# Figure out "hidden" library dependencies from verbose
6356a31a186aSmrg# compiler output when linking a shared library.
6357a31a186aSmrg# Parse the compiler output and extract the necessary
6358a31a186aSmrg# objects, libraries and library flags.
6359a31a186aSmrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
6360a31a186aSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6361a31a186aSmrg# Dependencies to place before and after the object being linked:
6362a31a186aSmrg_LT_TAGVAR(predep_objects, $1)=
6363a31a186aSmrg_LT_TAGVAR(postdep_objects, $1)=
6364a31a186aSmrg_LT_TAGVAR(predeps, $1)=
6365a31a186aSmrg_LT_TAGVAR(postdeps, $1)=
6366a31a186aSmrg_LT_TAGVAR(compiler_lib_search_path, $1)=
6367fe5e51b7Smrg
6368a31a186aSmrgdnl we can't use the lt_simple_compile_test_code here,
6369a31a186aSmrgdnl because it contains code intended for an executable,
6370a31a186aSmrgdnl not a library.  It's possible we should let each
6371a31a186aSmrgdnl tag define a new lt_????_link_test_code variable,
6372a31a186aSmrgdnl but it's only used here...
6373a31a186aSmrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
6374a31a186aSmrgint a;
6375a31a186aSmrgvoid foo (void) { a = 0; }
6376a31a186aSmrg_LT_EOF
6377a31a186aSmrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
6378a31a186aSmrgclass Foo
6379a31a186aSmrg{
6380a31a186aSmrgpublic:
6381a31a186aSmrg  Foo (void) { a = 0; }
6382a31a186aSmrgprivate:
6383a31a186aSmrg  int a;
6384a31a186aSmrg};
6385a31a186aSmrg_LT_EOF
6386a31a186aSmrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
6387a31a186aSmrg      subroutine foo
6388a31a186aSmrg      implicit none
6389a31a186aSmrg      integer*4 a
6390a31a186aSmrg      a=0
6391a31a186aSmrg      return
6392a31a186aSmrg      end
6393a31a186aSmrg_LT_EOF
6394a31a186aSmrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
6395a31a186aSmrg      subroutine foo
6396a31a186aSmrg      implicit none
6397a31a186aSmrg      integer a
6398a31a186aSmrg      a=0
6399a31a186aSmrg      return
6400a31a186aSmrg      end
6401a31a186aSmrg_LT_EOF
6402a31a186aSmrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
6403a31a186aSmrgpublic class foo {
6404a31a186aSmrg  private int a;
6405a31a186aSmrg  public void bar (void) {
6406a31a186aSmrg    a = 0;
6407a31a186aSmrg  }
6408a31a186aSmrg};
6409a31a186aSmrg_LT_EOF
6410a31a186aSmrg])
6411a31a186aSmrgdnl Parse the compiler output and extract the necessary
6412a31a186aSmrgdnl objects, libraries and library flags.
6413a31a186aSmrgif AC_TRY_EVAL(ac_compile); then
6414a31a186aSmrg  # Parse the compiler output and extract the necessary
6415a31a186aSmrg  # objects, libraries and library flags.
6416fe5e51b7Smrg
6417a31a186aSmrg  # Sentinel used to keep track of whether or not we are before
6418a31a186aSmrg  # the conftest object file.
6419a31a186aSmrg  pre_test_object_deps_done=no
6420fe5e51b7Smrg
6421a31a186aSmrg  for p in `eval "$output_verbose_link_cmd"`; do
6422a31a186aSmrg    case $p in
6423fe5e51b7Smrg
6424a31a186aSmrg    -L* | -R* | -l*)
6425a31a186aSmrg       # Some compilers place space between "-{L,R}" and the path.
6426a31a186aSmrg       # Remove the space.
6427a31a186aSmrg       if test $p = "-L" ||
6428a31a186aSmrg          test $p = "-R"; then
6429a31a186aSmrg	 prev=$p
6430a31a186aSmrg	 continue
6431a31a186aSmrg       else
6432a31a186aSmrg	 prev=
6433a31a186aSmrg       fi
6434fe5e51b7Smrg
6435a31a186aSmrg       if test "$pre_test_object_deps_done" = no; then
6436a31a186aSmrg	 case $p in
6437a31a186aSmrg	 -L* | -R*)
6438a31a186aSmrg	   # Internal compiler library paths should come after those
6439a31a186aSmrg	   # provided the user.  The postdeps already come after the
6440a31a186aSmrg	   # user supplied libs so there is no need to process them.
6441a31a186aSmrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
6442a31a186aSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
6443a31a186aSmrg	   else
6444a31a186aSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
6445a31a186aSmrg	   fi
6446a31a186aSmrg	   ;;
6447a31a186aSmrg	 # The "-l" case would never come before the object being
6448a31a186aSmrg	 # linked, so don't bother handling this case.
6449a31a186aSmrg	 esac
6450a31a186aSmrg       else
6451a31a186aSmrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
6452a31a186aSmrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
6453a31a186aSmrg	 else
6454a31a186aSmrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
6455a31a186aSmrg	 fi
6456a31a186aSmrg       fi
6457a31a186aSmrg       ;;
6458fe5e51b7Smrg
6459a31a186aSmrg    *.$objext)
6460a31a186aSmrg       # This assumes that the test object file only shows up
6461a31a186aSmrg       # once in the compiler output.
6462a31a186aSmrg       if test "$p" = "conftest.$objext"; then
6463a31a186aSmrg	 pre_test_object_deps_done=yes
6464a31a186aSmrg	 continue
6465a31a186aSmrg       fi
6466fe5e51b7Smrg
6467a31a186aSmrg       if test "$pre_test_object_deps_done" = no; then
6468a31a186aSmrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
6469a31a186aSmrg	   _LT_TAGVAR(predep_objects, $1)="$p"
6470a31a186aSmrg	 else
6471a31a186aSmrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
6472a31a186aSmrg	 fi
6473a31a186aSmrg       else
6474a31a186aSmrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
6475a31a186aSmrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
6476a31a186aSmrg	 else
6477a31a186aSmrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
6478a31a186aSmrg	 fi
6479a31a186aSmrg       fi
6480a31a186aSmrg       ;;
6481fe5e51b7Smrg
6482a31a186aSmrg    *) ;; # Ignore the rest.
6483fe5e51b7Smrg
6484a31a186aSmrg    esac
6485a31a186aSmrg  done
6486fe5e51b7Smrg
6487a31a186aSmrg  # Clean up.
6488a31a186aSmrg  rm -f a.out a.exe
6489eda3803bSmrgelse
6490a31a186aSmrg  echo "libtool.m4: error: problem compiling $1 test program"
6491fe5e51b7Smrgfi
6492fe5e51b7Smrg
6493a31a186aSmrg$RM -f confest.$objext
6494fe5e51b7Smrg
6495a31a186aSmrg# PORTME: override above test on systems where it is broken
6496a31a186aSmrgm4_if([$1], [CXX],
6497a31a186aSmrg[case $host_os in
6498a31a186aSmrginterix[[3-9]]*)
6499a31a186aSmrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
6500a31a186aSmrg  # hack all around it, let's just trust "g++" to DTRT.
6501a31a186aSmrg  _LT_TAGVAR(predep_objects,$1)=
6502a31a186aSmrg  _LT_TAGVAR(postdep_objects,$1)=
6503a31a186aSmrg  _LT_TAGVAR(postdeps,$1)=
6504a31a186aSmrg  ;;
6505eda3803bSmrg
6506a31a186aSmrglinux*)
6507a31a186aSmrg  case `$CC -V 2>&1 | sed 5q` in
6508a31a186aSmrg  *Sun\ C*)
6509a31a186aSmrg    # Sun C++ 5.9
6510fe5e51b7Smrg
6511a31a186aSmrg    # The more standards-conforming stlport4 library is
6512a31a186aSmrg    # incompatible with the Cstd library. Avoid specifying
6513a31a186aSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
6514a31a186aSmrg    # -library=stlport4 depends on it.
6515a31a186aSmrg    case " $CXX $CXXFLAGS " in
6516a31a186aSmrg    *" -library=stlport4 "*)
6517a31a186aSmrg      solaris_use_stlport4=yes
6518a31a186aSmrg      ;;
6519a31a186aSmrg    esac
6520fe5e51b7Smrg
6521a31a186aSmrg    if test "$solaris_use_stlport4" != yes; then
6522a31a186aSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
6523a31a186aSmrg    fi
6524a31a186aSmrg    ;;
6525a31a186aSmrg  esac
6526a31a186aSmrg  ;;
6527a31a186aSmrg
6528a31a186aSmrgsolaris*)
6529a31a186aSmrg  case $cc_basename in
6530a31a186aSmrg  CC*)
6531a31a186aSmrg    # The more standards-conforming stlport4 library is
6532a31a186aSmrg    # incompatible with the Cstd library. Avoid specifying
6533a31a186aSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
6534a31a186aSmrg    # -library=stlport4 depends on it.
6535a31a186aSmrg    case " $CXX $CXXFLAGS " in
6536a31a186aSmrg    *" -library=stlport4 "*)
6537a31a186aSmrg      solaris_use_stlport4=yes
6538a31a186aSmrg      ;;
6539a31a186aSmrg    esac
6540fe5e51b7Smrg
6541a31a186aSmrg    # Adding this requires a known-good setup of shared libraries for
6542a31a186aSmrg    # Sun compiler versions before 5.6, else PIC objects from an old
6543a31a186aSmrg    # archive will be linked into the output, leading to subtle bugs.
6544a31a186aSmrg    if test "$solaris_use_stlport4" != yes; then
6545a31a186aSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
6546a31a186aSmrg    fi
6547a31a186aSmrg    ;;
6548a31a186aSmrg  esac
6549a31a186aSmrg  ;;
6550a31a186aSmrgesac
6551a31a186aSmrg])
6552fe5e51b7Smrg
6553a31a186aSmrgcase " $_LT_TAGVAR(postdeps, $1) " in
6554a31a186aSmrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
6555a31a186aSmrgesac
6556a31a186aSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
6557a31a186aSmrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
6558a31a186aSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
6559a31a186aSmrgfi
6560a31a186aSmrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
6561a31a186aSmrg    [The directories searched by this compiler when creating a shared library])
6562a31a186aSmrg_LT_TAGDECL([], [predep_objects], [1],
6563a31a186aSmrg    [Dependencies to place before and after the objects being linked to
6564a31a186aSmrg    create a shared library])
6565a31a186aSmrg_LT_TAGDECL([], [postdep_objects], [1])
6566a31a186aSmrg_LT_TAGDECL([], [predeps], [1])
6567a31a186aSmrg_LT_TAGDECL([], [postdeps], [1])
6568a31a186aSmrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
6569a31a186aSmrg    [The library search path used internally by the compiler when linking
6570a31a186aSmrg    a shared library])
6571a31a186aSmrg])# _LT_SYS_HIDDEN_LIBDEPS
6572a31a186aSmrg
6573a31a186aSmrg
6574a31a186aSmrg# _LT_PROG_F77
6575a31a186aSmrg# ------------
6576a31a186aSmrg# Since AC_PROG_F77 is broken, in that it returns the empty string
6577a31a186aSmrg# if there is no fortran compiler, we have our own version here.
6578a31a186aSmrgm4_defun([_LT_PROG_F77],
6579643b027fSmrg[
6580a31a186aSmrgpushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
6581a31a186aSmrgAC_PROG_F77
6582a31a186aSmrgif test -z "$F77" || test "X$F77" = "Xno"; then
6583a31a186aSmrg  _lt_disable_F77=yes
6584a31a186aSmrgfi
6585a31a186aSmrgpopdef([AC_MSG_ERROR])
6586a31a186aSmrg])# _LT_PROG_F77
6587fe5e51b7Smrg
6588a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
6589a31a186aSmrgdnl AC_DEFUN([_LT_PROG_F77], [])
6590fe5e51b7Smrg
6591fe5e51b7Smrg
6592a31a186aSmrg# _LT_LANG_F77_CONFIG([TAG])
6593a31a186aSmrg# --------------------------
6594a31a186aSmrg# Ensure that the configuration variables for a Fortran 77 compiler are
6595a31a186aSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
6596a31a186aSmrg# to write the compiler configuration to `libtool'.
6597a31a186aSmrgm4_defun([_LT_LANG_F77_CONFIG],
6598a31a186aSmrg[AC_REQUIRE([_LT_PROG_F77])dnl
6599a31a186aSmrgAC_LANG_PUSH(Fortran 77)
6600eda3803bSmrg
6601a31a186aSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6602a31a186aSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
6603a31a186aSmrg_LT_TAGVAR(always_export_symbols, $1)=no
6604a31a186aSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
6605a31a186aSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6606a31a186aSmrg_LT_TAGVAR(hardcode_direct, $1)=no
6607a31a186aSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6608a31a186aSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6609a31a186aSmrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6610a31a186aSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
6611a31a186aSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
6612a31a186aSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
6613a31a186aSmrg_LT_TAGVAR(inherit_rpath, $1)=no
6614a31a186aSmrg_LT_TAGVAR(module_cmds, $1)=
6615a31a186aSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
6616a31a186aSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
6617a31a186aSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6618a31a186aSmrg_LT_TAGVAR(no_undefined_flag, $1)=
6619a31a186aSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
6620a31a186aSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6621fe5e51b7Smrg
6622a31a186aSmrg# Source file extension for f77 test sources.
6623a31a186aSmrgac_ext=f
6624eda3803bSmrg
6625a31a186aSmrg# Object file extension for compiled f77 test sources.
6626a31a186aSmrgobjext=o
6627a31a186aSmrg_LT_TAGVAR(objext, $1)=$objext
6628a31a186aSmrg
6629a31a186aSmrg# No sense in running all these tests if we already determined that
6630a31a186aSmrg# the F77 compiler isn't working.  Some variables (like enable_shared)
6631a31a186aSmrg# are currently assumed to apply to all compilers on this platform,
6632a31a186aSmrg# and will be corrupted by setting them based on a non-working compiler.
6633a31a186aSmrgif test "$_lt_disable_F77" != yes; then
6634a31a186aSmrg  # Code to be used in simple compile tests
6635a31a186aSmrg  lt_simple_compile_test_code="\
6636a31a186aSmrg      subroutine t
6637a31a186aSmrg      return
6638a31a186aSmrg      end
6639a31a186aSmrg"
6640eda3803bSmrg
6641a31a186aSmrg  # Code to be used in simple link tests
6642a31a186aSmrg  lt_simple_link_test_code="\
6643a31a186aSmrg      program t
6644a31a186aSmrg      end
6645a31a186aSmrg"
6646fe5e51b7Smrg
6647a31a186aSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6648a31a186aSmrg  _LT_TAG_COMPILER
6649fe5e51b7Smrg
6650a31a186aSmrg  # save warnings/boilerplate of simple test code
6651a31a186aSmrg  _LT_COMPILER_BOILERPLATE
6652a31a186aSmrg  _LT_LINKER_BOILERPLATE
6653fe5e51b7Smrg
6654a31a186aSmrg  # Allow CC to be a program name with arguments.
6655a31a186aSmrg  lt_save_CC="$CC"
6656a31a186aSmrg  lt_save_GCC=$GCC
6657a31a186aSmrg  CC=${F77-"f77"}
6658a31a186aSmrg  compiler=$CC
6659a31a186aSmrg  _LT_TAGVAR(compiler, $1)=$CC
6660a31a186aSmrg  _LT_CC_BASENAME([$compiler])
6661a31a186aSmrg  GCC=$G77
6662a31a186aSmrg  if test -n "$compiler"; then
6663a31a186aSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
6664a31a186aSmrg    AC_MSG_RESULT([$can_build_shared])
6665eda3803bSmrg
6666a31a186aSmrg    AC_MSG_CHECKING([whether to build shared libraries])
6667a31a186aSmrg    test "$can_build_shared" = "no" && enable_shared=no
6668eda3803bSmrg
6669a31a186aSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
6670a31a186aSmrg    # are all built from PIC.
6671a31a186aSmrg    case $host_os in
6672a31a186aSmrg      aix3*)
6673a31a186aSmrg        test "$enable_shared" = yes && enable_static=no
6674a31a186aSmrg        if test -n "$RANLIB"; then
6675a31a186aSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
6676a31a186aSmrg          postinstall_cmds='$RANLIB $lib'
6677a31a186aSmrg        fi
6678a31a186aSmrg        ;;
6679a31a186aSmrg      aix[[4-9]]*)
6680a31a186aSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6681a31a186aSmrg	  test "$enable_shared" = yes && enable_static=no
6682a31a186aSmrg	fi
6683a31a186aSmrg        ;;
6684a31a186aSmrg    esac
6685a31a186aSmrg    AC_MSG_RESULT([$enable_shared])
6686a31a186aSmrg
6687a31a186aSmrg    AC_MSG_CHECKING([whether to build static libraries])
6688a31a186aSmrg    # Make sure either enable_shared or enable_static is yes.
6689a31a186aSmrg    test "$enable_shared" = yes || enable_static=yes
6690a31a186aSmrg    AC_MSG_RESULT([$enable_static])
6691a31a186aSmrg
6692a31a186aSmrg    _LT_TAGVAR(GCC, $1)="$G77"
6693a31a186aSmrg    _LT_TAGVAR(LD, $1)="$LD"
6694a31a186aSmrg
6695a31a186aSmrg    ## CAVEAT EMPTOR:
6696a31a186aSmrg    ## There is no encapsulation within the following macros, do not change
6697a31a186aSmrg    ## the running order or otherwise move them around unless you know exactly
6698a31a186aSmrg    ## what you are doing...
6699a31a186aSmrg    _LT_COMPILER_PIC($1)
6700a31a186aSmrg    _LT_COMPILER_C_O($1)
6701a31a186aSmrg    _LT_COMPILER_FILE_LOCKS($1)
6702a31a186aSmrg    _LT_LINKER_SHLIBS($1)
6703a31a186aSmrg    _LT_SYS_DYNAMIC_LINKER($1)
6704a31a186aSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
6705a31a186aSmrg
6706a31a186aSmrg    _LT_CONFIG($1)
6707a31a186aSmrg  fi # test -n "$compiler"
6708a31a186aSmrg
6709a31a186aSmrg  GCC=$lt_save_GCC
6710a31a186aSmrg  CC="$lt_save_CC"
6711a31a186aSmrgfi # test "$_lt_disable_F77" != yes
6712eda3803bSmrg
6713a31a186aSmrgAC_LANG_POP
6714a31a186aSmrg])# _LT_LANG_F77_CONFIG
6715eda3803bSmrg
6716fe5e51b7Smrg
6717a31a186aSmrg# _LT_PROG_FC
6718a31a186aSmrg# -----------
6719a31a186aSmrg# Since AC_PROG_FC is broken, in that it returns the empty string
6720a31a186aSmrg# if there is no fortran compiler, we have our own version here.
6721a31a186aSmrgm4_defun([_LT_PROG_FC],
6722a31a186aSmrg[
6723a31a186aSmrgpushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
6724a31a186aSmrgAC_PROG_FC
6725a31a186aSmrgif test -z "$FC" || test "X$FC" = "Xno"; then
6726a31a186aSmrg  _lt_disable_FC=yes
6727a31a186aSmrgfi
6728a31a186aSmrgpopdef([AC_MSG_ERROR])
6729a31a186aSmrg])# _LT_PROG_FC
6730eda3803bSmrg
6731a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
6732a31a186aSmrgdnl AC_DEFUN([_LT_PROG_FC], [])
6733eda3803bSmrg
6734eda3803bSmrg
6735a31a186aSmrg# _LT_LANG_FC_CONFIG([TAG])
6736a31a186aSmrg# -------------------------
6737a31a186aSmrg# Ensure that the configuration variables for a Fortran compiler are
6738a31a186aSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
6739a31a186aSmrg# to write the compiler configuration to `libtool'.
6740a31a186aSmrgm4_defun([_LT_LANG_FC_CONFIG],
6741a31a186aSmrg[AC_REQUIRE([_LT_PROG_FC])dnl
6742a31a186aSmrgAC_LANG_PUSH(Fortran)
6743a31a186aSmrg
6744a31a186aSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6745a31a186aSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
6746a31a186aSmrg_LT_TAGVAR(always_export_symbols, $1)=no
6747a31a186aSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
6748a31a186aSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6749a31a186aSmrg_LT_TAGVAR(hardcode_direct, $1)=no
6750a31a186aSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6751a31a186aSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6752a31a186aSmrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6753a31a186aSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
6754a31a186aSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
6755a31a186aSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
6756a31a186aSmrg_LT_TAGVAR(inherit_rpath, $1)=no
6757a31a186aSmrg_LT_TAGVAR(module_cmds, $1)=
6758a31a186aSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
6759a31a186aSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
6760a31a186aSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6761a31a186aSmrg_LT_TAGVAR(no_undefined_flag, $1)=
6762a31a186aSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
6763a31a186aSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6764a31a186aSmrg
6765a31a186aSmrg# Source file extension for fc test sources.
6766a31a186aSmrgac_ext=${ac_fc_srcext-f}
6767a31a186aSmrg
6768a31a186aSmrg# Object file extension for compiled fc test sources.
6769a31a186aSmrgobjext=o
6770a31a186aSmrg_LT_TAGVAR(objext, $1)=$objext
6771a31a186aSmrg
6772a31a186aSmrg# No sense in running all these tests if we already determined that
6773a31a186aSmrg# the FC compiler isn't working.  Some variables (like enable_shared)
6774a31a186aSmrg# are currently assumed to apply to all compilers on this platform,
6775a31a186aSmrg# and will be corrupted by setting them based on a non-working compiler.
6776a31a186aSmrgif test "$_lt_disable_FC" != yes; then
6777a31a186aSmrg  # Code to be used in simple compile tests
6778a31a186aSmrg  lt_simple_compile_test_code="\
6779a31a186aSmrg      subroutine t
6780a31a186aSmrg      return
6781a31a186aSmrg      end
6782a31a186aSmrg"
6783fe5e51b7Smrg
6784a31a186aSmrg  # Code to be used in simple link tests
6785a31a186aSmrg  lt_simple_link_test_code="\
6786a31a186aSmrg      program t
6787a31a186aSmrg      end
6788a31a186aSmrg"
6789fe5e51b7Smrg
6790a31a186aSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6791a31a186aSmrg  _LT_TAG_COMPILER
6792fe5e51b7Smrg
6793a31a186aSmrg  # save warnings/boilerplate of simple test code
6794a31a186aSmrg  _LT_COMPILER_BOILERPLATE
6795a31a186aSmrg  _LT_LINKER_BOILERPLATE
6796fe5e51b7Smrg
6797a31a186aSmrg  # Allow CC to be a program name with arguments.
6798a31a186aSmrg  lt_save_CC="$CC"
6799a31a186aSmrg  lt_save_GCC=$GCC
6800a31a186aSmrg  CC=${FC-"f95"}
6801a31a186aSmrg  compiler=$CC
6802a31a186aSmrg  GCC=$ac_cv_fc_compiler_gnu
6803a31a186aSmrg
6804a31a186aSmrg  _LT_TAGVAR(compiler, $1)=$CC
6805a31a186aSmrg  _LT_CC_BASENAME([$compiler])
6806fe5e51b7Smrg
6807a31a186aSmrg  if test -n "$compiler"; then
6808a31a186aSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
6809a31a186aSmrg    AC_MSG_RESULT([$can_build_shared])
6810a31a186aSmrg
6811a31a186aSmrg    AC_MSG_CHECKING([whether to build shared libraries])
6812a31a186aSmrg    test "$can_build_shared" = "no" && enable_shared=no
6813a31a186aSmrg
6814a31a186aSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
6815a31a186aSmrg    # are all built from PIC.
6816643b027fSmrg    case $host_os in
6817a31a186aSmrg      aix3*)
6818a31a186aSmrg        test "$enable_shared" = yes && enable_static=no
6819a31a186aSmrg        if test -n "$RANLIB"; then
6820a31a186aSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
6821a31a186aSmrg          postinstall_cmds='$RANLIB $lib'
6822a31a186aSmrg        fi
6823a31a186aSmrg        ;;
6824643b027fSmrg      aix[[4-9]]*)
6825a31a186aSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6826a31a186aSmrg	  test "$enable_shared" = yes && enable_static=no
6827643b027fSmrg	fi
6828a31a186aSmrg        ;;
6829643b027fSmrg    esac
6830a31a186aSmrg    AC_MSG_RESULT([$enable_shared])
6831a31a186aSmrg
6832a31a186aSmrg    AC_MSG_CHECKING([whether to build static libraries])
6833a31a186aSmrg    # Make sure either enable_shared or enable_static is yes.
6834a31a186aSmrg    test "$enable_shared" = yes || enable_static=yes
6835a31a186aSmrg    AC_MSG_RESULT([$enable_static])
6836a31a186aSmrg
6837a31a186aSmrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
6838a31a186aSmrg    _LT_TAGVAR(LD, $1)="$LD"
6839a31a186aSmrg
6840a31a186aSmrg    ## CAVEAT EMPTOR:
6841a31a186aSmrg    ## There is no encapsulation within the following macros, do not change
6842a31a186aSmrg    ## the running order or otherwise move them around unless you know exactly
6843a31a186aSmrg    ## what you are doing...
6844a31a186aSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
6845a31a186aSmrg    _LT_COMPILER_PIC($1)
6846a31a186aSmrg    _LT_COMPILER_C_O($1)
6847a31a186aSmrg    _LT_COMPILER_FILE_LOCKS($1)
6848a31a186aSmrg    _LT_LINKER_SHLIBS($1)
6849a31a186aSmrg    _LT_SYS_DYNAMIC_LINKER($1)
6850a31a186aSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
6851a31a186aSmrg
6852a31a186aSmrg    _LT_CONFIG($1)
6853a31a186aSmrg  fi # test -n "$compiler"
6854a31a186aSmrg
6855a31a186aSmrg  GCC=$lt_save_GCC
6856a31a186aSmrg  CC="$lt_save_CC"
6857a31a186aSmrgfi # test "$_lt_disable_FC" != yes
6858eda3803bSmrg
6859a31a186aSmrgAC_LANG_POP
6860a31a186aSmrg])# _LT_LANG_FC_CONFIG
6861eda3803bSmrg
6862eda3803bSmrg
6863a31a186aSmrg# _LT_LANG_GCJ_CONFIG([TAG])
6864a31a186aSmrg# --------------------------
6865a31a186aSmrg# Ensure that the configuration variables for the GNU Java Compiler compiler
6866a31a186aSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
6867a31a186aSmrg# to write the compiler configuration to `libtool'.
6868a31a186aSmrgm4_defun([_LT_LANG_GCJ_CONFIG],
6869a31a186aSmrg[AC_REQUIRE([LT_PROG_GCJ])dnl
6870a31a186aSmrgAC_LANG_SAVE
6871eda3803bSmrg
6872a31a186aSmrg# Source file extension for Java test sources.
6873a31a186aSmrgac_ext=java
6874eda3803bSmrg
6875a31a186aSmrg# Object file extension for compiled Java test sources.
6876a31a186aSmrgobjext=o
6877a31a186aSmrg_LT_TAGVAR(objext, $1)=$objext
6878eda3803bSmrg
6879a31a186aSmrg# Code to be used in simple compile tests
6880a31a186aSmrglt_simple_compile_test_code="class foo {}"
6881eda3803bSmrg
6882a31a186aSmrg# Code to be used in simple link tests
6883a31a186aSmrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
6884fe5e51b7Smrg
6885a31a186aSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
6886a31a186aSmrg_LT_TAG_COMPILER
6887fe5e51b7Smrg
6888a31a186aSmrg# save warnings/boilerplate of simple test code
6889a31a186aSmrg_LT_COMPILER_BOILERPLATE
6890a31a186aSmrg_LT_LINKER_BOILERPLATE
6891fe5e51b7Smrg
6892a31a186aSmrg# Allow CC to be a program name with arguments.
6893a31a186aSmrglt_save_CC="$CC"
6894a31a186aSmrglt_save_GCC=$GCC
6895a31a186aSmrgGCC=yes
6896a31a186aSmrgCC=${GCJ-"gcj"}
6897a31a186aSmrgcompiler=$CC
6898a31a186aSmrg_LT_TAGVAR(compiler, $1)=$CC
6899a31a186aSmrg_LT_TAGVAR(LD, $1)="$LD"
6900a31a186aSmrg_LT_CC_BASENAME([$compiler])
6901a31a186aSmrg
6902a31a186aSmrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
6903a31a186aSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6904a31a186aSmrg
6905a31a186aSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6906a31a186aSmrg
6907a31a186aSmrgif test -n "$compiler"; then
6908a31a186aSmrg  _LT_COMPILER_NO_RTTI($1)
6909a31a186aSmrg  _LT_COMPILER_PIC($1)
6910a31a186aSmrg  _LT_COMPILER_C_O($1)
6911a31a186aSmrg  _LT_COMPILER_FILE_LOCKS($1)
6912a31a186aSmrg  _LT_LINKER_SHLIBS($1)
6913a31a186aSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
6914a31a186aSmrg
6915a31a186aSmrg  _LT_CONFIG($1)
6916a31a186aSmrgfi
6917a31a186aSmrg
6918a31a186aSmrgAC_LANG_RESTORE
6919a31a186aSmrg
6920a31a186aSmrgGCC=$lt_save_GCC
6921a31a186aSmrgCC="$lt_save_CC"
6922a31a186aSmrg])# _LT_LANG_GCJ_CONFIG
6923a31a186aSmrg
6924a31a186aSmrg
6925a31a186aSmrg# _LT_LANG_RC_CONFIG([TAG])
6926a31a186aSmrg# -------------------------
6927a31a186aSmrg# Ensure that the configuration variables for the Windows resource compiler
6928a31a186aSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
6929a31a186aSmrg# to write the compiler configuration to `libtool'.
6930a31a186aSmrgm4_defun([_LT_LANG_RC_CONFIG],
6931a31a186aSmrg[AC_REQUIRE([LT_PROG_RC])dnl
6932a31a186aSmrgAC_LANG_SAVE
6933a31a186aSmrg
6934a31a186aSmrg# Source file extension for RC test sources.
6935a31a186aSmrgac_ext=rc
6936a31a186aSmrg
6937a31a186aSmrg# Object file extension for compiled RC test sources.
6938a31a186aSmrgobjext=o
6939a31a186aSmrg_LT_TAGVAR(objext, $1)=$objext
6940a31a186aSmrg
6941a31a186aSmrg# Code to be used in simple compile tests
6942a31a186aSmrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
6943a31a186aSmrg
6944a31a186aSmrg# Code to be used in simple link tests
6945a31a186aSmrglt_simple_link_test_code="$lt_simple_compile_test_code"
6946a31a186aSmrg
6947a31a186aSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
6948a31a186aSmrg_LT_TAG_COMPILER
6949a31a186aSmrg
6950a31a186aSmrg# save warnings/boilerplate of simple test code
6951a31a186aSmrg_LT_COMPILER_BOILERPLATE
6952a31a186aSmrg_LT_LINKER_BOILERPLATE
6953fe5e51b7Smrg
6954a31a186aSmrg# Allow CC to be a program name with arguments.
6955a31a186aSmrglt_save_CC="$CC"
6956a31a186aSmrglt_save_GCC=$GCC
6957a31a186aSmrgGCC=
6958a31a186aSmrgCC=${RC-"windres"}
6959a31a186aSmrgcompiler=$CC
6960a31a186aSmrg_LT_TAGVAR(compiler, $1)=$CC
6961a31a186aSmrg_LT_CC_BASENAME([$compiler])
6962a31a186aSmrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
6963fe5e51b7Smrg
6964a31a186aSmrgif test -n "$compiler"; then
6965a31a186aSmrg  :
6966a31a186aSmrg  _LT_CONFIG($1)
6967a31a186aSmrgfi
6968fe5e51b7Smrg
6969a31a186aSmrgGCC=$lt_save_GCC
6970a31a186aSmrgAC_LANG_RESTORE
6971a31a186aSmrgCC="$lt_save_CC"
6972a31a186aSmrg])# _LT_LANG_RC_CONFIG
6973fe5e51b7Smrg
6974fe5e51b7Smrg
6975a31a186aSmrg# LT_PROG_GCJ
6976a31a186aSmrg# -----------
6977a31a186aSmrgAC_DEFUN([LT_PROG_GCJ],
6978a31a186aSmrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
6979a31a186aSmrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
6980a31a186aSmrg    [AC_CHECK_TOOL(GCJ, gcj,)
6981a31a186aSmrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
6982a31a186aSmrg      AC_SUBST(GCJFLAGS)])])[]dnl
6983a31a186aSmrg])
6984fe5e51b7Smrg
6985a31a186aSmrg# Old name:
6986a31a186aSmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
6987a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
6988a31a186aSmrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
6989fe5e51b7Smrg
6990fe5e51b7Smrg
6991a31a186aSmrg# LT_PROG_RC
6992a31a186aSmrg# ----------
6993a31a186aSmrgAC_DEFUN([LT_PROG_RC],
6994a31a186aSmrg[AC_CHECK_TOOL(RC, windres,)
6995a31a186aSmrg])
6996fe5e51b7Smrg
6997a31a186aSmrg# Old name:
6998a31a186aSmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
6999a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
7000a31a186aSmrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
7001fe5e51b7Smrg
7002fe5e51b7Smrg
7003a31a186aSmrg# _LT_DECL_EGREP
7004a31a186aSmrg# --------------
7005a31a186aSmrg# If we don't have a new enough Autoconf to choose the best grep
7006a31a186aSmrg# available, choose the one first in the user's PATH.
7007a31a186aSmrgm4_defun([_LT_DECL_EGREP],
7008a31a186aSmrg[AC_REQUIRE([AC_PROG_EGREP])dnl
7009a31a186aSmrgAC_REQUIRE([AC_PROG_FGREP])dnl
7010a31a186aSmrgtest -z "$GREP" && GREP=grep
7011a31a186aSmrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
7012a31a186aSmrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
7013a31a186aSmrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
7014a31a186aSmrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
7015a31a186aSmrgAC_SUBST([GREP])
7016a31a186aSmrg])
7017fe5e51b7Smrg
7018eda3803bSmrg
7019a31a186aSmrg# _LT_DECL_OBJDUMP
7020a31a186aSmrg# --------------
7021a31a186aSmrg# If we don't have a new enough Autoconf to choose the best objdump
7022a31a186aSmrg# available, choose the one first in the user's PATH.
7023a31a186aSmrgm4_defun([_LT_DECL_OBJDUMP],
7024a31a186aSmrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
7025a31a186aSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
7026a31a186aSmrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
7027a31a186aSmrgAC_SUBST([OBJDUMP])
7028a31a186aSmrg])
7029eda3803bSmrg
7030eda3803bSmrg
7031a31a186aSmrg# _LT_DECL_SED
7032a31a186aSmrg# ------------
7033a31a186aSmrg# Check for a fully-functional sed program, that truncates
7034a31a186aSmrg# as few characters as possible.  Prefer GNU sed if found.
7035a31a186aSmrgm4_defun([_LT_DECL_SED],
7036a31a186aSmrg[AC_PROG_SED
7037a31a186aSmrgtest -z "$SED" && SED=sed
7038a31a186aSmrgXsed="$SED -e 1s/^X//"
7039a31a186aSmrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
7040a31a186aSmrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
7041a31a186aSmrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
7042a31a186aSmrg])# _LT_DECL_SED
7043a31a186aSmrg
7044a31a186aSmrgm4_ifndef([AC_PROG_SED], [
7045a31a186aSmrg# NOTE: This macro has been submitted for inclusion into   #
7046a31a186aSmrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
7047a31a186aSmrg#  a released version of Autoconf we should remove this    #
7048a31a186aSmrg#  macro and use it instead.                               #
7049a31a186aSmrg
7050a31a186aSmrgm4_defun([AC_PROG_SED],
7051a31a186aSmrg[AC_MSG_CHECKING([for a sed that does not truncate output])
7052a31a186aSmrgAC_CACHE_VAL(lt_cv_path_SED,
7053a31a186aSmrg[# Loop through the user's path and test for sed and gsed.
7054a31a186aSmrg# Then use that list of sed's as ones to test for truncation.
7055a31a186aSmrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7056a31a186aSmrgfor as_dir in $PATH
7057a31a186aSmrgdo
7058a31a186aSmrg  IFS=$as_save_IFS
7059a31a186aSmrg  test -z "$as_dir" && as_dir=.
7060a31a186aSmrg  for lt_ac_prog in sed gsed; do
7061a31a186aSmrg    for ac_exec_ext in '' $ac_executable_extensions; do
7062a31a186aSmrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
7063a31a186aSmrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
7064a31a186aSmrg      fi
7065a31a186aSmrg    done
7066a31a186aSmrg  done
7067a31a186aSmrgdone
7068a31a186aSmrgIFS=$as_save_IFS
7069a31a186aSmrglt_ac_max=0
7070a31a186aSmrglt_ac_count=0
7071a31a186aSmrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
7072a31a186aSmrg# along with /bin/sed that truncates output.
7073a31a186aSmrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
7074a31a186aSmrg  test ! -f $lt_ac_sed && continue
7075a31a186aSmrg  cat /dev/null > conftest.in
7076a31a186aSmrg  lt_ac_count=0
7077a31a186aSmrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
7078a31a186aSmrg  # Check for GNU sed and select it if it is found.
7079a31a186aSmrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
7080a31a186aSmrg    lt_cv_path_SED=$lt_ac_sed
7081a31a186aSmrg    break
7082fe5e51b7Smrg  fi
7083a31a186aSmrg  while true; do
7084a31a186aSmrg    cat conftest.in conftest.in >conftest.tmp
7085a31a186aSmrg    mv conftest.tmp conftest.in
7086a31a186aSmrg    cp conftest.in conftest.nl
7087a31a186aSmrg    echo >>conftest.nl
7088a31a186aSmrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
7089a31a186aSmrg    cmp -s conftest.out conftest.nl || break
7090a31a186aSmrg    # 10000 chars as input seems more than enough
7091a31a186aSmrg    test $lt_ac_count -gt 10 && break
7092a31a186aSmrg    lt_ac_count=`expr $lt_ac_count + 1`
7093a31a186aSmrg    if test $lt_ac_count -gt $lt_ac_max; then
7094a31a186aSmrg      lt_ac_max=$lt_ac_count
7095a31a186aSmrg      lt_cv_path_SED=$lt_ac_sed
7096a31a186aSmrg    fi
7097a31a186aSmrg  done
7098a31a186aSmrgdone
7099fe5e51b7Smrg])
7100a31a186aSmrgSED=$lt_cv_path_SED
7101a31a186aSmrgAC_SUBST([SED])
7102a31a186aSmrgAC_MSG_RESULT([$SED])
7103a31a186aSmrg])#AC_PROG_SED
7104a31a186aSmrg])#m4_ifndef
7105fe5e51b7Smrg
7106a31a186aSmrg# Old name:
7107a31a186aSmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
7108a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
7109a31a186aSmrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
7110a31a186aSmrg
7111a31a186aSmrg
7112a31a186aSmrg# _LT_CHECK_SHELL_FEATURES
7113a31a186aSmrg# ------------------------
7114a31a186aSmrg# Find out whether the shell is Bourne or XSI compatible,
7115a31a186aSmrg# or has some other useful features.
7116a31a186aSmrgm4_defun([_LT_CHECK_SHELL_FEATURES],
7117a31a186aSmrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
7118a31a186aSmrg# Try some XSI features
7119a31a186aSmrgxsi_shell=no
7120a31a186aSmrg( _lt_dummy="a/b/c"
7121a31a186aSmrg  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
7122a31a186aSmrg      = c,a/b,, \
7123a31a186aSmrg    && eval 'test $(( 1 + 1 )) -eq 2 \
7124a31a186aSmrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
7125a31a186aSmrg  && xsi_shell=yes
7126a31a186aSmrgAC_MSG_RESULT([$xsi_shell])
7127a31a186aSmrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
7128a31a186aSmrg
7129a31a186aSmrgAC_MSG_CHECKING([whether the shell understands "+="])
7130a31a186aSmrglt_shell_append=no
7131a31a186aSmrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
7132a31a186aSmrg    >/dev/null 2>&1 \
7133a31a186aSmrg  && lt_shell_append=yes
7134a31a186aSmrgAC_MSG_RESULT([$lt_shell_append])
7135a31a186aSmrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
7136a31a186aSmrg
7137a31a186aSmrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
7138a31a186aSmrg  lt_unset=unset
7139a31a186aSmrgelse
7140a31a186aSmrg  lt_unset=false
7141fe5e51b7Smrgfi
7142a31a186aSmrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
7143a31a186aSmrg
7144a31a186aSmrg# test EBCDIC or ASCII
7145a31a186aSmrgcase `echo X|tr X '\101'` in
7146a31a186aSmrg A) # ASCII based system
7147a31a186aSmrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
7148a31a186aSmrg  lt_SP2NL='tr \040 \012'
7149a31a186aSmrg  lt_NL2SP='tr \015\012 \040\040'
7150a31a186aSmrg  ;;
7151a31a186aSmrg *) # EBCDIC based system
7152a31a186aSmrg  lt_SP2NL='tr \100 \n'
7153a31a186aSmrg  lt_NL2SP='tr \r\n \100\100'
7154a31a186aSmrg  ;;
7155fe5e51b7Smrgesac
7156a31a186aSmrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
7157a31a186aSmrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
7158a31a186aSmrg])# _LT_CHECK_SHELL_FEATURES
7159eda3803bSmrg
7160eda3803bSmrg
7161a31a186aSmrg# _LT_PROG_XSI_SHELLFNS
7162a31a186aSmrg# ---------------------
7163a31a186aSmrg# Bourne and XSI compatible variants of some useful shell functions.
7164a31a186aSmrgm4_defun([_LT_PROG_XSI_SHELLFNS],
7165a31a186aSmrg[case $xsi_shell in
7166a31a186aSmrg  yes)
7167a31a186aSmrg    cat << \_LT_EOF >> "$cfgfile"
7168a31a186aSmrg
7169a31a186aSmrg# func_dirname file append nondir_replacement
7170a31a186aSmrg# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
7171a31a186aSmrg# otherwise set result to NONDIR_REPLACEMENT.
7172a31a186aSmrgfunc_dirname ()
7173a31a186aSmrg{
7174a31a186aSmrg  case ${1} in
7175a31a186aSmrg    */*) func_dirname_result="${1%/*}${2}" ;;
7176a31a186aSmrg    *  ) func_dirname_result="${3}" ;;
7177a31a186aSmrg  esac
7178a31a186aSmrg}
7179eda3803bSmrg
7180a31a186aSmrg# func_basename file
7181a31a186aSmrgfunc_basename ()
7182a31a186aSmrg{
7183a31a186aSmrg  func_basename_result="${1##*/}"
7184a31a186aSmrg}
7185a31a186aSmrg
7186a31a186aSmrg# func_dirname_and_basename file append nondir_replacement
7187a31a186aSmrg# perform func_basename and func_dirname in a single function
7188a31a186aSmrg# call:
7189a31a186aSmrg#   dirname:  Compute the dirname of FILE.  If nonempty,
7190a31a186aSmrg#             add APPEND to the result, otherwise set result
7191a31a186aSmrg#             to NONDIR_REPLACEMENT.
7192a31a186aSmrg#             value returned in "$func_dirname_result"
7193a31a186aSmrg#   basename: Compute filename of FILE.
7194a31a186aSmrg#             value retuned in "$func_basename_result"
7195a31a186aSmrg# Implementation must be kept synchronized with func_dirname
7196a31a186aSmrg# and func_basename. For efficiency, we do not delegate to
7197a31a186aSmrg# those functions but instead duplicate the functionality here.
7198a31a186aSmrgfunc_dirname_and_basename ()
7199a31a186aSmrg{
7200a31a186aSmrg  case ${1} in
7201a31a186aSmrg    */*) func_dirname_result="${1%/*}${2}" ;;
7202a31a186aSmrg    *  ) func_dirname_result="${3}" ;;
7203eda3803bSmrg  esac
7204a31a186aSmrg  func_basename_result="${1##*/}"
7205a31a186aSmrg}
7206a31a186aSmrg
7207a31a186aSmrg# func_stripname prefix suffix name
7208a31a186aSmrg# strip PREFIX and SUFFIX off of NAME.
7209a31a186aSmrg# PREFIX and SUFFIX must not contain globbing or regex special
7210a31a186aSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
7211a31a186aSmrg# dot (in which case that matches only a dot).
7212a31a186aSmrgfunc_stripname ()
7213a31a186aSmrg{
7214a31a186aSmrg  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
7215a31a186aSmrg  # positional parameters, so assign one to ordinary parameter first.
7216a31a186aSmrg  func_stripname_result=${3}
7217a31a186aSmrg  func_stripname_result=${func_stripname_result#"${1}"}
7218a31a186aSmrg  func_stripname_result=${func_stripname_result%"${2}"}
7219a31a186aSmrg}
7220a31a186aSmrg
7221a31a186aSmrg# func_opt_split
7222a31a186aSmrgfunc_opt_split ()
7223a31a186aSmrg{
7224a31a186aSmrg  func_opt_split_opt=${1%%=*}
7225a31a186aSmrg  func_opt_split_arg=${1#*=}
7226a31a186aSmrg}
7227a31a186aSmrg
7228a31a186aSmrg# func_lo2o object
7229a31a186aSmrgfunc_lo2o ()
7230a31a186aSmrg{
7231a31a186aSmrg  case ${1} in
7232a31a186aSmrg    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
7233a31a186aSmrg    *)    func_lo2o_result=${1} ;;
7234a31a186aSmrg  esac
7235a31a186aSmrg}
7236a31a186aSmrg
7237a31a186aSmrg# func_xform libobj-or-source
7238a31a186aSmrgfunc_xform ()
7239a31a186aSmrg{
7240a31a186aSmrg  func_xform_result=${1%.*}.lo
7241a31a186aSmrg}
7242a31a186aSmrg
7243a31a186aSmrg# func_arith arithmetic-term...
7244a31a186aSmrgfunc_arith ()
7245a31a186aSmrg{
7246a31a186aSmrg  func_arith_result=$(( $[*] ))
7247a31a186aSmrg}
7248a31a186aSmrg
7249a31a186aSmrg# func_len string
7250a31a186aSmrg# STRING may not start with a hyphen.
7251a31a186aSmrgfunc_len ()
7252a31a186aSmrg{
7253a31a186aSmrg  func_len_result=${#1}
7254a31a186aSmrg}
7255a31a186aSmrg
7256a31a186aSmrg_LT_EOF
7257fe5e51b7Smrg    ;;
7258a31a186aSmrg  *) # Bourne compatible functions.
7259a31a186aSmrg    cat << \_LT_EOF >> "$cfgfile"
7260a31a186aSmrg
7261a31a186aSmrg# func_dirname file append nondir_replacement
7262a31a186aSmrg# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
7263a31a186aSmrg# otherwise set result to NONDIR_REPLACEMENT.
7264a31a186aSmrgfunc_dirname ()
7265a31a186aSmrg{
7266a31a186aSmrg  # Extract subdirectory from the argument.
7267a31a186aSmrg  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
7268a31a186aSmrg  if test "X$func_dirname_result" = "X${1}"; then
7269a31a186aSmrg    func_dirname_result="${3}"
7270a31a186aSmrg  else
7271a31a186aSmrg    func_dirname_result="$func_dirname_result${2}"
7272a31a186aSmrg  fi
7273a31a186aSmrg}
7274a31a186aSmrg
7275a31a186aSmrg# func_basename file
7276a31a186aSmrgfunc_basename ()
7277a31a186aSmrg{
7278a31a186aSmrg  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
7279a31a186aSmrg}
7280a31a186aSmrg
7281a31a186aSmrgdnl func_dirname_and_basename
7282a31a186aSmrgdnl A portable version of this function is already defined in general.m4sh
7283a31a186aSmrgdnl so there is no need for it here.
7284a31a186aSmrg
7285a31a186aSmrg# func_stripname prefix suffix name
7286a31a186aSmrg# strip PREFIX and SUFFIX off of NAME.
7287a31a186aSmrg# PREFIX and SUFFIX must not contain globbing or regex special
7288a31a186aSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
7289a31a186aSmrg# dot (in which case that matches only a dot).
7290a31a186aSmrg# func_strip_suffix prefix name
7291a31a186aSmrgfunc_stripname ()
7292a31a186aSmrg{
7293a31a186aSmrg  case ${2} in
7294a31a186aSmrg    .*) func_stripname_result=`$ECHO "X${3}" \
7295a31a186aSmrg           | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
7296a31a186aSmrg    *)  func_stripname_result=`$ECHO "X${3}" \
7297a31a186aSmrg           | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
7298fe5e51b7Smrg  esac
7299a31a186aSmrg}
7300fe5e51b7Smrg
7301a31a186aSmrg# sed scripts:
7302a31a186aSmrgmy_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
7303a31a186aSmrgmy_sed_long_arg='1s/^-[[^=]]*=//'
7304fe5e51b7Smrg
7305a31a186aSmrg# func_opt_split
7306a31a186aSmrgfunc_opt_split ()
7307a31a186aSmrg{
7308a31a186aSmrg  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
7309a31a186aSmrg  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
7310a31a186aSmrg}
7311fe5e51b7Smrg
7312a31a186aSmrg# func_lo2o object
7313a31a186aSmrgfunc_lo2o ()
7314a31a186aSmrg{
7315a31a186aSmrg  func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
7316a31a186aSmrg}
7317fe5e51b7Smrg
7318a31a186aSmrg# func_xform libobj-or-source
7319a31a186aSmrgfunc_xform ()
7320a31a186aSmrg{
7321a31a186aSmrg  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
7322a31a186aSmrg}
7323fe5e51b7Smrg
7324a31a186aSmrg# func_arith arithmetic-term...
7325a31a186aSmrgfunc_arith ()
7326a31a186aSmrg{
7327a31a186aSmrg  func_arith_result=`expr "$[@]"`
7328a31a186aSmrg}
7329fe5e51b7Smrg
7330a31a186aSmrg# func_len string
7331a31a186aSmrg# STRING may not start with a hyphen.
7332a31a186aSmrgfunc_len ()
7333a31a186aSmrg{
7334a31a186aSmrg  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
7335a31a186aSmrg}
7336fe5e51b7Smrg
7337a31a186aSmrg_LT_EOF
7338a31a186aSmrgesac
7339fe5e51b7Smrg
7340a31a186aSmrgcase $lt_shell_append in
7341a31a186aSmrg  yes)
7342a31a186aSmrg    cat << \_LT_EOF >> "$cfgfile"
7343fe5e51b7Smrg
7344a31a186aSmrg# func_append var value
7345a31a186aSmrg# Append VALUE to the end of shell variable VAR.
7346a31a186aSmrgfunc_append ()
7347a31a186aSmrg{
7348a31a186aSmrg  eval "$[1]+=\$[2]"
7349a31a186aSmrg}
7350a31a186aSmrg_LT_EOF
7351a31a186aSmrg    ;;
7352a31a186aSmrg  *)
7353a31a186aSmrg    cat << \_LT_EOF >> "$cfgfile"
7354fe5e51b7Smrg
7355a31a186aSmrg# func_append var value
7356a31a186aSmrg# Append VALUE to the end of shell variable VAR.
7357a31a186aSmrgfunc_append ()
7358a31a186aSmrg{
7359a31a186aSmrg  eval "$[1]=\$$[1]\$[2]"
7360a31a186aSmrg}
7361fe5e51b7Smrg
7362a31a186aSmrg_LT_EOF
7363a31a186aSmrg    ;;
7364a31a186aSmrg  esac
7365a31a186aSmrg])
7366fe5e51b7Smrg
7367a31a186aSmrg# Helper functions for option handling.                    -*- Autoconf -*-
7368a31a186aSmrg#
7369a31a186aSmrg#   Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
7370a31a186aSmrg#   Written by Gary V. Vaughan, 2004
7371a31a186aSmrg#
7372a31a186aSmrg# This file is free software; the Free Software Foundation gives
7373a31a186aSmrg# unlimited permission to copy and/or distribute it, with or without
7374a31a186aSmrg# modifications, as long as this notice is preserved.
7375fe5e51b7Smrg
7376a31a186aSmrg# serial 6 ltoptions.m4
7377fe5e51b7Smrg
7378a31a186aSmrg# This is to help aclocal find these macros, as it can't see m4_define.
7379a31a186aSmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
7380fe5e51b7Smrg
7381fe5e51b7Smrg
7382a31a186aSmrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
7383a31a186aSmrg# ------------------------------------------
7384a31a186aSmrgm4_define([_LT_MANGLE_OPTION],
7385a31a186aSmrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
7386fe5e51b7Smrg
7387fe5e51b7Smrg
7388a31a186aSmrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
7389a31a186aSmrg# ---------------------------------------
7390a31a186aSmrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
7391a31a186aSmrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
7392a31a186aSmrg# saved as a flag.
7393a31a186aSmrgm4_define([_LT_SET_OPTION],
7394a31a186aSmrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
7395a31a186aSmrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
7396a31a186aSmrg        _LT_MANGLE_DEFUN([$1], [$2]),
7397a31a186aSmrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
7398a31a186aSmrg])
7399fe5e51b7Smrg
7400fe5e51b7Smrg
7401a31a186aSmrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
7402a31a186aSmrg# ------------------------------------------------------------
7403a31a186aSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7404a31a186aSmrgm4_define([_LT_IF_OPTION],
7405a31a186aSmrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
7406a31a186aSmrg
7407a31a186aSmrg
7408a31a186aSmrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
7409a31a186aSmrg# -------------------------------------------------------
7410a31a186aSmrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
7411a31a186aSmrg# are set.
7412a31a186aSmrgm4_define([_LT_UNLESS_OPTIONS],
7413a31a186aSmrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
7414a31a186aSmrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
7415a31a186aSmrg		      [m4_define([$0_found])])])[]dnl
7416a31a186aSmrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
7417a31a186aSmrg])[]dnl
7418a31a186aSmrg])
7419fe5e51b7Smrg
7420fe5e51b7Smrg
7421a31a186aSmrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
7422a31a186aSmrg# ----------------------------------------
7423a31a186aSmrg# OPTION-LIST is a space-separated list of Libtool options associated
7424a31a186aSmrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
7425a31a186aSmrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
7426a31a186aSmrg# the unknown option and exit.
7427a31a186aSmrgm4_defun([_LT_SET_OPTIONS],
7428a31a186aSmrg[# Set options
7429a31a186aSmrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
7430a31a186aSmrg    [_LT_SET_OPTION([$1], _LT_Option)])
7431a31a186aSmrg
7432a31a186aSmrgm4_if([$1],[LT_INIT],[
7433a31a186aSmrg  dnl
7434a31a186aSmrg  dnl Simply set some default values (i.e off) if boolean options were not
7435a31a186aSmrg  dnl specified:
7436a31a186aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
7437a31a186aSmrg  ])
7438a31a186aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
7439a31a186aSmrg  ])
7440a31a186aSmrg  dnl
7441a31a186aSmrg  dnl If no reference was made to various pairs of opposing options, then
7442a31a186aSmrg  dnl we run the default mode handler for the pair.  For example, if neither
7443a31a186aSmrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
7444a31a186aSmrg  dnl archives by default:
7445a31a186aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
7446a31a186aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
7447a31a186aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
7448a31a186aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
7449a31a186aSmrg  		   [_LT_ENABLE_FAST_INSTALL])
7450a31a186aSmrg  ])
7451a31a186aSmrg])# _LT_SET_OPTIONS
7452fe5e51b7Smrg
7453fe5e51b7Smrg
7454fe5e51b7Smrg
7455a31a186aSmrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
7456a31a186aSmrg# -----------------------------------------
7457a31a186aSmrgm4_define([_LT_MANGLE_DEFUN],
7458a31a186aSmrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
7459eda3803bSmrg
7460eda3803bSmrg
7461a31a186aSmrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
7462a31a186aSmrg# -----------------------------------------------
7463a31a186aSmrgm4_define([LT_OPTION_DEFINE],
7464a31a186aSmrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
7465a31a186aSmrg])# LT_OPTION_DEFINE
7466eda3803bSmrg
7467eda3803bSmrg
7468a31a186aSmrg# dlopen
7469a31a186aSmrg# ------
7470a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
7471a31a186aSmrg])
7472a31a186aSmrg
7473a31a186aSmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
7474a31a186aSmrg[_LT_SET_OPTION([LT_INIT], [dlopen])
7475a31a186aSmrgAC_DIAGNOSE([obsolete],
7476a31a186aSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
7477a31a186aSmrgput the `dlopen' option into LT_INIT's first parameter.])
7478a31a186aSmrg])
7479a31a186aSmrg
7480a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
7481a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
7482a31a186aSmrg
7483a31a186aSmrg
7484a31a186aSmrg# win32-dll
7485a31a186aSmrg# ---------
7486a31a186aSmrg# Declare package support for building win32 dll's.
7487a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
7488a31a186aSmrg[enable_win32_dll=yes
7489a31a186aSmrg
7490a31a186aSmrgcase $host in
7491a31a186aSmrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
7492a31a186aSmrg  AC_CHECK_TOOL(AS, as, false)
7493a31a186aSmrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
7494a31a186aSmrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
7495a31a186aSmrg  ;;
7496a31a186aSmrgesac
7497fe5e51b7Smrg
7498a31a186aSmrgtest -z "$AS" && AS=as
7499a31a186aSmrg_LT_DECL([], [AS],      [0], [Assembler program])dnl
7500fe5e51b7Smrg
7501a31a186aSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
7502a31a186aSmrg_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
7503fe5e51b7Smrg
7504a31a186aSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
7505a31a186aSmrg_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
7506a31a186aSmrg])# win32-dll
7507fe5e51b7Smrg
7508a31a186aSmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
7509a31a186aSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7510a31a186aSmrg_LT_SET_OPTION([LT_INIT], [win32-dll])
7511a31a186aSmrgAC_DIAGNOSE([obsolete],
7512a31a186aSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
7513a31a186aSmrgput the `win32-dll' option into LT_INIT's first parameter.])
7514a31a186aSmrg])
7515fe5e51b7Smrg
7516a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
7517a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
7518fe5e51b7Smrg
7519fe5e51b7Smrg
7520a31a186aSmrg# _LT_ENABLE_SHARED([DEFAULT])
7521a31a186aSmrg# ----------------------------
7522a31a186aSmrg# implement the --enable-shared flag, and supports the `shared' and
7523a31a186aSmrg# `disable-shared' LT_INIT options.
7524a31a186aSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7525a31a186aSmrgm4_define([_LT_ENABLE_SHARED],
7526a31a186aSmrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
7527a31a186aSmrgAC_ARG_ENABLE([shared],
7528a31a186aSmrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
7529a31a186aSmrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
7530a31a186aSmrg    [p=${PACKAGE-default}
7531a31a186aSmrg    case $enableval in
7532a31a186aSmrg    yes) enable_shared=yes ;;
7533a31a186aSmrg    no) enable_shared=no ;;
7534a31a186aSmrg    *)
7535a31a186aSmrg      enable_shared=no
7536a31a186aSmrg      # Look at the argument we got.  We use all the common list separators.
7537a31a186aSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7538a31a186aSmrg      for pkg in $enableval; do
7539a31a186aSmrg	IFS="$lt_save_ifs"
7540a31a186aSmrg	if test "X$pkg" = "X$p"; then
7541a31a186aSmrg	  enable_shared=yes
7542a31a186aSmrg	fi
7543a31a186aSmrg      done
7544a31a186aSmrg      IFS="$lt_save_ifs"
7545fe5e51b7Smrg      ;;
7546a31a186aSmrg    esac],
7547a31a186aSmrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
7548fe5e51b7Smrg
7549a31a186aSmrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
7550a31a186aSmrg	[Whether or not to build shared libraries])
7551a31a186aSmrg])# _LT_ENABLE_SHARED
7552fe5e51b7Smrg
7553a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
7554a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
7555fe5e51b7Smrg
7556a31a186aSmrg# Old names:
7557a31a186aSmrgAC_DEFUN([AC_ENABLE_SHARED],
7558a31a186aSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
7559a31a186aSmrg])
7560fe5e51b7Smrg
7561a31a186aSmrgAC_DEFUN([AC_DISABLE_SHARED],
7562a31a186aSmrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
7563a31a186aSmrg])
7564fe5e51b7Smrg
7565a31a186aSmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
7566a31a186aSmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
7567fe5e51b7Smrg
7568a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
7569a31a186aSmrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
7570a31a186aSmrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
7571fe5e51b7Smrg
7572fe5e51b7Smrg
7573fe5e51b7Smrg
7574a31a186aSmrg# _LT_ENABLE_STATIC([DEFAULT])
7575a31a186aSmrg# ----------------------------
7576a31a186aSmrg# implement the --enable-static flag, and support the `static' and
7577a31a186aSmrg# `disable-static' LT_INIT options.
7578a31a186aSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7579a31a186aSmrgm4_define([_LT_ENABLE_STATIC],
7580a31a186aSmrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
7581a31a186aSmrgAC_ARG_ENABLE([static],
7582a31a186aSmrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
7583a31a186aSmrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
7584a31a186aSmrg    [p=${PACKAGE-default}
7585a31a186aSmrg    case $enableval in
7586a31a186aSmrg    yes) enable_static=yes ;;
7587a31a186aSmrg    no) enable_static=no ;;
7588a31a186aSmrg    *)
7589a31a186aSmrg     enable_static=no
7590a31a186aSmrg      # Look at the argument we got.  We use all the common list separators.
7591a31a186aSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7592a31a186aSmrg      for pkg in $enableval; do
7593a31a186aSmrg	IFS="$lt_save_ifs"
7594a31a186aSmrg	if test "X$pkg" = "X$p"; then
7595a31a186aSmrg	  enable_static=yes
7596a31a186aSmrg	fi
7597a31a186aSmrg      done
7598a31a186aSmrg      IFS="$lt_save_ifs"
7599fe5e51b7Smrg      ;;
7600a31a186aSmrg    esac],
7601a31a186aSmrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
7602fe5e51b7Smrg
7603a31a186aSmrg    _LT_DECL([build_old_libs], [enable_static], [0],
7604a31a186aSmrg	[Whether or not to build static libraries])
7605a31a186aSmrg])# _LT_ENABLE_STATIC
7606fe5e51b7Smrg
7607a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
7608a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
7609fe5e51b7Smrg
7610a31a186aSmrg# Old names:
7611a31a186aSmrgAC_DEFUN([AC_ENABLE_STATIC],
7612a31a186aSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
7613a31a186aSmrg])
7614fe5e51b7Smrg
7615a31a186aSmrgAC_DEFUN([AC_DISABLE_STATIC],
7616a31a186aSmrg[_LT_SET_OPTION([LT_INIT], [disable-static])
7617a31a186aSmrg])
7618fe5e51b7Smrg
7619a31a186aSmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
7620a31a186aSmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
7621fe5e51b7Smrg
7622a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
7623a31a186aSmrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
7624a31a186aSmrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
7625fe5e51b7Smrg
7626fe5e51b7Smrg
7627fe5e51b7Smrg
7628a31a186aSmrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
7629a31a186aSmrg# ----------------------------------
7630a31a186aSmrg# implement the --enable-fast-install flag, and support the `fast-install'
7631a31a186aSmrg# and `disable-fast-install' LT_INIT options.
7632a31a186aSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7633a31a186aSmrgm4_define([_LT_ENABLE_FAST_INSTALL],
7634a31a186aSmrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
7635a31a186aSmrgAC_ARG_ENABLE([fast-install],
7636a31a186aSmrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
7637a31a186aSmrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
7638a31a186aSmrg    [p=${PACKAGE-default}
7639a31a186aSmrg    case $enableval in
7640a31a186aSmrg    yes) enable_fast_install=yes ;;
7641a31a186aSmrg    no) enable_fast_install=no ;;
7642a31a186aSmrg    *)
7643a31a186aSmrg      enable_fast_install=no
7644a31a186aSmrg      # Look at the argument we got.  We use all the common list separators.
7645a31a186aSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7646a31a186aSmrg      for pkg in $enableval; do
7647a31a186aSmrg	IFS="$lt_save_ifs"
7648a31a186aSmrg	if test "X$pkg" = "X$p"; then
7649a31a186aSmrg	  enable_fast_install=yes
7650eda3803bSmrg	fi
7651a31a186aSmrg      done
7652a31a186aSmrg      IFS="$lt_save_ifs"
7653fe5e51b7Smrg      ;;
7654a31a186aSmrg    esac],
7655a31a186aSmrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
7656fe5e51b7Smrg
7657a31a186aSmrg_LT_DECL([fast_install], [enable_fast_install], [0],
7658a31a186aSmrg	 [Whether or not to optimize for fast installation])dnl
7659a31a186aSmrg])# _LT_ENABLE_FAST_INSTALL
7660fe5e51b7Smrg
7661a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
7662a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
7663fe5e51b7Smrg
7664a31a186aSmrg# Old names:
7665a31a186aSmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
7666a31a186aSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
7667a31a186aSmrgAC_DIAGNOSE([obsolete],
7668a31a186aSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
7669a31a186aSmrgthe `fast-install' option into LT_INIT's first parameter.])
7670a31a186aSmrg])
7671fe5e51b7Smrg
7672a31a186aSmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
7673a31a186aSmrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
7674a31a186aSmrgAC_DIAGNOSE([obsolete],
7675a31a186aSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
7676a31a186aSmrgthe `disable-fast-install' option into LT_INIT's first parameter.])
7677a31a186aSmrg])
7678fe5e51b7Smrg
7679a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
7680a31a186aSmrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
7681a31a186aSmrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
7682fe5e51b7Smrg
7683fe5e51b7Smrg
7684a31a186aSmrg# _LT_WITH_PIC([MODE])
7685a31a186aSmrg# --------------------
7686a31a186aSmrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
7687a31a186aSmrg# LT_INIT options.
7688a31a186aSmrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
7689a31a186aSmrgm4_define([_LT_WITH_PIC],
7690a31a186aSmrg[AC_ARG_WITH([pic],
7691a31a186aSmrg    [AS_HELP_STRING([--with-pic],
7692a31a186aSmrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
7693a31a186aSmrg    [pic_mode="$withval"],
7694a31a186aSmrg    [pic_mode=default])
7695a31a186aSmrg
7696a31a186aSmrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
7697fe5e51b7Smrg
7698a31a186aSmrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
7699a31a186aSmrg])# _LT_WITH_PIC
7700eda3803bSmrg
7701a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
7702a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
7703eda3803bSmrg
7704a31a186aSmrg# Old name:
7705a31a186aSmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
7706a31a186aSmrg[_LT_SET_OPTION([LT_INIT], [pic-only])
7707a31a186aSmrgAC_DIAGNOSE([obsolete],
7708a31a186aSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
7709a31a186aSmrgput the `pic-only' option into LT_INIT's first parameter.])
7710fe5e51b7Smrg])
7711fe5e51b7Smrg
7712a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
7713a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
7714fe5e51b7Smrg
7715fe5e51b7Smrg
7716a31a186aSmrgm4_define([_LTDL_MODE], [])
7717a31a186aSmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
7718a31a186aSmrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
7719a31a186aSmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
7720a31a186aSmrg		 [m4_define([_LTDL_MODE], [recursive])])
7721a31a186aSmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
7722a31a186aSmrg		 [m4_define([_LTDL_MODE], [subproject])])
7723fe5e51b7Smrg
7724a31a186aSmrgm4_define([_LTDL_TYPE], [])
7725a31a186aSmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
7726a31a186aSmrg		 [m4_define([_LTDL_TYPE], [installable])])
7727a31a186aSmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
7728a31a186aSmrg		 [m4_define([_LTDL_TYPE], [convenience])])
7729fe5e51b7Smrg
7730a31a186aSmrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
7731fe5e51b7Smrg#
7732a31a186aSmrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
7733a31a186aSmrg# Written by Gary V. Vaughan, 2004
7734fe5e51b7Smrg#
7735a31a186aSmrg# This file is free software; the Free Software Foundation gives
7736a31a186aSmrg# unlimited permission to copy and/or distribute it, with or without
7737a31a186aSmrg# modifications, as long as this notice is preserved.
7738a31a186aSmrg
7739a31a186aSmrg# serial 6 ltsugar.m4
7740a31a186aSmrg
7741a31a186aSmrg# This is to help aclocal find these macros, as it can't see m4_define.
7742a31a186aSmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
7743a31a186aSmrg
7744a31a186aSmrg
7745a31a186aSmrg# lt_join(SEP, ARG1, [ARG2...])
7746a31a186aSmrg# -----------------------------
7747a31a186aSmrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
7748a31a186aSmrg# associated separator.
7749a31a186aSmrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
7750a31a186aSmrg# versions in m4sugar had bugs.
7751a31a186aSmrgm4_define([lt_join],
7752a31a186aSmrg[m4_if([$#], [1], [],
7753a31a186aSmrg       [$#], [2], [[$2]],
7754a31a186aSmrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
7755a31a186aSmrgm4_define([_lt_join],
7756a31a186aSmrg[m4_if([$#$2], [2], [],
7757a31a186aSmrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
7758a31a186aSmrg
7759a31a186aSmrg
7760a31a186aSmrg# lt_car(LIST)
7761a31a186aSmrg# lt_cdr(LIST)
7762a31a186aSmrg# ------------
7763a31a186aSmrg# Manipulate m4 lists.
7764a31a186aSmrg# These macros are necessary as long as will still need to support
7765a31a186aSmrg# Autoconf-2.59 which quotes differently.
7766a31a186aSmrgm4_define([lt_car], [[$1]])
7767a31a186aSmrgm4_define([lt_cdr],
7768a31a186aSmrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
7769a31a186aSmrg       [$#], 1, [],
7770a31a186aSmrg       [m4_dquote(m4_shift($@))])])
7771a31a186aSmrgm4_define([lt_unquote], $1)
7772a31a186aSmrg
7773a31a186aSmrg
7774a31a186aSmrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
7775a31a186aSmrg# ------------------------------------------
7776a31a186aSmrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
7777a31a186aSmrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
7778a31a186aSmrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
7779a31a186aSmrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
7780a31a186aSmrg# than defined and empty).
7781643b027fSmrg#
7782a31a186aSmrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
7783a31a186aSmrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
7784a31a186aSmrgm4_define([lt_append],
7785a31a186aSmrg[m4_define([$1],
7786a31a186aSmrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
7787a31a186aSmrg
7788a31a186aSmrg
7789a31a186aSmrg
7790a31a186aSmrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
7791a31a186aSmrg# ----------------------------------------------------------
7792a31a186aSmrg# Produce a SEP delimited list of all paired combinations of elements of
7793a31a186aSmrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
7794a31a186aSmrg# has the form PREFIXmINFIXSUFFIXn.
7795a31a186aSmrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
7796a31a186aSmrgm4_define([lt_combine],
7797a31a186aSmrg[m4_if(m4_eval([$# > 3]), [1],
7798a31a186aSmrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
7799a31a186aSmrg[[m4_foreach([_Lt_prefix], [$2],
7800a31a186aSmrg	     [m4_foreach([_Lt_suffix],
7801a31a186aSmrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
7802a31a186aSmrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
7803a31a186aSmrg
7804a31a186aSmrg
7805a31a186aSmrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
7806a31a186aSmrg# -----------------------------------------------------------------------
7807a31a186aSmrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
7808a31a186aSmrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
7809a31a186aSmrgm4_define([lt_if_append_uniq],
7810a31a186aSmrg[m4_ifdef([$1],
7811a31a186aSmrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
7812a31a186aSmrg		 [lt_append([$1], [$2], [$3])$4],
7813a31a186aSmrg		 [$5])],
7814a31a186aSmrg	  [lt_append([$1], [$2], [$3])$4])])
7815a31a186aSmrg
7816a31a186aSmrg
7817a31a186aSmrg# lt_dict_add(DICT, KEY, VALUE)
7818a31a186aSmrg# -----------------------------
7819a31a186aSmrgm4_define([lt_dict_add],
7820a31a186aSmrg[m4_define([$1($2)], [$3])])
7821fe5e51b7Smrg
7822eda3803bSmrg
7823a31a186aSmrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
7824a31a186aSmrg# --------------------------------------------
7825a31a186aSmrgm4_define([lt_dict_add_subkey],
7826a31a186aSmrg[m4_define([$1($2:$3)], [$4])])
7827fe5e51b7Smrg
7828fe5e51b7Smrg
7829a31a186aSmrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
7830a31a186aSmrg# ----------------------------------
7831a31a186aSmrgm4_define([lt_dict_fetch],
7832a31a186aSmrg[m4_ifval([$3],
7833a31a186aSmrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
7834a31a186aSmrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
7835fe5e51b7Smrg
7836fe5e51b7Smrg
7837a31a186aSmrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
7838a31a186aSmrg# -----------------------------------------------------------------
7839a31a186aSmrgm4_define([lt_if_dict_fetch],
7840a31a186aSmrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
7841a31a186aSmrg	[$5],
7842a31a186aSmrg    [$6])])
7843fe5e51b7Smrg
7844a31a186aSmrg
7845a31a186aSmrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
7846a31a186aSmrg# --------------------------------------------------------------
7847a31a186aSmrgm4_define([lt_dict_filter],
7848a31a186aSmrg[m4_if([$5], [], [],
7849a31a186aSmrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
7850a31a186aSmrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
7851a31a186aSmrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
7852fe5e51b7Smrg])
7853fe5e51b7Smrg
7854a31a186aSmrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
7855a31a186aSmrg#
7856a31a186aSmrg#   Copyright (C) 2004 Free Software Foundation, Inc.
7857a31a186aSmrg#   Written by Scott James Remnant, 2004
7858a31a186aSmrg#
7859a31a186aSmrg# This file is free software; the Free Software Foundation gives
7860a31a186aSmrg# unlimited permission to copy and/or distribute it, with or without
7861a31a186aSmrg# modifications, as long as this notice is preserved.
7862fe5e51b7Smrg
7863a31a186aSmrg# Generated from ltversion.in.
7864fe5e51b7Smrg
7865d7be9c72Smrg# serial 3017 ltversion.m4
7866a31a186aSmrg# This file is part of GNU Libtool
7867fe5e51b7Smrg
7868d7be9c72Smrgm4_define([LT_PACKAGE_VERSION], [2.2.6b])
7869d7be9c72Smrgm4_define([LT_PACKAGE_REVISION], [1.3017])
7870fe5e51b7Smrg
7871a31a186aSmrgAC_DEFUN([LTVERSION_VERSION],
7872d7be9c72Smrg[macro_version='2.2.6b'
7873d7be9c72Smrgmacro_revision='1.3017'
7874a31a186aSmrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
7875a31a186aSmrg_LT_DECL(, macro_revision, 0)
7876fe5e51b7Smrg])
7877eda3803bSmrg
7878a31a186aSmrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
7879a31a186aSmrg#
7880a31a186aSmrg#   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
7881a31a186aSmrg#   Written by Scott James Remnant, 2004.
7882a31a186aSmrg#
7883a31a186aSmrg# This file is free software; the Free Software Foundation gives
7884a31a186aSmrg# unlimited permission to copy and/or distribute it, with or without
7885a31a186aSmrg# modifications, as long as this notice is preserved.
7886a31a186aSmrg
7887a31a186aSmrg# serial 4 lt~obsolete.m4
7888a31a186aSmrg
7889a31a186aSmrg# These exist entirely to fool aclocal when bootstrapping libtool.
7890a31a186aSmrg#
7891a31a186aSmrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
7892a31a186aSmrg# which have later been changed to m4_define as they aren't part of the
7893a31a186aSmrg# exported API, or moved to Autoconf or Automake where they belong.
7894a31a186aSmrg#
7895a31a186aSmrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
7896a31a186aSmrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
7897a31a186aSmrg# using a macro with the same name in our local m4/libtool.m4 it'll
7898a31a186aSmrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
7899a31a186aSmrg# and doesn't know about Autoconf macros at all.)
7900a31a186aSmrg#
7901a31a186aSmrg# So we provide this file, which has a silly filename so it's always
7902a31a186aSmrg# included after everything else.  This provides aclocal with the
7903a31a186aSmrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
7904a31a186aSmrg# because those macros already exist, or will be overwritten later.
7905a31a186aSmrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
7906a31a186aSmrg#
7907a31a186aSmrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
7908a31a186aSmrg# Yes, that means every name once taken will need to remain here until
7909a31a186aSmrg# we give up compatibility with versions before 1.7, at which point
7910a31a186aSmrg# we need to keep only those names which we still refer to.
7911a31a186aSmrg
7912a31a186aSmrg# This is to help aclocal find these macros, as it can't see m4_define.
7913a31a186aSmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
7914a31a186aSmrg
7915a31a186aSmrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
7916a31a186aSmrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
7917a31a186aSmrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
7918a31a186aSmrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
7919a31a186aSmrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
7920a31a186aSmrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
7921a31a186aSmrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
7922a31a186aSmrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
7923a31a186aSmrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
7924a31a186aSmrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
7925a31a186aSmrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
7926a31a186aSmrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
7927a31a186aSmrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
7928a31a186aSmrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
7929a31a186aSmrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
7930a31a186aSmrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
7931a31a186aSmrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
7932a31a186aSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
7933a31a186aSmrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
7934a31a186aSmrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
7935a31a186aSmrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
7936a31a186aSmrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
7937a31a186aSmrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
7938a31a186aSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
7939a31a186aSmrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
7940a31a186aSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
7941a31a186aSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
7942a31a186aSmrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
7943a31a186aSmrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
7944a31a186aSmrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
7945a31a186aSmrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
7946a31a186aSmrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
7947a31a186aSmrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
7948a31a186aSmrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
7949a31a186aSmrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
7950a31a186aSmrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
7951a31a186aSmrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
7952a31a186aSmrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
7953a31a186aSmrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
7954a31a186aSmrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
7955a31a186aSmrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
7956a31a186aSmrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
7957a31a186aSmrgm4_ifndef([AC_LIBTOOL_RC],		[AC_DEFUN([AC_LIBTOOL_RC])])
7958a31a186aSmrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
7959a31a186aSmrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
7960a31a186aSmrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
7961a31a186aSmrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
7962a31a186aSmrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
7963a31a186aSmrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
7964a31a186aSmrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
7965a31a186aSmrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
7966a31a186aSmrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
7967a31a186aSmrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
7968a31a186aSmrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
7969a31a186aSmrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
7970a31a186aSmrg
7971fe5e51b7Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
7972fe5e51b7Smrg# 
7973fe5e51b7Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
7974fe5e51b7Smrg#
7975fe5e51b7Smrg# This program is free software; you can redistribute it and/or modify
7976fe5e51b7Smrg# it under the terms of the GNU General Public License as published by
7977fe5e51b7Smrg# the Free Software Foundation; either version 2 of the License, or
7978fe5e51b7Smrg# (at your option) any later version.
7979fe5e51b7Smrg#
7980fe5e51b7Smrg# This program is distributed in the hope that it will be useful, but
7981fe5e51b7Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
7982fe5e51b7Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
7983fe5e51b7Smrg# General Public License for more details.
7984fe5e51b7Smrg#
7985fe5e51b7Smrg# You should have received a copy of the GNU General Public License
7986fe5e51b7Smrg# along with this program; if not, write to the Free Software
7987fe5e51b7Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
7988fe5e51b7Smrg#
7989fe5e51b7Smrg# As a special exception to the GNU General Public License, if you
7990fe5e51b7Smrg# distribute this file as part of a program that contains a
7991fe5e51b7Smrg# configuration script generated by Autoconf, you may include it under
7992fe5e51b7Smrg# the same distribution terms that you use for the rest of that program.
7993fe5e51b7Smrg
7994fe5e51b7Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
7995fe5e51b7Smrg# ----------------------------------
7996fe5e51b7SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
7997fe5e51b7Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
7998fe5e51b7Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
7999fe5e51b7SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
8000fe5e51b7Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
8001fe5e51b7Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
8002fe5e51b7Smrgfi
8003fe5e51b7Smrgif test -n "$PKG_CONFIG"; then
8004fe5e51b7Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
8005fe5e51b7Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
8006fe5e51b7Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
8007fe5e51b7Smrg		AC_MSG_RESULT([yes])
8008fe5e51b7Smrg	else
8009fe5e51b7Smrg		AC_MSG_RESULT([no])
8010fe5e51b7Smrg		PKG_CONFIG=""
8011fe5e51b7Smrg	fi
8012fe5e51b7Smrg		
8013fe5e51b7Smrgfi[]dnl
8014fe5e51b7Smrg])# PKG_PROG_PKG_CONFIG
8015fe5e51b7Smrg
8016fe5e51b7Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
8017fe5e51b7Smrg#
8018fe5e51b7Smrg# Check to see whether a particular set of modules exists.  Similar
8019fe5e51b7Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
8020fe5e51b7Smrg#
8021fe5e51b7Smrg#
8022fe5e51b7Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
8023fe5e51b7Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
8024fe5e51b7Smrg# PKG_CHECK_EXISTS manually
8025fe5e51b7Smrg# --------------------------------------------------------------
8026fe5e51b7SmrgAC_DEFUN([PKG_CHECK_EXISTS],
8027fe5e51b7Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8028fe5e51b7Smrgif test -n "$PKG_CONFIG" && \
8029fe5e51b7Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
8030fe5e51b7Smrg  m4_ifval([$2], [$2], [:])
8031fe5e51b7Smrgm4_ifvaln([$3], [else
8032fe5e51b7Smrg  $3])dnl
8033fe5e51b7Smrgfi])
8034fe5e51b7Smrg
8035fe5e51b7Smrg
8036fe5e51b7Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
8037fe5e51b7Smrg# ---------------------------------------------
8038fe5e51b7Smrgm4_define([_PKG_CONFIG],
8039eda3803bSmrg[if test -n "$$1"; then
8040eda3803bSmrg    pkg_cv_[]$1="$$1"
8041eda3803bSmrg elif test -n "$PKG_CONFIG"; then
8042eda3803bSmrg    PKG_CHECK_EXISTS([$3],
8043eda3803bSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
8044eda3803bSmrg		     [pkg_failed=yes])
8045eda3803bSmrg else
8046eda3803bSmrg    pkg_failed=untried
8047fe5e51b7Smrgfi[]dnl
8048fe5e51b7Smrg])# _PKG_CONFIG
8049fe5e51b7Smrg
8050fe5e51b7Smrg# _PKG_SHORT_ERRORS_SUPPORTED
8051fe5e51b7Smrg# -----------------------------
8052fe5e51b7SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
8053fe5e51b7Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
8054fe5e51b7Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
8055fe5e51b7Smrg        _pkg_short_errors_supported=yes
8056fe5e51b7Smrgelse
8057fe5e51b7Smrg        _pkg_short_errors_supported=no
8058fe5e51b7Smrgfi[]dnl
8059fe5e51b7Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
8060fe5e51b7Smrg
8061fe5e51b7Smrg
8062fe5e51b7Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
8063fe5e51b7Smrg# [ACTION-IF-NOT-FOUND])
8064fe5e51b7Smrg#
8065fe5e51b7Smrg#
8066fe5e51b7Smrg# Note that if there is a possibility the first call to
8067fe5e51b7Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
8068fe5e51b7Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
8069fe5e51b7Smrg#
8070fe5e51b7Smrg#
8071fe5e51b7Smrg# --------------------------------------------------------------
8072fe5e51b7SmrgAC_DEFUN([PKG_CHECK_MODULES],
8073fe5e51b7Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8074fe5e51b7SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
8075fe5e51b7SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
8076fe5e51b7Smrg
8077fe5e51b7Smrgpkg_failed=no
8078fe5e51b7SmrgAC_MSG_CHECKING([for $1])
8079fe5e51b7Smrg
8080fe5e51b7Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
8081fe5e51b7Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
8082fe5e51b7Smrg
8083fe5e51b7Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
8084fe5e51b7Smrgand $1[]_LIBS to avoid the need to call pkg-config.
8085fe5e51b7SmrgSee the pkg-config man page for more details.])
8086fe5e51b7Smrg
8087fe5e51b7Smrgif test $pkg_failed = yes; then
8088fe5e51b7Smrg        _PKG_SHORT_ERRORS_SUPPORTED
8089fe5e51b7Smrg        if test $_pkg_short_errors_supported = yes; then
8090eda3803bSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
8091fe5e51b7Smrg        else 
8092eda3803bSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
8093fe5e51b7Smrg        fi
8094fe5e51b7Smrg	# Put the nasty error message in config.log where it belongs
8095fe5e51b7Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
8096fe5e51b7Smrg
8097fe5e51b7Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
8098fe5e51b7Smrg[Package requirements ($2) were not met:
8099fe5e51b7Smrg
8100fe5e51b7Smrg$$1_PKG_ERRORS
8101fe5e51b7Smrg
8102fe5e51b7SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
8103fe5e51b7Smrginstalled software in a non-standard prefix.
8104fe5e51b7Smrg
8105fe5e51b7Smrg_PKG_TEXT
8106fe5e51b7Smrg])],
8107fe5e51b7Smrg		[AC_MSG_RESULT([no])
8108fe5e51b7Smrg                $4])
8109fe5e51b7Smrgelif test $pkg_failed = untried; then
8110fe5e51b7Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
8111fe5e51b7Smrg[The pkg-config script could not be found or is too old.  Make sure it
8112fe5e51b7Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
8113fe5e51b7Smrgpath to pkg-config.
8114fe5e51b7Smrg
8115fe5e51b7Smrg_PKG_TEXT
8116fe5e51b7Smrg
8117fe5e51b7SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
8118fe5e51b7Smrg		[$4])
8119fe5e51b7Smrgelse
8120fe5e51b7Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
8121fe5e51b7Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
8122fe5e51b7Smrg        AC_MSG_RESULT([yes])
8123fe5e51b7Smrg	ifelse([$3], , :, [$3])
8124fe5e51b7Smrgfi[]dnl
8125fe5e51b7Smrg])# PKG_CHECK_MODULES
8126fe5e51b7Smrg
8127eda3803bSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
8128fe5e51b7Smrgdnl
8129fe5e51b7Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
8130fe5e51b7Smrgdnl 
8131fe5e51b7Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
8132d7be9c72Smrgdnl copy of this software and associated documentation files (the "Software"),
8133d7be9c72Smrgdnl to deal in the Software without restriction, including without limitation
8134d7be9c72Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
8135d7be9c72Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
8136d7be9c72Smrgdnl Software is furnished to do so, subject to the following conditions:
8137fe5e51b7Smrgdnl
8138d7be9c72Smrgdnl The above copyright notice and this permission notice (including the next
8139d7be9c72Smrgdnl paragraph) shall be included in all copies or substantial portions of the
8140d7be9c72Smrgdnl Software.
8141fe5e51b7Smrgdnl
8142d7be9c72Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
8143d7be9c72Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
8144d7be9c72Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
8145d7be9c72Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
8146d7be9c72Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
8147d7be9c72Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
8148d7be9c72Smrgdnl DEALINGS IN THE SOFTWARE.
8149fe5e51b7Smrg
8150fe5e51b7Smrg# XORG_MACROS_VERSION(required-version)
8151fe5e51b7Smrg# -------------------------------------
8152fe5e51b7Smrg# Minimum version: 1.1.0
8153fe5e51b7Smrg#
8154fe5e51b7Smrg# If you're using a macro added in Version 1.1 or newer, include this in
8155fe5e51b7Smrg# your configure.ac with the minimum required version, such as:
8156fe5e51b7Smrg# XORG_MACROS_VERSION(1.1)
8157fe5e51b7Smrg#
8158a31a186aSmrg# To ensure that this macro is defined, also add:
8159a31a186aSmrg# m4_ifndef([XORG_MACROS_VERSION],
8160a31a186aSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
8161fe5e51b7Smrg#
8162fe5e51b7Smrg#
8163fe5e51b7Smrg# See the "minimum version" comment for each macro you use to see what 
8164fe5e51b7Smrg# version you require.
8165a31a186aSmrgm4_defun([XORG_MACROS_VERSION],[
8166d7be9c72Smrgm4_define([vers_have], [1.10.0])
8167a31a186aSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
8168a31a186aSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
8169a31a186aSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
8170a31a186aSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
8171a31a186aSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
8172a31a186aSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
8173a31a186aSmrgm4_undefine([vers_have])
8174a31a186aSmrgm4_undefine([maj_have])
8175a31a186aSmrgm4_undefine([maj_needed])
8176fe5e51b7Smrg]) # XORG_MACROS_VERSION
8177fe5e51b7Smrg
8178fe5e51b7Smrg# XORG_PROG_RAWCPP()
8179fe5e51b7Smrg# ------------------
8180fe5e51b7Smrg# Minimum version: 1.0.0
8181fe5e51b7Smrg#
8182fe5e51b7Smrg# Find cpp program and necessary flags for use in pre-processing text files
8183fe5e51b7Smrg# such as man pages and config files
8184fe5e51b7SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
8185fe5e51b7SmrgAC_REQUIRE([AC_PROG_CPP])
8186fe5e51b7SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
8187fe5e51b7Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
8188fe5e51b7Smrg
8189fe5e51b7Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
8190fe5e51b7Smrg# which is not the best choice for supporting other OS'es, but covers most
8191fe5e51b7Smrg# of the ones we need for now.
8192fe5e51b7SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
8193fe5e51b7SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
8194fe5e51b7Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
8195fe5e51b7Smrg	AC_MSG_RESULT([no])
8196fe5e51b7Smrgelse
8197fe5e51b7Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
8198fe5e51b7Smrg		RAWCPPFLAGS=-undef
8199fe5e51b7Smrg		AC_MSG_RESULT([yes])
8200eda3803bSmrg	# under Cygwin unix is still defined even with -undef
8201eda3803bSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
8202eda3803bSmrg		RAWCPPFLAGS="-undef -ansi"
8203eda3803bSmrg		AC_MSG_RESULT([yes, with -ansi])
8204fe5e51b7Smrg	else
8205fe5e51b7Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
8206fe5e51b7Smrg	fi
8207fe5e51b7Smrgfi
8208fe5e51b7Smrgrm -f conftest.$ac_ext
8209fe5e51b7Smrg
8210fe5e51b7SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
8211fe5e51b7SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
8212fe5e51b7Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
8213fe5e51b7Smrg	AC_MSG_RESULT([no])
8214fe5e51b7Smrgelse
8215fe5e51b7Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
8216fe5e51b7Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
8217fe5e51b7Smrg		AC_MSG_RESULT([yes])
8218fe5e51b7Smrg	else
8219fe5e51b7Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
8220fe5e51b7Smrg	fi
8221fe5e51b7Smrgfi
8222fe5e51b7Smrgrm -f conftest.$ac_ext
8223fe5e51b7SmrgAC_SUBST(RAWCPPFLAGS)
8224fe5e51b7Smrg]) # XORG_PROG_RAWCPP
8225fe5e51b7Smrg
8226fe5e51b7Smrg# XORG_MANPAGE_SECTIONS()
8227fe5e51b7Smrg# -----------------------
8228fe5e51b7Smrg# Minimum version: 1.0.0
8229fe5e51b7Smrg#
8230fe5e51b7Smrg# Determine which sections man pages go in for the different man page types
8231fe5e51b7Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
8232fe5e51b7Smrg# Not sure if there's any better way than just hardcoding by OS name.
8233fe5e51b7Smrg# Override default settings by setting environment variables
8234d7be9c72Smrg# Added MAN_SUBSTS in version 1.8
8235d7be9c72Smrg# Added AC_PROG_SED in version 1.8
8236fe5e51b7Smrg
8237fe5e51b7SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
8238fe5e51b7SmrgAC_REQUIRE([AC_CANONICAL_HOST])
8239d7be9c72SmrgAC_REQUIRE([AC_PROG_SED])
8240fe5e51b7Smrg
8241fe5e51b7Smrgif test x$APP_MAN_SUFFIX = x    ; then
8242fe5e51b7Smrg    APP_MAN_SUFFIX=1
8243fe5e51b7Smrgfi
8244fe5e51b7Smrgif test x$APP_MAN_DIR = x    ; then
8245fe5e51b7Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
8246fe5e51b7Smrgfi
8247fe5e51b7Smrg
8248fe5e51b7Smrgif test x$LIB_MAN_SUFFIX = x    ; then
8249fe5e51b7Smrg    LIB_MAN_SUFFIX=3
8250fe5e51b7Smrgfi
8251fe5e51b7Smrgif test x$LIB_MAN_DIR = x    ; then
8252fe5e51b7Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
8253fe5e51b7Smrgfi
8254fe5e51b7Smrg
8255fe5e51b7Smrgif test x$FILE_MAN_SUFFIX = x    ; then
8256fe5e51b7Smrg    case $host_os in
8257fe5e51b7Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
8258fe5e51b7Smrg	*)		FILE_MAN_SUFFIX=5  ;;
8259fe5e51b7Smrg    esac
8260fe5e51b7Smrgfi
8261fe5e51b7Smrgif test x$FILE_MAN_DIR = x    ; then
8262fe5e51b7Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
8263fe5e51b7Smrgfi
8264fe5e51b7Smrg
8265fe5e51b7Smrgif test x$MISC_MAN_SUFFIX = x    ; then
8266fe5e51b7Smrg    case $host_os in
8267fe5e51b7Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
8268fe5e51b7Smrg	*)		MISC_MAN_SUFFIX=7  ;;
8269fe5e51b7Smrg    esac
8270fe5e51b7Smrgfi
8271fe5e51b7Smrgif test x$MISC_MAN_DIR = x    ; then
8272fe5e51b7Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
8273fe5e51b7Smrgfi
8274fe5e51b7Smrg
8275fe5e51b7Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
8276fe5e51b7Smrg    case $host_os in
8277fe5e51b7Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
8278fe5e51b7Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
8279fe5e51b7Smrg    esac
8280fe5e51b7Smrgfi
8281fe5e51b7Smrgif test x$DRIVER_MAN_DIR = x    ; then
8282fe5e51b7Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
8283fe5e51b7Smrgfi
8284fe5e51b7Smrg
8285fe5e51b7Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
8286fe5e51b7Smrg    case $host_os in
8287fe5e51b7Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
8288fe5e51b7Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
8289fe5e51b7Smrg    esac
8290fe5e51b7Smrgfi
8291fe5e51b7Smrgif test x$ADMIN_MAN_DIR = x    ; then
8292fe5e51b7Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
8293fe5e51b7Smrgfi
8294fe5e51b7Smrg
8295fe5e51b7Smrg
8296fe5e51b7SmrgAC_SUBST([APP_MAN_SUFFIX])
8297fe5e51b7SmrgAC_SUBST([LIB_MAN_SUFFIX])
8298fe5e51b7SmrgAC_SUBST([FILE_MAN_SUFFIX])
8299fe5e51b7SmrgAC_SUBST([MISC_MAN_SUFFIX])
8300fe5e51b7SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
8301fe5e51b7SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
8302fe5e51b7SmrgAC_SUBST([APP_MAN_DIR])
8303fe5e51b7SmrgAC_SUBST([LIB_MAN_DIR])
8304fe5e51b7SmrgAC_SUBST([FILE_MAN_DIR])
8305fe5e51b7SmrgAC_SUBST([MISC_MAN_DIR])
8306fe5e51b7SmrgAC_SUBST([DRIVER_MAN_DIR])
8307fe5e51b7SmrgAC_SUBST([ADMIN_MAN_DIR])
8308d7be9c72Smrg
8309d7be9c72SmrgXORG_MAN_PAGE="X Version 11"
8310d7be9c72SmrgAC_SUBST([XORG_MAN_PAGE])
8311d7be9c72SmrgMAN_SUBSTS="\
8312d7be9c72Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
8313d7be9c72Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
8314d7be9c72Smrg	-e 's|__xservername__|Xorg|g' \
8315d7be9c72Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
8316d7be9c72Smrg	-e 's|__projectroot__|\$(prefix)|g' \
8317d7be9c72Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
8318d7be9c72Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
8319d7be9c72Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
8320d7be9c72Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
8321d7be9c72Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
8322d7be9c72Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
8323d7be9c72SmrgAC_SUBST([MAN_SUBSTS])
8324d7be9c72Smrg
8325fe5e51b7Smrg]) # XORG_MANPAGE_SECTIONS
8326fe5e51b7Smrg
8327d7be9c72Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
8328d7be9c72Smrg# ------------------------
8329d7be9c72Smrg# Minimum version: 1.7.0
8330d7be9c72Smrg#
8331d7be9c72Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
8332d7be9c72Smrg# provided by xorg-sgml-doctools, if installed.
8333d7be9c72SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
8334d7be9c72SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
8335d7be9c72SmrgXORG_SGML_PATH=
8336d7be9c72SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
8337d7be9c72Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
8338d7be9c72Smrg    [m4_ifval([$1],[:],
8339d7be9c72Smrg        [if test x"$cross_compiling" != x"yes" ; then
8340d7be9c72Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
8341d7be9c72Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
8342d7be9c72Smrg         fi])
8343d7be9c72Smrg    ])
8344d7be9c72Smrg
8345d7be9c72Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
8346d7be9c72Smrg# the path and the name of the doc stylesheet
8347d7be9c72Smrgif test "x$XORG_SGML_PATH" != "x" ; then
8348d7be9c72Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
8349d7be9c72Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
8350d7be9c72Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
8351d7be9c72Smrgelse
8352d7be9c72Smrg   AC_MSG_RESULT([no])
8353d7be9c72Smrgfi
8354d7be9c72Smrg
8355d7be9c72SmrgAC_SUBST(XORG_SGML_PATH)
8356d7be9c72SmrgAC_SUBST(STYLESHEET_SRCDIR)
8357d7be9c72SmrgAC_SUBST(XSL_STYLESHEET)
8358d7be9c72SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
8359d7be9c72Smrg]) # XORG_CHECK_SGML_DOCTOOLS
8360d7be9c72Smrg
8361fe5e51b7Smrg# XORG_CHECK_LINUXDOC
8362fe5e51b7Smrg# -------------------
8363fe5e51b7Smrg# Minimum version: 1.0.0
8364fe5e51b7Smrg#
8365fe5e51b7Smrg# Defines the variable MAKE_TEXT if the necessary tools and
8366fe5e51b7Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
8367fe5e51b7Smrg# Whether or not the necessary tools and files are found can be checked
8368fe5e51b7Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
8369fe5e51b7SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
8370d7be9c72SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
8371d7be9c72SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
8372fe5e51b7Smrg
8373fe5e51b7SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
8374fe5e51b7Smrg
8375d7be9c72SmrgAC_MSG_CHECKING([whether to build documentation])
8376fe5e51b7Smrg
8377d7be9c72Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
8378fe5e51b7Smrg   BUILDDOC=yes
8379fe5e51b7Smrgelse
8380fe5e51b7Smrg   BUILDDOC=no
8381fe5e51b7Smrgfi
8382fe5e51b7Smrg
8383fe5e51b7SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
8384fe5e51b7Smrg
8385fe5e51b7SmrgAC_MSG_RESULT([$BUILDDOC])
8386fe5e51b7Smrg
8387d7be9c72SmrgAC_MSG_CHECKING([whether to build pdf documentation])
8388fe5e51b7Smrg
8389d7be9c72Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
8390fe5e51b7Smrg   BUILDPDFDOC=yes
8391fe5e51b7Smrgelse
8392fe5e51b7Smrg   BUILDPDFDOC=no
8393fe5e51b7Smrgfi
8394fe5e51b7Smrg
8395fe5e51b7SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
8396fe5e51b7Smrg
8397fe5e51b7SmrgAC_MSG_RESULT([$BUILDPDFDOC])
8398fe5e51b7Smrg
8399d7be9c72SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
8400fe5e51b7SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
8401fe5e51b7SmrgMAKE_PDF="$PS2PDF"
8402fe5e51b7SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
8403fe5e51b7Smrg
8404fe5e51b7SmrgAC_SUBST(MAKE_TEXT)
8405fe5e51b7SmrgAC_SUBST(MAKE_PS)
8406fe5e51b7SmrgAC_SUBST(MAKE_PDF)
8407fe5e51b7SmrgAC_SUBST(MAKE_HTML)
8408fe5e51b7Smrg]) # XORG_CHECK_LINUXDOC
8409fe5e51b7Smrg
8410fe5e51b7Smrg# XORG_CHECK_DOCBOOK
8411fe5e51b7Smrg# -------------------
8412fe5e51b7Smrg# Minimum version: 1.0.0
8413fe5e51b7Smrg#
8414fe5e51b7Smrg# Checks for the ability to build output formats from SGML DocBook source.
8415fe5e51b7Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
8416fe5e51b7Smrg# indicates whether the necessary tools and files are found and, if set,
8417fe5e51b7Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
8418fe5e51b7SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
8419d7be9c72SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
8420d7be9c72Smrg
8421fe5e51b7SmrgBUILDTXTDOC=no
8422fe5e51b7SmrgBUILDPDFDOC=no
8423fe5e51b7SmrgBUILDPSDOC=no
8424fe5e51b7SmrgBUILDHTMLDOC=no
8425fe5e51b7Smrg
8426fe5e51b7SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
8427fe5e51b7SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
8428fe5e51b7SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
8429fe5e51b7SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
8430fe5e51b7Smrg
8431d7be9c72SmrgAC_MSG_CHECKING([whether to build text documentation])
8432d7be9c72Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
8433fe5e51b7Smrg   test x$BUILD_TXTDOC != xno; then
8434fe5e51b7Smrg	BUILDTXTDOC=yes
8435fe5e51b7Smrgfi
8436fe5e51b7SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
8437fe5e51b7SmrgAC_MSG_RESULT([$BUILDTXTDOC])
8438fe5e51b7Smrg
8439d7be9c72SmrgAC_MSG_CHECKING([whether to build PDF documentation])
8440d7be9c72Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
8441fe5e51b7Smrg   test x$BUILD_PDFDOC != xno; then
8442fe5e51b7Smrg	BUILDPDFDOC=yes
8443fe5e51b7Smrgfi
8444fe5e51b7SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
8445fe5e51b7SmrgAC_MSG_RESULT([$BUILDPDFDOC])
8446fe5e51b7Smrg
8447d7be9c72SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
8448d7be9c72Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
8449fe5e51b7Smrg   test x$BUILD_PSDOC != xno; then
8450fe5e51b7Smrg	BUILDPSDOC=yes
8451fe5e51b7Smrgfi
8452fe5e51b7SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
8453fe5e51b7SmrgAC_MSG_RESULT([$BUILDPSDOC])
8454fe5e51b7Smrg
8455d7be9c72SmrgAC_MSG_CHECKING([whether to build HTML documentation])
8456d7be9c72Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
8457fe5e51b7Smrg   test x$BUILD_HTMLDOC != xno; then
8458fe5e51b7Smrg	BUILDHTMLDOC=yes
8459fe5e51b7Smrgfi
8460fe5e51b7SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
8461fe5e51b7SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
8462fe5e51b7Smrg
8463fe5e51b7SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
8464fe5e51b7SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
8465fe5e51b7SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
8466fe5e51b7SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
8467fe5e51b7Smrg
8468fe5e51b7SmrgAC_SUBST(MAKE_TEXT)
8469fe5e51b7SmrgAC_SUBST(MAKE_PS)
8470fe5e51b7SmrgAC_SUBST(MAKE_PDF)
8471fe5e51b7SmrgAC_SUBST(MAKE_HTML)
8472fe5e51b7Smrg]) # XORG_CHECK_DOCBOOK
8473fe5e51b7Smrg
8474d7be9c72Smrg# XORG_WITH_XMLTO([MIN-VERSION])
8475d7be9c72Smrg# ----------------
8476d7be9c72Smrg# Minimum version: 1.5.0
8477d7be9c72Smrg#
8478d7be9c72Smrg# Documentation tools are not always available on all platforms and sometimes
8479d7be9c72Smrg# not at the appropriate level. This macro enables a module to test for the
8480d7be9c72Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
8481d7be9c72Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
8482d7be9c72Smrg# as whether or not to use the xmlto package.
8483d7be9c72Smrg#
8484d7be9c72Smrg# Interface to module:
8485d7be9c72Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
8486d7be9c72Smrg# XMLTO:	returns the path of the xmlto program found
8487d7be9c72Smrg#		returns the path set by the user in the environment
8488d7be9c72Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
8489d7be9c72Smrg#		'no' user instructs the module not to use xmlto
8490d7be9c72Smrg#
8491d7be9c72Smrg# Added in version 1.10.0
8492d7be9c72Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
8493d7be9c72Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
8494d7be9c72Smrg#
8495d7be9c72Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
8496d7be9c72Smrg#
8497d7be9c72SmrgAC_DEFUN([XORG_WITH_XMLTO],[
8498d7be9c72SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
8499d7be9c72SmrgAC_ARG_WITH(xmlto,
8500d7be9c72Smrg	AS_HELP_STRING([--with-xmlto],
8501d7be9c72Smrg	   [Use xmlto to regenerate documentation (default: yes, if installed)]),
8502d7be9c72Smrg	   [use_xmlto=$withval], [use_xmlto=auto])
8503d7be9c72Smrg
8504d7be9c72Smrgif test "x$use_xmlto" = x"auto"; then
8505d7be9c72Smrg   AC_PATH_PROG([XMLTO], [xmlto])
8506d7be9c72Smrg   if test "x$XMLTO" = "x"; then
8507d7be9c72Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
8508d7be9c72Smrg	have_xmlto=no
8509d7be9c72Smrg   else
8510d7be9c72Smrg        have_xmlto=yes
8511d7be9c72Smrg   fi
8512d7be9c72Smrgelif test "x$use_xmlto" = x"yes" ; then
8513d7be9c72Smrg   AC_PATH_PROG([XMLTO], [xmlto])
8514d7be9c72Smrg   if test "x$XMLTO" = "x"; then
8515d7be9c72Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
8516d7be9c72Smrg   fi
8517d7be9c72Smrg   have_xmlto=yes
8518d7be9c72Smrgelif test "x$use_xmlto" = x"no" ; then
8519d7be9c72Smrg   if test "x$XMLTO" != "x"; then
8520d7be9c72Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
8521d7be9c72Smrg   fi
8522d7be9c72Smrg   have_xmlto=no
8523d7be9c72Smrgelse
8524d7be9c72Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
8525d7be9c72Smrgfi
8526d7be9c72Smrg
8527d7be9c72Smrg# Test for a minimum version of xmlto, if provided.
8528d7be9c72Smrgm4_ifval([$1],
8529d7be9c72Smrg[if test "$have_xmlto" = yes; then
8530d7be9c72Smrg    # scrape the xmlto version
8531d7be9c72Smrg    AC_MSG_CHECKING([the xmlto version])
8532d7be9c72Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
8533d7be9c72Smrg    AC_MSG_RESULT([$xmlto_version])
8534d7be9c72Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
8535d7be9c72Smrg        [if test "x$use_xmlto" = xauto; then
8536d7be9c72Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
8537d7be9c72Smrg            have_xmlto=no
8538d7be9c72Smrg        else
8539d7be9c72Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
8540d7be9c72Smrg        fi])
8541d7be9c72Smrgfi])
8542d7be9c72Smrg
8543d7be9c72Smrg# Test for the ability of xmlto to generate a text target
8544d7be9c72Smrghave_xmlto_text=no
8545d7be9c72Smrgcat > conftest.xml << "EOF"
8546d7be9c72SmrgEOF
8547d7be9c72SmrgAS_IF([test "$have_xmlto" = yes],
8548d7be9c72Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
8549d7be9c72Smrg             [have_xmlto_text=yes],
8550d7be9c72Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
8551d7be9c72Smrgrm -f conftest.xml
8552d7be9c72SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
8553d7be9c72SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
8554d7be9c72Smrg]) # XORG_WITH_XMLTO
8555d7be9c72Smrg
8556d7be9c72Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION])
8557d7be9c72Smrg# ----------------
8558d7be9c72Smrg# Minimum version: 1.5.0
8559d7be9c72Smrg#
8560d7be9c72Smrg# Documentation tools are not always available on all platforms and sometimes
8561d7be9c72Smrg# not at the appropriate level. This macro enables a module to test for the
8562d7be9c72Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
8563d7be9c72Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
8564d7be9c72Smrg# as whether or not to use the asciidoc package.
8565d7be9c72Smrg#
8566d7be9c72Smrg# Interface to module:
8567d7be9c72Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
8568d7be9c72Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
8569d7be9c72Smrg#		 returns the path set by the user in the environment
8570d7be9c72Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
8571d7be9c72Smrg#		  'no' user instructs the module not to use asciidoc
8572d7be9c72Smrg#
8573d7be9c72Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
8574d7be9c72Smrg#
8575d7be9c72SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
8576d7be9c72SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
8577d7be9c72SmrgAC_ARG_WITH(asciidoc,
8578d7be9c72Smrg	AS_HELP_STRING([--with-asciidoc],
8579d7be9c72Smrg	   [Use asciidoc to regenerate documentation (default: yes, if installed)]),
8580d7be9c72Smrg	   [use_asciidoc=$withval], [use_asciidoc=auto])
8581d7be9c72Smrg
8582d7be9c72Smrgif test "x$use_asciidoc" = x"auto"; then
8583d7be9c72Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
8584d7be9c72Smrg   if test "x$ASCIIDOC" = "x"; then
8585d7be9c72Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
8586d7be9c72Smrg	have_asciidoc=no
8587d7be9c72Smrg   else
8588d7be9c72Smrg        have_asciidoc=yes
8589d7be9c72Smrg   fi
8590d7be9c72Smrgelif test "x$use_asciidoc" = x"yes" ; then
8591d7be9c72Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
8592d7be9c72Smrg   if test "x$ASCIIDOC" = "x"; then
8593d7be9c72Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
8594d7be9c72Smrg   fi
8595d7be9c72Smrg   have_asciidoc=yes
8596d7be9c72Smrgelif test "x$use_asciidoc" = x"no" ; then
8597d7be9c72Smrg   if test "x$ASCIIDOC" != "x"; then
8598d7be9c72Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
8599d7be9c72Smrg   fi
8600d7be9c72Smrg   have_asciidoc=no
8601d7be9c72Smrgelse
8602d7be9c72Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
8603d7be9c72Smrgfi
8604d7be9c72Smrgm4_ifval([$1],
8605d7be9c72Smrg[if test "$have_asciidoc" = yes; then
8606d7be9c72Smrg    # scrape the asciidoc version
8607d7be9c72Smrg    AC_MSG_CHECKING([the asciidoc version])
8608d7be9c72Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
8609d7be9c72Smrg    AC_MSG_RESULT([$asciidoc_version])
8610d7be9c72Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
8611d7be9c72Smrg        [if test "x$use_asciidoc" = xauto; then
8612d7be9c72Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
8613d7be9c72Smrg            have_asciidoc=no
8614d7be9c72Smrg        else
8615d7be9c72Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
8616d7be9c72Smrg        fi])
8617d7be9c72Smrgfi])
8618d7be9c72SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
8619d7be9c72Smrg]) # XORG_WITH_ASCIIDOC
8620d7be9c72Smrg
8621d7be9c72Smrg# XORG_WITH_DOXYGEN([MIN-VERSION])
8622d7be9c72Smrg# --------------------------------
8623d7be9c72Smrg# Minimum version: 1.5.0
8624d7be9c72Smrg#
8625d7be9c72Smrg# Documentation tools are not always available on all platforms and sometimes
8626d7be9c72Smrg# not at the appropriate level. This macro enables a module to test for the
8627d7be9c72Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
8628d7be9c72Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
8629d7be9c72Smrg# as whether or not to use the doxygen package.
8630d7be9c72Smrg#
8631d7be9c72Smrg# Interface to module:
8632d7be9c72Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
8633d7be9c72Smrg# DOXYGEN:	 returns the path of the doxygen program found
8634d7be9c72Smrg#		 returns the path set by the user in the environment
8635d7be9c72Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
8636d7be9c72Smrg#		  'no' user instructs the module not to use doxygen
8637d7be9c72Smrg#
8638d7be9c72Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
8639d7be9c72Smrg#
8640d7be9c72SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
8641d7be9c72SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
8642d7be9c72SmrgAC_ARG_WITH(doxygen,
8643d7be9c72Smrg	AS_HELP_STRING([--with-doxygen],
8644d7be9c72Smrg	   [Use doxygen to regenerate documentation (default: yes, if installed)]),
8645d7be9c72Smrg	   [use_doxygen=$withval], [use_doxygen=auto])
8646d7be9c72Smrg
8647d7be9c72Smrgif test "x$use_doxygen" = x"auto"; then
8648d7be9c72Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
8649d7be9c72Smrg   if test "x$DOXYGEN" = "x"; then
8650d7be9c72Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
8651d7be9c72Smrg	have_doxygen=no
8652d7be9c72Smrg   else
8653d7be9c72Smrg        have_doxygen=yes
8654d7be9c72Smrg   fi
8655d7be9c72Smrgelif test "x$use_doxygen" = x"yes" ; then
8656d7be9c72Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
8657d7be9c72Smrg   if test "x$DOXYGEN" = "x"; then
8658d7be9c72Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
8659d7be9c72Smrg   fi
8660d7be9c72Smrg   have_doxygen=yes
8661d7be9c72Smrgelif test "x$use_doxygen" = x"no" ; then
8662d7be9c72Smrg   if test "x$DOXYGEN" != "x"; then
8663d7be9c72Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
8664d7be9c72Smrg   fi
8665d7be9c72Smrg   have_doxygen=no
8666d7be9c72Smrgelse
8667d7be9c72Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
8668d7be9c72Smrgfi
8669d7be9c72Smrgm4_ifval([$1],
8670d7be9c72Smrg[if test "$have_doxygen" = yes; then
8671d7be9c72Smrg    # scrape the doxygen version
8672d7be9c72Smrg    AC_MSG_CHECKING([the doxygen version])
8673d7be9c72Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
8674d7be9c72Smrg    AC_MSG_RESULT([$doxygen_version])
8675d7be9c72Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
8676d7be9c72Smrg        [if test "x$use_doxygen" = xauto; then
8677d7be9c72Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
8678d7be9c72Smrg            have_doxygen=no
8679d7be9c72Smrg        else
8680d7be9c72Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
8681d7be9c72Smrg        fi])
8682d7be9c72Smrgfi])
8683d7be9c72SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
8684d7be9c72Smrg]) # XORG_WITH_DOXYGEN
8685d7be9c72Smrg
8686d7be9c72Smrg# XORG_WITH_GROFF
8687d7be9c72Smrg# ----------------
8688d7be9c72Smrg# Minimum version: 1.6.0
8689d7be9c72Smrg#
8690d7be9c72Smrg# Documentation tools are not always available on all platforms and sometimes
8691d7be9c72Smrg# not at the appropriate level. This macro enables a module to test for the
8692d7be9c72Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
8693d7be9c72Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
8694d7be9c72Smrg# as whether or not to use the groff package.
8695d7be9c72Smrg#
8696d7be9c72Smrg# Interface to module:
8697d7be9c72Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
8698d7be9c72Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
8699d7be9c72Smrg# HAVE_GROFF_MS: the -ms macros package
8700d7be9c72Smrg# GROFF:	 returns the path of the groff program found
8701d7be9c72Smrg#		 returns the path set by the user in the environment
8702d7be9c72Smrg# --with-groff:	 'yes' user instructs the module to use groff
8703d7be9c72Smrg#		 'no' user instructs the module not to use groff
8704d7be9c72Smrg#
8705d7be9c72Smrg# Added in version 1.9.0:
8706d7be9c72Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
8707d7be9c72Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
8708d7be9c72Smrg#		   psselect from the psutils package.
8709d7be9c72Smrg#		   the ghostcript package. Refer to the grohtml man pages
8710d7be9c72Smrg#
8711d7be9c72Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
8712d7be9c72Smrg#
8713d7be9c72Smrg# OS and distros often splits groff in a basic and full package, the former
8714d7be9c72Smrg# having the groff program and the later having devices, fonts and macros
8715d7be9c72Smrg# Checking for the groff executable is not enough.
8716d7be9c72Smrg#
8717d7be9c72Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
8718d7be9c72Smrg# unset HAVE_GROFF or GROFF env variables.
8719d7be9c72Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
8720d7be9c72Smrg#
8721d7be9c72SmrgAC_DEFUN([XORG_WITH_GROFF],[
8722d7be9c72SmrgAC_ARG_VAR([GROFF], [Path to groff command])
8723d7be9c72SmrgAC_ARG_WITH(groff,
8724d7be9c72Smrg	AS_HELP_STRING([--with-groff],
8725d7be9c72Smrg	   [Use groff to regenerate documentation (default: yes, if installed)]),
8726d7be9c72Smrg	   [use_groff=$withval], [use_groff=auto])
8727d7be9c72Smrg
8728d7be9c72Smrgif test "x$use_groff" = x"auto"; then
8729d7be9c72Smrg   AC_PATH_PROG([GROFF], [groff])
8730d7be9c72Smrg   if test "x$GROFF" = "x"; then
8731d7be9c72Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
8732d7be9c72Smrg	have_groff=no
8733d7be9c72Smrg   else
8734d7be9c72Smrg        have_groff=yes
8735d7be9c72Smrg   fi
8736d7be9c72Smrgelif test "x$use_groff" = x"yes" ; then
8737d7be9c72Smrg   AC_PATH_PROG([GROFF], [groff])
8738d7be9c72Smrg   if test "x$GROFF" = "x"; then
8739d7be9c72Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
8740d7be9c72Smrg   fi
8741d7be9c72Smrg   have_groff=yes
8742d7be9c72Smrgelif test "x$use_groff" = x"no" ; then
8743d7be9c72Smrg   if test "x$GROFF" != "x"; then
8744d7be9c72Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
8745d7be9c72Smrg   fi
8746d7be9c72Smrg   have_groff=no
8747d7be9c72Smrgelse
8748d7be9c72Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
8749d7be9c72Smrgfi
8750d7be9c72Smrg
8751d7be9c72Smrg# We have groff, test for the presence of the macro packages
8752d7be9c72Smrgif test "x$have_groff" = x"yes"; then
8753d7be9c72Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
8754d7be9c72Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
8755d7be9c72Smrg        groff_ms_works=yes
8756d7be9c72Smrg    else
8757d7be9c72Smrg        groff_ms_works=no
8758d7be9c72Smrg    fi
8759d7be9c72Smrg    AC_MSG_RESULT([$groff_ms_works])
8760d7be9c72Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
8761d7be9c72Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
8762d7be9c72Smrg        groff_mm_works=yes
8763d7be9c72Smrg    else
8764d7be9c72Smrg        groff_mm_works=no
8765d7be9c72Smrg    fi
8766d7be9c72Smrg    AC_MSG_RESULT([$groff_mm_works])
8767d7be9c72Smrgfi
8768d7be9c72Smrg
8769d7be9c72Smrg# We have groff, test for HTML dependencies, one command per package
8770d7be9c72Smrgif test "x$have_groff" = x"yes"; then
8771d7be9c72Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
8772d7be9c72Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
8773d7be9c72Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
8774d7be9c72Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
8775d7be9c72Smrg      have_groff_html=yes
8776d7be9c72Smrg   else
8777d7be9c72Smrg      have_groff_html=no
8778d7be9c72Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
8779d7be9c72Smrg   fi
8780d7be9c72Smrgfi
8781d7be9c72Smrg
8782d7be9c72Smrg# Set Automake conditionals for Makefiles
8783d7be9c72SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
8784d7be9c72SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
8785d7be9c72SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
8786d7be9c72SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
8787d7be9c72Smrg]) # XORG_WITH_GROFF
8788d7be9c72Smrg
8789d7be9c72Smrg# XORG_WITH_FOP
8790d7be9c72Smrg# ----------------
8791d7be9c72Smrg# Minimum version: 1.6.0
8792d7be9c72Smrg#
8793d7be9c72Smrg# Documentation tools are not always available on all platforms and sometimes
8794d7be9c72Smrg# not at the appropriate level. This macro enables a module to test for the
8795d7be9c72Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
8796d7be9c72Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
8797d7be9c72Smrg# as whether or not to use the fop package.
8798d7be9c72Smrg#
8799d7be9c72Smrg# Interface to module:
8800d7be9c72Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
8801d7be9c72Smrg# FOP:	 	returns the path of the fop program found
8802d7be9c72Smrg#		returns the path set by the user in the environment
8803d7be9c72Smrg# --with-fop: 	'yes' user instructs the module to use fop
8804d7be9c72Smrg#		'no' user instructs the module not to use fop
8805d7be9c72Smrg#
8806d7be9c72Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
8807d7be9c72Smrg#
8808d7be9c72SmrgAC_DEFUN([XORG_WITH_FOP],[
8809d7be9c72SmrgAC_ARG_VAR([FOP], [Path to fop command])
8810d7be9c72SmrgAC_ARG_WITH(fop,
8811d7be9c72Smrg	AS_HELP_STRING([--with-fop],
8812d7be9c72Smrg	   [Use fop to regenerate documentation (default: yes, if installed)]),
8813d7be9c72Smrg	   [use_fop=$withval], [use_fop=auto])
8814d7be9c72Smrg
8815d7be9c72Smrgif test "x$use_fop" = x"auto"; then
8816d7be9c72Smrg   AC_PATH_PROG([FOP], [fop])
8817d7be9c72Smrg   if test "x$FOP" = "x"; then
8818d7be9c72Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
8819d7be9c72Smrg	have_fop=no
8820d7be9c72Smrg   else
8821d7be9c72Smrg        have_fop=yes
8822d7be9c72Smrg   fi
8823d7be9c72Smrgelif test "x$use_fop" = x"yes" ; then
8824d7be9c72Smrg   AC_PATH_PROG([FOP], [fop])
8825d7be9c72Smrg   if test "x$FOP" = "x"; then
8826d7be9c72Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
8827d7be9c72Smrg   fi
8828d7be9c72Smrg   have_fop=yes
8829d7be9c72Smrgelif test "x$use_fop" = x"no" ; then
8830d7be9c72Smrg   if test "x$FOP" != "x"; then
8831d7be9c72Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
8832d7be9c72Smrg   fi
8833d7be9c72Smrg   have_fop=no
8834d7be9c72Smrgelse
8835d7be9c72Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
8836d7be9c72Smrgfi
8837d7be9c72SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
8838d7be9c72Smrg]) # XORG_WITH_FOP
8839d7be9c72Smrg
8840d7be9c72Smrg# XORG_WITH_PS2PDF
8841d7be9c72Smrg# ----------------
8842d7be9c72Smrg# Minimum version: 1.6.0
8843d7be9c72Smrg#
8844d7be9c72Smrg# Documentation tools are not always available on all platforms and sometimes
8845d7be9c72Smrg# not at the appropriate level. This macro enables a module to test for the
8846d7be9c72Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
8847d7be9c72Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
8848d7be9c72Smrg# as whether or not to use the ps2pdf package.
8849d7be9c72Smrg#
8850d7be9c72Smrg# Interface to module:
8851d7be9c72Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
8852d7be9c72Smrg# PS2PDF:	returns the path of the ps2pdf program found
8853d7be9c72Smrg#		returns the path set by the user in the environment
8854d7be9c72Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
8855d7be9c72Smrg#		 'no' user instructs the module not to use ps2pdf
8856d7be9c72Smrg#
8857d7be9c72Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
8858d7be9c72Smrg#
8859d7be9c72SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
8860d7be9c72SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
8861d7be9c72SmrgAC_ARG_WITH(ps2pdf,
8862d7be9c72Smrg	AS_HELP_STRING([--with-ps2pdf],
8863d7be9c72Smrg	   [Use ps2pdf to regenerate documentation (default: yes, if installed)]),
8864d7be9c72Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=auto])
8865d7be9c72Smrg
8866d7be9c72Smrgif test "x$use_ps2pdf" = x"auto"; then
8867d7be9c72Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
8868d7be9c72Smrg   if test "x$PS2PDF" = "x"; then
8869d7be9c72Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
8870d7be9c72Smrg	have_ps2pdf=no
8871d7be9c72Smrg   else
8872d7be9c72Smrg        have_ps2pdf=yes
8873d7be9c72Smrg   fi
8874d7be9c72Smrgelif test "x$use_ps2pdf" = x"yes" ; then
8875d7be9c72Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
8876d7be9c72Smrg   if test "x$PS2PDF" = "x"; then
8877d7be9c72Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
8878d7be9c72Smrg   fi
8879d7be9c72Smrg   have_ps2pdf=yes
8880d7be9c72Smrgelif test "x$use_ps2pdf" = x"no" ; then
8881d7be9c72Smrg   if test "x$PS2PDF" != "x"; then
8882d7be9c72Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
8883d7be9c72Smrg   fi
8884d7be9c72Smrg   have_ps2pdf=no
8885d7be9c72Smrgelse
8886d7be9c72Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
8887d7be9c72Smrgfi
8888d7be9c72SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
8889d7be9c72Smrg]) # XORG_WITH_PS2PDF
8890d7be9c72Smrg
8891d7be9c72Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
8892d7be9c72Smrg# ----------------
8893d7be9c72Smrg# Minimum version: 1.6.0
8894d7be9c72Smrg#
8895d7be9c72Smrg# Documentation tools are not always available on all platforms and sometimes
8896d7be9c72Smrg# not at the appropriate level. This macro enables a builder to skip all
8897d7be9c72Smrg# documentation targets except traditional man pages.
8898d7be9c72Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
8899d7be9c72Smrg# maximum flexibilty in controlling documentation building.
8900d7be9c72Smrg# Refer to:
8901d7be9c72Smrg# XORG_WITH_XMLTO         --with-xmlto
8902d7be9c72Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
8903d7be9c72Smrg# XORG_WITH_DOXYGEN       --with-doxygen
8904d7be9c72Smrg# XORG_WITH_FOP           --with-fop
8905d7be9c72Smrg# XORG_WITH_GROFF         --with-groff
8906d7be9c72Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
8907d7be9c72Smrg#
8908d7be9c72Smrg# Interface to module:
8909d7be9c72Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
8910d7be9c72Smrg# --enable-docs: 'yes' user instructs the module to generate docs
8911d7be9c72Smrg#		 'no' user instructs the module not to generate docs
8912d7be9c72Smrg# parm1:	specify the default value, yes or no.
8913d7be9c72Smrg#
8914d7be9c72SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
8915d7be9c72Smrgdefault=$1
8916d7be9c72Smrgif test "x$default" = x ; then
8917d7be9c72Smrg  default="yes"
8918d7be9c72Smrgfi
8919d7be9c72SmrgAC_ARG_ENABLE(docs,
8920d7be9c72Smrg	AS_HELP_STRING([--enable-docs],
8921d7be9c72Smrg	   [Enable building the documentation (default: yes)]),
8922d7be9c72Smrg	   [build_docs=$enableval], [build_docs=$default])
8923d7be9c72SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
8924d7be9c72SmrgAC_MSG_CHECKING([whether to build documentation])
8925d7be9c72SmrgAC_MSG_RESULT([$build_docs])
8926d7be9c72Smrg]) # XORG_ENABLE_DOCS
8927d7be9c72Smrg
8928d7be9c72Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
8929d7be9c72Smrg# ----------------
8930d7be9c72Smrg# Minimum version: 1.6.0
8931d7be9c72Smrg#
8932d7be9c72Smrg# This macro enables a builder to skip all developer documentation.
8933d7be9c72Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
8934d7be9c72Smrg# maximum flexibilty in controlling documentation building.
8935d7be9c72Smrg# Refer to:
8936d7be9c72Smrg# XORG_WITH_XMLTO         --with-xmlto
8937d7be9c72Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
8938d7be9c72Smrg# XORG_WITH_DOXYGEN       --with-doxygen
8939d7be9c72Smrg# XORG_WITH_FOP           --with-fop
8940d7be9c72Smrg# XORG_WITH_GROFF         --with-groff
8941d7be9c72Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
8942d7be9c72Smrg#
8943d7be9c72Smrg# Interface to module:
8944d7be9c72Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
8945d7be9c72Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
8946d7be9c72Smrg#			'no' user instructs the module not to generate developer docs
8947d7be9c72Smrg# parm1:		specify the default value, yes or no.
8948d7be9c72Smrg#
8949d7be9c72SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
8950d7be9c72Smrgdevel_default=$1
8951d7be9c72Smrgif test "x$devel_default" = x ; then
8952d7be9c72Smrg  devel_default="yes"
8953d7be9c72Smrgfi
8954d7be9c72SmrgAC_ARG_ENABLE(devel-docs,
8955d7be9c72Smrg	AS_HELP_STRING([--enable-devel-docs],
8956d7be9c72Smrg	   [Enable building the developer documentation (default: yes)]),
8957d7be9c72Smrg	   [build_devel_docs=$enableval], [build_devel_docs=$devel_default])
8958d7be9c72SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
8959d7be9c72SmrgAC_MSG_CHECKING([whether to build developer documentation])
8960d7be9c72SmrgAC_MSG_RESULT([$build_devel_docs])
8961d7be9c72Smrg]) # XORG_ENABLE_DEVEL_DOCS
8962d7be9c72Smrg
8963d7be9c72Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
8964d7be9c72Smrg# ----------------
8965d7be9c72Smrg# Minimum version: 1.6.0
8966d7be9c72Smrg#
8967d7be9c72Smrg# This macro enables a builder to skip all functional specification targets.
8968d7be9c72Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
8969d7be9c72Smrg# maximum flexibilty in controlling documentation building.
8970d7be9c72Smrg# Refer to:
8971d7be9c72Smrg# XORG_WITH_XMLTO         --with-xmlto
8972d7be9c72Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
8973d7be9c72Smrg# XORG_WITH_DOXYGEN       --with-doxygen
8974d7be9c72Smrg# XORG_WITH_FOP           --with-fop
8975d7be9c72Smrg# XORG_WITH_GROFF         --with-groff
8976d7be9c72Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
8977d7be9c72Smrg#
8978d7be9c72Smrg# Interface to module:
8979d7be9c72Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
8980d7be9c72Smrg# --enable-specs:	'yes' user instructs the module to generate specs
8981d7be9c72Smrg#			'no' user instructs the module not to generate specs
8982d7be9c72Smrg# parm1:		specify the default value, yes or no.
8983d7be9c72Smrg#
8984d7be9c72SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
8985d7be9c72Smrgspec_default=$1
8986d7be9c72Smrgif test "x$spec_default" = x ; then
8987d7be9c72Smrg  spec_default="yes"
8988d7be9c72Smrgfi
8989d7be9c72SmrgAC_ARG_ENABLE(specs,
8990d7be9c72Smrg	AS_HELP_STRING([--enable-specs],
8991d7be9c72Smrg	   [Enable building the specs (default: yes)]),
8992d7be9c72Smrg	   [build_specs=$enableval], [build_specs=$spec_default])
8993d7be9c72SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
8994d7be9c72SmrgAC_MSG_CHECKING([whether to build functional specifications])
8995d7be9c72SmrgAC_MSG_RESULT([$build_specs])
8996d7be9c72Smrg]) # XORG_ENABLE_SPECS
8997d7be9c72Smrg
8998fe5e51b7Smrg# XORG_CHECK_MALLOC_ZERO
8999fe5e51b7Smrg# ----------------------
9000fe5e51b7Smrg# Minimum version: 1.0.0
9001fe5e51b7Smrg#
9002fe5e51b7Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
9003fe5e51b7Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
9004fe5e51b7Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
9005fe5e51b7SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
9006fe5e51b7SmrgAC_ARG_ENABLE(malloc0returnsnull,
9007a31a186aSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
9008fe5e51b7Smrg		       [malloc(0) returns NULL (default: auto)]),
9009fe5e51b7Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
9010fe5e51b7Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
9011fe5e51b7Smrg
9012fe5e51b7SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
9013fe5e51b7Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
9014fe5e51b7Smrg	AC_RUN_IFELSE([
9015fe5e51b7Smrgchar *malloc();
9016fe5e51b7Smrgchar *realloc();
9017fe5e51b7Smrgchar *calloc();
9018fe5e51b7Smrgmain() {
9019fe5e51b7Smrg    char *m0, *r0, *c0, *p;
9020fe5e51b7Smrg    m0 = malloc(0);
9021fe5e51b7Smrg    p = malloc(10);
9022fe5e51b7Smrg    r0 = realloc(p,0);
9023fe5e51b7Smrg    c0 = calloc(0);
9024fe5e51b7Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
9025fe5e51b7Smrg}],
9026fe5e51b7Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
9027d7be9c72Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
9028d7be9c72Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
9029fe5e51b7Smrgfi
9030fe5e51b7SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
9031fe5e51b7Smrg
9032fe5e51b7Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
9033fe5e51b7Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
9034fe5e51b7Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
9035fe5e51b7Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
9036fe5e51b7Smrgelse
9037fe5e51b7Smrg	MALLOC_ZERO_CFLAGS=""
9038fe5e51b7Smrg	XMALLOC_ZERO_CFLAGS=""
9039fe5e51b7Smrg	XTMALLOC_ZERO_CFLAGS=""
9040fe5e51b7Smrgfi
9041fe5e51b7Smrg
9042fe5e51b7SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
9043fe5e51b7SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
9044fe5e51b7SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
9045fe5e51b7Smrg]) # XORG_CHECK_MALLOC_ZERO
9046fe5e51b7Smrg
9047fe5e51b7Smrg# XORG_WITH_LINT()
9048fe5e51b7Smrg# ----------------
9049fe5e51b7Smrg# Minimum version: 1.1.0
9050fe5e51b7Smrg#
9051d7be9c72Smrg# This macro enables the use of a tool that flags some suspicious and
9052d7be9c72Smrg# non-portable constructs (likely to be bugs) in C language source code.
9053d7be9c72Smrg# It will attempt to locate the tool and use appropriate options.
9054d7be9c72Smrg# There are various lint type tools on different platforms.
9055d7be9c72Smrg#
9056d7be9c72Smrg# Interface to module:
9057d7be9c72Smrg# LINT:		returns the path to the tool found on the platform
9058d7be9c72Smrg#		or the value set to LINT on the configure cmd line
9059d7be9c72Smrg#		also an Automake conditional
9060d7be9c72Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
9061d7be9c72Smrg#
9062d7be9c72Smrg# --with-lint:	'yes' user instructs the module to use lint
9063d7be9c72Smrg#		'no' user instructs the module not to use lint (default)
9064d7be9c72Smrg#
9065d7be9c72Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
9066d7be9c72Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
9067fe5e51b7Smrg#
9068fe5e51b7SmrgAC_DEFUN([XORG_WITH_LINT],[
9069fe5e51b7Smrg
9070d7be9c72SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
9071d7be9c72SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
9072a31a186aSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
9073fe5e51b7Smrg		[Use a lint-style source code checker (default: disabled)])],
9074fe5e51b7Smrg		[use_lint=$withval], [use_lint=no])
9075d7be9c72Smrg
9076d7be9c72Smrg# Obtain platform specific info like program name and options
9077d7be9c72Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
9078d7be9c72Smrgcase $host_os in
9079d7be9c72Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
9080d7be9c72Smrg	lint_name=splint
9081d7be9c72Smrg	lint_options="-badflag"
9082d7be9c72Smrg	;;
9083d7be9c72Smrg  *freebsd* | *netbsd*)
9084d7be9c72Smrg	lint_name=lint
9085d7be9c72Smrg	lint_options="-u -b"
9086d7be9c72Smrg	;;
9087d7be9c72Smrg  *solaris*)
9088d7be9c72Smrg	lint_name=lint
9089d7be9c72Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
9090d7be9c72Smrg	;;
9091d7be9c72Smrgesac
9092d7be9c72Smrg
9093d7be9c72Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
9094d7be9c72Smrgif test "x$use_lint" = x"yes" ; then
9095d7be9c72Smrg   AC_PATH_PROG([LINT], [$lint_name])
9096d7be9c72Smrg   if test "x$LINT" = "x"; then
9097d7be9c72Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
9098d7be9c72Smrg   fi
9099d7be9c72Smrgelif test "x$use_lint" = x"no" ; then
9100d7be9c72Smrg   if test "x$LINT" != "x"; then
9101d7be9c72Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
9102d7be9c72Smrg   fi
9103fe5e51b7Smrgelse
9104d7be9c72Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
9105fe5e51b7Smrgfi
9106d7be9c72Smrg
9107d7be9c72Smrg# User supplied flags override default flags
9108d7be9c72Smrgif test "x$LINT_FLAGS" != "x"; then
9109d7be9c72Smrg   lint_options=$LINT_FLAGS
9110fe5e51b7Smrgfi
9111fe5e51b7Smrg
9112d7be9c72SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
9113d7be9c72SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
9114fe5e51b7Smrg
9115fe5e51b7Smrg]) # XORG_WITH_LINT
9116fe5e51b7Smrg
9117fe5e51b7Smrg# XORG_LINT_LIBRARY(LIBNAME)
9118fe5e51b7Smrg# --------------------------
9119fe5e51b7Smrg# Minimum version: 1.1.0
9120fe5e51b7Smrg#
9121fe5e51b7Smrg# Sets up flags for building lint libraries for checking programs that call
9122fe5e51b7Smrg# functions in the library.
9123fe5e51b7Smrg#
9124d7be9c72Smrg# Interface to module:
9125d7be9c72Smrg# LINTLIB		- Automake variable with the name of lint library file to make
9126d7be9c72Smrg# MAKE_LINT_LIB		- Automake conditional
9127d7be9c72Smrg#
9128d7be9c72Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
9129d7be9c72Smrg#			  - 'no' user instructs the module not to create a lint library (default)
9130fe5e51b7Smrg
9131fe5e51b7SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
9132fe5e51b7SmrgAC_REQUIRE([XORG_WITH_LINT])
9133a31a186aSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
9134fe5e51b7Smrg	[Create lint library (default: disabled)])],
9135fe5e51b7Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
9136d7be9c72Smrg
9137d7be9c72Smrgif test "x$make_lint_lib" = x"yes" ; then
9138d7be9c72Smrg   LINTLIB=llib-l$1.ln
9139d7be9c72Smrg   if test "x$LINT" = "x"; then
9140d7be9c72Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
9141d7be9c72Smrg   fi
9142d7be9c72Smrgelif test "x$make_lint_lib" != x"no" ; then
9143d7be9c72Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
9144fe5e51b7Smrgfi
9145d7be9c72Smrg
9146fe5e51b7SmrgAC_SUBST(LINTLIB)
9147fe5e51b7SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
9148fe5e51b7Smrg
9149fe5e51b7Smrg]) # XORG_LINT_LIBRARY
9150fe5e51b7Smrg
9151eda3803bSmrg# XORG_CWARNFLAGS
9152eda3803bSmrg# ---------------
9153eda3803bSmrg# Minimum version: 1.2.0
9154eda3803bSmrg#
9155eda3803bSmrg# Defines CWARNFLAGS to enable C compiler warnings.
9156eda3803bSmrg#
9157eda3803bSmrgAC_DEFUN([XORG_CWARNFLAGS], [
9158d7be9c72SmrgAC_REQUIRE([AC_PROG_CC_C99])
9159eda3803bSmrgif  test "x$GCC" = xyes ; then
9160eda3803bSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
9161eda3803bSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
9162d7be9c72Smrg-Wbad-function-cast -Wformat=2"
9163a31a186aSmrg    case `$CC -dumpversion` in
9164eda3803bSmrg    3.4.* | 4.*)
9165a31a186aSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
9166eda3803bSmrg	;;
9167eda3803bSmrg    esac
9168eda3803bSmrgelse
9169eda3803bSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
9170eda3803bSmrg    if test "x$SUNCC" = "xyes"; then
9171eda3803bSmrg	CWARNFLAGS="-v"
9172eda3803bSmrg    fi
9173eda3803bSmrgfi
9174eda3803bSmrgAC_SUBST(CWARNFLAGS)
9175eda3803bSmrg]) # XORG_CWARNFLAGS
9176a31a186aSmrg
9177a31a186aSmrg# XORG_STRICT_OPTION
9178a31a186aSmrg# -----------------------
9179a31a186aSmrg# Minimum version: 1.3.0
9180a31a186aSmrg#
9181a31a186aSmrg# Add configure option to enable strict compilation
9182a31a186aSmrgAC_DEFUN([XORG_STRICT_OPTION], [
9183d7be9c72Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
9184a31a186aSmrgAC_REQUIRE([AC_PROG_CC_C99])
9185a31a186aSmrgAC_REQUIRE([XORG_CWARNFLAGS])
9186a31a186aSmrg
9187a31a186aSmrgAC_ARG_ENABLE(strict-compilation,
9188a31a186aSmrg			  AS_HELP_STRING([--enable-strict-compilation],
9189a31a186aSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
9190a31a186aSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
9191a31a186aSmrgif test "x$STRICT_COMPILE" = "xyes"; then
9192a31a186aSmrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
9193a31a186aSmrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
9194a31a186aSmrg	if test "x$GCC" = xyes ; then
9195a31a186aSmrg		STRICT_CFLAGS="-pedantic -Werror"
9196a31a186aSmrg	elif test "x$SUNCC" = "xyes"; then
9197a31a186aSmrg		STRICT_CFLAGS="-errwarn"
9198a31a186aSmrg    elif test "x$INTELCC" = "xyes"; then
9199a31a186aSmrg		STRICT_CFLAGS="-Werror"
9200a31a186aSmrg	fi
9201a31a186aSmrgfi
9202a31a186aSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
9203a31a186aSmrgAC_SUBST([CWARNFLAGS])
9204a31a186aSmrg]) # XORG_STRICT_OPTION
9205a31a186aSmrg
9206a31a186aSmrg# XORG_DEFAULT_OPTIONS
9207a31a186aSmrg# --------------------
9208a31a186aSmrg# Minimum version: 1.3.0
9209a31a186aSmrg#
9210a31a186aSmrg# Defines default options for X.Org modules.
9211a31a186aSmrg#
9212a31a186aSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
9213d7be9c72SmrgAC_REQUIRE([AC_PROG_INSTALL])
9214a31a186aSmrgXORG_CWARNFLAGS
9215a31a186aSmrgXORG_STRICT_OPTION
9216a31a186aSmrgXORG_RELEASE_VERSION
9217a31a186aSmrgXORG_CHANGELOG
9218a31a186aSmrgXORG_INSTALL
9219a31a186aSmrgXORG_MANPAGE_SECTIONS
9220d7be9c72Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
9221d7be9c72Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
9222a31a186aSmrg]) # XORG_DEFAULT_OPTIONS
9223a31a186aSmrg
9224a31a186aSmrg# XORG_INSTALL()
9225a31a186aSmrg# ----------------
9226a31a186aSmrg# Minimum version: 1.4.0
9227a31a186aSmrg#
9228a31a186aSmrg# Defines the variable INSTALL_CMD as the command to copy
9229d7be9c72Smrg# INSTALL from $prefix/share/util-macros.
9230a31a186aSmrg#
9231a31a186aSmrgAC_DEFUN([XORG_INSTALL], [
9232a31a186aSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
9233d7be9c72Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
9234d7be9c72SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
9235a31a186aSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
9236a31a186aSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
9237d7be9c72Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
9238a31a186aSmrgAC_SUBST([INSTALL_CMD])
9239a31a186aSmrg]) # XORG_INSTALL
9240fe5e51b7Smrgdnl Copyright 2005 Red Hat, Inc
9241fe5e51b7Smrgdnl
9242fe5e51b7Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
9243fe5e51b7Smrgdnl documentation for any purpose is hereby granted without fee, provided that
9244fe5e51b7Smrgdnl the above copyright notice appear in all copies and that both that
9245fe5e51b7Smrgdnl copyright notice and this permission notice appear in supporting
9246fe5e51b7Smrgdnl documentation.
9247fe5e51b7Smrgdnl
9248fe5e51b7Smrgdnl The above copyright notice and this permission notice shall be included
9249fe5e51b7Smrgdnl in all copies or substantial portions of the Software.
9250fe5e51b7Smrgdnl
9251fe5e51b7Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
9252fe5e51b7Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9253fe5e51b7Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
9254fe5e51b7Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
9255fe5e51b7Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
9256fe5e51b7Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
9257fe5e51b7Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
9258fe5e51b7Smrgdnl
9259fe5e51b7Smrgdnl Except as contained in this notice, the name of the copyright holders shall
9260fe5e51b7Smrgdnl not be used in advertising or otherwise to promote the sale, use or
9261fe5e51b7Smrgdnl other dealings in this Software without prior written authorization
9262fe5e51b7Smrgdnl from the copyright holders.
9263fe5e51b7Smrgdnl
9264fe5e51b7Smrg
9265fe5e51b7Smrg# XORG_RELEASE_VERSION
9266fe5e51b7Smrg# --------------------
9267d7be9c72Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
9268fe5e51b7Smrg 
9269fe5e51b7SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
9270fe5e51b7Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
9271fe5e51b7Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
9272fe5e51b7Smrg		[Major version of this package])
9273eda3803bSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
9274fe5e51b7Smrg	if test "x$PVM" = "x"; then
9275fe5e51b7Smrg		PVM="0"
9276fe5e51b7Smrg	fi
9277fe5e51b7Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
9278fe5e51b7Smrg		[$PVM],
9279fe5e51b7Smrg		[Minor version of this package])
9280eda3803bSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
9281fe5e51b7Smrg	if test "x$PVP" = "x"; then
9282fe5e51b7Smrg		PVP="0"
9283fe5e51b7Smrg	fi
9284fe5e51b7Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
9285fe5e51b7Smrg		[$PVP],
9286fe5e51b7Smrg		[Patch version of this package])
9287fe5e51b7Smrg])
9288fe5e51b7Smrg
9289eda3803bSmrg# XORG_CHANGELOG()
9290eda3803bSmrg# ----------------
9291eda3803bSmrg# Minimum version: 1.2.0
9292eda3803bSmrg#
9293eda3803bSmrg# Defines the variable CHANGELOG_CMD as the command to generate
9294eda3803bSmrg# ChangeLog from git.
9295eda3803bSmrg#
9296eda3803bSmrg#
9297eda3803bSmrgAC_DEFUN([XORG_CHANGELOG], [
9298a31a186aSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
9299a31a186aSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
9300a31a186aSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
9301eda3803bSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
9302eda3803bSmrgAC_SUBST([CHANGELOG_CMD])
9303eda3803bSmrg]) # XORG_CHANGELOG
9304eda3803bSmrg
9305a31a186aSmrgdnl Copyright 2005 Red Hat, Inc
9306a31a186aSmrgdnl 
9307a31a186aSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
9308a31a186aSmrgdnl documentation for any purpose is hereby granted without fee, provided that
9309a31a186aSmrgdnl the above copyright notice appear in all copies and that both that
9310a31a186aSmrgdnl copyright notice and this permission notice appear in supporting
9311a31a186aSmrgdnl documentation.
9312a31a186aSmrgdnl 
9313a31a186aSmrgdnl The above copyright notice and this permission notice shall be included
9314a31a186aSmrgdnl in all copies or substantial portions of the Software.
9315a31a186aSmrgdnl 
9316a31a186aSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
9317a31a186aSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9318a31a186aSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
9319a31a186aSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
9320a31a186aSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
9321a31a186aSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
9322a31a186aSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
9323a31a186aSmrgdnl 
9324a31a186aSmrgdnl Except as contained in this notice, the name of the copyright holders shall
9325a31a186aSmrgdnl not be used in advertising or otherwise to promote the sale, use or
9326a31a186aSmrgdnl other dealings in this Software without prior written authorization
9327a31a186aSmrgdnl from the copyright holders.
9328a31a186aSmrgdnl 
9329a31a186aSmrg
9330a31a186aSmrg# XORG_DRIVER_CHECK_EXT()
9331a31a186aSmrg# --------------------------
9332a31a186aSmrg# Checks for the $1 define in xorg-server.h (from the sdk).  If it
9333a31a186aSmrg# is defined, then add $1 to $REQUIRED_MODULES.
9334a31a186aSmrg
9335a31a186aSmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
9336d7be9c72Smrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9337a31a186aSmrg	SAVE_CFLAGS="$CFLAGS"
9338d7be9c72Smrg	CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
9339a31a186aSmrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
9340a31a186aSmrg#include "xorg-server.h"
9341a31a186aSmrg#if !defined $1
9342a31a186aSmrg#error $1 not defined
9343a31a186aSmrg#endif
9344a31a186aSmrg		]])],
9345a31a186aSmrg		[_EXT_CHECK=yes],
9346a31a186aSmrg		[_EXT_CHECK=no])
9347a31a186aSmrg	CFLAGS="$SAVE_CFLAGS"
9348a31a186aSmrg	AC_MSG_CHECKING([if $1 is defined])
9349a31a186aSmrg	AC_MSG_RESULT([$_EXT_CHECK])
9350a31a186aSmrg	if test "$_EXT_CHECK" != no; then
9351a31a186aSmrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
9352a31a186aSmrg	fi
9353a31a186aSmrg])
9354a31a186aSmrg
9355eda3803bSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
9356fe5e51b7Smrg#
9357fe5e51b7Smrg# This file is free software; the Free Software Foundation
9358fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
9359fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
9360fe5e51b7Smrg
9361fe5e51b7Smrg# AM_AUTOMAKE_VERSION(VERSION)
9362fe5e51b7Smrg# ----------------------------
9363fe5e51b7Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
9364fe5e51b7Smrg# generated from the m4 files accompanying Automake X.Y.
9365fe5e51b7Smrg# (This private macro should not be called outside this file.)
9366fe5e51b7SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
9367643b027fSmrg[am__api_version='1.11'
9368fe5e51b7Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
9369fe5e51b7Smrgdnl require some minimum version.  Point them to the right macro.
9370d7be9c72Smrgm4_if([$1], [1.11.1], [],
9371fe5e51b7Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
9372fe5e51b7Smrg])
9373fe5e51b7Smrg
9374fe5e51b7Smrg# _AM_AUTOCONF_VERSION(VERSION)
9375fe5e51b7Smrg# -----------------------------
9376fe5e51b7Smrg# aclocal traces this macro to find the Autoconf version.
9377fe5e51b7Smrg# This is a private macro too.  Using m4_define simplifies
9378fe5e51b7Smrg# the logic in aclocal, which can simply ignore this definition.
9379fe5e51b7Smrgm4_define([_AM_AUTOCONF_VERSION], [])
9380fe5e51b7Smrg
9381fe5e51b7Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
9382fe5e51b7Smrg# -------------------------------
9383fe5e51b7Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
9384eda3803bSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
9385fe5e51b7SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
9386d7be9c72Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
9387eda3803bSmrgm4_ifndef([AC_AUTOCONF_VERSION],
9388eda3803bSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
9389eda3803bSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
9390fe5e51b7Smrg
9391fe5e51b7Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
9392fe5e51b7Smrg
9393fe5e51b7Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
9394fe5e51b7Smrg#
9395fe5e51b7Smrg# This file is free software; the Free Software Foundation
9396fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
9397fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
9398fe5e51b7Smrg
9399fe5e51b7Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
9400fe5e51b7Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
9401fe5e51b7Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
9402fe5e51b7Smrg#
9403fe5e51b7Smrg# Of course, Automake must honor this variable whenever it calls a
9404fe5e51b7Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
9405fe5e51b7Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
9406fe5e51b7Smrg# depending on how configure is run.  This is pretty annoying, since
9407fe5e51b7Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
9408fe5e51b7Smrg# source directory, any form will work fine, but in subdirectories a
9409fe5e51b7Smrg# relative path needs to be adjusted first.
9410fe5e51b7Smrg#
9411fe5e51b7Smrg# $ac_aux_dir/missing
9412fe5e51b7Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
9413fe5e51b7Smrg# $top_srcdir/$ac_aux_dir/missing
9414fe5e51b7Smrg#    fails if $ac_aux_dir is absolute,
9415fe5e51b7Smrg#    fails when called from a subdirectory in a VPATH build with
9416fe5e51b7Smrg#          a relative $ac_aux_dir
9417fe5e51b7Smrg#
9418fe5e51b7Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
9419fe5e51b7Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
9420fe5e51b7Smrg# harmless because $srcdir is `.', but things will broke when you
9421fe5e51b7Smrg# start a VPATH build or use an absolute $srcdir.
9422fe5e51b7Smrg#
9423fe5e51b7Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
9424fe5e51b7Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
9425fe5e51b7Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
9426fe5e51b7Smrg# and then we would define $MISSING as
9427fe5e51b7Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
9428fe5e51b7Smrg# This will work as long as MISSING is not called from configure, because
9429fe5e51b7Smrg# unfortunately $(top_srcdir) has no meaning in configure.
9430fe5e51b7Smrg# However there are other variables, like CC, which are often used in
9431fe5e51b7Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
9432fe5e51b7Smrg#
9433fe5e51b7Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
9434fe5e51b7Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
9435fe5e51b7Smrg# configured tree to be moved without reconfiguration.
9436fe5e51b7Smrg
9437fe5e51b7SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
9438fe5e51b7Smrg[dnl Rely on autoconf to set up CDPATH properly.
9439fe5e51b7SmrgAC_PREREQ([2.50])dnl
9440fe5e51b7Smrg# expand $ac_aux_dir to an absolute path
9441fe5e51b7Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
9442fe5e51b7Smrg])
9443fe5e51b7Smrg
9444fe5e51b7Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
9445fe5e51b7Smrg
9446643b027fSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
9447fe5e51b7Smrg# Free Software Foundation, Inc.
9448fe5e51b7Smrg#
9449fe5e51b7Smrg# This file is free software; the Free Software Foundation
9450fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
9451fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
9452fe5e51b7Smrg
9453643b027fSmrg# serial 9
9454fe5e51b7Smrg
9455fe5e51b7Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
9456fe5e51b7Smrg# -------------------------------------
9457fe5e51b7Smrg# Define a conditional.
9458fe5e51b7SmrgAC_DEFUN([AM_CONDITIONAL],
9459fe5e51b7Smrg[AC_PREREQ(2.52)dnl
9460fe5e51b7Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
9461fe5e51b7Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
9462fe5e51b7SmrgAC_SUBST([$1_TRUE])dnl
9463fe5e51b7SmrgAC_SUBST([$1_FALSE])dnl
9464fe5e51b7Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
9465fe5e51b7Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
9466643b027fSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
9467fe5e51b7Smrgif $2; then
9468fe5e51b7Smrg  $1_TRUE=
9469fe5e51b7Smrg  $1_FALSE='#'
9470fe5e51b7Smrgelse
9471fe5e51b7Smrg  $1_TRUE='#'
9472fe5e51b7Smrg  $1_FALSE=
9473fe5e51b7Smrgfi
9474fe5e51b7SmrgAC_CONFIG_COMMANDS_PRE(
9475fe5e51b7Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
9476fe5e51b7Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
9477fe5e51b7SmrgUsually this means the macro was only invoked conditionally.]])
9478fe5e51b7Smrgfi])])
9479fe5e51b7Smrg
9480643b027fSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
9481fe5e51b7Smrg# Free Software Foundation, Inc.
9482fe5e51b7Smrg#
9483fe5e51b7Smrg# This file is free software; the Free Software Foundation
9484fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
9485fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
9486fe5e51b7Smrg
9487643b027fSmrg# serial 10
9488fe5e51b7Smrg
9489fe5e51b7Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
9490fe5e51b7Smrg# written in clear, in which case automake, when reading aclocal.m4,
9491fe5e51b7Smrg# will think it sees a *use*, and therefore will trigger all it's
9492fe5e51b7Smrg# C support machinery.  Also note that it means that autoscan, seeing
9493fe5e51b7Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
9494fe5e51b7Smrg
9495fe5e51b7Smrg
9496fe5e51b7Smrg# _AM_DEPENDENCIES(NAME)
9497fe5e51b7Smrg# ----------------------
9498fe5e51b7Smrg# See how the compiler implements dependency checking.
9499fe5e51b7Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
9500fe5e51b7Smrg# We try a few techniques and use that to set a single cache variable.
9501fe5e51b7Smrg#
9502fe5e51b7Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
9503fe5e51b7Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
9504fe5e51b7Smrg# dependency, and given that the user is not expected to run this macro,
9505fe5e51b7Smrg# just rely on AC_PROG_CC.
9506fe5e51b7SmrgAC_DEFUN([_AM_DEPENDENCIES],
9507fe5e51b7Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
9508fe5e51b7SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
9509fe5e51b7SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
9510fe5e51b7SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
9511fe5e51b7Smrg
9512fe5e51b7Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
9513fe5e51b7Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
9514fe5e51b7Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
9515fe5e51b7Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
9516fe5e51b7Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
9517fe5e51b7Smrg                   [depcc="$$1"   am_compiler_list=])
9518fe5e51b7Smrg
9519fe5e51b7SmrgAC_CACHE_CHECK([dependency style of $depcc],
9520fe5e51b7Smrg               [am_cv_$1_dependencies_compiler_type],
9521fe5e51b7Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
9522fe5e51b7Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
9523fe5e51b7Smrg  # making bogus files that we don't know about and never remove.  For
9524fe5e51b7Smrg  # instance it was reported that on HP-UX the gcc test will end up
9525fe5e51b7Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
9526fe5e51b7Smrg  # in D'.
9527fe5e51b7Smrg  mkdir conftest.dir
9528fe5e51b7Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
9529fe5e51b7Smrg  # using a relative directory.
9530fe5e51b7Smrg  cp "$am_depcomp" conftest.dir
9531fe5e51b7Smrg  cd conftest.dir
9532fe5e51b7Smrg  # We will build objects and dependencies in a subdirectory because
9533fe5e51b7Smrg  # it helps to detect inapplicable dependency modes.  For instance
9534fe5e51b7Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
9535fe5e51b7Smrg  # side effect of compilation, but ICC will put the dependencies in
9536fe5e51b7Smrg  # the current directory while Tru64 will put them in the object
9537fe5e51b7Smrg  # directory.
9538fe5e51b7Smrg  mkdir sub
9539fe5e51b7Smrg
9540fe5e51b7Smrg  am_cv_$1_dependencies_compiler_type=none
9541fe5e51b7Smrg  if test "$am_compiler_list" = ""; then
9542fe5e51b7Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
9543fe5e51b7Smrg  fi
9544643b027fSmrg  am__universal=false
9545643b027fSmrg  m4_case([$1], [CC],
9546643b027fSmrg    [case " $depcc " in #(
9547643b027fSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
9548643b027fSmrg     esac],
9549643b027fSmrg    [CXX],
9550643b027fSmrg    [case " $depcc " in #(
9551643b027fSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
9552643b027fSmrg     esac])
9553643b027fSmrg
9554fe5e51b7Smrg  for depmode in $am_compiler_list; do
9555fe5e51b7Smrg    # Setup a source with many dependencies, because some compilers
9556fe5e51b7Smrg    # like to wrap large dependency lists on column 80 (with \), and
9557fe5e51b7Smrg    # we should not choose a depcomp mode which is confused by this.
9558fe5e51b7Smrg    #
9559fe5e51b7Smrg    # We need to recreate these files for each test, as the compiler may
9560fe5e51b7Smrg    # overwrite some of them when testing with obscure command lines.
9561fe5e51b7Smrg    # This happens at least with the AIX C compiler.
9562fe5e51b7Smrg    : > sub/conftest.c
9563fe5e51b7Smrg    for i in 1 2 3 4 5 6; do
9564fe5e51b7Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
9565fe5e51b7Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
9566fe5e51b7Smrg      # Solaris 8's {/usr,}/bin/sh.
9567fe5e51b7Smrg      touch sub/conftst$i.h
9568fe5e51b7Smrg    done
9569fe5e51b7Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
9570fe5e51b7Smrg
9571643b027fSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
9572643b027fSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
9573643b027fSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
9574643b027fSmrg    # versions had trouble with output in subdirs
9575643b027fSmrg    am__obj=sub/conftest.${OBJEXT-o}
9576643b027fSmrg    am__minus_obj="-o $am__obj"
9577fe5e51b7Smrg    case $depmode in
9578643b027fSmrg    gcc)
9579643b027fSmrg      # This depmode causes a compiler race in universal mode.
9580643b027fSmrg      test "$am__universal" = false || continue
9581643b027fSmrg      ;;
9582fe5e51b7Smrg    nosideeffect)
9583fe5e51b7Smrg      # after this tag, mechanisms are not by side-effect, so they'll
9584fe5e51b7Smrg      # only be used when explicitly requested
9585fe5e51b7Smrg      if test "x$enable_dependency_tracking" = xyes; then
9586fe5e51b7Smrg	continue
9587fe5e51b7Smrg      else
9588fe5e51b7Smrg	break
9589fe5e51b7Smrg      fi
9590fe5e51b7Smrg      ;;
9591643b027fSmrg    msvisualcpp | msvcmsys)
9592643b027fSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
9593643b027fSmrg      # not run yet.  These depmodes are late enough in the game, and
9594643b027fSmrg      # so weak that their functioning should not be impacted.
9595643b027fSmrg      am__obj=conftest.${OBJEXT-o}
9596643b027fSmrg      am__minus_obj=
9597643b027fSmrg      ;;
9598fe5e51b7Smrg    none) break ;;
9599fe5e51b7Smrg    esac
9600fe5e51b7Smrg    if depmode=$depmode \
9601643b027fSmrg       source=sub/conftest.c object=$am__obj \
9602fe5e51b7Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
9603643b027fSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
9604fe5e51b7Smrg         >/dev/null 2>conftest.err &&
9605fe5e51b7Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
9606fe5e51b7Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
9607643b027fSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
9608fe5e51b7Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
9609fe5e51b7Smrg      # icc doesn't choke on unknown options, it will just issue warnings
9610fe5e51b7Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
9611fe5e51b7Smrg      # that says an option was ignored or not supported.
9612fe5e51b7Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
9613fe5e51b7Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
9614fe5e51b7Smrg      # The diagnosis changed in icc 8.0:
9615fe5e51b7Smrg      #   icc: Command line remark: option '-MP' not supported
9616fe5e51b7Smrg      if (grep 'ignoring option' conftest.err ||
9617fe5e51b7Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
9618fe5e51b7Smrg        am_cv_$1_dependencies_compiler_type=$depmode
9619fe5e51b7Smrg        break
9620fe5e51b7Smrg      fi
9621fe5e51b7Smrg    fi
9622fe5e51b7Smrg  done
9623fe5e51b7Smrg
9624fe5e51b7Smrg  cd ..
9625fe5e51b7Smrg  rm -rf conftest.dir
9626fe5e51b7Smrgelse
9627fe5e51b7Smrg  am_cv_$1_dependencies_compiler_type=none
9628fe5e51b7Smrgfi
9629fe5e51b7Smrg])
9630fe5e51b7SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
9631fe5e51b7SmrgAM_CONDITIONAL([am__fastdep$1], [
9632fe5e51b7Smrg  test "x$enable_dependency_tracking" != xno \
9633fe5e51b7Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
9634fe5e51b7Smrg])
9635fe5e51b7Smrg
9636fe5e51b7Smrg
9637fe5e51b7Smrg# AM_SET_DEPDIR
9638fe5e51b7Smrg# -------------
9639fe5e51b7Smrg# Choose a directory name for dependency files.
9640fe5e51b7Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
9641fe5e51b7SmrgAC_DEFUN([AM_SET_DEPDIR],
9642fe5e51b7Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
9643fe5e51b7SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
9644fe5e51b7Smrg])
9645fe5e51b7Smrg
9646fe5e51b7Smrg
9647fe5e51b7Smrg# AM_DEP_TRACK
9648fe5e51b7Smrg# ------------
9649fe5e51b7SmrgAC_DEFUN([AM_DEP_TRACK],
9650fe5e51b7Smrg[AC_ARG_ENABLE(dependency-tracking,
9651fe5e51b7Smrg[  --disable-dependency-tracking  speeds up one-time build
9652fe5e51b7Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
9653fe5e51b7Smrgif test "x$enable_dependency_tracking" != xno; then
9654fe5e51b7Smrg  am_depcomp="$ac_aux_dir/depcomp"
9655fe5e51b7Smrg  AMDEPBACKSLASH='\'
9656fe5e51b7Smrgfi
9657fe5e51b7SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
9658fe5e51b7SmrgAC_SUBST([AMDEPBACKSLASH])dnl
9659fe5e51b7Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
9660fe5e51b7Smrg])
9661fe5e51b7Smrg
9662fe5e51b7Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
9663fe5e51b7Smrg
9664eda3803bSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
9665fe5e51b7Smrg# Free Software Foundation, Inc.
9666fe5e51b7Smrg#
9667fe5e51b7Smrg# This file is free software; the Free Software Foundation
9668fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
9669fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
9670fe5e51b7Smrg
9671643b027fSmrg#serial 5
9672fe5e51b7Smrg
9673fe5e51b7Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
9674fe5e51b7Smrg# ------------------------------
9675fe5e51b7SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
9676643b027fSmrg[{
9677643b027fSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
9678643b027fSmrg  # are listed without --file.  Let's play safe and only enable the eval
9679643b027fSmrg  # if we detect the quoting.
9680643b027fSmrg  case $CONFIG_FILES in
9681643b027fSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
9682643b027fSmrg  *)   set x $CONFIG_FILES ;;
9683643b027fSmrg  esac
9684643b027fSmrg  shift
9685643b027fSmrg  for mf
9686643b027fSmrg  do
9687643b027fSmrg    # Strip MF so we end up with the name of the file.
9688643b027fSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
9689643b027fSmrg    # Check whether this is an Automake generated Makefile or not.
9690643b027fSmrg    # We used to match only the files named `Makefile.in', but
9691643b027fSmrg    # some people rename them; so instead we look at the file content.
9692643b027fSmrg    # Grep'ing the first line is not enough: some people post-process
9693643b027fSmrg    # each Makefile.in and add a new line on top of each file to say so.
9694643b027fSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
9695643b027fSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
9696643b027fSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
9697643b027fSmrg      dirpart=`AS_DIRNAME("$mf")`
9698643b027fSmrg    else
9699643b027fSmrg      continue
9700643b027fSmrg    fi
9701643b027fSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
9702643b027fSmrg    # from the Makefile without running `make'.
9703643b027fSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
9704643b027fSmrg    test -z "$DEPDIR" && continue
9705643b027fSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
9706643b027fSmrg    test -z "am__include" && continue
9707643b027fSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
9708643b027fSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
9709643b027fSmrg    U=`sed -n 's/^U = //p' < "$mf"`
9710643b027fSmrg    # Find all dependency output files, they are included files with
9711643b027fSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
9712643b027fSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
9713643b027fSmrg    # expansion.
9714643b027fSmrg    for file in `sed -n "
9715643b027fSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
9716643b027fSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
9717643b027fSmrg      # Make sure the directory exists.
9718643b027fSmrg      test -f "$dirpart/$file" && continue
9719643b027fSmrg      fdir=`AS_DIRNAME(["$file"])`
9720643b027fSmrg      AS_MKDIR_P([$dirpart/$fdir])
9721643b027fSmrg      # echo "creating $dirpart/$file"
9722643b027fSmrg      echo '# dummy' > "$dirpart/$file"
9723643b027fSmrg    done
9724fe5e51b7Smrg  done
9725643b027fSmrg}
9726fe5e51b7Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
9727fe5e51b7Smrg
9728fe5e51b7Smrg
9729fe5e51b7Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
9730fe5e51b7Smrg# -----------------------------
9731fe5e51b7Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
9732fe5e51b7Smrg#
9733fe5e51b7Smrg# This code is only required when automatic dependency tracking
9734fe5e51b7Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
9735fe5e51b7Smrg# need in order to bootstrap the dependency handling code.
9736fe5e51b7SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
9737fe5e51b7Smrg[AC_CONFIG_COMMANDS([depfiles],
9738fe5e51b7Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
9739fe5e51b7Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
9740fe5e51b7Smrg])
9741fe5e51b7Smrg
9742fe5e51b7Smrg# Do all the work for Automake.                             -*- Autoconf -*-
9743fe5e51b7Smrg
9744fe5e51b7Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
9745643b027fSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
9746fe5e51b7Smrg#
9747fe5e51b7Smrg# This file is free software; the Free Software Foundation
9748fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
9749fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
9750fe5e51b7Smrg
9751643b027fSmrg# serial 16
9752fe5e51b7Smrg
9753fe5e51b7Smrg# This macro actually does too much.  Some checks are only needed if
9754fe5e51b7Smrg# your package does certain things.  But this isn't really a big deal.
9755fe5e51b7Smrg
9756fe5e51b7Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
9757fe5e51b7Smrg# AM_INIT_AUTOMAKE([OPTIONS])
9758fe5e51b7Smrg# -----------------------------------------------
9759fe5e51b7Smrg# The call with PACKAGE and VERSION arguments is the old style
9760fe5e51b7Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
9761fe5e51b7Smrg# and VERSION should now be passed to AC_INIT and removed from
9762fe5e51b7Smrg# the call to AM_INIT_AUTOMAKE.
9763fe5e51b7Smrg# We support both call styles for the transition.  After
9764fe5e51b7Smrg# the next Automake release, Autoconf can make the AC_INIT
9765fe5e51b7Smrg# arguments mandatory, and then we can depend on a new Autoconf
9766fe5e51b7Smrg# release and drop the old call support.
9767fe5e51b7SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
9768643b027fSmrg[AC_PREREQ([2.62])dnl
9769fe5e51b7Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
9770fe5e51b7Smrgdnl the ones we care about.
9771fe5e51b7Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
9772fe5e51b7SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
9773fe5e51b7SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
9774fe5e51b7Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
9775fe5e51b7Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
9776fe5e51b7Smrg  # is not polluted with repeated "-I."
9777fe5e51b7Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
9778fe5e51b7Smrg  # test to see if srcdir already configured
9779fe5e51b7Smrg  if test -f $srcdir/config.status; then
9780fe5e51b7Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
9781fe5e51b7Smrg  fi
9782fe5e51b7Smrgfi
9783fe5e51b7Smrg
9784fe5e51b7Smrg# test whether we have cygpath
9785fe5e51b7Smrgif test -z "$CYGPATH_W"; then
9786fe5e51b7Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
9787fe5e51b7Smrg    CYGPATH_W='cygpath -w'
9788fe5e51b7Smrg  else
9789fe5e51b7Smrg    CYGPATH_W=echo
9790fe5e51b7Smrg  fi
9791fe5e51b7Smrgfi
9792fe5e51b7SmrgAC_SUBST([CYGPATH_W])
9793fe5e51b7Smrg
9794fe5e51b7Smrg# Define the identity of the package.
9795fe5e51b7Smrgdnl Distinguish between old-style and new-style calls.
9796fe5e51b7Smrgm4_ifval([$2],
9797fe5e51b7Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
9798fe5e51b7Smrg AC_SUBST([PACKAGE], [$1])dnl
9799fe5e51b7Smrg AC_SUBST([VERSION], [$2])],
9800fe5e51b7Smrg[_AM_SET_OPTIONS([$1])dnl
9801fe5e51b7Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
9802fe5e51b7Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
9803fe5e51b7Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
9804fe5e51b7Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
9805fe5e51b7Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
9806fe5e51b7Smrg
9807fe5e51b7Smrg_AM_IF_OPTION([no-define],,
9808fe5e51b7Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
9809fe5e51b7Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
9810fe5e51b7Smrg
9811fe5e51b7Smrg# Some tools Automake needs.
9812fe5e51b7SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
9813fe5e51b7SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
9814fe5e51b7SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
9815fe5e51b7SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
9816fe5e51b7SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
9817fe5e51b7SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
9818fe5e51b7SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
9819643b027fSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
9820643b027fSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
9821fe5e51b7SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
9822fe5e51b7Smrg# We need awk for the "check" target.  The system "awk" is bad on
9823fe5e51b7Smrg# some platforms.
9824fe5e51b7SmrgAC_REQUIRE([AC_PROG_AWK])dnl
9825fe5e51b7SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
9826fe5e51b7SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
9827fe5e51b7Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
9828643b027fSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
9829643b027fSmrg			     [_AM_PROG_TAR([v7])])])
9830fe5e51b7Smrg_AM_IF_OPTION([no-dependencies],,
9831fe5e51b7Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
9832643b027fSmrg		  [_AM_DEPENDENCIES(CC)],
9833643b027fSmrg		  [define([AC_PROG_CC],
9834643b027fSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
9835fe5e51b7SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
9836643b027fSmrg		  [_AM_DEPENDENCIES(CXX)],
9837643b027fSmrg		  [define([AC_PROG_CXX],
9838643b027fSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
9839fe5e51b7SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
9840643b027fSmrg		  [_AM_DEPENDENCIES(OBJC)],
9841643b027fSmrg		  [define([AC_PROG_OBJC],
9842643b027fSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
9843fe5e51b7Smrg])
9844643b027fSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
9845643b027fSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
9846643b027fSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
9847643b027fSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
9848643b027fSmrgAC_CONFIG_COMMANDS_PRE(dnl
9849643b027fSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
9850643b027fSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
9851fe5e51b7Smrg])
9852fe5e51b7Smrg
9853643b027fSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
9854643b027fSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
9855643b027fSmrgdnl mangled by Autoconf and run in a shell conditional statement.
9856643b027fSmrgm4_define([_AC_COMPILER_EXEEXT],
9857643b027fSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
9858643b027fSmrg
9859fe5e51b7Smrg
9860fe5e51b7Smrg# When config.status generates a header, we must update the stamp-h file.
9861fe5e51b7Smrg# This file resides in the same directory as the config header
9862fe5e51b7Smrg# that is generated.  The stamp files are numbered to have different names.
9863fe5e51b7Smrg
9864fe5e51b7Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
9865fe5e51b7Smrg# loop where config.status creates the headers, so we can generate
9866fe5e51b7Smrg# our stamp files there.
9867fe5e51b7SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
9868fe5e51b7Smrg[# Compute $1's index in $config_headers.
9869eda3803bSmrg_am_arg=$1
9870fe5e51b7Smrg_am_stamp_count=1
9871fe5e51b7Smrgfor _am_header in $config_headers :; do
9872fe5e51b7Smrg  case $_am_header in
9873eda3803bSmrg    $_am_arg | $_am_arg:* )
9874fe5e51b7Smrg      break ;;
9875fe5e51b7Smrg    * )
9876fe5e51b7Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
9877fe5e51b7Smrg  esac
9878fe5e51b7Smrgdone
9879eda3803bSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
9880fe5e51b7Smrg
9881643b027fSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
9882fe5e51b7Smrg#
9883fe5e51b7Smrg# This file is free software; the Free Software Foundation
9884fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
9885fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
9886fe5e51b7Smrg
9887fe5e51b7Smrg# AM_PROG_INSTALL_SH
9888fe5e51b7Smrg# ------------------
9889fe5e51b7Smrg# Define $install_sh.
9890fe5e51b7SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
9891fe5e51b7Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
9892643b027fSmrgif test x"${install_sh}" != xset; then
9893643b027fSmrg  case $am_aux_dir in
9894643b027fSmrg  *\ * | *\	*)
9895643b027fSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
9896643b027fSmrg  *)
9897643b027fSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
9898643b027fSmrg  esac
9899643b027fSmrgfi
9900fe5e51b7SmrgAC_SUBST(install_sh)])
9901fe5e51b7Smrg
9902fe5e51b7Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
9903fe5e51b7Smrg#
9904fe5e51b7Smrg# This file is free software; the Free Software Foundation
9905fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
9906fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
9907fe5e51b7Smrg
9908fe5e51b7Smrg# serial 2
9909fe5e51b7Smrg
9910fe5e51b7Smrg# Check whether the underlying file-system supports filenames
9911fe5e51b7Smrg# with a leading dot.  For instance MS-DOS doesn't.
9912fe5e51b7SmrgAC_DEFUN([AM_SET_LEADING_DOT],
9913fe5e51b7Smrg[rm -rf .tst 2>/dev/null
9914fe5e51b7Smrgmkdir .tst 2>/dev/null
9915fe5e51b7Smrgif test -d .tst; then
9916fe5e51b7Smrg  am__leading_dot=.
9917fe5e51b7Smrgelse
9918fe5e51b7Smrg  am__leading_dot=_
9919fe5e51b7Smrgfi
9920fe5e51b7Smrgrmdir .tst 2>/dev/null
9921fe5e51b7SmrgAC_SUBST([am__leading_dot])])
9922fe5e51b7Smrg
9923fe5e51b7Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
9924fe5e51b7Smrg# From Jim Meyering
9925fe5e51b7Smrg
9926643b027fSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
9927fe5e51b7Smrg# Free Software Foundation, Inc.
9928fe5e51b7Smrg#
9929fe5e51b7Smrg# This file is free software; the Free Software Foundation
9930fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
9931fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
9932fe5e51b7Smrg
9933643b027fSmrg# serial 5
9934fe5e51b7Smrg
9935643b027fSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
9936643b027fSmrg# ----------------------------------
9937643b027fSmrg# Control maintainer-specific portions of Makefiles.
9938643b027fSmrg# Default is to disable them, unless `enable' is passed literally.
9939643b027fSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
9940643b027fSmrg# can override the default with the --enable/--disable switch.
9941fe5e51b7SmrgAC_DEFUN([AM_MAINTAINER_MODE],
9942643b027fSmrg[m4_case(m4_default([$1], [disable]),
9943643b027fSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
9944643b027fSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
9945643b027fSmrg       [m4_define([am_maintainer_other], [enable])
9946643b027fSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
9947643b027fSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
9948643b027fSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
9949643b027fSmrg  AC_ARG_ENABLE([maintainer-mode],
9950643b027fSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
9951fe5e51b7Smrg			  (and sometimes confusing) to the casual installer],
9952643b027fSmrg      [USE_MAINTAINER_MODE=$enableval],
9953643b027fSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
9954fe5e51b7Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
9955643b027fSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
9956fe5e51b7Smrg  MAINT=$MAINTAINER_MODE_TRUE
9957643b027fSmrg  AC_SUBST([MAINT])dnl
9958fe5e51b7Smrg]
9959fe5e51b7Smrg)
9960fe5e51b7Smrg
9961fe5e51b7SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
9962fe5e51b7Smrg
9963fe5e51b7Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
9964fe5e51b7Smrg
9965643b027fSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
9966fe5e51b7Smrg#
9967fe5e51b7Smrg# This file is free software; the Free Software Foundation
9968fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
9969fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
9970fe5e51b7Smrg
9971643b027fSmrg# serial 4
9972fe5e51b7Smrg
9973fe5e51b7Smrg# AM_MAKE_INCLUDE()
9974fe5e51b7Smrg# -----------------
9975fe5e51b7Smrg# Check to see how make treats includes.
9976fe5e51b7SmrgAC_DEFUN([AM_MAKE_INCLUDE],
9977fe5e51b7Smrg[am_make=${MAKE-make}
9978fe5e51b7Smrgcat > confinc << 'END'
9979fe5e51b7Smrgam__doit:
9980643b027fSmrg	@echo this is the am__doit target
9981fe5e51b7Smrg.PHONY: am__doit
9982fe5e51b7SmrgEND
9983fe5e51b7Smrg# If we don't find an include directive, just comment out the code.
9984fe5e51b7SmrgAC_MSG_CHECKING([for style of include used by $am_make])
9985fe5e51b7Smrgam__include="#"
9986fe5e51b7Smrgam__quote=
9987fe5e51b7Smrg_am_result=none
9988fe5e51b7Smrg# First try GNU make style include.
9989fe5e51b7Smrgecho "include confinc" > confmf
9990643b027fSmrg# Ignore all kinds of additional output from `make'.
9991643b027fSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
9992643b027fSmrg*the\ am__doit\ target*)
9993643b027fSmrg  am__include=include
9994643b027fSmrg  am__quote=
9995643b027fSmrg  _am_result=GNU
9996643b027fSmrg  ;;
9997643b027fSmrgesac
9998fe5e51b7Smrg# Now try BSD make style include.
9999fe5e51b7Smrgif test "$am__include" = "#"; then
10000fe5e51b7Smrg   echo '.include "confinc"' > confmf
10001643b027fSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
10002643b027fSmrg   *the\ am__doit\ target*)
10003643b027fSmrg     am__include=.include
10004643b027fSmrg     am__quote="\""
10005643b027fSmrg     _am_result=BSD
10006643b027fSmrg     ;;
10007643b027fSmrg   esac
10008fe5e51b7Smrgfi
10009fe5e51b7SmrgAC_SUBST([am__include])
10010fe5e51b7SmrgAC_SUBST([am__quote])
10011fe5e51b7SmrgAC_MSG_RESULT([$_am_result])
10012fe5e51b7Smrgrm -f confinc confmf
10013fe5e51b7Smrg])
10014fe5e51b7Smrg
10015fe5e51b7Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
10016fe5e51b7Smrg
10017643b027fSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
10018fe5e51b7Smrg# Free Software Foundation, Inc.
10019fe5e51b7Smrg#
10020fe5e51b7Smrg# This file is free software; the Free Software Foundation
10021fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
10022fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
10023fe5e51b7Smrg
10024643b027fSmrg# serial 6
10025fe5e51b7Smrg
10026fe5e51b7Smrg# AM_MISSING_PROG(NAME, PROGRAM)
10027fe5e51b7Smrg# ------------------------------
10028fe5e51b7SmrgAC_DEFUN([AM_MISSING_PROG],
10029fe5e51b7Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
10030fe5e51b7Smrg$1=${$1-"${am_missing_run}$2"}
10031fe5e51b7SmrgAC_SUBST($1)])
10032fe5e51b7Smrg
10033fe5e51b7Smrg
10034fe5e51b7Smrg# AM_MISSING_HAS_RUN
10035fe5e51b7Smrg# ------------------
10036fe5e51b7Smrg# Define MISSING if not defined so far and test if it supports --run.
10037fe5e51b7Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
10038fe5e51b7SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
10039fe5e51b7Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
10040fe5e51b7SmrgAC_REQUIRE_AUX_FILE([missing])dnl
10041643b027fSmrgif test x"${MISSING+set}" != xset; then
10042643b027fSmrg  case $am_aux_dir in
10043643b027fSmrg  *\ * | *\	*)
10044643b027fSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
10045643b027fSmrg  *)
10046643b027fSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
10047643b027fSmrg  esac
10048643b027fSmrgfi
10049fe5e51b7Smrg# Use eval to expand $SHELL
10050fe5e51b7Smrgif eval "$MISSING --run true"; then
10051fe5e51b7Smrg  am_missing_run="$MISSING --run "
10052fe5e51b7Smrgelse
10053fe5e51b7Smrg  am_missing_run=
10054fe5e51b7Smrg  AC_MSG_WARN([`missing' script is too old or missing])
10055fe5e51b7Smrgfi
10056fe5e51b7Smrg])
10057fe5e51b7Smrg
10058fe5e51b7Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
10059fe5e51b7Smrg#
10060fe5e51b7Smrg# This file is free software; the Free Software Foundation
10061fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
10062fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
10063fe5e51b7Smrg
10064fe5e51b7Smrg# AM_PROG_MKDIR_P
10065fe5e51b7Smrg# ---------------
10066fe5e51b7Smrg# Check for `mkdir -p'.
10067fe5e51b7SmrgAC_DEFUN([AM_PROG_MKDIR_P],
10068fe5e51b7Smrg[AC_PREREQ([2.60])dnl
10069fe5e51b7SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
10070fe5e51b7Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
10071fe5e51b7Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
10072fe5e51b7Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
10073fe5e51b7Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
10074fe5e51b7Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
10075fe5e51b7Smrgdnl adjustment using top_builddir (which is defined more often than
10076fe5e51b7Smrgdnl MKDIR_P).
10077fe5e51b7SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
10078fe5e51b7Smrgcase $mkdir_p in
10079fe5e51b7Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
10080fe5e51b7Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
10081fe5e51b7Smrgesac
10082fe5e51b7Smrg])
10083fe5e51b7Smrg
10084fe5e51b7Smrg# Helper functions for option handling.                     -*- Autoconf -*-
10085fe5e51b7Smrg
10086eda3803bSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
10087fe5e51b7Smrg#
10088fe5e51b7Smrg# This file is free software; the Free Software Foundation
10089fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
10090fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
10091fe5e51b7Smrg
10092eda3803bSmrg# serial 4
10093fe5e51b7Smrg
10094fe5e51b7Smrg# _AM_MANGLE_OPTION(NAME)
10095fe5e51b7Smrg# -----------------------
10096fe5e51b7SmrgAC_DEFUN([_AM_MANGLE_OPTION],
10097fe5e51b7Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
10098fe5e51b7Smrg
10099fe5e51b7Smrg# _AM_SET_OPTION(NAME)
10100fe5e51b7Smrg# ------------------------------
10101fe5e51b7Smrg# Set option NAME.  Presently that only means defining a flag for this option.
10102fe5e51b7SmrgAC_DEFUN([_AM_SET_OPTION],
10103fe5e51b7Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
10104fe5e51b7Smrg
10105fe5e51b7Smrg# _AM_SET_OPTIONS(OPTIONS)
10106fe5e51b7Smrg# ----------------------------------
10107fe5e51b7Smrg# OPTIONS is a space-separated list of Automake options.
10108fe5e51b7SmrgAC_DEFUN([_AM_SET_OPTIONS],
10109eda3803bSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
10110fe5e51b7Smrg
10111fe5e51b7Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
10112fe5e51b7Smrg# -------------------------------------------
10113fe5e51b7Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
10114fe5e51b7SmrgAC_DEFUN([_AM_IF_OPTION],
10115fe5e51b7Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
10116fe5e51b7Smrg
10117fe5e51b7Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
10118fe5e51b7Smrg
10119643b027fSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
10120fe5e51b7Smrg# Free Software Foundation, Inc.
10121fe5e51b7Smrg#
10122fe5e51b7Smrg# This file is free software; the Free Software Foundation
10123fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
10124fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
10125fe5e51b7Smrg
10126643b027fSmrg# serial 5
10127fe5e51b7Smrg
10128fe5e51b7Smrg# AM_SANITY_CHECK
10129fe5e51b7Smrg# ---------------
10130fe5e51b7SmrgAC_DEFUN([AM_SANITY_CHECK],
10131fe5e51b7Smrg[AC_MSG_CHECKING([whether build environment is sane])
10132fe5e51b7Smrg# Just in case
10133fe5e51b7Smrgsleep 1
10134fe5e51b7Smrgecho timestamp > conftest.file
10135643b027fSmrg# Reject unsafe characters in $srcdir or the absolute working directory
10136643b027fSmrg# name.  Accept space and tab only in the latter.
10137643b027fSmrgam_lf='
10138643b027fSmrg'
10139643b027fSmrgcase `pwd` in
10140643b027fSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
10141643b027fSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
10142643b027fSmrgesac
10143643b027fSmrgcase $srcdir in
10144643b027fSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
10145643b027fSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
10146643b027fSmrgesac
10147643b027fSmrg
10148fe5e51b7Smrg# Do `set' in a subshell so we don't clobber the current shell's
10149fe5e51b7Smrg# arguments.  Must try -L first in case configure is actually a
10150fe5e51b7Smrg# symlink; some systems play weird games with the mod time of symlinks
10151fe5e51b7Smrg# (eg FreeBSD returns the mod time of the symlink's containing
10152fe5e51b7Smrg# directory).
10153fe5e51b7Smrgif (
10154643b027fSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
10155fe5e51b7Smrg   if test "$[*]" = "X"; then
10156fe5e51b7Smrg      # -L didn't work.
10157643b027fSmrg      set X `ls -t "$srcdir/configure" conftest.file`
10158fe5e51b7Smrg   fi
10159fe5e51b7Smrg   rm -f conftest.file
10160fe5e51b7Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
10161fe5e51b7Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
10162fe5e51b7Smrg
10163fe5e51b7Smrg      # If neither matched, then we have a broken ls.  This can happen
10164fe5e51b7Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
10165fe5e51b7Smrg      # broken ls alias from the environment.  This has actually
10166fe5e51b7Smrg      # happened.  Such a system could not be considered "sane".
10167fe5e51b7Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
10168fe5e51b7Smrgalias in your environment])
10169fe5e51b7Smrg   fi
10170fe5e51b7Smrg
10171fe5e51b7Smrg   test "$[2]" = conftest.file
10172fe5e51b7Smrg   )
10173fe5e51b7Smrgthen
10174fe5e51b7Smrg   # Ok.
10175fe5e51b7Smrg   :
10176fe5e51b7Smrgelse
10177fe5e51b7Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
10178fe5e51b7SmrgCheck your system clock])
10179fe5e51b7Smrgfi
10180fe5e51b7SmrgAC_MSG_RESULT(yes)])
10181fe5e51b7Smrg
10182a31a186aSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
10183a31a186aSmrg#
10184a31a186aSmrg# This file is free software; the Free Software Foundation
10185a31a186aSmrg# gives unlimited permission to copy and/or distribute it,
10186a31a186aSmrg# with or without modifications, as long as this notice is preserved.
10187a31a186aSmrg
10188a31a186aSmrg# serial 1
10189a31a186aSmrg
10190a31a186aSmrg# AM_SILENT_RULES([DEFAULT])
10191a31a186aSmrg# --------------------------
10192a31a186aSmrg# Enable less verbose build rules; with the default set to DEFAULT
10193a31a186aSmrg# (`yes' being less verbose, `no' or empty being verbose).
10194a31a186aSmrgAC_DEFUN([AM_SILENT_RULES],
10195a31a186aSmrg[AC_ARG_ENABLE([silent-rules],
10196a31a186aSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
10197a31a186aSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
10198a31a186aSmrgcase $enable_silent_rules in
10199a31a186aSmrgyes) AM_DEFAULT_VERBOSITY=0;;
10200a31a186aSmrgno)  AM_DEFAULT_VERBOSITY=1;;
10201a31a186aSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
10202a31a186aSmrgesac
10203a31a186aSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
10204a31a186aSmrgAM_BACKSLASH='\'
10205a31a186aSmrgAC_SUBST([AM_BACKSLASH])dnl
10206a31a186aSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
10207a31a186aSmrg])
10208a31a186aSmrg
10209fe5e51b7Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
10210fe5e51b7Smrg#
10211fe5e51b7Smrg# This file is free software; the Free Software Foundation
10212fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
10213fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
10214fe5e51b7Smrg
10215fe5e51b7Smrg# AM_PROG_INSTALL_STRIP
10216fe5e51b7Smrg# ---------------------
10217fe5e51b7Smrg# One issue with vendor `install' (even GNU) is that you can't
10218fe5e51b7Smrg# specify the program used to strip binaries.  This is especially
10219fe5e51b7Smrg# annoying in cross-compiling environments, where the build's strip
10220fe5e51b7Smrg# is unlikely to handle the host's binaries.
10221fe5e51b7Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
10222fe5e51b7Smrg# always use install-sh in `make install-strip', and initialize
10223fe5e51b7Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
10224fe5e51b7SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
10225fe5e51b7Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
10226fe5e51b7Smrg# Installed binaries are usually stripped using `strip' when the user
10227fe5e51b7Smrg# run `make install-strip'.  However `strip' might not be the right
10228fe5e51b7Smrg# tool to use in cross-compilation environments, therefore Automake
10229fe5e51b7Smrg# will honor the `STRIP' environment variable to overrule this program.
10230fe5e51b7Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
10231fe5e51b7Smrgif test "$cross_compiling" != no; then
10232fe5e51b7Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
10233fe5e51b7Smrgfi
10234fe5e51b7SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
10235fe5e51b7SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
10236fe5e51b7Smrg
10237643b027fSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
10238fe5e51b7Smrg#
10239fe5e51b7Smrg# This file is free software; the Free Software Foundation
10240fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
10241fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
10242fe5e51b7Smrg
10243643b027fSmrg# serial 2
10244643b027fSmrg
10245fe5e51b7Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
10246fe5e51b7Smrg# ---------------------------
10247eda3803bSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
10248fe5e51b7Smrg# This macro is traced by Automake.
10249fe5e51b7SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
10250fe5e51b7Smrg
10251643b027fSmrg# AM_SUBST_NOTMAKE(VARIABLE)
10252643b027fSmrg# ---------------------------
10253643b027fSmrg# Public sister of _AM_SUBST_NOTMAKE.
10254643b027fSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
10255643b027fSmrg
10256fe5e51b7Smrg# Check how to create a tarball.                            -*- Autoconf -*-
10257fe5e51b7Smrg
10258fe5e51b7Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
10259fe5e51b7Smrg#
10260fe5e51b7Smrg# This file is free software; the Free Software Foundation
10261fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
10262fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
10263fe5e51b7Smrg
10264fe5e51b7Smrg# serial 2
10265fe5e51b7Smrg
10266fe5e51b7Smrg# _AM_PROG_TAR(FORMAT)
10267fe5e51b7Smrg# --------------------
10268fe5e51b7Smrg# Check how to create a tarball in format FORMAT.
10269fe5e51b7Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
10270fe5e51b7Smrg#
10271fe5e51b7Smrg# Substitute a variable $(am__tar) that is a command
10272fe5e51b7Smrg# writing to stdout a FORMAT-tarball containing the directory
10273fe5e51b7Smrg# $tardir.
10274fe5e51b7Smrg#     tardir=directory && $(am__tar) > result.tar
10275fe5e51b7Smrg#
10276fe5e51b7Smrg# Substitute a variable $(am__untar) that extract such
10277fe5e51b7Smrg# a tarball read from stdin.
10278fe5e51b7Smrg#     $(am__untar) < result.tar
10279fe5e51b7SmrgAC_DEFUN([_AM_PROG_TAR],
10280fe5e51b7Smrg[# Always define AMTAR for backward compatibility.
10281fe5e51b7SmrgAM_MISSING_PROG([AMTAR], [tar])
10282fe5e51b7Smrgm4_if([$1], [v7],
10283fe5e51b7Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
10284fe5e51b7Smrg     [m4_case([$1], [ustar],, [pax],,
10285fe5e51b7Smrg              [m4_fatal([Unknown tar format])])
10286fe5e51b7SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
10287fe5e51b7Smrg# Loop over all known methods to create a tar archive until one works.
10288fe5e51b7Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
10289fe5e51b7Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
10290fe5e51b7Smrg# Do not fold the above two line into one, because Tru64 sh and
10291fe5e51b7Smrg# Solaris sh will not grok spaces in the rhs of `-'.
10292fe5e51b7Smrgfor _am_tool in $_am_tools
10293fe5e51b7Smrgdo
10294fe5e51b7Smrg  case $_am_tool in
10295fe5e51b7Smrg  gnutar)
10296fe5e51b7Smrg    for _am_tar in tar gnutar gtar;
10297fe5e51b7Smrg    do
10298fe5e51b7Smrg      AM_RUN_LOG([$_am_tar --version]) && break
10299fe5e51b7Smrg    done
10300fe5e51b7Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
10301fe5e51b7Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
10302fe5e51b7Smrg    am__untar="$_am_tar -xf -"
10303fe5e51b7Smrg    ;;
10304fe5e51b7Smrg  plaintar)
10305fe5e51b7Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
10306fe5e51b7Smrg    # ustar tarball either.
10307fe5e51b7Smrg    (tar --version) >/dev/null 2>&1 && continue
10308fe5e51b7Smrg    am__tar='tar chf - "$$tardir"'
10309fe5e51b7Smrg    am__tar_='tar chf - "$tardir"'
10310fe5e51b7Smrg    am__untar='tar xf -'
10311fe5e51b7Smrg    ;;
10312fe5e51b7Smrg  pax)
10313fe5e51b7Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
10314fe5e51b7Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
10315fe5e51b7Smrg    am__untar='pax -r'
10316fe5e51b7Smrg    ;;
10317fe5e51b7Smrg  cpio)
10318fe5e51b7Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
10319fe5e51b7Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
10320fe5e51b7Smrg    am__untar='cpio -i -H $1 -d'
10321fe5e51b7Smrg    ;;
10322fe5e51b7Smrg  none)
10323fe5e51b7Smrg    am__tar=false
10324fe5e51b7Smrg    am__tar_=false
10325fe5e51b7Smrg    am__untar=false
10326fe5e51b7Smrg    ;;
10327fe5e51b7Smrg  esac
10328fe5e51b7Smrg
10329fe5e51b7Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
10330fe5e51b7Smrg  # and am__untar set.
10331fe5e51b7Smrg  test -n "${am_cv_prog_tar_$1}" && break
10332fe5e51b7Smrg
10333fe5e51b7Smrg  # tar/untar a dummy directory, and stop if the command works
10334fe5e51b7Smrg  rm -rf conftest.dir
10335fe5e51b7Smrg  mkdir conftest.dir
10336fe5e51b7Smrg  echo GrepMe > conftest.dir/file
10337fe5e51b7Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
10338fe5e51b7Smrg  rm -rf conftest.dir
10339fe5e51b7Smrg  if test -s conftest.tar; then
10340fe5e51b7Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
10341fe5e51b7Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
10342fe5e51b7Smrg  fi
10343fe5e51b7Smrgdone
10344fe5e51b7Smrgrm -rf conftest.dir
10345fe5e51b7Smrg
10346fe5e51b7SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
10347fe5e51b7SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
10348fe5e51b7SmrgAC_SUBST([am__tar])
10349fe5e51b7SmrgAC_SUBST([am__untar])
10350fe5e51b7Smrg]) # _AM_PROG_TAR
10351fe5e51b7Smrg
10352